/* SmartDeskVerse shared design (SDV.DEL-001 §3, SDV.DEL-004 §2.3 and §31).
   Base palette from the Clock specification; every text/background pair is checked to WCAG 2.2 AA in both themes.
   Theme: data-theme="light"|"dark" on <html> when the visitor chose one, otherwise the system setting. */
:root {
  --surface: #F7F8F5; --surface-raised: #FFFFFF; --surface-muted: #ECEFEA; --surface-sunk: #E3E8E4;
  --text: #15232D; --text-muted: #4B5B66; --border: #D5DBD8; --control-border: #66767F;
  --accent: #147D82; --accent-strong: #0F6569; --accent-text: #FFFFFF; --accent-soft: #DCEFEE;
  --warm: #9A5B13; --focus-ring: #147D82;
  --danger: #B3261E; --danger-soft: #FBE7E5; --success: #1E6B3A; --success-soft: #E2F3E7; --warn: #7A4F00; --warn-soft: #FFF1D6;
  --shadow: 0 1px 2px rgb(21 35 45 / .06), 0 4px 16px rgb(21 35 45 / .06);
  --radius: 12px; --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --page: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #15232D; --surface-raised: #1C2E3A; --surface-muted: #213644; --surface-sunk: #101C24;
    --text: #F7F8F5; --text-muted: #B9C6CC; --border: #2F4552; --control-border: #8396A0;
    --accent: #62B9B4; --accent-strong: #7CCBC6; --accent-text: #15232D; --accent-soft: #1F3F45;
    --warm: #E8B36B; --focus-ring: #62B9B4;
    --danger: #F2938C; --danger-soft: #3C2224; --success: #7CCB95; --success-soft: #1D3528; --warn: #F0C46A; --warn-soft: #3A3020;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #15232D; --surface-raised: #1C2E3A; --surface-muted: #213644; --surface-sunk: #101C24;
  --text: #F7F8F5; --text-muted: #B9C6CC; --border: #2F4552; --control-border: #8396A0;
  --accent: #62B9B4; --accent-strong: #7CCBC6; --accent-text: #15232D; --accent-soft: #1F3F45;
  --warm: #E8B36B; --focus-ring: #62B9B4;
  --danger: #F2938C; --danger-soft: #3C2224; --success: #7CCB95; --success-soft: #1D3528; --warn: #F0C46A; --warn-soft: #3A3020;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--text); font: 16px/1.55 var(--font); overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--accent-strong); text-underline-offset: 2px; }
:root:not([data-theme="dark"]) a { color: var(--accent-strong); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.65rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
p, ul, ol { margin: 0 0 1em; }
.num, .tab { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-text); padding: 10px 14px; border-radius: var(--radius-sm); z-index: 100; font-weight: 600; }
.skip:focus { top: 8px; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--border); background: var(--surface); }
.head-row { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text) !important; margin-right: auto; }
.brand svg { flex: none; }
.brand b { font-size: 1.15rem; letter-spacing: -.01em; }
.brand small { display: block; color: var(--text-muted); font-size: .78rem; line-height: 1.2; }
.head-nav { display: none; gap: 4px; }
.head-nav a { color: var(--text) !important; text-decoration: none; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; }
.head-nav a:hover, .head-nav a[aria-current="page"] { background: var(--surface-muted); }
.head-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); border-radius: var(--radius-sm); font: inherit; font-size: .9rem; cursor: pointer; }
.icon-btn:hover { border-color: var(--control-border); }
.menu-btn { display: inline-flex; }
@media (min-width: 960px) { .head-nav { display: flex; } .menu-btn { display: none; } }
.mobile-nav { border-top: 1px solid var(--border); padding: 8px 0 12px; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { display: block; padding: 12px 8px; color: var(--text) !important; text-decoration: none; border-radius: var(--radius-sm); }
.mobile-nav a:hover { background: var(--surface-muted); }

/* search */
.search { position: relative; flex: 1 1 220px; max-width: 360px; }
.search input[type="search"] { width: 100%; min-height: 44px; padding: 0 12px 0 38px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text); font: inherit; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); margin: 0; padding: 4px; list-style: none; z-index: 50; max-height: 60vh; overflow: auto; }
.search-list[hidden] { display: none; }
.search-list li { padding: 10px; border-radius: 6px; cursor: pointer; }
.search-list li[aria-selected="true"], .search-list li:hover { background: var(--accent-soft); }
.search-list li b { display: block; }
.search-list li span { color: var(--text-muted); font-size: .88rem; }
.search-list .empty { cursor: default; color: var(--text-muted); }
@media (max-width: 599px) { .search { order: 3; flex-basis: 100%; max-width: none; } }

/* ---------- page parts ---------- */
main { display: block; padding-bottom: 48px; }
.crumbs { font-size: .88rem; color: var(--text-muted); padding-top: 12px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--text-muted); }
.crumbs a { color: var(--text-muted) !important; }
.lede { font-size: 1.08rem; color: var(--text-muted); max-width: 68ch; }
.prose { max-width: 72ch; }
.prose li { margin-bottom: .35em; }
.card { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.tool-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text) !important; }
.tool-card:hover { border-color: var(--accent); }
.tool-card h3 { margin: 0; font-size: 1.12rem; }
.tool-card p { margin: 0; color: var(--text-muted); }
.tool-card .go { margin-top: auto; padding-top: 8px; color: var(--accent-strong); font-weight: 600; }
.chip { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface-raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text) !important; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: .9rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.notice { border-left: 4px solid var(--warm); background: var(--warn-soft); padding: 12px 14px; border-radius: var(--radius-sm); }
.notice.info { border-color: var(--accent); background: var(--accent-soft); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.faq details p { margin: .6em 0 0; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--text-muted); font-size: .85rem; }
.field .err { color: var(--danger); font-size: .88rem; font-weight: 600; }
.field .err:empty { display: none; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  min-height: 44px; padding: 8px 10px; border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--text); font: inherit; max-width: 100%; min-width: 0;
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
input[type="range"] { accent-color: var(--accent); width: 100%; min-height: 32px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin: 0; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--border); background: var(--surface-muted); padding: 28px 0 36px; font-size: .92rem; }
.site-foot nav ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-foot nav a { display: inline-block; padding: 6px 0; }
.site-foot p { color: var(--text-muted); margin: .4em 0; }

/* ---------- print ---------- */
@media print {
  .site-head, .site-foot, .crumbs, .no-print, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #999; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
