/* News Trade Desk — community chat client. Uses the desk's palette tokens when present (with fallbacks). */
.ntdc, .ntdc-dlg, .ntdc-menu, .ntdc-light {
  --c-bg: var(--bg, #0e1013);
  --c-surface: var(--surface, #161a20);
  --c-surface-2: var(--surface-2, #1c2129);
  --c-surface-3: var(--surface-3, #232935);
  --c-line: var(--line, #262c36);
  --c-line-strong: var(--line-strong, #363e4b);
  --c-ink: var(--ink, #e9e7df);
  --c-ink-2: var(--ink-2, #a7a69b);
  --c-ink-3: var(--ink-3, #737883);
  --c-accent: var(--accent, #e3a72f);
  --c-accent-soft: var(--accent-soft, rgba(227,167,47,.14));
  --c-accent-ink: var(--accent-ink, #1b1400);
  --c-buy: var(--buy, #27b25f);
  --c-buy-soft: var(--buy-soft, rgba(39,178,95,.16));
  --c-sell: var(--sell, #e5504f);
  --c-sell-soft: var(--sell-soft, rgba(229,80,79,.16));
  --c-blue: var(--blue, #3d8bff);
  --c-blue-soft: var(--blue-soft, rgba(61,139,255,.16));
  --c-med: var(--med, #f0b429);
  --c-focus: var(--focus, #7fb4ff);
  --c-sans: var(--sans, 'IBM Plex Sans', system-ui, 'Segoe UI', sans-serif);
  --c-cond: var(--cond, 'IBM Plex Sans Condensed', 'IBM Plex Sans', system-ui, sans-serif);
  --c-mono: var(--mono, 'IBM Plex Mono', ui-monospace, Consolas, monospace);
  --c-radius: var(--radius, 6px);
}
.ntdc {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0; position: relative; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 8px; overflow: hidden; color: var(--c-ink); font: 13.5px/1.45 var(--c-sans); text-align: left;
}
:is(.ntdc, .ntdc-dlg, .ntdc-menu) *, :is(.ntdc, .ntdc-dlg, .ntdc-menu) *::before, :is(.ntdc, .ntdc-dlg, .ntdc-menu) *::after { box-sizing: border-box; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) button, :is(.ntdc, .ntdc-dlg, .ntdc-menu) input, :is(.ntdc, .ntdc-dlg, .ntdc-menu) select, :is(.ntdc, .ntdc-dlg, .ntdc-menu) textarea { font: inherit; color: inherit; }
.ntdc[data-layout="dock"] { grid-template-columns: minmax(0, 1fr); border-radius: 0; border-width: 0 0 0 1px; }
.ntdc[data-layout="dock"] .ntdc-side { display: none; }
.ntdc[data-layout="dock"] .ntdc-head .rname, .ntdc[data-layout="dock"] .ntdc-head .topic { display: none; }
.ntdc[data-layout="dock"] .ntdc-roomsel { max-width: 150px; flex: 1; }
.ntdc[data-layout="full"] .ntdc-roomsel { display: none; }
.ntdc[data-layout="full"] .ntdc-dockonly { display: none; }
.ntdc-hidden { display: none !important; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn { background: var(--c-surface-3); border: 1px solid var(--c-line-strong); color: var(--c-ink); padding: 5px 10px; border-radius: var(--c-radius); cursor: pointer; font-size: 12.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn:hover { border-color: var(--c-ink-3); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.ghost { background: transparent; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.icon { padding: 4px 7px; font-size: 14px; line-height: 1; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.blue { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.amber { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-ink); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.danger { background: var(--c-sell); border-color: var(--c-sell); color: #fff; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.buy { background: var(--c-buy); border-color: var(--c-buy); color: #fff; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.sell { background: var(--c-sell); border-color: var(--c-sell); color: #fff; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn.on { background: var(--c-accent-soft); border-color: var(--c-accent); color: var(--c-accent); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn:disabled { opacity: .5; cursor: default; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-in, :is(.ntdc, .ntdc-dlg, .ntdc-menu) select, :is(.ntdc, .ntdc-dlg, .ntdc-menu) textarea, .ntdc-dlg input:not([type=checkbox]):not([type=color]):not([type=file]) { background: var(--c-surface-2); border: 1px solid var(--c-line-strong); color: var(--c-ink); padding: 5px 8px; border-radius: var(--c-radius); font-size: 13px; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-in:focus-visible, :is(.ntdc, .ntdc-dlg, .ntdc-menu) textarea:focus-visible, :is(.ntdc, .ntdc-dlg, .ntdc-menu) select:focus-visible, :is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-btn:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 1px; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .muted { color: var(--c-ink-3); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .num { font-family: var(--c-mono); font-variant-numeric: tabular-nums; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .pos { color: var(--c-buy); } :is(.ntdc, .ntdc-dlg, .ntdc-menu) .neg { color: var(--c-sell); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-tag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 0 5px; border-radius: 3px; background: var(--c-accent-soft); color: var(--c-accent); line-height: 16px; vertical-align: middle; font-weight: 600; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-tag.mod { background: var(--c-blue-soft); color: var(--c-blue); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-tag.bot { background: var(--c-surface-3); color: var(--c-ink-2); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-tag.live { background: var(--c-sell); color: #fff; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-tag.paper { background: var(--c-blue-soft); color: var(--c-blue); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--c-cond); font-weight: 700; letter-spacing: .04em; font-size: 13px; padding: 2px 8px; border-radius: 4px; border: 1px solid; white-space: nowrap; }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-chip.buy { color: var(--c-buy); background: var(--c-buy-soft); border-color: var(--c-buy); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-chip.sell { color: var(--c-sell); background: var(--c-sell-soft); border-color: var(--c-sell); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-chip.hold { color: var(--c-ink-2); background: var(--c-surface-3); border-color: var(--c-line-strong); }
:is(.ntdc, .ntdc-dlg, .ntdc-menu) .ntdc-chip small { font-family: var(--c-sans); font-weight: 500; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }

/* ---- sidebar ---- */
.ntdc-side { display: flex; flex-direction: column; min-height: 0; background: var(--c-surface-2); border-right: 1px solid var(--c-line); }
/* The main pane and the Trade Shop pane share one grid cell — only one of them is ever visible. */
.ntdc-main, .ntdc-pane { grid-column: 2; grid-row: 1; }
.ntdc-pane { min-width: 0; min-height: 0; overflow: hidden; }
.ntdc-nav { flex: none; padding-bottom: 4px; border-bottom: 1px solid var(--c-line); }
.ntdc[data-layout="dock"] .ntdc-pane { grid-column: 1; }
.ntdc-hub { padding: 12px 14px 10px; border-bottom: 1px solid var(--c-line); font-family: var(--c-cond); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.ntdc-hub .ntdc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-med); flex: none; }
.ntdc-hub .ntdc-dot.on { background: var(--c-buy); box-shadow: 0 0 0 3px var(--c-buy-soft); }
.ntdc-rooms { flex: 1; overflow: auto; padding: 8px 6px; display: flex; flex-direction: column; gap: 1px; }
.ntdc-rooms .ntdc-sec { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-ink-3); padding: 8px 8px 3px; font-weight: 600; }
.ntdc-room { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 5px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--c-ink-2); width: 100%; }
.ntdc-room:hover { background: var(--c-surface-3); color: var(--c-ink); }
.ntdc-room.on { background: var(--c-surface-3); color: var(--c-ink); font-weight: 600; }
.ntdc-room.unread { color: var(--c-ink); font-weight: 600; }
.ntdc-room .hash { color: var(--c-ink-3); font-family: var(--c-mono); }
.ntdc-room .rn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntdc-badge { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-sell); color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; font-weight: 700; font-family: var(--c-sans); }
.ntdc-badge.mention { box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 3px var(--c-sell); }   /* a mention: the same red with a ring, so it still stands out */
.ntdc-me { display: flex; align-items: center; gap: 8px; padding: 10px 10px; border-top: 1px solid var(--c-line); }
.ntdc-me .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.ntdc-me .nm small { display: block; font-weight: 400; color: var(--c-ink-3); font-size: 11px; }
.ntdc-av { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--c-cond); font-weight: 700; font-size: 12px; color: #fff; flex: none; text-transform: uppercase; }
.ntdc-av.sm { width: 20px; height: 20px; font-size: 9.5px; }
.ntdc-av.lg { width: 36px; height: 36px; font-size: 14px; }

/* ---- main ---- */
.ntdc-main { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; min-height: 0; min-width: 0; position: relative; }
/* the news bot's call: BUY / SELL across the top of every room */
.ntdc-call { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--c-line); border-left: 4px solid var(--c-ink-3); background: var(--c-surface-2); font-size: 12.5px; }
.ntdc-call.buy { border-left-color: var(--c-buy); background: var(--c-buy-soft); } .ntdc-call.sell { border-left-color: var(--c-sell); background: var(--c-sell-soft); }
.ntdc-call.headsup.flat, .ntdc-call.brief.flat { border-left-color: var(--c-med); background: var(--c-accent-soft); }
.ntdc-call .ct { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntdc-call .ct b { font-family: var(--c-cond); }
.ntdc-call .ntdc-btn.small { padding: 2px 8px; font-size: 11.5px; }
@media (max-width: 720px) { .ntdc-call { padding: 5px 8px; font-size: 12px; } .ntdc-call .ct { white-space: normal; } }
/* homework: the brief card and the block inside heads-ups */
.ntdc-card.brief { border-left-color: var(--c-blue); max-width: 680px; }
.ntdc-card .bt { width: 100%; border-collapse: collapse; font-size: 12px; }
.ntdc-card .bt th { text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); padding: 2px 6px; border-bottom: 1px solid var(--c-line); }
.ntdc-card .bt td { padding: 4px 6px; vertical-align: top; }
.ntdc-card .bt tr.done td { opacity: .6; }
.ntdc-card .bt tr.det td { padding: 0 6px 6px; border-bottom: 1px solid var(--c-line); }
.ntdc-card .bt details summary, .ntdc-card details.lows summary, .ntdc-card details.wk summary { cursor: pointer; color: var(--c-ink-3); font-size: 11.5px; }
.ntdc-card details.wk .wd { font-size: 12px; margin: 4px 0; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ntdc-card .hw { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--c-ink-2); }
.ntdc-card .hw-l { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; }
.ntdc-card .hw-l > span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); padding-top: 2px; }
.ntdc-card .hw-l i { color: var(--c-ink-3); }
.ntdc-card .hw-l.buy { color: var(--c-buy); } .ntdc-card .hw-l.sell { color: var(--c-sell); } .ntdc-card .hw-l.warn { color: var(--c-med); }
.ntdc-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--c-line); min-height: 44px; }
.ntdc-head .rname { font-family: var(--c-cond); font-weight: 700; font-size: 15px; white-space: nowrap; }
.ntdc-head .rname .hash { color: var(--c-ink-3); font-family: var(--c-mono); font-weight: 500; }
.ntdc-head .topic { color: var(--c-ink-3); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntdc-head .acts { display: flex; gap: 4px; margin-left: auto; flex: none; }
.ntdc-roomsel { max-width: 180px; font-family: var(--c-cond); font-weight: 700; padding: 4px 6px; }
.ntdc-searchbar { display: flex; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--c-line); background: var(--c-surface-2); }
.ntdc-searchbar .ntdc-in { flex: 1; }
.ntdc-list { overflow-y: auto; overflow-x: hidden; padding: 8px 0 4px; scroll-behavior: auto; overscroll-behavior: contain; }
.ntdc-list .ntdc-day { display: flex; align-items: center; gap: 10px; color: var(--c-ink-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 16px 4px; }
.ntdc-list .ntdc-day::before, .ntdc-list .ntdc-day::after { content: ''; flex: 1; height: 1px; background: var(--c-line); }
.ntdc-list .ntdc-newline { display: flex; align-items: center; gap: 8px; color: var(--c-sell); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 16px; font-weight: 700; }
.ntdc-list .ntdc-newline::before { content: ''; flex: 1; height: 1px; background: var(--c-sell); }
.ntdc-loading { text-align: center; color: var(--c-ink-3); font-size: 12px; padding: 8px; }
.ntdc-empty { padding: 40px 24px; color: var(--c-ink-3); text-align: center; max-width: 48ch; margin: 0 auto; }
.ntdc-empty b { display: block; color: var(--c-ink); font-family: var(--c-cond); font-size: 18px; margin-bottom: 4px; }

/* messages */
.ntdc-msg { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 10px; padding: 2px 16px 2px 12px; }
.ntdc-msg.head { margin-top: 10px; padding-top: 3px; }
.ntdc-msg:hover { background: var(--c-surface-2); }
.ntdc-msg.mentioned { background: var(--c-accent-soft); box-shadow: inset 3px 0 0 var(--c-accent); }
.ntdc-msg.hl { animation: ntdc-hl 2s ease-out; }
@keyframes ntdc-hl { from { background: var(--c-blue-soft); } to { background: transparent; } }
.ntdc-msg .gutter { display: flex; justify-content: center; align-items: flex-start; padding-top: 2px; }
.ntdc-msg:not(.head) .gutter { padding-top: 0; }
.ntdc-msg:not(.head) .gutter .t { display: none; font-size: 10px; color: var(--c-ink-3); font-family: var(--c-mono); padding-top: 3px; }
.ntdc-msg:not(.head):hover .gutter .t { display: block; }
.ntdc-msg .meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.3; }
.ntdc-msg .meta .nm { font-weight: 700; font-family: var(--c-cond); font-size: 14px; cursor: pointer; }
.ntdc-msg .meta .t { font-size: 11px; color: var(--c-ink-3); font-family: var(--c-mono); }
.ntdc-msg .body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; color: var(--c-ink); }
.ntdc-msg .body a { color: var(--c-blue); }
.ntdc-msg .body code { font-family: var(--c-mono); font-size: 12px; background: var(--c-surface-3); padding: 1px 4px; border-radius: 3px; }
.ntdc-msg .body pre { font-family: var(--c-mono); font-size: 12px; background: var(--c-surface-3); padding: 8px 10px; border-radius: 5px; margin: 4px 0; overflow: auto; white-space: pre; }
.ntdc-msg .body .mention { background: var(--c-blue-soft); color: var(--c-blue); border-radius: 3px; padding: 0 3px; font-weight: 600; }
.ntdc-msg .body .mention.me { background: var(--c-accent-soft); color: var(--c-accent); }
.ntdc-msg .body .roomref { color: var(--c-accent); cursor: pointer; }
.ntdc-msg .body .edited { font-size: 10.5px; color: var(--c-ink-3); margin-left: 4px; }
.ntdc-msg .body.deleted { color: var(--c-ink-3); font-style: italic; }
.ntdc-msg .pinmark { font-size: 10.5px; color: var(--c-accent); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.ntdc-msg .replyq { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-ink-3); margin-bottom: 2px; cursor: pointer; max-width: 100%; }
.ntdc-msg .replyq::before { content: ''; width: 18px; height: 9px; border: 2px solid var(--c-line-strong); border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; margin-left: -4px; flex: none; }
.ntdc-msg .replyq b { color: var(--c-ink-2); font-weight: 600; }
.ntdc-msg .replyq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntdc-msg .acts { position: absolute; top: -12px; right: 14px; display: none; gap: 0; background: var(--c-surface-3); border: 1px solid var(--c-line-strong); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 2; }
.ntdc-msg:hover .acts, .ntdc-msg.menu .acts { display: flex; }
.ntdc-msg .acts button { background: none; border: 0; padding: 4px 7px; cursor: pointer; font-size: 13px; color: var(--c-ink-2); line-height: 1; }
.ntdc-msg .acts button:hover { background: var(--c-surface-2); color: var(--c-ink); }
.ntdc-msg .acts button.danger:hover { color: var(--c-sell); }
.ntdc-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ntdc-react { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--c-line-strong); background: var(--c-surface-2); border-radius: 12px; padding: 1px 7px; font-size: 12px; cursor: pointer; }
.ntdc-react.mine { border-color: var(--c-blue); background: var(--c-blue-soft); }
.ntdc-react .n { font-family: var(--c-mono); font-size: 11px; color: var(--c-ink-2); }
.ntdc-msg.system { grid-template-columns: 1fr; padding: 4px 16px; }
.ntdc-msg.system .body { color: var(--c-ink-3); font-size: 12px; text-align: center; }
.ntdc-msg.system .body::before { content: '· '; }
.ntdc-file { margin-top: 4px; }
.ntdc-file img { max-width: min(420px, 100%); max-height: 320px; border-radius: 6px; border: 1px solid var(--c-line); cursor: zoom-in; display: block; }
.ntdc-file .att { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--c-line-strong); background: var(--c-surface-2); border-radius: 6px; padding: 6px 10px; color: var(--c-ink); text-decoration: none; font-size: 12.5px; }
.ntdc-file .att small { color: var(--c-ink-3); }

/* cards */
.ntdc-card { margin-top: 4px; border: 1px solid var(--c-line-strong); border-left: 4px solid var(--c-accent); border-radius: 8px; background: var(--c-surface-2); padding: 10px 12px; max-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.ntdc-card.buy { border-left-color: var(--c-buy); } .ntdc-card.sell { border-left-color: var(--c-sell); } .ntdc-card.hold { border-left-color: var(--c-ink-3); } .ntdc-card.headsup { border-left-color: var(--c-med); }
.ntdc-card .ch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ntdc-card .ch .ttl { font-family: var(--c-cond); font-weight: 700; font-size: 15px; }
.ntdc-card .ch .sub { color: var(--c-ink-3); font-size: 12px; }
.ntdc-card .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 4px 12px; }
.ntdc-card .grid div { display: flex; flex-direction: column; }
.ntdc-card .grid span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.ntdc-card .grid b { font-family: var(--c-mono); font-weight: 500; font-size: 13px; }
.ntdc-card .sum { font-size: 12.5px; color: var(--c-ink-2); }
.ntdc-card .pairs { display: flex; gap: 4px; flex-wrap: wrap; }
.ntdc-card .pair { font-family: var(--c-mono); font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--c-line-strong); }
.ntdc-card .pair.buy { color: var(--c-buy); border-color: var(--c-buy); } .ntdc-card .pair.sell { color: var(--c-sell); border-color: var(--c-sell); }
.ntdc-card .cf { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.ntdc-card .ntdc-pb { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.ntdc-card .ntdc-pb .pb { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--c-line-strong); border-radius: 6px; padding: 6px 8px; }
.ntdc-card .ntdc-pb .pb.buy { border-color: var(--c-buy); background: var(--c-buy-soft); }
.ntdc-card .ntdc-pb .pb.sell { border-color: var(--c-sell); background: var(--c-sell-soft); }
.ntdc-card .ntdc-pb .pb-head { font-family: var(--c-cond); font-weight: 700; font-size: 12.5px; }
.ntdc-card .ntdc-pb .pb.buy .pb-head { color: var(--c-buy); } .ntdc-card .ntdc-pb .pb.sell .pb-head { color: var(--c-sell); }
.ntdc-card .ntdc-pb .pb-if { font-size: 11.5px; color: var(--c-ink-3); }
.ntdc-meter { height: 6px; border-radius: 3px; background: var(--c-surface-3); position: relative; overflow: hidden; }
.ntdc-meter i { position: absolute; top: 0; bottom: 0; left: 50%; background: var(--c-buy); }
.ntdc-meter i.neg { background: var(--c-sell); }

/* typing + compose */
.ntdc-typing { min-height: 18px; font-size: 11.5px; color: var(--c-ink-3); padding: 0 16px; }
.ntdc-compose { border-top: 1px solid var(--c-line); padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.ntdc-replybar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-ink-2); background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 6px; padding: 4px 8px; }
.ntdc-replybar b { color: var(--c-ink); }
.ntdc-replybar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntdc-replybar button { background: none; border: 0; cursor: pointer; color: var(--c-ink-3); font-size: 14px; }
.ntdc-row { display: flex; gap: 6px; align-items: flex-end; }
.ntdc-row textarea { flex: 1; resize: none; min-height: 36px; max-height: 160px; line-height: 1.4; padding: 8px 10px; }
.ntdc-row .ntdc-btn.icon { height: 36px; }
.ntdc-compose .hint { font-size: 11px; color: var(--c-ink-3); }
.ntdc-compose .hint.warn { color: var(--c-med); }
.ntdc-pop { position: absolute; bottom: 100%; left: 12px; background: var(--c-surface-3); border: 1px solid var(--c-line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 5; margin-bottom: 4px; }
.ntdc-pop.emoji { display: grid; grid-template-columns: repeat(8, 32px); padding: 6px; gap: 2px; left: auto; right: 12px; }
.ntdc-pop.emoji button { background: none; border: 0; font-size: 18px; cursor: pointer; border-radius: 4px; padding: 3px 0; }
.ntdc-pop.emoji button:hover { background: var(--c-surface-2); }
.ntdc-pop.mention { min-width: 220px; padding: 4px; }
.ntdc-pop.mention button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 5px 8px; border-radius: 5px; cursor: pointer; text-align: left; }
.ntdc-pop.mention button.on, .ntdc-pop.mention button:hover { background: var(--c-surface-2); }
.ntdc-jump { position: absolute; right: 20px; bottom: 96px; z-index: 3; }
.ntdc-drop { position: absolute; inset: 0; background: var(--c-blue-soft); border: 2px dashed var(--c-blue); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--c-cond); font-weight: 700; font-size: 18px; z-index: 6; pointer-events: none; }

/* right panels */
.ntdc-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(300px, 90%); background: var(--c-surface-2); border-left: 1px solid var(--c-line); z-index: 4; display: flex; flex-direction: column; min-height: 0; }
.ntdc-panel .ph { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--c-line); font-family: var(--c-cond); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.ntdc-panel .ph button { margin-left: auto; }
.ntdc-panel .pb { overflow: auto; flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.ntdc-panel .ntdc-sec { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-ink-3); padding: 8px 6px 3px; font-weight: 600; }
.ntdc-member { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; color: var(--c-ink); }
.ntdc-member:hover { background: var(--c-surface-3); }
.ntdc-member.off { opacity: .55; }
.ntdc-member .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ntdc-member .nm small { display: block; color: var(--c-ink-3); font-size: 10.5px; }
.ntdc-result { border: 1px solid var(--c-line); border-radius: 6px; padding: 6px 8px; background: var(--c-surface); cursor: pointer; font-size: 12.5px; }
.ntdc-result:hover { border-color: var(--c-ink-3); }
.ntdc-result .rm { font-size: 11px; color: var(--c-ink-3); display: flex; gap: 6px; }
.ntdc-result .rb { white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* dialogs */
.ntdc-dlg { border: 1px solid var(--c-line-strong); border-radius: 10px; background: var(--c-surface); color: var(--c-ink); padding: 0; width: min(640px, 94vw); max-height: 90vh; font: 13.5px/1.45 var(--c-sans); box-shadow: 0 16px 48px rgba(0,0,0,.5); }
.ntdc-dlg::backdrop { background: rgba(0,0,0,.55); }
.ntdc-dlg .dh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--c-line); font-family: var(--c-cond); font-weight: 700; font-size: 16px; }
.ntdc-dlg .dh button { margin-left: auto; }
.ntdc-dlg .db { padding: 14px 16px; overflow: auto; max-height: calc(90vh - 52px); display: flex; flex-direction: column; gap: 12px; }
.ntdc-dlg h4 { margin: 0; font-family: var(--c-cond); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-ink-2); }
.ntdc-dlg .frow { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.ntdc-dlg label.f { display: flex; flex-direction: column; gap: 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--c-ink-3); }
.ntdc-dlg label.f > * { text-transform: none; letter-spacing: 0; }
.ntdc-dlg table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ntdc-dlg th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); padding: 4px 6px; border-bottom: 1px solid var(--c-line); }
.ntdc-dlg td { padding: 5px 6px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.ntdc-dlg .code { font-family: var(--c-mono); font-weight: 600; letter-spacing: .06em; }
.ntdc-dlg.wide { width: min(1000px, 96vw); }
.ntdc-dlg .crmnums { display: flex; gap: 8px; flex-wrap: wrap; }
.ntdc-dlg .crmnums > div { flex: 1 1 110px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 8px 10px; }
.ntdc-dlg .crmnums b { display: block; font-family: var(--c-cond); font-size: 20px; line-height: 1.1; }
.ntdc-dlg .crmnums span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.ntdc-dlg td.lead-email { font-family: var(--c-mono); font-size: 11.5px; word-break: break-all; }
.ntdc-dlg .tabs { display: flex; gap: 4px; }
.ntdc-dlg .tabs button { background: none; border: 1px solid transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--c-ink-2); font-family: var(--c-cond); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 12.5px; }
.ntdc-dlg .tabs button.on { background: var(--c-surface-3); color: var(--c-ink); border-color: var(--c-line-strong); }
.ntdc-dlg .ok { color: var(--c-buy); font-size: 12.5px; }
.ntdc-dlg .err { color: var(--c-sell); font-size: 12.5px; }
.ntdc-light { padding: 0; background: transparent; border: 0; max-width: 96vw; max-height: 96vh; }
.ntdc-light::backdrop { background: rgba(0,0,0,.8); }
.ntdc-light img { max-width: 96vw; max-height: 96vh; border-radius: 6px; display: block; }
.ntdc-menu { position: fixed; z-index: 50; background: var(--c-surface-3); border: 1px solid var(--c-line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); padding: 4px; min-width: 190px; display: flex; flex-direction: column; font: 13px var(--c-sans); color: var(--c-ink); }
.ntdc-menu .mh { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--c-line); margin-bottom: 4px; font-weight: 600; }
.ntdc-menu button { background: none; border: 0; text-align: left; padding: 6px 8px; border-radius: 5px; cursor: pointer; color: var(--c-ink); }
.ntdc-menu button:hover { background: var(--c-surface-2); }
.ntdc-menu button.danger { color: var(--c-sell); }
.ntdc-toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--c-surface-3); border: 1px solid var(--c-line-strong); border-left: 4px solid var(--c-med); border-radius: 6px; padding: 8px 12px; font-size: 12.5px; z-index: 8; box-shadow: 0 8px 24px rgba(0,0,0,.35); max-width: 90%; }
.ntdc-toast.ok { border-left-color: var(--c-buy); }
.ntdc-offline { background: var(--c-med); color: #1b1400; font-size: 12px; font-weight: 600; text-align: center; padding: 3px 8px; }
@media (max-width: 720px) {
  .ntdc[data-layout="full"] { grid-template-columns: minmax(0, 1fr); }
  .ntdc[data-layout="full"] .ntdc-side { display: none; }
  .ntdc[data-layout="full"] .ntdc-roomsel { display: inline-block; }
  .ntdc-msg { grid-template-columns: 30px minmax(0, 1fr); padding-inline: 8px 10px; }
  .ntdc-card .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- phones ---- */
@media (max-width: 720px) {
  .ntdc-head { padding: 6px 8px; gap: 6px; }
  .ntdc-head .topic, .ntdc-head .rname { display: none; }
  .ntdc[data-layout="full"] .ntdc-roomsel { display: inline-block; flex: 1; max-width: none; }
  .ntdc-roomsel { max-width: 46vw; }
  .ntdc-compose { padding: 6px 8px 8px; }
  .ntdc-row textarea { padding: 7px 8px; }
  .ntdc-panel { width: 100%; }
  .ntdc-card { max-width: 100%; }
  .ntdc-file img { max-width: 100%; }
  .ntdc-dlg { width: 100vw; max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .ntdc-dlg .db { max-height: calc(100dvh - 52px); }
  .ntdc-dlg table { display: block; overflow-x: auto; }
  .ntdc-pop.emoji { grid-template-columns: repeat(6, 32px); }
  .ntdc-jump { bottom: 80px; right: 10px; }
  .ntdc-typing { padding: 0 8px; }
}

/* ---- polls ---- */
.ntdc-card.poll { border-left-color: var(--c-blue); }
.ntdc-poll { display: flex; flex-direction: column; gap: 5px; }
.ntdc-poll-opt { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--c-surface-3); border: 1px solid var(--c-line-strong); border-radius: 6px; padding: 6px 10px; cursor: pointer; overflow: hidden; color: var(--c-ink); }
.ntdc-poll-opt:hover:not(:disabled) { border-color: var(--c-blue); }
.ntdc-poll-opt:disabled { cursor: default; opacity: .85; }
.ntdc-poll-opt i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-blue-soft); transition: width .3s; }
.ntdc-poll-opt.mine { border-color: var(--c-blue); }
.ntdc-poll-opt.mine i { background: var(--c-blue-soft); box-shadow: inset 3px 0 0 var(--c-blue); }
.ntdc-poll-opt .ol { position: relative; flex: 1; }
.ntdc-poll-opt .on { position: relative; font-size: 11.5px; color: var(--c-ink-2); white-space: nowrap; }
.ntdc-dlg .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 720px) { .ntdc-dlg .opts { grid-template-columns: 1fr; } }
.ntdc-voters { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--c-line-strong); padding-top: 8px; margin-top: 2px; font-size: 12.5px; }
.ntdc-voters .vo b { font-weight: 600; }
.ntdc-voters .vl { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.ntdc-voters .vu { display: inline-flex; align-items: center; gap: 5px; }
/* compact poll card */
.ntdc-card.poll { max-width: 420px; padding: 8px 10px; gap: 4px; font-size: 12px; }
.ntdc-card.poll .ch .ttl { font-size: 13.5px; }
.ntdc-card.poll .ch .sub { font-size: 11px; }
.ntdc-poll { gap: 3px; }
.ntdc-poll-opt { padding: 3px 8px; font-size: 12px; border-radius: 5px; gap: 6px; }
.ntdc-poll-opt .on { font-size: 10.5px; }
.ntdc-card.poll .cf .ntdc-btn { padding: 3px 8px; font-size: 11.5px; }
.ntdc-voters { font-size: 11.5px; gap: 4px; padding-top: 6px; }
.ntdc-voters .vl { gap: 3px 8px; margin-top: 2px; }

/* ---- avatars, devices, link QR ---- */
.ntdc-av.img { overflow: hidden; }
.ntdc-av.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ntdc-av.xl { width: 64px; height: 64px; font-size: 22px; }
.ntdc-qr { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: 8px; padding: 12px; }
.ntdc-qr .qr { width: 168px; height: 168px; background: #fff; padding: 6px; border-radius: 6px; flex: none; }
.ntdc-qr .qr svg { width: 100%; height: 100%; display: block; }
.ntdc-qr > div:last-child { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.ntdc-code { font-family: var(--c-mono); font-size: 26px; font-weight: 600; letter-spacing: .25em; }

/* ---- layout fix: the main column is a flex column (grid rows shifted when hidden rows collapsed and pushed the compose bar off-screen) ---- */
.ntdc-main { display: flex; flex-direction: column; }
.ntdc-main > * { flex: none; }
.ntdc-main > .ntdc-list { flex: 1 1 auto; min-height: 0; }
.ntdc { height: 100%; max-height: 100%; }
@media (max-width: 720px) {
  .ntdc textarea, .ntdc .ntdc-in, .ntdc select, .ntdc-dlg input, .ntdc-dlg select, .ntdc-dlg textarea { font-size: 16px; }   /* iOS zooms into smaller fields */
  .ntdc-compose { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .ntdc-row textarea { min-height: 40px; min-width: 0; }
  .ntdc-list { -webkit-overflow-scrolling: touch; }
  /* On a 360 px phone the four buttons squeezed the typing field to ~140 px, which wrapped and clipped
     its own placeholder. Tighter gaps and button padding give the field back about 20 px. */
  .ntdc-row { gap: 4px; }
  .ntdc-row .ntdc-btn.icon { padding: 4px 6px; }
  .ntdc-row .ntdc-btn.blue { padding: 5px 9px; }
}
