/* Nav rail, top bar, breadcrumb, page head, side panel. The shell wiring is package 1.3. */
.nav { background: var(--nav-bg); color: var(--nav-text); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav a { display: flex; justify-content: space-between; align-items: center; min-height: var(--target); padding: 0 10px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.nav a:hover { background: var(--nav-active); }
.nav a[aria-current] { background: var(--nav-active); color: var(--nav-on); box-shadow: inset 2px 0 0 var(--action-primary); }
.nav .group { font-size: 12.5px; padding: 12px 10px 4px; opacity: .75; }
.nav-more summary { cursor: pointer; min-height: var(--target); display: flex; align-items: center; padding: 0 10px; border-radius: var(--r-sm); margin-top: 8px; list-style: none; opacity: .85; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: "+"; margin-left: auto; }
.nav-more[open] summary::after { content: "\2212"; }
.nav-more summary:hover { background: var(--nav-active); }
.nav-more a { padding-left: 18px; }
.nav hr { border: 0; border-top: 1px solid var(--nav-line); margin: 10px 4px; }
.topbar { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--gutter); background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.breadcrumb { display: flex; gap: 6px; align-items: center; color: var(--text-secondary); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb [aria-current] { color: var(--text-primary); font-weight: 600; }
.searchbox { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); min-width: 280px; min-height: var(--target); border: 1px solid var(--border-strong); background: var(--bg-raised); border-radius: var(--r-md); padding: 0 10px; color: var(--text-muted); }
.searchbox kbd { margin-left: auto; }
.page { padding: 22px var(--gutter) 40px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.page-head p { margin-top: 2px; color: var(--text-secondary); }
.actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.sidepanel { background: var(--bg-surface); border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; min-height: 0; }
.sidepanel > header { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
.sidepanel > .body { flex: 1; overflow: auto; padding: 14px var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
@media (max-width: 639px) {
  .searchbox { min-width: 0; flex: 1; }
  .searchbox kbd { display: none; }
  .page-head { flex-direction: column; }
}

/* App shell (package 1.3) */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100vh; }
.shell.panel-open { grid-template-columns: 232px minmax(0, 1fr) 560px; }
.shell > .nav { grid-row: 1 / 3; }
.shell > .topbar { grid-column: 2 / 4; }
.shell > main { grid-column: 2; overflow: auto; min-width: 0; }
.shell > .sidepanel { grid-column: 3; display: none; }
.shell.panel-open > .sidepanel { display: flex; }
.shell { grid-template-rows: 52px minmax(0, 1fr); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; color: var(--nav-on); font-weight: 650; font-size: var(--fs-16); }
.brand i { width: 26px; height: 26px; border-radius: 6px; background: var(--action-primary); display: grid; place-items: center; font-style: normal; color: var(--action-on); font-weight: 700; }
.nav .me { margin-top: auto; padding: 10px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--nav-active); color: var(--nav-on); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.menu-btn { display: none; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-4); }
.auth-card { width: min(420px, 100%); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-card .btn { width: 100%; }
.mono { font-family: var(--font-mono); overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.codes li { border: 1px solid var(--border-subtle); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); background: var(--bg-raised); }
@media (max-width: 899px) {
  .shell, .shell.panel-open { grid-template-columns: minmax(0, 1fr); }
  .shell > .topbar, .shell > main { grid-column: 1; }
  .shell > .nav { display: none; position: fixed; inset: 52px 0 0 0; width: 260px; z-index: 6; grid-row: auto; }
  .shell > .nav.open { display: flex; }
  .shell > .sidepanel { grid-column: 1; grid-row: 2; position: fixed; inset: 52px 0 0 0; z-index: 5; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 639px) {
  .topbar { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .page { padding: var(--sp-4); }
}

.pad { padding: var(--sp-4); }
.scroll { overflow: auto; }

.searchbox > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.banner + .actions { margin-top: var(--sp-2); }
/* UX pass 2026-12-01: two-column forms, a setting with its save button on one line, the get-started steps */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
@media (max-width: 639px) { .grid-2 { grid-template-columns: 1fr; } }
.setting-row { display: flex; gap: var(--sp-3); align-items: flex-end; }
.setting-row .field { flex: 1; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.steps li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-raised); }
.steps li .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: var(--fs-14); border: 1px solid var(--border-strong); flex: none; }
.steps li.done .n { background: var(--status-success-bg); color: var(--status-success); border-color: var(--status-success); }
.steps li.done .t { color: var(--text-secondary); text-decoration: line-through; }
.steps li .t { flex: 1; }

.qr-wrap { display: flex; justify-content: center; }
.qr { border-radius: var(--r-md); }
.qr .qr-bg { fill: var(--qr-light); }
.qr .qr-fg { fill: var(--qr-dark); }
a.btn { text-decoration: none; }
@media (max-width: 639px) { .steps li { flex-wrap: wrap; } .steps li .btn { margin-left: 38px; } }

/* Claude console panel */
.console { display: flex; flex-direction: column; gap: var(--sp-2); height: 100%; min-height: 0; }
.console-screen { flex: 1; min-height: 240px; margin: 0; overflow: auto; padding: var(--sp-3); border-radius: var(--r-md); background: var(--nav-bg); color: var(--nav-on);
  font: 12.5px/1.4 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.console-keys { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.console-form { display: flex; gap: var(--sp-2); align-items: flex-end; }
.console-form .console-input { flex: 1; resize: vertical; }
.page.dropping { outline: 2px dashed var(--action-primary); outline-offset: -8px; border-radius: var(--r-md); }
