/* Kerro inner pages: what goes inside a <main class="page">. The sidebar,
   the search row, the background and the footer around it are the shell's
   (css/shell.css, js/shell.js), the same as the home page. */

/* Before js/shell.js moves the page into its column, hold it roughly where
   it will land so nothing jumps. */
body > main.page { margin-left: calc(var(--side-w) + var(--pad)); padding-top: 110px; }
@media (max-width: 900px) { body > main.page { margin-left: 16px; padding-top: 140px; } }

.main > .page { position: relative; z-index: 2; width: 100%; max-width: 1040px; padding: 44px 0 0; }
@media (max-width: 900px) { .main > .page { padding-top: 28px; } }

/* The small grey word over a page title is gone: the sidebar says where you are. */
.page-kicker { display: none; }
.page h1 { margin: 0; font-size: clamp(40px, 4.2vw, 64px); font-weight: 700; font-stretch: var(--display-stretch); line-height: .95; letter-spacing: -.025em; text-wrap: balance; }
.page .lede { max-width: 62ch; margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.page h2 { margin: 48px 0 14px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.page h3 { margin: 28px 0 8px; font-size: 16px; font-weight: 600; }
.page p, .page li { color: var(--muted); line-height: 1.65; }
.page p { margin: 0; }
.page p + p { margin-top: 12px; }
.page ul, .page ol { margin: 10px 0 0 1.15rem; padding: 0; }
.page li + li { margin-top: 6px; }
.page a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(var(--wash), .35); }
.page a:hover { text-decoration-color: var(--ink); }
.page a.btn { text-decoration: none; }
.page code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: rgba(var(--wash), .07); padding: .1em .4em; border-radius: 6px; }

/* ── Panels ──────────────────────────────────────────────────────────── */
.panel { margin-top: 16px; padding: 22px; border-radius: 20px; background: var(--pod); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 14px 30px -18px rgba(0, 0, 0, .8); }
[data-theme="light"] .panel { box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .25); }
.panel-label { margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.panel-note { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.page .btn:not(.btn-sm) { height: 42px; padding: 0 18px; font-size: 14px; }

/* ── Fields ──────────────────────────────────────────────────────────── */
.field { width: 100%; height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(var(--wash), .12); background: var(--pill); color: var(--ink); font-size: 15px; transition: border-color .2s ease, background-color .2s ease; }
textarea.field { height: auto; min-height: 96px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
select.field { padding-right: 36px; }
.field:hover { border-color: var(--line-strong); }
.field:focus { outline: none; border-color: rgba(var(--wash), .3); background: var(--pill-solid); }
.field:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.field::placeholder { color: var(--faint); }
.field-row { display: flex; gap: 10px; align-items: center; }
.field-row .btn { flex-shrink: 0; }

/* Switch rows. */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.toggle-row .label { font-size: 15px; font-weight: 500; }
.toggle-row .desc { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.switch { position: relative; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--raise); border: 1px solid var(--line-strong); transition: background-color .2s ease; pointer-events: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease-out), background-color .2s ease; }
.switch input:checked + .track { background: #3a3a40; }
[data-theme="light"] .switch input:checked + .track { background: #c9c9d2; }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 16px; }
table.gv { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.gv th, table.gv td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.gv th { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
table.gv td { color: var(--muted); }
table.gv td:first-child { color: var(--ink); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); white-space: nowrap; }
.badge.added    { color: #5ce08a; border-color: rgba(92, 224, 138, .45); }
.badge.progress { color: #f0c04a; border-color: rgba(240, 192, 74, .45); }
.badge.soon     { color: #6aa8ff; border-color: rgba(106, 168, 255, .45); }
.badge.denied   { color: var(--red); border-color: rgba(255, 59, 59, .45); }
[data-theme="light"] .badge.added { color: #1d8a47; }
[data-theme="light"] .badge.progress { color: #946c00; }
[data-theme="light"] .badge.soon { color: #2563c9; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
}
