/* SONGWOK design system — tokens per reference/brand-ui.md */

/* Noto Sans Thai (variable 400–800), self-hosted, SIL OFL 1.1 — see assets/fonts/OFL.txt */
@font-face {
  font-family: "Noto Sans Thai"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/noto-sans-thai-thai.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Sans Thai"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/noto-sans-thai-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans Thai"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/noto-sans-thai-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --sw-primary: #B5121B; --sw-primary-dark: #7F1015; --sw-accent: #FFC928; --sw-accent-dark: #8A6A00;
  --sw-text: #202124; --sw-muted: #5F6368; --sw-bg: #F7F8FA; --sw-surface: #FFFFFF; --sw-border: #E3E5E8;
  --ok: #137333; --ok-bg: #E6F4EA; --warn: #8A5300; --warn-bg: #FEF3D6; --err: #B3261E; --err-bg: #FCE8E6; --info: #0B57D0; --info-bg: #E8F0FE; --mutedc: #5F6368; --muted-bg: #F1F3F4;
  --sw-radius: 12px; --s: 8px; --hdr-h: 60px; --side-w: 240px;
  --sw-font: "Noto Sans Thai", "Sarabun", Tahoma, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(32,33,36,.06), 0 1px 3px rgba(32,33,36,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sw-font); font-size: 15.5px; line-height: 1.6; color: var(--sw-text); background: var(--sw-bg); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 var(--s); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 var(--s); }
a { color: var(--sw-primary); }
code { font-family: Consolas, monospace; font-size: .85em; background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--sw-accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--sw-muted); } .small { font-size: .85rem; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.ico-xs { width: 14px; height: 14px; } .ico-lg { width: 32px; height: 32px; color: var(--sw-primary); } .ico-xl { width: 44px; height: 44px; color: var(--sw-primary); }

/* header */
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.hdr { position: sticky; top: 0; z-index: 30; height: var(--hdr-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s); padding: 0 16px; background: var(--sw-surface); border-bottom: 1px solid var(--sw-border); }
.hdr-left, .hdr-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-img { width: 40px; height: 40px; border-radius: 50%; display: block; }
.wordmark { font-weight: 800; font-size: 1.2rem; letter-spacing: .5px; color: var(--sw-primary); }
.wordmark span { color: #C99700; }
.demo-badge { font-size: .72rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); border: 1px solid #F3D58A; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lang { display: flex; background: var(--muted-bg); border-radius: 999px; padding: 3px; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 10px 4px 4px; border-radius: 999px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--sw-text); min-height: 32px; }
.lang-btn.active { background: #fff; box-shadow: var(--shadow); font-weight: 700; }
.flag { display: inline-block; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.flag svg { display: block; width: 100%; height: 100%; }
.role-switch { position: relative; display: flex; align-items: center; gap: 6px; }
.role-chip { font-size: .78rem; font-weight: 700; color: #fff; background: var(--sw-primary); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.role-switch select { font: inherit; font-size: .85rem; border: 1px solid var(--sw-border); border-radius: 8px; padding: 6px 8px; max-width: 190px; background: #fff; min-height: 36px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--sw-text); cursor: pointer; position: relative; text-decoration: none; }
.icon-btn:hover { background: var(--muted-bg); }
.icon-btn.sm { width: 32px; height: 32px; }
.bell .dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--sw-primary); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.net { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.net.on { color: var(--ok); background: var(--ok-bg); } .net.off { color: var(--err); background: var(--err-bg); }
.only-mobile { display: none; }

/* layout */
.layout { display: flex; min-height: calc(100vh - var(--hdr-h)); }
.sidebar { width: var(--side-w); flex: none; background: var(--sw-surface); border-right: 1px solid var(--sw-border); position: sticky; top: var(--hdr-h); height: calc(100vh - var(--hdr-h)); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar ul { list-style: none; margin: 0; padding: 12px 8px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--sw-text); text-decoration: none; font-size: .93rem; }
.sidebar a:hover { background: var(--muted-bg); }
.sidebar a.active { background: #FBE9EA; color: var(--sw-primary); font-weight: 700; }
.nav-count { margin-left: auto; background: var(--sw-primary); color: #fff; font-size: .72rem; border-radius: 999px; padding: 0 7px; }
.side-foot { margin-top: auto; padding: 12px 16px; font-size: .75rem; color: var(--sw-muted); border-top: 1px solid var(--sw-border); }
.side-foot .btn { margin-top: 4px; }
.view { flex: 1; min-width: 0; padding: 24px; max-width: 1280px; outline: none; }
.drawer-scrim { display: none; }
.bottom-nav { display: none; }

/* page parts */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { outline: none; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: var(--sw-radius); box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px 0; flex-wrap: wrap; }
.card-h h2 { margin: 0; }
.card-b { padding: 14px 18px 18px; }
.card.highlight { border-color: var(--sw-primary); }
article.card, .card.feature { padding: 16px; }
.grid-2, .grid-3, .grid-4, .grid-5, .grid-6, .grid-2-1 { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card, .grid-2-1 > .card { margin-bottom: 0; }
.align-start { align-items: start; }
.kpis { margin-bottom: 16px; }
.kpi { background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: var(--sw-radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: .82rem; color: var(--sw-muted); }
.kpi-value { font-size: 1.35rem; font-weight: 800; word-break: break-word; }
.kpi-sub { font-size: .78rem; color: var(--sw-muted); }
.kpi-ok { border-left: 4px solid var(--ok); } .kpi-err { border-left: 4px solid var(--err); }
.card .kpis .kpi { box-shadow: none; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .92rem; padding: 8px 16px; min-height: 40px; border-radius: 10px; border: 1px solid var(--sw-border); background: #fff; color: var(--sw-text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--muted-bg); }
.btn-primary { background: var(--sw-primary); border-color: var(--sw-primary); color: #fff; }
.btn-primary:hover { background: var(--sw-primary-dark); }
.btn-danger { background: #fff; color: var(--err); border-color: #F1B8B4; }
.btn-danger:hover { background: var(--err-bg); }
.btn-ghost { background: #fff; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
.btn-lg { min-height: 48px; padding: 10px 20px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-row, .btn-col { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-col { flex-direction: column; align-items: flex-start; }
.link { background: none; border: 0; color: var(--sw-primary); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; min-width: 0; }
.field > span { font-weight: 600; }
.field input, .field select, .field textarea, .qty { font: inherit; padding: 8px 10px; border: 1px solid #C9CDD2; border-radius: 8px; background: #fff; min-height: 40px; width: 100%; }
.field input[aria-invalid="true"] { border-color: var(--err); }
.field-err { color: var(--err); font-size: .8rem; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; font-weight: 500; color: var(--sw-muted); }
.field.inline select, .field.inline input { width: auto; }
.field.grow { flex: 1; } .field.grow input { width: 100%; }
.qty { width: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.form-error { color: var(--err); display: flex; gap: 6px; align-items: center; }
fieldset { border: 1px solid var(--sw-border); border-radius: 10px; padding: 10px 14px; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; font-size: .9rem; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--sw-primary); flex: none; }
.check.strong { font-weight: 700; margin-top: 8px; }
.consent { background: #FFFBEF; border-color: #F3D58A; }
.consent legend { display: flex; align-items: center; gap: 6px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.pick-list { display: grid; gap: 8px; border: 0; padding: 0; margin-bottom: 12px; }
.pick { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--sw-border); border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; }
.pick:has(input:checked) { border-color: var(--sw-primary); background: #FFF7F7; }
.pick input { margin-top: 4px; accent-color: var(--sw-primary); width: 18px; height: 18px; flex: none; }
.pick.compact { padding: 8px 12px; align-items: center; } .pick.compact input { margin-top: 0; }
.pick-b { flex: 1; min-width: 0; } .pick-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.score { margin-left: auto; font-weight: 700; color: var(--sw-primary); }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; color: var(--sw-muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 8px 0; }
.seg legend { width: 100%; padding: 0; margin-bottom: 4px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 12px; border: 1px solid var(--sw-border); border-radius: 8px; font-size: .88rem; min-height: 40px; }
.seg input:checked + span { background: var(--sw-primary); color: #fff; border-color: var(--sw-primary); }
.seg input:focus-visible + span { outline: 3px solid var(--sw-accent); }
.seg-tabs, .tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--muted-bg); padding: 3px; border-radius: 10px; }
.seg-tabs button, .tabs button { border: 0; background: transparent; font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 8px; cursor: pointer; min-height: 34px; }
.seg-tabs button.active, .tabs button.active { background: #fff; box-shadow: var(--shadow); font-weight: 700; color: var(--sw-primary); }
.tabs { margin-bottom: 12px; }

/* badges, notices */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.b-ok { color: var(--ok); background: var(--ok-bg); } .b-warn { color: var(--warn); background: var(--warn-bg); } .b-err { color: var(--err); background: var(--err-bg); }
.b-info { color: var(--info); background: var(--info-bg); } .b-muted { color: var(--mutedc); background: var(--muted-bg); }
.demo-tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 1px 8px; border-radius: 999px; }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }
.notice.info { background: var(--info-bg); color: #08306B; } .notice.warn { background: var(--warn-bg); color: #5C3A00; } .notice.ok { background: var(--ok-bg); color: #0B4F22; }
.notice .ico { margin-top: 2px; }
.disclaimer { display: flex; gap: 8px; font-size: .8rem; color: var(--sw-muted); border-top: 1px dashed var(--sw-border); padding-top: 12px; margin-top: 8px; }
.empty { text-align: center; padding: 28px 12px; color: var(--sw-muted); }
.empty .ico-lg { color: #BDC1C6; }
.empty p { margin: 8px 0 12px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--sw-border); border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--sw-border); vertical-align: top; }
.tbl thead th { background: #FAFAFB; font-weight: 700; color: var(--sw-muted); font-size: .8rem; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl.pl th { font-weight: 500; } .tbl.pl tr.strong th, .tbl.pl tr.strong td { font-weight: 800; }
.mini-list { list-style: none; margin: 0; padding: 0; font-size: .84rem; }
.timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--sw-border); font-size: .84rem; }
.timeline li { margin-bottom: 4px; } .timeline p { margin: 0; }
.track { display: flex; gap: 3px; list-style: none; padding: 0; margin: 0 0 4px; }
.track li { width: 16px; height: 6px; border-radius: 3px; background: var(--sw-border); }
.track li.done { background: var(--sw-primary); }

/* charts */
.chart { margin: 0; } .chart svg { width: 100%; height: auto; display: block; }
.bar { fill: var(--sw-primary); } .bar:hover { fill: var(--sw-primary-dark); }
.axis { font-size: 11px; fill: var(--sw-muted); } .axis-line { stroke: var(--sw-border); }
.share { list-style: none; padding: 0; margin: 0 0 12px; }
.share li { margin-bottom: 10px; }
.share-row { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; }
.share-track { height: 8px; background: var(--muted-bg); border-radius: 4px; overflow: hidden; }
.share-fill { height: 100%; background: var(--sw-primary); border-radius: 4px; }
.progress { height: 10px; background: var(--muted-bg); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--sw-primary), #D9363E); }

/* home */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: 16px; padding: 28px; margin-bottom: 16px; box-shadow: var(--shadow); }
.eyebrow { color: var(--sw-primary); font-weight: 700; font-size: .82rem; letter-spacing: .3px; }
.hero h1 { font-size: 2rem; outline: none; }
.lead { font-size: 1.05rem; color: #3C4043; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.tagline { font-size: .8rem; color: var(--sw-muted); letter-spacing: .5px; }
.hero-art { display: grid; gap: 12px; }
.logo-panel { background: #000; border-radius: 14px; padding: 10px; }
.logo-panel img { width: 100%; height: auto; display: block; }
.stall { width: 100%; max-height: 170px; }
.conn { margin: 0; } .conn svg { width: 100%; max-width: 680px; display: block; margin: 0 auto; height: auto; }
.c-line { stroke: var(--sw-primary); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: .7; }
.c-node { fill: #fff; stroke: var(--sw-primary); stroke-width: 2; }
.c-ico { fill: none; stroke: var(--sw-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.c-label { font-size: 14px; font-weight: 700; fill: var(--sw-text); }
.c-flow { font-size: 11px; fill: var(--sw-muted); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.c-hub { fill: var(--sw-primary); } .c-hub-t { fill: #fff; font-weight: 800; font-size: 16px; } .c-hub-s { fill: var(--sw-accent); font-size: 12px; }
.feature h3 { margin-top: 8px; } .feature p { font-size: .9rem; color: var(--sw-muted); margin: 0; }
.model-mini { display: block; padding: 16px; text-decoration: none; color: inherit; margin: 0; }
.model-mini:hover { border-color: var(--sw-primary); } .model-mini h3 { margin-top: 8px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.steps li { display: flex; gap: 10px; } .steps p { font-size: .88rem; color: var(--sw-muted); }
.step-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--sw-primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.chips { list-style: none; padding: 0; margin: 0 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.chips li { background: #FBE9EA; color: var(--sw-primary-dark); padding: 5px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600; }
.grid-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.role-card { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--sw-border); background: #fff; border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; min-height: 88px; }
.role-card:hover { border-color: var(--sw-primary); background: #FFF7F7; }
.role-card strong { color: var(--sw-primary); } .role-card span { font-size: .84rem; color: var(--sw-muted); }
.bullets { margin: 0 0 10px; padding-left: 20px; } .bullets li { margin-bottom: 4px; }
.core { font-weight: 800; color: var(--sw-primary); }
.roadmap-card { border: 1px dashed #C9CDD2; border-radius: 12px; padding: 14px; background: #FCFCFD; }
.roadmap-card h3 { margin-top: 8px; } .roadmap-card p { font-size: .86rem; color: var(--sw-muted); margin: 0; }
.roadmap-card .price { color: var(--sw-text); font-weight: 800; font-size: 1.05rem; }
.flow { color: var(--sw-muted); } .flow span { white-space: nowrap; }

/* builder / models */
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--sw-muted); background: #fff; border: 1px solid var(--sw-border); padding: 4px 12px 4px 4px; border-radius: 999px; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; background: var(--muted-bg); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.stepper li.current { color: var(--sw-primary); border-color: var(--sw-primary); font-weight: 700; }
.stepper li.current span { background: var(--sw-primary); color: #fff; }
.stepper li.done span { background: var(--ok-bg); color: var(--ok); }
.payback { margin-top: 8px; } .setup { margin-top: 12px; }
.model-h, .product-h, .course-h { display: flex; justify-content: space-between; align-items: flex-start; }
.model h3, .product h3, .course h3 { margin-top: 10px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: .88rem; }
.dl dt { color: var(--sw-muted); } .dl dd { margin: 0; font-weight: 600; }
.dl.compact { font-size: .82rem; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--sw-primary); margin: 4px 0; }
.price small { font-size: .8rem; color: var(--sw-muted); font-weight: 400; }
.add-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.add-row .qty { width: 72px; flex: none; } .add-row .btn { flex: 1 1 auto; min-width: 0; }
.total { font-size: 1.05rem; margin: 12px 0; }
.stepper-qty { display: inline-flex; align-items: center; gap: 6px; }
.stepper-qty span { min-width: 28px; text-align: center; font-weight: 700; }

/* POS */
.net-toggle { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pos { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.pos-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; min-height: 140px; border: 1px solid var(--sw-border); background: #fff; border-radius: 12px; cursor: pointer; font: inherit; text-align: center; box-shadow: var(--shadow); }
.pos-item:hover:not([disabled]) { border-color: var(--sw-primary); }
.pos-item:active:not([disabled]) { transform: scale(.98); }
.pos-item[disabled] { opacity: .45; cursor: not-allowed; }
.pi-name { font-weight: 700; font-size: .9rem; } .pi-price { color: var(--sw-primary); font-weight: 800; }
.pi-stock { font-size: .75rem; color: var(--sw-muted); } .pi-stock.low { color: var(--err); font-weight: 700; }
.pos-cart { padding: 16px; position: sticky; top: calc(var(--hdr-h) + 12px); }
.pos-lines { list-style: none; padding: 0; margin: 0 0 12px; }
.pos-lines li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--sw-border); }
.pl-name { font-weight: 600; font-size: .9rem; } .pl-name small { display: block; color: var(--sw-muted); font-weight: 400; }
.pl-amt { font-weight: 700; min-width: 70px; text-align: right; }
.pos-pay { display: grid; gap: 8px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 8px 0; }
.totals dt { color: var(--sw-muted); } .totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 1.3rem; font-weight: 800; color: var(--sw-text); }
.receipt { font-family: Consolas, "Courier New", monospace; max-width: 320px; margin: 0 auto; font-size: .85rem; }
.receipt h2 { text-align: center; margin-bottom: 0; } .receipt > p { text-align: center; margin: 4px 0; }
.receipt table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.receipt td { padding: 2px 0; } .receipt tr.sep td { border-top: 1px dashed #999; padding-top: 6px; }
.receipt tr.grand td { font-weight: 800; font-size: 1rem; }
.r-demo { font-weight: 700; color: var(--err); }

/* dashboard etc */
.tasks, .recent, .checklist, .lesson-list { list-style: none; padding: 0; margin: 0; }
.tasks li a { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--sw-border); color: var(--sw-text); text-decoration: none; font-size: .9rem; }
.tasks li a:hover { color: var(--sw-primary); }
.recent li { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--sw-border); font-size: .88rem; }
.checklist li { display: flex; gap: 6px; align-items: center; padding: 3px 0; font-size: .9rem; color: var(--sw-muted); }
.checklist li.done { color: var(--ok); font-weight: 600; }
.lesson-list li { padding: 4px 0; }
.badge-earned { display: flex; gap: 6px; align-items: center; color: var(--warn); font-weight: 700; font-size: .85rem; margin-top: 8px; }
.badge-earned .ico { color: #C99700; }
.stars { color: #C99700; letter-spacing: 1px; }
.golden { padding-left: 0; list-style: none; }
.golden li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sw-border); }
.kpi-inline { margin-top: 8px; }

/* toast & modal */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; background: #202124; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: .9rem; transition: opacity .3s, transform .3s; }
.toast.t-err { background: #8C1D18; } .toast.t-warn { background: #6B4400; }
.toast.out { opacity: 0; transform: translateY(8px); }
#modal-root { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(32,33,36,.5); }
.modal { position: relative; background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--sw-border); }
.modal-h h2 { margin: 0; } .modal-b { padding: 16px 18px; } .modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--sw-border); }
#print-area { display: none; }

/* responsive */
@media (max-width: 1100px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-sm { display: none; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: var(--hdr-h); bottom: 0; height: auto; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .drawer-scrim { display: block; position: fixed; inset: var(--hdr-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 35; }
  .view { padding: 16px 14px 88px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--sw-border); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: .68rem; color: var(--sw-muted); text-decoration: none; min-height: 56px; text-align: center; line-height: 1.2; }
  .bottom-nav a.active { color: var(--sw-primary); font-weight: 700; }
  .toasts { bottom: 76px; }
  .hero { grid-template-columns: 1fr; padding: 20px; } .hero h1 { font-size: 1.5rem; }
  .grid-2, .grid-3, .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .pos { grid-template-columns: minmax(0, 1fr); } .pos-cart { position: static; }
  .role-switch select { max-width: 130px; }
  .wordmark { display: none; }
  .hdr-reset { display: none; }
}
@media (max-width: 600px) {
  .hdr { padding: 0 8px; gap: 4px; } .hdr-right { gap: 4px; } .hdr-left { gap: 4px; }
  .hdr .net, .hdr-reset { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .demo-badge { display: none; }
  .lang-btn span:last-child { display: none; } .lang-btn { padding: 4px; }
  .role-chip { display: none; } .role-switch select { max-width: 112px; font-size: .8rem; }
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.1rem; }
  .page-head h1 { font-size: 1.3rem; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .field.inline { flex-wrap: wrap; }
  .net span.hide-sm { display: none; }
  /* stacked tables */
  .table-wrap { border: 0; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--sw-border); border-radius: 10px; margin-bottom: 10px; padding: 6px 0; background: #fff; }
  .tbl td { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 38% 1fr; gap: 8px; text-align: left !important; }
  .tbl td::before { content: attr(data-label); color: var(--sw-muted); font-size: .78rem; font-weight: 600; }
  .tbl td[data-label=""] { grid-template-columns: 1fr; } .tbl td[data-label=""]::before { display: none; }
  .tbl.pl tr { display: flex; justify-content: space-between; border: 0; margin: 0; border-bottom: 1px solid var(--sw-border); border-radius: 0; }
  .tbl.pl th, .tbl.pl td { display: block; width: auto; border: 0; }
  .tbl.pl td::before { display: none; }
}
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
