/* 타운홈 — the Town home's front end (REQ-197 messages 17–19). maru.css is LANDING's src/shared/site.css at the same pin;
   these tokens map onto its --maru-* values for light and add a dark set. Copy lives in content.ko.json, never here. */
:root{--th-bg:var(--maru-bg,#fcfbf8);--th-surface:#fff;--th-ink:var(--maru-ink,#171626);--th-muted:var(--maru-muted,#5c5c68);--th-line:var(--maru-line,#e7e5e1);
  --th-primary:var(--maru-primary,#5b50e0);--th-primary-ink:#fff;--th-soft:var(--maru-soft,#eeecfc);--th-focus:var(--maru-warm,#e08a5a);--th-radius:14px;
  --th-ok:#2f7a55;--th-ok-soft:#e5f3ec;--th-wait:#8a5a1c;--th-wait-soft:#fbefdf;color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--th-bg:#14131c;--th-surface:#1d1c28;--th-ink:#efedf7;--th-muted:#aaa6bb;--th-line:#2f2d3f;
  --th-primary:#a39bff;--th-primary-ink:#14131c;--th-soft:#262341;--th-ok:#7fd1a4;--th-ok-soft:#18301f;--th-wait:#f0bf7c;--th-wait-soft:#332513;color-scheme:dark}}
:root[data-theme="dark"]{--th-bg:#14131c;--th-surface:#1d1c28;--th-ink:#efedf7;--th-muted:#aaa6bb;--th-line:#2f2d3f;
  --th-primary:#a39bff;--th-primary-ink:#14131c;--th-soft:#262341;--th-ok:#7fd1a4;--th-ok-soft:#18301f;--th-wait:#f0bf7c;--th-wait-soft:#332513;color-scheme:dark}

.th{margin:0;background:var(--th-bg);color:var(--th-ink);font:15px/1.7 'Pretendard',system-ui,-apple-system,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}
.th *{box-sizing:border-box}
.th h1,.th h2,.th h3,.th p{word-break:keep-all;overflow-wrap:break-word;margin:0}
.th a{color:var(--th-primary);text-underline-offset:4px}
.th :focus-visible{outline:3px solid var(--th-focus);outline-offset:3px;border-radius:6px}
.th-skip{position:fixed;top:-100px;left:16px;z-index:50;padding:10px 16px;background:var(--th-surface);border:2px solid var(--th-primary);border-radius:10px}
.th-skip:focus{top:10px}

/* Header */
.th-header{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--th-bg) 94%,transparent);backdrop-filter:blur(12px);border-bottom:1px solid var(--th-line)}
.th-header-inner{max-width:1120px;margin:auto;height:64px;padding:0 max(16px,env(safe-area-inset-left,0px));display:flex;align-items:center;gap:16px}
.th-brand{display:flex;align-items:center;gap:10px;min-width:0;text-decoration:none;color:var(--th-ink)}
/* The web console's brand: its eight-spoke mark, then «MARU» at 15 px with .06em tracking */
.th-logo{flex:none;display:block}
.th-brand b{font-weight:700;font-size:15px;letter-spacing:.06em;color:var(--th-ink)}
.th-brand span{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-who{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:13px;color:var(--th-muted);min-width:0}
.th-who strong{color:var(--th-ink);font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:12em}
.th-btn{font:inherit;font-size:13px;font-weight:650;border:1px solid var(--th-line);background:var(--th-surface);color:var(--th-ink);border-radius:9px;padding:7px 12px;cursor:pointer;white-space:nowrap;text-decoration:none;display:inline-block}
.th-btn:hover{border-color:var(--th-primary)}
.th-btn-primary{background:var(--th-primary);border-color:var(--th-primary);color:var(--th-primary-ink);padding:12px 20px;font-size:15px;border-radius:10px;text-decoration:none;display:inline-block}
.th-btn-primary:hover{filter:brightness(1.06)}
/* A link styled as a button keeps the button's colours over .th a's link colour. */
.th a.th-btn{color:var(--th-ink)}
.th a.th-btn-primary{color:var(--th-primary-ink)}
.th-icon-btn{width:34px;height:34px;padding:0;display:inline-grid;place-items:center}

/* Layout */
.th-main{max-width:1120px;margin:auto;padding:36px max(16px,env(safe-area-inset-right,0px)) 72px max(16px,env(safe-area-inset-left,0px));outline:none}
.th-section{margin-top:36px}
.th-section:first-child{margin-top:0}
.th-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:14px;flex-wrap:wrap}
.th-section h2{font-size:20px;letter-spacing:-.02em;text-wrap:balance}
.th-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:14px}
.th-card{background:var(--th-surface);border:1px solid var(--th-line);border-radius:var(--th-radius);padding:20px 20px 18px;min-width:0;display:flex;flex-direction:column;gap:10px}
.th-card h3{font-size:17px;letter-spacing:-.01em}
.th-card p{font-size:14px;color:var(--th-muted)}
.th-meta{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:13px;color:var(--th-muted)}
.th-chip{display:inline-block;font-size:12px;font-weight:700;padding:3px 9px;border-radius:7px;background:var(--th-soft);color:var(--th-primary);white-space:nowrap}
.th-chip.ok{background:var(--th-ok-soft);color:var(--th-ok)}
.th-chip.wait{background:var(--th-wait-soft);color:var(--th-wait)}
.th-chip.muted{background:transparent;border:1px solid var(--th-line);color:var(--th-muted)}
.th-card-foot{margin-top:auto;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding-top:4px}
.th-link{font-weight:700;font-size:14px;text-decoration:none}
.th-link:hover{text-decoration:underline}
.th-empty{border:1px dashed var(--th-line);border-radius:var(--th-radius);padding:22px;color:var(--th-muted);font-size:14px;background:transparent}

/* Stage track: 준비 ▸ 스프린트 ▸ 최종검수 */
.th-stages{display:flex;gap:4px;list-style:none;margin:0;padding:0;font-size:12px}
.th-stages li{flex:1;text-align:center;padding:5px 4px;border-radius:6px;background:var(--th-soft);color:var(--th-muted);white-space:nowrap}
.th-stages li.done{color:var(--th-primary)}
.th-stages li.now{background:var(--th-primary);color:var(--th-primary-ink);font-weight:700}

/* MARU-LITE list */
.th-tools{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.th-tools input,.th-tools select{font:inherit;font-size:14px;color:var(--th-ink);background:var(--th-surface);border:1px solid var(--th-line);border-radius:9px;padding:9px 12px;min-width:0}
.th-tools input{flex:1 1 220px}
.th-tools label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--th-muted)}
.th-list{display:flex;flex-direction:column;gap:10px}
.th-row{background:var(--th-surface);border:1px solid var(--th-line);border-radius:12px;padding:16px 18px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:center}
.th-row h3{font-size:16px}
.th-row p{font-size:13px;color:var(--th-muted)}
.th-row>*{grid-column:1}
.th-row>.th-link{grid-row:1 / span 3;grid-column:2;align-self:center}

/* Help */
.th-help{display:flex;flex-wrap:wrap;gap:10px}
.th-help a{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid var(--th-line);border-radius:10px;background:var(--th-surface);text-decoration:none;font-size:14px;font-weight:650}
.th-help a:hover{border-color:var(--th-primary)}

/* Sign-in and not-member: a single centred panel, nothing of the Town on it */
.th-gate{min-height:100vh;display:grid;place-items:center;padding:24px max(16px,env(safe-area-inset-left,0px))}
.th-gate-panel{width:min(100%,420px);background:var(--th-surface);border:1px solid var(--th-line);border-radius:20px;padding:36px 30px;text-align:center;display:flex;flex-direction:column;gap:16px;align-items:center}
.th-gate-mark{display:flex;align-items:center;gap:8px;font-weight:700;font-size:15px;letter-spacing:.06em;color:var(--th-ink)}
.th-gate h1{font-size:24px;letter-spacing:-.03em;text-wrap:balance}
.th-gate p{font-size:14px;color:var(--th-muted)}
.th-status{color:var(--th-muted);font-size:14px}
.th-facts{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 14px;margin:4px 0 0;font-size:14px}
.th-facts dt{color:var(--th-muted)}
.th-facts dd{margin:0;min-width:0;overflow-wrap:anywhere}
.th-hash{word-break:break-all;font-size:12.5px}
/* The sign-in shell's static list of what a failed sign-in can mean; the not-member page's sign-out is a POST form */
.th-gate-help{width:100%;text-align:left;border-top:1px solid var(--th-line);padding-top:14px}
.th-gate-help h2{font-size:14px;font-weight:700;margin:0 0 6px}
.th-gate-help ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--th-muted)}
.th-gate-form,.th-signout{margin:0;display:inline-flex}
.th-error{border:1px solid var(--th-line);border-radius:var(--th-radius);background:var(--th-surface);padding:22px;display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap}

@media (max-width:640px){
  .th-header-inner{height:58px;gap:10px}
  .th-brand span{font-size:14px}
  .th-who strong{max-width:7em}
  .th-main{padding-top:24px}
  .th-row{grid-template-columns:1fr}
  .th-row>.th-link{grid-row:auto;grid-column:1}
  .th-tools input{flex-basis:100%}
  .th-tools label{flex:1 1 0}
  .th-tools select{width:100%}
}
@media (max-width:420px){.th-brand b{display:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* The deposit page: a LITE member's own project (REQ-200 st 4–5, 9) */
.th-section h1{font-size:24px;letter-spacing:-.02em;text-wrap:balance}
.th-intro{color:var(--th-muted);font-size:14px;margin:0 0 20px;max-width:60ch}
.th-form{display:flex;flex-direction:column;gap:16px;max-width:640px}
.th-field{display:flex;flex-direction:column;gap:6px}
.th-field label,.th-choice legend{font-size:14px;font-weight:650}
.th-field small{font-size:12px;color:var(--th-muted)}
.th-form input,.th-form select,.th-form textarea{font:inherit;font-size:15px;color:var(--th-ink);background:var(--th-surface);border:1px solid var(--th-line);border-radius:9px;padding:10px 12px;min-width:0;width:100%}
.th-form textarea{resize:vertical}
.th-form [aria-invalid="true"]{border-color:var(--th-focus)}
.th-choice{border:1px solid var(--th-line);border-radius:12px;padding:12px 16px 14px;margin:0;display:flex;flex-wrap:wrap;gap:8px 20px}
.th-choice legend{padding:0 6px}
.th-choice label{display:inline-flex;align-items:center;gap:8px;font-size:14px}
.th-choice input{width:auto}
.th-form-foot{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.th-form-foot .th-btn-primary{border:0;cursor:pointer}

/* Publishing is its own act on the member's own row (REQ-200 st 4) */
.th-publish{grid-column:1;font-size:13px}
.th-publish summary{cursor:pointer;color:var(--th-primary);font-weight:650;width:max-content}
.th-publish-body{display:flex;flex-direction:column;gap:8px;padding:10px 0 2px}
.th-publish-body small{color:var(--th-muted)}
.th-publish-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.th-publish-row select{font:inherit;font-size:14px;color:var(--th-ink);background:var(--th-surface);border:1px solid var(--th-line);border-radius:9px;padding:7px 10px}

/* The project viewer (REQ-197 statement 6): overview, the simple status, four read-only tabs */
.th-crumbs{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:13px;color:var(--th-muted);margin-bottom:18px}
.th-crumbs a{text-decoration:none}
.th-overview{gap:12px}
.th-overview h1{font-size:24px;letter-spacing:-.02em;text-wrap:balance}
.th-def summary{cursor:pointer;color:var(--th-primary);font-weight:650;font-size:14px;width:max-content}
.th-def dl,.th-def-list{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 16px;margin:10px 0 0;font-size:14px}
.th-def dt,.th-def-list dt{font-weight:650;color:var(--th-ink)}
.th-def dd,.th-def-list dd{margin:0;color:var(--th-muted)}
.th-def dd ul{margin:0;padding-left:18px}
.th-maps{display:flex;flex-wrap:wrap;gap:12px}
.th-map{flex:1 1 240px;background:var(--th-surface);border:1px solid var(--th-line);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;font-size:14px}
.th-map-label{font-size:12px;color:var(--th-muted);font-weight:650}
.th-tabs{display:flex;gap:4px;border-bottom:1px solid var(--th-line);margin-bottom:16px;overflow-x:auto}
.th-tab{font:inherit;font-size:14px;font-weight:650;background:none;border:0;border-bottom:2px solid transparent;color:var(--th-muted);padding:10px 14px;cursor:pointer;white-space:nowrap}
.th-tab[aria-selected="true"]{color:var(--th-primary);border-bottom-color:var(--th-primary)}
.th-tabpanel{outline:none}
.th-stack{display:flex;flex-direction:column;gap:22px}
.th-stack h3{font-size:16px;margin-bottom:10px}
.th-table-wrap{overflow-x:auto;border:1px solid var(--th-line);border-radius:12px;background:var(--th-surface)}
.th-table{border-collapse:collapse;width:100%;font-size:14px}
.th-table th,.th-table td{text-align:left;padding:10px 14px;border-bottom:1px solid var(--th-line);vertical-align:top}
.th-table th{font-size:12px;color:var(--th-muted);font-weight:650;white-space:nowrap}
.th-table tr:last-child td{border-bottom:0}
.th-compass{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:8px}
.th-compass li{display:flex;flex-direction:column;gap:2px;background:var(--th-surface);border:1px solid var(--th-line);border-radius:10px;padding:10px 14px;font-size:13px;color:var(--th-muted)}
.th-compass b{font-weight:650;font-size:14px;color:var(--th-ink)}
.th-collab p{font-size:13px}
.th-readonly{margin-top:28px;border-top:1px solid var(--th-line);padding-top:14px}
@media (max-width:640px){.th-def dl,.th-def-list{grid-template-columns:1fr}}
.th-report>:last-child{grid-row:1 / span 2;grid-column:2;align-self:center;justify-self:end}
.th-row>.th-chip{justify-self:start}
@media (max-width:640px){.th-report>:last-child{grid-row:auto;grid-column:1;justify-self:start}}

/* The Town project viewer: the Blueprint's sections, comments as revision requests, the owner's invitations */
.th-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.th-bp-section h3{font-size:16px}
.th-comments{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.th-comments li{border-left:3px solid var(--th-line);padding:4px 0 4px 12px;display:flex;flex-direction:column;gap:4px}
.th-comments p{font-size:14px;color:var(--th-ink)}
.th-answer{font-size:13px!important;color:var(--th-muted)!important}
.th-comment-form{margin-top:12px;max-width:none}
.th-invited{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:8px}
.th-invited li{display:flex;justify-content:space-between;align-items:center;gap:12px;background:var(--th-surface);border:1px solid var(--th-line);border-radius:10px;padding:8px 12px;font-size:14px}
.th-publish-row input{font:inherit;font-size:14px;color:var(--th-ink);background:var(--th-surface);border:1px solid var(--th-line);border-radius:9px;padding:7px 10px;min-width:0;flex:1 1 200px}

/* The 마루홈: the current project, the members with the owner's controls */
.th-mh-current{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--th-line);padding-top:12px}
.th-mh-members li{flex-wrap:wrap}
.th-mh-who{display:flex;flex-direction:column;gap:4px;min-width:0}
.th-mh-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.th-mh-act select,.th-publish-row select{font:inherit;font-size:14px;color:var(--th-ink);background:var(--th-surface);border:1px solid var(--th-line);border-radius:9px;padding:6px 8px}
