/* Self-hosted fonts only (CSP: no external requests). */
@font-face{font-family:"Noto Sans Thai";src:url("/static/fonts/NotoSansThai-thai-wght-normal.woff2") format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:"Manrope";src:url("/static/fonts/Manrope-VariableFont_wght.woff2") format("woff2");font-weight:200 800;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url("/static/fonts/JetBrainsMono-VariableFont_wght.woff2") format("woff2");font-weight:400;font-display:swap}
:root{
  --bg:#FAF8F5;--surface:#FFFFFF;--surface-2:#F3EEE6;--ink:#18221E;--muted:#5F6B65;--line:#E8E2D8;
  --accent:#D46238;--accent-hover:#BE532B;--accent-text:#B04A22;--accent-fg:#FFFFFF;--accent-soft:rgba(212,98,56,.10);
  --warn:#9A5B0A;--warn-soft:rgba(154,91,10,.10);--neg:#B42318;--neg-soft:rgba(180,35,24,.09);--pos:#2E7D5B;--chip:#F1EBE1;
  --live-soft:rgba(46,125,91,.12);--info:#2F5FD0;--ai:#6D45C4;--shadow:0 1px 2px rgba(24,34,30,.06),0 4px 14px rgba(24,34,30,.05);
  --line-ch:#2E7D5B;--ic-ch:#2F5FD0;--tg-ch:#1B7FB0;
  --display:"Manrope","Noto Sans Thai","Sarabun","Thonburi","Leelawadee UI",Tahoma,system-ui,sans-serif;
  --body:"Manrope","Noto Sans Thai","Sarabun","Thonburi","Leelawadee UI",Tahoma,system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"JetBrains Mono",ui-monospace,Menlo,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root{
  --bg:#1A1714;--surface:#23201C;--surface-2:#2B2722;--ink:#F2EDE6;--muted:#A8A196;--line:#38332D;
  --accent:#E07A4F;--accent-hover:#EA8C63;--accent-text:#F0946B;--accent-fg:#1A1714;--accent-soft:rgba(224,122,79,.14);
  --warn:#E8B04A;--warn-soft:rgba(232,176,74,.14);--neg:#F28B82;--neg-soft:rgba(242,139,130,.14);--pos:#6FCF9B;--chip:#2B2722;
  --live-soft:rgba(111,207,155,.14);--info:#8FB0FF;--ai:#B9A0FF;--shadow:0 1px 2px rgba(0,0,0,.3);
  --line-ch:#6FCF9B;--ic-ch:#8FB0FF;--tg-ch:#6EC6F0;color-scheme:dark}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.65}
a{color:var(--accent-text)}
h1,h2,h3{font-family:var(--display);margin:0;line-height:1.3;text-wrap:balance}
h1{font-size:24px}h2{font-size:17px;margin-bottom:12px}h3{font-size:15px}
p{margin:0 0 10px}
.sub{color:var(--muted);font-size:14px;margin:4px 0 0}
.muted{color:var(--muted)}
.error{color:var(--neg);margin:8px 0}
.ok{color:var(--pos);margin:8px 0}
.mono{font-family:var(--mono)}

header.top{background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.top-in{max-width:1160px;margin:0 auto;padding:10px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px}
.brand{font-family:var(--display);font-weight:700;font-size:17px;display:flex;align-items:center;gap:8px;color:var(--ink);text-decoration:none}
.brand i{width:9px;height:9px;border-radius:50%;background:var(--accent);display:inline-block}
.co{color:var(--muted);font-size:14px}
nav.tabs{display:flex;gap:4px;flex-wrap:wrap}
nav.tabs a{font-size:14px;color:var(--muted);padding:6px 12px;border-radius:6px;text-decoration:none}
nav.tabs a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-text);font-weight:700}
nav.tabs a:hover{color:var(--ink)}
.tools{margin-left:auto;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tools form{margin:0}
.who{font-size:13px;color:var(--muted)}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

main{max-width:1160px;margin:0 auto;padding:24px 16px 56px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:18px;min-width:0;box-shadow:var(--shadow)}
.card+.card{margin-top:16px}
.grid>.card+.card{margin-top:0}
.grid{display:grid;gap:16px}
.kpis{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:18px}
@media (max-width:860px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
.kpi .v{font-family:var(--display);font-size:28px;font-weight:700;font-variant-numeric:tabular-nums}
.kpi .l{font-size:13px;color:var(--muted)}
@media (max-width:520px){.kpi .v{font-size:21px}.kpi{padding:14px}}
.kpi .d{font-size:12px;color:var(--muted)}
.row2{grid-template-columns:minmax(0,3fr) minmax(0,2fr);margin-top:16px}
@media (max-width:860px){.row2{grid-template-columns:1fr}}
.pagehead{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:10px}
.pagehead+.card{margin-top:16px}

/* buttons and forms */
button,.btn{font:inherit;font-size:14px;border:0;border-radius:8px;padding:8px 16px;background:var(--accent);color:var(--accent-fg);font-weight:600;cursor:pointer;text-decoration:none;display:inline-block}
button:not(.ghost):not(.danger):hover,.btn:not(.ghost):hover{background:var(--accent-hover)}
button.ghost,.btn.ghost{background:transparent;color:var(--ink);border:1px solid var(--line);font-weight:500}
button.danger{background:var(--neg);color:#fff}
/* Coloured actions (owner's request 2026-11-06, chat page): the colour says what the button does.
   red = spam · green = done · orange = pin · blue = go / tools · purple = AI · yellow = note */
.t-neg{--tc:var(--neg)}.t-pos{--tc:var(--pos)}.t-pin{--tc:var(--accent-text)}.t-info{--tc:var(--info)}.t-ai{--tc:var(--ai)}.t-note{--tc:var(--warn)}
button.ghost.tone,.btn.ghost.tone{color:var(--tc);background:color-mix(in srgb,var(--tc) 10%,transparent);border-color:color-mix(in srgb,var(--tc) 40%,transparent);font-weight:600}
button.ghost.tone:hover,.btn.ghost.tone:hover{background:color-mix(in srgb,var(--tc) 18%,transparent);border-color:var(--tc)}
button.ai-go{background:var(--ai);color:var(--surface)}
button.ai-go:not(.ghost):hover{background:color-mix(in srgb,var(--ai) 85%,var(--ink))}
.inline{display:inline-block;margin:0 6px 6px 0}
form>p:has(>button:only-child){margin-top:18px}
label{display:block;margin:12px 0 4px;font-weight:600;font-size:14px}
input[type=text],input[type=email],input[type=password],input[type=search],input[type=date],select{width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface)}
.seg button,.seg a{font:inherit;font-size:13px;border:0;background:transparent;padding:5px 12px;color:var(--muted);cursor:pointer;font-weight:500;text-decoration:none;border-radius:0}
.seg button[aria-pressed="true"],.seg a[aria-current="true"]{background:var(--accent-soft);color:var(--accent-text);font-weight:700}
.filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px}
.filters form{display:flex;gap:8px;flex:1 1 280px;margin:0}
.filters input[type=search]{flex:1}

/* tables */
.table-x{overflow-x:auto}
table{border-collapse:collapse;width:100%}
th{text-align:left;font-size:12px;color:var(--muted);font-weight:600;border-bottom:1px solid var(--line);padding:8px;white-space:nowrap}
td{border-bottom:1px solid var(--line);padding:10px 8px;vertical-align:top;font-size:14px}
td.n{font-variant-numeric:tabular-nums;text-align:right;font-family:var(--mono)}
th.n{text-align:right}
code.link{display:block;word-break:break-all;padding:10px;background:var(--bg);border:1px solid var(--line);border-radius:8px;font-family:var(--mono);font-size:13px}

/* chips */
.chip{display:inline-block;font-size:12px;padding:1px 9px;border-radius:999px;background:var(--chip);color:var(--muted);white-space:nowrap}
.chip.pos{background:var(--live-soft);color:var(--pos)}
.chip.neg{background:var(--neg-soft);color:var(--neg)}
.chip.warn{background:var(--warn-soft);color:var(--warn)}
.ch{font-size:12px;font-weight:700}
.ch.line{color:var(--line-ch)}.ch.intercom{color:var(--ic-ch)}

/* charts */
.chart svg{width:100%;height:auto;display:block}
.chart text{fill:var(--muted);font-family:var(--mono);font-size:11px}
.chart .grid-l{stroke:var(--line);stroke-width:1}
.chart .b-line{fill:var(--line-ch)}.chart .b-ic{fill:var(--ic-ch)}
.legend{display:flex;gap:14px;font-size:13px;color:var(--muted);margin-top:6px;flex-wrap:wrap}
.legend span::before{content:"";display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:6px;vertical-align:-1px}
.legend .l1::before{background:var(--line-ch)}.legend .l2::before{background:var(--ic-ch)}
.hours{display:grid;grid-template-columns:repeat(24,minmax(0,1fr));gap:2px;margin-top:8px}
.hours i{height:28px;border-radius:2px;background:var(--accent)}
.hours i.h0{opacity:.08}.hours i.h1{opacity:.18}.hours i.h2{opacity:.28}.hours i.h3{opacity:.38}.hours i.h4{opacity:.48}
.hours i.h5{opacity:.58}.hours i.h6{opacity:.68}.hours i.h7{opacity:.78}.hours i.h8{opacity:.9}.hours i.h9{opacity:1}
.hours-l{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);font-family:var(--mono);margin-top:4px}

/* chat list + thread */
.list{padding:0;overflow:hidden}
.conv{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}
.conv:last-child{border-bottom:0}
.conv:hover{background:var(--surface-2)}
.av{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-family:var(--display);font-weight:700;color:#fff;font-size:15px;background:#3d6fb6}
.av0{background:#c0567a}.av1{background:#3d6fb6}.av2{background:#8a6d1e}.av3{background:#2e8b72}.av4{background:#7b5cc4}.av5{background:#b5651d}.av6{background:#3b8ea5}.av7{background:#9a4a4a}
.conv .nm{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.conv .nm b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv .tm{font-size:12px;color:var(--muted);white-space:nowrap}
.conv p{margin:2px 0 4px;font-size:14px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv .tags{display:flex;gap:8px;flex-wrap:wrap;align-items:center;font-size:12px;color:var(--muted)}
.pager{display:flex;gap:10px;align-items:center;justify-content:center;margin-top:16px;color:var(--muted);font-size:14px}
.thread{display:grid;gap:10px;margin-top:16px}
.msg{max-width:78%;padding:9px 13px;border-radius:12px;font-size:14.5px;overflow-wrap:anywhere}
.msg .txt{white-space:pre-wrap}
.msg small{display:block;font-size:11px;color:var(--muted);margin-top:3px;font-family:var(--mono)}
.msg.cus{background:var(--chip);justify-self:start;border-bottom-left-radius:4px}
.msg.staff{background:var(--accent-soft);justify-self:end;border-bottom-right-radius:4px}
.msg .lbl{font-style:italic;color:var(--muted)}
.list-head{padding:14px 14px 4px}
.who-l{font-size:12px;color:var(--muted);margin-bottom:2px}
.msg.staff .who-l{text-align:right}
.note{font-size:13px;color:var(--warn);background:var(--warn-soft);border-radius:8px;padding:8px 12px;margin-top:12px}
.dhead{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.dhead .av{flex:none}
.av{position:relative;overflow:hidden}
.av .avpic{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%}
.empty{text-align:center;padding:36px 16px}
.exp{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}
.exp div{flex:1 1 150px}
.exp label{margin-top:0}

/* channels */
.cards2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:760px){.cards2{grid-template-columns:1fr}}
.steps{padding-left:1.3em;margin:6px 0 16px}
.steps li{margin:6px 0}
.copyrow{display:flex;gap:8px}
.copyrow input{flex:1;font-family:var(--mono);font-size:13px}
.fieldinfo{margin:0 0 6px;font-size:13px}
hr{border:0;border-top:1px solid var(--line);margin:18px 0}
ul.plain{padding-left:1.2em;margin:6px 0}
ul.plain li{margin:6px 0}
/* AI summary box */
.ai-box{border:1px solid var(--accent);background:var(--accent-soft);border-radius:10px;padding:14px 16px;margin-top:12px}
.ai-box h3{font-size:14px;color:var(--accent-text);margin-bottom:6px}
.ai-box p{margin:6px 0}
/* reports */
.repday{margin:18px 0 6px}
.bars{display:grid;gap:9px}
.bar{display:grid;grid-template-columns:minmax(0,9em) minmax(0,1fr) 2.6em;gap:8px;align-items:center;font-size:14px;color:var(--ink);text-decoration:none}
a.bar:hover span{text-decoration:underline}
.bar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar i{display:block;height:10px;border-radius:5px;background:var(--accent)}
.bar em{font-style:normal;text-align:right;color:var(--muted);font-variant-numeric:tabular-nums}
.bw0{width:0}.bw1{width:10%}.bw2{width:20%}.bw3{width:30%}.bw4{width:40%}.bw5{width:50%}.bw6{width:60%}.bw7{width:70%}.bw8{width:80%}.bw9{width:90%}.bw10{width:100%}
.sbar{width:100%;height:14px;display:block;border-radius:7px;overflow:hidden;margin:10px 0 8px}
.s-pos{fill:var(--pos)}.s-neu{fill:var(--line)}.s-neg{fill:var(--neg)}
.legend .l-pos::before{background:var(--pos)}.legend .l-neu::before{background:var(--line)}.legend .l-neg::before{background:var(--neg)}

/* ---- landing page ---- */
.hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:40px;align-items:center;padding:28px 0 8px}
@media (max-width:900px){.hero{grid-template-columns:1fr;gap:28px}}
.live{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--pos);background:var(--live-soft);padding:4px 12px;border-radius:999px}
.live i{width:8px;height:8px;border-radius:50%;background:var(--pos);display:inline-block}
.hero h1{font-size:clamp(28px,4.4vw,42px);line-height:1.25;margin:16px 0 14px;letter-spacing:-.01em}
.hero .lead{font-size:17px;color:var(--muted);max-width:560px;margin:0 0 22px}
.cta{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:22px}
.cta .btn{font-size:16px;padding:12px 24px;border-radius:10px}
.btn.outline{background:transparent;color:var(--ink);border:1px solid var(--line);font-weight:600}
.btn.outline:hover{background:var(--surface-2)}
.badges{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;font-size:14px;color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:7px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:4px 12px;font-weight:600;color:var(--ink);font-size:13px}
.badge i{width:8px;height:8px;border-radius:50%;display:inline-block}
.badge.line i{background:var(--line-ch)}.badge.ic i{background:var(--ic-ch)}
.only{margin:16px 0 0;font-size:13px;color:var(--muted)}
.sim{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow)}
.sim-head{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:14px}
.sim-tag{background:var(--surface-2);border-radius:999px;padding:2px 10px;font-size:12px}
.bub{max-width:88%;padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.55;margin:0 0 8px}
.bub.cus{background:var(--surface);border:1px solid var(--line);border-bottom-left-radius:4px}
.sum{background:var(--surface-2);border-radius:14px;padding:14px 16px;margin-top:14px}
.sum-head{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;margin-bottom:6px}
.vbadge{background:var(--live-soft);color:var(--pos);border-radius:999px;padding:1px 9px;font-size:12px;font-weight:700}
.sum p{margin:0 0 8px;font-size:14px}
.sum .row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:13px;color:var(--muted)}
.rep{display:flex;flex-wrap:wrap;gap:6px 16px;justify-content:space-between;margin-top:14px;padding-top:12px;border-top:1px dashed var(--line);font-size:13px;color:var(--muted)}
.rep b{color:var(--ink)}
.how{padding:44px 0 8px}
.how h2{font-size:22px;margin-bottom:16px}
.steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;list-style:none;padding:0;margin:0}
@media (max-width:760px){.steps{grid-template-columns:1fr}}
.steps li{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px;box-shadow:var(--shadow)}
.steps .n{display:inline-flex;width:28px;height:28px;border-radius:50%;background:var(--accent-soft);color:var(--accent-text);font-weight:700;align-items:center;justify-content:center;margin-bottom:10px}
.steps h3{margin-bottom:6px}.steps p{color:var(--muted);font-size:14px;margin:0}
.trust{margin-top:22px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;font-size:14px}
@media (max-width:900px){.trust{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:520px){.trust{grid-template-columns:1fr}}
.trust div{border-left:3px solid var(--accent);padding:2px 0 2px 12px;color:var(--muted)}
.trust b{display:block;color:var(--ink);font-size:14px}

/* ---- knowledge base and reply suggestion ---- */
textarea{width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit;resize:vertical}
.list-title{margin:22px 0 10px}
.sug{margin-top:16px}

/* ---- customer pictures in the thread ---- */
.msg .pic{display:block;max-width:min(320px,100%);max-height:360px;border-radius:10px;border:1px solid var(--line);margin:2px 0 4px;background:var(--surface-2)}

/* ---- payment slip reading ---- */
.slipform{margin:6px 0 0}
.slipbox{margin-top:8px;padding:10px 12px;border:1px dashed var(--line);border-radius:10px;background:var(--surface)}
.slipbox dl{display:grid;grid-template-columns:max-content 1fr;gap:2px 14px;margin:0 0 6px}
.slipbox dt{color:var(--muted);font-size:13px}.slipbox dd{margin:0;font-weight:600;overflow-wrap:anywhere}

/* ---- inbox layout: chat list beside the open chat, composer always in reach ---- */
.inbox{display:grid;grid-template-columns:320px minmax(0,1fr);gap:16px;align-items:start}
.inbox-list{position:sticky;top:64px;max-height:calc(100vh - 88px);overflow:auto}
.inbox-list .list-end{margin:0;padding:12px 14px 16px;text-align:center;font-size:13px}
.inbox-list .list-end:empty{display:none}
.inbox-list-head{padding:10px 14px;border-bottom:1px solid var(--line);font-size:14px}
.inbox-chat{min-width:0;display:flex;flex-direction:column;height:calc(100vh - 88px);min-height:420px}
.inbox-back{display:none;margin:0 0 8px}
.chatcard{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.thread .older{margin:0;display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
.thread .older-btn{padding:6px 12px;font-size:13px;white-space:nowrap}
.chatcard .thread{flex:1 1 auto;min-height:0;overflow:auto;align-content:start;padding-right:4px}
.chatcard .ai-box{max-height:26vh;overflow:auto}
.conv.active{background:var(--accent-soft)}
.composer{flex:none;margin-top:12px;padding:12px 14px}
.composer textarea{margin-bottom:8px}
.composer label{margin:0 0 4px;font-size:13px}
.composer .actions{display:flex;flex-wrap:wrap;gap:8px}
.composer .hint{margin-top:8px;font-size:13px}
.composer .hint summary{cursor:pointer;color:var(--muted)}
@media (max-width:900px){
  .inbox{display:block}
  .inbox-list{display:none}
  .inbox-back{display:block}
  .inbox-chat{display:block;height:auto}
  .chatcard .thread{max-height:none;overflow:visible}
  .chatcard .ai-box{max-height:none}
  .composer{position:sticky;bottom:0;z-index:3;box-shadow:0 -4px 14px rgba(24,34,30,.08)}
}

/* ---- waiting-for-reply status and live refresh ---- */
.chip.warn{background:var(--warn-soft);color:var(--warn);font-weight:600}
.dhead-act{margin-left:auto;display:flex;gap:8px;align-items:center}
.dhead-act form{margin:0}
.newbar{position:sticky;top:56px;z-index:6;display:block;width:100%;margin:0 0 10px;padding:8px 14px;border:0;border-radius:10px;background:var(--accent);color:var(--accent-fg);font:inherit;font-weight:600;cursor:pointer;text-align:center}
.msg .pic.sticker{max-width:150px;max-height:150px;border:0;background:transparent}

/* ---- close / delete a company ---- */
.danger-zone{border-color:var(--neg)}
.danger-zone h2,.danger-zone h1{color:var(--neg)}
a.btn.danger{background:var(--neg);color:#fff}

.needclaim{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:0 0 8px}
.needclaim .note{margin:0;flex:1 1 220px}
.msg video.vid{display:block;width:min(360px,100%);max-height:420px;border-radius:12px;background:#000;margin:4px 0}
.composer button[disabled]{opacity:.5;cursor:not-allowed}
#slips button[disabled],#slips input[disabled]{opacity:.5;cursor:not-allowed}

/* ---- answered-before suggestions ---- */
.simbox{border:1px dashed var(--line);border-radius:10px;padding:10px 12px;margin:0 0 10px;background:var(--surface-2)}
.simbox p{margin:0 0 6px}
.simitem{border-top:1px solid var(--line);padding-top:8px;margin-top:8px}
.simans{white-space:pre-wrap;overflow-wrap:anywhere}
.draftbadge{display:inline-block;margin:0 0 6px}

/* service period warning for company owners */
.subbar{margin:0 0 14px;padding:10px 14px;border-radius:10px;font-size:14px;font-weight:600}
.subbar.warn{background:var(--warn-soft);color:var(--warn)}
.subbar.neg{background:var(--neg-soft,var(--warn-soft));color:var(--neg,var(--warn))}

/* ---- wide inbox: views | list | chat | details ---- */
main.wide{max-width:none;padding:12px 16px 16px}
.top-in.wide{max-width:none}
.inbox.v4{grid-template-columns:200px 320px minmax(0,1fr) 300px;gap:12px}
.inbox.v4.noview{grid-template-columns:200px 320px minmax(0,1fr)}
/* the inbox fills the window below the top bar exactly: the page itself never scrolls, each
   column scrolls on its own, and the reply box can never squeeze the conversation away */
main.wide{height:calc(100vh - var(--topbar,57px));display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden}
main.wide>.subbar,main.wide>.newbar{flex:none;margin-bottom:10px}
main.wide>.inbox.v4{flex:1 1 auto;min-height:0}
.inbox.v4 .inbox-list,.inbox.v4 .inbox-chat,.inbox.v4 .inbox-views,.inbox.v4 .inbox-details{height:100%;max-height:none;position:static;min-height:0}
.inbox.v4 .inbox-chat{min-height:0}
.inbox.v4>*{margin:0}
.inbox.v4 .inbox-chat>.card:last-child{margin-bottom:0}
.inbox.v4 .chatcard{flex:1 1 0;min-height:30%}
/* reply box: a flexible column whose text area shrinks first, so the buttons always stay in view */
.inbox.v4 .composer{flex:0 0 auto;max-height:62%;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:10px 12px}
.inbox.v4 .composer>*{flex:none}
.inbox.v4 .composer .ctabs{margin-bottom:6px}
.inbox.v4 .composer .cpane{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.inbox.v4 .composer .cpane>*{flex:none}
.js .inbox.v4 .composer .cpane.later{display:none}
.inbox.v4 .composer .cpane>form:not(.once[id]){flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.inbox.v4 .composer .cpane>form>*{flex:none}
.inbox.v4 .composer textarea{flex:1 1 auto;min-height:64px;height:auto;resize:none;margin-bottom:6px}
.inbox.v4 .composer .simbox{flex:0 1 auto;min-height:0;max-height:26vh;overflow:auto}
.inbox.v4 .composer .needclaim{margin-bottom:6px}
.inbox.v4 .composer .needclaim .note{padding:6px 10px;font-size:13px}
.inbox.v4 .composer label{margin-bottom:2px}
.inbox.v4 .composer .hint{margin-top:4px}
.inbox-views{position:sticky;padding:10px;overflow:auto;display:flex;flex-direction:column}
.inbox-views .online{margin-top:auto;padding-top:12px;border-top:1px solid var(--line)}
.inbox-views .online .iv-title{margin:4px 8px 6px}
.inbox-views .online ul{list-style:none;margin:0;padding:0 8px}
.inbox-views .online li{display:flex;align-items:center;gap:8px;font-size:13px;padding:3px 0;min-width:0}
.inbox-views .online li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inbox-views .online .odot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--pos)}
.inbox-views .online li.away .odot{background:transparent;border:1.5px solid var(--muted)}
.iv-title{margin:4px 8px 10px;font-size:13px;color:var(--muted);font-weight:600}
.iv{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;color:var(--text);text-decoration:none;font-size:14px}
.iv:hover{background:var(--chip)}
.iv.on{background:var(--accent-soft);font-weight:600}
.iv b{font-weight:600;color:var(--muted);font-size:13px;white-space:nowrap}
.iv b .ivans{font-weight:500;font-size:12px;color:var(--pos)}
.iv b .ivwait{font-weight:600;font-size:12px;color:var(--warn)}
.inbox-views .iv.sub{padding:5px 10px 5px 24px;font-size:13px;color:var(--muted)}
.inbox-views .iv.sub.on{color:var(--ink)}
.inbox-views .iv.gap{margin-top:8px;position:relative}
.inbox-views .iv.gap::before{content:"";position:absolute;left:10px;right:10px;top:-5px;border-top:1px solid var(--line)}
.iv-mini{display:none;flex-wrap:wrap;gap:4px;margin-bottom:6px}
.iv-mini .iv{padding:4px 8px;font-size:13px}
.ilh-row{display:flex;justify-content:space-between;align-items:center;gap:8px}
.ilh-sort{font-size:13px}
.inbox-details{position:sticky;padding:14px;overflow:auto}
.dt-head{display:flex;justify-content:space-between;align-items:center}
.dt-head h2{margin:0;font-size:16px}
.dt-head .dtoggle{display:none}
.facts{display:grid;grid-template-columns:auto 1fr;gap:8px 12px;margin:14px 0;font-size:14px}
.facts dt{color:var(--muted)}
.facts dd{margin:0;overflow-wrap:anywhere}
.dt-sec{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}
.dt-sec h3{margin:0 0 6px;font-size:14px}
.inbox-details textarea{width:100%;margin:6px 0}
/* in the details panel the AI summary is a plain section like the others (the boxed style
   clashed with the section divider and looked cut) */
.inbox-details .ai-box{max-height:none;margin:12px 0 0;padding:12px 0 0;border:0;border-top:1px solid var(--line);border-radius:0;background:none}
.inbox-details .ai-box h3{font-size:14px;color:var(--text);margin:0 0 6px}
.dtoggle{display:none}
.msg.note-msg{justify-self:center;max-width:86%;background:var(--warn-soft);border:1px dashed var(--warn);color:var(--text)}
.msg.note-msg .who-l{color:var(--warn);font-weight:600}
.ctabs{display:flex;gap:6px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.ctab{background:transparent;border:1px solid var(--line);color:var(--muted);padding:6px 12px;border-radius:8px;font:inherit;font-size:14px;cursor:pointer}
.ctab.on{background:var(--accent-soft);color:var(--text);border-color:var(--accent);font-weight:600}
.cnext{margin-left:auto}
.js .cpane.later{display:none}
.notebtn{background:var(--warn);border-color:var(--warn)}
@media (max-width:1450px){
  .inbox.v4{grid-template-columns:300px minmax(0,1fr) 300px}
  .inbox.v4.noview{grid-template-columns:300px minmax(0,1fr)}
  .inbox.v4 .inbox-views{display:none}
  .iv-mini{display:flex}
}
@media (max-width:1180px){
  .inbox.v4{grid-template-columns:300px minmax(0,1fr)}
  .dtoggle,.dt-head .dtoggle{display:inline-flex}
  .inbox.v4 .inbox-details{display:none;position:fixed;right:12px;top:64px;width:min(360px,92vw);z-index:20;box-shadow:0 10px 30px rgba(0,0,0,.25)}
  .inbox.v4 .inbox-details.open{display:block}
}
@media (max-width:900px){
  main.wide{height:auto;overflow:visible;display:block}
  .inbox.v4{display:block}
  .inbox.v4 .inbox-chat{height:auto}
  .inbox.v4 .chatcard{min-height:0}
  .inbox.v4 .composer{max-height:none;overflow:visible}
}
.isearch{margin:6px 0}
.isearch input{width:100%;padding:7px 10px;font-size:14px}
.ifilters{margin-top:6px;font-size:13px}
.ifilters summary{cursor:pointer;color:var(--muted)}
.ifilters .seg{margin:6px 6px 0 0;display:inline-flex;flex-wrap:wrap}
.ifilters .seg a{padding:4px 8px;font-size:13px}
.inbox-none{align-items:center;justify-content:center;text-align:center;padding:40px}
.inbox.v4.noview .inbox-list>.empty{padding:24px 12px}
.inbox.v4.noview .inbox-chat{display:flex;flex-direction:column}
.inbox.v4.noview .inbox-none{flex:1 1 auto;display:flex;flex-direction:column}
.subbar{display:flex;align-items:center;gap:10px}
.subbar span{flex:1}
.subx{background:transparent;border:0;color:inherit;font-size:20px;line-height:1;padding:2px 8px;cursor:pointer;border-radius:6px}
.subx:hover{background:rgba(0,0,0,.08)}
.subbar.hidden{display:none}
.aiassist{border-top:0;margin-top:8px;padding-top:0}
.aiassist .draftbadge{display:inline-block;margin:0 0 8px;white-space:normal}
.aiassist .note{margin:0 0 8px}
.aiassist .simbox{margin-top:6px}
.dt-head+.aiassist{border-top:1px solid var(--line);padding-top:12px}
/* text boxes: a calm focus ring in the theme colour instead of the browser's thick blue one */
textarea:focus,input[type=text]:focus,input[type=search]:focus,input[type=email]:focus,input[type=password]:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.notebtn.ghost{background:transparent;border-color:var(--warn);color:var(--warn)}
/* notes in the details panel: compact, the text box and its save button side by side */
.noteform{display:flex;gap:8px;align-items:flex-end;margin-top:6px}
.inbox-details .noteform textarea{flex:1;margin:0;min-height:44px;resize:vertical}
button.sm{padding:6px 12px;font-size:13px;white-space:nowrap}
.cnote details{margin-top:4px;font-size:13px}
.cnote details summary{cursor:pointer;color:var(--accent-text,var(--accent))}
.cnote-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0;font-size:14px}
.pinnote{background:var(--warn-soft);border:1px dashed var(--warn);border-radius:10px;padding:6px 10px;margin:0 0 8px}.pinnote .fieldinfo{margin:0}
.linkish{background:none;border:0;padding:0 0 0 6px;min-height:0;color:var(--accent-text,var(--accent));text-decoration:underline;cursor:pointer;font-size:12px}
.noteform{flex-wrap:wrap}.inbox-details .noteform textarea{flex:1 1 140px}
.notepin-check{flex-basis:100%;font-size:13px;margin:0;display:flex;gap:6px;align-items:flex-start}
.msg .notepin{display:inline}
.dt-sec h3 .fieldinfo{font-weight:400}
/* placeholder text is a hint, not content: keep it faint */
textarea::placeholder,input::placeholder{color:var(--muted);opacity:.55}
/* the note box shrinks so its save button stays inside the panel */
.inbox-details .noteform textarea{width:auto;min-width:0}
/* chat header: name and status on the left, the buttons on the right, one row */
.inbox.v4 .dhead{flex-wrap:nowrap;gap:12px}
.inbox.v4 .dhead-who{flex:1 1 auto;min-width:0}
.inbox.v4 .dhead-who h1{font-size:20px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.inbox.v4 .dhead-who .sub{margin:2px 0 0;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.inbox.v4 .dhead-act{flex:none;flex-wrap:nowrap}
.inbox.v4 .dhead-act .btn,.inbox.v4 .dhead-act button{padding:6px 12px;font-size:14px}
@media (max-width:1300px){.inbox.v4 .dhead{flex-wrap:wrap}.inbox.v4 .dhead-act{flex-wrap:wrap}}
/* signed-in pages use the whole width like the inbox, so moving between menus does not jump */
main.app{max-width:none;padding:20px 24px 48px}
main.app .card form input[type=text],main.app .card form input[type=email],main.app .card form input[type=password],main.app .card form input[type=search],main.app .card form input[type=date],main.app .card form textarea,main.app .card form select{max-width:760px}
main.app .copyrow input{max-width:none}
@media (max-width:640px){main.app{padding:16px 16px 40px}}
/* a document the customer sent: a card, the whole of it downloads (2026-11-18) */
.filecard{position:relative;display:flex;align-items:center;gap:12px;width:340px;max-width:100%;margin:2px 0 4px;padding:10px 10px 10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);text-decoration:none;transition:border-color .15s}
.filecard:hover{border-color:var(--accent)}
.filecard:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.fc-ic{flex:none;width:40px;height:40px;border-radius:10px;background:var(--surface-2);color:var(--muted);display:grid;place-items:center}
.fc-tx{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.fc-tx b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fc-meta{font-size:12.5px;color:var(--muted)}
.fc-dl{flex:none;width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:var(--bg);color:var(--ink);display:grid;place-items:center;transition:background .15s,color .15s}
.filecard:hover .fc-dl{background:var(--accent-soft);color:var(--accent-text)}
@media (prefers-reduced-motion:reduce){.filecard,.fc-dl{transition:none}}
.attach{position:relative;overflow:hidden;cursor:pointer}
.attach input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}
.attach.off{opacity:.5;cursor:not-allowed}
.attach.off input{cursor:not-allowed}
/* picture popup */
.lightbox{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.78);display:flex;align-items:center;justify-content:center;padding:24px;cursor:zoom-out}
.lightbox img{max-width:min(92vw,1400px);max-height:88vh;border-radius:10px;box-shadow:0 10px 40px rgba(0,0,0,.5);cursor:default;background:#fff}
.lightbox-x{position:absolute;top:14px;right:18px;width:40px;height:40px;border-radius:50%;border:0;padding:0;background:rgba(255,255,255,.15);color:transparent;font-size:0;cursor:pointer}
/* the × is drawn with two bars so it sits exactly in the middle whatever the font */
.lightbox-x::before,.lightbox-x::after{content:"";position:absolute;left:50%;top:50%;width:18px;height:2px;background:#fff;border-radius:1px}
.lightbox-x::before{transform:translate(-50%,-50%) rotate(45deg)}
.lightbox-x::after{transform:translate(-50%,-50%) rotate(-45deg)}
.lightbox-x:hover{background:rgba(255,255,255,.28)}
.msg a > img.pic{cursor:zoom-in}
.chip.sm{font-size:11px;padding:1px 7px}
/* sticker box: opens above the send buttons, scrolls on its own */
.stk-panel{border:1px solid var(--line,#3a3a3a);border-radius:10px;padding:8px;margin-bottom:6px;max-height:240px;overflow:auto}
.stk-panel[hidden]{display:none}
.stk-panel .fieldinfo{margin:0 0 6px}
.stk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:4px}
.stk-grid .stk{padding:4px;background:transparent;border:1px solid transparent;border-radius:8px;min-height:0;height:auto}
.stk-grid .stk:hover,.stk-grid .stk:focus-visible{border-color:var(--accent,#e07a4f)}
.stk-grid .stk img{width:100%;height:64px;object-fit:contain;display:block}
.inbox.v4 .composer .stk-panel{flex:0 0 auto;height:200px}
/* chat page: no top bar; the ☰ button at the top of the inbox opens the same menu */
body.notop header.top{display:none}
body.notop main.wide{height:100vh}
.iv-top{display:flex;align-items:center;gap:6px;margin:0 0 6px}
.iv-top .iv-title{margin:4px 4px 4px 2px}
.appmenu{position:relative;flex:none}
.appmenu>summary{list-style:none;cursor:pointer;width:32px;height:32px;display:grid;place-items:center;border-radius:8px;font-size:18px;line-height:1;color:var(--ink);border:1px solid var(--line);background:var(--surface-2)}
.appmenu>summary::-webkit-details-marker{display:none}
.appmenu>summary .menu-ic{display:block}
.appmenu>summary:hover,.appmenu[open]>summary{border-color:var(--accent);color:var(--accent-text)}
.am-pop{position:fixed;z-index:40;margin-top:6px;min-width:230px;max-width:min(320px,90vw);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px;box-shadow:0 12px 32px rgba(0,0,0,.3);display:flex;flex-direction:column;gap:8px}
.am-pop p{margin:0}
.am-co{display:flex;align-items:center;gap:8px;padding:2px 6px 6px;border-bottom:1px solid var(--line)}
.am-nav{display:flex;flex-direction:column}
.am-nav a{padding:7px 10px;border-radius:8px;color:var(--ink);text-decoration:none;font-size:14px}
.am-nav a:hover{background:var(--surface-2)}
.am-nav a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-text);font-weight:700}
.am-who{font-size:13px;color:var(--muted);padding:6px 6px 0;border-top:1px solid var(--line);overflow:hidden;text-overflow:ellipsis}
.am-pop form{margin:0}
.am-pop .ghost{width:100%}
.iv-mini .appmenu{margin-right:4px}
.iv-mini .appmenu>summary{width:28px;height:28px;font-size:16px}
/* a chat the customer just wrote to: blinks a few times, then stays marked until opened */
.conv.fresh{box-shadow:inset 4px 0 0 var(--accent);background:var(--accent-soft)}
.conv.fresh .nm b::after{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent);margin-left:6px;vertical-align:middle}
.conv.flash{animation:convflash 1s ease-in-out 4}
@keyframes convflash{0%,100%{background:var(--accent-soft)}50%{background:rgba(212,98,56,.38)}}
@media (prefers-reduced-motion:reduce){.conv.flash{animation:none}}
/* a chat leaving the list folds away (app.js listMotion · N175) */
.conv.conv-leaving{overflow:hidden;pointer-events:none}
/* a checkbox with its words on one line (settings) */
label.check{display:flex;align-items:center;gap:8px;font-weight:600;margin:8px 0 12px;cursor:pointer}
label.check input{width:18px;height:18px;margin:0;flex:none;accent-color:var(--accent)}
/* ☰ menu: the language switch fills the menu width in two equal halves */
.am-pop .seg{display:flex}
.am-pop .seg button{flex:1 1 0;padding:7px 12px}
/* knowledge page: topics as a short list (open one to edit), settings in a side column */
.kb .pagehead{align-items:flex-end}
.kb .pagehead .sub{max-width:760px}
.kb-usage{display:flex;align-items:center;gap:6px;font-size:14px;white-space:nowrap}
.kb-bar{display:inline-block;width:120px;height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden;margin-left:6px}
.kb-bar i{display:block;height:6px;background:var(--accent)}
.kb-pending{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;margin:16px 0;padding:14px 18px;border-radius:12px;background:var(--warn-soft);border:1px solid var(--warn);color:var(--ink)}
.kb-pending svg{color:var(--warn);flex:none}
.kb-pending>div{flex:1 1 320px;min-width:0}
.kb-pending p{margin:2px 0 0;font-size:14px;color:var(--muted)}
.kb-pending .btn{background:var(--warn);color:var(--bg);border-color:var(--warn)}
.kb>.fieldinfo{margin:14px 0}
.kb-cols{display:flex;flex-wrap:wrap;gap:18px;align-items:flex-start;margin-top:4px}
.kb-list{flex:none;min-width:0;padding:0;overflow:hidden} /* sits in .main (a column): its height follows what is open */
.kb-side{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:18px}
.kb-side .card{margin:0}
.kb-side h2{font-size:16px}
.kb-list-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;padding:14px 18px;border-bottom:1px solid var(--line)}
.kb-list-head h2{margin:0;flex:1 1 auto}
.kb-list-head .kb-search{flex:1 1 240px;max-width:340px;margin:0}
.kb-add{padding:16px 18px;background:var(--surface-2);border-bottom:1px solid var(--line)}
.kb-add[hidden]{display:none}
.kb-add .actions,.kb-form .actions{display:flex;gap:8px;flex-wrap:wrap}
.kb-item{border-bottom:1px solid var(--line)}
.kb-item:last-of-type{border-bottom:0}
.kb-item>summary{list-style:none;display:flex;gap:14px;align-items:flex-start;padding:14px 18px;cursor:pointer}
.kb-item>summary::-webkit-details-marker{display:none}
.kb-item>summary:hover{background:var(--surface-2)}
.kb-sum{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.kb-q{font-weight:700}
.kb-a{color:var(--muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line}
.kb-up{color:var(--muted);font-size:12px;opacity:.8}
.kb-edit{flex:none;font-size:14px;padding:5px 14px;border:1px solid var(--line);border-radius:8px;color:var(--ink)}
.kb-item[open]{background:var(--surface-2);box-shadow:inset 3px 0 0 var(--accent)}
.kb-item[open]>summary .kb-a,.kb-item[open]>summary .kb-up,.kb-item[open]>summary .kb-edit{display:none}
.kb-form{padding:0 18px 16px}
.kb-form form{margin:0}
.kb-del{margin-top:8px;text-align:right}
.kbc-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.kbc-bar p{margin:0}.kbc-bar .inline{margin:0}
.ghost.danger{color:var(--neg);border-color:var(--neg-soft)}
.kb-empty{padding:24px 18px;margin:0;text-align:center}
.kb-full{padding:12px 18px;margin:0}
.kb-tips{padding:16px 18px;border-radius:12px;background:var(--surface-2)}
.kb-tips h2{font-size:14px;margin:0 0 6px}
.kb-tips ul{margin:0;padding-left:18px;color:var(--muted);font-size:13px}
.kb-tips li+li{margin-top:4px}
/* settings: sections with a side menu; each setting is one row, switches on the right */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.set{max-width:1180px}
.set-cols{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start;margin-top:16px}
.set-nav{flex:1 1 220px;max-width:260px;display:flex;flex-direction:column;gap:4px;padding:10px;margin:0}
.set-nav a{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 12px;border-radius:10px;color:var(--ink);text-decoration:none}
.set-nav a span{flex:1 1 auto}
.set-nav a small{font-size:12px;color:var(--muted)}
.set-nav a:hover{background:var(--surface-2)}
.set-nav a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-text);font-weight:700}
.set-main{flex:999 1 560px;min-width:0}
.set-sec[hidden]{display:none}
.set-sec>h2{font-size:18px;margin:0 0 10px}
.set-sec>p.muted{margin:-4px 0 12px;font-size:14px}
.set-rows{padding:0;overflow:hidden}
.set-row{display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;padding:16px 18px;border-bottom:1px solid var(--line)}
.set-row:last-child{border-bottom:0}
.set-what{flex:1 1 280px;min-width:0;display:flex;flex-direction:column;gap:2px}
.set-what h3,.set-what .h3{font-size:15px;font-weight:700;margin:0;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.set-what p,.set-what .p{margin:0;font-size:13px;color:var(--muted)}
.set-what p.note{color:var(--ink);font-size:13px}
.set-what .need{color:var(--warn)}
.set-inline{flex:1 1 320px;display:flex;gap:8px;align-items:center;margin:0}
.set-inline input,.set-inline select{flex:1 1 auto;min-width:0;margin:0}
.set-val{flex:1 1 320px;color:var(--ink)}
.set-row .seg{flex:none}
.set-row>.more,.set-row>.snd-blocked{flex:1 1 100%}
.set-row>.snd-blocked{margin:0}
[hidden].snd-blocked{display:none}
.more>summary{cursor:pointer;color:var(--muted);font-size:13px;width:max-content}
.more>summary:hover{color:var(--ink)}
.more p{font-size:13px;color:var(--muted);margin:6px 0 0}
.set-pw{display:block}
.set-pw>summary{list-style:none;display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;cursor:pointer}
.set-pw>summary::-webkit-details-marker{display:none}
.set-pw[open]>summary .btn{display:none}
.set-pwform{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;align-items:end;margin-top:12px}
.set-pwform label{font-size:13px}
.set-pwform input{margin:0}
.set-sw form{margin:0;flex:none}
.set-sub{padding-left:42px}
.switch{position:relative;width:56px;height:32px;padding:0;border-radius:999px;border:1px solid var(--line);background:var(--surface-2);cursor:pointer;flex:none}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:var(--muted);transition:left .15s}
.switch[aria-checked="true"]{background:var(--accent);border-color:var(--accent)}
.switch[aria-checked="true"]::after{left:27px;background:var(--bg)}
.switch:disabled{opacity:.45;cursor:not-allowed}
.switch:hover:not(:disabled){border-color:var(--accent)}
.set-block{align-items:flex-start}
.set-links{flex:1 1 100%;margin:0}
.set-links textarea{max-width:520px}
.set-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-bottom:12px}
.set-facts .card{margin:0}
.set-facts p{margin:0;font-size:13px}
.set-facts .big{font-size:24px;font-weight:800;color:var(--ink);margin:2px 0}
.set-facts .big.sm{font-size:17px}
@media (max-width:640px){.set-nav{max-width:none}.set-sub{padding-left:18px}}
.set-inline button,.set-pw .btn{white-space:nowrap;flex:none}
/* team page: one row per person, actions behind "manage", filters by status */
.chip.acc{background:var(--accent-soft);color:var(--accent-text);font-weight:600}
.team{max-width:1280px}
.team .pagehead{align-items:flex-end}
.team-add{margin-top:16px;border-color:var(--accent)}
.team-add[hidden]{display:none}
.team-add .actions{display:flex;gap:8px;flex-wrap:wrap}
.team-roles{border:0;margin:8px 0;padding:0}
.team-roles legend{font-weight:600;font-size:14px;margin-bottom:6px;padding:0}
.team-roles{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;max-width:760px}
.role-card{display:flex;gap:10px;align-items:flex-start;padding:14px;border:2px solid var(--line);border-radius:12px;cursor:pointer;margin:0}
.role-card:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.role-card input{margin-top:4px;accent-color:var(--accent);flex:none}
.role-card span{display:flex;flex-direction:column}
.role-card small{color:var(--muted);font-size:13px;font-weight:400}
.team-cols{display:flex;flex-wrap:wrap;gap:18px;align-items:flex-start;margin-top:16px}
.team-list{flex:999 1 560px;min-width:0;padding:0;margin:0;overflow:hidden}
.team-side{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:14px}
.team-side .card{margin:0}
.team-side h2{font-size:16px}
.team-side ul{margin:4px 0 12px;padding-left:18px;font-size:13px;color:var(--muted)}
.team-filters{display:flex;flex-wrap:wrap;gap:8px;padding:14px 18px;border-bottom:1px solid var(--line)}
.tf{height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:transparent;color:var(--ink);font-size:14px;font-weight:500;cursor:pointer}
.tf span{opacity:.7}
.tf[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-text);font-weight:700}
.member{border-bottom:1px solid var(--line)}
.member:last-of-type{border-bottom:0}
.member.inactive>summary{opacity:.7}
.member>summary{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;padding:14px 18px;cursor:pointer}
.member>summary::-webkit-details-marker{display:none}
.member>summary:hover{background:var(--surface-2)}
.member .av{width:42px;height:42px;flex:none}
.m-who{flex:1 1 220px;min-width:0;display:flex;flex-direction:column}
.m-who .muted{font-size:13px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-tags{flex:none;display:flex;gap:8px;flex-wrap:wrap}
.m-manage{flex:none;font-size:14px;padding:6px 14px;border:1px solid var(--line);border-radius:10px}
.m-manage::after{content:" ▾";color:var(--muted)}
.member[open]{background:var(--surface-2)}
.member[open] .m-manage::after{content:" ▴"}
.m-actions{display:flex;flex-wrap:wrap;gap:8px;padding:0 18px 16px 76px}
.m-actions form{margin:0}
.ghost.warnbtn{color:var(--warn)}
.team-none{padding:24px 18px;margin:0;text-align:center}
@media (max-width:640px){.m-actions{padding-left:18px}}
/* ===== one look for every company page (overview, knowledge, reports, channels, team, settings) =====
   .pg page · .ph header (title, one line, actions right) · .cols = .main (wide, left) + .side (right)
   .card.flush with .card-h (card header) and .card-b (body) · .rowi list rows · .tips side notes · .banner */
.pg{max-width:1280px;margin:0 auto}
.pg .card{border-radius:14px;box-shadow:none;margin:0}
.ph{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 20px;padding-bottom:18px;margin-bottom:20px;border-bottom:1px solid var(--line)}
.ph h1{font-size:26px;font-weight:800;margin:0}
.ph .sub{margin:4px 0 0;max-width:760px}
.ph-acts{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
.ph-acts form{margin:0}
.pg>.note,.pg>.ok,.pg>.error,.pg>p.fieldinfo{margin:0 0 20px}
.cols{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
.cols>.main{flex:999 1 560px;min-width:0;display:flex;flex-direction:column;gap:20px}
.cols>.side{flex:1 1 300px;max-width:100%;min-width:0;display:flex;flex-direction:column;gap:20px}
@media (min-width:1000px){.cols>.side{max-width:360px}}
.card.flush{padding:0;overflow:hidden}
.card-h{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;padding:14px 18px;border-bottom:1px solid var(--line)}
.card-h h2{margin:0;font-size:16px;font-weight:700}
.card-h a{font-size:14px}
.card-b{padding:16px 18px}
.card-b>:last-child{margin-bottom:0}
.rowi{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;padding:16px 18px;border-bottom:1px solid var(--line)}
.rowi:last-child{border-bottom:0}
.rowi .grow{flex:1 1 240px;min-width:0}
.rowi .grow p{margin:2px 0 0;font-size:13px;color:var(--muted)}
.tips{padding:16px 18px;border-radius:14px;background:var(--surface-2)}
.tips h2{font-size:14px;margin:0 0 6px}
.tips p,.tips ul{margin:0;font-size:13px;color:var(--muted)}
.tips ul{padding-left:18px}
.tips li+li{margin-top:4px}
.banner{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;padding:14px 18px;border-radius:12px;background:var(--warn-soft);border:1px solid var(--warn);margin-bottom:20px}
.banner>svg{color:var(--warn);flex:none}
.banner>div{flex:1 1 320px;min-width:0}
.banner p{margin:2px 0 0;font-size:14px;color:var(--muted)}
.banner .btn{background:var(--warn);color:var(--bg);border-color:var(--warn)}
.pg .kpis{margin:0 0 20px;gap:20px}
.pg .kpi{padding:16px 18px}
.pg .kpi .v{font-size:28px;font-weight:800}
.chlogo{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;font-weight:800;font-size:13px;flex:none}
.chlogo.line{background:var(--live-soft);color:var(--line-ch)}
.chlogo.intercom{background:rgba(47,95,208,.14);color:var(--ic-ch)}
.chlogo.telegram{background:rgba(34,158,217,.14);color:var(--tg-ch)}
.chlogo.ppay{background:var(--warn-soft);color:var(--warn)}
.daypick{position:relative}
.daypick>summary{list-style:none;cursor:pointer}
.daypick>summary::-webkit-details-marker{display:none}
.daypick[open]>div{position:absolute;right:0;top:calc(100% + 6px);z-index:30;min-width:220px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:6px;box-shadow:0 12px 32px rgba(0,0,0,.3);display:flex;flex-direction:column}
.daypick a{padding:8px 12px;border-radius:8px;color:var(--ink);text-decoration:none}
.daypick a:hover{background:var(--surface-2)}
.daypick a[aria-current]{color:var(--accent-text);font-weight:700}
.subtabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--line);margin:-8px 0 20px}
.subtabs a{display:flex;align-items:center;gap:8px;padding:10px 16px;color:var(--muted);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}
.subtabs a:hover{color:var(--ink)}
.subtabs a[aria-current="page"]{color:var(--accent-text);border-bottom-color:var(--accent);font-weight:700}
.subtabs small{font-size:12px;color:var(--muted);font-weight:500}
.ph.tabbed{border-bottom:0;padding-bottom:8px;margin-bottom:8px}
.facts-list{margin:0;display:flex;flex-direction:column;gap:8px}
.facts-list>div{display:flex;justify-content:space-between;gap:12px}
.facts-list dt{color:var(--muted)}
.facts-list dd{margin:0;font-weight:700;text-align:right}
.pg .chart .legend{margin:0}
.pg .card.list .conv:last-child{border-bottom:0}
.card-h .kb-search{flex:1 1 240px;max-width:340px;margin:0}
.card-h .team-filters{padding:0;border:0}
.team-add{margin:0 0 20px}
.team-roles-info ul{margin:4px 0 12px;padding-left:18px;font-size:13px;color:var(--muted)}
.team-roles-info p{margin:0}
.pg.set,.pg.team{max-width:1280px}
.pg>.card.empty,.pg>.note,.pg>.grid.kpis{margin-bottom:20px}
/* report bars: the full label on its own line, the bar and number under it (long Thai labels were cut) */
.pg .bars{display:flex;flex-direction:column;gap:12px}
.pg .bar{grid-template-columns:minmax(0,1fr) 3em;row-gap:4px}
.pg .bar span{grid-column:1/-1;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.45}
/* provider pages on the same look */
.pg .backlink{margin:0 0 10px;font-size:14px}
.pg .card-h.sub-h{border-top:1px solid var(--line)}
.pg .card-h h3{margin:0;font-size:14px}
.rowi.sm-row{padding:10px 18px;font-size:14px}
.pg .actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
.pg .actions form{margin:0}
.pg .ai-keyform{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.pg .table-x table{margin:0}
.pg .danger-zone .card-h h2{color:var(--neg)}
/* a "delete" button drawn as an outline: red text on no fill (button.danger alone fills it red,
   which made the red text invisible) */
button.ghost.danger,a.btn.ghost.danger{background:transparent;color:var(--neg);border:1px solid var(--neg)}
button.ghost.danger:hover,a.btn.ghost.danger:hover{background:var(--neg-soft)}
/* label + value side by side, value next to its label (not pushed to the far edge of a wide card) */
.facts-list.inline>div{justify-content:flex-start;flex-wrap:wrap;gap:4px 16px}
.facts-list.inline dt{min-width:140px}
.facts-list.inline dd{text-align:left;font-weight:500}
/* quick replies: a list above the reply box (like the sticker box), the key in the accent colour */
.qr-panel{border:1px solid var(--accent);border-radius:12px;margin-bottom:6px;background:var(--surface);display:flex;flex-direction:column;max-height:280px;overflow:hidden}
.qr-panel[hidden]{display:none}
.inbox.v4 .composer .qr-panel{flex:0 0 auto;max-height:260px}
.qr-top{display:flex;align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid var(--line)}
.qr-top .qr-search{flex:1 1 auto;margin:0;height:36px}
.qr-keys{font-size:12px;white-space:nowrap}
.qr-items{overflow:auto;flex:1 1 auto;min-height:0}
.qr-item{display:flex;gap:12px;align-items:flex-start;width:100%;text-align:left;padding:9px 12px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);border-radius:0;cursor:pointer;font-weight:400}
.qr-item:hover,.qr-item.on{background:var(--accent-soft)}
.qr-key{flex:none;font-family:var(--mono);font-size:13px;color:var(--accent-text);min-width:64px}
.qr-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.qr-prev{color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.qr-none{margin:0;padding:12px;text-align:center}
.qr-row{display:grid;grid-template-columns:minmax(0,180px) minmax(0,1fr);gap:10px}
.qr-row input{margin:0}
.qr-list .qr-help,.depts .qr-help{margin:10px 18px 0}
.qr-list .kb-item>summary .qr-key{padding-top:2px}

/* Departments: the chip on list rows and the card at the top of the details panel */
.chip.dept{background:var(--accent-soft);color:var(--accent-text)}
.qr-panel .qr-manage{flex:none;margin:0;padding:8px 12px;border-top:1px solid var(--line);display:flex;justify-content:flex-end}
.qr-panel .qr-manage a{display:inline-flex;align-items:center;min-height:32px;padding:4px 12px;border:1px solid var(--line);border-radius:8px;font-size:13px;text-decoration:none;color:var(--accent-text)}
.qr-panel .qr-manage a:hover{background:var(--chip)}
.qr-list .qr-ro{display:flex;gap:10px;align-items:baseline;padding:10px 16px;border-top:1px solid var(--line)}
.chip.pin{background:transparent;border:1px solid var(--accent);color:var(--accent-text)}
.chip.dept.todo{background:transparent;border:1px dashed var(--warn);color:var(--warn)}
.deptbox.todo{border-left:3px solid var(--accent);padding:12px 0 12px 14px;border-radius:0 8px 8px 0;background:var(--accent-soft)}
.deptbox .dept-name{margin:0 0 4px;font-size:18px;font-weight:700}
.deptbox .dept-acts{margin:0}
.deptbox .dept-opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;margin-top:8px}
.deptbox .dept-opts button{min-height:44px;margin:0}
.deptbox .dept-more{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.deptbox .dept-more button,.deptbox .dept-menu button{width:100%;min-height:40px;margin:0}
.deptbox .dept-menu{margin-top:8px}
.deptbox .dept-menu .fieldinfo{margin-top:6px}
button.linkish{background:none;border:0;padding:0;min-height:0;color:var(--accent-text);font-weight:600;text-decoration:underline;cursor:pointer}
.dept-empty{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.dept-empty p{margin:0}
.dg-scroll{overflow-x:auto}
table.dg{width:100%;border-collapse:collapse;font-size:14px}
table.dg th,table.dg td{padding:8px 12px;border-bottom:1px solid var(--line);text-align:center;white-space:nowrap}
table.dg th[scope=row],table.dg thead th:first-child{text-align:left}
table.dg thead th{font-weight:600;color:var(--muted);font-size:13px}
table.ranks tr.me td,table.ranks tr.me th{background:var(--accent-soft)}
table.ranks th[scope=row]{font-weight:600}
table.ranks thead th:nth-child(2){text-align:left}
.ranks-help{margin-top:10px}
.ranks-months{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:0 0 12px}
.ranks-h{font-size:16px;margin:22px 0 8px}
table.dg td label{display:flex;justify-content:center;align-items:center;min-height:40px;cursor:pointer}
table.dg input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent)}
.deptbox .dept-ok{width:100%;min-height:44px;margin:4px 0 2px}
.dept-modes{display:flex;flex-direction:column;gap:8px;margin:0 0 12px}
.dept-modes p{margin:4px 0 0}
.dept-acc{padding:12px 14px;border-radius:10px;background:var(--surface-2)}
.dept-acc p{margin:0 0 4px}
button.linkish.reveal{font-size:12px;margin-left:4px}
.msg .txt.revealed{outline:1px dashed var(--warn);outline-offset:2px;border-radius:4px}
.rename>summary{list-style:none;cursor:pointer}
.rename>summary::-webkit-details-marker{display:none}
.rename .rename-ic{font-size:12px;text-decoration:underline}
.rename-form{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 2px}
.rename-form button{white-space:nowrap}
.rename-form input{flex:1 1 140px;min-width:0}
.hrename>summary{display:flex;align-items:center;gap:8px}
.hrename>summary h1{margin:0}
.hrename .rename-ic{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:8px;color:var(--muted);text-decoration:none}
.hrename>summary:hover .rename-ic,.hrename[open] .rename-ic{background:var(--chip);color:var(--ink)}
.hrename .rename-form{max-width:420px}
.dhead-who .hname{margin:0}
.rules-form h4{margin:16px 0 6px;font-size:14px}
.rules-form textarea{width:100%;max-width:560px;box-sizing:border-box}
.rules-more{margin:8px 0 4px}
.rules-more label:not(.check){margin-top:8px}
.rules-dg td{text-align:center}

/* Team page v2 (owner's design 2026-10-21): tabs, one row per person, the person panel. */
.ttabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--line);margin:16px 0}
.ttabs a{min-height:44px;display:inline-flex;align-items:center;padding:0 16px;border-bottom:3px solid transparent;color:var(--muted);font-weight:700;text-decoration:none}
.ttabs a:hover{color:var(--ink)}
.ttabs a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--accent)}
.tm-wrap{display:flex;flex-wrap:wrap;gap:18px;align-items:flex-start}
.tm-wrap .team-list{flex:999 1 640px}
.tm-scroll{overflow-x:auto}
.tm-table{min-width:760px}
.act-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:12px}.act-filters label{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:600}.act-filters select,.act-filters input{min-width:150px}
.act-list{width:100%;min-width:640px;border-collapse:collapse}.act-list th,.act-list td{padding:10px 16px}.act-when{white-space:nowrap;color:var(--muted)}.act-chat{margin:8px 0 0}.tm-hist{margin:0;border-top:1px solid var(--line)}
.act-bans{margin-top:12px;padding:12px 14px;border:1px solid color-mix(in srgb,var(--neg) 35%,transparent);border-radius:8px;background:var(--neg-soft)}.act-bans h3{margin:0 0 6px;font-size:14px}.act-bans ul{margin:0;padding-left:18px}.act-bans li{margin:4px 0}.act-ban{margin:0 0 0 6px}
.tm-head,.tm-row{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(0,1fr) minmax(0,2fr) minmax(0,1.9fr) 104px;align-items:center}
.tm-head{background:var(--surface-2);font-size:12px;font-weight:700;color:var(--muted)}
.tm-head span{padding:10px 8px}.tm-head span:first-child{padding-left:18px}
.tm-row{border-top:1px solid var(--line)}
.tm-row.on{background:var(--accent-soft)}
.tm-row.inactive{opacity:.65}
.tm-row[hidden]{display:none}
.tm-row>div{padding:10px 8px;min-width:0}
.tm-who{display:flex;gap:10px;align-items:center;padding-left:18px!important}
.tm-who .av{width:38px;height:38px;flex:none;font-size:14px}
.tm-who .m-who{display:flex;flex-direction:column;min-width:0}
.tm-who .m-who .muted{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-who .chip{align-self:flex-start;margin-top:2px}
.tm-depts,.tm-see{display:flex;flex-wrap:wrap;gap:4px}
.tm-depts .muted,.tm-see .muted{font-size:13px}
.sb{font-size:12px;font-weight:600;padding:2px 8px;border-radius:6px;color:var(--muted);background:var(--surface-2)}
.sb.int{background:color-mix(in srgb,var(--info) 12%,transparent);color:var(--info)}.sb.ext{background:var(--accent-soft);color:var(--accent-text)}
.tm-groups{margin:4px 0 8px 28px}.tm-gl{margin:0 0 4px;font-size:13px;font-weight:600}
.tm-act .btn{width:100%;min-height:40px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;font-weight:700}
.tm-act .btn.on{border-color:var(--accent)}
.tm-legend{font-size:13px;border-top:1px solid var(--line);margin:0}
.tm-person{flex:1 1 360px;min-width:300px;margin:0;scroll-margin-top:120px}
.tm-ph{display:flex;gap:12px;align-items:center;padding:16px 18px;border-bottom:1px solid var(--line)}
.tm-ph .av{width:44px;height:44px;flex:none}
.tm-ph h2{margin:0}
.tm-ph .muted{font-size:13px}
.tm-form fieldset{border:0;margin:0 0 16px;padding:0;display:flex;flex-direction:column;gap:8px}
.tm-form legend{font-weight:800;margin-bottom:6px;padding:0}
.tm-form legend .muted{font-weight:500;font-size:13px}
.tm-form label.check{margin:0;min-height:40px;font-weight:500}
.tm-form label.check .muted{font-size:13px}
.tm-note{padding:12px 14px;border-radius:12px;background:var(--surface-2);font-size:14px}
.tm-pv{margin-top:4px;background:var(--surface-2);border-radius:12px;padding:10px 14px;font-size:14px}
.tm-pv>.muted{display:block;font-size:12px}
.pv-m{color:var(--muted)}
.tm-acct{border-top:1px solid var(--line)}
.tm-acct h3{margin-bottom:8px}
.tm-acct .m-actions{padding:0 0 8px}
.tm-narrow{max-width:860px}
@media (max-width:700px){
  .tm-table{min-width:0}
  .tm-head{display:none}
  .tm-row{grid-template-columns:1fr auto;gap:2px 8px;padding:10px 14px}
  .tm-row>div{padding:2px 0}
  .tm-who{grid-column:1/-1;padding-left:0!important}
  .tm-act{grid-column:1/-1}
  .tm-person{min-width:0}
}

/* Welcome menu card (owner's design 2026-10-23) */
.welcome-form textarea{width:100%}
.welcome-btns{border:0;margin:12px 0;padding:0;display:flex;flex-direction:column;gap:6px}
.welcome-btns legend{font-weight:700;padding:0;margin-bottom:6px}
.welcome-btns legend .muted{font-weight:400;font-size:13px}
.wb-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:center}
.wb-row label.check{margin:0}
.wb-row input[type=text]{min-height:40px}
@media (max-width:640px){.wb-row{grid-template-columns:1fr}}

/* Department colours (owner's request 2026-10-27): the same colour on the sorting buttons, list
   chips, filter and menu lines. Dark text on light colours reads in both themes. */
.dc0{--dc:#6EA8FE}.dc1{--dc:#E8C35A}.dc2{--dc:#6FCF9B}.dc3{--dc:#C9A0F0}.dc4{--dc:#F28BB5}
.dc5{--dc:#5CC8C8}.dc6{--dc:#A8D672}.dc7{--dc:#9DB3D9}.dc8{--dc:#E3A6A0}.dc9{--dc:#F4B183}
.deptbox .dept-opts button.dc,.deptbox .dept-ok.dc{background:var(--dc);color:#14110E;border:0;font-weight:800}
.deptbox .dept-opts button.dc:hover,.deptbox .dept-ok.dc:hover{background:var(--dc);filter:brightness(1.08)}
.chip.dept.dc{background:var(--dc);color:#14110E;font-weight:700}
.ddot{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--dc);margin-right:7px;vertical-align:0;flex:none}
.dept-name .ddot{width:12px;height:12px}

/* Chat header (owner's requests 2026-10-27): name / channel and date on one line / the labels on
   the left and the buttons on the right of the same row (they wrap under the labels, left-aligned,
   only when the column is too narrow for both). */
.inbox.v4 .dhead{flex-wrap:nowrap;align-items:flex-start}
.inbox.v4 .dhead-who{flex:1 1 auto;min-width:0}
.inbox.v4 .dhead-who .hmeta{display:block;margin:2px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.inbox.v4 .dhead-who .hbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:8px}
.inbox.v4 .dhead-who .hchips{display:flex;flex-wrap:wrap;gap:6px;margin:0}
.inbox.v4 .dhead-who .dhead-act{margin-left:auto;display:flex;flex-wrap:wrap;gap:8px;flex:0 1 auto;min-width:0;max-width:100%;justify-content:flex-start}

/* Moving between pages fades instead of flashing white (Chrome/Edge; owner's request 2026-10-27). */
@view-transition{navigation:auto}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}
/* Provider backup page */
.bk-key{border:2px solid var(--warn)}
.bk-list{margin:12px 0;padding-left:20px;color:var(--muted)}
.bk-list li+li{margin-top:4px}
.bk-cmd{margin:8px 0;padding:10px 12px;border-radius:8px;background:var(--surface);font:13px/1.5 var(--mono);white-space:pre-wrap;word-break:break-all}
.bk-dl{margin-top:16px}
/* Who else has a chat open (no more taking a chat before answering, 2026-10-28) */
.chip.view{display:inline-flex;align-items:center;gap:4px;background:rgba(47,95,208,.10);color:var(--ic-ch);font-weight:600}
.chip.view svg{flex:none}
.viewbar:empty{display:none}
.viewbar .note.view{display:flex;align-items:center;gap:8px;margin:0 0 8px;color:var(--ic-ch);background:rgba(47,95,208,.08)}
/* What the deposit bot does with this chat (N128.28): above the reply box, for the team only */
.viewbar .note.bot{display:flex;align-items:flex-start;gap:8px;margin:0 0 8px;font-weight:600;line-height:1.45}
.viewbar .note.bot svg{flex:none;margin-top:2px}
.viewbar .note.bot.hold{color:var(--ai);background:color-mix(in srgb,var(--ai) 10%,transparent)}
.viewbar .note.bot.pos{color:var(--pos);background:var(--live-soft)}
.inbox.v4 .dhead-who .hchips .hlast{font-size:12px;color:var(--muted);align-self:center}
.conv p.rlast{margin:4px 0 0;font-size:12px}
/* A chat nobody has answered yet keeps pulsing in the list until a person answers or marks it
   handled (owner's request 2026-10-28); the open one stays still. Reduced motion: a steady mark. */
.conv.unanswered:not(.active){box-shadow:inset 4px 0 0 var(--accent);animation:convpulse 1.6s ease-in-out infinite}
@keyframes convpulse{0%,100%{background:var(--accent-soft)}50%{background:rgba(212,98,56,.32)}}
@media (prefers-reduced-motion:reduce){.conv.unanswered:not(.active){animation:none;background:var(--accent-soft)}}
/* Forbidden pictures: the company's samples */
.fb-grid{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0 16px}
.fb-item{position:relative;width:104px;height:104px;border-radius:10px;overflow:hidden;background:var(--surface-2)}
.fb-item img{width:100%;height:100%;object-fit:cover;display:block}
.fb-item form{position:absolute;top:4px;right:4px;margin:0}
.fb-del{min-width:28px;min-height:28px;padding:0;border-radius:8px;border:0;background:rgba(20,17,14,.75);color:#F2EDE6;font-weight:800;cursor:pointer}
.fb-grid>form{margin:0}
.fb-add{display:grid;place-items:center;width:104px;height:104px;border-radius:10px;border:1px dashed var(--line);color:var(--muted);font-weight:700;cursor:pointer;box-sizing:border-box;text-align:center}
.fb-add input{position:absolute;width:1px;height:1px;opacity:0}
.fb-notes textarea{width:100%;box-sizing:border-box}
/* answering one customer message (LINE quote) */
.msg .qbtn{display:none;margin-left:8px;font-size:12px;padding:2px 10px;min-height:28px;border-radius:999px;background:transparent;border:1px solid var(--line);color:var(--muted);cursor:pointer}
.msg:hover .qbtn,.msg:focus-within .qbtn{display:inline-block}
@media (hover:none){.msg .qbtn{display:inline-block}}
.msg .qref{font-size:12px;color:var(--muted);border-left:3px solid var(--line);padding:2px 8px;margin:2px 0 6px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quote-bar{display:flex;align-items:center;gap:6px;font-size:13px;padding:6px 10px;margin-bottom:6px;border-left:3px solid var(--accent);background:var(--chip);border-radius:6px;min-width:0}
.quote-bar b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.quote-bar[hidden]{display:none}
/* the Telegram page: a provider's time limit in its row (2026-11-11) */
.route-win{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0}
.route-win input[type=number]{width:6.5em;min-height:40px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit}
.route-win input[type=number]:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.route-win button{min-height:40px}
/* the admin-group label is a sentence: it wraps on a phone instead of running off the card */
#routes>p>.chip{white-space:normal;border-radius:12px;padding:3px 10px;line-height:1.45}
