/* Radman Stone Orders — warm stone palette, serif headings, light & dark mode. No external fonts. */

:root {
  --bg: #f5efe6;
  --bg-veil: #ece2d3;
  --surface: #fffcf7;
  --surface-2: #f4ece0;
  --text: #2a241f;
  --muted: #6e6255;
  --border: #e3d7c6;
  --border-strong: #cdbba4;
  --accent: #8b6a47;
  --accent-hover: #74583a;
  --accent-soft: #f0e3d0;
  --on-accent: #ffffff;
  --danger: #a33b2b;
  --danger-soft: #f8e4df;
  --success: #3f7a4a;
  --success-soft: #e3f0e2;
  --focus: #c08a4a;
  --shadow: 0 1px 2px rgba(70, 45, 20, .05), 0 10px 30px rgba(70, 45, 20, .07);
  --radius: 16px;
  --radius-sm: 10px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --st-new-bg: #e5edf8;       --st-new-fg: #2b5089;
  --st-progress-bg: #fbeed2;  --st-progress-fg: #875800;
  --st-quoted-bg: #efe4f6;    --st-quoted-fg: #6a3c88;
  --st-done-bg: #e1efe1;      --st-done-fg: #2e6a39;
  --st-cancelled-bg: #ece7e2; --st-cancelled-fg: #6e6255;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1714; --bg-veil: #221e1a; --surface: #241f1b; --surface-2: #2c2621;
    --text: #efe7dc; --muted: #b3a797; --border: #3a332c; --border-strong: #52483e;
    --accent: #d2ad83; --accent-hover: #e2c29d; --accent-soft: #3a2f24; --on-accent: #1a1714;
    --danger: #ec8b7a; --danger-soft: #3d221d; --success: #8fc79a; --success-soft: #1f3324; --focus: #e2b57e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    --st-new-bg: #1f2d42; --st-new-fg: #a9c6f0;
    --st-progress-bg: #3b2f17; --st-progress-fg: #f0cb7f;
    --st-quoted-bg: #33253d; --st-quoted-fg: #d6b5ec;
    --st-done-bg: #1e3323; --st-done-fg: #9ed4a8;
    --st-cancelled-bg: #2e2924; --st-cancelled-fg: #b3a797;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1714; --bg-veil: #221e1a; --surface: #241f1b; --surface-2: #2c2621;
  --text: #efe7dc; --muted: #b3a797; --border: #3a332c; --border-strong: #52483e;
  --accent: #d2ad83; --accent-hover: #e2c29d; --accent-soft: #3a2f24; --on-accent: #1a1714;
  --danger: #ec8b7a; --danger-soft: #3d221d; --success: #8fc79a; --success-soft: #1f3324; --focus: #e2b57e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --st-new-bg: #1f2d42; --st-new-fg: #a9c6f0;
  --st-progress-bg: #3b2f17; --st-progress-fg: #f0cb7f;
  --st-quoted-bg: #33253d; --st-quoted-fg: #d6b5ec;
  --st-done-bg: #1e3323; --st-done-fg: #9ed4a8;
  --st-cancelled-bg: #2e2924; --st-cancelled-fg: #b3a797;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 10% -10%, var(--bg-veil), transparent 60%),
    radial-gradient(900px 400px at 110% 0%, var(--bg-veil), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }
.container-wide { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--font-mono); }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* ---------- Header / footer ---------- */
.site-header, .admin-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.header-inner, .admin-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background:
    linear-gradient(135deg, transparent 45%, rgba(255,255,255,.35) 47%, transparent 52%),
    linear-gradient(160deg, transparent 60%, rgba(0,0,0,.12) 62%, transparent 66%),
    linear-gradient(135deg, #d9c4a5, #a88563 55%, #7d5f42);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.brand-sub { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.site-nav, .admin-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a, .admin-nav a {
  text-decoration: none; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: .95rem;
}
.site-nav a:hover, .admin-nav a:hover { color: var(--text); background: var(--surface-2); }
.admin-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; padding: 20px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-inner p { margin: 0; }
.site-footer a { color: var(--muted); }
@media (max-width: 480px) { .hide-sm { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 16px 0 24px; }
.hero-sm { padding-bottom: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; color: var(--accent); font-weight: 600; margin-bottom: .6em; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 640px; }

/* ---------- Cards & sections ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
@media (min-width: 640px) { .card { padding: 28px; } }
.section { margin-bottom: 16px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin-bottom: .8em; }
.step {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-sans); font-size: .9rem; font-weight: 700;
}
.optional { font-family: var(--font-sans); font-size: .8rem; font-weight: 400; color: var(--muted); }
.section-hint { color: var(--muted); font-size: .93rem; margin-top: -.3em; }
.card-title { font-size: 1.15rem; margin-bottom: .9em; }
.sub-title { font-size: 1rem; margin: 1.5em 0 .6em; }

/* ---------- Forms ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
  .grid-item { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) { .grid-item { grid-template-columns: repeat(3, 1fr); } .grid-item .field-qty { grid-column: span 1; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label, .label { font-weight: 600; font-size: .92rem; }
.req { color: var(--danger); }
.hint { margin: 0; font-size: .82rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .85rem; margin: 0; }
::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.dims, .qty { display: flex; align-items: center; gap: 8px; }
.dims input { flex: 1; min-width: 0; }
.qty input { flex: 1.3; min-width: 0; }
.qty select { flex: 1; min-width: 0; }

.items { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.item-card { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; }
.item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.item-title { margin: 0; font-size: 1rem; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 24px 16px; cursor: pointer;
  color: var(--muted); font-weight: 400; background: var(--surface-2); position: relative;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); color: var(--text); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone strong { color: var(--accent); }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.file-list li { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.file-list li.is-bad { border-color: var(--danger); color: var(--danger); }

.form-actions { display: flex; flex-direction: column-reverse; gap: 12px; align-items: stretch; margin-top: 8px; }
.privacy-note { color: var(--muted); font-size: .85rem; margin: 0; }
@media (min-width: 640px) { .form-actions { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid transparent; padding: 10px 18px; min-height: 44px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); color: #fff; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: .9rem; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-link.danger { color: var(--danger); }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; border: 1px solid; font-size: .95rem; }
.alert strong { margin-right: 4px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

/* ---------- Success & tracking ---------- */
.success-card { text-align: center; max-width: 640px; margin: 24px auto; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--success-soft); color: var(--success); }
.reference { font-family: var(--font-mono); font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); font-weight: 700; letter-spacing: .04em; margin: 4px 0 12px; color: var(--accent); }
.success-card .muted { margin-top: 16px; }
.track-layout { display: grid; gap: 16px; }
@media (min-width: 860px) { .track-layout { grid-template-columns: 320px 1fr; align-items: start; } }
.track-form .field { margin-bottom: 14px; }
.track-layout .card + .card { margin-top: 0; }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mono-title { font-family: var(--font-mono); letter-spacing: .02em; font-size: 1.4rem; margin: 0 0 .2em; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; margin: 20px 0 8px; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .8rem; color: var(--muted); }
.steps li::before { content: ""; position: absolute; top: 8px; left: -50%; right: 50%; height: 2px; background: var(--border); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); position: relative; z-index: 1; }
.steps li.is-done, .steps li.is-current { color: var(--text); }
.steps li.is-done .dot { background: var(--accent); border-color: var(--accent); }
.steps li.is-done::before, .steps li.is-current::before { background: var(--accent); }
.steps li.is-current .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--accent); }
.steps li.is-current .step-label { font-weight: 700; }
.status-text { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 12px; }
.item-summary { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.item-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .93rem; }
.item-summary strong { white-space: nowrap; }
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline-title { font-weight: 600; font-size: .93rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-new { background: var(--st-new-bg); color: var(--st-new-fg); }
.badge-in_progress { background: var(--st-progress-bg); color: var(--st-progress-fg); }
.badge-quoted { background: var(--st-quoted-bg); color: var(--st-quoted-fg); }
.badge-done { background: var(--st-done-bg); color: var(--st-done-fg); }
.badge-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }

/* ---------- Admin ---------- */
.admin-main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.admin-user form { margin: 0; }
@media (max-width: 720px) {
  .admin-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
}
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); margin: 0; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { margin: 0 0 10px; font-size: .9rem; }
.breadcrumb a { text-decoration: none; }

.stat-groups { display: grid; gap: 16px; }
@media (min-width: 860px) { .stat-groups { grid-template-columns: 1fr 1fr 0.8fr; } }
.stat-groups .card + .card { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); text-decoration: none; color: var(--text); }
.stat:hover { color: var(--text); outline: 1px solid var(--border-strong); }
.stat-num { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-new .stat-num { color: var(--st-new-fg); }
.stat-in_progress .stat-num { color: var(--st-progress-fg); }
.stat-done .stat-num { color: var(--st-done-fg); }
.big-num { font-family: var(--font-serif); font-size: 3rem; line-height: 1; margin: 0 0 6px; }

.filters { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; } }
.filters .field label { font-size: .82rem; }
.filters-actions { display: flex; gap: 8px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .num { text-align: right; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table a.ref { font-family: var(--font-mono); font-weight: 600; text-decoration: none; white-space: nowrap; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link.is-active { color: var(--text); }
.card .table-wrap { box-shadow: none; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px !important; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--surface); font-size: .9rem; }
.pagination .is-current { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pagination .gap { border: 0; background: none; }

.detail-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.detail-grid .card + .card { margin-top: 16px; }
.dl { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .82rem; margin-top: 8px; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .dl { grid-template-columns: 170px 1fr; } .dl dt { margin-top: 0; padding: 6px 0; } .dl dd { padding: 6px 0; } }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-tile { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-decoration: none; color: var(--text); background: var(--surface-2); font-size: .85rem; overflow-wrap: anywhere; }
.file-tile:hover { border-color: var(--accent); color: var(--text); }
.file-thumb { aspect-ratio: 4 / 3; border-radius: 6px; background: var(--surface); display: grid; place-items: center; overflow: hidden; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.note { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.note-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: .93rem; }

.option-table input[type="text"] { min-height: 38px; padding: 6px 10px; }
.option-table input.pos { width: 80px; }
.option-table td { vertical-align: middle; }
.add-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-row input { flex: 1; min-width: 180px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.settings-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.settings-grid .card + .card { margin-top: 0; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
details.inline-form summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
details.inline-form form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
details.inline-form input { min-width: 180px; flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }

.auth-wrap { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { margin-bottom: 20px; }
.auth-card .field { margin-bottom: 14px; }
.install-card { max-width: 720px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.checks li { display: flex; gap: 8px; align-items: baseline; }
.checks .ok { color: var(--success); font-weight: 700; }
.checks .bad { color: var(--danger); font-weight: 700; }
.checks .warn { color: var(--st-progress-fg); font-weight: 700; }
code, .code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

@media print {
  .site-header, .admin-header, .site-footer, .detail-side, .btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}
