/* Magnolia portal. Colours and type follow studio/brand.md (Eggshell, Taupe,
   Stone, Ink, Graphite, Smoke; Inter 300 for headings, Geist Mono for labels).
   Status colours are functional only: always paired with a word or an icon. */

:root{
  --egg:#fdfcfc;--taupe:#f5f3f1;--stone:#ebe8e4;--line:#e2ded9;--ink:#1c1917;--graphite:#44403b;--smoke:#777169;
  --ok:#2f6b47;--ok-bg:#e8f1ea;--warn:#8a5a0b;--warn-bg:#f8efdc;--alert:#a8321f;--alert-bg:#f8e7e2;--info:#2d4f8a;--info-bg:#e7ecf6;
  --shadow:rgba(0,0,0,.4) 0 0 1px 0,rgba(0,0,0,.04) 0 1px 1px 0,rgba(0,0,0,.04) 0 2px 4px 0;
  --shadow-lg:rgba(0,0,0,.35) 0 0 1px 0,rgba(0,0,0,.06) 0 8px 24px -4px,rgba(0,0,0,.05) 0 2px 6px 0;
  --side:252px;--top:64px;--radius:16px;
  --mono:"Geist Mono",ui-monospace,Menlo,monospace;
}
*{box-sizing:border-box}
svg[aria-hidden]{width:1.15em;height:1.15em;flex:none;vertical-align:-.2em}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--egg);color:var(--ink);font:400 15px/1.5 Inter,ui-sans-serif,system-ui,sans-serif;letter-spacing:.005em;-webkit-font-smoothing:antialiased}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
h1,h2,h3,h4,p{margin:0}
h1{font-weight:300;font-size:32px;line-height:1.15;letter-spacing:-.02em;text-wrap:balance}
h2{font-weight:300;font-size:24px;line-height:1.2;letter-spacing:-.02em}
h3{font-weight:500;font-size:16px;line-height:1.35}
h4{font-weight:500;font-size:14px;line-height:1.35}
p{color:var(--smoke)}
.mono{font:400 12px/1.5 var(--mono);letter-spacing:0;color:var(--graphite)}
.muted{color:var(--smoke)}
.small{font-size:13px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--ink);outline-offset:2px}

/* ---------- shell ---------- */
.app{display:grid;grid-template-columns:var(--side) 1fr;min-height:100vh;min-height:100dvh}
.side{position:sticky;top:0;height:100vh;height:100dvh;display:flex;flex-direction:column;border-right:1px solid var(--stone);background:var(--taupe);padding:18px 12px 12px;overflow-y:auto}
.brand{display:flex;align-items:center;gap:9px;white-space:nowrap;padding:4px 8px 18px;text-decoration:none;color:var(--ink)}
.brand img{width:28px;height:28px}
.brand b{font:700 16px/1 "Bricolage Grotesque",Inter,sans-serif;letter-spacing:-.02em}
.brand span{font:400 16px/1 "Bricolage Grotesque",Inter,sans-serif;letter-spacing:-.02em}
.who{display:flex;align-items:center;gap:10px;padding:10px;margin:0 0 14px;border-radius:12px;background:var(--egg);box-shadow:var(--shadow)}
.who .av{width:34px;height:34px;border-radius:50%;background:var(--ink);color:var(--egg);display:grid;place-items:center;font:500 13px/1 Inter;flex:none}
.who b{display:block;font-weight:500;font-size:14px;line-height:1.25}
.who small{display:block;font-size:12px;color:var(--smoke)}
.nav-group{margin:8px 0 2px;padding:0 10px;font:400 11px/1.6 var(--mono);color:var(--smoke);text-transform:uppercase;letter-spacing:.04em}
.nav a{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;border-radius:10px;text-decoration:none;color:var(--graphite);font-size:14px}
.nav a svg{width:18px;height:18px;flex:none}
.nav a:hover{background:var(--stone);color:var(--ink)}
.nav a[aria-current=page]{background:var(--egg);color:var(--ink);box-shadow:var(--shadow);font-weight:500}
.nav .count{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:9999px;background:var(--ink);color:var(--egg);font:500 11px/20px Inter;text-align:center}
.nav .count.soft{background:var(--stone);color:var(--graphite)}
.side .foot{margin-top:auto;padding-top:12px}
.demo-note{margin:10px 4px 0;padding:10px;border-radius:12px;border:1px dashed var(--line);font-size:12px;color:var(--smoke);line-height:1.45}
.demo-note button{background:none;border:0;padding:0;text-decoration:underline;cursor:pointer;color:var(--graphite);font-size:12px}

.main{min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;height:var(--top);display:flex;align-items:center;gap:12px;padding:0 32px;background:rgba(253,252,252,.88);backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--stone)}
.topbar .crumb{font:400 12px/1 var(--mono);color:var(--smoke)}
.topbar .mob-brand{display:none}
.topbar .sp{flex:1}
.view{padding:32px;max-width:1240px;width:100%;margin:0 auto;flex:1}
.view.full{max-width:none;padding:0}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.page-head p{margin-top:6px;max-width:44em}
.page-head .acts{display:flex;gap:8px;flex-wrap:wrap}

.tabbar{display:none}

/* ---------- status pill in top bar ---------- */
.state{display:inline-flex;align-items:center;gap:8px;height:32px;padding:0 12px 0 10px;border-radius:9999px;border:1px solid var(--stone);background:var(--egg);font-size:13px;color:var(--graphite);cursor:pointer;text-decoration:none}
.state:hover{border-color:var(--line);background:var(--taupe)}
.dot{width:8px;height:8px;border-radius:50%;background:var(--ok);flex:none}
.dot.off{background:var(--warn)}.dot.bad{background:var(--alert)}.dot.idle{background:var(--line)}
.state .dot{box-shadow:0 0 0 3px var(--ok-bg)}
.state .dot.off{box-shadow:0 0 0 3px var(--warn-bg)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:36px;padding:0 16px;border-radius:9999px;border:1px solid var(--ink);background:var(--ink);color:var(--egg);font-weight:500;font-size:14px;line-height:1;text-decoration:none;white-space:nowrap;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.btn svg{width:16px;height:16px;flex:none}
.btn:hover{background:#34302c;border-color:#34302c}
.btn.out{background:var(--egg);color:var(--ink);border-color:var(--line)}
.btn.out:hover{background:var(--taupe);border-color:var(--smoke)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--graphite);padding:0 10px}
.btn.ghost:hover{background:var(--taupe);color:var(--ink)}
.btn.danger{background:var(--egg);color:var(--alert);border-color:#e7c2b9}
.btn.danger:hover{background:var(--alert-bg)}
.btn.solid-danger{background:var(--alert);border-color:var(--alert);color:#fff}
.btn.sm{height:30px;padding:0 12px;font-size:13px}
.btn.lg{height:44px;padding:0 22px;font-size:15px}
.btn.icon{width:36px;padding:0}
.btn.sm.icon{width:30px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.block{width:100%}
.linkbtn{background:none;border:0;padding:0;color:var(--ink);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--line);cursor:pointer;font-size:inherit}
.linkbtn:hover{text-decoration-color:var(--ink)}

/* ---------- surfaces ---------- */
.card{background:var(--egg);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}
.card.flat{background:var(--taupe);box-shadow:none}
.card.line{box-shadow:none;border:1px solid var(--stone)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.card-head h3{display:flex;align-items:center;gap:8px}
.card-head .mono{white-space:nowrap}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.split{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;align-items:start}
.stack{display:grid;gap:16px;align-content:start}
.row{display:flex;align-items:center;gap:10px}
.row.wrap{flex-wrap:wrap}
.row.between{justify-content:space-between}
.sec{margin-top:32px}
.sec>h2{margin-bottom:14px}
hr.rule{border:0;border-top:1px solid var(--stone);margin:16px 0}

/* stat tiles */
.stat{background:var(--egg);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px 20px;display:grid;gap:4px;align-content:start}
.stat .k{font:400 12px/1.4 var(--mono);color:var(--smoke)}
.stat .v{font-weight:300;font-size:34px;line-height:1.1;letter-spacing:-.02em}
.stat .v small{font:400 14px Inter;color:var(--smoke);letter-spacing:0;margin-left:4px}
.stat p{font-size:13px}

/* badges */
.badge{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:9999px;background:var(--taupe);color:var(--graphite);font-size:12px;font-weight:500;white-space:nowrap;line-height:1}
.badge svg{width:12px;height:12px}
.badge.ok{background:var(--ok-bg);color:var(--ok)}
.badge.warn{background:var(--warn-bg);color:var(--warn)}
.badge.alert{background:var(--alert-bg);color:var(--alert)}
.badge.info{background:var(--info-bg);color:var(--info)}
.badge.ink{background:var(--ink);color:var(--egg)}
.badge.line{background:transparent;box-shadow:inset 0 0 0 1px var(--line)}

/* notices */
.notice{display:grid;grid-template-columns:18px minmax(0,1fr);column-gap:12px;row-gap:10px;align-items:start;padding:14px 16px;border-radius:14px;background:var(--taupe);font-size:14px;color:var(--graphite)}
.notice svg{width:18px;height:18px;flex:none;margin-top:1px}
.notice b{color:var(--ink);font-weight:500}
.notice.warn{background:var(--warn-bg);color:#5f3f08}
.notice.warn svg{color:var(--warn)}
.notice.alert{background:var(--alert-bg);color:#6e2214}
.notice.alert svg{color:var(--alert)}
.notice.ok{background:var(--ok-bg);color:#1f4a31}
.notice.info{background:var(--info-bg);color:#1f3963}
.notice .acts{grid-column:2;display:flex;gap:8px;flex-wrap:wrap}

/* lists */
.list{display:grid;grid-template-columns:minmax(0,1fr)}
.li{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--stone)}
.li:first-child{border-top:0}
.li .grow{flex:1;min-width:0}
.li .t{font-weight:500;font-size:14px;line-height:1.35}
.li .s{font-size:13px;color:var(--smoke);line-height:1.4}
.li.click{cursor:pointer;border-radius:10px;margin:0 -10px;padding:12px 10px;border-top-color:transparent;box-shadow:0 -1px 0 var(--stone)}
.li.click:first-child{box-shadow:none}
.li.click:hover{background:var(--taupe)}
.time-chip{font:500 13px/1 var(--mono);min-width:54px;color:var(--ink)}
.ellip{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- forms ---------- */
.field{display:grid;gap:6px}
.field>label,.label{font-weight:500;font-size:13px;color:var(--ink)}
.field .hint{font-size:12px;color:var(--smoke);line-height:1.45}
.input,.select,.textarea{width:100%;height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--line);background:var(--egg);font-size:14px;transition:border-color .15s,box-shadow .15s}
.textarea{height:auto;min-height:96px;padding:10px 12px;line-height:1.5;resize:vertical}
.select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777169' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:34px}
.input:hover,.select:hover,.textarea:hover{border-color:#cfc9c2}
.input:focus,.select:focus,.textarea:focus{outline:0;border-color:var(--ink);box-shadow:0 0 0 3px var(--stone)}
.input.sm,.select.sm{height:32px;font-size:13px;border-radius:8px}
.input-group{display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;background:var(--egg);height:40px;overflow:hidden}
.input-group:focus-within{border-color:var(--ink);box-shadow:0 0 0 3px var(--stone)}
.input-group .input{border:0;box-shadow:none!important;height:38px}
.input-group .add{padding:0 12px;color:var(--smoke);font-size:13px;white-space:nowrap;background:var(--taupe);height:100%;display:flex;align-items:center}
.form{display:grid;gap:16px}
.form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.form-row.r3{grid-template-columns:repeat(3,minmax(0,1fr))}
.search{position:relative}
.search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--smoke);pointer-events:none}
.search .input{padding-left:36px}

/* toggle */
.switch{position:relative;display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
.switch input{position:absolute;opacity:0;width:1px;height:1px}
.switch .tr{width:38px;height:22px;border-radius:9999px;background:var(--line);position:relative;transition:background .2s;flex:none}
.switch .tr::after{content:"";position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .2s}
.switch input:checked+.tr{background:var(--ink)}
.switch input:checked+.tr::after{transform:translateX(16px)}
.switch input:focus-visible+.tr{outline:2px solid var(--ink);outline-offset:2px}
.switch input:disabled+.tr{opacity:.55}
.switch input:disabled~*{cursor:not-allowed}

.setting{display:flex;align-items:flex-start;gap:16px;padding:16px 0;border-top:1px solid var(--stone)}
.setting:first-child{border-top:0;padding-top:4px}
.setting .grow{flex:1;min-width:0}
.setting .t{font-weight:500;font-size:14px}
.setting .s{font-size:13px;color:var(--smoke);margin-top:2px;line-height:1.45}
.setting .lock{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--smoke);margin-top:6px}
.setting .lock svg{width:12px;height:12px}

/* checks */
.check{display:flex;gap:10px;align-items:flex-start;cursor:pointer;font-size:14px;padding:6px 0}
.check input{width:16px;height:16px;margin:2px 0 0;accent-color:var(--ink);flex:none}
.check small{display:block;color:var(--smoke);font-size:12px}

/* segmented */
.seg{display:inline-flex;padding:3px;border-radius:9999px;background:var(--taupe);gap:2px;flex-wrap:wrap}
.seg button,.seg label{border:0;background:none;height:30px;padding:0 14px;border-radius:9999px;font-size:13px;color:var(--graphite);cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.seg input{position:absolute;opacity:0;width:1px;height:1px}
.seg button[aria-pressed=true],.seg label:has(input:checked){background:var(--egg);color:var(--ink);box-shadow:var(--shadow);font-weight:500}
.seg label:has(input:focus-visible){outline:2px solid var(--ink)}
.seg .count{font:500 11px/1 var(--mono);color:var(--smoke)}

/* tabs */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--stone);margin-bottom:24px;overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs a{display:inline-flex;align-items:center;height:40px;padding:0 12px;font-size:14px;color:var(--smoke);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap}
.tabs a:hover{color:var(--ink)}
.tabs a[aria-current=page]{color:var(--ink);border-bottom-color:var(--ink);font-weight:500}

/* tables */
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th{text-align:left;font:400 12px/1.4 var(--mono);color:var(--smoke);padding:0 12px 10px;border-bottom:1px solid var(--stone);white-space:nowrap}
.table td{padding:12px;border-bottom:1px solid var(--stone);vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table td.num,.table th.num{text-align:right;font-variant-numeric:tabular-nums}
.table-wrap{overflow-x:auto;margin:0 -20px;padding:0 20px}

/* ---------- dialogs, drawers, toasts ---------- */
dialog{border:0;padding:0;background:transparent;max-width:none;max-height:none;color:var(--ink)}
dialog::backdrop{background:rgba(28,25,23,.32);backdrop-filter:blur(2px)}
.dlg{width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 48px);overflow:auto;background:var(--egg);border-radius:20px;box-shadow:var(--shadow-lg);padding:24px}
.dlg.wide{width:min(720px,calc(100vw - 32px))}
.dlg-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.dlg-head p{margin-top:4px;font-size:14px}
.dlg-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:24px;flex-wrap:wrap}
dialog.drawer{margin:0 0 0 auto;height:100dvh}
dialog.drawer .dlg{width:min(460px,100vw);height:100dvh;max-height:none;border-radius:20px 0 0 20px;padding:24px}
dialog[open] .dlg{animation:pop .18s ease-out}
dialog.drawer[open] .dlg{animation:slide .22s ease-out}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.98)}}
@keyframes slide{from{transform:translateX(24px);opacity:0}}
.toasts{position:fixed;z-index:100;left:50%;bottom:24px;transform:translateX(-50%);display:grid;gap:8px;justify-items:center;pointer-events:none}
.toast{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:9999px;background:var(--ink);color:var(--egg);font-size:14px;box-shadow:var(--shadow-lg);animation:pop .2s ease-out;pointer-events:auto}
.toast svg{width:16px;height:16px}
.toast button{background:none;border:0;color:#d6d3d1;text-decoration:underline;cursor:pointer;padding:0;margin-left:4px}

.kv{display:grid;grid-template-columns:auto 1fr;gap:8px 16px;font-size:14px}
.kv dt{color:var(--smoke)}
.kv dd{margin:0;color:var(--ink);text-align:right}

.empty{display:grid;justify-items:center;text-align:center;gap:8px;padding:40px 16px;color:var(--smoke)}
.empty svg{width:28px;height:28px;color:var(--line)}
.empty h3{color:var(--ink)}

/* ---------- conversations ---------- */
.inbox{display:grid;grid-template-columns:360px minmax(0,1fr);height:calc(100dvh - var(--top));overflow:hidden}
.inbox.with-info{grid-template-columns:360px minmax(0,1fr) 300px}
.threads{border-right:1px solid var(--stone);display:flex;flex-direction:column;min-height:0;background:var(--egg)}
.threads .tools{padding:16px;display:grid;gap:10px;border-bottom:1px solid var(--stone)}
.threads .seg{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;max-width:100%}
.threads .seg::-webkit-scrollbar{display:none}
.threads .seg button{padding:0 11px}
.threads .scroll{overflow-y:auto;flex:1}
.th{display:flex;gap:12px;padding:14px 16px;border-bottom:1px solid var(--stone);text-decoration:none;color:inherit;position:relative}
.th:hover{background:var(--taupe)}
.th[aria-current=true]{background:var(--taupe)}
.th[aria-current=true]::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:var(--ink)}
.th .av,.av{width:38px;height:38px;border-radius:50%;background:var(--stone);color:var(--graphite);display:grid;place-items:center;font:500 13px/1 Inter;flex:none}
.th .grow{flex:1;min-width:0}
.th .top{display:flex;align-items:baseline;gap:8px}
.th .n{font-weight:500;font-size:14px;flex:1;min-width:0}
.th .when{font:400 11px/1 var(--mono);color:var(--smoke);flex:none}
.th .pv{font-size:13px;color:var(--smoke);margin-top:2px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.th .tags{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.th.unread .n{font-weight:600}
.th.unread .pv{color:var(--graphite)}
.unread-dot{width:8px;height:8px;border-radius:50%;background:var(--ink);flex:none;align-self:center}

.thread{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--taupe)}
.thread-head{display:flex;align-items:center;gap:12px;padding:12px 20px;border-bottom:1px solid var(--stone);background:var(--egg);min-height:65px}
.thread-head .grow{flex:1;min-width:0}
.thread-head b{display:block;font-weight:500}
.thread-head small{font-size:12px;color:var(--smoke)}
.thread-head .back{display:none}
.msgs{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:6px}
.day-sep{align-self:center;font:400 11px/1 var(--mono);color:var(--smoke);background:var(--egg);padding:6px 10px;border-radius:9999px;margin:10px 0}
.msg{max-width:min(78%,520px);padding:9px 12px 7px;border-radius:16px;font-size:14px;line-height:1.45;position:relative;white-space:pre-wrap;word-wrap:break-word}
.msg .meta{display:flex;gap:8px;align-items:center;justify-content:flex-end;font:400 10.5px/1 var(--mono);margin-top:5px;opacity:.75}
.msg.in{align-self:flex-start;background:var(--egg);box-shadow:var(--shadow);border-bottom-left-radius:5px}
.msg.bot{align-self:flex-end;background:var(--ink);color:var(--egg);border-bottom-right-radius:5px}
.msg.own{align-self:flex-end;background:var(--egg);box-shadow:inset 0 0 0 1.5px var(--ink);border-bottom-right-radius:5px}
.msg .who-l{display:block;font:500 11px/1 Inter;margin-bottom:5px;opacity:.7}
.msg.bot .who-l{color:#d6d3d1;opacity:1}
.msg .basis{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
.msg .basis span{font:400 10.5px/1 var(--mono);padding:4px 7px;border-radius:9999px;background:rgba(255,255,255,.12);color:#e7e5e4}
.msg .opts{display:grid;gap:4px;margin-top:8px}
.msg .opts span{display:block;text-align:center;padding:7px;border-radius:10px;background:rgba(255,255,255,.1);font-size:13px}
.msg.sys{align-self:center;max-width:90%;background:transparent;color:var(--smoke);font-size:12px;text-align:center;padding:4px 10px;display:flex;align-items:center;gap:6px}
.msg.sys svg{width:13px;height:13px;flex:none}
.msg.sys.hand{background:var(--warn-bg);color:#5f3f08;border-radius:9999px;padding:6px 12px}
.msg.media{font-style:italic;color:var(--smoke)}
.handoff-bar{margin:0 20px;margin-top:-4px}
.composer{border-top:1px solid var(--stone);background:var(--egg);padding:12px 16px;display:grid;gap:8px}
.composer form{display:flex;gap:8px;align-items:flex-end}
.composer .textarea{min-height:42px;max-height:160px;border-radius:21px;padding:10px 16px;resize:none}
.composer .note{font-size:12px;color:var(--smoke);display:flex;gap:6px;align-items:center}
.composer .note svg{width:13px;height:13px}
.quick{display:flex;gap:6px;flex-wrap:wrap}
.quick button{border:1px solid var(--line);background:var(--egg);border-radius:9999px;height:28px;padding:0 10px;font-size:12px;color:var(--graphite);cursor:pointer}
.quick button:hover{border-color:var(--ink);color:var(--ink)}
.info{border-left:1px solid var(--stone);background:var(--egg);overflow-y:auto;padding:20px;display:grid;gap:20px;align-content:start}
.info .av{width:56px;height:56px;font-size:18px}
.thread-empty{display:grid;place-items:center;height:100%;text-align:center;color:var(--smoke);padding:24px}

/* ---------- agenda ---------- */
.cal-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.cal-tools .range{font-weight:500;font-size:15px;margin:0 6px;min-width:12em}
.week{--hour:52px;display:grid;grid-template-columns:52px repeat(var(--days),minmax(0,1fr));background:var(--egg);border-radius:var(--radius);box-shadow:var(--shadow);overflow:clip}
.week .dh{position:sticky;top:var(--top);z-index:4;background:var(--egg);border-bottom:1px solid var(--stone);padding:10px 8px;text-align:center;font-size:13px;color:var(--smoke)}
.week .dh b{display:block;font-weight:300;font-size:22px;color:var(--ink);letter-spacing:-.02em;line-height:1.2}
.week .dh.today b{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--ink);color:var(--egg);font-size:17px;font-weight:400}
.week .dh .load{display:block;font:400 10.5px/1.4 var(--mono);margin-top:2px}
.week .hours{position:relative;border-right:1px solid var(--stone)}
.week .hours span{position:absolute;right:8px;font:400 10.5px/1 var(--mono);color:var(--smoke);transform:translateY(-50%)}
.week .col{position:relative;border-left:1px solid var(--stone);background-image:linear-gradient(var(--stone) 1px,transparent 1px);background-size:100% var(--hour)}
.week .col .closed{position:absolute;left:0;right:0;background:repeating-linear-gradient(135deg,var(--taupe) 0 6px,#f0ede9 6px 12px)}
.week .col.past{background-color:#fbfaf9}
.ev{position:absolute;left:4px;right:4px;border-radius:8px;padding:5px 7px;font-size:12px;line-height:1.3;overflow:hidden;cursor:pointer;border:0;text-align:left;background:var(--ink);color:var(--egg);display:flex;flex-direction:column;justify-content:flex-start}
.ev b{display:block;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ev span{display:block;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ev:hover{filter:brightness(1.25)}
.ev.pending{background:var(--egg);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--ink);background-image:repeating-linear-gradient(135deg,transparent 0 6px,rgba(28,25,23,.05) 6px 12px)}
.ev.done{background:var(--stone);color:var(--graphite)}
.ev.no_show{background:var(--alert-bg);color:var(--alert)}
.ev.cancelled{background:transparent;color:var(--smoke);box-shadow:inset 0 0 0 1px var(--line);text-decoration:line-through}
.ev.block{background:repeating-linear-gradient(135deg,var(--stone) 0 6px,var(--taupe) 6px 12px);color:var(--graphite);cursor:pointer}
.now-line{position:absolute;left:0;right:0;height:2px;background:var(--alert);z-index:2;pointer-events:none}
.now-line::before{content:"";position:absolute;left:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--alert)}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--smoke);margin-top:12px}
.legend i{display:inline-block;width:14px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.day-strip{display:none}
.day-list{display:none}

.hours-grid{display:grid;gap:0}
.hrow{display:grid;grid-template-columns:140px 1fr;gap:16px;align-items:start;padding:14px 0;border-top:1px solid var(--stone)}
.hrow:first-child{border-top:0}
.hrow .ranges{display:grid;gap:8px}
.hrow .range{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hrow .range .input{width:110px}
.hrow .closed-l{color:var(--smoke);font-size:14px;padding-top:8px}

/* ---------- answers ---------- */
.faq-item{display:flex;gap:14px;padding:16px 0;border-top:1px solid var(--stone);align-items:flex-start}
.faq-item:first-child{border-top:0}
.faq-item .grow{flex:1;min-width:0}
.faq-item .q{font-weight:500;font-size:14px}
.faq-item .a{font-size:14px;color:var(--smoke);margin-top:4px;line-height:1.5}
.faq-item .meta{display:flex;gap:10px;margin-top:8px;flex-wrap:wrap;align-items:center}
.cat-h{display:flex;align-items:center;justify-content:space-between;margin:28px 0 4px}
.cat-h:first-child{margin-top:0}
.cat-h h3{font:400 12px/1 var(--mono);color:var(--smoke);text-transform:uppercase;letter-spacing:.04em}
.unans{display:flex;gap:12px;align-items:center;padding:12px 14px;background:var(--egg);border-radius:12px;box-shadow:var(--shadow)}
.unans .grow{flex:1;min-width:0}
.unans q{font-weight:500;font-size:14px;quotes:"“" "”"}

/* ---------- tester ---------- */
.phone{background:var(--egg);border-radius:24px;box-shadow:var(--shadow-lg);overflow:hidden;display:flex;flex-direction:column;height:min(680px,calc(100dvh - 200px));min-height:460px}
.phone header{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--stone)}
.phone header .av{width:34px;height:34px;background:var(--ink);color:var(--egg)}
.phone header b{display:block;font-weight:500;font-size:14px}
.phone header small{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--smoke)}
.phone .msgs{background:var(--taupe)}
.phone form{display:flex;gap:8px;padding:12px;border-top:1px solid var(--stone)}
.phone .input{border-radius:9999px;padding:0 16px}
.slot-btns{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.slot-btns button{border:0;background:rgba(255,255,255,.14);color:var(--egg);border-radius:9999px;height:28px;padding:0 10px;font-size:12px;cursor:pointer}
.slot-btns button:hover{background:rgba(255,255,255,.24)}
.explain{font:400 11px/1.4 var(--mono);color:var(--smoke);align-self:flex-end;max-width:78%;text-align:right;margin:-2px 2px 6px}
.explain.l{align-self:flex-start;text-align:left}
.typing{align-self:flex-end;background:var(--ink);border-radius:16px;padding:12px 14px;display:flex;gap:4px}
.typing i{width:6px;height:6px;border-radius:50%;background:#a8a29e;animation:blink 1s infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes blink{50%{opacity:.3}}

/* preview bubble for templates */
.wa-preview{background:#efeae2;border-radius:16px;padding:16px;display:grid;gap:6px}
.wa-preview .b{justify-self:start;max-width:92%;background:#fff;border-radius:12px;border-top-left-radius:4px;padding:9px 12px;font-size:14px;line-height:1.45;box-shadow:0 1px 1px rgba(0,0,0,.08);white-space:pre-wrap;color:#111}
.wa-preview .b .btns{display:grid;border-top:1px solid #eee;margin:8px -12px -9px}
.wa-preview .b .btns span{text-align:center;padding:9px;color:#027eb5;font-size:14px;border-top:1px solid #eee}
.wa-preview .b .btns span:first-child{border-top:0}
.wa-preview .t{font:400 10.5px/1 var(--mono);color:#667;justify-self:start}
.var{background:var(--stone);border-radius:4px;padding:0 4px;font:400 12px var(--mono)}

/* ---------- charts ---------- */
.chart{position:relative}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart .bar{fill:var(--ink)}
.chart .bar.soft{fill:#c9c4be}
.chart .hit{fill:transparent;cursor:default}
.chart .hit:hover+.bar,.chart g:hover .bar{fill:#57524c}
.chart .axis{font:400 10.5px var(--mono);fill:var(--smoke)}
.chart .grid-l{stroke:var(--stone);stroke-width:1}
.chart .base{stroke:var(--line);stroke-width:1}
.tip{position:absolute;pointer-events:none;background:var(--ink);color:var(--egg);font-size:12px;line-height:1.35;padding:6px 9px;border-radius:8px;white-space:nowrap;transform:translate(-50%,calc(-100% - 8px));opacity:0;transition:opacity .1s;z-index:5}
.tip b{font-weight:500}
.tip.on{opacity:1}
.hbars{display:grid;gap:10px}
.hbar{display:grid;grid-template-columns:110px 1fr 44px;gap:10px;align-items:center;font-size:13px}
.hbar .track{height:10px;border-radius:0 4px 4px 0;background:transparent;position:relative}
.hbar .fill{height:100%;border-radius:0 4px 4px 0;background:var(--ink)}
.hbar .v{text-align:right;font:400 12px var(--mono);color:var(--graphite)}

/* site, brand */
.serp{background:var(--egg);border-radius:14px;border:1px solid var(--stone);padding:16px;font-family:Arial,sans-serif}
.serp .u{font-size:12px;color:#4d5156}
.serp .h{font-size:18px;color:#1a0dab;margin:4px 0;line-height:1.3}
.serp .d{font-size:13px;color:#4d5156;line-height:1.5}
.swatch{border-radius:14px;overflow:hidden;box-shadow:var(--shadow);background:var(--egg)}
.swatch .c{height:84px}
.swatch .m{padding:10px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.swatch b{font-weight:500;font-size:13px}
.logo-tile{border-radius:14px;display:grid;place-items:center;height:160px;box-shadow:var(--shadow)}
.svc{display:flex;gap:12px;align-items:center;padding:14px;border-radius:14px;background:var(--egg);box-shadow:var(--shadow)}
.svc .ic{width:38px;height:38px;border-radius:10px;background:var(--taupe);display:grid;place-items:center;flex:none}
.svc .ic svg{width:18px;height:18px}
.svc .grow{flex:1;min-width:0}
.meter{height:8px;border-radius:9999px;background:var(--stone);overflow:hidden;display:flex;gap:2px}
.meter i{flex:1;background:var(--ink);border-radius:9999px}
.meter i.off{background:var(--stone)}
.meter.seg4{background:transparent}
.meter.seg4 i.off{background:var(--stone)}

/* ---------- login ---------- */
.login{min-height:100dvh;display:grid;grid-template-columns:1fr 1fr}
.login .l{display:flex;flex-direction:column;padding:32px 48px}
.login .l .box{margin:auto 0;max-width:400px;display:grid;gap:20px;width:100%}
.login .r{background:var(--taupe);display:grid;place-items:center;padding:48px;position:relative;overflow:hidden}
.login .r .stack{max-width:420px;width:100%}
.or{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--smoke)}
.or::before,.or::after{content:"";flex:1;border-top:1px solid var(--stone)}

/* ---------- responsive ---------- */
@media (max-width:1180px){
  .inbox.with-info{grid-template-columns:320px minmax(0,1fr)}
  .inbox.with-info .info{display:none}
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:980px){
  .split{grid-template-columns:1fr}
  .g3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:860px){
  :root{--top:56px}
  body{font-size:15px}
  .app{grid-template-columns:1fr}
  .side{display:none}
  .topbar{padding:0 16px;gap:8px}
  .topbar .crumb{display:none}
  .topbar .mob-brand{display:flex;align-items:center;gap:8px;font:600 16px/1 Inter;text-decoration:none;color:var(--ink);min-width:0}
  .topbar .mob-brand img{width:26px;height:26px}
  .topbar .mob-brand span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .state .lbl{display:none}
  .state{padding:0 10px}
  .view{padding:20px 16px calc(96px + env(safe-area-inset-bottom))}
  .view.full{padding:0 0 calc(68px + env(safe-area-inset-bottom))}
  h1{font-size:28px}
  .page-head{margin-bottom:18px}
  .g2,.g3,.form-row,.form-row.r3{grid-template-columns:1fr}
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stat{padding:14px 16px}
  .stat .v{font-size:28px}
  .tabbar{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;z-index:30;left:0;right:0;bottom:0;background:rgba(253,252,252,.94);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--stone);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .tabbar a,.tabbar button{display:grid;justify-items:center;gap:3px;padding:6px 0;font-size:11px;color:var(--smoke);text-decoration:none;background:none;border:0;cursor:pointer;position:relative}
  .tabbar svg{width:22px;height:22px}
  .tabbar [aria-current=page]{color:var(--ink);font-weight:500}
  .tabbar .count{position:absolute;top:2px;left:calc(50% + 6px);min-width:17px;height:17px;padding:0 4px;border-radius:9999px;background:var(--ink);color:var(--egg);font:500 10px/17px Inter;text-align:center}
  .inbox,.inbox.with-info{grid-template-columns:1fr;height:calc(100dvh - var(--top) - 68px - env(safe-area-inset-bottom))}
  .inbox.open .threads{display:none}
  .inbox:not(.open) .thread{display:none}
  .thread-head{padding:10px 12px}
  .thread-head .back{display:inline-flex}
  .msgs{padding:14px 12px}
  .msg{max-width:86%}
  .composer{padding:10px 12px}
  .composer .note{display:none}
  .composer .quick{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .composer .quick button{flex:none}
  .week-wrap{display:none}
  .day-strip{display:flex;gap:6px;overflow-x:auto;margin:0 -16px 16px;padding:0 16px 4px;scrollbar-width:none}
  .day-strip::-webkit-scrollbar{display:none}
  .day-strip button{flex:none;width:52px;border:0;border-radius:14px;background:var(--taupe);padding:8px 0;display:grid;justify-items:center;gap:2px;cursor:pointer;color:var(--smoke);font-size:11px}
  .day-strip button b{font-weight:400;font-size:18px;color:var(--ink)}
  .day-strip button i{width:5px;height:5px;border-radius:50%;background:var(--ink);font-style:normal}
  .day-strip button i.none{background:transparent}
  .day-strip button[aria-pressed=true]{background:var(--ink);color:#d6d3d1}
  .day-strip button[aria-pressed=true] b{color:var(--egg)}
  .day-strip button[aria-pressed=true] i{background:var(--egg)}
  .day-list{display:grid;gap:8px}
  .hrow{grid-template-columns:1fr;gap:8px}
  dialog.drawer{margin:auto 0 0;height:auto;width:100vw}
  dialog.drawer .dlg{width:100vw;height:auto;max-height:92dvh;border-radius:20px 20px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom))}
  dialog.drawer[open] .dlg{animation:up .22s ease-out}
  dialog.sheet{margin:auto 0 0;width:100vw}
  dialog.sheet .dlg{width:100vw;border-radius:20px 20px 0 0;max-height:92dvh;padding:20px 16px calc(20px + env(safe-area-inset-bottom))}
  .toasts{bottom:calc(84px + env(safe-area-inset-bottom))}
  .login{grid-template-columns:1fr}
  .login .r{display:none}
  .login .l{padding:24px 16px}
  .table-wrap{margin:0 -16px;padding:0 16px}
  .hbar{grid-template-columns:90px 1fr 40px}
  .phone{height:calc(100dvh - 250px);border-radius:20px}
  .card{padding:16px}
}
@keyframes up{from{transform:translateY(24px);opacity:0}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.more-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.more-grid a{display:grid;justify-items:center;gap:6px;padding:14px 6px;border-radius:14px;background:var(--taupe);text-decoration:none;font-size:12px;color:var(--graphite);text-align:center}
.more-grid a svg{width:22px;height:22px;color:var(--ink)}
/* owner-only note (PRD §10, decision 6) */
.lock{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--smoke);margin-top:8px}
.lock svg{width:13px;height:13px}
fieldset[disabled] .input,fieldset[disabled] .select{background:var(--taupe);color:var(--graphite)}
