/* Money Desk owner UI — WhatsApp Business look ported from wabby/pixel (src/app/globals.css tokens,
   kit/chats/chat-item, kit/chat/chat-header, kit/message-variants/visual/{peer,self,system}, ui/avatar, ui/badge).
   Tailwind classes translated by hand; see DECISIONS.md [T9] for the file → rule inventory. */
:root {
  /* globals.css :root (oklch → hex) */
  --brand: #12857a;          /* oklch(0.547 0.107 176) */
  --brand-light: #e2f6f2;    /* oklch(0.954 0.045 180) */
  --brand-dark: #0f3b35;     /* oklch(0.307 0.054 176) */
  --brand-teal-dark: #178c7d;
  --brand-10: rgba(18, 133, 122, .10); /* bg-brand/10 */
  --active-ring: #7edc9a;
  --bg: #ffffff;
  --fg: #252525;             /* oklch(0.145 0 0) */
  --muted: #f4f5f7;          /* oklch(0.969 0.005 265) */
  --muted-fg: #737373;       /* oklch(0.556 0 0) */
  --border: #e5e5e5;         /* oklch(0.922 0 0) */
  --destructive: #d63b2f;    /* oklch(0.58 0.22 27) */
  --radius: 0.45rem;
  --r-3xl: calc(var(--radius) + 12px); /* rounded-3xl bubbles */
  --r-xl: calc(var(--radius) + 4px);
  --shadow-pill: 0 6px 10px rgba(14, 18, 27, .06), 0 2px 4px rgba(14, 18, 27, .03);
  --shadow-toast: 0 0 0 1px rgba(23,23,23,.08), 0 1px 1px -.5px rgba(23,23,23,.04), 0 3px 3px -1.5px rgba(23,23,23,.04), 0 6px 6px -3px rgba(23,23,23,.04), 0 10px 10px -5px rgba(23,23,23,.04), 0 20px 20px -10px rgba(23,23,23,.04);
  /* WhatsApp chat surface */
  --wall: #efeae2;
  --self: #e6f4f1;           /* bg-brand/10 over white, opaque on the wallpaper */
  --read: #53bdeb;           /* WhatsApp read-tick blue */
  --good: #1c7a3a; --good-bg: #e3f5e8;
  --warn: #8a5300; --warn-bg: #fff3d4;
  --bad: #b42318;  --bad-bg: #fdeceb;
  font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.topbar :focus-visible { outline-color: #fff; } /* brand ring is 2.75:1 on the dark bar */
.hidden { display: none !important; }
.muted { color: var(--muted-fg); }
.small { font-size: 12px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.empty { color: var(--muted-fg); padding: 32px 20px; text-align: center; font-size: 13px; line-height: 1.5; }

/* ── top bar ── */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--brand-dark); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; } /* a crowded bar clips the name/badge instead of drawing them under the clock */
.brand-txt { min-width: 0; }
.logo { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-light); color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; box-shadow: 0 0 0 2px var(--active-ring); }
.biz { font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font-variant-numeric: tabular-nums; min-width: 150px; }
.clock-row { display: flex; align-items: baseline; gap: 8px; }
#clock { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.clock-end { font-size: 12px; opacity: .7; }
.bar { height: 4px; background: rgba(255,255,255,.18); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--active-ring); border-radius: 2px; transition: width .4s linear; }
.actions { display: flex; align-items: center; gap: 8px; }
/* wabby chat-header segmented control */
.seg { display: flex; gap: 2px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 3px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; color: #d8ece8; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--brand); color: #fff; }
/* wabby .btn-brand */
.btn-brand { background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0)), var(--brand-teal-dark); box-shadow: 0 1px 2px rgba(14,18,27,.24), 0 0 0 1px var(--brand); color: #fff; font-weight: 600; height: 36px; padding: 0 16px; border-radius: 10px; white-space: nowrap; }
.btn-brand:hover { filter: brightness(1.08); }
.btn-ghost { height: 36px; padding: 0 12px; border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.live { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--active-ring); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--active-ring); animation: pulse 1.6s ease-in-out infinite; }
.live.paused { color: var(--muted-fg); }
.live.paused i { background: currentColor; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff5a5f; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }

/* ── layout ── */
.app { flex: 1; display: grid; grid-template-columns: 360px minmax(0, 1fr) 380px; min-height: 0; }
body.no-panel .app { grid-template-columns: 360px minmax(0, 1fr); }
.app > * { min-width: 0; }
body.no-panel .panel { display: none; }
.list, .panel { background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.list { border-right: 1px solid var(--border); }
.panel { border-left: 1px solid var(--border); }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; border-bottom: 1px solid var(--border); }
.chip-btn { font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--brand-light); padding: 7px 12px; border-radius: 999px; }
.chats { overflow-y: auto; flex: 1; }

/* wabby kit/chats/chat-item: p-4 gap-3, name font-medium truncate, time text-xs (brand + semibold when unread), +N badge, rounded-md tags */
.row-chat { display: flex; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; transition: background .15s; position: relative; }
.row-chat::after { content: ""; position: absolute; left: 72px; right: 0; bottom: 0; border-bottom: 1px solid #f0f0f0; }
.row-chat:hover { background: rgba(244,245,247,.7); }
.row-chat.sel { background: var(--muted); box-shadow: inset 3px 0 0 var(--brand); }
.avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-top, .rc-mid { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rc-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-time { font-size: 12px; color: var(--muted-fg); font-weight: 500; font-variant-numeric: tabular-nums; flex: none; }
.rc-time.hot { color: var(--brand); font-weight: 700; }
.rc-prev { color: var(--muted-fg); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; align-items: center; gap: 3px; }
.rc-prev span { overflow: hidden; text-overflow: ellipsis; }
.rc-bot { display: flex; gap: 6px; margin-top: 2px; }
.unread { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; line-height: 20px; text-align: center; flex: none; }
.status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.status:empty { display: none; }
.status.muted { background: var(--muted); color: #5c5c5c; } /* ≥4.5:1 on --muted at 11px */
.status.good { background: var(--good-bg); color: var(--good); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
/* WhatsApp double tick (lucide CheckCheck, the icon wabby's self bubble uses) */
.ticks { width: 16px; height: 16px; flex: none; fill: none; stroke: #8696a0; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ticks.read { stroke: var(--read); }

/* ── thread ── */
.thread { display: flex; flex-direction: column; min-height: 0; background: var(--wall); }
/* wabby kit/chat/chat-header: border-b px-3.5 py-3 gap-2.5, name font-semibold tracking-tight */
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--border); min-height: 62px; }
.who { flex: 1; min-width: 0; }
.who .name { font-weight: 600; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsub { font-size: 12.5px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { display: none; width: 36px; height: 36px; border-radius: 10px; place-items: center; color: var(--fg); }
.back .ic { width: 22px; height: 22px; }
#tAvatar:empty { background: var(--brand-light); }
/* chat wallpaper: WhatsApp beige + faint doodle pattern (inline SVG, offline) */
.messages { flex: 1; overflow-y: auto; padding: 14px max(16px, 6%) 18px; display: flex; flex-direction: column; gap: 4px;
  background-color: var(--wall);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none' stroke='%23000' stroke-opacity='.045' stroke-width='1.4' stroke-linecap='round'%3E%3Ccircle cx='18' cy='20' r='6'/%3E%3Cpath d='M70 14l8 8m0-8l-8 8'/%3E%3Cpath d='M100 50c4-6 12-6 14 0'/%3E%3Crect x='40' y='60' width='14' height='10' rx='3'/%3E%3Cpath d='M12 92l6-8 6 8z'/%3E%3Ccircle cx='86' cy='96' r='3'/%3E%3Cpath d='M58 104h12'/%3E%3C/svg%3E"); }
.placeholder { margin: auto; max-width: 460px; text-align: center; background: rgba(255,255,255,.92); border-radius: var(--r-3xl); padding: 26px; color: var(--muted-fg); line-height: 1.55; box-shadow: var(--shadow-pill); }
.ph-title { font-size: 18px; font-weight: 700; color: var(--fg); margin-bottom: 8px; letter-spacing: -.01em; }
.day-chip { align-self: center; background: #fff; color: #54656f; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); margin: 4px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.biz-note { align-self: center; max-width: min(440px, 92%); background: #fff5c4; color: #54656f; font-size: 12px; line-height: 1.45; text-align: center; padding: 6px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); margin-bottom: 8px; }
.biz-note .ic { width: 12px; height: 12px; vertical-align: -1px; }

/* bubbles — wabby message-variants/visual: rounded-3xl, peer rounded-bl-none + border, self rounded-br-none bg-brand/10 border-brand/10, time text-xs font-light muted self-end */
.msg { display: flex; margin: 2px 0; }
.msg.out { justify-content: flex-end; }
.bubble { position: relative; max-width: min(78%, 560px); padding: 9px 13px 4px; border-radius: var(--r-3xl); background: #fff; border: 1px solid rgba(0,0,0,.05); box-shadow: 0 1px .5px rgba(11,20,26,.10); overflow-wrap: anywhere; line-height: 1.42; font-size: 14.2px; }
.msg.in .bubble { border-bottom-left-radius: 0; }
.msg.out .bubble { background: var(--self); border-color: var(--brand-10); border-bottom-right-radius: 0; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; }
.mt { font-size: 11px; font-weight: 300; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.by { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--brand); margin-bottom: 2px; }
.ai { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--brand); border-radius: 4px; padding: 1px 4px; line-height: 1.3; }
/* owner-only: a reply the Fact checker stopped before it was sent */
.msg.out .bubble.blocked { background: repeating-linear-gradient(-45deg, #fbfbfb, #fbfbfb 8px, #f4f4f4 8px, #f4f4f4 16px); border: 1px dashed #d9a5a0; opacity: .95; }
.bubble.blocked .by { color: var(--bad); }
.bubble.blocked .ai { background: var(--bad); }
.draft { text-decoration: line-through; text-decoration-color: rgba(180,35,24,.55); color: #8a8f93; }
.bwhy { margin-top: 6px; font-size: 12.5px; color: var(--bad); background: var(--bad-bg); border-radius: 8px; padding: 6px 8px; }
.only { font-size: 10.5px; color: var(--muted-fg); font-style: italic; margin-left: 4px; }
.bubble.shot { padding: 5px 5px 4px; }
.shot-card { width: 230px; max-width: 100%; border-radius: 16px; background: linear-gradient(160deg, #f4f8ff, #e6edfb); border: 1px solid #d7e0f3; padding: 14px 12px; text-align: center; }
.shot-bank { font-size: 12px; color: #456; font-weight: 600; }
.shot-amt { font-size: 21px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.01em; }
.shot-ref { font-size: 12px; color: #456; font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; }
.shot-ok { margin-top: 8px; font-size: 12px; color: var(--good); font-weight: 600; }
.shot-read { font-size: 11.5px; color: var(--muted-fg); padding: 6px 6px 0; max-width: 230px; }

/* WhatsApp Business card messages (order / payment request, payment received, order shipped).
   Built on the self bubble; header strip + rows + full-width buttons like WhatsApp interactive/order messages. */
.bubble.card-msg { padding: 7px 7px 4px; width: min(330px, 86%); }
.card-msg > .by { padding: 0 6px; }
.wa-text { padding: 2px 6px 7px; }
.wa-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.wa-head { font-size: 12.5px; font-weight: 700; padding: 7px 11px; letter-spacing: .01em; }
.wa-head.brand { background: var(--brand-light); color: var(--brand-dark); }
.wa-head.good { background: var(--good-bg); color: var(--good); }
.wa-head.warn { background: var(--warn-bg); color: var(--warn); }
.wa-body { padding: 8px 11px; display: flex; flex-direction: column; gap: 4px; }
.wa-body + .wa-body { border-top: 1px solid #f0f0f0; }
.wa-body .wa-text { padding: 0; }
.wa-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted-fg); }
.wa-row > span { flex: none; white-space: nowrap; } /* "Item" never wraps to "Ite / m" */
.wa-row b { color: var(--fg); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: break-word; } /* "4.999,00 RSD" never splits mid-word */
.wa-row.total { border-top: 1px dashed var(--border); padding-top: 5px; margin-top: 2px; color: var(--fg); }
.wa-row.total b { font-size: 15px; font-weight: 700; }
.wa-row.good b { color: var(--good); }
.wa-row.warn b { color: var(--warn); }
.wa-note { font-size: 11px; color: var(--muted-fg); text-align: right; }
.wa-btns { display: flex; flex-direction: column; border-top: 1px solid #f0f0f0; }
.wa-btn { display: block; width: 100%; text-align: center; padding: 10px; font-size: 14px; font-weight: 600; color: var(--brand); list-style: none; cursor: default; }
button.wa-btn, summary.wa-btn { cursor: pointer; }
a.wa-btn { text-decoration: none; }
.nw { white-space: nowrap; }
.wa-btn::-webkit-details-marker { display: none; }
.wa-btn.primary { background: var(--brand-teal-dark); color: #fff; }
button.wa-btn.primary:hover { filter: brightness(1.08); }
.wa-btn.done { color: var(--good); background: var(--good-bg); }
.wa-btn.held { color: var(--warn); background: var(--warn-bg); font-size: 13px; }
.wa-qr { border-top: 1px solid #f0f0f0; }
.qr-box { padding: 10px 11px 11px; display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid #f0f0f0; }
.qr-svg { width: 132px; height: 132px; background: #fff; padding: 4px; border: 1px solid var(--border); border-radius: 8px; shape-rendering: crispEdges; }
.qr-txt { font-size: 12px; color: var(--muted-fg); text-align: center; line-height: 1.4; }
.qr-txt b { color: var(--fg); }
.qr-box .wa-btn.primary { border-radius: 10px; padding: 8px; }
.wa-link { font-size: 10.5px; color: var(--muted-fg); text-align: center; padding: 6px 8px 7px; border-top: 1px solid #f0f0f0; overflow-wrap: anywhere; }
.wa-steps { display: flex; align-items: center; gap: 4px; padding: 8px 11px 9px; border-top: 1px solid #f0f0f0; font-size: 11.5px; color: var(--muted-fg); }
.wa-steps .st.on { color: var(--good); font-weight: 600; }
.wa-steps i { flex: 1; height: 2px; background: var(--good-bg); border-radius: 1px; }
.card-msg .det { padding: 0 6px; }

/* centered notices — wabby visual/system: rounded-xl bg-brand/10 text-sm text-center max-w-2/3 */
.note { align-self: center; max-width: min(75%, 520px); text-align: center; font-size: 12.8px; line-height: 1.45; padding: 6px 12px; border-radius: 12px; background: #e3f1ee; color: #1f4a44; box-shadow: 0 1px .5px rgba(11,20,26,.10); margin: 5px 0; text-wrap: balance; }
.note .nt { margin-left: 8px; opacity: .55; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note.money { background: #d8f0e9; color: #0d4a41; font-weight: 600; }
.note.good { background: var(--good-bg); color: var(--good); font-weight: 600; }
.note.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.note.bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.note-btn { display: block; margin: 6px auto 2px; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 999px; padding: 4px 12px; }
/* details expander (technical sources: ids, rules) */
.det { font-size: 11px; font-weight: 400; text-align: left; margin-top: 3px; color: var(--muted-fg); }
.det summary { cursor: pointer; list-style: none; display: inline-block; opacity: .75; text-decoration: underline dotted; }
.det summary::-webkit-details-marker { display: none; }
.det summary::after { content: " ▾"; }
.det[open] summary::after { content: " ▴"; }
.det > div { margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.7); font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: 10.5px; line-height: 1.5; overflow-wrap: anywhere; color: #444; }
.note .det { display: inline; margin-left: 6px; }
.note .det > div { display: block; text-align: left; font-weight: 400; }

/* owner composer bar (read-only: the assistant replies) — wabby chat-input layout */
.owner-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #f0f2f5; border-top: 1px solid var(--border); }
.ob-input { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 22px; padding: 10px 14px; color: var(--muted-fg); font-size: 13.5px; border: 1px solid var(--border); }
.ob-input span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-input b { color: var(--brand); }
.ob-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--fg); }
.ob-send:disabled { opacity: .5; }
.ob-input .ic { color: var(--brand); }
.ob-send { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }

/* guest composer */
.composer { background: #f0f2f5; border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; max-height: 40vh; overflow-y: auto; flex: none; }
.composer > * { flex: none; } /* the composer scrolls; its rows never squash */
.c-top { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.c-top .link-btn { flex: none; }
.composer.picker-closed .tiles-wrap, .composer.picker-closed .pick-acts { display: none; }
.c-label { font-size: 11.5px; font-weight: 600; color: var(--muted-fg); }
.composer .row { display: flex; gap: 6px; flex-wrap: wrap; }
.item, .qr { border: 1px solid var(--border); background: #fff; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.item span { color: var(--muted-fg); margin-left: 4px; font-size: 12px; font-weight: 400; }
.item:hover:not(:disabled), .qr:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.act { padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; background: #fff; border: 1px solid var(--border); }
.act.primary { background: var(--brand-teal-dark); color: #fff; border-color: transparent; }
.act.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.act.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.act.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }

/* ── right panel ── */
.tabs { display: flex; gap: 2px; margin: 10px 12px; border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.tabs button { flex: 1; height: 36px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { background: var(--brand); color: #fff; }
.tab { flex: 1; overflow-y: auto; min-height: 0; }
#tab-approvals { padding: 2px 12px 12px; }
.empty-card { text-align: center; padding: 28px 18px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted-fg); line-height: 1.5; font-size: 13px; }
.empty-card b { color: var(--fg); font-size: 14px; }
.empty-card p { margin: 6px 0 0; }
.ec-icon { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-pill); border-top: 3px solid #f0a500; }
.card-top { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.countdown { margin-left: auto; font-size: 11px; text-align: right; color: var(--warn); background: var(--warn-bg); padding: 3px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.amt { font-size: 26px; font-weight: 700; margin-top: 10px; letter-spacing: -.02em; }
.from { font-size: 13px; color: var(--muted-fg); margin: 2px 0 10px; }
.from b { color: var(--fg); }
.approve { display: block; width: 100%; text-align: left; background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0)), var(--brand-teal-dark); color: #fff; padding: 9px 12px; border-radius: 10px; font-weight: 600; margin-top: 8px; box-shadow: 0 1px 2px rgba(14,18,27,.24); }
.approve .sub { display: block; font-weight: 400; font-size: 12px; opacity: .85; }
.why { font-size: 12px; color: var(--muted-fg); margin: 4px 2px 0; }
.reject { width: 100%; margin-top: 10px; padding: 8px; border-radius: 10px; border: 1px solid #f3c2bd; color: var(--bad); font-weight: 600; background: #fff; }
.reject:hover:not(:disabled) { background: var(--bad-bg); }
.decisions .h { font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-fg); margin: 16px 2px 8px; }
.dec { font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.dec .how { font-size: 11.5px; margin-top: 3px; font-weight: 600; }
.dec.click .how { color: var(--brand); }
.lanes-note { margin: 0 14px 6px; font-size: 12px; color: var(--muted-fg); }
.lanes { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: 11.5px; padding: 0 12px 12px; }
.lane { display: grid; grid-template-columns: 40px 1fr; gap: 0 6px; padding: 5px 0; border-bottom: 1px dashed #eee; }
.lane .lx { grid-column: 2; color: #333; }
.lt { color: var(--muted-fg); }
.la { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx { overflow-wrap: anywhere; }

/* ── summary modal ── */
.modal { position: fixed; inset: 0; background: rgba(10,20,18,.45); display: grid; place-items: center; padding: 16px; z-index: 10; }
.sheet { background: #fff; border-radius: 20px; width: min(680px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: var(--shadow-toast), 0 30px 60px rgba(0,0,0,.2); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.btn-x { width: 34px; height: 34px; border-radius: 50%; background: var(--muted); }
.recon { margin: 14px 0; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.recon.good, .check.good { background: var(--good-bg); color: var(--good); }
.recon.bad { background: var(--bad-bg); color: var(--bad); }
.check { margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.check.warn { background: var(--warn-bg); color: var(--warn); }
.lines { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.line + .line { border-top: 1px solid var(--border); }
.line summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.line summary:hover { background: #fafafa; }
.line summary::-webkit-details-marker { display: none; }
.line summary::after { content: "▸"; color: var(--muted-fg); font-size: 12px; }
.line[open] summary::after { content: "▾"; }
.li { width: 30px; height: 30px; border-radius: 50%; background: var(--muted); display: grid; place-items: center; flex: none; font-size: 15px; }
.lbl { flex: 1; min-width: 150px; font-weight: 600; }
.lbl small { display: block; font-weight: 400; color: var(--muted-fg); font-size: 12px; }
.val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.ids { padding: 0 14px 12px 56px; display: flex; flex-wrap: wrap; gap: 4px; }
.src { width: 100%; font-size: 11px; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.ids code { background: var(--muted); border-radius: 6px; padding: 2px 6px; font-size: 11.5px; overflow-wrap: anywhere; }
.gap { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
h3 { font-size: 15px; margin: 20px 0 4px; }
.disclaimer, .foot { text-align: center; font-size: 12px; color: var(--muted-fg); padding: 10px; }
.foot { padding: 4px; border-top: 1px solid var(--border); background: var(--bg); }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: var(--brand-teal-dark); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-toast), 0 10px 30px rgba(0,0,0,.2); z-index: 20; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }
.tabs .panel-x, .backdrop { display: none; }

/* ── narrower desktops: drop the panel to an overlay ── */
@media (max-width: 1180px) {
  .app { grid-template-columns: 320px minmax(0, 1fr) 340px; }
  body.no-panel .app { grid-template-columns: 320px minmax(0, 1fr); }
  .clock { min-width: 120px; }
}
/* ── mobile: one pane at a time ── */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand { flex: 1 1 60%; }
  .clock { order: 2; min-width: 0; text-align: right; }
  .actions { order: 3; width: 100%; flex-wrap: wrap; }
  .live { padding: 0 4px; }
  .actions .seg { margin-right: auto; }
  .btn-brand, .btn-ghost, .live { height: 32px; padding: 0 10px; font-size: 13px; }
  .seg button { height: 26px; padding: 0 9px; }
  #clock { font-size: 17px; }
  .app, body.no-panel .app { grid-template-columns: minmax(0, 1fr); }
  .list, .thread { min-width: 0; }
  .list { border-right: 0; }
  .thread { display: none; }
  body.in-thread .list { display: none; }
  body.in-thread .thread { display: flex; }
  .back { display: grid; }
  .panel { position: fixed; inset: auto 0 0 0; height: 72vh; z-index: 5; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.2); border-left: 0; }
  .panel .tabs { align-items: center; }
  .tabs .panel-x { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; color: var(--fg); background: var(--muted); }
  body:not(.no-panel) .backdrop { display: block; position: fixed; inset: 0; z-index: 4; background: rgba(10,20,18,.35); }
  .messages { padding: 12px 10px; }
  .bubble { max-width: 86%; }
  .note { max-width: 92%; }
  .ob-input span { white-space: normal; font-size: 12.5px; }
  .foot { display: none; }
}
@media (max-width: 420px) {
  .biz { font-size: 14px; }
  .sub { display: none; }
  .clock-end { display: none; }
  .actions { gap: 6px; }
  .seg button { padding: 0 7px; font-size: 12px; }
  .live { font-size: 12px; gap: 4px; padding: 0 2px; text-transform: capitalize; }
  .lv-shop { display: none; } /* "● Open": short label instead of a lone dot */
  .line summary { flex-wrap: wrap; row-gap: 4px; }
  .lbl { min-width: 0; flex-basis: calc(100% - 70px); }
  .val { order: 1; flex-basis: 100%; text-align: left; padding-left: 42px; }
  .btn-brand, .btn-ghost { padding: 0 9px; }
}

html { background: #fff; color-scheme: light; } /* light theme only */
