/* Product channel previews rebuilt from the supplied screenshots. */
.scene-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--ink-3); font-size: 12px; }
.scene-caption a { flex: none; color: var(--accent-strong); font-weight: 700; }

@media (max-width: 700px) {
  .nimble-grid > * { min-width: 0; }
  .scene-caption { flex-direction: column; align-items: flex-start; }
}

/* ---------- WhatsApp (Android, dark) recreation ----------
   Always dark, whatever the site theme: it mirrors the product screenshot. */
.wa-preview { width: min(380px, 100%); min-width: 0; margin: 0 auto; }
.wa-preview .scene-caption { flex-direction: column; align-items: flex-start; gap: 6px; }
.wa-device {
  --wa-bg: #0b1114; --wa-bar: #0a1014; --wa-in: #21282c; --wa-out: #144d37; --wa-fg: #e9edef; --wa-fg-2: #8696a0;
  --wa-green: #21c063; --wa-tick: #53bdeb; --wa-chart: #1b7f55;
  position: relative; padding: 10px; border-radius: 48px; background: #111; color: var(--wa-fg);
  box-shadow: inset 0 0 0 1.5px #2a2a2a, 0 30px 60px -24px rgba(26, 22, 20, .55), 0 2px 8px rgba(26, 22, 20, .12);
  font: 15px/1.38 Roboto, "Google Sans", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; color-scheme: dark;
}
.wa-device *, .wa-device *::before, .wa-device *::after { box-sizing: border-box; }
.wa-device button { font: inherit; color: inherit; }
.wa-screen { position: relative; display: flex; flex-direction: column; height: 720px; overflow: hidden; border-radius: 38px; background: var(--wa-bg); }
.wa-icon { width: 22px; height: 22px; flex: none; fill: currentColor; }

.wa-statusbar { position: relative; display: flex; align-items: center; justify-content: space-between; height: 32px; flex: none; padding: 4px 24px 0 28px; background: var(--wa-bar); color: #e9edef; font-size: 13px; font-weight: 500; }
.wa-camera { position: absolute; left: 50%; top: 9px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #000; box-shadow: inset 0 0 0 2px #1b1b1b; }
.wa-status-icons { display: flex; gap: 3px; }
.wa-status-icons .wa-icon { width: 15px; height: 15px; }

.wa-header { position: relative; display: flex; align-items: center; gap: 2px; height: 60px; flex: none; padding: 0 4px 0 2px; background: var(--wa-bar); border-bottom: 1px solid #141c20; }
.wa-hbtn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #e9edef; }
button.wa-hbtn { cursor: pointer; }
button.wa-hbtn:hover { background: rgba(255, 255, 255, .08); }
.wa-hbtn:focus-visible, .wa-fab:focus-visible, .wa-quick button:focus-visible { outline: 2px solid var(--wa-green); outline-offset: 2px; }
/* SafeFlow avatar: always the light brand version (inherited variables feed the <use> mark). */
.wa-logo { --track: #e6d5c9; --accent: #d9573a; display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 4px; border-radius: 50%; background: #fff; }
.wa-logo svg { width: 100%; height: 100%; }
.wa-title { display: flex; flex-direction: column; min-width: 0; flex: 1; margin-left: 10px; line-height: 1.2; }
.wa-title strong { overflow: hidden; font-size: 17px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.wa-title span { overflow: hidden; color: var(--wa-fg-2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.wa-title span.is-typing { color: var(--wa-green); }
.wa-menu { position: absolute; z-index: 4; top: 8px; right: 8px; display: flex; flex-direction: column; min-width: 190px; padding: 8px 0; border-radius: 12px; background: #233138; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.wa-menu[hidden] { display: none; }
.wa-menu > * { padding: 11px 20px; border: 0; background: none; text-align: left; font-size: 15px; }
.wa-menu button { cursor: pointer; }
.wa-menu button:hover, .wa-menu button:focus-visible { background: rgba(255, 255, 255, .07); outline: 0; }
.wa-menu span { color: var(--wa-fg-2); }

.wa-thread { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 14px; scrollbar-width: none;
  background-color: var(--wa-bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' fill='none' stroke='%23c9d4da' stroke-opacity='.055' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 20c4-6 12-6 16 0s-2 14-8 16c-6-2-12-10-8-16z'/%3E%3Ccircle cx='62' cy='18' r='7'/%3E%3Cpath d='M62 7v-3M62 32v-3M51 18h-3M76 18h-3'/%3E%3Cpath d='M98 10h22a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-14l-6 5v-5h-2a4 4 0 0 1-4-4V14a4 4 0 0 1 4-4z'/%3E%3Cpath d='M20 62l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z'/%3E%3Crect x='52' y='56' width='24' height='18' rx='3'/%3E%3Ccircle cx='64' cy='65' r='5'/%3E%3Cpath d='M100 58c8 0 14 6 14 14M100 66c4 0 6 2 6 6'/%3E%3Ccircle cx='100' cy='72' r='1.5'/%3E%3Cpath d='M12 110q8-12 16 0t16 0'/%3E%3Cpath d='M58 100l10 20 10-20zM62 108h12'/%3E%3Cpath d='M104 102c0-5 8-5 8 0 0-5 8-5 8 0 0 6-8 11-8 11s-8-5-8-11z'/%3E%3C/svg%3E"); background-size: 140px 140px; }
.wa-thread::-webkit-scrollbar { display: none; }
.wa-thread:focus-visible { outline: 2px solid var(--wa-green); outline-offset: -2px; }
.wa-chip { width: max-content; max-width: 88%; margin: 4px auto 10px; padding: 5px 12px; border-radius: 8px; background: #182229; color: var(--wa-fg-2); font-size: 12.5px; text-align: center; }
.wa-chip-e2e { display: flex; gap: 6px; align-items: flex-start; background: #1e2a2d; color: #ffd279; font-size: 12px; line-height: 1.4; text-align: left; }
.wa-chip-e2e .wa-icon { width: 13px; height: 13px; margin-top: 2px; }
.wa-msg { position: relative; display: flow-root; width: max-content; max-width: 85%; margin: 2px 0; padding: 6px 8px 8px 9px; border-radius: 8px; overflow-wrap: anywhere; box-shadow: 0 1px .5px rgba(0, 0, 0, .25); }
.wa-msg.has-tail.is-out { border-top-right-radius: 0; }
.wa-msg.has-tail.is-in { border-top-left-radius: 0; }
.wa-msg.has-tail { margin-top: 8px; }
.wa-msg.has-tail::before { content: ""; position: absolute; top: 0; width: 9px; height: 13px; background: inherit; }
.wa-msg.is-out.has-tail::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); border-top-right-radius: 3px; }
.wa-msg.is-in.has-tail::before { left: -8px; clip-path: polygon(0 0, 100% 0, 100% 100%); border-top-left-radius: 3px; }
.wa-msg.is-out { margin-left: auto; background: var(--wa-out); }
.wa-msg.is-in { background: var(--wa-in); }
.wa-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 8px 0 -4px 12px; color: rgba(233, 237, 239, .6); font-size: 11px; line-height: 1; }
.wa-meta .wa-icon { width: 16px; height: 16px; color: var(--wa-tick); }
.wa-msg.wa-long { width: 92%; max-width: 92%; }
.wa-text h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; line-height: 1.38; letter-spacing: 0; color: var(--wa-fg); }
.wa-text h4 { margin: 12px 0 4px; font-size: 15px; font-weight: 700; color: var(--wa-fg); }
.wa-text p { margin: 0 0 10px; }
.wa-text p:last-child { margin-bottom: 0; }
.wa-text strong { font-weight: 700; color: var(--wa-fg); }
.wa-text ul { margin: 0 0 10px; padding-left: 20px; }
.wa-text li { margin: 1px 0; }
.wa-text .muted { color: var(--wa-fg-2); font-size: 13px; }

/* image message holding the chart (rendered like the matplotlib image in the screenshot) */
.wa-media { width: 80%; max-width: 290px; padding: 3px 3px 7px; }
.wa-media-wrap { display: flex; align-items: center; gap: 8px; }
.wa-media-wrap .wa-media { flex: none; }
.wa-forward { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: rgba(17, 27, 33, .85); color: #d1d7db; }
.wa-forward .wa-icon { width: 20px; height: 20px; }
.wa-chart { position: relative; border-radius: 6px; background: #fff; color: #222; }
.wa-chart svg { display: block; width: 100%; height: auto; font-family: "DejaVu Sans", Verdana, Arial, sans-serif; }
.wa-chart .ttl { font-size: 8.5px; fill: #222; text-anchor: middle; }
.wa-chart .tk { font-size: 6.4px; fill: #333; }
.wa-chart .frame { fill: none; stroke: #222; stroke-width: .7; }
.wa-chart .grid { stroke: #e6e6e6; stroke-width: .6; }
.wa-chart .line { fill: none; stroke: var(--wa-chart); stroke-width: 1.4; stroke-linejoin: round; }
.wa-chart .pt { fill: var(--wa-chart); pointer-events: none; }
.wa-chart .hit { fill: transparent; cursor: pointer; }
.wa-chart .hit:focus { outline: none; }
.wa-chart .hit:focus-visible + .pt, .wa-chart .pt.is-active { fill: #0b5c3b; stroke: rgba(27, 127, 85, .3); stroke-width: 5; }
.wa-tip { position: absolute; z-index: 2; padding: 5px 8px; border-radius: 6px; background: #111b21; color: #e9edef; font-size: 11.5px; line-height: 1.3; white-space: nowrap; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.wa-tip.is-below { transform: translate(-50%, 12px); }
.wa-tip[hidden] { display: none; }
.wa-tip b { display: block; }
.wa-tip .up { color: #6fdc97; } .wa-tip .down { color: #ff9a9a; }
.wa-media .wa-text { padding: 6px 5px 0; }

/* WhatsApp Business quick-reply buttons */
.wa-quick { display: grid; gap: 2px; width: 92%; margin-top: 2px; }
.wa-quick button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px; border: 0; border-radius: 8px; background: var(--wa-in); color: #53bdeb; font-size: 14.5px; font-weight: 500; cursor: pointer; box-shadow: 0 1px .5px rgba(0, 0, 0, .25); }
.wa-quick button:hover { background: #283236; }
.wa-quick button:disabled { opacity: .5; cursor: default; }
.wa-quick .wa-icon { width: 17px; height: 17px; transform: scaleX(-1); }
.wa-typing { display: flex; gap: 4px; padding: 12px 14px; }
.wa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: tm-bounce 1.1s infinite ease-in-out; }
.wa-typing i:nth-child(2) { animation-delay: .15s; } .wa-typing i:nth-child(3) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .wa-typing i { animation: none; } }

.wa-composer { display: flex; align-items: flex-end; gap: 6px; flex: none; padding: 6px 8px 8px; background: transparent; }
.wa-thread + .wa-composer { background: var(--wa-bg); }
.wa-field { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; height: 50px; padding: 0 14px; border-radius: 25px; background: #20262b; color: #8696a0; }
.wa-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--wa-fg); font: inherit; font-size: 16px; }
.wa-field input::placeholder { color: #8696a0; }
.wa-attach { transform: rotate(-45deg); }
.wa-fab { position: relative; display: grid; place-items: center; width: 50px; height: 50px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--wa-green); color: #0b141a; cursor: pointer; }
.wa-fab:hover { background: #1daa57; }
.wa-fab:disabled { opacity: .6; cursor: wait; }
.wa-fab .wa-icon { position: absolute; width: 24px; height: 24px; transition: transform .15s, opacity .15s; }
.wa-fab .wa-i-send { opacity: 0; transform: scale(.4); }
.wa-composer.has-text .wa-i-send { opacity: 1; transform: none; }
.wa-composer.has-text .wa-i-mic { opacity: 0; transform: scale(.4); }
.wa-composer.has-text .wa-cam { display: none; }
.wa-gesture { display: block; width: 110px; height: 4px; flex: none; margin: 2px auto 8px; border-radius: 2px; background: #6b7479; }
@media (max-width: 420px) {
  .wa-device { padding: 7px; border-radius: 40px; }
  .wa-screen { height: 660px; border-radius: 33px; }
}

/* Security story */
.security-flow { display: flex; align-items: stretch; gap: 12px; margin: 36px 0 22px; }
.security-flow > div { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.security-flow-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.security-flow-icon .lucide { width: 20px; height: 20px; }
.security-flow strong { color: var(--ink); font-size: 14px; line-height: 1.3; }
.security-arrow { display: grid; place-items: center; flex: none; color: var(--accent); opacity: .8; }
.security-arrow .lucide { width: 18px; height: 18px; }
.security-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.security-grid article { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.security-number { display: block; margin-bottom: 30px; color: var(--accent); font: 600 12px var(--mono); }
.security-grid h3 { margin-bottom: 10px; text-wrap: balance; color: var(--ink); font-size: 19px; }
.security-grid p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
@media (max-width: 980px) {
  .security-flow { flex-wrap: wrap; }
  .security-flow > div { flex: 1 1 calc(50% - 36px); }
  .security-flow .security-arrow:nth-of-type(2) { display: none; }
  .security-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .security-flow { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .security-flow > div { width: 100%; }
  .security-arrow { transform: rotate(90deg); height: 18px; }
  .security-flow .security-arrow:nth-of-type(2) { display: grid; }
  .security-grid { grid-template-columns: 1fr; }
  .security-number { margin-bottom: 15px; }
}

/* ---------- Microsoft Teams desktop recreation (#demo) ----------
   Always dark, whatever the site theme: it mirrors the product screenshot. */
.tm-shell {
  --tm-chrome: #0f0f0f; --tm-list: #191919; --tm-canvas: #1f1f1f; --tm-card: #2d2d2d; --tm-card-2: #383838;
  --tm-stroke: #2e2e2e; --tm-stroke-2: #3d3d3d; --tm-fg: #ffffff; --tm-fg-2: #d6d6d6; --tm-fg-3: #adadad; --tm-fg-4: #8a8a8a;
  --tm-brand: #7f85f5; --tm-brand-line: #6269c4; --tm-brand-bg: #2f2f4a; --tm-select: #2b2c47; --tm-red: #e0202f;
  position: relative; display: grid; grid-template-columns: 68px 300px minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr);
  height: 760px; overflow: hidden; border: 1px solid #2c2c2c; border-radius: 12px; background: var(--tm-canvas); color: var(--tm-fg);
  box-shadow: 0 30px 70px -28px rgba(26, 22, 20, .55), 0 2px 8px rgba(26, 22, 20, .12);
  font: 14px/1.43 "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; color-scheme: dark;
}
.tm-shell *, .tm-shell *::before, .tm-shell *::after { box-sizing: border-box; }
.tm-shell button { font: inherit; color: inherit; }
.tm-icon { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* title bar */
.tm-titlebar { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr minmax(0, 520px) 1fr; align-items: center; gap: 16px; padding: 0 14px 0 20px; background: var(--tm-chrome); border-bottom: 1px solid #1d1d1d; }
.tm-nav-arrows { display: flex; gap: 14px; color: var(--tm-fg-4); }
.tm-nav-arrows .tm-icon { width: 18px; height: 18px; }
.tm-search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid #2f2f2f; border-radius: 6px; background: #1f1f1f; color: var(--tm-fg-4); font-size: 13px; }
.tm-search .tm-icon { width: 16px; height: 16px; }
.tm-titlebar-end { display: flex; align-items: center; justify-content: flex-end; gap: 16px; color: var(--tm-fg-2); }

/* app rail */
.tm-rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 4px; background: var(--tm-chrome); }
.tm-rail-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 6px; color: var(--tm-fg-3); font-size: 10px; line-height: 1.2; }
.tm-rail-item .tm-icon { width: 24px; height: 24px; }
.tm-rail-item.is-active { color: var(--tm-brand); font-weight: 600; }
.tm-rail-item.is-active::before { content: ""; position: absolute; left: -4px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tm-brand); }
.tm-rail-apps { margin-top: auto; }
.tm-badge { position: absolute; top: 6px; left: calc(50% + 5px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #c4314b; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

/* chat list */
.tm-list { display: flex; flex-direction: column; min-height: 0; background: var(--tm-list); border-right: 1px solid #111; border-top-left-radius: 8px; }
.tm-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; flex: none; padding: 0 12px 0 20px; }
.tm-list-head h3 { margin: 0; color: var(--tm-fg); font-size: 18px; font-weight: 700; letter-spacing: 0; }
.tm-list-tools { display: flex; gap: 14px; color: var(--tm-fg-2); }
.tm-list-tools .tm-icon { width: 19px; height: 19px; }
.tm-chips { display: flex; gap: 6px; padding: 0 20px 12px; }
.tm-chips span { padding: 3px 10px; border: 1px solid var(--tm-stroke-2); border-radius: 999px; color: var(--tm-fg-2); font-size: 12px; }
.tm-list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.tm-group { display: flex; align-items: center; gap: 4px; padding: 10px 8px 6px; color: var(--tm-fg-3); font-size: 12px; font-weight: 600; }
.tm-group .tm-icon { width: 14px; height: 14px; }
.tm-chat-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
button.tm-chat-item { cursor: pointer; }
.tm-chat-item.is-selected { background: var(--tm-select); box-shadow: inset 0 0 0 1px rgba(127, 133, 245, .16); }
.tm-chat-item:focus-visible { outline: 2px solid var(--tm-brand); outline-offset: -2px; }
.tm-chat-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tm-chat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tm-chat-row strong { overflow: hidden; color: var(--tm-fg); font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.tm-chat-row time { flex: none; color: var(--tm-fg-3); font-size: 12px; }
.tm-chat-preview { overflow: hidden; color: var(--tm-fg-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tm-chat-item.is-selected strong, .tm-chat-item.is-unread strong { font-weight: 700; }
.tm-chat-item.is-unread .tm-chat-preview { color: var(--tm-fg-2); font-weight: 600; }

/* avatars */
.tm-avatar { position: relative; display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; font-size: 12px; font-weight: 600; }
.tm-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.tm-avatar-group { border-radius: 8px; }
.tm-avatar-group .tm-icon { width: 18px; height: 18px; }
.tm-c1 { background: #4f2a52; color: #f1bbf5; } .tm-c2 { background: #203e5a; color: #a9d3f2; } .tm-c3 { background: #1f4a3a; color: #9fe0c0; }
.tm-c4 { background: #5b3b12; color: #fcd29b; } .tm-c5 { background: #3b3a70; color: #c5c7fa; } .tm-c6 { background: #5a2427; color: #f6b3b6; } .tm-c7 { background: #34404a; color: #c3d0da; }
.tm-presence { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2px solid var(--tm-list); border-radius: 50%; }
.tm-titlebar .tm-presence { border-color: var(--tm-chrome); }
.tm-available { background: #6bb700; } .tm-away { background: #f8d22a; } .tm-busy { background: #d74553; } .tm-offline { background: transparent; box-shadow: inset 0 0 0 1.5px #adadad; }

/* SafeFlow app avatar: always the light brand version, never theme-dependent. */
/* The mark is drawn through <use>, so its colours come from these inherited variables. */
.tm-logo { --track: #e6d5c9; --accent: #d9573a; display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 3px; border-radius: 8px; background: #ffffff; }
.tm-logo svg { width: 100%; height: 100%; }

/* main chat column */
.tm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--tm-canvas); }
.tm-chat-head { display: flex; align-items: center; gap: 12px; height: 56px; flex: none; padding: 0 12px 0 20px; border-bottom: 1px solid #121212; }
.tm-chat-name { font-size: 18px; font-weight: 700; white-space: nowrap; }
.tm-tabs { display: flex; align-self: stretch; gap: 18px; margin-left: 6px; }
.tm-tabs span { display: flex; align-items: center; color: var(--tm-fg-3); font-size: 14px; border-bottom: 3px solid transparent; padding-top: 3px; }
.tm-tabs .is-active { color: var(--tm-fg); font-weight: 600; border-bottom-color: var(--tm-brand); }
.tm-head-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; color: var(--tm-fg-2); }
.tm-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--tm-fg-2); }
button.tm-icon-btn { cursor: pointer; }
button.tm-icon-btn:hover { background: #2b2b2b; color: var(--tm-fg); }
button.tm-icon-btn:focus-visible, .tm-send:focus-visible, .tm-action:focus-visible { outline: 2px solid var(--tm-brand); outline-offset: 1px; }
.tm-divider-v { width: 1px; height: 20px; margin: 0 6px; background: var(--tm-stroke-2); }
.tm-back { display: none; margin-left: -8px; }

/* thread */
.tm-thread { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 32px 24px; scrollbar-width: thin; scrollbar-color: #4a4a4a transparent; }
.tm-thread:focus-visible { outline: 2px solid var(--tm-brand); outline-offset: -2px; }
.tm-out { display: flex; flex-direction: column; align-items: flex-end; margin: 14px 26px 0 0; position: relative; }
.tm-out time { margin: 0 2px 3px 0; color: var(--tm-fg-3); font-size: 12px; }
.tm-bubble { max-width: min(75%, 540px); padding: 8px 14px; border-radius: 6px; background: var(--tm-brand-bg); color: var(--tm-fg); overflow-wrap: anywhere; }
.tm-seen { position: absolute; right: -24px; bottom: 6px; width: 16px; height: 16px; color: var(--tm-brand); }
.tm-lastread { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px 44px; color: var(--tm-brand); font-size: 12px; font-weight: 600; }
.tm-lastread::before, .tm-lastread::after { content: ""; flex: 1; height: 1px; background: var(--tm-brand-line); }
.tm-in { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; margin-top: 14px; }
.tm-in .tm-logo { grid-row: 1 / span 2; margin-top: 22px; }
.tm-meta { margin-bottom: 4px; color: var(--tm-fg-3); font-size: 12px; }
.tm-meta b { margin-right: 8px; color: var(--tm-fg-2); font-weight: 400; }
.tm-card { width: min(100%, 560px); padding: 16px 18px 18px; border-radius: 6px; background: var(--tm-card); color: var(--tm-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .28); overflow-wrap: break-word; }
.tm-card.is-text { width: auto; max-width: min(100%, 560px); justify-self: start; padding: 9px 14px; }
.tm-card h4 { margin: 0 0 10px; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: 0; color: var(--tm-fg); }
.tm-card h5 { margin: 16px 0 6px; font-size: 14px; font-weight: 700; color: var(--tm-fg); }
.tm-card p { margin: 0 0 8px; }
.tm-card strong { font-weight: 700; color: var(--tm-fg); }
.tm-card ul { margin: 0; padding-left: 22px; }
.tm-card li { margin: 1px 0; }
.tm-card li::marker { color: var(--tm-fg-2); }
.tm-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 28px; row-gap: 4px; margin: 16px 0 6px; }
.tm-facts dt { font-weight: 700; }
.tm-facts dd { margin: 0; color: var(--tm-fg-2); }
.tm-note { margin-top: 12px !important; color: var(--tm-fg-3); font-size: 12px; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--tm-stroke-2); }
.tm-action { min-height: 32px; padding: 5px 12px; border: 1px solid #555; border-radius: 4px; background: transparent; color: var(--tm-fg); font-size: 13px; font-weight: 600; cursor: pointer; }
.tm-action:hover { background: #383838; border-color: #6b6b6b; }
.tm-action:disabled { opacity: .45; cursor: default; }
.tm-typing { display: flex; align-items: center; gap: 5px; width: max-content; padding: 13px 16px; border-radius: 6px; background: var(--tm-card); }
.tm-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--tm-fg-3); animation: tm-bounce 1.1s infinite ease-in-out; }
.tm-typing i:nth-child(2) { animation-delay: .15s; } .tm-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tm-bounce { 0%, 70%, 100% { opacity: .35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .tm-typing i { animation: none; } }
.tm-compare { display: grid; gap: 8px; margin: 14px 0 4px; }
.tm-compare div { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.tm-compare i { display: block; height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--tm-red) var(--w), #454545 var(--w)); }
.tm-compare b { font-variant-numeric: tabular-nums; }

/* line chart: SVG for lines, HTML for labels and focusable data points */
.tm-chart { display: grid; grid-template-columns: 18px 38px minmax(0, 1fr); grid-template-rows: 210px auto auto; margin-top: 18px; }
.tm-chart-ylabel { grid-row: 1; display: flex; align-items: center; justify-content: center; }
.tm-chart-ylabel span { transform: rotate(-90deg); white-space: nowrap; color: var(--tm-fg); font-size: 12px; font-weight: 700; }
.tm-chart-yticks { position: relative; grid-row: 1; }
.tm-chart-yticks span { position: absolute; right: 8px; transform: translateY(-50%); color: var(--tm-fg); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tm-plot { position: relative; grid-row: 1; }
.tm-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tm-plot .grid { stroke: #5c5c5c; stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.tm-plot .axis { stroke: #8a8a8a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tm-plot .guide { stroke: #9a9a9a; stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; opacity: 0; }
.tm-plot .guide.is-on { opacity: 1; }
.tm-plot .line { fill: none; stroke: var(--tm-red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tm-point { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.tm-point::after { content: ""; position: absolute; inset: 9px; border: 2px solid var(--tm-card); border-radius: 50%; background: var(--tm-red); transform: scale(.7); transition: transform .12s; }
.tm-point:hover::after, .tm-point.is-active::after { transform: scale(1.25); box-shadow: 0 0 0 3px rgba(224, 32, 47, .3); }
.tm-point:focus-visible { outline: 2px solid var(--tm-brand); outline-offset: -4px; }
.tm-tip { position: absolute; z-index: 2; min-width: 138px; padding: 7px 10px; border: 1px solid #4a4a4a; border-radius: 6px; background: #1b1b1b; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); color: var(--tm-fg); font-size: 12px; line-height: 1.35; pointer-events: none; transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap; }
.tm-tip[hidden] { display: none; }
.tm-tip b { display: block; font-size: 13px; }
.tm-tip span { color: var(--tm-fg-3); }
.tm-tip .up { color: #7fd48b; } .tm-tip .down { color: #ff8f8f; }
.tm-chart-xticks { position: relative; grid-column: 3; height: 22px; margin-top: 6px; }
.tm-chart-xticks span { position: absolute; transform: translateX(-50%); color: var(--tm-fg-3); font-size: 11px; white-space: nowrap; }
.tm-chart-readout { grid-column: 1 / -1; min-height: 18px; margin-top: 6px; color: var(--tm-fg-3); font-size: 12px; }
.tm-chart-readout b { color: var(--tm-fg); font-weight: 600; }

/* compose */
.tm-compose { display: flex; align-items: center; gap: 6px; min-height: 48px; flex: none; margin: 4px 32px 20px; padding: 4px 6px 4px 14px; border: 1px solid #3b3a3a; border-bottom-width: 2px; border-radius: 6px; background: #282727; }
.tm-compose:focus-within { border-bottom-color: var(--tm-brand); }
.tm-compose input { flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--tm-fg); font: inherit; font-size: 14px; }
.tm-compose input::placeholder { color: var(--tm-fg-3); }
.tm-compose-tools { display: flex; align-items: center; gap: 16px; padding: 0 6px; color: var(--tm-fg-2); }
.tm-compose .tm-divider-v { margin: 0 2px; }
.tm-send { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 6px; background: transparent; color: var(--tm-fg-2); cursor: pointer; }
.tm-send:hover { background: #333; color: var(--tm-brand); }
.tm-send:disabled { opacity: .45; cursor: wait; }

.scene-caption-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.scene-caption-btn { padding: 0; border: 0; background: none; color: var(--accent-strong); font: 700 12px var(--font); cursor: pointer; }
.scene-caption-btn:hover, .scene-caption a:hover { text-decoration: underline; }

/* The chat list collapses into an overlay once there is no room for it. */
@media (max-width: 1080px) { .tm-shell { grid-template-columns: 64px 260px minmax(0, 1fr); } }
@media (max-width: 960px) {
  .tm-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .tm-list { position: absolute; z-index: 5; top: 48px; bottom: 0; left: 64px; width: min(300px, calc(100% - 64px)); box-shadow: 16px 0 40px rgba(0, 0, 0, .55); transform: translateX(-12px); opacity: 0; visibility: hidden; transition: opacity .16s, transform .16s, visibility 0s .16s; }
  .tm-shell.is-list-open .tm-list { transform: none; opacity: 1; visibility: visible; transition: opacity .16s, transform .16s; }
  .tm-back { display: grid; }
  .tm-titlebar { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 700px) {
  .tm-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 640px; border-radius: 14px; }
  .tm-titlebar, .tm-rail, .tm-hide-sm, .tm-head-tools .tm-divider-v { display: none; }
  .tm-list { top: 0; left: 0; width: 100%; border-radius: 0; }
  .tm-chat-head { gap: 8px; padding: 0 6px 0 14px; }
  .tm-chat-name { font-size: 16px; }
  .tm-tabs { gap: 14px; margin-left: 2px; }
  .tm-thread { padding: 12px 12px 18px; }
  .tm-out { margin-right: 22px; }
  .tm-bubble { max-width: 88%; }
  .tm-lastread { margin-left: 0; }
  .tm-in { grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px; }
  .tm-in .tm-logo { width: 28px; height: 28px; }
  .tm-card { padding: 13px 13px 15px; }
  .tm-card h4 { font-size: 16px; }
  .tm-card, .tm-card.is-text { font-size: 13.5px; }
  .tm-card ul { padding-left: 18px; }
  .tm-facts { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .tm-facts dd { margin-bottom: 6px; }
  .tm-chart { grid-template-columns: 16px 32px minmax(0, 1fr); grid-template-rows: 170px auto auto; }
  .tm-chart-xticks span:nth-child(even) { display: none; }
  .tm-compose { margin: 4px 10px 12px; padding-left: 12px; }
  .tm-compose-tools { gap: 12px; padding: 0 2px; }
  .scene-caption-links { gap: 14px; }
}
