/* message-hub.css - the Message Hub UI's styles, shared by the Fleet control
   plane (chats.html) and the customer Chats application (S1-13). Moved here
   unchanged from chats.html; a surface adds only its own stylesheet after it. */
:root {
  --bg: #0a0f17; --sidebar: #070b12; --surface: #101724; --surface2: #17202f; --surface3: #1e2939; --border: #223046;
  --text: #e8edf4; --muted: #8b99ab; --faint: #5f6d80;
  --accent: #3f7fe8; --accent-strong: #6099f0; --accent-soft: #14243d; --rose: #e07a9b; --rose-soft: #2c1a25;
  --ok: #3ec585; --ok-soft: #0f2a1e; --warn: #e6b04a; --warn-soft: #322508; --bad: #e26262; --bad-soft: #391a1a;
  --off: #8d9aa8; --off-soft: #1c2634; --info: #a78bfa; --info-soft: #241f3d;
  --btn-primary-text: #0b1220;
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .22);
  --shadow-modal: 0 10px 44px rgba(0, 0, 0, .6);
  --av-1: #3987e5; --av-2: #d95926; --av-3: #199e70; --av-4: #c98500; --av-5: #d55181; --av-6: #9085e9;
  --tier-low: var(--off); --tier-low-soft: var(--off-soft);
  --tier-mid: var(--accent-strong); --tier-mid-soft: var(--accent-soft);
  --tier-high: var(--warn); --tier-high-soft: var(--warn-soft);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; margin: 0; line-height: 1.45; }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; }
.num { font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 218px; flex: none; background: var(--sidebar); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.brand .glyph { color: var(--rose); font-size: 1.35rem; line-height: 1; }
.brand .words { line-height: 1.15; }
.brand .words b { display: block; font-size: .92rem; letter-spacing: .1em; }
.brand .words span { display: block; font-size: .68rem; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; }
.sidenav { display: flex; flex-direction: column; gap: 4px; }
.navitem { display: flex; align-items: center; gap: 10px; font: inherit; font-size: .92rem; font-weight: 500; color: var(--muted); text-decoration: none; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 9px 12px; cursor: pointer; text-align: left; }
.navitem:hover { color: var(--text); background: var(--surface); }
.navitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.navitem.active { color: var(--text); background: var(--accent-soft); border-color: var(--border); font-weight: 600; }
.navitem .ico { width: 18px; text-align: center; flex: none; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navitem.parent { width: 100%; }
.navitem.parent .navcaret { margin-left: auto; font-size: .7rem; color: var(--faint); transition: transform .12s; }
.navgroup.open .navitem.parent .navcaret { transform: rotate(90deg); }
.navchildren { display: flex; flex-direction: column; gap: 2px; margin-left: 20px; padding-left: 10px; border-left: 1px solid var(--border); }
.navgroup:not(.open) .navchildren { display: none; }
.navitem.child { font-size: .86rem; padding: 7px 11px; }
.navitem.child::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.navitem.child.active::before { opacity: 1; color: var(--accent-strong); }
.sidefoot { margin-top: auto; color: var(--faint); font-size: .74rem; padding: 0 8px; overflow-wrap: anywhere; }

/* ---- main: the chat workspace fills the viewport ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: .9rem; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent; text-decoration: none; color: var(--text); background: transparent; white-space: nowrap; flex: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface2); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-quiet { color: var(--muted); font-weight: 500; padding: 5px 9px; font-size: .84rem; }
.btn-quiet:hover { color: var(--accent-strong); background: var(--surface2); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 9px; color: var(--muted); font-size: 1rem; }
.btn-icon:hover { color: var(--text); background: var(--surface2); }
.btn-icon[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.off { background: var(--off); } .dot.info { background: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; flex: none; border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.off { background: var(--off-soft); color: var(--off); }
.pill.info { background: var(--accent-soft); color: var(--accent-strong); } .pill.rose { background: var(--rose-soft); color: var(--rose); }

/* ---- creator tab bar (Messages Pro region A) ---- */
.creatorbar { display: flex; align-items: stretch; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--border); background: var(--sidebar); overflow-x: auto; flex: none; }
.ctab { display: flex; align-items: center; gap: 9px; padding: 8px 12px 9px; border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: .88rem; font-weight: 500; position: relative; }
.ctab:hover { color: var(--text); background: var(--surface); }
.ctab.active { color: var(--text); background: var(--bg); border-color: var(--border); font-weight: 600; }
.ctab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--bg); }
.ctab .cbadge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--rose); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.ctab .cstate { font-size: .7rem; color: var(--faint); }
.ctab .cclose { margin-left: 2px; color: var(--faint); border: 0; background: transparent; cursor: pointer; padding: 0 2px; border-radius: 4px; font-size: .9rem; line-height: 1; }
.ctab .cclose:hover { color: var(--bad); background: var(--bad-soft); }
.ctab-add { align-self: center; margin-left: 2px; }
.creatorbar .spacer { flex: 1; }
.sfw { align-self: center; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; margin: 0 8px; }
.sfw .sfwlabel { font-size: .62rem; font-weight: 800; letter-spacing: .04em; color: var(--text); line-height: 1; }
.sfw .switch { width: 38px; height: 20px; }
.sfw .switch::after { width: 14px; height: 14px; }
.sfw .switch[aria-checked="true"] { background: #f0894a; border-color: #f0894a; }
.sfw .switch[aria-checked="true"]::after { left: 20px; }
[data-sfw="on"] .msg .tile img, [data-sfw="on"] .msg .tile video, [data-sfw="on"] .gtile img, [data-sfw="on"] .gtile video, [data-sfw="on"] .composer .att img, [data-sfw="on"] .composer .att video, [data-sfw="on"] #viewerBody:not([data-reveal="on"]) img, [data-sfw="on"] #viewerBody:not([data-reveal="on"]) video { filter: blur(16px) saturate(.6); transform: scale(1.08); }
[data-sfw="on"] .msg .tile, [data-sfw="on"] .gtile, [data-sfw="on"] .composer .att { overflow: hidden; }
.sfwmark { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: none; place-items: center; pointer-events: none; }
.sfwmark .ic { width: 15px; height: 15px; }
[data-sfw="on"] .sfwmark { display: grid; }
#viewerReveal { display: none; }
[data-sfw="on"] #viewerReveal { display: inline-flex; }
.creatorbar .barmeta { align-self: center; color: var(--faint); font-size: .76rem; padding: 0 6px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: #fff; flex: none; position: relative; letter-spacing: .02em; }
.avatar.sm { width: 22px; height: 22px; font-size: .64rem; }
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.avatar[data-hue="1"] { background: var(--av-1); } .avatar[data-hue="2"] { background: var(--av-2); } .avatar[data-hue="3"] { background: var(--av-3); }
.avatar[data-hue="4"] { background: var(--av-4); } .avatar[data-hue="5"] { background: var(--av-5); } .avatar[data-hue="6"] { background: var(--av-6); }
.avatar .presence { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--off); }
.avatar .presence[data-presence="online"] { background: var(--ok); }
.avatar .presence[data-presence="unknown"] { background: transparent; border-color: transparent; }

/* ---- chat tabs (Messages Pro region B): Home = the inbox, one tab per pinned chat ---- */
.chattabs { display: flex; align-items: flex-end; gap: 3px; padding: 6px 12px 0; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; }
.chattab { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 220px; position: relative; }
.chattab:hover { color: var(--text); background: var(--surface2); }
.chattab.active { color: var(--text); background: var(--bg); border-color: var(--border); }
.chattab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--bg); }
.chattab .tname { overflow: hidden; text-overflow: ellipsis; }
.chattab .ic { width: 15px; height: 15px; }
.chattab .tclose { width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--off-soft); color: var(--muted); font-size: .7rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.chattab .tclose:hover { background: var(--bad-soft); color: var(--bad); }
.chattab .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); flex: none; }
.chattab.home { padding-left: 12px; }
.tabfocus { padding: 6px 0 0; }
.tabfocus .thread { cursor: default; border-left-color: var(--accent); background: var(--accent-soft); }
.tabfocus .tfnote { padding: 12px 14px; font-size: .78rem; color: var(--faint); }
.convhead .backBtn { display: inline-flex; }

/* ---- creator list (the Home tab: every creator, one card each) ---- */
.creators { flex: 1; min-height: 0; overflow-y: auto; padding: 34px 40px 28px; display: flex; flex-direction: column; gap: 18px; }
.creators .inner { width: min(1320px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.creators .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.creators h1 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; }
.creators .head .grow { flex: 1; }
.creators .head select, .creators .head input { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; color: var(--text); font: inherit; font-size: .88rem; min-width: 200px; }
.creators .head input:focus, .creators .head select:focus { outline: none; border-color: var(--accent); }
.creatorgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 14px; align-content: start; }
.creator { position: relative; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; min-width: 0; min-height: 80px; box-shadow: var(--shadow); color: var(--text); }
.creator:hover { border-color: var(--accent); background: var(--surface2); }
.creator:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.creator .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.creator .cname { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator .chandle { color: var(--faint); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator .badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.creator .badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px; font-size: .7rem; font-weight: 700; line-height: 1.5; }
.creator .badge.unread { background: var(--rose); color: #fff; }
.creator .badge.flags { background: var(--ok); color: #05130c; }
.creator .badge.state { background: var(--warn-soft); color: var(--warn); }
.creator .badge.state.off { background: var(--off-soft); color: var(--off); }
.creator .badge.state.bad { background: var(--bad-soft); color: var(--bad); }
.creator .opened { position: absolute; top: -1px; right: 10px; background: var(--accent); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .04em; border-radius: 0 0 6px 6px; padding: 2px 7px; }
.creator[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.creator[aria-disabled="true"]:hover { border-color: var(--border); background: var(--surface); }
.creators .foot { margin-top: auto; text-align: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--muted); font-size: .88rem; }
.creators .listempty { padding: 40px 0; }
.ctab.home .ico { color: var(--muted); }

/* ---- workspace grid: inbox | conversation | insights ---- */
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 272px; }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.inbox { border-right: 1px solid var(--border); background: var(--surface); }
.insights { border-left: 1px solid var(--border); background: var(--surface); }
.notice { margin: 10px 12px 0; padding: 9px 12px; border-radius: 8px; font-size: .84rem; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); }
.notice.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.notice.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.notice a { color: inherit; }

/* inbox header — title row, two wide actions, selector row, chip rail */
.inboxhead { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 9px; border-bottom: 1px solid var(--border); }
.inboxhead .row1 { display: flex; align-items: center; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin: 0 -12px; padding-left: 12px; padding-right: 8px; }
.inboxhead .title { font-weight: 700; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inboxhead .wide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wideBtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 0; border-radius: 10px; padding: 0 8px; font-size: .8rem; font-weight: 600; cursor: pointer; color: #fff; white-space: nowrap; min-width: 0; overflow: hidden; }
.wideBtn .ic { width: 17px; height: 17px; flex: none; }
.wideBtn .lbl { overflow: hidden; text-overflow: ellipsis; }
.wideBtn.online { background: var(--accent); }
.wideBtn.online:hover { background: var(--accent-strong); }
.wideBtn.online[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #ffffff55; }
.wideBtn.notif { background: var(--ok); color: #05130c; }
.wideBtn.notif:hover { filter: brightness(1.06); }
.wideBtn .nbadge { background: var(--rose); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 700; line-height: 1; flex: none; }
.ic { width: 16px; height: 16px; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon .ic { width: 17px; height: 17px; }
.inboxhead .selrow { display: flex; align-items: center; gap: 5px; }
.inboxhead .selrow .inboxBtn { flex: 1 1 130px; min-width: 132px; display: inline-flex; align-items: center; gap: 7px; background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 0 8px; height: 30px; color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.inboxhead .selrow .inboxBtn .lbl { overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; }
.inboxhead .selrow .inboxBtn .caret { color: var(--faint); font-size: .6rem; }
.inboxhead .selrow .inboxBtn:hover { border-color: var(--accent); }
.menu .stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; font-size: .86rem; }
.menu .stepper .ctl { display: inline-flex; align-items: center; gap: 4px; }
.menu .stepper .ctl button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface3); color: var(--text); cursor: pointer; font-size: .9rem; }
.menu .stepper .ctl button[disabled] { opacity: .4; cursor: not-allowed; }
.menu .stepper .ctl b { min-width: 18px; text-align: center; }
.thread .inboxno { position: absolute; top: 6px; left: 6px; background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--border); border-radius: 5px; font-size: .6rem; font-weight: 700; padding: 0 4px; line-height: 1.5; }
.thread { position: relative; }
.inboxhead .selrow .orderBtn { display: inline-block; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .8rem; padding: 6px 2px; white-space: nowrap; }
.inboxhead .selrow .orderBtn:hover { color: var(--text); background: var(--surface2); }
.inboxhead .selrow .btn-icon { width: 28px; height: 28px; flex: none; border: 1px solid var(--border); background: var(--surface2); }
.inboxhead .selrow .btn-icon.plain { border: 0; background: transparent; }
.chip { position: relative; }
.chip .cbadge { position: absolute; top: -8px; right: -6px; background: var(--rose); color: #fff; border-radius: 999px; font-size: .62rem; font-weight: 700; padding: 0 5px; line-height: 1.5; min-width: 16px; text-align: center; }
.chiprail { padding-top: 8px; row-gap: 12px; }
.notifpanel { position: absolute; z-index: 30; left: 12px; right: 12px; top: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-modal); max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; }
.notifpanel .nhead { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface2); }
.notifpanel .nitem { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer; color: var(--text); width: 100%; }
.notifpanel .nitem:hover { background: var(--surface3); }
.notifpanel .nitem .nt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.notifpanel .nhead .sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--faint); }
.notifpanel .nitem .nn { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notifpanel .nitem .ns { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notifpanel .nitem .nw { font-size: .7rem; color: var(--faint); white-space: nowrap; }
.notifpanel .nempty { padding: 18px 12px; color: var(--muted); font-size: .84rem; text-align: center; }
.notifpanel.wide { left: 12px; right: 12px; max-height: 520px; }
.notifpanel .ntabs { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; position: sticky; top: 40px; background: var(--surface2); z-index: 1; }
.notifpanel .ntabs .chip { padding: 5px 12px; font-size: .8rem; }
.notifpanel .ntabs .chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.notifpanel .ntabs .chip[disabled] { opacity: .5; cursor: not-allowed; }
.notifpanel .ntabs .chip .cbadge { background: var(--ok); color: #04150f; }
.nrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.nrow .nname { font-weight: 700; font-size: .9rem; }
.nrow .nhandle { color: var(--muted); font-weight: 500; margin-left: 6px; }
.nrow .nlists { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .78rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nrow .nlists .ic { width: 13px; height: 13px; color: var(--accent-strong); fill: currentColor; flex: none; }
.nrow .nmsg { font-size: .88rem; margin-top: 4px; }
.nrow .nwhen { color: var(--faint); font-size: .76rem; margin-top: 2px; }
.nrow .nreply { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.nrow .nreply input { flex: 1 1 0; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; font-size: .84rem; }
.nrow .nreply input:focus { outline: none; border-color: var(--accent); }
.nrow .nreply .btn-secondary { padding: 6px 12px; font-size: .82rem; }
.nrow .nreply .btn-secondary[disabled] { opacity: .45; }
.nrow .nreply .open { width: 32px; height: 32px; border: 1px solid var(--accent); color: var(--accent-strong); border-radius: 8px; background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.nrow .nreply .open .ic { width: 16px; height: 16px; }
.notifpanel .nhead h3 { margin: 0; font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 700; }
.notifpanel .ntools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notifpanel .ntools select { background: var(--surface3); border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; color: var(--accent-strong); font: inherit; font-size: .8rem; font-weight: 600; max-width: 55%; }
.notifpanel .ntools .btn-primary { padding: 6px 10px; font-size: .78rem; white-space: nowrap; flex: none; }
.orow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.orow .oname { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow .ospend { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.orow .btn-icon { width: 30px; height: 30px; color: var(--accent-strong); }
.orow .btn-icon.warn { color: var(--warn); }
.searchrow { display: flex; gap: 6px; }
.searchrow input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; color: var(--text); font: inherit; font-size: .88rem; }
.searchrow input:focus { outline: none; border-color: var(--accent); }
.searchrow select, .field select, .field input, .field textarea { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px; color: var(--text); font: inherit; font-size: .86rem; }
.chiprail { display: flex; flex-wrap: wrap; gap: 6px; max-height: 62px; overflow-y: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }
.chip .ccount { color: var(--faint); font-weight: 500; }
.chip[aria-pressed="true"] .ccount { color: var(--accent-strong); opacity: .8; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 230px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-modal); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu .mhead { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 2px; }
.menu .mitem { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 7px; padding: 7px 9px; font-size: .86rem; color: var(--text); cursor: pointer; }
.menu .mitem:hover { background: var(--surface3); }
.menu .mitem[aria-checked="true"]::before { content: "✓"; color: var(--accent-strong); font-weight: 700; }
.menu .mitem[aria-checked="false"]::before { content: ""; width: 9px; }
.menu .mitem.danger { color: var(--bad); }
.menu .mitem.radio::before, .menu .mitem.check::before { content: ""; width: 16px; height: 16px; flex: none; border: 2px solid var(--faint); box-sizing: border-box; }
.menu .mitem.radio::before { border-radius: 50%; }
.menu .mitem.check::before { border-radius: 4px; }
.menu .mitem.radio[aria-checked="true"] { color: var(--accent-strong); }
.menu .mitem.radio[aria-checked="true"]::before { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface2); background: var(--accent); }
.menu .mitem.check[aria-checked="true"]::before { border-color: var(--accent); background: var(--accent); }
.menu .mitem.plain { font-weight: 600; }
.menu .focuscard { margin: 2px 6px 4px 30px; background: var(--surface3); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.menu .focuscard .frow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .88rem; font-weight: 600; }
.menu .focuscard .fsub { font-size: .76rem; color: var(--muted); }
.switch { width: 40px; height: 22px; border-radius: 999px; background: var(--off-soft); border: 1px solid var(--border); position: relative; cursor: pointer; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .12s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { left: 20px; }
.menu.right { left: auto; right: 0; min-width: 270px; }
.menu.ctxmenu { position: fixed; top: auto; left: auto; min-width: 250px; z-index: 45; }
.menu .mitem[disabled] { opacity: .45; cursor: not-allowed; }
.menu .mitem .sub { margin-left: auto; color: var(--faint); font-size: .74rem; }
.inboxhead .selrow { position: relative; }
#inboxMenu { left: 0; right: auto; min-width: 200px; }
.menu .msep { height: 1px; background: var(--border); margin: 4px 2px; }
.menuwrap { position: relative; }

/* inbox rows */
.inboxlist { flex: 1; overflow-y: auto; min-height: 0; }
.thread { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; width: 100%; text-align: left; background: transparent; border-left: 3px solid transparent; border-top: 0; border-right: 0; }
.thread:hover { background: var(--surface2); }
.thread.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.thread .avcol { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.spend { font-size: .68rem; font-weight: 700; border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.spend[data-tier="low"] { color: var(--tier-low); background: var(--tier-low-soft); }
.spend[data-tier="mid"] { color: var(--tier-mid); background: var(--tier-mid-soft); }
.spend[data-tier="high"] { color: var(--tier-high); background: var(--tier-high-soft); }
.spend[data-tier="none"] { color: var(--faint); background: transparent; }
.thread .body { min-width: 0; }
.thread .nameline { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.thread .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .handle { color: var(--faint); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .flags { color: var(--warn); font-size: .72rem; }
.avatar.status-expired { background: #f0665a; }
.avatar.status-hot { background: #f28c28; }
.avatar.status-new { background: #17b28a; font-size: .62rem; letter-spacing: .04em; }
.avatar.status-expired .ic, .avatar.status-hot .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.avatar.status-hot .ic { fill: #fff; stroke: none; }
.thread .stag { display: inline-flex; align-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .04em; flex: none; }
.thread .stag.hot { color: #f28c28; }
.thread .stag.hot .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.thread .stag.new { color: #17b28a; }
.thread .stag.expired { color: #f0665a; }
.thread .snippet { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; display: flex; gap: 5px; align-items: center; }
.thread .snippet.bold { color: var(--text); font-weight: 600; }
.thread .snippet .who { color: var(--faint); font-weight: 500; }
.thread .snippet.auto { color: var(--faint); font-style: italic; font-weight: 500; }
.thread .snippet .glyph { flex: none; }
.thread .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: .72rem; color: var(--faint); white-space: nowrap; }
.thread .reply { background: var(--rose-soft); color: var(--rose); font-weight: 700; font-size: .66rem; border-radius: 6px; padding: 2px 6px; letter-spacing: .04em; }
.thread .owner { font-size: .66rem; color: var(--info); }
.thread .hide { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0 3px; border-radius: 4px; opacity: 0; font-size: .8rem; }
.thread:hover .hide { opacity: 1; }
.thread .hide:hover { color: var(--bad); background: var(--bad-soft); }
.inboxfoot { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--faint); }
.listempty { padding: 26px 16px; color: var(--muted); text-align: center; font-size: .88rem; }

/* conversation pane */
.conv { background: var(--bg); }
.convhead { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.convhead .who { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.convhead .fanname { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; line-height: 1.2; min-width: 0; letter-spacing: -.01em; }
.convhead .fanname .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.convhead .fanname a.nm:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.convhead .fanname .pen { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; display: inline-grid; place-items: center; }
.convhead .fanname .pen .ic { width: 16px; height: 16px; }
.convhead .fanname .pen:hover { color: var(--accent-strong); background: var(--surface2); }
.convhead .seenrow { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; }
.convhead .seen { font-size: .76rem; color: var(--muted); white-space: nowrap; padding-right: 8px; }
.convhead .sep { width: 1px; height: 13px; background: var(--border); margin: 0 4px; flex: none; }
.convhead .seenrow .btn-icon { width: 24px; height: 24px; }
.convhead .seenrow .btn-icon .ic { width: 14px; height: 14px; }
.convhead .seenrow .tool { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 6px; border: 0; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 500; cursor: pointer; border-radius: 6px; }
.convhead .seenrow .tool:hover { color: var(--text); background: var(--surface2); }
.convhead .seenrow .tool .ic { width: 14px; height: 14px; }
.convhead .seenrow .btn-icon[aria-pressed="true"] { color: var(--accent-strong); }
.convhead .seenrow .btn-icon[aria-pressed="true"] .ic { fill: currentColor; }
.convhead .backBtn { display: inline-flex; align-self: center; }
.convhead .fanname button.nm { border: 0; background: transparent; font: inherit; font-weight: 700; padding: 0; cursor: pointer; text-align: left; }
.convhead .fanname button.nm:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.findbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.findbar input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; color: var(--text); font: inherit; font-size: .92rem; }
.findbar input:focus { outline: none; border-color: var(--accent); }
.findbar .btn-icon { color: var(--muted); }
.findbar .btn-icon.go { color: var(--accent-strong); }
.findresults { max-height: 240px; overflow-y: auto; border-bottom: 1px solid var(--border); background: var(--surface); padding: 6px 12px; display: flex; flex-direction: column; gap: 6px; }
.findresults:empty { display: none; }
.notifpanel.pinnedpanel { left: 14px; right: 14px; top: 100%; margin-top: 4px; max-height: 300px; }
.pinnedpanel .nitem .ic { width: 15px; height: 15px; color: var(--accent-strong); flex: none; }
.convhead { position: relative; }
.galleryview { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.galleryview .ghead { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.galleryview .ghead .t { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.galleryview .ghead .st { font-size: .8rem; color: var(--muted); }
.galleryview .gchips { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.galleryview .gchips .chip { padding: 6px 14px; font-size: .84rem; border-radius: 999px; }
.galleryview .gchips .chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.galleryview .ggrid { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-content: start; }
.gtile2 { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface3); border: 0; padding: 0; cursor: pointer; display: block; }
.gtile2 img, .gtile2 video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gtile2 .who { position: absolute; top: 10px; left: 10px; }
.gtile2 .price { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 2px 8px; font-size: .78rem; font-weight: 700; color: #fff; background: #ee6b5b; }
.gtile2 .price.paid { background: #17b28a; color: #04150f; }
.gtile2 .price .ic { width: 12px; height: 12px; }
.gtile2 .meta { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: .76rem; background: rgba(0,0,0,.55); border-radius: 6px; padding: 2px 7px; }
.gtile2 .meta .ic { width: 14px; height: 14px; }
.gtile2 .meta .cap { border: 1.5px solid #fff; border-radius: 3px; font-size: .62rem; font-weight: 800; padding: 0 3px; line-height: 1.3; }
.gtile2 .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; pointer-events: none; }
.gtile2 .play .ic { width: 20px; height: 20px; fill: currentColor; }
[data-sfw="on"] .gtile2 img, [data-sfw="on"] .gtile2 video { filter: blur(16px) saturate(.6); transform: scale(1.08); }
.galleryview .gempty { padding: 40px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.fanhead { display: flex; align-items: center; gap: 14px; }
.fanhead .fn { font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.fanhead .fh { color: var(--muted); font-size: .9rem; }
.fanlists { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.fanlists .ic { width: 16px; height: 16px; color: var(--accent-strong); fill: currentColor; }
.fanacts { display: flex; gap: 8px; flex-wrap: wrap; }
.fanacts .btn { border-radius: 999px; background: var(--surface2); border-color: var(--border); gap: 8px; }
.fantabs { display: flex; border-bottom: 1px solid var(--border); }
.fantabs button { flex: 1; border: 0; background: transparent; padding: 10px 4px; font-size: .95rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.fantabs button[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.fanrows .kv2 { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.fanrows .kv2:last-child { border-bottom: 0; }
.convhead .acts { display: flex; gap: 0; align-items: center; flex: none; }
.convhead .acts .btn-icon { width: 30px; height: 30px; }
.convhead .acts .btn-icon .ic { width: 17px; height: 17px; }
.convhead .backBtn { width: 32px; height: 32px; margin-top: 6px; }
.convhead .backBtn .ic { width: 20px; height: 20px; }
.convhead .fanname .nm { min-width: 0; }
.convhead .seen { flex-wrap: wrap; row-gap: 0; }
.ownerbanner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: .84rem; border-bottom: 1px solid var(--border); }
.ownerbanner.bot { background: var(--info-soft); color: var(--info); }
.ownerbanner.human { background: var(--ok-soft); color: var(--ok); }
.ownerbanner.hold { background: var(--warn-soft); color: var(--warn); }
.ownerbanner .grow { flex: 1; }
.ownerbanner .btn { padding: 5px 10px; font-size: .8rem; background: rgba(0,0,0,.25); }
.timelinewrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.timeline { flex: 1; overflow-y: auto; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.tl-tools { display: flex; justify-content: center; gap: 8px; padding: 6px 0; }
.daysep { align-self: center; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); background: var(--surface2); border-radius: 999px; padding: 3px 10px; margin: 8px 0 4px; }
.msg { display: flex; gap: 8px; max-width: min(78%, 820px); align-items: flex-end; position: relative; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 8px 12px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.msg.in .bubble { border-bottom-left-radius: 4px; }
.msg.out .bubble { background: var(--accent-soft); border-color: #1f3a66; border-bottom-right-radius: 4px; }
.msg.unsent .bubble { color: var(--faint); font-style: italic; }
.msg.pending .bubble { opacity: .6; }
.msg.failed .bubble { border-color: var(--bad); }
.msg .quote { border-left: 3px solid var(--accent); padding: 2px 8px; margin-bottom: 6px; color: var(--muted); font-size: .8rem; white-space: pre-wrap; overflow: hidden; text-overflow: ellipsis; max-height: 3.6em; }
.msg .media { display: block; margin: 0 0 6px; }
.msg .carousel { position: relative; width: min(100%, 440px); aspect-ratio: 4 / 4.2; background: #1a2230; border-radius: 12px; overflow: hidden; }
.msg .tile { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; background: transparent; display: grid; place-items: center; color: var(--faint); font-size: .74rem; border: 0; cursor: pointer; padding: 0; }
.msg .tile img, .msg .tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
.msg .tile .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; pointer-events: none; }
.msg .tile .play .ic { width: 24px; height: 24px; fill: currentColor; }
.msg .carousel .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.msg .carousel .nav.prev { left: 8px; } .msg .carousel .nav.next { right: 8px; }
.msg .carousel .nav:hover { background: rgba(0,0,0,.7); }
.msg .carousel .nav[disabled] { opacity: .3; cursor: default; }
.msg .media .mcount { z-index: 2; }
.msg .textbubble { margin-top: 0; }
.msg .column { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg.out .column { align-items: flex-end; }
.msg .column .bubble { max-width: 100%; }
/* A media panel has its own width - 440px, never wider than its column. A percentage
   alone resolved against the shrink-to-fit column, so a media-only message collapsed
   to the width of its timestamp (a ~40px tile, half under the hover actions) and a
   captioned one to the width of its caption. */
.msg .column .media { width: 440px; max-width: 100%; }
.msg.ppv .media { border: 3px solid transparent; border-radius: 14px; padding: 0; }
.msg .foot { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: .68rem; color: var(--faint); flex-wrap: wrap; }
.msg.out .foot { justify-content: flex-end; }
.msg .avatar.sender { align-self: flex-end; }
.msg .foot .ticks { color: var(--accent-strong); }
.msg .foot .attrib { color: var(--muted); font-weight: 600; }
.msg .foot .who { color: var(--accent-strong); font-weight: 600; }
.msg .foot .auto { color: var(--info); font-weight: 600; }
.msg .foot .ppv { border-radius: 4px; padding: 2px 7px; font-weight: 700; font-size: .72rem; }
.msg .foot .ppv.paid { background: #17b28a; color: #04150f; }
.msg .foot .ppv.unpaid { background: #ee6b5b; color: #fff; }
.msg .foot .ppv.unknown { background: var(--off-soft); color: var(--muted); }
.msg.ppv-unpaid .media { border-color: #ee6b5b; }
.msg.ppv-paid .media { border-color: #17b28a; }
.msg .media { position: relative; }
.msg .media .mcount { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0,0,0,.65); color: #fff; font-size: .72rem; border-radius: 6px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 5px; pointer-events: none; }
.msg .media .mcount .ic { width: 13px; height: 13px; }
.msg .foot .tip { color: var(--ok); font-weight: 700; }
.msg .foot .flag { color: var(--rose); }
.msg .hover { position: absolute; top: -12px; display: none; gap: 2px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); }
.msg.in .hover { left: 40px; } .msg.out .hover { right: 0; }
.msg:hover .hover { display: flex; }
.msg .hover button { border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; width: 28px; height: 26px; display: grid; place-items: center; padding: 0; }
.msg .hover button .ic { width: 15px; height: 15px; }
.msg .hover button:hover { color: var(--text); background: var(--surface3); }
.msg .hover button[aria-pressed="true"] { color: var(--rose); }
.msg .hover button[aria-pressed="true"] .ic { fill: currentColor; }
.msg .hover button.danger:hover { color: var(--bad); background: var(--bad-soft); }
.msg .hover button[disabled] { opacity: .4; cursor: not-allowed; }
.tl-banner { align-self: center; font-size: .78rem; color: var(--muted); }
.msg .bubblerow { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.msg.out .bubblerow { flex-direction: row; }
.msg.in .bubblerow { flex-direction: row; }
.msg .side { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 0 4px; }
.msg .side button { width: 26px; height: 26px; border: 0; background: transparent; color: #8a94a3; border-radius: 6px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.msg .side button:hover, .msg .side button[aria-expanded="true"] { color: var(--accent-strong); }
.msg .side button[disabled] { cursor: not-allowed; }
.msg .side button[disabled]:hover { color: #8a94a3; }
.msg .side .ic { width: 19px; height: 19px; stroke-width: 1.8; }
.msg .side .ic.dotsv { fill: currentColor; stroke: none; }
.msgmenu { position: fixed; z-index: 45; display: flex; align-items: center; background: #2a3441; color: #fff; border-radius: 10px; padding: 8px 6px; box-shadow: var(--shadow-modal); font-size: .9rem; white-space: nowrap; }
.msgmenu button { border: 0; background: transparent; color: #fff; font: inherit; font-size: .9rem; padding: 4px 10px; cursor: pointer; border-radius: 6px; }
.msgmenu button:hover { background: rgba(255,255,255,.1); }
.msgmenu button[disabled] { opacity: .45; cursor: not-allowed; }
.msgmenu .div { width: 1px; height: 18px; background: rgba(255,255,255,.25); }

/* composer — Messages Pro layout: banner, emoji row, attachment tray, text, tool row */
.composer { border-top: 1px solid var(--border); background: var(--surface); padding: 0 0 10px; display: flex; flex-direction: column; gap: 0; }
.composer .cbanner { background: #f6c9d2; color: #7a1f36; font-size: .84rem; font-weight: 600; padding: 7px 12px; }
.composer .emojirow { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.composer .emojirow .emojistrip { flex: 1; min-width: 0; }
.composer .emojirow .right { display: flex; align-items: center; gap: 6px; flex: none; }
.composer .tool { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: var(--surface2); color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; }
.composer .tool .ic { width: 15px; height: 15px; }
.composer .tool.ai { color: var(--info); background: var(--info-soft); }
.composer .tool.scripts { color: var(--accent-strong); background: var(--accent-soft); }
.composer .tool[disabled] { opacity: .5; cursor: not-allowed; }
.composer .tray { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.composer .tray.single { grid-template-columns: 1fr; }
.composer .zone { display: flex; flex-direction: column; min-width: 0; }
.composer .zone.locked { background: #0f2233; }
.composer .zhead { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: .86rem; color: var(--muted); }
.composer .zone.locked .zhead { color: var(--text); }
.composer .zhead .ic { width: 16px; height: 16px; }
.composer .zhead .zprice { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); }
.composer .zhead .zprice button { width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: .7rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.composer .tiles { display: flex; gap: 8px; padding: 4px 12px 10px; overflow-x: auto; min-height: 0; }
.composer .tiles .att { width: 72px; height: 96px; flex: none; }
.composer .att { position: relative; border-radius: 8px; overflow: hidden; background: var(--surface3); border: 1px solid var(--border); cursor: pointer; }
.composer .att img, .composer .att video { width: 100%; height: 100%; object-fit: cover; display: block; }
.composer .att .rm { position: absolute; top: 5px; left: 5px; border: 0; background: rgba(0,0,0,.65); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .7rem; cursor: pointer; line-height: 1; }
.composer .att .kind { position: absolute; left: 4px; bottom: 26px; width: 18px; height: 18px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.composer .att .sel { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); cursor: pointer; padding: 0; display: grid; place-items: center; color: #fff; }
.composer .att .sel[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.composer .att .sel .ic { width: 12px; height: 12px; }
.composer .att .grip { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: grab; letter-spacing: 2px; font-size: .8rem; }
.composer .att.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.composer .att.dragging { opacity: .4; }
.composer .att.dropbefore { box-shadow: -4px 0 0 var(--accent); }
.composer .tray { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.composer .tray.single { grid-template-columns: 1fr; }
.composer .mover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 4px; }
.composer .mover button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.composer .mover button:hover { background: var(--surface2); color: var(--text); }
.composer .mover button[disabled] { opacity: .35; cursor: not-allowed; }
.composer .mover .ic { width: 16px; height: 16px; }
.composer .zone.dropzone { outline: 2px dashed var(--accent); outline-offset: -4px; }
.composer .att .kind .ic { width: 11px; height: 11px; }
.composer .att.add { display: grid; place-items: center; color: var(--faint); font-size: 1.4rem; background: var(--surface2); border-style: dashed; }
.composer .zone .hint { padding: 0 12px 8px; }
.composer textarea { width: auto; margin: 8px 12px 4px; resize: none; min-height: 44px; max-height: 180px; background: transparent; border: 0; padding: 4px 0; color: var(--text); font: inherit; font-size: .92rem; }
.composer textarea:focus { outline: none; }
.composer .toolbar { display: flex; align-items: center; gap: 2px; padding: 2px 8px 0; }
.composer .toolbar .btn-icon { width: 34px; height: 34px; color: var(--muted); }
.composer .toolbar .btn-icon[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.composer .toolbar .btn-icon[disabled] { opacity: .4; }
.composer .toolbar .grow { flex: 1; }
.composer .toolbar .btn-secondary { border-radius: 999px; padding: 7px 16px; }
.composer .toolbar .btn-primary { border-radius: 999px; padding: 7px 20px; }
.composer .hint { font-size: .74rem; color: var(--faint); }
.composer .hint.bad { color: var(--bad); }
.pricefield { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: 1rem; }
.pricefield:focus-within { border-color: var(--accent); }
.pricefield input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 1rem; }
.pricefield input:focus { outline: none; }
.ppvhist { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ppvhist .phead { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface2); font-size: .84rem; color: var(--muted); }
.ppvhist .phead .stat { margin-left: auto; }
.ppvhist .phead .stat b { color: var(--warn); }
.ppvhist .prow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--border); font-size: .84rem; }
.ppvhist .pempty { padding: 26px 12px; text-align: center; color: var(--faint); font-size: .86rem; }
.composer .replychip { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); background: var(--surface2); border-left: 3px solid var(--accent); border-radius: 6px; padding: 5px 8px; }
.composer .replychip .q { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .emojistrip { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.composer .replychip { margin: 6px 12px 0; }
.composer .emojistrip button { border: 0; background: transparent; font-size: 1.05rem; cursor: pointer; border-radius: 6px; padding: 2px 5px; line-height: 1.3; }
.composer .emojistrip button:hover { background: var(--surface2); }
.composer .emojistrip .gear { font-size: .8rem; color: var(--faint); margin-left: 4px; }

/* insights pane — cards with grips, bottom icon tabs (Messages Pro region E) */
.ctxtitle { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; font-weight: 700; font-size: 1rem; }
.ctxtitle .btn-primary { padding: 5px 12px; font-size: .8rem; background: #f0894a; color: #1a0d05; box-shadow: none; }
.ctxtitle .btn-primary:hover { background: #f59d66; }
.ctxhead { padding: 4px 14px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.ctxbody { padding-bottom: 12px; }
.ctxbody > * { flex: none; }
.ccard .chead .grip { color: var(--faint); letter-spacing: -2px; margin-right: 6px; font-size: .9rem; }
.ccard .chead .ctitle { flex: 1; text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--text); font-weight: 700; }
.spendgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.spendgrid .col + .col { border-left: 1px solid var(--border); padding-left: 12px; }
.spendgrid .k { font-size: .76rem; color: var(--muted); }
.spendgrid .big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.spendgrid .sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.kv2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .84rem; padding: 4px 0; min-height: 30px; }
.kv2 .k { color: var(--muted); flex: 0 0 auto; max-width: 46%; line-height: 1.25; }
.kv2 .v { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 1px; }
.kv2 .v > b, .kv2 .v > .field, .kv2 .v > .pillv, .kv2 .v > input, .kv2 .v > select { display: inline-flex; align-items: center; }
.kv2 .v b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kv2 .v .s { color: var(--muted); font-size: .76rem; font-weight: 500; }
.kv2 .v .sub { color: var(--muted); font-size: .74rem; }
.kv2 .field { flex-direction: row; gap: 6px; white-space: nowrap; max-width: 100%; }
.kv2 input, .kv2 select { background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; height: 28px; color: var(--text); font: inherit; font-size: .8rem; max-width: 150px; min-width: 0; }
.kv2 input[type="date"] { color-scheme: dark; width: 138px; padding-right: 4px; }
.kv2 .money { display: inline-flex; align-items: center; background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; height: 28px; padding: 0 6px 0 8px; gap: 2px; color: var(--muted); font-size: .8rem; }
.kv2 .money input { border: 0; background: transparent; height: 26px; width: 48px; padding: 0 2px; text-align: right; }
.kv2 .money input:focus { outline: none; }
.kv2 .cadence { width: 92px; }
.kv2 .pen { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; display: inline-grid; place-items: center; }
.kv2 .pen .ic { width: 14px; height: 14px; }
.kv2 .pen:hover { color: var(--accent-strong); background: var(--surface3); }
.pillv { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: .74rem; font-weight: 700; background: var(--off-soft); color: var(--text); }
.pillv.ok { background: var(--ok-soft); color: var(--ok); }
.pillv.warn { background: var(--warn-soft); color: var(--warn); }
.ctxtabs { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); border-bottom: 0; background: var(--surface); }
.ctxtabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; padding: 8px 4px; font-size: .74rem; font-weight: 600; color: var(--faint); cursor: pointer; border-radius: 12px; }
.ctxtabs button .ic { width: 20px; height: 20px; }
.ctxtabs button[aria-selected="true"] { color: var(--text); background: var(--surface2); }
.ctxtabs button:hover { color: var(--text); }
/* sales */
.buyrate { font-size: .92rem; font-weight: 700; padding: 0 14px 8px; display: flex; align-items: center; gap: 6px; }
.buyrate .ic { width: 14px; height: 14px; color: var(--faint); }
.pricetiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 10px; }
.pricetile { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pricetile b { font-size: 1.15rem; display: block; }
.pricetile span { font-size: .76rem; color: var(--muted); }
.ppvitem { padding: 6px 12px 10px; }
.ppvitem .ph { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ppvitem .ppill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; color: #fff; background: #e0568f; }
.ppvitem .ppill.paid { background: #17b28a; color: #04150f; }
.ppvitem .ppill .ic { width: 12px; height: 12px; }
.ppvitem .pdate { font-size: .78rem; color: var(--muted); }
.ppvitem .pcard { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ppvitem .pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ppvitem .pthumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface3); border: 0; padding: 0; cursor: pointer; }
.ppvitem .pthumb img, .ppvitem .pthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ppvitem .pthumb .lock { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 5px; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.ppvitem .pthumb .lock .ic { width: 12px; height: 12px; }
.ppvitem .ptext { font-size: .82rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.ppvitem .ptext.clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ppvitem .pacts { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ppvitem .more { border: 0; background: transparent; color: #f0894a; font-weight: 600; font-size: .82rem; cursor: pointer; padding: 0; }
.ppvitem .draft { border: 1px solid var(--border); background: var(--surface3); color: var(--text); border-radius: 8px; padding: 5px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; }
[data-sfw="on"] .ppvitem .pthumb img, [data-sfw="on"] .ppvitem .pthumb video { filter: blur(12px) saturate(.6); transform: scale(1.1); }
/* chart dialog */
.chartwrap { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.charthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; margin-bottom: 6px; }
.charthead .mm { font-size: .84rem; color: var(--muted); }
.charthead .mm b { color: #f0894a; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-dasharray: 4 4; }
.chart .axis { fill: var(--faint); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt-paid { fill: #17b28a; stroke: var(--surface2); stroke-width: 2; }
.chart .pt-locked { fill: var(--surface2); stroke: #ee6b5b; stroke-width: 2.5; }
.chart .lbl { font-size: 11px; font-weight: 700; fill: #fff; }
.chart .lblbg-paid { fill: #17b28a; } .chart .lblbg-locked { fill: #ee6b5b; }
.chart .thumb { clip-path: inset(0 round 4px); }
.legend { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.legend .paid { background: #17b28a; color: #04150f; } .legend .locked { background: #ee6b5b; color: #fff; }
.legend .ic { width: 12px; height: 12px; }
.charttable { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 8px; }
.charttable th, .charttable td { text-align: left; padding: 4px 6px; border-top: 1px solid var(--border); }
.charttable th { color: var(--muted); font-weight: 600; }
/* notes */
.sheet { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 120px; }
.sheet textarea { width: 100%; min-height: 200px; background: transparent; border: 0; color: var(--text); font: inherit; resize: vertical; }
.sheet textarea:focus { outline: none; }
.sheet .sep { border-top: 1px dashed var(--faint); margin: 10px 0; }
.sheet .entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sheet .entry:last-of-type { border-bottom: 0; }
.sheet .entry .stamp { color: var(--muted); font-size: .76rem; display: flex; gap: 6px; flex-wrap: wrap; }
.sheet .entry .stamp b { color: var(--accent-strong); font-weight: 600; }
.sheet .entry .etext { font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.sheet .entry.deleted .etext { color: var(--faint); text-decoration: line-through; }
.sheet .entry.deleted .stamp { color: var(--faint); }
.sheet .entry .eact { border: 0; background: transparent; color: var(--faint); cursor: pointer; border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; align-self: start; }
.sheet .entry .eact .ic { width: 14px; height: 14px; }
.sheet .entry .eact:hover { color: var(--bad); background: var(--bad-soft); }
.sheet .entry .eact.restore:hover { color: var(--ok); background: var(--ok-soft); }
.sheet .logtools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.sheet .logtools b { white-space: nowrap; }
.sheet .logtools .right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sheet .logtools select { background: var(--surface3); border: 1px solid var(--border); border-radius: 7px; padding: 3px 6px; color: var(--muted); font: inherit; font-size: .74rem; }
.sheet .addrow { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-width: 0; width: 100%; }
.sheet .addrow input { flex: 1 1 0; min-width: 0; width: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; color: var(--text); font: inherit; font-size: .86rem; }
.sheet .addrow input:focus { outline: none; border-color: var(--accent); }
.sheet .addrow .btn { flex: none; padding: 7px 12px; }
.sheet .logtools label { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ctxhead .idrow { display: flex; align-items: center; gap: 10px; }
.ctxhead .idname { font-weight: 700; font-size: .96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctxhead .idsub { color: var(--faint); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctxhead .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ctxtabs { display: flex; border-bottom: 1px solid var(--border); }
.ctxtabs button { flex: 1; border: 0; background: transparent; padding: 8px 4px; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.ctxtabs button[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.ctxbody { flex: 1; overflow-y: auto; min-height: 0; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.ccard { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; }
.ccard .chead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; font-weight: 700; }
.ccard .chead .caret { color: var(--faint); font-size: .7rem; transition: transform .12s; }
.ccard[data-open="false"] .chead .caret { transform: rotate(-90deg); }
.ccard[data-open="false"] .cbody { display: none; }
.ccard .cbody { padding: 2px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv .v.big { font-size: 1.05rem; }
.kv .v.muted { color: var(--faint); font-weight: 500; }
.kvnote { font-size: .72rem; color: var(--faint); }
.listchips { display: flex; gap: 5px; flex-wrap: wrap; }
.listchips .chip { cursor: default; font-size: .72rem; padding: 2px 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .74rem; color: var(--muted); }
.field textarea { min-height: 70px; resize: vertical; }
.field .acts { display: flex; gap: 6px; justify-content: flex-end; }
.prose { font-size: .82rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
#confirmText { font-size: .92rem; }
.prose.muted { color: var(--muted); }

/* dialogs */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 12, .72); z-index: 40; display: grid; place-items: center; padding: 20px; }
.dialog { width: min(720px, 100%); max-height: 88vh; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-modal); display: flex; flex-direction: column; overflow: hidden; }
.dialog.narrow { width: min(460px, 100%); }
.dialog.wide { width: min(960px, 100%); }
.dhead { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dhead h2 { margin: 0; font-size: 1rem; flex: 1; }
.dbody { padding: 14px 16px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.dfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gtile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface3); border: 2px solid transparent; cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--faint); font-size: .72rem; }
.gtile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gtile[aria-pressed="true"] { border-color: var(--accent); }
.gtile .dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: .64rem; border-radius: 4px; padding: 1px 5px; }
.gtile .kind { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: .62rem; border-radius: 4px; padding: 1px 5px; }
.results { display: flex; flex-direction: column; gap: 6px; }
.result { text-align: left; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: .84rem; }
.result:hover { border-color: var(--accent); }
.result .rmeta { font-size: .7rem; color: var(--faint); margin-top: 2px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; font-size: .84rem; box-shadow: var(--shadow-modal); z-index: 50; display: flex; gap: 10px; align-items: center; }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast .btn { padding: 3px 8px; font-size: .78rem; }
.srlive { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.mobile-only { display: none; }
@media (max-width: 1180px) { .workspace { grid-template-columns: 320px minmax(0, 1fr); } .insights { display: none; } .insights.forced { display: flex; position: fixed; right: 0; top: 0; bottom: 0; width: 300px; z-index: 35; box-shadow: var(--shadow-modal); } #ctxBtn, #ctxClose { display: inline-flex; } }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; gap: 10px; padding: 12px 14px 8px; border-right: none; border-bottom: 1px solid var(--border); }
  .brand { padding: 0; }
  .brand .words b, .brand .words span { display: inline; }
  .brand .words span { margin-left: 6px; }
  .sidenav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
  .navgroup, .navchildren { flex-direction: row; margin: 0; padding: 0; border: 0; }
  .navgroup:not(.open) .navchildren { display: flex; }
  .navitem.parent .navcaret { display: none; }
  .navitem { white-space: nowrap; padding: 7px 11px; font-size: .86rem; }
  .sidefoot { display: none; }
  .main { height: auto; min-height: calc(100vh - 60px); }
  .workspace { grid-template-columns: 1fr; }
  .workspace[data-mobile="inbox"] .conv, .workspace[data-mobile="inbox"] .insights { display: none; }
  .workspace[data-mobile="conv"] .inbox { display: none; }
  .mobile-only { display: inline-flex; }
}
