:root {
  color-scheme: light;
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --ink: #15202b;
  --muted: #5c6c78;
  --line: #d5dee6;
  --brand: #0a524e;
  --brand-hover: #083f3c;
  --link: #0a524e;
  --nav: #101920;
  --nav-ink: #ffffff;
  --nav-quiet: #d5dee6;
  --footer: #5c6c78;
  --chip: #e7eef2;
  --danger: #8d1c14;
  --ok-bg: #e5f6ef;
  --ok-ink: #0d4f3c;
  --bad-bg: #fdecea;
  --bad-ink: #6e120c;
  --info-bg: #e7f3f2;
  --info-ink: #083f3c;
  --practice-bg: #f6e4b8;
  --practice-ink: #3d2808;
  --shadow: 0 1px 2px rgba(16, 25, 32, 0.06);
  --font: "Segoe UI", system-ui, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e151b;
  --surface: #17212b;
  --surface-2: #1d2935;
  --ink: #f4f7f8;
  --muted: #c5d0d8;
  --line: #31404c;
  --brand: #0a524e;
  --brand-hover: #12756f;
  --link: #b7f3ee;
  --nav: #0b1218;
  --nav-ink: #ffffff;
  --nav-quiet: #d5dee6;
  --footer: #b7c3cc;
  --chip: #243240;
  --danger: #8d1c14;
  --ok-bg: #12352c;
  --ok-ink: #d7f7ec;
  --bad-bg: #3d1816;
  --bad-ink: #ffd2cc;
  --info-bg: #123330;
  --info-ink: #d5f4f1;
  --practice-bg: #4a3412;
  --practice-ink: #ffe6b8;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
}
img { max-width: 100%; }
a { color: var(--link); }
a:hover { text-decoration: none; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0.15rem 0 0; }
h2 { font-size: 1.15rem; margin: 0 0 0.4rem; }
p { margin: 0.4rem 0; }

.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 8px; }

.shell { min-height: 100vh; display: flex; align-items: stretch; }
.sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: var(--nav);
  color: var(--nav-ink);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
}
.side-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #fff;
  text-decoration: none;
  margin: 4px 4px 16px;
}
.brand img { border-radius: 8px; background: #0b1218; }
.brand strong { display: block; font-size: 1.05rem; color: #fff; }
.brand small { display: block; color: var(--nav-quiet); font-size: 12px; }
.nav-section {
  margin: 14px 10px 6px;
  color: var(--nav-quiet);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-link, .nav-button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 1px 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nav-link:hover, .nav-button:hover, .nav-link.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.logout-form { margin: 0; }
.side-bottom { margin-top: auto; padding-top: 12px; }
.who { color: #fff; font-size: 13px; margin: 0 8px 10px; }
.who strong { color: #fff; }
.theme-toggle, .nav-toggle {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.theme-toggle { width: 100%; }
.nav-toggle { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 28px 28px 12px; }
.site-footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--footer);
  padding: 8px 12px 18px;
}

.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sub { color: var(--muted); max-width: 62ch; }

.banner { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.pwa-banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pwa-banner p { flex: 1 1 12rem; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.banner p { margin: 0.2rem 0; }
.banner.ok { background: var(--ok-bg); color: var(--ok-ink); }
.banner.bad { background: var(--bad-bg); color: var(--bad-ink); }
.banner.info { background: var(--info-bg); color: var(--info-ink); }
.banner.practice { background: var(--practice-bg); color: var(--practice-ink); font-weight: 700; }
.banner a { color: inherit; font-weight: 700; }

.card, .table-wrap, .sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card { padding: 16px; }
.stack { display: grid; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.35rem; color: var(--ink); }
.stat span { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 12px; font-weight: 700; }
.badge.critical, .badge.cancelled { background: var(--danger); color: #fff; }
.badge.warning, .badge.pending_approval, .badge.partial { background: #8a4b08; color: #fff; }
.badge.info, .badge.ordered, .badge.order, .badge.quote, .badge.draft, .badge.open { background: var(--brand); color: #fff; }
.badge.received, .badge.shipped, .badge.active, .badge.paid { background: #0d4f3c; color: #fff; }
.badge.void { background: var(--danger); color: #fff; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-hover); color: #fff; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #6e120c; color: #fff; }

form.inline { display: inline; }
[data-scan-video] { width: 100%; max-height: 240px; background: #111; margin: 8px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { max-width: 280px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field span { font-weight: 650; }
input, select, textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
.pw-wrap { display: flex; gap: 8px; }
.pw-wrap input { flex: 1; }
.pw-toggle {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.check input { width: auto; }
.help { color: var(--muted); font-size: 13px; }
.home-actions, .split { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.home-actions form { display: flex; margin: 0; }
.lede { font-size: 1.15rem; max-width: 62ch; }
.price { font-size: 1.8rem; margin: 8px 0; color: var(--ink); }
.price .muted { font-size: 0.95rem; }
.plan-section { margin-top: 28px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.plan-card h3 { margin-top: 0; font-size: 1.15rem; }
.landing h1 { max-width: 18em; }
.landing .eyebrow { color: var(--ink); }
.landing section { margin-top: 36px; }
.landing-mark { display: block; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 10px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.2fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: var(--surface);
  background-image:
    radial-gradient(900px 420px at 100% -10%, color-mix(in srgb, var(--brand) 24%, transparent), transparent 62%),
    radial-gradient(480px 280px at 0% 120%, color-mix(in srgb, var(--link) 18%, transparent), transparent 58%);
}
.shot-frame {
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 10px 8px;
  box-shadow: 0 12px 28px rgba(16, 25, 32, 0.08);
}
[data-theme="dark"] .shot-frame { box-shadow: none; }
.shot-chrome { display: flex; gap: 6px; padding: 2px 4px 8px; }
.shot-chrome span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.shot-frame figcaption { margin-top: 8px; font-size: 13px; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.steps h3 { margin: 8px 0 0; font-size: 1.05rem; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--info-ink);
  font-weight: 700;
}
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.feature-grid h3, .faq-list h3 { margin-top: 0; }
.feature-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--info-bg);
  color: var(--info-ink);
  margin-bottom: 10px;
}
.feature-icon svg { width: 22px; height: 22px; display: block; }
.feature-grid .card:hover,
.landing .plan-card:hover,
.steps li:hover { border-color: var(--link); }
.gallery-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.gallery-panel { display: none; }
.gallery:has(#screen-pipeline:checked) .panel-pipeline,
.gallery:has(#screen-warehouse:checked) .panel-warehouse,
.gallery:has(#screen-invoices:checked) .panel-invoices { display: block; }
.gallery-tabs label {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
}
.gallery-tabs label:hover { border-color: var(--link); }
.gallery-tabs input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.gallery:has(#screen-pipeline:checked) label[for="screen-pipeline"],
.gallery:has(#screen-warehouse:checked) label[for="screen-warehouse"],
.gallery:has(#screen-invoices:checked) label[for="screen-invoices"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.landing .plan-card { display: flex; flex-direction: column; min-height: 100%; }
.landing .plan-card .price { margin-top: 8px; }
.plan-toggle { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.plan-toggle label {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
}
.plan-toggle label:hover { border-color: var(--link); }
.plan-toggle input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.plan-board .price-year { display: none; }
.plan-board:has(#price-year:checked) .price-month { display: none; }
.plan-board:has(#price-year:checked) .price-year { display: block; }
.plan-board:has(#price-month:checked) label[for="price-month"],
.plan-board:has(#price-year:checked) label[for="price-year"],
.compare:has(#compare-3:checked) label[for="compare-3"],
.compare:has(#compare-10:checked) label[for="compare-10"],
.compare:has(#compare-25:checked) label[for="compare-25"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.plan-quote .price { font-size: 1.25rem; line-height: 1.35; }
.compare .size-3, .compare .size-25 { display: none; }
.compare:has(#compare-3:checked) .size-10 { display: none; }
.compare:has(#compare-3:checked) .size-3 { display: table-row; }
.compare:has(#compare-25:checked) .size-10 { display: none; }
.compare:has(#compare-25:checked) .size-25 { display: table-row; }
.compare .table-wrap { max-width: 100%; }
.compare-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.compare-table th, .compare-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}
.compare-table th { font-size: 14px; font-weight: 700; }
.compare-table th:first-child, .compare-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}
.compare-note { font-size: 13px; max-width: 72ch; color: var(--ink); }
.plan-features { margin: 8px 0; padding-left: 1.15em; }
.log-view { overflow: auto; max-height: 28rem; white-space: pre-wrap; background: var(--surface); color: var(--ink); padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.plan-features li { margin: 0.2rem 0; }
.faq-list section { padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(10px); }
  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .feature-grid .card,
  .landing .plan-card,
  .steps li { transition: border-color 0.15s ease, transform 0.15s ease; }
  .feature-grid .card:hover,
  .landing .plan-card:hover,
  .steps li:hover { transform: translateY(-2px); }
}
.narrow { max-width: 720px; }
.sheet { padding: 22px; max-width: 860px; }
.sheet h1 { font-size: 1.4rem; }
.muted { color: var(--muted); }
.reveal-once { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.board-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 180px;
}
.board-col h2 { font-size: 0.95rem; }
.board-card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  margin-top: 8px;
}
.board-card p { margin: 0.2rem 0; }
.board-card select, .board-card .btn { margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  border-left: 3px solid var(--line);
  margin: 0 0 0 4px;
  padding: 0 0 12px 12px;
}
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { margin: 0.35rem 0; }
fieldset.stack {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 8px 12px 4px;
}
fieldset.stack legend { padding: 0 4px; color: var(--ink); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.label-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.label-card {
  background: #fff;
  color: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  width: min(100%, 260px);
}
.label-card p { margin: 4px 0 0; color: #000; }
.label-card svg { max-width: 100%; height: auto; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; }
  .sidebar.is-open .nav-links { display: block; margin-top: 8px; }
  .content { padding: 18px 14px 8px; }
  .page-head, .grid-2 { display: block; }
  .page-actions { margin-top: 10px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: 1fr; overflow-x: visible; }
  .board-col { min-width: 0; }
  .hero { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
  .steps { grid-template-columns: 1fr; }
  .landing h1 { font-size: 1.45rem; }
}

.help-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.help-launcher:hover, .help-launcher:focus-visible { background: var(--brand-hover); color: #fff; }
.help-panel {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 30;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.help-panel[hidden] { display: none !important; }
.help-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help-panel h2 { margin: 0; }
.help-log { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.help-msg {
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.help-msg.assistant { background: var(--info-bg); color: var(--info-ink); }
.help-rate { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.help-rate-note { margin: 8px 0 0; }
.help-transcript { white-space: pre-wrap; overflow-wrap: anywhere; }
.help-panel textarea { width: 100%; }

@media (max-width: 860px) {
  .help-launcher { right: 12px; bottom: 12px; }
  .help-panel { left: 12px; right: 12px; width: auto; bottom: 64px; }
}

.dash-bars { display: flex; flex-direction: column; gap: 8px; }
.dash-bar { display: grid; grid-template-columns: minmax(72px, 92px) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.dash-bar i { display: block; height: 10px; border-radius: 999px; background: var(--link); min-width: 2px; }
.dash-bar b { font-weight: 600; }
.widget-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.widget-row .actions-row { margin: 0; }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-list .check { margin: 0; }

@media print {
  .sidebar, .site-footer, .no-print, .banner, .skip, .help-launcher, .help-panel { display: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  body, .content, .sheet { background: #fff; color: #000; }
  .shell, .main-col { display: block; }
  .content { padding: 0; }
  a { color: #000; text-decoration: none; }
  .sheet { border: 0; box-shadow: none; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
