/* Page styles: Home, the workflow catalog, the three demos and Settings. Only the app.css tokens, so both themes follow. */
.spin{width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .8s linear infinite;flex:none;display:inline-block}
.d-block{display:block}
.letter{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--accent);color:var(--on-accent);font-weight:650;font-size:13px;flex:none;font-family:Inter,system-ui,sans-serif}
.letter.sm{width:24px;height:24px;font-size:12px;border-radius:7px}
.sechead .ti,.sechead+.ti{width:30px;height:30px;border-radius:9px}
.sechead h2{font-size:15px}
h3.sub{font-size:13px;color:var(--mut);font-weight:500;margin:20px 0 10px}
.summary{margin:0;font-size:14.5px;line-height:1.7;color:var(--ink-2);white-space:pre-line;min-height:3em;transition:opacity .2s}
.summary.loading{opacity:.55}

/* ---------- home */
.home{display:flex;flex-direction:column;gap:52px;padding-top:4px}
.home h2{font-size:22px;letter-spacing:-.02em;line-height:1.25}
.h-hero{position:relative;overflow:hidden;padding:48px 48px 40px;border-radius:24px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}
.h-hero::before{content:"";position:absolute;right:-160px;top:-180px;width:520px;height:520px;border-radius:50%;background:radial-gradient(closest-side,var(--cream),transparent);pointer-events:none}
.h-deco{position:absolute;right:44px;top:34px;display:grid;grid-template-columns:repeat(2,64px);gap:10px;pointer-events:none;user-select:none}
.h-deco span{display:grid;place-items:center;width:64px;height:64px;border-radius:18px;background:var(--surface);border:1px solid var(--line);color:var(--ink);box-shadow:var(--shadow);animation:h-float 6s ease-in-out infinite}
.h-deco span:nth-child(2){animation-delay:-1.5s;background:var(--cream)}.h-deco span:nth-child(3){animation-delay:-3s}.h-deco span:nth-child(4){animation-delay:-4.5s;background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
@keyframes h-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.h-hero>:not(.h-deco){position:relative}
.h-eyebrow{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px;border-radius:999px;background:var(--cream);color:var(--ink);font-size:12.5px;font-weight:500}
.h-hero h1{margin:18px 0 0;font-size:46px;line-height:1.08;letter-spacing:-.035em;max-width:620px}
html[lang=km] .h-hero h1{font-size:38px;line-height:1.45}
.h-alt{margin:12px 0 0;font-size:17px;font-weight:500;color:var(--ink-2)}
.h-lead{margin:10px 0 0;font-size:16.5px;line-height:1.6;color:var(--mut);max-width:620px}
html[lang=km] .h-lead{line-height:1.8}
.h-cta{display:flex;flex-wrap:wrap;gap:10px;margin-top:26px}
.h-pills{list-style:none;margin:28px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.h-pills li{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:12.5px;color:var(--ink-2)}
.h-pills svg.i{color:var(--ok)}
.h-sec{display:flex;flex-direction:column;gap:18px}
.h-sechead p{margin:6px 0 0;color:var(--mut);max-width:680px}
.h-demos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.h-demo{display:flex;flex-direction:column;gap:6px;padding:20px;transition:border-color .15s,box-shadow .15s,transform .15s var(--ease)}
.h-demo:hover{border-color:var(--cream-2);box-shadow:var(--shadow-2);transform:translateY(-2px)}
.h-demo-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.h-demo .ti{width:44px;height:44px;border-radius:13px}
.h-demo b{font-size:16px;font-weight:600}
.h-demo p{margin:0;color:var(--mut);font-size:13.5px;flex:1}
.h-demo-go{display:inline-flex;align-items:center;gap:6px;margin-top:12px;font-weight:500;font-size:13.5px}
.h-demo:hover .h-demo-go svg{transform:translateX(3px)}.h-demo-go svg{transition:transform .2s var(--ease)}
.h-cmp tr.click{cursor:pointer}
.h-cmp tr.click td{transition:background .12s}
.h-cmp tr.click:hover td,.h-cmp tr.click:focus-visible td{background:var(--surface-2)}
.h-cmp tr.click:focus-visible{outline-offset:-2px}
.wf{display:flex;align-items:center;gap:12px;min-width:220px}
.wf b{display:block;font-weight:500}.wf .small{display:block}
.h-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.h-steps li{display:flex;gap:14px;align-items:flex-start;padding:18px;border:1px solid var(--line);border-radius:var(--r);background:var(--surface)}
.h-steps .n,.flow .n{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-weight:600;font-size:13px;font-variant-numeric:tabular-nums}
.h-steps b{display:block;font-weight:600}
.h-steps p{margin:2px 0 0;color:var(--mut);font-size:13.5px}
.h-core{display:flex;flex-direction:column;gap:14px}
.h-contact{display:flex;align-items:center;gap:16px;flex-wrap:wrap;background:var(--cream);border-color:var(--cream-2)}
.h-contact p{margin:4px 0 0}.h-contact .btnrow{margin:0}
.h-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding-top:20px;border-top:1px solid var(--line)}
.h-fam{display:inline-flex;align-items:center;gap:8px;font-weight:600}
@media(max-width:1100px){.h-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.h-demos{grid-template-columns:minmax(0,1fr)}.h-demo{flex-direction:column}}
@media(max-width:860px){
 .home{gap:40px}
 .h-hero{padding:26px 20px 24px;border-radius:18px}
 .h-hero::before{width:320px;height:320px;right:-120px;top:-140px}
 .h-deco{display:none}
 .h-hero h1{font-size:32px}
 html[lang=km] .h-hero h1{font-size:27px}
 .h-lead{font-size:15px}
 .h-cta .btn{flex:1 1 auto}
 .h-steps{grid-template-columns:minmax(0,1fr)}
 .h-cmp .c-lvl{display:none}
}

/* ---------- catalog */
.wgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:14px}
.wcard{display:flex;flex-direction:column;gap:6px;padding:20px;transition:border-color .15s,box-shadow .15s,transform .15s var(--ease)}
.wcard:hover{border-color:var(--cream-2);box-shadow:var(--shadow-2);transform:translateY(-2px)}
.wcard-top{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.wcard-top .badge{margin-left:auto}
.wcard b{font-size:15.5px;font-weight:600}
.wcard p{margin:0;color:var(--mut);font-size:13.5px}
.wcard-for{font-size:12.5px;color:var(--ink-2);flex:1;padding-top:4px}
.wcard-foot{display:flex;gap:16px;flex-wrap:wrap;padding-top:12px;margin-top:8px;border-top:1px solid var(--line-2);font-size:12.5px}
.probs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.probs li{display:flex;gap:10px;align-items:flex-start;color:var(--ink-2)}
.probs svg.i{color:var(--bad);margin-top:3px}
.flow{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.flow li{position:relative;display:flex;gap:14px;align-items:flex-start;padding:0 0 16px}
.flow li:last-child{padding-bottom:0}
.flow li:not(:last-child)::before{content:"";position:absolute;left:14.5px;top:32px;bottom:2px;width:1px;background:var(--line)}
.flow li>span:last-child{padding-top:5px;color:var(--ink-2)}
.prices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:8px}
.prices>div{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border-radius:10px;background:var(--surface-2)}
.prices b{font-size:20px;font-weight:650;letter-spacing:-.02em}
.kv-for b{text-align:right;font-weight:500}
.pn{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.pn-a{display:flex;align-items:center;gap:12px;padding:14px 16px;transition:border-color .15s,background .15s}
.pn-a:hover{border-color:var(--cream-2);background:var(--surface-2)}
.pn-a b{display:block;font-weight:500}.pn-a .small{display:block}
.pn-a.r{justify-content:flex-end;text-align:right}
@media(max-width:560px){.pn{grid-template-columns:minmax(0,1fr)}}
.fields .kv b{font-weight:500}
.caption{display:flex;flex-direction:column;gap:8px}
.caption p{margin:0;line-height:1.6}
.caption-img{height:120px;border-radius:10px;background:linear-gradient(135deg,var(--cream),var(--surface-2));display:grid;place-items:center;color:var(--mut)}

/* ---------- chat bubbles (examples and the assistant) */
.bubbles{display:flex;flex-direction:column;gap:8px}
.bub{position:relative;max-width:84%;padding:9px 12px 9px;border-radius:16px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;animation:pop .2s var(--ease)}
html[lang=km] .bub,.bub[lang=km]{line-height:1.7}
.bub.in{align-self:flex-end;background:var(--accent);color:var(--on-accent);border-bottom-right-radius:5px}
.bub.out{align-self:flex-start;background:var(--surface);border:1px solid var(--line);color:var(--ink);border-bottom-left-radius:5px}
.bub-t{display:inline-block;margin-left:10px;font-size:10.5px;opacity:.55;vertical-align:-1px;float:right;margin-top:6px}
.phone{padding:16px;border-radius:14px;background:var(--surface-2)}
.typing{display:inline-flex;gap:4px;align-items:center;padding:12px 14px}
.typing i{width:6px;height:6px;border-radius:50%;background:var(--mut-2);animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes blink{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}

/* ---------- assistant */
.as-grid{grid-template-columns:minmax(0,1fr) 420px}
@media(max-width:1100px){.as-grid{grid-template-columns:minmax(0,1fr)}}
.phonecard{display:flex;flex-direction:column;height:min(680px,calc(100dvh - 200px));min-height:460px;overflow:hidden}
.chat-head{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.chat-head b{display:block;font-weight:600;line-height:1.25}.chat-head span:not(.badge):not(.dot):not(.chat-av){display:block;font-size:12px;color:var(--mut)}
.chat-av{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--cream);color:var(--ink);font-weight:650;flex:none}
.chat-av.lg{width:56px;height:56px;font-size:22px}
.chat-msgs{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:8px;background:var(--surface-2);overscroll-behavior:contain}
.chat-empty{margin:auto;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;color:var(--mut);max-width:300px}
.chat-empty b{color:var(--ink);font-size:15px}
.chat-quick{display:flex;gap:6px;overflow-x:auto;padding:10px 12px 0;background:var(--surface);scrollbar-width:none}
.chat-quick:empty{display:none}
.chat-quick .chip{flex:none;height:32px}
.chat-in{display:flex;gap:8px;padding:10px 12px 12px;background:var(--surface)}
.chat-in .inp{height:40px;border-radius:999px;padding:0 16px;background:var(--surface-2);border-color:transparent}
.chat-in .inp:focus-visible{outline:none;border-color:var(--mut-2);background:var(--surface)}
.chat-in .btn{width:40px;height:40px;border-radius:50%}
.as-side{display:flex;flex-direction:column;min-width:0}
.as-tabs{margin:14px 14px 0;display:flex}
.as-tabs button{flex:1;justify-content:center}
.as-body{padding:16px;max-height:min(600px,calc(100dvh - 280px));overflow-y:auto}
@media(max-width:1100px){.as-body{max-height:none}}
.as-fine{padding:0 16px 14px;margin-top:auto}
.bi{display:grid;grid-template-columns:1fr 1fr;gap:6px}
@media(max-width:480px){.bi{grid-template-columns:minmax(0,1fr)}}
.mi-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 72px 30px;gap:6px;margin-bottom:6px;align-items:center}
.faq-row{padding:12px 0 14px;border-bottom:1px solid var(--line-2);margin-bottom:12px}
.faq-row .field{margin-bottom:10px}
.as-notify{margin-bottom:6px}
.as-body>.note{margin-bottom:4px}
a.note:hover{border-color:var(--mut-2)}
.ib-h{display:flex;align-items:center;gap:8px;font-size:13px;margin:18px 0 8px}
.iblist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.ib{display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.ib.done{opacity:.65}
.ib-top{display:flex;align-items:baseline;gap:8px;width:100%}
.ib-r{margin-left:auto}

/* ---------- KPIs and charts */
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
@media(max-width:960px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
.kpi{position:relative;display:flex;flex-direction:column;gap:2px;padding:16px 18px;min-width:0}
.kpi-i{position:absolute;right:14px;top:14px;color:var(--mut-2)}
.kpi-l{font-size:12.5px;color:var(--mut);padding-right:22px}
.kpi-v{font-size:26px;font-weight:650;letter-spacing:-.025em;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi-s{display:flex;flex-wrap:wrap;gap:4px 8px;font-size:12px;color:var(--mut)}
.kpi-d{font-weight:600;color:var(--mut)}.kpi-d span{font-weight:400;color:var(--mut)}
.kpi-d.good{color:var(--ok)}.kpi-d.bad{color:var(--bad)}
@media(max-width:560px){.kpi{padding:14px}.kpi-v{font-size:21px}}
.chartbox{position:relative;padding:4px 14px 10px;min-height:120px}
.card.pad .chartbox{padding:0}
.chart{display:block;max-width:100%;overflow:visible}
.ch-grid{stroke:var(--chart-grid);stroke-width:1;shape-rendering:crispEdges}
.ch-ax{font:11px Inter,system-ui,sans-serif;fill:var(--mut);font-variant-numeric:tabular-nums}
html[lang=km] .ch-ax{font-family:var(--khm)}
.ch-val{font:600 11.5px Inter,system-ui,sans-serif;fill:var(--ink);font-variant-numeric:tabular-nums}
.ch-bar{fill:var(--chart);transition:opacity .12s}
.ch-bar.dim{fill:var(--chart-2)}
.ch-hit{fill:transparent}
.ch-col{outline:none;cursor:default}
.chart:hover .ch-bar,.chart:focus-within .ch-bar{opacity:.55}
.ch-col:hover .ch-bar,.ch-col:focus .ch-bar{opacity:1}
.ch-col:focus-visible .ch-hit{stroke:var(--focus);stroke-width:1.5}
.ch-tip{position:absolute;left:0;top:0;transform:translateX(-50%);background:var(--accent);color:var(--on-accent);font-size:12px;font-weight:500;line-height:1.3;padding:6px 9px;border-radius:6px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .1s;z-index:5;box-shadow:var(--shadow-2)}
.ch-tip.on{opacity:1}
.hbars{display:flex;flex-direction:column;gap:12px}
.hb-top{display:flex;align-items:baseline;gap:10px;margin-bottom:5px;font-size:13.5px}
.hb-l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hb-bar{height:8px;border-radius:999px;background:var(--line-2);overflow:hidden}
.hb-bar i{display:block;height:100%;background:var(--chart);border-radius:0 4px 4px 0}
.hb-n{display:block;font-size:11.5px;color:var(--mut);margin-top:3px}

/* ---------- reports */
.needs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.need{display:flex;gap:10px;align-items:flex-start}
.need .ti{width:32px;height:32px;border-radius:9px}
.need b{display:block;font-weight:600}.need span{display:block}
@media(max-width:960px){.needs{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.needs{grid-template-columns:minmax(0,1fr)}}
.drop>span{display:block}

/* ---------- Telegram message preview */
.tgp{border-radius:14px;background:var(--surface-2);padding:12px;display:flex;flex-direction:column;gap:10px}
.tgp-head{display:flex;align-items:center;gap:10px}
.tgp-head b{display:block;font-size:13.5px;line-height:1.2}.tgp-head span{display:block;font-size:11.5px;color:var(--mut)}
.tgp-msg{position:relative;align-self:flex-start;max-width:100%;background:var(--surface);border:1px solid var(--line);border-radius:14px;border-top-left-radius:5px;padding:10px 12px 18px;font-size:13.5px;line-height:1.55;overflow-wrap:anywhere}
html[lang=km] .tgp-msg{line-height:1.75}
.tgp-msg pre{margin:8px 0;padding:8px 10px;background:var(--surface-2);border-radius:8px;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-x:auto}
.tgp-time{position:absolute;right:10px;bottom:4px;font-size:10.5px;color:var(--mut-2)}

/* ---------- inventory */
.iv-head{flex-wrap:wrap}
.iv-head .search{width:200px;height:32px}
.search{display:flex;align-items:center;gap:8px;height:36px;border:1px solid var(--line);border-radius:var(--r-s);padding:0 10px;width:240px;color:var(--mut);background:var(--surface);transition:border-color .15s}
.search:focus-within{border-color:var(--ink)}
.search input{border:0;outline:0;width:100%;background:transparent;color:var(--ink);height:100%;font-size:13px}
.iv-tbl td{padding-top:9px;padding-bottom:9px}
.iv-tbl td:first-child{min-width:160px}
.iv-tbl .c-rate,.iv-tbl .c-left{white-space:nowrap}
.iv-tbl .c-stock{min-width:110px}
.iv-tbl .c-stock .bar{margin-top:5px;width:96px}
.minin{width:64px;text-align:right}
.c-act{white-space:nowrap}
.c-act .btn{color:var(--mut)}.c-act .btn:hover{color:var(--ink)}
.iv-add{border-top:1px solid var(--line);border-radius:0 0 var(--r) var(--r)}
.iv-add>summary{border-radius:0 0 var(--r) var(--r)}
.iv-add[open]>summary{border-radius:0}
.iv-new{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px}
.iv-new .btnrow{grid-column:1/-1;margin-top:0}
@media(max-width:700px){.iv-new{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.iv-type{display:flex}.iv-type button{flex:1;justify-content:center}
.iv-auto{margin:14px 0 0}
.moves{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.moves li{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-bottom:1px solid var(--line-2);font-size:13.5px}
.moves li:last-child{border-bottom:0}
.mv{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;flex:none}
.mv.in{background:var(--ok-soft);color:var(--ok)}.mv.out{background:var(--surface-2);color:var(--mut)}
@media(max-width:860px){
 .iv-tbl .c-rate,.iv-tbl .c-left{display:none}
 .iv-head .search{width:100%;order:3}
}

/* ---------- settings */
.st-wide{grid-column:1/-1}
.st-p{margin:-6px 0 14px}
.st-steps{margin:4px 0 18px}
.st-steps li>span:last-child{padding-top:5px}
.st-fine{margin-top:14px}
.pw{display:flex;gap:6px;align-items:center}
.pw .inp{flex:1}
.st-ai{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:16px}
@media(max-width:560px){.st-ai{grid-template-columns:minmax(0,1fr)}}
.st-gem{padding-top:4px}
