/* BERLIN intranet mockup — design system (mono neutral) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400&display=swap');

:root{
  --bg:#0B0C0F; --surface:#121418; --surface-2:#191C22; --surface-3:#20242C;
  --border:#23272F; --border-strong:#2F343E;
  --text:#E8EAEE; --text-2:#B4BAC4; --muted:#8B929D;
  --primary:#E9B44C; --primary-ink:#1A1300; --primary-hover:#F2C062;
  --accent:#E9B44C; --accent-soft:rgba(233,180,76,.14);
  --green:#3DBE7A; --red:#E5604F; --blue:#5B9CF5; --violet:#A98CF2; --teal:#3EC4C0;
  --ring:rgba(233,180,76,.25);
  --shadow:0 24px 60px rgba(0,0,0,.45);
  --radius:10px; --radius-sm:7px;
  --sans:'Inter',system-ui,-apple-system,sans-serif;
  --serif:'Source Serif 4',Georgia,serif;
  color-scheme:dark;
}
:root[data-theme="light"]{
  --bg:#F7F6F2; --surface:#FFFFFF; --surface-2:#F2F1EC; --surface-3:#E9E8E2;
  --border:#E5E4DE; --border-strong:#D2D1CA;
  --text:#0A0A0A; --text-2:#3D4047; --muted:#646973;
  --primary:#8C5E10; --primary-ink:#FFFFFF; --primary-hover:#7A520E;
  --accent:#8C5E10; --accent-soft:rgba(140,94,16,.12);
  --green:#1F9D5A; --red:#D04545; --blue:#2F62D8; --violet:#6D4FD8; --teal:#1E9C97;
  --ring:rgba(140,94,16,.25);
  --shadow:0 24px 60px rgba(20,20,22,.10);
  color-scheme:light;
}

*{box-sizing:border-box} html,body{margin:0;padding:0}
body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none;cursor:pointer}
h1,h2,h3,.serif{font-family:var(--serif);font-weight:500;letter-spacing:-.01em;margin:0}
h1{font-size:30px;line-height:1.15} h2{font-size:22px;line-height:1.2} h3{font-size:17px;line-height:1.3}
p{margin:0}
.muted{color:var(--muted)} .t2{color:var(--text-2)} .small{font-size:12.5px} .xs{font-size:11.5px}
.eyebrow{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:500}
.mono{font-variant-numeric:tabular-nums}
.row{display:flex;align-items:center;gap:10px} .col{display:flex;flex-direction:column;gap:6px}
.between{justify-content:space-between} .wrap{flex-wrap:wrap} .grow{flex:1;min-width:0}
.gap4{gap:4px}.gap8{gap:8px}.gap16{gap:16px}.gap24{gap:24px}
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.divider{height:1px;background:var(--border);margin:16px 0}
svg{flex-shrink:0}

/* Wordmark */
.wordmark{font-family:var(--sans);font-weight:700;letter-spacing:.26em;font-size:12.5px;text-transform:uppercase;color:var(--text)}
.wordmark i{display:inline-block;width:7px;height:7px;background:var(--accent);border-radius:1.5px;margin-right:10px;vertical-align:1px}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 14px;min-height:36px;border-radius:var(--radius-sm);border:1px solid var(--border-strong);background:var(--surface);color:var(--text);font:inherit;font-weight:500;font-size:13px;cursor:pointer;white-space:nowrap;transition:background .18s,border-color .18s,box-shadow .18s}
.btn:hover{background:var(--surface-2)}
.btn-primary{background:var(--primary);color:var(--primary-ink);border-color:transparent}
.btn-primary:hover{background:var(--primary-hover)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--text-2)}
.btn-ghost:hover{background:var(--surface-2);color:var(--text)}
.btn-sm{padding:5px 10px;font-size:12px;min-height:30px} .btn-lg{padding:12px 20px;font-size:14px;min-height:44px}
.btn-block{width:100%}
.icon-btn{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;border:1px solid transparent;color:var(--text-2);cursor:pointer;background:transparent;transition:background .18s}
.icon-btn:hover{background:var(--surface-2);color:var(--text)}
.icon-btn svg{width:18px;height:18px}

/* Inputs */
.input,.select,.textarea{width:100%;background:var(--bg);border:1px solid var(--border-strong);color:var(--text);border-radius:var(--radius-sm);padding:9px 12px;font:inherit;font-size:13px;outline:none;transition:border-color .18s,box-shadow .18s}
:root[data-theme="light"] .input,:root[data-theme="light"] .select,:root[data-theme="light"] .textarea{background:var(--surface)}
.input::placeholder{color:var(--muted)}
.input:focus-visible,.select:focus-visible,.textarea:focus-visible{border-color:var(--accent);box-shadow:0 0 0 3px var(--ring)}
.btn:focus-visible,.icon-btn:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.textarea{min-height:80px;resize:vertical}
.label{display:block;font-size:12.5px;color:var(--text-2);font-weight:500;margin-bottom:6px}
.field{margin-bottom:14px}
.search{position:relative}
.search .input{padding-left:34px}
.search svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--muted)}
.toggle{width:36px;height:20px;border-radius:999px;background:var(--surface-3);border:1px solid var(--border-strong);position:relative;flex-shrink:0;transition:background .18s}
.toggle::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--muted);transition:left .18s}
.toggle.on{background:var(--primary);border-color:var(--primary)} .toggle.on::after{left:18px;background:var(--primary-ink)}
.check{width:16px;height:16px;border-radius:4px;border:1px solid var(--border-strong);display:inline-block;flex-shrink:0}
.check.on{background:var(--primary);border-color:var(--primary);position:relative}
.check.on::after{content:"";position:absolute;left:5px;top:2px;width:4px;height:8px;border:solid var(--primary-ink);border-width:0 2px 2px 0;transform:rotate(45deg)}
.radio{width:16px;height:16px;border-radius:50%;border:1px solid var(--border-strong);display:inline-block;flex-shrink:0}
.radio.on{border:5px solid var(--primary)}

/* Surfaces */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px}
.lnk{color:var(--text-2);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--border-strong)}
.lnk:hover{color:var(--text);text-decoration-color:var(--text-2)}
.card.tight{padding:0;overflow:auto}
.card-head{padding:13px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:12px}
.card-title{font-weight:600;font-size:13px}
.stat{padding:18px} .stat .n{font-family:var(--serif);font-size:32px;line-height:1;font-weight:500;margin:10px 0 4px}
.stat .d{font-size:12px;color:var(--muted)}

/* Chips / badges */
.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:500;border:1px solid var(--border-strong);color:var(--text-2);background:transparent;white-space:nowrap}
.chip.accent{background:var(--surface-3);border-color:transparent;color:var(--text)}
.chip .dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.role{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:500;white-space:nowrap;border:1px solid var(--border-strong);background:transparent!important;color:var(--text-2)!important}
.role-owner{background:rgba(233,180,76,.18);color:var(--accent)}
.role-group{background:rgba(169,140,242,.18);color:var(--violet)}
.role-ceo{background:rgba(91,156,245,.18);color:var(--blue)}
.role-manager{background:rgba(62,196,192,.18);color:var(--teal)}
.role-employee{background:var(--surface-3);color:var(--text-2)}
.tag{display:inline-block;padding:1px 7px;border-radius:4px;font-size:11px;background:var(--surface-3);color:var(--text-2)}
.online{width:8px;height:8px;border-radius:50%;background:var(--green);border:2px solid var(--surface);box-sizing:content-box}
.lang-code{display:inline-flex;align-items:center;justify-content:center;width:36px;height:28px;border-radius:6px;background:var(--surface-3);font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--text-2)}

/* Avatars */
.av{--h:210;width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;flex-shrink:0;position:relative;
  background:hsl(var(--h) 40% 24%);color:hsl(var(--h) 80% 82%);letter-spacing:.02em}
:root[data-theme="light"] .av{background:hsl(var(--h) 55% 88%);color:hsl(var(--h) 50% 30%)}
.av::before{content:attr(data-i)}
.av.sm{width:24px;height:24px;font-size:9px} .av.lg{width:48px;height:48px;font-size:15px} .av.xl{width:72px;height:72px;font-size:22px}
.av.sq{border-radius:8px} .av .online{position:absolute;right:-1px;bottom:-1px}
.av-stack{display:inline-flex} .av-stack .av{margin-left:-8px;border:2px solid var(--surface)} .av-stack .av:first-child{margin-left:0}

/* Tables & lists */
.table{width:100%;border-collapse:collapse;font-size:13px}
.table th{text-align:left;font-size:12px;font-weight:500;color:var(--muted);padding:10px 16px;border-bottom:1px solid var(--border)}
.table td{padding:11px 16px;border-bottom:1px solid var(--border);vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table tr:hover td{background:var(--surface-2)}
.list{display:flex;flex-direction:column}
.list-row{display:flex;align-items:center;gap:12px;padding:11px 16px;border-bottom:1px solid var(--border)}
.list-row:last-child{border-bottom:0}
.list-row:hover{background:var(--surface-2)}
.kv{display:grid;grid-template-columns:170px 1fr;gap:10px 16px;font-size:13px}
.kv dt{color:var(--muted);margin:0} .kv dd{margin:0}
.file{display:inline-flex;align-items:center;gap:8px;padding:5px 10px 5px 6px;border:1px solid var(--border-strong);border-radius:7px;background:var(--surface-2);font-size:12px}
.file i{width:22px;height:26px;border-radius:3px;background:var(--surface-3);color:var(--text-2);font-style:normal;font-size:7px;font-weight:700;display:inline-flex;align-items:flex-end;justify-content:center;padding-bottom:3px;border:1px solid var(--border-strong)}

/* Tabs */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--border)}
.tabs a{padding:10px 14px;font-size:13px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:500}
.tabs a.active{color:var(--text);border-color:var(--accent)}
.seg{display:inline-flex;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:2px}
.seg a{padding:5px 10px;font-size:12px;border-radius:6px;color:var(--muted);font-weight:500}
.seg a.active{background:var(--surface-3);color:var(--text)}

/* Notes */
.note{padding:10px 12px;border-radius:8px;background:var(--surface-2);border:1px solid var(--border);color:var(--text);font-size:12.5px;display:flex;gap:10px;align-items:flex-start}
.note.info{background:var(--surface-2)}
.note svg{width:16px;height:16px;color:var(--text-2);margin-top:1px}

/* ───────── Desktop app shell ───────── */
.app{display:grid;grid-template-columns:224px 1fr;min-height:100vh}
.sidebar{background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.sidebar .brand{padding:18px 18px 10px;display:flex;align-items:center;justify-content:space-between}
.sidebar .section{padding:12px 10px 2px}
.sidebar .section .eyebrow{padding:0 8px 6px}
.nav a{display:flex;align-items:center;gap:10px;padding:7px 10px;min-height:34px;border-radius:7px;color:var(--text-2);font-size:13px;font-weight:500;transition:background .15s}
.nav a svg{width:16px;height:16px;color:var(--muted)}
.nav a:hover{background:var(--surface-2);color:var(--text)}
.nav a.active{background:var(--surface-3);color:var(--text)} .nav a.active svg{color:var(--text)}
.nav a .count{margin-left:auto;font-size:10.5px;background:var(--accent);color:var(--primary-ink);border-radius:999px;padding:0 6px;font-weight:600;min-width:18px;text-align:center;line-height:17px}
.nav a .hash{color:var(--muted);font-weight:400}
.sidebar .me{margin-top:auto;padding:12px 14px;border-top:1px solid var(--border);display:flex;align-items:center;gap:10px}
.main{min-width:0;display:flex;flex-direction:column}
.topbar{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;border-bottom:1px solid var(--border);background:var(--bg);position:sticky;top:0;z-index:5}
.topbar .crumb{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.topbar .crumb b{color:var(--text);font-weight:600}
.content{padding:28px 28px 90px;max-width:1240px;width:100%}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:24px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px} .grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px} .grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.split{display:grid;grid-template-columns:1fr 340px;gap:16px}

/* Chat (desktop) */
.chat{display:grid;grid-template-columns:272px 1fr;height:calc(100vh - 54px)}
.chat.with-side{grid-template-columns:272px 1fr 272px}
.chat-list{border-right:1px solid var(--border);background:var(--surface);overflow:auto;display:flex;flex-direction:column}
.chat-list .hd{padding:12px 12px 6px}
.chat-list .grp{padding:14px 14px 4px}
.conv{display:flex;align-items:center;gap:10px;padding:8px 12px;margin:0 6px;border-radius:7px;cursor:pointer;transition:background .15s}
.conv:hover{background:var(--surface-2)} .conv.active{background:var(--surface-3)}
.conv .nm{font-size:13px;font-weight:500} .conv .pv{font-size:12px;color:var(--muted)}
.conv .meta{margin-left:auto;text-align:right;font-size:11px;color:var(--muted)}
.conv .unread,.badge-n{display:inline-block;background:var(--accent);color:var(--primary-ink);font-size:10px;font-weight:600;border-radius:999px;padding:0 6px;line-height:17px;margin-top:3px}
.chat-main{display:flex;flex-direction:column;min-width:0}
.chat-head{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid var(--border)}
.chat-body{flex:1;overflow:auto;padding:20px 24px 90px;display:flex;flex-direction:column;gap:14px}
.chat-side{border-left:1px solid var(--border);background:var(--surface);padding:18px;overflow:auto}
.day{align-self:center;font-size:11px;color:var(--muted);padding:3px 10px}
.msg{display:flex;gap:10px;max-width:72%}
.msg .b{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:9px 12px;font-size:13.5px;line-height:1.5}
.msg .who{font-size:12.5px;font-weight:600;margin-bottom:3px;display:flex;align-items:center;gap:8px} .msg .who span{font-weight:400;color:var(--muted);font-size:11.5px}
.msg.me{align-self:flex-end;flex-direction:row-reverse} .msg.me .b{background:var(--surface-3);border-color:transparent}
.tr{margin-top:7px;padding-top:6px;border-top:1px solid var(--border);font-size:11px;color:var(--muted);display:flex;align-items:center;gap:8px}
.tr b{color:var(--text-2);font-weight:500} .tr a{color:var(--text-2);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.orig{margin-top:6px;font-size:12.5px;color:var(--text-2);font-style:italic;border-left:2px solid var(--border-strong);padding-left:8px}
.composer{padding:12px 20px;border-top:1px solid var(--border);display:flex;gap:10px;align-items:center;background:var(--bg)}
.composer .input{flex:1;min-height:40px}
.sys{align-self:center;font-size:11.5px;color:var(--muted)}

/* Field builder */
.ftype{display:inline-flex;align-items:center;gap:6px;font-size:11px;padding:2px 7px;border-radius:4px;background:var(--surface-3);color:var(--text-2);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.scope-pill{font-size:11px;padding:2px 8px;border-radius:999px;border:1px solid var(--border-strong);color:var(--text-2)}
.scope-pill.global{border-color:var(--text-2);color:var(--text)}

/* Org chart */
.org{display:flex;flex-direction:column;align-items:center;gap:0}
.org-node{background:var(--surface);border:1px solid var(--border);border-radius:9px;padding:10px 14px;display:flex;align-items:center;gap:10px;min-width:200px}
.org-node .nm{font-size:13px;font-weight:600} .org-node .ti{font-size:11px;color:var(--muted)}
.org-line{width:1px;height:22px;background:var(--border-strong)}
.org-row{display:flex;gap:22px;position:relative;padding-top:22px}
.org-row::before{content:"";position:absolute;top:0;left:50%;width:1px;height:22px;background:var(--border-strong)}
.org-row>div{display:flex;flex-direction:column;align-items:center}
.org-row>div::before{content:"";width:1px;height:14px;background:var(--border-strong)}
.org-hr{height:1px;background:var(--border-strong);width:70%}
.perm{width:14px;height:14px;border-radius:50%;display:inline-block}
.perm.y{background:var(--text)} .perm.n{background:transparent;border:1px solid var(--border-strong)} .perm.p{background:transparent;border:4px solid var(--text-2)}

/* Theme button */
.theme-btn{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--text-2);border:1px solid var(--border-strong);border-radius:999px;padding:5px 11px;min-height:30px;cursor:pointer;background:var(--surface);transition:color .18s}
.theme-btn:hover{color:var(--text)}

/* ───────── Scenario pages ───────── */
.hub{max-width:1180px;margin:0 auto;padding:40px 32px 100px}
.hub-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:30px;flex-wrap:wrap}
.hub h1{font-size:40px}
.sgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:12px}
.scard{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:10px;min-height:150px;transition:border-color .18s,background .18s}
.scard:hover{border-color:var(--border-strong);background:var(--surface-2)}
.scard .num{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.scard h3{font-size:16px}
.scard p{font-size:12.5px;color:var(--muted);flex:1}
.scard .foot{display:flex;align-items:center;justify-content:space-between;gap:8px}
.scard .go{font-size:12px;color:var(--text-2);font-weight:500}
.sgroup{margin:34px 0 12px}

/* ───────── Mobile (iPhone) ───────── */
body.mobile{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:40px 16px;background:var(--bg)}
.phone{width:393px;height:852px;background:#000;border-radius:58px;padding:12px;box-shadow:0 0 0 2px #2a2a2e,0 0 0 6px #121214,var(--shadow);position:relative;flex-shrink:0}
.phone::before{content:"";position:absolute;left:-8px;top:200px;width:4px;height:60px;background:#2a2a2e;border-radius:2px}
.phone::after{content:"";position:absolute;right:-8px;top:240px;width:4px;height:90px;background:#2a2a2e;border-radius:2px}
.screen{width:100%;height:100%;background:var(--bg);border-radius:46px;overflow:hidden;position:relative;display:flex;flex-direction:column}
.screen main{flex:1;display:flex;flex-direction:column;min-height:0}
.island{position:absolute;top:11px;left:50%;transform:translateX(-50%);width:120px;height:35px;background:#000;border-radius:999px;z-index:20}
.statusbar{height:54px;display:flex;align-items:flex-end;justify-content:space-between;padding:0 32px 10px;font-size:15px;font-weight:600;flex-shrink:0}
.statusbar .icons{display:flex;gap:5px;align-items:center}
.statusbar .batt{width:25px;height:12px;border:1.5px solid currentColor;border-radius:4px;position:relative;opacity:.9}
.statusbar .batt::after{content:"";position:absolute;left:2px;top:2px;right:2px;bottom:2px;background:currentColor;border-radius:1.5px}
.mhead{padding:6px 20px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0}
.mhead h1{font-size:28px}
.mhead .back{color:var(--text);display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;margin-left:-12px;border-radius:50%}
.mhead .back:active{background:var(--surface-2)}
.mrow:active{background:var(--surface-2)}
a.mstat:active{background:var(--surface-2)}
.mhead .icon-btn{width:44px;height:44px}
.mbody{flex:1;overflow:auto;padding:0 16px 16px;-webkit-overflow-scrolling:touch}
.mbody::-webkit-scrollbar{display:none}
.tabbar{height:84px;border-top:1px solid var(--border);background:var(--surface);display:flex;justify-content:space-around;padding:10px 8px 0;flex-shrink:0;position:relative}
.tabbar a{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;font-size:10px;color:var(--muted);font-weight:500;width:68px;min-height:52px;padding-top:2px}
.tabbar a:active{color:var(--text)}
.tabbar a svg{width:24px;height:24px}
.tabbar a.active{color:var(--text)}
.home-ind{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);width:134px;height:5px;border-radius:3px;background:var(--text);opacity:.85}
.mrow{display:flex;align-items:center;gap:12px;padding:12px 4px;min-height:52px;border-bottom:1px solid var(--border)}
.mrow:last-child{border-bottom:0}
.mcard{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px;margin-bottom:12px}
.mgroup{background:var(--surface);border:1px solid var(--border);border-radius:14px;margin-bottom:14px;overflow:hidden}
.mgroup .mrow{padding:12px 16px}
.msection{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:500;padding:14px 4px 6px}
.mlink{color:var(--text);font-weight:500;font-size:13px}
.mstat{display:flex;flex-direction:column;gap:2px;padding:12px;border-radius:12px;background:var(--surface);border:1px solid var(--border)}
.mstat b{font-family:var(--serif);font-size:22px;font-weight:500}
.mstat span{font-size:11px;color:var(--muted)}
.big-btn{display:flex;align-items:center;justify-content:center;padding:14px;min-height:50px;border-radius:12px;background:var(--primary);color:var(--primary-ink);font-weight:600;font-size:15px}
.mchat{flex:1;overflow:auto;padding:8px 16px 16px;display:flex;flex-direction:column;gap:10px}
.mchat::-webkit-scrollbar{display:none}
.mbubble{max-width:82%;padding:9px 13px;border-radius:18px;background:var(--surface-2);border:1px solid var(--border);font-size:14.5px;line-height:1.4}
.mmsg{display:flex;flex-direction:column;gap:3px;align-items:flex-start}
.mmsg.me{align-items:flex-end} .mmsg.me .mbubble{background:var(--primary);color:var(--primary-ink);border-color:transparent}
.mmsg .who{font-size:11px;color:var(--muted);margin-left:6px}
.mmsg .tr{font-size:10.5px}
.mmsg.me .tr{border-top-color:rgba(0,0,0,.15);color:rgba(0,0,0,.55)} .mmsg.me .tr b{color:rgba(0,0,0,.8)} .mmsg.me .tr a{color:rgba(0,0,0,.8)}
:root[data-theme="light"] .mmsg.me .tr{border-top-color:rgba(255,255,255,.2);color:rgba(255,255,255,.6)} :root[data-theme="light"] .mmsg.me .tr b,:root[data-theme="light"] .mmsg.me .tr a{color:#fff}
.mcomposer{display:flex;gap:8px;align-items:center;padding:8px 12px 10px;border-top:1px solid var(--border);flex-shrink:0}
.mcomposer .icon-btn{width:44px;height:44px}
.mcomposer .input{border-radius:999px;background:var(--surface-2);min-height:44px}
.send{width:44px;height:44px;border-radius:50%;background:var(--primary);color:var(--primary-ink);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.send svg{width:18px;height:18px}
.fab{position:absolute;right:20px;bottom:100px;width:52px;height:52px;border-radius:50%;background:var(--primary);color:var(--primary-ink);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,.4);z-index:10}
.phone-label{margin-top:18px;margin-bottom:64px;font-size:12px;color:var(--muted);display:flex;gap:16px;align-items:center}
.mob-tools{position:fixed;top:16px;left:16px;right:16px;display:flex;justify-content:space-between;z-index:30}
@media (max-height:960px){.phone{zoom:.85}}
@media (max-height:820px){.phone{zoom:.72}}

/* Scenario pager */
.pager{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:2px;background:var(--surface);border:1px solid var(--border-strong);border-radius:999px;padding:4px;box-shadow:0 10px 30px rgba(0,0,0,.35);z-index:60}
.pager a{width:36px;height:36px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--text);font-size:17px;line-height:1}
.pager a:hover{background:var(--surface-2)} .pager a.off{opacity:.3;pointer-events:none}
.pager span{font-size:11px;color:var(--muted);padding:0 10px;font-variant-numeric:tabular-nums;white-space:nowrap}

/* Auth */
.auth{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--bg)}
.auth-card{width:100%;max-width:400px;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:32px;box-shadow:var(--shadow)}
.auth-card .wordmark{display:block;text-align:center;margin-bottom:22px}
.auth-card h1{font-size:26px;text-align:center}
.auth-card .sub{text-align:center;color:var(--muted);font-size:13px;margin:6px 0 24px}
.auth .input{padding:12px 14px;font-size:14px;min-height:44px}
.auth .btn{min-height:44px}
.pw{position:relative} .pw .input{padding-right:64px}
.pw .show{position:absolute;right:6px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--text-2);padding:6px 8px;border-radius:6px;cursor:pointer}
.pw .show:hover{background:var(--surface-2);color:var(--text)}
.or{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:11px;letter-spacing:.12em;text-transform:uppercase;margin:18px 0}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--border)}
.auth-foot{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin:4px 0 18px}
.auth-foot label{display:flex;align-items:center;gap:8px;cursor:pointer}
.auth-foot a{color:var(--text-2);text-decoration:underline;text-underline-offset:3px}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
.mhead .grow .xs{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* View-as switcher */
.viewas{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);border:1px solid var(--border-strong);border-radius:999px;padding:0 4px 0 11px;min-height:30px;background:var(--surface)}
.viewas select{background:transparent;border:0;color:var(--text);font:inherit;font-size:12px;font-weight:500;outline:none;padding:4px 6px;cursor:pointer;max-width:200px}

/* Custom dropdown */
.dd{position:relative;display:inline-block}
.dd-block{display:block;width:100%}
.dd-btn{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:38px;padding:8px 10px 8px 12px;border-radius:var(--radius-sm);border:1px solid var(--border-strong);background:var(--bg);color:var(--text);font:inherit;font-size:13px;cursor:pointer;text-align:left;transition:border-color .18s,box-shadow .18s}
:root[data-theme="light"] .dd-btn{background:var(--surface)}
.dd-btn svg{color:var(--muted);transition:transform .18s}
.dd-btn:hover{border-color:var(--text-2)}
.dd-btn:focus-visible{border-color:var(--accent);box-shadow:0 0 0 3px var(--ring);outline:none}
.dd.open .dd-btn{border-color:var(--accent)} .dd.open .dd-btn svg{transform:rotate(180deg)}
.dd-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dd-menu{position:absolute;top:calc(100% + 6px);left:0;min-width:100%;background:var(--surface);border:1px solid var(--border-strong);border-radius:9px;padding:4px;box-shadow:0 14px 40px rgba(0,0,0,.35);z-index:80;display:none;max-height:280px;overflow:auto}
.dd.open .dd-menu{display:block}
.dd-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border-radius:6px;font-size:13px;color:var(--text-2);cursor:pointer;white-space:nowrap}
.dd-item:hover{background:var(--surface-2);color:var(--text)}
.dd-item svg{visibility:hidden;color:var(--text)} .dd-item.on{color:var(--text)} .dd-item.on svg{visibility:visible}
.viewas{padding:0 2px 0 11px}
.viewas .dd-btn{border:0;background:transparent;min-height:28px;padding:4px 6px;font-size:12px;font-weight:500}
.viewas .dd-menu{left:auto;right:0;min-width:240px}
/* Scrollbars */
*{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent}
*::-webkit-scrollbar{width:8px;height:8px} *::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:8px;border:2px solid transparent;background-clip:padding-box}
[hidden]{display:none!important}
.mbody>*{flex-shrink:0}
.mhead .icon-btn svg{width:22px;height:22px}
.bell{position:relative;display:inline-flex}
.bell-dot{position:absolute;top:-3px;right:-4px;width:8px;height:8px;border-radius:50%;background:var(--accent);border:2px solid var(--bg);box-sizing:content-box}
.chip[data-f]{cursor:pointer;min-height:32px;padding:5px 12px}
.row[data-chipfilter]{flex-shrink:0}
