/* Shared shell geometry and palette match the existing Agent Console. */
:root { color-scheme:light; --paper:#fff; --surface:#f5f6f8; --ink:#20242b; --muted:#66717f; --secondary:var(--muted); --quiet:#7b8490; --line:#e4e7eb; --accent:#315b50; --header:60px; --sidebar:272px; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:var(--paper); font:16px/1.85 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif; }
a { color:inherit; text-decoration:none; }
button,input { font:inherit; color:inherit; border-radius:0; }
button { cursor:pointer; background:transparent; border:0; }
button,input[type="search"] { -webkit-appearance:none; appearance:none; }
button:disabled { cursor:default; opacity:.45; }
svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:square; stroke-linejoin:miter; flex-shrink:0; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
[hidden] { display:none!important; }
.skip-link { position:fixed; left:16px; top:-70px; padding:12px; color:#fff; background:var(--ink); z-index:60; }
.skip-link:focus { top:12px; }
.top { position:sticky; top:0; z-index:20; height:var(--header); display:flex; align-items:center; gap:16px; padding:0 28px; background:var(--paper); border-bottom:1px solid var(--line); line-height:normal; }
.brand { font-size:18px; font-weight:750; letter-spacing:-.65px; white-space:nowrap; line-height:normal; }
.project-name { color:var(--muted); font-size:13px; font-weight:450; letter-spacing:0; margin-left:10px; }
.top-actions { margin-left:auto; display:flex; align-items:center; gap:24px; }
.connection { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; }
.connection i { width:6px; height:6px; background:var(--accent); border-radius:50%; flex-shrink:0; }
.icon-button { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:6px; border:0; flex-shrink:0; color:var(--muted); font-size:20px; }
.icon-button:hover { color:var(--ink); }
#menu { display:none; color:var(--ink); }
.app-switch { display:inline-flex; align-items:center; gap:10px; min-height:44px; padding:8px 0; color:var(--muted); font-size:13px; line-height:normal; white-space:nowrap; }
.app-switch:hover { color:var(--ink); }
.workspace { margin-left:var(--sidebar); display:flex; min-height:calc(100dvh - var(--header)); }
aside { position:fixed; top:var(--header); bottom:0; left:0; width:var(--sidebar); display:flex; flex-direction:column; min-height:0; padding:20px 16px 12px; background:var(--surface); border-right:1px solid var(--line); z-index:15; overflow-y:auto; }
.sidebar-top { flex-shrink:0; }
.sidebar-home { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:44px; padding:10px 13px; border:1px solid #d7dce2; background:#fff; font-size:14px; font-weight:550; line-height:normal; }
.sidebar-home:hover { border-color:#9ca7b2; }
.sidebar-home>span { font-size:20px; font-weight:400; line-height:1; }
.search { display:flex; align-items:center; gap:8px; width:100%; min-height:42px; margin:10px 0 0; padding:8px 11px; border:1px solid transparent; color:var(--quiet); }
.search:focus-within { background:#fff; border-color:#c3cbd2; color:var(--ink); }
.search svg { width:15px; height:15px; }
.search input { width:100%; min-width:0; height:24px; padding:0; border:0; outline:0; background:transparent; font-size:13px; line-height:normal; }
.search input::placeholder { color:#7a8491; }
.side-heading { display:flex; align-items:center; gap:8px; margin:10px 0; padding:0 10px; color:var(--muted); font-size:11px; font-weight:550; min-height:32px; }
#count { margin-left:auto; font-variant-numeric:tabular-nums; }
#refresh { width:32px; height:32px; margin:-5px -8px -5px 0; }
#refresh svg { width:16px; height:16px; }
nav#tree { flex:1; min-height:70px; overflow:auto; padding-bottom:18px; font-size:13px; line-height:1.6; scrollbar-width:thin; }
#tree a { display:block; padding:9px 10px; border-left:2px solid transparent; color:#505a67; overflow-wrap:anywhere; }
#tree a:hover { color:var(--ink); background:#e9edf0; }
#tree a[aria-current="page"] { border-left-color:var(--accent); color:var(--ink); background:#e7ecea; }
#tree summary { padding:9px 4px; cursor:pointer; font-weight:550; list-style:none; }
#tree summary::-webkit-details-marker { display:none; }
#tree summary::before { content:"›"; display:inline-block; color:var(--muted); width:17px; font-weight:400; transform-origin:5px 50%; }
#tree details[open]>summary::before { transform:rotate(90deg); }
#tree details>div { margin-left:9px; padding-left:10px; border-left:1px solid var(--line); }
.sidebar-footer { flex-shrink:0; display:flex; align-items:center; gap:7px; margin-top:auto; padding:14px 10px 2px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; }
.readonly-mark { width:5px; height:5px; background:var(--accent); }
.logout-button { margin-left:auto; padding:8px 0 8px 8px; font-size:11px; color:var(--muted); min-height:36px; white-space:nowrap; }
.logout-button:hover { color:var(--ink); text-decoration:underline; }
main { flex:1; min-width:0; width:min(100%,960px); max-width:960px; margin:0 auto; padding:32px 44px 100px; }

/* Existing document content and navigation behavior. */
.page-context { color: var(--quiet); font-size: 11px; letter-spacing: .2px; }
.page-context span { margin: 0 10px; color: #c5c5c5; }
.page-heading { margin: 26px 0 0; }
h1 { font-size: 36px; font-weight: 600; letter-spacing: -1.5px; line-height: 1.35; margin: 0; }
.page-heading p { margin: 12px 0 0; font-size: 13px; color: var(--secondary); }
.quicklinks { display: flex; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin: 32px 0 55px; }
.quicklinks a { flex: 1; display: flex; align-items: center; gap: 12px; padding: 18px 0; font-size: 13px; font-weight: 500; }
.quicklinks a+a { margin-left: 26px; }
.link-number { font-size: 10px; color: var(--quiet); font-weight: 400; font-variant-numeric: tabular-nums; }
.arrow { margin-left: auto; font-size: 15px; color: var(--secondary); }
.quicklinks a:hover { color: var(--accent); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-heading h2 { font-size: 16px; letter-spacing: -.4px; font-weight: 600; margin: 0; }
.section-heading>span { font-size: 10px; color: var(--quiet); }
.list-heading { display: flex; justify-content: space-between; border-bottom: 1px solid #aaa; padding-bottom: 10px; color: var(--quiet); font-size: 10px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; row-gap: 5px; align-items: baseline; padding: 19px 0; border-bottom: 1px solid var(--line); }
.file-row strong { grid-column: 1; grid-row: 1; font-size: 14px; line-height: 1.6; font-weight: 550; overflow-wrap: anywhere; }
.file-row .file-path { grid-column: 1; grid-row: 2; font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--quiet); overflow-wrap: anywhere; }
.file-row time { grid-column: 2; grid-row: 1; font-size: 10px; color: var(--quiet); white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-row p { grid-column: 1/-1; margin: 6px 0 0; color: var(--secondary); font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-row:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.file-list:empty::after { content: "표시할 문서가 없습니다."; display: block; padding: 28px 0; color: var(--quiet); font-size: 13px; }
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--secondary); border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.doc-toolbar button { font-size: 11px; color: var(--secondary); padding: 8px 0 8px 16px; min-height: 40px; }
.doc-toolbar a:hover,.doc-toolbar button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
#breadcrumb { font: 10px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--quiet); overflow-wrap: anywhere; margin: 22px 0 36px; }
article { max-width: 100%; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
article h1 { font-size: 32px; margin: 0 0 30px; line-height: 1.45; }
article h2 { font-size: 22px; font-weight: 600; letter-spacing: -.6px; line-height: 1.5; margin: 48px 0 20px; }
article h3 { font-size: 17px; font-weight: 600; line-height: 1.65; margin: 32px 0 14px; }
article h4 { font-size: 15px; margin-top: 26px; }
article h1,article h2,article h3,article h4 { scroll-margin-top: calc(var(--header) + 24px); }
article p { margin: 18px 0; }
article li { margin: 6px 0; padding-left: 3px; }
article ul,article ol { padding-left: 23px; }
article a { color: var(--accent); text-decoration: underline; text-decoration-color: #a8bcb5; text-underline-offset: 3px; }
article pre { background: #f5f6f8; border: 1px solid var(--line); padding: 18px 20px; overflow: auto; font-size: 12px; line-height: 1.8; }
article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
article :not(pre)>code { background: #eef1f3; padding: 2px 4px; }
article pre code { font-size: inherit; }
article table { display: block; width: 100%; overflow: auto; border-collapse: collapse; font-size: 12px; margin: 24px 0; line-height: 1.8; }
article th,article td { border-bottom: 1px solid var(--line); padding: 12px 15px 12px 0; text-align: left; vertical-align: top; min-width: 90px; }
article th { border-top: 1px solid var(--ink); border-bottom-color: #aaa; font-weight: 600; }
article blockquote { margin: 24px 0; padding: 0 0 0 19px; border-left: 2px solid #ccc; color: var(--secondary); }
article hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
article img { max-width: 100%; height: auto; }
.document-footer { border-top: 1px solid var(--line); margin-top: 50px; padding-top: 16px; font-size: 11px; color: var(--quiet); }
#status { font-size: 13px; color: #994438; }

#scrim { display:none; }
@media(max-width:1100px) {
  :root { --sidebar:248px; }
  main { padding-left:30px; padding-right:30px; }
}
@media(max-width:900px) {
  :root { --sidebar:0px; --header:calc(60px + env(safe-area-inset-top)); }
  .top { padding:env(safe-area-inset-top) 20px 0; gap:14px; }
  #menu { display:inline-flex; width:44px; height:44px; padding:10px; margin-left:-10px; }
  .top-actions { gap:20px; }
  aside { width:min(86vw,310px); transform:translateX(-100%); transition:transform .16s ease; top:var(--header); }
  aside.open { transform:none; }
  #tree a,#tree summary { min-height:44px; padding-top:12px; padding-bottom:12px; }
  #scrim { display:block; position:fixed; inset:var(--header) 0 0; background:#14202c55; z-index:14; }
  main { width:min(100%,820px); padding-left:28px; padding-right:28px; }
  .search input { font-size:16px; }
  #refresh { width:44px; height:44px; margin:-10px -10px -10px 0; }
  .logout-button { min-height:44px; }
}
@media(max-width:480px) {
  .top { padding-left:18px; padding-right:18px; gap:10px; }
  .brand { font-size:17px; }
  .project-name { font-size:11px; margin-left:7px; }
  .top-actions { gap:15px; }
  .connection { font-size:11px; gap:5px; }
  .app-switch { font-size:12px; gap:5px; }
  main { padding:28px 20px 70px; }
  .page-context { font-size:10px; }
  .page-heading { margin-top:23px; }
  h1 { font-size:29px; letter-spacing:-1.2px; }
  .page-heading p { font-size:13px; line-height:1.85; margin-top:10px; }
  .quicklinks { margin:26px 0 40px; }
  .quicklinks a { gap:7px; font-size:12px; padding:16px 0; }
  .quicklinks a+a { margin-left:16px; }
  .link-number { display:none; }
  .arrow { font-size:13px; }
  .section-heading { margin-bottom:18px; }
  .section-heading h2 { font-size:15px; }
  .file-row { column-gap:13px; padding:18px 0; }
  .file-row strong { font-size:14px; }
  .file-row time,.file-row .file-path { font-size:10px; }
  article { font-size:15px; line-height:1.9; }
  article h1 { font-size:26px; margin-bottom:26px; }
  article h2 { font-size:21px; margin-top:38px; }
  article pre { padding:16px; font-size:12px; }
  article table { font-size:12px; }
  #breadcrumb { font-size:10px; margin:20px 0 30px; }
}
@media(prefers-reduced-motion:reduce) { aside { transition:none; } }
/* Sign-in uses the same full-width navigation as Agent sign-in. */
.login-page .app-switch { margin-left:auto; }
.login-main { width:min(100%,450px); max-width:450px; margin:0 auto; padding:90px 28px 45px; }
.login-heading { margin:0; }
.login-heading h1 { font-size:36px; font-weight:600; letter-spacing:-1.4px; margin:18px 0; }
.login-heading p { font-size:15px; line-height:1.85; color:var(--muted); margin:0; }
#login-form { border-top:1px solid var(--line); margin-top:34px; padding-top:12px; }
.login-field { display:block; font-size:13px; font-weight:500; margin:21px 0 9px; }
#login-form>input { display:block; width:100%; min-height:48px; padding:12px; border:1px solid #c5cdd4; background:#fff; font-size:16px; }
#login-form>input:focus { outline:2px solid var(--accent); outline-offset:3px; }
.remember { display:flex; align-items:center; gap:10px; margin:23px 0; font-size:13px; color:var(--muted); }
.remember input { width:16px; height:16px; margin:0; accent-color:var(--accent); }
.login-submit { display:block; width:100%; min-height:47px; padding:9px 16px; background:#263d35; border:1px solid #263d35; color:#fff; font-size:14px; font-weight:550; margin:0; }
.login-submit:hover { background:#1c2d26; }
.login-submit:disabled { opacity:.45; cursor:default; }
#login-status { color:#994438; font-size:13px; line-height:1.8; min-height:24px; }
.login-note { border-top:1px solid var(--line); padding-top:20px; margin-top:30px; font-size:11px; line-height:1.8; color:var(--quiet); }
@media(max-width:480px) { .login-main { padding-top:64px; } }
