/* Twin Protocol brand fonts (style guide v1.1): Source Sans 3 for text, Creato Display for headings.
   Both are free for commercial use (SIL Open Font License) and served from this site. */
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("/fonts/creato-display-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
.page-title, .greeting, .signin-sheet h1, .sheet-title { font-family: "Creato Display", "Source Sans 3", sans-serif; font-weight: 700; letter-spacing: -0.01em; }

/* Twin Chat, following the Twin Client App design proposal (October 2026).
   Dark by default and follows the phone setting; light mode is the same screens with the palette flipped.
   Electric Navy is the ground, one softened blue accent means "tap me", status colours stay small. */

:root {
  color-scheme: dark;
  --bg: #070a18;
  --bg-top: #070a18;
  --surface: rgba(16, 20, 44, 0.78);
  --surface-2: rgba(255, 255, 255, 0.07);
  --bubble: #1c2447;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f6ff;
  --muted: #96a2c0;
  --faint: #566180;
  --accent: #3fb6ea;
  --accent-text: #5cc8f5;
  --glow: radial-gradient(60% 40% at 15% 42%, rgba(12, 157, 216, 0.22), transparent 70%), radial-gradient(60% 50% at 90% 88%, rgba(42, 63, 176, 0.38), transparent 70%), radial-gradient(40% 30% at 70% 58%, rgba(124, 92, 230, 0.14), transparent 70%);
  --num: linear-gradient(135deg, #7fd8ff, #8fa0ff);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 2, 12, 0.45);
  --user-1: #4d84ad;
  --user-2: #6297c0;
  --ring-1: #5d8fc0;
  --ring-2: #8e74c8;
  --live: #31e38f;
  --alert: #df0e44;
  --attention: #fe9309;
  --bar: rgba(7, 10, 24, 0.88);
  --seg: rgba(255, 255, 255, 0.06);
  --seg-on: rgba(92, 200, 245, 0.22);
  --bar-lo: #2a3650;
  --live-bg: rgba(49, 227, 143, 0.14);
  --attention-bg: rgba(254, 147, 9, 0.18);
  --sheet: #ffffff;
  --sheet-text: #0b1430;
  --sheet-muted: #5b6275;
  --sheet-line: #d9dde6;
  --navy: #0f1d4a;
  --sky: #0c9dd8;
  --indigo: #2a3fb0;
  --twin: linear-gradient(135deg, #0c9dd8 0%, #2a3fb0 100%);
  /* The phone app (Android) sets --safe-area-inset-*; browsers use env(). */
  --safe-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f9fd;
    --bg-top: #e9f3fc;
    --surface: #ffffff;
    --surface-2: #eef3fb;
    --bubble: #e3e9f3;
    --line: rgba(11, 16, 48, 0.07);
    --text: #0b1030;
    --muted: #5b6785;
    --faint: #9aa5bf;
    --accent: #1f6fd0;
    --accent-text: #1f6fd0;
    --glow: none;
    --num: linear-gradient(135deg, #0c9dd8, #2a3fb0);
    --card-shadow: 0 10px 28px rgba(11, 16, 48, 0.07);
    --user-1: #2f78ad;
    --user-2: #3f8dc4;
    --bar: rgba(255, 255, 255, 0.92);
    --seg: #e6ecf6;
    --seg-on: #ffffff;
    --bar-lo: #c9d3e2;
    --live: #17a65c;
    --attention: #d97706;
    --live-bg: rgba(23, 166, 92, 0.12);
    --attention-bg: rgba(217, 119, 6, 0.14);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

/* iOS 26 home-screen apps: with the translucent status bar, WebKit makes the page shorter than the
   screen by the status bar height (WebKit bug 301108), so bottom bars float up. Make the page as
   tall as the screen again. The min() stops any scroll where the top inset is 0. */
@media (display-mode: standalone) {
  html { height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
}
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.42 "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app { height: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
[hidden] { display: none !important; }
a { color: var(--accent-text); }
p { margin: 0 0 8px; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-filled { fill: currentColor; stroke: currentColor; }
.icon .icon-dots { stroke-width: 3.4; stroke-linecap: square; }
.tab .icon path[d^="M5 12h.01"] { stroke-width: 3.2; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 13px 16px;
  font-weight: 600; font-size: 16px; margin-top: 8px;
}
.btn-primary { background: linear-gradient(135deg, var(--sky) 0%, var(--indigo) 100%); color: #fff; box-shadow: 0 8px 20px rgba(42, 63, 176, 0.25); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.text-btn { background: none; border: 0; padding: 6px 0; color: var(--accent-text); font-size: 15px; }
.text-btn.strong { font-weight: 700; }
.text-btn.block { display: block; margin: 12px auto 0; }
.form-error { color: var(--alert); font-size: 14px; min-height: 0; margin: 6px 0 0; }
.form-error:empty { display: none; }

/* The lockup: glyph and name. Light grounds get the two-tone glyph, dark ones the white glyph. */
.nameplate { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -0.02em; font-size: 20px; }
.nameplate-glyph { height: 1.4em; width: auto; position: relative; top: 0.08em; }
.only-dark { display: none; }
@media (prefers-color-scheme: light) { .only-dark { display: none; } .only-light { display: inline; } }
@media (prefers-color-scheme: dark) { .only-light { display: none; } .only-dark { display: inline; } }

/* Splash: white glyph on navy, a blue glow behind it and faint rings */
.splash { height: 100%; background: #f6f9fd; display: flex; align-items: center; justify-content: center; padding-bottom: var(--safe-b); }
.splash-mark { transform: scale(1.3); color: #0b1030; }
.splash-icon { width: 72px; height: 72px; border-radius: 17px; }
.branded-boot .boot-splash .splash-mark { visibility: hidden; }

/* Sign in: a light page in both modes, the lockup top left, the glyph as a faint watermark */
.signin { position: relative; overflow: hidden; min-height: 100%; display: flex; flex-direction: column; background: #f6f9fd; color: #0b1030; }
/* First open: Hello in each language, then the language list (hello.ts) */
.hello { position: relative; overflow: hidden; min-height: 100%; display: flex; flex-direction: column; background: #f6f9fd; color: #0b1030; }
.hello-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 28px; position: relative; }
.hello-word { font-family: "Creato Display", "Source Sans 3", sans-serif; font-weight: 700; font-size: 48px; line-height: 1.12; letter-spacing: -0.02em; margin: 0; color: #5a6480; }
.hello-line { display: block; white-space: nowrap; }
.hello-foot { margin: 14px 0 0; text-align: center; color: #8a93a8; font-size: 12.5px; letter-spacing: 0.02em; }
/* "Welcome to" small and grey, the app's name big in teal, blue and purple */
.hello-word .hello-line:first-child { font-size: 0.6em; font-weight: 600; letter-spacing: 0; margin-bottom: 2px; }
.hello-word .hello-line:last-child { display: inline-block; background: linear-gradient(90deg, #12b5c9, #2d6ee0 50%, #7a3fe0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hello-word.in { animation: hello-in 0.5s ease; }
@keyframes hello-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hello-word.in { animation: none; } }
.hello-name { color: #4b5570; font-size: 15px; margin: 10px 0 0; }
.hello-dots { display: flex; gap: 8px; margin-top: 28px; }
.hello-dots i { width: 7px; height: 7px; border-radius: 50%; background: #c8d3e6; }
.hello-dots i.on { background: #0c9dd8; }
.hello-go { position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding: 0 28px calc(36px + var(--safe-b)); box-sizing: border-box; }
.hello.pick { padding: calc(56px + var(--safe-t)) 20px calc(28px + var(--safe-b)); max-width: 480px; margin: 0 auto; box-sizing: border-box; }
.hello.pick h1 { position: relative; font-family: "Creato Display", "Source Sans 3", sans-serif; font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
.hello.pick .lead { position: relative; color: #4b5570; font-size: 15px; margin: 0 0 22px; }
.pick-list { position: relative; background: #fff; border: 1px solid #e3e9f3; border-radius: 16px; overflow: hidden; }
.pick-row { display: flex; align-items: center; width: 100%; padding: 11px 18px; border: 0; border-top: 1px solid #edf1f7; background: none; color: #0b1030; text-align: start; }
.pick-row:first-child { border-top: 0; }
.pick-row b { display: block; font-size: 16px; font-weight: 600; }
.pick-row small { display: block; color: #6b7590; font-size: 13px; }
.pick-check { margin-inline-start: auto; color: #0c7fc0; font-size: 20px; font-weight: 700; }
.hello.pick .btn-primary { position: relative; margin-top: 20px; }
.signin-mark { position: absolute; right: -120px; top: -40px; width: 340px; height: auto; opacity: 0.06; pointer-events: none; }
.signin-top { position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding: calc(44px + var(--safe-t)) 28px 0; color: var(--navy); }
.signin-top .nameplate { font-size: 22px; }
.signin-sheet { position: relative; flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 440px; margin: 0 auto; padding: 56px 28px calc(24px + var(--safe-b)); }
.signin-sheet h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; color: #0b1030; }
.signin-sheet .lead { color: #4b5570; font-size: 15px; line-height: 1.5; margin-bottom: 30px; }
/* Fine print under a button: centred, one sentence per line, evenly spaced. */
.signin-sheet .lead.small { font-size: 14px; margin: 16px auto 0; text-align: center; max-width: 320px; }
.signin-sheet .lead.small .sn, .consent .sn, .consent-foot .sn { display: block; }
.signin-sheet .lead.small .sn + .sn, .consent .sn + .sn { margin-top: 4px; }
.consent-point p { text-align: left; hyphens: none; -webkit-hyphens: none; }
.signin-sheet input:not([type=checkbox]) {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 14px; border: 1px solid #d6deea;
  background: #fff; color: #0b1030; outline: none;
}
.signin-sheet input:not([type=checkbox]):focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(12, 157, 216, 0.15); }
.signin-sheet input.code:not(:placeholder-shown) { letter-spacing: 0.3em; }
.signin-sheet input.code { font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.signin-sheet .btn-primary { height: 54px; border-radius: 14px; margin-top: 14px; padding: 0 16px; }
.signin-sheet .text-btn { color: var(--indigo); }
.signin-sheet .form-error { margin-top: 10px; }
.split { display: flex; justify-content: space-between; margin-top: 10px; }
.signin-foot { margin-top: auto; padding-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.signin-rule { display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--twin); }
.consent { text-align: center; font-size: 12px; line-height: 1.6; color: #6b7590; margin: 0; }
.inline-link { background: none; border: 0; padding: 0; color: var(--indigo); font-size: 12px; }

/* Signed-in shell: soft navy gradient ground, bar at the bottom */
.shell { position: relative; height: 100%; display: flex; flex-direction: column; background: var(--bg); isolation: isolate; }
/* The glow is one fixed layer behind everything, composited once, so tab changes and scrolling never repaint it. */
.shell::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--glow), linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 45%); background-color: var(--bg); pointer-events: none; transform: translateZ(0); }
.solo { min-height: 100%; background: var(--bg); position: relative; isolation: isolate; }
/* Screens shown outside the app shell (consent, terms, legal, no agent) get the same backdrop as the app. */
.solo::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--glow), linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 45%); background-color: var(--bg); pointer-events: none; transform: translateZ(0); }
/* A page shown on its own (consent) stretches to the full height, so its centring spacers have room to work. */
.solo:not(.center-screen) { display: flex; flex-direction: column; }
.solo:not(.center-screen) > .page { flex: 1 0 auto; }
.center-screen { display: flex; align-items: center; }
.content { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.corner-mark { display: none; }
/* One screen at a time scrolls; the one on its way out sits on top with the shell's backdrop so the dissolve is clean. */
.screen { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.leaving { z-index: 2; pointer-events: none; }
.screen.staged { visibility: hidden; }
/* Phones: one short dissolve. Wide screens (below) add travel in the direction of the change. Both
   screens are transparent over the shell's fixed glow, so the backdrop itself never moves. */
.screen.in-left, .screen.in-right, .screen.in-up { animation: screen-in 0.18s ease-out both; }
.screen.out-left, .screen.out-right, .screen.out-up { animation: screen-out 0.16s ease-out forwards; }
@keyframes screen-in { from { opacity: 0; } }
@keyframes screen-out { to { opacity: 0; } }
@media (min-width: 700px) {
  .screen.in-left { animation: in-left 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .screen.in-right { animation: in-right 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .screen.in-up { animation: in-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .screen.out-left { animation: out-left 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards; }
  .screen.out-right { animation: out-right 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards; }
  .screen.out-up { animation: screen-out 0.24s ease-out forwards; }
  /* The spinner stays invisible for the first moments, so a quick load never shows it at all. */
  .screen > .loading { animation: spinner-late 0.45s step-end both; }
}
@keyframes spinner-late { from { opacity: 0; } to { opacity: 1; } }
@keyframes in-left { from { transform: translateX(56px); opacity: 0; } }
@keyframes in-right { from { transform: translateX(-56px); opacity: 0; } }
@keyframes in-up { from { transform: translateY(18px); opacity: 0; } }
@keyframes out-left { to { transform: translateX(-40px); opacity: 0; } }
@keyframes out-right { to { transform: translateX(40px); opacity: 0; } }
/* Floating bar: a pill detached from the bottom edge; the page scrolls under it. */
.tabbar {
  position: absolute; left: 14px; right: 14px; bottom: calc(12px + var(--safe-b)); z-index: 6;
  display: flex; background: var(--bar); border: 1px solid var(--line); border-radius: 26px;
  padding: 6px 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.screen { padding-bottom: calc(88px + var(--safe-b)); }
.screen:has(> .chat) { padding-bottom: 0; }
.chat .composer { padding-bottom: calc(90px + var(--safe-b)); border-top: 0; }
.shell > .me-fixed { position: absolute; display: grid; place-items: center; top: calc(18px + var(--safe-t)); right: 20px; z-index: 6; background: var(--seg-on); color: var(--accent-text); border: 1px solid var(--line); }
.shell > .me-fixed[hidden] { display: none; }
.menu-back { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0); transition: background 0.22s ease; }
.menu-back.open { background: rgba(0, 0, 0, 0.45); }
.menu { position: absolute; top: 0; bottom: 0; left: 0; width: min(82vw, 340px); display: flex; flex-direction: column; background: var(--bg); color: var(--text); box-shadow: 12px 0 40px rgba(0, 0, 0, 0.4); transform: translateX(-104%); transition: transform 0.22s ease-out; padding: calc(22px + var(--safe-t)) 0 calc(16px + var(--safe-b)); }
.menu-back.open .menu { transform: none; }
.menu-head { display: flex; align-items: center; gap: 14px; padding: 6px 20px 18px; border-bottom: 1px solid var(--line); }
.menu .me-big { width: 48px; height: 48px; font-size: 19px; display: grid; place-items: center; border: 0; background: var(--twin); color: #fff; }
.menu-who { display: flex; flex-direction: column; min-width: 0; }
.menu-who strong { font-size: 17px; }
.menu-who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-list { flex: 1; overflow-y: auto; padding: 10px 8px; }
.menu-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 14px; border: 0; border-radius: 12px; background: none; color: var(--text); font-size: 16px; font-weight: 500; text-align: left; }
.menu-item:active { background: var(--surface-2); }
.menu-item .icon { color: var(--accent-text); flex: none; }
.menu-item.danger, .menu-item.danger .icon { color: var(--alert); }
.menu-rule { border: 0; border-top: 1px solid var(--line); margin: 8px 14px; }
/* Appearance in the menu: Auto, Light, Dark */
.segmented.menu-theme { margin: 14px 20px 6px; }
.segmented.menu-theme .seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0; font-size: 14px; }
.segmented.menu-theme .seg .icon { flex: none; }
.menu-foot { text-align: center; color: var(--faint); font-size: 12px; margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .menu, .menu-back { transition: none; } }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 2px; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.tab.tab-extra { display: none; }
.tab[aria-current="page"] { color: var(--accent-text); font-weight: 600; }

/* Pages */
/* One gutter everywhere: titles, labels and cards share the same left edge (20px, as on Home). */
.page { padding: calc(18px + var(--safe-t)) 20px 28px; max-width: 640px; margin: 0 auto; width: 100%; }
/* A short screen sits in the middle of the view instead of bunching at the top; a long one scrolls as usual. */
.page:not(.home) { display: flex; flex-direction: column; min-height: 100%; box-sizing: border-box; }
.page:not(.home):not(.sub):not(.top)::before, .page:not(.home):not(.sub):not(.top)::after { content: ""; flex: 1 0 0; }
.page:not(.home) > * { flex: none; }
/* Spacing scale, used on every screen: back row 44px; title; title to subtitle 4px; subtitle (or title) to first
   content 24px; label to card 12px; card to card 20px; footnote 16px above. */
.page-title { font-size: 35px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.page-sub { color: var(--muted); font-size: 16px; line-height: 1.4; margin: 4px 0 24px; }
.page-title + :not(.page-sub) { margin-top: 24px; }
.back { display: grid; place-items: center; width: 44px; height: 44px; background: none; border: 0; padding: 0; color: var(--text); margin: 0 0 4px -12px; }
/* Sub-screens start a little lower than the tabs so the header clears the status bar. */
.page.sub, .page.top { padding-top: calc(28px + var(--safe-t)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-shadow); }
.note { padding: 16px 18px; }
.note p { margin: 0; }
.note p + p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.group { margin-bottom: 20px; }
.group:last-child { margin-bottom: 0; }
.group-label { color: var(--muted); font-size: 15px; font-weight: 500; margin: 0 0 12px; }
.group + .group .group-label, .card + .group .group-label { margin-top: 4px; }
/* A footnote or footer directly after a group keeps its own 16/24/40 distance; the group adds nothing. */
.group:has(+ .foot-note), .group:has(+ .more-foot), .group:has(+ .about-foot), .group:has(+ .text-btn), .card:has(+ .foot-note) { margin-bottom: 0; }
.list + .group-label, .note + .group-label { margin-top: 22px; }
.list { overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 74px; padding: 14px 16px;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; color: var(--text);
}
.row:first-child { border-top: 0; }
.row-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent-text); flex: none; }
.row-icon.photo { overflow: hidden; }
.row-icon.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; }
.row-detail { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.row-chevron, .row-value { color: var(--faint); }
.row.danger .row-title, .row.danger .row-icon { color: var(--alert); }
.prose p { color: var(--text); font-size: 16px; line-height: 1.5; margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
/* Reading text is flush on both sides; hyphenation avoids wide word gaps on short lines. */
.foot-note { color: var(--muted); font-size: 13px; line-height: 1.4; text-align: center; margin: 16px 0 0; }
.prose p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }
.consent-point p { text-wrap: pretty; }
.sn { display: inline-block; }
.sheet-head strong { font-size: 20px; }
.sheet-head .text-btn { font-size: 16px; }
.arrange { touch-action: none; user-select: none; }
.arrange .list { margin-bottom: 24px; }
.grip { color: var(--muted); padding: 8px; margin-right: -8px; cursor: grab; touch-action: none; }
.arrange-row.dragging { background: var(--surface-2); }
.about-foot { text-align: center; margin-top: 40px; }
.about-foot .nameplate { font-size: 18px; color: var(--text); }
.about-foot p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.more-foot { text-align: center; color: var(--faint); font-size: 12px; margin: 24px 0 0; }

/* Avatar: the Twin glyph in a white circle with the Twin gradient ring, green dot when active */
.avatar { position: relative; flex: none; border-radius: 50%; padding: 2px; background: var(--twin); }
.avatar-inner { border-radius: 50%; background: #fff; display: grid; place-items: center; }
.avatar-glyph { width: 42%; height: auto; }
.avatar-md .avatar-inner { width: 46px; height: 46px; }
.avatar-xs .avatar-inner { width: 26px; height: 26px; }
.avatar-xs { padding: 1.5px; }
.online-dot { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--live); border: 2px solid var(--bg); }

/* Shared bits */
.eyebrow { display: block; color: var(--muted); font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.icon-btn { background: none; border: 0; padding: 6px; color: var(--muted); display: grid; place-items: center; border-radius: 50%; }
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); max-width: calc(100% - 40px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); z-index: 30; animation: rise 0.2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end; z-index: 25; }
.sheet { width: 100%; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + var(--safe-b)); animation: up 0.22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { transform: translateY(10px); opacity: 0; } }
.sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--faint); margin: 0 auto 14px; }
.sheet-agent { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet .btn-secondary { margin-top: 14px; }
.sheet .btn-primary + .btn-secondary { margin-top: 10px; }
.btn-primary.danger { background: var(--alert); }
.sheet-title { font-size: 20px; font-weight: 700; margin: 2px 0 6px; }
.sheet-text { color: var(--muted); margin: 0 0 16px; }
.badge { position: absolute; top: -5px; right: -9px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--alert); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bar); box-sizing: content-box; }
.tab-icon { position: relative; display: inline-flex; }

/* Home: the Twin gradient band at the top, cards below */
.page.home { padding: 0 0 28px; max-width: none; }
.home-band { position: relative; overflow: hidden; background: var(--band, linear-gradient(180deg, #17b3ec 0%, #1f7fd0 45%, #2a3fb0 100%)); color: #fff; border-radius: 0 0 32px 32px; padding: calc(16px + var(--safe-t)) 20px 28px; }
.home-band::before { content: ""; position: absolute; left: -40px; top: 64px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%); pointer-events: none; }
.home-band > * { position: relative; }
.home-band > * { position: relative; }
.band-mark { position: absolute; right: -40px; bottom: -60px; width: 190px; height: auto; opacity: 0.12; pointer-events: none; }
.home-head { display: flex; justify-content: space-between; align-items: center; min-height: 52px; margin-bottom: 30px; }
.home-head .nameplate { font-size: 20px; }
.home-head-right { display: flex; align-items: center; gap: 10px; }
.agent-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 170px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 13px; font-weight: 600; }
.pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); flex: none; }
.pill-dot.on { background: #7df3b0; box-shadow: 0 0 10px rgba(125, 243, 176, 0.8); }
.head-name { font-weight: 700; font-size: 19px; }
.head-status { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.head-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-switch { border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.head-switch .head-name svg { color: var(--muted); flex: none; }
.head-vault { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.head-vault.on { color: var(--text); }
.me { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; font-size: 14px; flex: none; }
.band-sub { font-size: 15px; font-weight: 500; opacity: 0.85; margin: 0; }
.greeting { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 6px 0 10px; }
.band-meta { font-size: 13px; color: rgba(255, 255, 255, 0.72); margin: 0; }
.home-body { padding: 24px 20px 0; max-width: 640px; margin: 0 auto; }
.home-body .eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
.upnext { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; margin: 0 0 22px; background: var(--surface); border-radius: 20px; }
.upnext-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.upnext-text strong { font-size: 19px; }
.upnext-text .muted { font-size: 15px; color: var(--muted); }
.pill-btn { flex: none; background: var(--twin); color: #fff; border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 600; font-size: 15px; text-decoration: none; }
.feed { display: flex; flex-direction: column; }
.feed-item { padding: 16px 0 14px; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: 0; padding-top: 4px; }
.feed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.feed-name { font-weight: 700; font-size: 17px; }
.feed-time { color: var(--muted); font-size: 15px; }
.feed-text { font-size: 19px; line-height: 1.4; margin: 0; }
.feed-empty { margin-top: 8px; }

/* Usage */
.segmented { display: flex; background: var(--seg); border-radius: 14px; padding: 4px; gap: 4px; margin: 0 0 20px; }
.seg { flex: 1; border: 1px solid transparent; border-radius: 11px; padding: 11px 0; background: none; color: var(--muted); font-weight: 600; font-size: 16px; }
.seg.on { background: var(--seg-on); color: var(--text); border-color: rgba(143, 184, 212, 0.45); }
.spent { padding: 20px 22px 18px; }
.big-number { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 2px 0 6px; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; }
.delta { font-size: 14px; font-weight: 700; }
.delta.good { color: var(--live); }
.delta.bad { color: var(--attention); }
.delta .muted { font-weight: 500; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; }
.stat strong { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.model { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 0; }
.model .row-title { font-size: 18px; }
.model-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--twin); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.text-btn.plain { color: var(--text); }
.center { text-align: center; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

/* Skills and Apps */
.tone-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.tone-icon.orange { background: #fe9309; }
.tone-icon.blue { background: #4d78a0; }
.tone-icon.plum { background: #6f0875; }
.tone-icon.sky { background: #3b8fe8; }
.tone-icon.green { background: #17a65c; }
/* The on/off switch, Twin's own: a rounded square track, a square knob, the Twin gradient and a tick when on. */
.switch { position: relative; width: 52px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); padding: 0; flex: none; transition: background 0.15s, border-color 0.15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 6px; background: #fff no-repeat center / 14px; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.switch.on { background: linear-gradient(135deg, #0c9dd8, #2a3fb0); border-color: transparent; }
.switch.on::after { transform: translateX(22px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7fd0' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.letter { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text); display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none; }
.status { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 8px; font-size: 14px; font-weight: 700; border: 1px solid transparent; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.live { color: var(--live); background: var(--live-bg); border-color: rgba(49, 227, 143, 0.35); }
.status.fix { color: var(--attention); background: var(--attention-bg); border-color: rgba(254, 147, 9, 0.4); }
.row .row-title { font-size: 18px; line-height: 1.22; }
.row-detail { line-height: 1.3; margin-top: 1px; }

/* Chat */
.chat { height: 100%; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
/* Right padding leaves room for the fixed avatar (20px in, 40px wide) so the info button sits left of it. */
.chat-head { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) 68px 10px 18px; }
.head-text { flex: 1; min-width: 0; }
.banner { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 16px 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.thread > :first-child { margin-top: auto; }
.day { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: 10px 0 6px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.msg.user { align-self: flex-end; }
.msg.assistant .avatar { margin-bottom: 20px; }
.chat-head .avatar-md .avatar-inner { width: 42px; height: 42px; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg.user .msg-col { align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.msg.assistant .bubble { background: var(--bubble); border: 1px solid var(--line); }
.msg.user .bubble { background: var(--twin); color: #fff; white-space: pre-wrap; box-shadow: 0 8px 20px rgba(42, 63, 176, 0.22); }
.time { color: var(--muted); font-size: 12px; margin: 4px 6px 4px; }
.msg.failed .bubble { opacity: 0.55; }
/* Website chat transcripts (sites.ts): the same bubbles, read only, the chatbot on the right. */
.site-thread { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.site-thread .day { align-self: center; }
.site-thread .msg.assistant .bubble { white-space: pre-wrap; }
.msg-note { color: var(--muted); font-size: 13px; margin: 0 4px 6px; text-align: right; max-width: 300px; }
.bubble p:last-child, .bubble ul:last-child, .bubble ol:last-child, .bubble pre:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 8px; padding-left: 20px; }
.bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: rgba(127, 140, 170, 0.18); padding: 1px 5px; border-radius: 6px; }
.bubble pre { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); overflow-x: auto; }
.bubble pre code { background: none; padding: 0; }
.md-heading { font-weight: 700; }
.typing { display: flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.composer { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 10px 10px 12px; border-top: 1px solid var(--line); }
.icon-btn.side { width: 40px; height: 44px; flex: none; }
.composer-field { flex: 1; min-width: 0; display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px; }
.composer textarea { flex: 1; min-width: 0; width: 100%; resize: none; border: 0; background: none; outline: none; padding: 11px 16px; max-height: 140px; line-height: 1.35; }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--twin); display: grid; place-items: center; }
.send-arrow { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 11px solid #fff; margin-top: -2px; }

/* Loading */
.loading { height: 100%; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Light mode details from the mockups: solid agent avatars, blue-tinted highlight cards */
@media (prefers-color-scheme: light) {
  .bar { background: #c6d5e8; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Phase 3b: skill list with search */
.search { width: 100%; padding: 11px 14px; margin: 0 0 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 16px; outline: none; }
.search:focus { border-color: var(--accent); }
.skill-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 22px; flex: none; color: var(--accent-text); font-weight: 700; }
.row.dim .row-title { color: var(--muted); }
.row.dim .skill-icon { opacity: 0.55; }
.big-empty { font-size: 24px; font-weight: 700; color: var(--muted); margin: 8px 0 6px; }

/* Skills, grouped: each group is a card that opens with a tap. Each group has its own warm
   gradient taken from the Twin palette, softened for a dark screen; its skills share it. */
.skill-groups { margin-top: 0; }
.skill-add { margin-top: 0; margin-bottom: 14px; }
.find-topics { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 14px; padding: 0 20px 2px; scrollbar-width: none; }
.find-topics::-webkit-scrollbar { display: none; }
.find-topic { flex: none; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.find-topic.on { background: var(--seg-on); border-color: var(--accent); color: var(--accent-text); }
.skill-group { border-top: 1px solid var(--line); }
.skill-group:first-child { border-top: 0; }
.skill-group-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: none; border: 0; color: var(--text); text-align: left; font: inherit; }
.skill-group-head .row-title { font-size: 18px; }
.skill-group-head .row-detail { font-size: 14px; }
.skill-count { color: var(--text); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.skill-chev { color: var(--faint); display: grid; transition: transform 0.18s; }
.skill-group.open .skill-chev, .skill-group.searching .skill-chev { transform: rotate(90deg); }
.skill-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.skill-rows { border-top: 1px solid var(--line); }
.row.skill .row-title { font-size: 16px; }
.row.skill .row-detail { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-icon[class*="tone-"] { border: 0; color: #fff; }
.tone-everyday { background: linear-gradient(135deg, #fe9309, #df4a2e); }
.tone-work { background: linear-gradient(135deg, #2fa6dc, #3e5bc4); }
.tone-create { background: linear-gradient(135deg, #e0366a, #8a1b8f); }
.tone-home { background: linear-gradient(135deg, #22b573, #1a8fb8); }
.tone-build { background: linear-gradient(135deg, #5b7fd6, #6b3fb0); }
.tone-system { background: linear-gradient(135deg, #8e74c8, #4d5aa8); }
.tone-other { background: linear-gradient(135deg, #5d8fc0, #8e74c8); }
.tone-na { background: linear-gradient(135deg, #3a4360, #2a3150); color: var(--muted); }
.tone-twin { background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }

/* Account and AI consent */
.field { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 16px; outline: none; }
.field:focus { border-color: var(--accent); }
.field-card { padding: 14px; }
.sheet .field { margin-bottom: 4px; }
.consent-page { padding-top: calc(28px + var(--safe-t)); padding-bottom: calc(12px + var(--safe-b)); }
.page.consent-page > .consent-card { padding: 2px 18px; margin: 16px 0 8px; }
.consent-point { padding: 10px 0; border-top: 1px solid var(--line); }
.consent-page .page-sub { margin-bottom: 16px; }
.consent-page > .consent-card { margin-top: 0; }
.consent-point:first-child { border-top: 0; }
.consent-point strong { display: block; font-size: 15px; margin-bottom: 2px; }
.consent-point p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.consent-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.consent-foot .btn-primary { width: 100%; margin: 8px 0 4px; }

/* Model picker */
.sheet-tall { max-height: 86dvh; display: flex; flex-direction: column; }
.sheet-scroll { overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.sheet-scroll .group-label { margin: 10px 4px 10px; }
.sheet-scroll .group-label:first-child { margin-top: 0; }
.sheet-scroll .card { background: var(--surface); }
.model-row { min-height: 64px; }
.group.settings { margin: 20px 0 0; }
/* Daily brief card on Home. */
.brief { padding: 16px 18px 14px; margin: 0 0 22px; }
.brief-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.brief-head .eyebrow { margin: 0; color: var(--accent-text); }
.brief.evening .brief-head .eyebrow { color: #c9a7ff; }
.brief-time { color: var(--faint); font-size: 13px; }
.brief-title { font-size: 18px; font-weight: 700; margin: 0 0 12px; line-height: 1.25; }
.brief-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.brief-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.brief-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.brief-text { display: flex; flex-direction: column; min-width: 0; }
.brief-text b { font-weight: 600; }
.brief-text small { color: var(--muted); font-size: 13px; margin-top: 1px; }
.brief-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.brief-foot .text-btn { padding: 0; }
.brief-foot .muted { color: var(--faint); font-size: 13px; text-align: right; }
.settings .row-value { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--muted); flex: none; }
.model-row.current .row-title { color: var(--accent-text); }
.model-avatar.small { width: 38px; height: 38px; font-size: 15px; background: var(--twin); }
.check { color: var(--accent-text); display: grid; }

/* Home overview */
.home-body .group-label { margin: 0 0 12px; }
.home-body .upnext + .group-label { margin-top: 2px; }
.home-body .two { margin: 0 0 24px; }
.home-body .row-icon { color: var(--accent-text); }
.spent { padding: 22px; }
.spent .delta, .spent .muted.small { display: inline-block; margin-top: 2px; }

/* A screen coming in on a tab change fades and rises a touch; nothing on the way out, so taps stay instant. */

/* Markets */
.mk { display: flex; align-items: center; gap: 14px; padding: 13px 18px; }
.mk + .mk { border-top: 1px solid var(--line); }
.mk.mini { padding: 11px 16px; }
.coin { width: 38px; height: 38px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-2); }
.coin-text { display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--twin); }
.mk.mini .coin { width: 32px; height: 32px; }
.mk-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk-name b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-name span { color: var(--muted); font-size: 13px; }
.spark { width: 68px; height: 28px; flex: none; }
.spark polyline { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke: var(--muted); }
.spark.up polyline { stroke: var(--live); }
.spark.dn polyline { stroke: var(--alert); }
.mk-px { text-align: right; min-width: 84px; display: flex; flex-direction: column; align-items: flex-end; }
.mk-px b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chg { display: inline-block; margin-top: 3px; padding: 2px 7px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.chg.up { color: var(--live); background: var(--live-bg); }
.chg.dn { color: var(--alert); background: rgba(255, 92, 122, 0.14); }
.mk-empty { color: var(--muted); padding: 16px 18px; margin: 0; }
.mk-label { display: flex; align-items: center; justify-content: space-between; }
/* Coin detail: tappable rows in the list, a price header, the line, a range picker and figures. */
button.mk-btn { width: 100%; border: 0; background: none; color: var(--text); text-align: left; font: inherit; }
.coin-head { padding: 18px 20px 16px; margin-bottom: 14px; }
.coin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.coin-top .coin { width: 46px; height: 46px; }
.coin-price { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.coin-move { margin-top: 6px; }
.coin-move .chg { font-size: 13px; padding: 4px 9px; }
.coin-chart { position: relative; height: 170px; margin: 0 -4px 12px; display: grid; place-items: center; }
.coin-chart .spinner { animation: spin 0.8s linear infinite, spinner-late 0.45s step-end both; }
.coin-chart .mk-empty { padding: 0; }
.chart { width: 100%; height: 100%; display: block; }
.chart-line { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-area { fill: var(--surface-2); }
.chart.up .chart-line { stroke: var(--live); }
.chart.up .chart-area { fill: var(--live-bg); }
.chart.dn .chart-line { stroke: var(--alert); }
.chart.dn .chart-area { fill: rgba(255, 92, 122, 0.14); }
.segmented.ranges { margin-bottom: 22px; }
.segmented.ranges .seg { padding: 9px 0; font-size: 15px; }
.stat-row { min-height: 54px; padding: 10px 18px; }
.stat-row .row-detail { font-size: 15px; }
.stat-val { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.mk-label .text-btn { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--accent-text); padding: 0; }
.home-body .mk-group { margin-top: 24px; }
.home-body .mk-group[hidden] { display: none; }

/* Vault */
.vault-storage { padding: 16px 18px; margin-bottom: 20px; }
.vault-storage-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.vault-storage-row b { font-size: 17px; }
.vault-bar { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 10px; }
.vault-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--sky), var(--indigo)); }
.vault-storage p { margin: 0; }
.vault-search { margin-bottom: 20px; }
.vault-results .group:last-child { margin-bottom: 0; }
.vault-results + .text-btn { margin-top: 24px; }
.vault-empty { margin: 8px 0 0; }
.ext-tile { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.ext-tile.doc { color: var(--accent-text); }
.ext-tile.sheet { color: #35b37e; }
.ext-tile.image { color: #d66aa3; }
.ext-tile.media { color: #9b7bea; }
.ext-tile.other { color: var(--muted); }
.vault-file .row-title { word-break: break-word; }
.field.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.field-card .form-error:empty { display: none; }

/* Agent line in the menu head */
.menu-agent { border-bottom: 1px solid var(--line); padding: 4px 0 8px; }
.menu-agent-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 20px; border: 0; background: none; color: var(--text); text-align: left; }
.menu-agent-add { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 20px; border: 0; background: none; color: var(--accent-text); font-size: 15px; font-weight: 600; text-align: left; }
.menu-agent-plus { width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.menu-agent-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.menu-agent-dot.on { background: #35b37e; }
.menu-agent-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.menu-agent-text strong { font-size: 15px; }
.menu-agent .eyebrow { font-size: 12px; margin-bottom: 0; }
.menu-agent-row .row-chevron { color: var(--muted); }
.sheet .field { margin-bottom: 10px; }

/* Wide screens: unfolded foldables, tablets, laptops. The bottom bar becomes a rail on the left,
   the content keeps a readable column in the middle, and sheets open as centred dialogs. */
@media (min-width: 700px) {
  .shell { flex-direction: row; }
  .tabbar {
    order: -1; position: static; flex: none; width: 92px; align-self: stretch;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: calc(22px + var(--safe-t)) 8px calc(16px + var(--safe-b));
    border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none;
    background: var(--bar); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tab { flex: none; padding: 11px 0 9px; border-radius: 14px; }
  .tab.tab-extra { display: flex; }
  .menu-item.menu-extra { display: none; }
  .tab[aria-current="page"] { background: var(--surface-2); }
  .screen { padding-bottom: 32px; }
  .screen:has(> .chat) { padding-bottom: 0; }
  .chat { max-width: 880px; }
  .chat .composer { padding-bottom: 18px; }
  .msg { max-width: 72%; }
  .page, .home-body { max-width: 720px; }
  .home-band { border-radius: 0 0 36px 36px; }
  .home-band > * { max-width: 720px; margin-left: auto; margin-right: auto; }
  .toast { bottom: 36px; }
  .sheet-back { align-items: center; justify-content: center; padding: 24px; }
  .sheet { max-width: 460px; border-radius: 22px; padding: 22px 24px 22px; animation: fade 0.18s ease-out; }
  .sheet-grab { display: none; }
  .menu { width: 360px; }
}
/* Pointer devices: a quiet hover on things that can be pressed. Colours are the existing surfaces. */
@media (hover: hover) and (pointer: fine) {
  .tab:hover, .menu-item:hover, button.row:hover { background: var(--surface-2); }
  .tab { transition: background 0.12s ease; }
}

/* Admin tag, Account and payments, Add agent, Building (p44) */
.menu-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; color: var(--accent-text); background: var(--surface-2); border: 1px solid var(--line); }
.status.off { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.plans-slot:empty { display: none; }
.plan-box { padding: 18px 18px 8px; margin: 0 0 18px; }
.plan-box .eyebrow { margin: 0 0 6px; color: var(--accent-text); }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-price span { color: var(--muted); font-size: 15px; }
.plan-sub { color: var(--muted); font-size: 15px; margin: 2px 0 10px; }
.plan-box .kv { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.plan-box .kv span:last-child { color: var(--muted); }
.foot-note.stack .sn { display: block; }
.foot-note.stack .sn + .sn { margin-top: 4px; }
.build-card { padding: 6px 18px; }
.build-list { list-style: none; margin: 0; padding: 0; }
.build-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.build-step:first-child { border-top: 0; }
.build-dot { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px solid var(--line); color: #fff; margin-top: 1px; }
.build-step.done .build-dot { background: var(--accent); border-color: var(--accent); }
.build-step:not(.done) .row-title { color: var(--muted); }
.plans-slot .group:last-child { margin-bottom: 20px; }
.foot-note.stack.left { text-align: left; margin: 10px 4px 0; }
.field.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row.choice { padding-left: 0; padding-right: 0; }
.field-card .row.choice + .field { margin-top: 10px; }
.tick-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; flex: none; }
.tick-box.on { background: var(--accent); border-color: var(--accent); }
.slot > .group:last-child { margin-bottom: 20px; }
.group .segmented { margin-bottom: 0; }
.segmented.providers .seg { font-size: 15px; padding-left: 0; padding-right: 0; }

/* Onboarding (p46): trial, agent setup, Twin Vault, welcome */
.page.ob { padding-top: calc(52px + var(--safe-t)); }
.ob-steps { display: flex; gap: 6px; margin: 0 0 22px; }
.ob-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); }
.ob-steps span.on { background: var(--accent); }
.ob-label { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.ob .btn-primary { width: 100%; margin-top: 18px; }
.ob .text-btn.block, .welcome .text-btn.block { width: 100%; text-align: center; margin-top: 10px; }
.card.perks { padding: 4px 16px; margin-bottom: 20px; }
.perk { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.perk:first-child { border-top: 0; }
.perk-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent-text); flex: none; }
.perk b { display: block; font-size: 15px; font-weight: 600; }
.perk small { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }
.perk small .sn { display: block; }
.tut-card { padding: 16px 18px; }
.tut { padding-left: 20px; margin: 0; }
.tut li { margin: 0 0 12px; line-height: 1.4; }
.tut li:last-child { margin-bottom: 0; }
.tut li::marker { color: var(--accent-text); font-weight: 700; }
.tut li b { display: block; }
.tut li small { color: var(--muted); font-size: 14px; }
.link-btn { display: grid; place-items: center; text-decoration: none; color: #fff; }
.page.welcome { text-align: center; padding-top: calc(56px + var(--safe-t)); }
.welcome-mark { width: 72px; height: 72px; margin: 0 auto 18px; display: block; }
.welcome .page-title { font-size: 30px; }
.welcome .page-sub { margin-left: auto; margin-right: auto; max-width: 320px; }
.welcome .card { text-align: left; }
.welcome .btn-primary { width: 100%; margin-top: 22px; }

/* Brief times: any time of day (p47) */
.custom-time { margin: 16px 0 0; }
.time-card { display: flex; gap: 10px; align-items: center; }
.time-card .time-field { flex: 1; min-width: 0; height: 52px; box-sizing: border-box; margin: 0; font-variant-numeric: tabular-nums; color-scheme: dark; }
.time-card .time-save, .time-card.field-card .time-field + .time-save { width: auto; flex: none; padding: 0 22px; margin: 0; height: 52px; box-sizing: border-box; align-self: center; border-radius: 14px; }
@media (prefers-color-scheme: light) { .time-card .time-field { color-scheme: light; } }

/* Admin (p48) */
.row-trail { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.admin-actions { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 24px; }
.admin-actions .btn-primary, .admin-actions .btn-secondary { width: 100%; }
.btn-secondary.danger-text { color: var(--alert); }
.admin-gap { height: 14px; }
.field-card .field + .btn-primary { width: 100%; margin-top: 12px; }
.admin .row-title, .admin .page-title { overflow-wrap: normal; word-break: normal; }
.support-head { padding-left: 6px; }
.support-head .back { margin: 0; flex: none; }
.support-head .text-btn { margin-left: auto; flex: none; }
.who { flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.who-xs { width: 30px; height: 30px; font-size: 13px; }
.who-md { width: 46px; height: 46px; font-size: 18px; }
.support-head .head-text { min-width: 0; }
.chat.support .bubble.plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.menu-item .menu-badge { margin-left: auto; }

/* Announcement on Home (Admin > App settings) */
.notice .upnext-text strong { font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.notice .pill-btn { flex: none; border: 0; cursor: pointer; }
.role-text { margin: 10px 0 0; font-size: 14px; }

/* Chat attachments: cards in bubbles and the tray above the message box */
.file-card { display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 10px 12px; margin-bottom: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; font: inherit; }
button.file-card { cursor: pointer; }
.file-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.file-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 13px; color: var(--muted); }
.tray { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 10px 0; border-top: 1px solid var(--line); }
.tray + .composer { border-top: 0; }
.tray-item { display: flex; align-items: center; gap: 8px; flex: none; width: 230px; padding: 8px 6px 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tray-track { display: block; height: 3px; margin-top: 5px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tray-bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.tray-item.ready .tray-track, .tray-item.failed .tray-track { display: none; }
.tray-item.failed .file-meta { color: var(--alert); white-space: normal; }
.tray-x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.attach-grid { display: flex; justify-content: space-around; gap: 12px; margin: 6px 0 4px; }
.attach-tile { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.attach-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text); display: grid; place-items: center; }
.attach-tile:active .attach-ic { background: var(--line); }

/* Admin > Alerts */
.alerts .alert-item { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.alerts .alert-item:last-child { border-bottom: 0; }
.alert-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.alert-source { font-weight: 600; font-size: 15px; }
.alert-item.unread .alert-source::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.alert-meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.alert-text { margin: 4px 0 0; font-size: 14px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.push-row .row-text { flex: 1; }
.push-row .row-detail { white-space: normal; }
.push-actions { display: flex; justify-content: space-between; padding: 4px 16px 12px; }

/* Chat history: earlier messages, the search button, and the Chat history screen. */
.earlier-row { display: flex; justify-content: center; padding: 6px 0 2px; }
.earlier-row .day { margin: 0; }
.text-btn.earlier { font-size: 14px; }
.head-search { flex: none; color: var(--muted); }
.hist-body { display: flex; flex-direction: column; gap: 12px; }
.hist-empty { padding: 28px 12px; }
.hist-hit { align-items: flex-start; cursor: pointer; }
.hist-hit .row-text { gap: 4px; }
.hist-text { margin: 0; color: var(--text); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.hist-text mark { background: rgba(125, 200, 255, 0.28); color: inherit; border-radius: 3px; padding: 0 1px; }
.hist-full { max-width: 100%; overflow-wrap: anywhere; color: var(--text); font-size: 15px; line-height: 1.5; }
.hist-full p { margin: 0 0 8px; }
.hist-full p:last-child { margin-bottom: 0; }
.hist-link, .hist-link:visited { text-decoration: none; color: inherit; }
.hist-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hist-link .row-text { min-width: 0; }
.hist-files { display: flex; flex-direction: column; gap: 10px; }
.hist-file { display: flex; flex-direction: column; gap: 4px; }
.hist-file .file-card { max-width: none; }

/* Configurable Home: every card keeps the same gap whatever the order. */
.home-body > .home-card, .home-body > .group { margin: 0 0 24px; }
.home-body > .home-card .two { margin-bottom: 0; }
.home-body .mk-group { margin-top: 0; }
.vault-home { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.vault-home .vault-bar { margin: 0; }
.vault-home-off { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.vault-home-off p { margin: 0; }
.vault-home-off .pill-btn { flex: none; border: 0; cursor: pointer; }
.vault-home-label { margin: 6px 0 0; color: var(--muted); }
.vault-home-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); padding: 4px 0; text-align: left; font: inherit; cursor: pointer; }
.vault-home-item svg { color: var(--accent-text); flex: none; }
.vault-home-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.text-btn.home-customize { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px auto 28px; padding: 10px 14px; color: var(--muted); }
.text-btn.home-customize svg { flex: none; }
.home-order .arrange-row .switch { margin-left: auto; }
.home-order .arrange-row.off .row-title { color: var(--muted); }
.vault-home .vault-storage-row { margin: 0; flex-wrap: wrap; }

/* Vault file viewer and recently changed files. */
.viewer-body { display: flex; justify-content: center; margin: 0 0 18px; }
.viewer-loading { padding: 60px 0; }
.viewer-image { display: block; max-width: 100%; max-height: 70vh; border-radius: 16px; background: var(--surface); object-fit: contain; }
.viewer-video { display: block; width: 100%; max-height: 70vh; border-radius: 16px; background: #000; }
.viewer-audio { width: 100%; }
.viewer-text { width: 100%; max-height: 65vh; overflow: auto; margin: 0; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-pdf { width: 100%; height: 70vh; border: 0; border-radius: 16px; background: #fff; }
.viewer-html { width: 100%; height: 72vh; border: 0; border-radius: 16px; background: #fff; display: block; }
.viewer-none { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 28px 20px; }
.viewer-none p { margin: 0; }
.btn-primary.viewer-save { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.vault-recent[hidden] { display: none; }

/* Private label: an uploaded logo in place of the Twin mark, and the Branding screen in Admin. */
.nameplate-logo { height: 1.6em; width: auto; max-width: 9em; object-fit: contain; }
.brand-colours { display: flex; gap: 12px; }
.brand-colour { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.brand-colour input[type=color] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; flex: none; }
.brand-colour span { font-size: 15px; }
.brand-preview { border-radius: 20px; padding: 18px 18px 20px; color: #fff; background: var(--band, linear-gradient(180deg, #17b3ec 0%, #1f7fd0 45%, #2a3fb0 100%)); margin: 0 0 20px; }
.brand-preview .nameplate { font-size: 20px; }
.brand-preview p { margin: 14px 0 0; font-size: 22px; font-weight: 700; }
.brand-logo-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.brand-logo-box { width: 64px; height: 64px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; flex: none; overflow: hidden; }
.brand-logo-box img { max-width: 56px; max-height: 56px; object-fit: contain; }
.brand-logo-row .row-text { flex: 1; }
.nameplate-logo.on-light { background: var(--twin); border-radius: 10px; padding: 4px; box-sizing: content-box; height: 1.3em; }
.avatar-inner.branded { background: var(--twin); }
.avatar-initial { color: #fff; font-weight: 700; font-size: 15px; }
.avatar-md .avatar-initial { font-size: 19px; }
.splash-icon.branded, .welcome-mark.branded { object-fit: contain; background: var(--twin); padding: 12px; box-sizing: border-box; border-radius: 18px; }

/* Vault consent line, above Agree and connect. */
.consent-note { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 12px 2px 10px; }
.notice-detail { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 400; }

/* Vault dashboard: totals, activity rows and who-did-it tags. */
.vault-totals { margin: 0 0 16px; }
.stat-sub { color: var(--muted); font-size: 14px; font-weight: 500; margin-top: 2px; }
.act-seg, .group .act-seg { margin: 0 0 14px; }
.act-seg .seg { padding: 8px 0; font-size: 15px; }
.act-icon { color: var(--muted); }
.act-icon.ai { color: var(--accent-text); }
.vault-act { cursor: default; }
.who-tag { flex: none; padding: 3px 9px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.who-tag.ai { color: var(--accent-text); background: var(--seg-on); border-color: rgba(143, 184, 212, 0.45); }

/* Add a skill: ClawHub's numbers, security audit and facts, inside the skill sheet. */
.skill-info { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 12px; }
.skill-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skill-stat, .skill-audit, .skill-facts { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.skill-stat .eyebrow, .skill-audit .eyebrow, .skill-fact .eyebrow { font-size: 13px; margin: 0; }
.skill-stat strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.skill-audit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.skill-audit p { margin: 8px 0 0; }
.skill-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skill-fact b { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.skills-note { margin-top: 18px; }
.sheet.skill-sheet { max-height: 92dvh; overflow-y: auto; }

/* Skills: setting up a skill that needs keys, or asking the Twin team. */
.row.skill.fixable { width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.row.skill.fixable .skill-count { color: var(--accent-text); }
.setup-label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.skill-sheet .field + .text-btn, .skill-sheet .field + .muted { margin-top: 10px; }
.skill-sheet .form-error:empty { display: none; }

/* Reporting an agent reply: a quiet link beside the time, then a sheet of reasons. */
.msg-report { display: inline-flex; align-items: center; gap: 3px; margin-left: 10px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; opacity: 0.75; }
.msg-report:hover, .msg-report:focus-visible { opacity: 1; color: var(--text); }
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.report-reason { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.report-reason[aria-pressed="true"] { background: var(--seg-on); border-color: var(--accent); color: var(--accent-text); }
.report-note { resize: vertical; min-height: 64px; margin-bottom: 8px; }

/* Pictures: the account's photo on the round "me" buttons, and the agent's picture in its avatar. */
.me.has-photo { padding: 0; overflow: hidden; }
.me-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-inner.photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.me.me-xl { width: 72px; height: 72px; font-size: 28px; flex: none; display: grid; place-items: center; border: 0; background: var(--twin); color: #fff; }
.photo-card { display: flex; align-items: center; gap: 18px; padding: 16px 18px; }
.photo-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-actions .photo-btn { width: auto; margin: 0; padding: 0 18px; height: 44px; }
.photo-preview { display: flex; justify-content: center; margin: 14px 0 6px; }
.photo-preview .avatar-md { transform: scale(1.6); margin: 18px 0; }
.sheet-text.center { text-align: center; }
.photo-group { margin-top: 18px; }

/* Move and zoom: the picked picture under a round frame, then a zoom slider. */
.crop-sheet { text-align: center; }
.crop-stage { display: flex; justify-content: center; margin: 12px 0 14px; }
.crop-canvas { border-radius: 18px; touch-action: none; cursor: grab; background: #fff; outline: none; }
.crop-canvas:active { cursor: grabbing; }
.crop-canvas:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.crop-zoom-row { display: flex; align-items: center; gap: 12px; margin: 0 auto 6px; max-width: 320px; }
.crop-zoom { flex: 1; accent-color: var(--accent); height: 28px; }
.crop-dot { flex: none; border-radius: 50%; border: 2px solid var(--muted); }
.crop-dot.small { width: 10px; height: 10px; }
.crop-dot.large { width: 18px; height: 18px; }
.crop-rotate { margin: 4px auto 10px; display: block; }

/* Locked account (trial over, not paid): a lock on every feature, its switch off, and Subscribe. */
.lock-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 20px 20px; gap: 6px; }
.lock-hero-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--twin); box-shadow: 0 8px 20px rgba(42, 63, 176, 0.25); margin-bottom: 6px; }
.lock-hero-title { font-size: 21px; font-weight: 700; margin: 0; }
.lock-hero-text { color: var(--muted); margin: 0; max-width: 34ch; }
.lock-hero-warn { color: var(--attention); font-weight: 600; font-size: 15px; margin: 4px 0 0; max-width: 34ch; }
.lock-hero .btn-primary { margin-top: 14px; }
.lock-hero .text-btn.block { margin-top: 8px; }
.lock-icon { position: relative; color: var(--muted); }
.lock-badge { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--attention); color: #fff; border: 2px solid var(--bg, #0b1030); }
.locked-row .row-title { color: var(--text); }
.locked-word { color: var(--alert) !important; font-weight: 600; }
.locked-row .switch { pointer-events: none; opacity: 0.7; }
.locked-row .switch::after { content: "OFF"; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--muted); }
.row-value.accent { color: var(--accent-text); font-weight: 600; }
.row .row-value.danger { color: var(--alert); font-weight: 600; }
.build-error { color: var(--alert); }
.plan-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 2px 0 12px; }
.plan-prices .plan-price { flex-direction: column; align-items: flex-start; gap: 0; }
.plan-box .kv.first-pay { font-weight: 600; }
.plan-box .kv.first-pay strong { color: var(--text); font-size: 17px; }
.plan-box .kv.first-pay + .plan-sub { margin: -8px 0 10px; font-size: 14px; }
/* Agreement boxes: unticked by default, the client ticks them themselves. */
.agree-check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; font-size: 14px; line-height: 1.45; color: inherit; text-align: left; cursor: pointer; }
.agree-box { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.agree-check .inline-link { font-size: inherit; padding: 0; }
.consent-foot .agree-check { margin: 4px 0 12px; }
.signin-sheet .agree-check { color: #0b1030; margin: 14px 0 6px; }
.signin-sheet .agree-check .inline-link { color: #1f6fd0; }

.ob-who { margin: 22px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.ob-who .text-btn.inline { display: inline; padding: 0; font-size: 13px; }

/* Sign in: form centred, lockup low centre */
.signin-sheet { padding: calc(24px + var(--safe-t)) 28px calc(22px + var(--safe-b)); }
.signin-center { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.signin-foot { margin-top: 0; padding-top: 24px; gap: 12px; }
.signin-brand .nameplate { font-size: 22px; color: var(--navy); }
.signin-sheet .lead .sn { display: block; }

/* Sidebar on wide screens, in Twin Chat Enterprise's style: navy in both themes, the lockup on top,
   labelled rows with the current one lit, and the person at the foot. Phones keep the bottom bar. */
.rail-brand, .rail-me { display: none; }
@media (min-width: 700px) {
  .tabbar {
    width: 232px; gap: 2px; padding: calc(18px + var(--safe-t)) 12px calc(14px + var(--safe-b));
    border-right: 0; color: #c9d2ec;
    background: radial-gradient(120% 35% at 0% 0%, rgba(12, 157, 216, 0.22), transparent 60%), linear-gradient(180deg, #0f1d4a 0%, #070a18 55%);
  }
  .rail-brand { display: block; padding: 4px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); color: #fff; }
  .rail-brand .nameplate { font-size: 18px; }
  .tabbar .tab { flex-direction: row; justify-content: flex-start; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #c9d2ec; font-size: 14px; font-weight: 500; }
  .tabbar .tab .tab-icon { display: grid; place-items: center; }
  .tabbar .tab svg { width: 19px; height: 19px; }
  .tabbar .tab[aria-current="page"] { background: linear-gradient(90deg, rgba(12, 157, 216, 0.32), rgba(42, 63, 176, 0.12)); box-shadow: inset 3px 0 0 #5cc8f5; color: #fff; }
  .rail-me { display: flex; align-items: center; gap: 10px; margin-top: auto; width: 100%; padding: 10px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; background: none; color: #c9d2ec; font: inherit; text-align: left; cursor: pointer; }
  .rail-me .me { width: 32px; height: 32px; font-size: 13px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #0c9dd8, #2a3fb0); border: 0; color: #fff; }
  .rail-me-text { display: flex; flex-direction: column; min-width: 0; }
  .rail-me-text b { color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-me-text small { color: #7f8bae; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shell > .me-fixed { display: none; }
}
@media (min-width: 700px) and (hover: hover) and (pointer: fine) {
  .tabbar .tab:hover:not([aria-current="page"]), .rail-me:hover { background: rgba(255, 255, 255, 0.05); }
}

/* Wide screens, Enterprise-style content: Home's band becomes a rounded card with the cards in two
   columns under it, Usage puts its figures side by side, and pages use more of the width. The
   sidebar already carries the logo and the person, so Home's band drops its own. Chat is unchanged. */
@media (min-width: 1100px) {
  .page.home { max-width: none; padding: calc(22px + var(--safe-t)) 28px 32px; }
  .home-band { border-radius: 24px; padding: 26px 30px 30px; }
  .home-band > * { max-width: none; margin-left: 0; margin-right: 0; }
  .home-head { min-height: 0; margin-bottom: 14px; justify-content: flex-end; }
  .home-head .nameplate, .home-head .me { display: none; }
  /* Two columns (arranged in tabs.ts): level tops, each card at its own natural size. */
  .home-body { max-width: none; padding: 22px 0 0; }
  .home-body .group-label { line-height: 20px; min-height: 20px; }
  .home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: start; margin-bottom: 8px; }
  .home-col { display: flex; flex-direction: column; min-width: 0; }
  .home-col > * { margin: 0 0 22px !important; }
  .home-col > .col-pad { margin-top: 32px !important; }
  .home-col > :last-child { margin-bottom: 0 !important; }
  .home-col > :last-child:not(.card) > :last-child { margin-bottom: 0 !important; }
  .page:not(.home) { max-width: 880px; }
  .page:has(.card.spent) { max-width: 1040px; }
  div:has(> .card.spent) { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; align-items: start; }
  div:has(> .card.spent) > .segmented, div:has(> .card.spent) > .foot-note { grid-column: 1 / -1; }
  div:has(> .card.spent) > * { margin: 0; }
  div:has(> .card.spent) .group-label { margin-top: 0; }
  div:has(> .card.spent) > .group.settings { grid-column: 1 / -1; }
  div:has(> .card.spent) > .two { height: 100%; }
  .page.vault-page { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; align-items: start; }
  .vault-page > .page-title, .vault-page > .page-sub, .vault-page > .vault-search, .vault-page > .vault-results, .vault-page > .text-btn { grid-column: 1 / -1; }
  .vault-page > .vault-totals { margin-bottom: 20px; }
  /* Every heading the same height, with or without a See all link, so the boxes beside each other start level. */
  .page.vault-page .group-label { height: 22px; line-height: 22px; margin: 0 0 12px; }
  .vault-page .mk-label .text-btn { height: 22px; line-height: 22px; }
  /* Boxes side by side line up at both edges: the storage card matches the totals' height, every
     list shows at most four rows, and each row stays one line high (long names are cut with …).
     The activity filters stay on its See all screen. */
  .vault-page > .vault-storage { align-self: stretch; display: flex; flex-direction: column; justify-content: center; margin-bottom: 20px; }
  .vault-page > .group .card.list > :nth-child(n+5) { display: none; }
  .vault-page > .group .row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vault-page > .vault-activity > .act-seg { display: none; }
}

/* Agent Connect */
.sheet.tall { max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.sheet .group { margin-bottom: 14px; }
.sheet .group .segmented { margin: 0; }
.row-sub { color: var(--muted); font-weight: 500; }
.row .row-value { flex: none; font-size: 14px; color: var(--muted); }
.connect-add .row-title { color: var(--accent-text); }
.connect-add .row-icon { color: var(--accent-text); }
.connect-msg .row-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connect-msg.unread .row-title { color: var(--accent-text); }
.share-code { font-size: 26px; font-weight: 700; letter-spacing: 0.08em; text-align: center; padding: 22px 12px; margin: 4px 0 14px; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.share-code + .card.list { margin-bottom: 14px; }
.code-field { letter-spacing: 0.06em; font-weight: 600; text-transform: uppercase; }
.connect-thread { max-height: 42dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.relay { max-width: 86%; display: flex; flex-direction: column; gap: 3px; }
.relay.in { align-self: flex-start; }
.relay.out { align-self: flex-end; align-items: flex-end; }
.relay-text { padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px dashed var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.relay.out .relay-text { border-style: solid; border-color: var(--accent-text); }
.relay-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-text); }
.relay .time { font-size: 12px; color: var(--faint); }
.thread .relay { margin: 6px 0; }
.chat-head .head-back { flex: none; color: var(--text); margin-left: -6px; }
.guest-banner { font-size: 13.5px; color: var(--muted); }
.guest-banner .text-btn { flex: none; font-weight: 700; padding: 0; }
.thread .msg-note { align-self: center; text-align: center; max-width: none; }

/* The agent's picture in the chat header opens the picture sheet. */
.head-photo { flex: none; border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; }

/* Vault files named in an agent's reply: pictures and tappable files under the bubble. */
.vault-refs { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px; max-width: 320px; }
.vault-pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vault-pic { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); padding: 0; cursor: pointer; display: grid; place-items: end start; }
.vault-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vault-pic-name { position: relative; margin: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11.5px; max-width: calc(100% - 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-pic:not(.loaded):not(.failed)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(127, 140, 170, 0.12), transparent); animation: shimmer 1.2s infinite; }
.vault-pic.failed { place-items: center; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.vault-file { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.vault-file .icon { color: var(--accent-text); flex: none; }
.vault-file-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.vault-file-open { flex: none; color: var(--accent-text); font-weight: 700; font-size: 13px; }

/* Chat list beside the conversation (chatlist.ts), and the agent's model, heartbeat and thinking
   in the header. Wide screens only: phones switch agents from the name in the header. */
.chat-split { --cl-w: 0px; position: relative; height: 100%; }
.screen:has(> .chat-split) { padding-bottom: 0; }
.chat-pane { position: relative; height: 100%; min-width: 0; overflow-y: auto; }
/* Switching agent: the current chat dims and a spinner shows (only if it takes a moment); the next
   one fades in when ready. */
.chat-pane > .chat { transition: opacity 0.18s ease-out; }
.chat-pane.switching > .chat { opacity: 0.35; transition-delay: 0.1s; pointer-events: none; }
.pane-wait { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; animation: spinner-late 0.25s step-end both; }
.chat-pane.pane-in { animation: screen-in 0.2s ease-out both; }
/* The next agent's chat, drawn hidden over the current one until its messages are in (shell.ts). */
.chat-pane.staged { position: absolute; top: 0; right: 0; bottom: 0; left: var(--cl-w); visibility: hidden; }
.chat-list, .head-info { display: none; }
@media (min-width: 1100px) {
  .chat-split { --cl-w: 320px; display: flex; align-items: stretch; }
  .chat-pane { flex: 1; }
  .chat-pane > .chat { max-width: none; margin: 0; }
  .chat-split .head-chevron { display: none; }
  /* Name, then model, heartbeat and thinking beside it; search stays at the far end. */
  .chat-split .head-text { flex: 0 1 auto; }
  .chat-split .head-search { margin-left: auto; }
  /* Very wide screens: the conversation keeps the width it has at 1440px, centred, instead of
     stretching edge to edge. */
  .chat-pane .chat-head { padding-left: max(24px, calc((100% - 1000px) / 2)); padding-right: max(24px, calc((100% - 1000px) / 2)); }
  .chat-pane .thread { padding-left: max(16px, calc((100% - 1000px) / 2)); padding-right: max(16px, calc((100% - 1000px) / 2)); }
  .chat-pane .composer, .chat-pane .tray { padding-left: max(10px, calc((100% - 1000px) / 2)); padding-right: max(10px, calc((100% - 1000px) / 2)); }
  .chat-pane .banner { margin-left: max(16px, calc((100% - 1000px) / 2)); margin-right: max(16px, calc((100% - 1000px) / 2)); }
  .chat-list { display: flex; flex-direction: column; flex: none; width: var(--cl-w); height: 100%; overflow-y: auto; box-sizing: border-box; padding: calc(18px + var(--safe-t)) 0 18px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); }
  .head-info { display: flex; align-items: center; flex: none; margin-left: 10px; }
  .head-info[hidden] { display: none; }
  .head-info-item { display: flex; flex-direction: column; gap: 2px; padding: 2px 22px; border-left: 1px solid var(--line); }
  .head-info-item small { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
  .head-info-item b { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
}
/* The list's rows, shared by the wide side panel and the phone's full-screen list. */
.cl-title { margin: 0; padding: 4px 22px 14px; font: 700 22px/1.2 "Creato Display", "Source Sans 3", sans-serif; }
.cl-search { display: flex; align-items: center; gap: 8px; margin: 0 14px 4px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.cl-search-input { flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.cl-search:focus-within { border-color: var(--accent); }
.cl-label { margin: 0; padding: 18px 22px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cl-row { display: flex; align-items: center; gap: 12px; width: calc(100% - 16px); margin: 0 8px; padding: 10px 14px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cl-row[hidden] { display: none; }
.cl-row.on { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.cl-face { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 15px; color: #fff; background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.cl-face img { width: 100%; height: 100%; object-fit: cover; }
.cl-row.guest .cl-face { background: linear-gradient(135deg, #2bb673, #167a4c); }
.cl-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cl-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-tag { flex: none; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; color: var(--live); background: var(--live-bg); }
.cl-end { flex: none; align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; padding: 2px 0; }
.cl-time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.cl-badge { min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.cl-empty { margin: 2px 22px 4px; font-size: 13px; color: var(--faint); line-height: 1.4; }
.cl-add { display: flex; align-items: center; gap: 10px; margin: 4px 8px 0; padding: 8px 14px; border: 0; border-radius: 10px; background: none; color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.cl-add.soon { color: var(--muted); }
.cl-add.soon .cl-tag { color: #b9a8ff; background: rgba(122, 92, 255, 0.18); }
/* Phones and tablets: the list is Chat's first screen (shell.ts), full width, above the tab bar. */
.chat-split.list-mode .chat-list { display: flex; flex-direction: column; width: 100%; height: 100%; overflow-y: auto; box-sizing: border-box; padding: calc(18px + var(--safe-t)) 0 calc(96px + var(--safe-b)); }
.list-mode .cl-title { font-size: 28px; padding: 6px 20px 14px; }
.list-mode .cl-search { margin: 0 16px 6px; }
.list-mode .cl-search-input { font-size: 16px; padding: 12px 0; }
.list-mode .cl-row { padding: 12px 12px; }
.list-mode .cl-face { width: 48px; height: 48px; font-size: 17px; }
.list-mode .cl-name { font-size: 16px; }
.list-mode .cl-sub { font-size: 14px; }
.list-mode .cl-row.on { background: none; }
@media (min-width: 700px) { .chat-split.list-mode .chat-list { padding-bottom: 24px; } .list-mode .chat-list > * { max-width: 720px; } }
@media (hover: hover) and (pointer: fine) {
  .cl-row:not(.on):hover, .cl-add:hover { background: var(--surface-2); }
}

/* Agent Connect asks in the owner's chat (chat.ts): a guest's question the agent passed on. */
.asks { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 0; }
.asks[hidden] { display: none; }
.ask-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ask-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ask-from { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-text); }
.ask-q { font-size: 15px; line-height: 1.4; color: var(--text); }
.ask-card .ask-reply { flex: none; width: auto; margin: 0; padding: 9px 18px; }
@media (min-width: 1100px) {
  .chat-pane .asks { padding-left: max(16px, calc((100% - 1000px) / 2)); padding-right: max(16px, calc((100% - 1000px) / 2)); }
}

/* Agent to agent: two agents' faces as a pair, their conversation, and the connect sheets. */
.a2a-faces { position: relative; width: 42px; height: 42px; flex: none; }
.a2a-faces .cl-face { position: absolute; width: 28px; height: 28px; font-size: 12px; border: 2px solid var(--bg); background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.a2a-faces .cl-face:first-child { left: 0; top: 0; }
.a2a-faces .cl-face:last-child { right: 0; bottom: 0; }
.cl-face.green, .a2a-faces .cl-face.green { background: linear-gradient(135deg, #2bb673, #167a4c); }
.cl-row.pair .cl-tag { color: #b9a8ff; background: rgba(122, 92, 255, 0.18); }
.cl-row.pair.req .cl-tag { color: #ffd27a; background: rgba(255, 190, 70, 0.16); }
.a2a-head .a2a-faces { width: 48px; height: 48px; }
.a2a-head .a2a-faces .cl-face { width: 32px; height: 32px; font-size: 13px; }
.a2a-head .head-info-item b { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.a2a-chat .head-search { color: var(--muted); }
.a2a-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px calc(90px + var(--safe-b)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.chat-pane .a2a-bar { padding-left: max(16px, calc((100% - 1000px) / 2)); padding-right: max(16px, calc((100% - 1000px) / 2)); }
.a2a-bar p { flex: 1; margin: 0; line-height: 1.45; }
.a2a-bar .btn-secondary, .a2a-bar .btn-danger, .a2a-bar .btn-primary { width: auto; flex: none; padding: 9px 16px; margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.btn-danger { background: none; border: 1px solid color-mix(in srgb, var(--danger, #e5484d) 50%, transparent); color: var(--danger, #e5484d); border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 599px) {
  .a2a-bar { flex-wrap: wrap; }
  .a2a-bar p { flex-basis: 100%; }
  .a2a-bar .btn-secondary, .a2a-bar .btn-danger, .a2a-bar .btn-primary { flex: 1; justify-content: center; }
}
.a2a-thread .msg .who { display: block; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: none; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 4px 2px; }
.a2a-thread .msg.user .who { align-self: flex-end; }
.a2a-thread .msg.assistant .who { align-self: flex-start; }
.a2a-face-sm { width: 28px; height: 28px; font-size: 11px; margin-bottom: 20px; }
.a2a-start { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.a2a-topic { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #b9a8ff; background: rgba(122, 92, 255, 0.18); }
.a2a-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.a2a-empty p { margin: 0; }
.a2a-empty p:first-child { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.sheet.a2a { max-width: 520px; }
.a2a-label { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.a2a-one { width: 100%; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.a2a-picklist { margin: -8px 0 16px; }
.a2a-one .cl-face, .a2a-found .cl-face { width: 36px; height: 36px; font-size: 14px; }
.a2a-one .t, .a2a-found .t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.a2a-one b, .a2a-found b { font-size: 15px; }
.a2a-one small, .a2a-found small { font-size: 12px; color: var(--muted); }
.a2a-id { width: 100%; box-sizing: border-box; margin: 0 0 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; }
.a2a-found { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--live) 45%, transparent); background: var(--live-bg); }
.a2a-found .ok { color: var(--live); display: grid; }
.a2a-hint { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.a2a-pair { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; }
.a2a-pair .pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.a2a-pair .pick .cl-face { width: 36px; height: 36px; font-size: 14px; }
.a2a-pair .pick .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.a2a-pair .pick b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a2a-pair .pick small { font-size: 12px; color: var(--muted); }
.a2a-pair .arrow { color: var(--muted); font-size: 18px; }
.a2a-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.a2a-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text); background: rgba(122, 92, 255, 0.18); border: 1px solid rgba(122, 92, 255, 0.35); }
.a2a-chip:has(.a2a-chip-x) { padding-right: 8px; }
.a2a-chip-x { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.a2a-chip.add { background: none; border: 1px dashed var(--line); color: var(--accent-text); cursor: text; }
.a2a-chip-input { width: 84px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; outline: none; }
.a2a-chip-input::placeholder { color: var(--accent-text); }
.a2a-box { padding: 4px 16px; margin: 0 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.a2a-set { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.a2a-box > .a2a-set:first-child { border-top: 0; }
.a2a-set .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.a2a-set .t b { font-size: 15px; font-weight: 600; }
.a2a-set .t small { font-size: 13px; color: var(--muted); }
.a2a-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.a2a-step button { width: 36px; height: 34px; border: 0; background: var(--surface-2); color: var(--text); font-size: 18px; cursor: pointer; }
.a2a-step span { min-width: 40px; text-align: center; font-weight: 700; }
.a2a-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--muted); }
.a2a-note b { color: var(--text); }
.a2a-agree { margin: 4px 0 16px; }
.a2a-req-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.a2a-req-head .a2a-faces { width: 52px; height: 52px; }
.a2a-req-head .a2a-faces .cl-face { width: 36px; height: 36px; font-size: 14px; }
.a2a-req-head .sheet-title { margin: 0; }
.a2a-req-sub { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.a2a-btns { display: flex; gap: 10px; align-items: stretch; }
.a2a-btns > * { flex: 1; margin: 0 !important; height: 52px; display: grid; place-items: center; padding: 0; }
.a2a-btns .btn-primary[disabled] { opacity: 0.45; }
.a2a-rowface { color: #fff; font-weight: 700; background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.a2a-idtext { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.a2a-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
@media (min-width: 700px) { .a2a-bar { padding-bottom: 18px; } }
.a2a-chip.pick { gap: 6px; background: none; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.a2a-chip.pick.on { color: var(--text); background: rgba(122, 92, 255, 0.18); border-color: rgba(122, 92, 255, 0.35); padding-left: 10px; }
.a2a-chip.pick.on svg { color: #b9a8ff; }
/* Phones: chat headers sit clear of the status bar, where iOS blurs and fades whatever is under it.
   The profile button moves down with them so the two stay lined up. */
@media (max-width: 699px) {
  .chat-head { padding-top: calc(28px + var(--safe-t)); }
  .shell:has(.chat-head) > .me-fixed { top: calc(34px + var(--safe-t)); }
}
/* Two cards in a row on a page always have a gap between them. */
.page > .card + .card { margin-top: 16px; }
/* Screens kept under the one on view (going back shows them at once). While a back swipe or the back
   slide is under way, the moving screen carries the app's backdrop so the one beneath shows only
   where it has moved away. */
.screen.parked { visibility: hidden; pointer-events: none; }
.screen.parked.peek { visibility: visible; }
.screen.dragging, .screen.out-back { z-index: 3; background: var(--glow), linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 45%); background-color: var(--bg); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25); will-change: transform; }
.screen.out-back { animation: out-back 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes out-back { to { transform: translateX(100%); } }

/* Admin console on computers and tablets (adminwide.ts), in Twin Chat Enterprise's console look. */
.ax { padding: calc(26px + var(--safe-t)) 34px 40px; max-width: 1240px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.ax .muted { color: var(--muted); }
.ax .ok { color: var(--live); }
.ax .warn { color: var(--attention); }
.ax-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; overflow-x: auto; scrollbar-width: none; }
.ax-tabs button { background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 9px 12px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ax-tabs button:hover { color: var(--text); }
.ax-tabs button.on { color: var(--text); border-bottom-color: var(--twin); }
.ax-tabs .n { background: var(--attention-bg); color: var(--attention); border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.ax-mini { font-size: 12.5px; color: var(--muted); }
.ax-gap { margin-top: 8px; }
.ax-none { font-size: 13px; margin: 4px 0; }
.ax-stat { font-size: 13px; }
.ax-stat b { font-size: 17px; }
.ax-val { font-size: 13px; white-space: nowrap; }
.ax-src { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ax-clip { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax .loading { padding: 40px 0; }
.ax-embed > .page { max-width: 760px; margin: 0; padding: 0; min-height: 0; }
.ax-embed > .page::before, .ax-embed > .page::after { display: none; }
.ax-embed.root > .page > .back, .ax-embed.root > .page > .page-title, .ax-embed.root > .page > .page-sub { display: none; }
.ax-embed.root > .page > .page-title + * { margin-top: 0; }
.ax-embed > .group { max-width: 640px; margin-top: 24px; }
.cx-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.cx-top h1 { font-family: "Creato Display", "Source Sans 3", sans-serif; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.cx-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cx-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.cx-btn { border: 0; border-radius: 10px; padding: 8px 13px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cx-btn.p { background: var(--twin); color: #fff; }
.cx-btn.s { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.cx-body > * + * { margin-top: 16px; }
.cx-grid { display: grid; gap: 16px; }
.cx-grid.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cx-grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cx-grid.c2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--card-shadow); min-width: 0; }
.cx-card h3 { margin: 0 0 12px; min-height: 20px; font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.cx-link { margin-left: auto; background: none; border: 0; padding: 0; color: var(--accent-text); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.cx-kpi { position: relative; overflow: hidden; --tone: #0c9dd8; --tone-bg: rgba(12, 157, 216, 0.12); }
.cx-kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--tone), transparent 85%); }
.cx-kpi.t-indigo { --tone: #2a3fb0; --tone-bg: rgba(42, 63, 176, 0.12); }
.cx-kpi.t-violet { --tone: #7c5ce6; --tone-bg: rgba(124, 92, 230, 0.13); }
.cx-kpi.t-green { --tone: var(--live); --tone-bg: var(--live-bg); }
.cx-kpi.t-amber { --tone: var(--attention); --tone-bg: var(--attention-bg); }
.cx-kh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cx-ki { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); flex: none; }
.cx-kpi .cx-l { color: var(--muted); font-size: 12px; font-weight: 500; }
.cx-kpi .cx-v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 0; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.cx-kpi .cx-v.sm { font-size: 15px; margin: 6px 0 6px; background: none; color: var(--text); }
.cx-kpi .cx-d { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.cx-bar { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; margin-top: 8px; }
.cx-bar i { display: block; height: 100%; background: var(--twin); border-radius: 9px; }
.cx-pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.cx-pill.ok { background: var(--live-bg); color: var(--live); }
.cx-pill.warn { background: var(--attention-bg); color: var(--attention); }
.cx-pill.off { background: var(--surface-2); color: var(--muted); }
.cx-list { display: grid; }
.cx-it { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.cx-it:first-child { border-top: 0; }
.cx-it-text { min-width: 0; flex: 1; }
.cx-it-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-t { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.cx-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.cx-foot { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.cx-toolbar { display: flex; align-items: center; gap: 12px; }
.cx-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.cx-chip.on { color: var(--accent-text); border-color: var(--accent); }
.cx-chip-n { font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--surface-2); box-sizing: border-box; }
.cx-chip.on .cx-chip-n { background: var(--seg-on); color: var(--accent-text); }
.cx-search { margin-left: auto; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; color: var(--text); font: inherit; font-size: 13px; outline: none; }
.cx-search:focus { border-color: var(--accent); }
.cx-table { padding: 4px 6px; overflow-x: auto; }
.cx-table > h3 { padding: 12px 12px 0; }
.cx-table table { width: 100%; border-collapse: collapse; }
.cx-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cx-table thead tr th:first-child { border-top-left-radius: 10px; }
.cx-table thead tr th:last-child { border-top-right-radius: 10px; }
.cx-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.cx-table tr:last-child td { border-bottom: 0; }
.cx-click { cursor: pointer; }
.cx-click:hover td { background: var(--surface-2); }
.cx-who { display: flex; align-items: center; gap: 10px; }
.cx-who-text { min-width: 0; }
.cx-who small, .cx-who-text small { display: block; color: var(--muted); font-size: 11.5px; }
.cx-more { width: 44px; text-align: right; }
.cx-dots { background: none; border: 0; color: var(--faint); letter-spacing: 2px; font-size: 14px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.cx-dots:hover { background: var(--surface-2); color: var(--text); }
.cx-empty { text-align: center; padding: 24px; }
.cx-lvc .cx-lvh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cx-lvc .cx-lvh b { font-size: 15px; }
.cx-cost { margin-top: 12px; font-size: 12px; color: var(--faint); }
@media (max-width: 1180px) { .cx-grid.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cx-grid.c2 { grid-template-columns: 1fr; } }
/* Admin detail pages and App settings on computers: lined up with the console's title, in its sizes. */
@media (min-width: 900px) {
  .page.admin { max-width: 1240px; padding: calc(26px + var(--safe-t)) 34px 40px; }
  .page.admin > * { max-width: 760px; }
  .page.admin .page-title { font-size: 22px; }
  .page.admin .page-sub { font-size: 13px; margin-bottom: 18px; }
  .page.admin .group-label { font-size: 12.5px; margin-bottom: 8px; }
  .page.admin .row { min-height: 54px; padding-top: 10px; padding-bottom: 10px; }
  .page.admin .row-title { font-size: 14px; }
  .page.admin .row-detail { font-size: 12.5px; }
  .page.admin .row-icon { width: 34px; height: 34px; }
  .page.admin .row-value, .page.admin .status { font-size: 12.5px; }
  .page.admin .back { width: 36px; height: 36px; }
  .page.admin .admin-actions { flex-direction: row; flex-wrap: wrap; }
  .page.admin .admin-actions .btn-primary, .page.admin .admin-actions .btn-secondary { width: auto; font-size: 14px; padding: 10px 16px; border-radius: 10px; }
  .page.admin .field { font-size: 14px; padding: 10px 12px; border-radius: 10px; }
  .page.admin .field-card .btn-primary, .page.admin .field-card .btn-secondary, .page.admin > .btn-primary, .page.admin > .btn-secondary { font-size: 14px; padding: 10px 14px; border-radius: 10px; }
  .page.admin .sheet-text { font-size: 13.5px; }
  .ax-embed > .page.admin { max-width: 760px; margin: 0; padding: 0; min-height: 0; }
}
/* Admin console on phones and narrow tablets: tabs scroll sideways, tables become tappable cards. */
.ax.narrow { padding: calc(28px + var(--safe-t)) 16px 28px; }
.ax.narrow > .back { margin: 0 0 6px -8px; }
.ax.narrow .cx-top { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.ax.narrow .cx-top h1 { font-size: 30px; }
.ax.narrow .cx-sub { font-size: 14px; }
.ax.narrow .cx-actions { margin-left: 0; }
.ax.narrow .ax-tabs { margin: 0 -16px 16px; padding: 0 10px; }
.ax.narrow .ax-tabs button { font-size: 14px; padding: 10px 10px 12px; }
.ax.narrow .cx-grid { gap: 10px; }
.ax.narrow .cx-grid.kn, .ax.narrow .cx-grid.k5, .ax.narrow .cx-grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ax.narrow .cx-grid.kn > :last-child:nth-child(odd), .ax.narrow .cx-grid.k5 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.ax.narrow .cx-grid.k3, .ax.narrow .cx-grid.c2 { grid-template-columns: 1fr; }
.ax.narrow .cx-body > * + * { margin-top: 12px; }
.ax.narrow .cx-card { padding: 14px 16px; }
.ax.narrow .cx-kpi .cx-l { font-size: 12.5px; }
.ax.narrow .cx-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
.ax.narrow .cx-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.ax.narrow .cx-chip { flex: none; font-size: 13px; padding: 6px 12px; }
.ax.narrow .cx-search { width: 100%; margin: 0; font-size: 15px; padding: 10px 12px; box-sizing: border-box; }
.ax.narrow .cx-it { font-size: 13.5px; }
.ax.narrow .cx-foot { font-size: 12.5px; }
.ax-rows { padding: 2px 0; }
.ax-rows > h3 { padding: 12px 16px 2px; margin: 0; }
.ax-rows > .ax-none { padding: 12px 16px; margin: 0; }
.ax-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; }
.ax-rows > h3 + .ax-row, .ax-rows > .ax-row:first-child { border-top: 0; }
button.ax-row { cursor: pointer; }
button.ax-row:active { background: var(--surface-2); }
.ax-row > .icon { color: var(--faint); flex: none; }
.ax-row-main { flex: 1; min-width: 0; }
.ax-row-top { font-size: 14.5px; font-weight: 600; min-width: 0; }
.ax-row-top .cx-who-text { font-weight: 600; }
.ax-row-top .cx-who small, .ax-row-top .cx-who-text small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-row-top .cx-who-text { overflow: hidden; }
.ax-row-sub { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.ax-row-sub + .ax-row-sub { margin-top: 1px; }
.ax-row-sub { display: flex; flex-wrap: wrap; column-gap: 14px; }
.ax-row-sub.plain { flex-direction: column; }
.ax-bit { max-width: 100%; min-width: 0; }
.ax.narrow .cx-card.ax-rows { padding: 2px 0; }
.ax-row-sub .ax-clip { display: inline; max-width: none; white-space: normal; }
.ax-row-sub b { font-weight: 500; color: var(--muted); }
.ax-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ax-row-end:empty { display: none; }
.ax.narrow .cx-grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ax.narrow .cx-lvc { padding: 12px; }
.ax.narrow .cx-lvc .cx-lvh { flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; }
.ax.narrow .cx-lvc .cx-lvh b { font-size: 22px; }
.ax.narrow .cx-lvc .ax-mini, .ax.narrow .cx-lvc .cx-cost { display: none; }
.ax-row-top .cx-who-text { white-space: nowrap; text-overflow: ellipsis; }

/* Voice messages: the recording strip in the composer, and the voice bubble (play bar, then words). */
.composer.recording > :not(.vn-rec):not(.send):not(input) { display: none; }
.vn-rec { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; border-radius: 23px; background: var(--surface-2); border: 1px solid var(--line); }
.vn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 5px rgba(223, 14, 68, 0.18); flex: none; animation: vn-pulse 1.4s ease-in-out infinite; }
@keyframes vn-pulse { 50% { box-shadow: 0 0 0 2px rgba(223, 14, 68, 0.1); } }
.vn-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; flex: none; min-width: 34px; }
.vn-meter { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; height: 100%; }
.vn-meter i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-text); flex: none; transition: width .09s, height .09s; }
.vn-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.vn-x:focus-visible { color: var(--alert); }
@media (hover: hover) { .vn-x:hover { color: var(--alert); } }
.vn-hint { text-align: center; font-size: 12px; color: var(--muted); margin: 0; padding: 6px 12px 0; }
.bubble.vn { padding: 8px 12px 11px; min-width: 230px; max-width: 100%; }
.vn-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.16); margin-bottom: 8px; }
.vn-play { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #fff; color: #2a3fb0; display: grid; place-items: center; flex: none; cursor: pointer; padding: 0; }
.vn-play:disabled { opacity: .6; cursor: default; }
.vn-play .icon-filled, .vn-play svg { fill: currentColor; stroke: none; }
.vn-track { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); position: relative; min-width: 90px; overflow: hidden; }
.vn-track b { position: absolute; inset: 0 auto 0 0; width: 0; background: #fff; transition: width .25s linear; }
.vn-len { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .9; flex: none; }
.vn-words { white-space: pre-wrap; }
.vn-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .02em; opacity: .8; text-transform: uppercase; }
.vn-wait { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 1px; }
.vn-wait > span { height: 9px; border-radius: 5px; background: rgba(255, 255, 255, 0.28); animation: vn-shimmer 1.2s ease-in-out infinite; }
.vn-wait > span:nth-of-type(1) { width: 92%; }
.vn-wait > span:nth-of-type(2) { width: 64%; animation-delay: .2s; }
@keyframes vn-shimmer { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .vn-dot, .vn-wait > span { animation: none; } .vn-meter i, .vn-track b { transition: none; } }

/* Admin second step: the QR code and key to add to an authenticator app, and the code field. */
.step-qr-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; }
.step-qr { width: 216px; height: 216px; image-rendering: pixelated; border-radius: 10px; background: #fff; padding: 8px; }
.step-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .04em; text-align: center; overflow-wrap: anywhere; margin: 0; color: var(--text); }
.step-code { font-size: 26px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.group-foot { color: var(--muted); font-size: 12px; margin: 8px 6px 0; }

/* Signed-in devices (devices.ts): a round icon per kind, three lines, an × to sign out. */
.dv-row { align-items: center; gap: 14px; }
.dv-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--twin); }
.dv-icon.k-phone { background: linear-gradient(135deg, #2fbf8f, #1d8f6a); }
.dv-icon.k-tablet { background: linear-gradient(135deg, #8e74c8, #5a49a8); }
.dv-row .row-text { gap: 2px; }
.dv-where { color: var(--faint); }
.dv-where.online { color: var(--accent-text); }
.dv-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
@media (hover: hover) { .dv-x:hover { color: var(--alert); background: var(--surface-2); } }
.dv-x:focus-visible { color: var(--alert); }
.dv-all .row-title { color: var(--alert); }
.dv-label { color: var(--accent-text); font-weight: 600; }
.dv-credit { color: var(--faint); font-size: 11px; text-align: center; margin: 4px 12px 24px; }
.row-value.accent { color: var(--accent-text); }

/* Vault apps and the CRM (crm.ts) */
.vault-page { position: relative; }
.vault-apps-btn { position: absolute; right: 66px; top: calc(18px + var(--safe-t)); display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px 0 11px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--card-shadow); color: var(--accent-text); font-weight: 700; font-size: 15px; }
.vapp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vapp-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--card-shadow); color: var(--text); min-height: 178px; }
.vapp-tile.soon { opacity: 0.6; }
.vapp-tile .status { margin-top: auto; padding: 4px 10px; font-size: 13px; }
.vapp-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.vapp-icon.big { width: 58px; height: 58px; border-radius: 16px; }
.vapp-icon.sky { background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.vapp-icon.green { background: #17a65c; } .vapp-icon.orange { background: #fe9309; } .vapp-icon.plum { background: #7b3fb8; }
.vapp-name { font-weight: 700; font-size: 17px; }
.vapp-detail { color: var(--muted); font-size: 14px; line-height: 1.35; }
.vapp-price { margin-top: auto; font-weight: 700; font-size: 14px; color: var(--accent-text); }
.vapp-sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.vapp-sheet-head .muted { color: var(--sheet-muted); margin: 0; }
.vapp-points { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.vapp-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.vapp-points li .icon { color: #17a65c; flex: none; margin-top: 2px; }
.vapp-price-box { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; border-radius: 14px; background: #eef3fb; margin-bottom: 4px; }
.vapp-price-box b { font-size: 26px; }
.vapp-price-box .muted { color: var(--sheet-muted); }
@media (min-width: 700px) {
  .crm-board { margin: 0; padding: 0 0 6px; }
  .crm-col { flex: 1 0 220px; }
  .vapp-grid { grid-template-columns: repeat(4, 1fr); }
  .vault-apps-btn { right: 20px; }
  .vault-apps-btn { top: calc(92px + var(--safe-t)); right: max(34px, calc((100% - 1240px) / 2 + 34px)); }
}

.crm-board { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 6px; scroll-snap-type: x mandatory; }
.crm-col { flex: 0 0 82%; scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.crm-col-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 2px; font-size: 15px; }
.crm-col-head .muted { font-size: 13px; }
.crm-deal { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--card-shadow); color: var(--text); }
.crm-deal-title { font-weight: 700; font-size: 16px; }
.crm-deal-who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.crm-deal-foot { display: flex; justify-content: space-between; font-size: 14px; }
.crm-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 12px; border: 1px dashed var(--faint); background: none; color: var(--muted); font-weight: 600; }
.crm-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #3b8fe8, #7b5ce6); flex: none; }
.crm-av.big { width: 42px; height: 42px; font-size: 15px; }
.crm-av.huge { width: 72px; height: 72px; font-size: 26px; }
.crm-stage { flex: none; display: inline-block; padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--accent-text); background: var(--seg-on); }
.crm-filters { display: flex; gap: 8px; }
.crm-chip { padding: 6px 12px; border-radius: 16px; font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.crm-chip.on { color: var(--text); background: var(--seg-on); border-color: rgba(143, 184, 212, 0.45); }
.crm-act .crm-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); flex: none; }
.crm-when { flex: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.crm-when.late { color: var(--alert); }
.crm-ask { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 13px 16px; border-radius: 16px; background: var(--seg-on); color: var(--accent-text); font-size: 15px; font-weight: 600; }
.crm-person { display: flex; align-items: center; gap: 14px; margin: 18px 0 16px; }
.crm-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.crm-q { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--accent-text); font-size: 13px; font-weight: 600; }
.crm-deal-box { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px; }
.crm-deal-box .eyebrow { font-size: 13px; }
.crm-deal-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.crm-big { font-size: 20px; }
.crm-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.crm-steps button { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 0 2px; border: 0; border-top: 4px solid var(--surface-2); background: none; text-align: center; }
.crm-steps button.on { border-top-color: var(--accent); color: var(--text); }
.crm-page .card + .group-label, .crm-page .list + .group-label { margin-top: 24px; }
.crm-sections { display: flex; gap: 6px; overflow-x: auto; margin: 18px -20px 14px; padding: 0 20px 2px; scrollbar-width: none; }
.crm-sec { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 15px; }
.crm-sec.on { color: var(--text); background: var(--seg-on); border-color: rgba(143, 184, 212, 0.45); }
.crm-sec.on .icon { color: var(--accent-text); }
.crm-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--attention); background: var(--attention-bg); }
.crm-stats { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px 14px; padding: 2px 20px 6px; scrollbar-width: none; }
.crm-stat { flex: none; min-width: 132px; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); text-align: left; color: var(--text); }
.crm-stat b { font-size: 20px; display: inline-flex; align-items: center; gap: 6px; }
.crm-stat span { color: var(--muted); font-size: 13px; }
.crm-stat.warn { border-bottom: 3px solid var(--attention); }
.crm-stat.warn b { color: var(--attention); }
.crm-stat.locked { background: var(--surface-2); box-shadow: none; border-style: dashed; }
.crm-stat.locked b { font-size: 15px; color: var(--muted); }
.crm-stat.locked span { color: var(--accent-text); font-weight: 600; }
.crm-toolbar { display: flex; gap: 8px; align-items: center; }
.crm-search { flex: 1; min-width: 0; margin: 0; }
.crm-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.crm-addbtn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px; width: auto; }
.crm-toolbar .crm-btn span, .crm-addbtn span { display: none; }
.crm-filters { overflow-x: auto; flex-wrap: nowrap; margin: 12px -20px 14px; padding: 0 20px; scrollbar-width: none; }
.crm-filters .crm-chip { flex: none; }
.crm-filters.inline { margin: 4px 0 0; padding: 0; flex-wrap: wrap; }
.crm-table { display: none; }
.crm-prow { align-items: flex-start; }
.crm-prow .row-title { display: flex; align-items: center; gap: 8px; }
.crm-next { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; color: var(--accent-text); font-weight: 600; }
.crm-prow-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.crm-score { font-size: 17px; }
.crm-score.hot { color: #17a65c; } .crm-score.warm { color: var(--attention); } .crm-score.cold { color: var(--muted); }
.crm-tag { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--attention); background: var(--attention-bg); }
.crm-tag.vip { color: #7b3fb8; background: rgba(123, 63, 184, 0.12); }
.crm-av.co { border-radius: 12px; background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.crm-tasks { display: grid; gap: 0; }
.crm-person { flex-direction: column; }
.crm-person-meta { display: flex; align-items: center; gap: 8px; }
@media (min-width: 900px) {
  .page.crm-page { max-width: none; padding-left: 32px; padding-right: 32px; }
  .crm-sections, .crm-stats, .crm-filters { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .crm-stats { display: grid; grid-template-columns: repeat(5, 1fr); }
  .crm-stat { min-width: 0; padding: 14px 18px; }
  .crm-stat b { font-size: 22px; }
  .crm-toolbar .crm-btn span, .crm-addbtn span { display: inline; }
  .crm-cards { display: none; }
  .crm-table { display: block; padding: 0; overflow: hidden; }
  .crm-table-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 20px; }
  .crm-table-head p { margin: 4px 0 0; }
  .crm-table-tools { display: flex; gap: 8px; }
  .crm-select { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; outline: none; }
  .crm-select .icon { color: var(--muted); }
  .crm-table-tools .crm-btn { height: 40px; }
  .crm-pill { margin-left: 8px; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
  .crm-tr { display: grid; grid-template-columns: minmax(220px, 2.3fr) 0.7fr 1.4fr 1.3fr 1.4fr 0.9fr 112px; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
  .crm-tr:hover:not(.crm-th) { background: var(--surface-2); }
  .crm-th { background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--muted); cursor: default; }
  .crm-cb { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--faint); }
  .crm-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .crm-who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
  .crm-who-text .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .crm-two { display: flex; flex-direction: column; gap: 2px; }
  .crm-two .muted { font-size: 13px; }
  .crm-link { color: var(--accent-text); }
  .crm-acts { display: flex; gap: 4px; justify-content: flex-end; }
  .crm-act-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
  .crm-act-btn:hover { background: var(--surface-2); color: var(--accent-text); }
  .crm-tasks { grid-template-columns: 1fr 1fr; gap: 20px; }
  .crm-tasks .group-label { margin-top: 0; }
  .crm-on-companies .card.list, .crm-page .crm-ask { max-width: 760px; }
  .crm-contact { display: grid; grid-template-columns: 420px 1fr; gap: 28px; align-items: start; }
  .crm-contact .crm-person { margin-top: 4px; }
  .crm-board { margin: 0; padding: 0 0 6px; }
  .crm-col { flex: 1 0 220px; }
}
.crm-tasks > div + div > .group-label { margin-top: 24px; }
@media (min-width: 900px) { .crm-tasks > div + div > .group-label { margin-top: 0; } }

.vapp-tile:disabled { cursor: default; }
.crm-stage.none { color: var(--muted); background: var(--surface-2); }
.crm-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }
.crm-page .late, .crm-next.late { color: var(--alert); }
.crm-two.right { align-items: flex-end; text-align: right; flex: none; }
.crm-tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--faint); background: none; flex: none; display: grid; place-items: center; padding: 0; color: #fff; }
.crm-tick.done { background: #17a65c; border-color: #17a65c; }
.crm-act { cursor: pointer; }
.crm-act.done .row-title { text-decoration: line-through; color: var(--muted); }
.crm-toolbar.end { justify-content: flex-end; margin-bottom: 4px; }
.crm-empty p { margin: 0 0 6px; }
.crm-empty-btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.crm-empty-btns > * { flex: 1 1 160px; margin: 0; }
.crm-none { padding: 24px 0; }
.crm-none-left { margin: 4px 4px 0; }
.crm-deal-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; background: none; padding: 0; text-align: left; color: var(--text); }
.crm-q { text-decoration: none; }
.crm-q.off, .crm-act-btn.off { opacity: 0.35; pointer-events: none; }
.crm-person-meta .muted { font-size: 14px; }
.crm-wrap { overflow-wrap: anywhere; }
.crm-form { display: grid; gap: 10px; margin: 6px 0 4px; }
.crm-field { display: grid; gap: 5px; }
.crm-field > span { font-size: 13px; font-weight: 600; color: var(--sheet-muted); }
.crm-sheet .field { margin: 0; background: #eef3fb; color: var(--sheet-text); border-color: var(--sheet-line); }
.crm-sheet select.field, .crm-sheet input[type=date].field, .crm-sheet input[type=time].field { min-height: 48px; }
.crm-two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crm-check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--sheet-text); padding: 4px 2px; }
.crm-check input { width: 20px; height: 20px; accent-color: #1f6fd0; }
.crm-del { margin-top: 6px; color: var(--alert); }
.crm-sheet .sheet { max-height: 92vh; overflow-y: auto; }
.crm-more { margin: 8px 0 12px; background: #fff; }
.crm-more .row { color: var(--sheet-text); }
.crm-more .row-detail { color: var(--sheet-muted); }
.crm-col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.crm-deal.dragging { opacity: 0.4; }
.crm-deal { cursor: pointer; }
.crm-tr .crm-two { min-width: 0; }

.crm-two { display: flex; flex-direction: column; gap: 2px; }
.crm-two .muted { font-size: 13px; }
.crm-cos .crm-two.right { margin-left: 10px; }
.crm-new { width: 100%; margin: 12px 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.crm-cos .row-detail { overflow-wrap: anywhere; }

/* Unread count on a tab sits on the icon's corner instead of over it. */
.tab .badge { left: calc(100% - 7px); right: auto; top: -7px; min-width: 10px; height: 16px; padding: 0 4px; font-size: 10.5px; }
/* Collapsible sidebar (wide screens): folds down to the icons, kept on this device. */
.rail-toggle, .rail-tip { display: none; }
@media (min-width: 700px) {
  .tabbar { position: relative; left: 0; right: auto; bottom: auto; transition: width 0.18s ease; }
  .rail-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .rail-toggle { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 0; background: none; color: #8f9bbf; cursor: pointer; }
  .rail-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
  .rail-mini .tabbar { width: 72px; padding-left: 12px; padding-right: 12px; }
  .rail-mini .rail-brand { flex-direction: column; justify-content: center; gap: 10px; padding: 4px 0 12px; }
  .rail-mini .rail-brand .nameplate > :not(img) { display: none; }
  .rail-mini .tabbar .tab { justify-content: center; padding: 10px 0; }
  .rail-mini .tabbar .tab > span:not(.tab-icon) { display: none; }
  .rail-mini .rail-me { justify-content: center; padding: 8px 0; border: 0; }
  .rail-mini .rail-me-text { display: none; }
  .rail-tip { display: block; position: fixed; z-index: 60; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: #0b1430; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); pointer-events: none; }
  .rail-tip[hidden] { display: none; }
  .rail-tip::before { content: ""; position: absolute; left: -5px; top: 50%; width: 8px; height: 8px; background: #0b1430; border-left: 1px solid rgba(255, 255, 255, 0.15); border-bottom: 1px solid rgba(255, 255, 255, 0.15); transform: translateY(-50%) rotate(45deg); }
}
/* Agent to agent: vault access, and the History tab */
.a2a-vseg { flex: 1; margin: 0; }
.a2a-vseg .seg { padding: 9px 0; font-size: 15px; }
button.a2a-set.a2a-folder { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.a2a-folder .row-icon { width: 36px; height: 36px; }
.a2a-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--attention); }
.a2a-warn .icon { flex: none; margin-top: 2px; }
.a2a-newfolder { display: flex; gap: 8px; margin: 0 0 12px; }
.a2a-newfolder .field { flex: 1; margin: 0; }
.a2a-newfolder .btn-secondary { width: auto; flex: none; margin: 0; padding: 0 16px; }
.a2a-nofolders { padding: 14px 16px; margin: 0; }
.a2a-terms { display: flex; flex-direction: column; gap: 4px; margin: 0 0 16px; }
.a2a-terms b { margin-top: 10px; font-size: 15px; }
.a2a-terms .a2a-terms-p { margin: 0 0 6px; }
.a2a-tabs { flex: none; width: 220px; margin: 2px auto 8px; padding: 3px; gap: 3px; border-radius: 11px; }
.a2a-tabs .seg { padding: 5px 0; font-size: 14px; border-radius: 9px; }
.a2a-tabs-head { display: none; }
@media (min-width: 700px) {
  .a2a-chat .a2a-tabs:not(.a2a-tabs-head) { display: none; }
  .a2a-tabs-head { display: flex; width: 190px; margin: 0 0 0 auto; flex: none; }
}
@media (min-width: 1100px) {
  .a2a-tabs-head { width: 170px; margin-left: 22px; }
  /* The name never squeezes; Topics gives way first (it ends in "…"). */
  .a2a-head .head-text { flex: none; }
  .a2a-head .head-info { flex: 0 1 auto; min-width: 0; }
  .a2a-head .head-info-item { min-width: 0; }
  .a2a-head .head-info-item:last-child { flex: none; }
  .a2a-head .head-info-item b { max-width: 100%; }
}
.a2a-history { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(90px + var(--safe-b)); overscroll-behavior: contain; }
.a2a-history .search { margin-bottom: 0; }
.a2a-history .group-label { margin: 20px 4px 10px; font-size: 14px; }
.a2a-history .row-detail { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 1100px) {
  /* Same width as the conversation and the header above it. */
  .chat-pane .a2a-history { padding-left: max(16px, calc((100% - 1000px) / 2)); padding-right: max(16px, calc((100% - 1000px) / 2)); }
}
.a2a-hist { align-items: flex-start; text-align: left; }
.a2a-hist .row-title { white-space: normal; }
.a2a-hist .row-detail { white-space: normal; }
.a2a-hist-when { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.a2a-hist-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.a2a-hist-files { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; }
.a2a-used { display: inline-flex; align-items: center; gap: 5px; margin: 6px 4px 0; font-size: 12px; color: var(--accent-text); font-weight: 600; }
.a2a-used .icon { flex: none; }
.a2a-histback { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 4px; }
.a2a-transcript { overflow: visible; padding: 0; }
.a2a-more { margin: 4px 0 12px; }
@media (min-width: 700px) { .a2a-history { padding-bottom: 18px; } }
/* Markets: the disclaimer, and Today's news beside the coins (on phones a Coins / News switch). */
.mk-disclaimer { display: flex; gap: 7px; align-items: flex-start; margin: -6px 0 18px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.mk-disclaimer .icon { flex: none; margin-top: 2px; }
.nw-seg { width: 220px; margin: 0 0 12px; padding: 3px; gap: 3px; border-radius: 11px; }
.nw-seg .seg { padding: 5px 0; font-size: 14px; border-radius: 9px; }
.nw-item { align-items: flex-start; text-decoration: none; color: var(--text); }
.nw-meta { font-size: 12px; color: var(--muted); }
.nw-src { font-weight: 700; color: var(--accent-text); }
.nw-title { display: block; margin-top: 3px; font-size: 15px; font-weight: 600; line-height: 1.35; white-space: normal; }
.nw-out { color: var(--faint); margin-top: 2px; flex: none; }
.nw-wait { display: grid; place-items: center; padding: 28px 0; }
.mk-tabs { margin-bottom: 18px; }
@media (max-width: 1099px) {
  .mk-split[data-tab="coins"] .nw-panel { display: none; }
  .mk-split[data-tab="news"] .mk-coins { display: none; }
  .mk-split .nw-panel > .group-label { display: none; }
}
@media (min-width: 1100px) {
  .mk-tabs { display: none; }
  .page.mk-split { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 26px; align-items: start; }
  .mk-split > .back, .mk-split > .page-title, .mk-split > .page-sub, .mk-split > .mk-disclaimer { grid-column: 1 / -1; }
  .mk-split .nw-panel { position: sticky; top: 18px; }
}
/* Both footnotes sit the same distance under their card. */
.mk-coins > .group:last-of-type { margin-bottom: 0; }
.mk-split .foot-note { margin-top: 14px; }
.mk-split .group + .group .group-label, .mk-split .group-label { margin-top: 0; }
/* CRM polish (Jim, 2026-11-04): calmer sizes, even spacing, the same width as other wide pages. */
.crm-sections { margin: 20px -20px 16px; }
.crm-sec { height: 38px; padding: 0 13px; font-size: 14.5px; border-radius: 11px; }
.crm-stats { gap: 10px; margin-bottom: 16px; padding-top: 2px; padding-bottom: 12px; }
.crm-stat { padding: 11px 15px; gap: 2px; }
.crm-stat b { font-size: 19px; }
.crm-faint { color: var(--faint); }
.crm-scorecell { display: inline-flex; align-items: baseline; gap: 6px; }
.crm-scorecell .muted { font-size: 13px; }
.crm-stage[data-stage="Lead"] { color: #3d6fb6; background: rgba(61, 111, 182, 0.12); }
.crm-stage[data-stage="Contacted"] { color: #0e7fa8; background: rgba(14, 127, 168, 0.12); }
.crm-stage[data-stage="Meeting"] { color: #7b3fb8; background: rgba(123, 63, 184, 0.12); }
.crm-stage[data-stage="Proposal"] { color: #b45d09; background: rgba(217, 119, 6, 0.13); }
.crm-stage[data-stage="Won"] { color: #0f8a4e; background: rgba(22, 163, 90, 0.13); }
.crm-stage[data-stage="Lost"] { color: var(--alert); background: rgba(220, 38, 38, 0.1); }
@media (prefers-color-scheme: dark) {
  .crm-stage[data-stage="Lead"] { color: #8db8f2; } .crm-stage[data-stage="Contacted"] { color: #6fd0f2; } .crm-stage[data-stage="Meeting"] { color: #c7a2f2; }
  .crm-stage[data-stage="Proposal"] { color: #f5b25c; } .crm-stage[data-stage="Won"] { color: #5fd69a; }
}
.crm-ttools { margin-bottom: 16px; }
.crm-filters { margin: 12px -20px 16px; }
.crm-person { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 20px 0 16px; }
.crm-person .crm-av.huge { width: 56px; height: 56px; font-size: 20px; }
.crm-person .crm-quick { flex-basis: 100%; }
.crm-q { padding: 10px 0; gap: 4px; }
.crm-deal-box { padding: 14px 16px; }
@media (min-width: 900px) {
  .page.crm-page { max-width: 1240px; padding-left: 32px; padding-right: 32px; }
  .crm-sections, .crm-filters { margin-left: 0; margin-right: 0; }
  .crm-stats { overflow: visible; padding-bottom: 0; margin-bottom: 18px; }
  .crm-stat { padding: 13px 18px; }
  .crm-stat b { font-size: 21px; }
  .crm-tr { padding: 10px 20px; font-size: 14px; }
  .crm-th { padding-top: 10px; padding-bottom: 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
  .crm-tr .crm-av.big { width: 36px; height: 36px; font-size: 13px; }
  .crm-table-head { padding: 14px 20px; }
  .crm-act-btn { color: var(--faint); }
  .crm-tr:hover .crm-act-btn { color: var(--muted); }
  .crm-ttools { justify-content: space-between; }
  .crm-ttools .crm-search { max-width: 460px; }
  .crm-contact { grid-template-columns: 400px 1fr; gap: 32px; }
  .crm-contact .crm-person { margin-top: 0; }
}
.crm-page .page-sub + .crm-sections { margin-top: 0; }
.crm-page .crm-cl .card.list > .row { padding-top: 10px; padding-bottom: 10px; min-height: 0; }
.crm-page .crm-cl .card.list > .row .row-title { font-size: 16px; }
.crm-ttools .crm-addbtn { box-shadow: none; }
/* Twin Events (a vault app in the CRM's format) */
.ev-date { flex: none; width: 46px; height: 50px; border-radius: 12px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.1; color: var(--text); }
.ev-date b { font-size: 18px; } .ev-date span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.crm-stage.ev-interested { color: #3d6fb6; background: rgba(61, 111, 182, 0.12); }
.crm-stage.ev-going { color: #0f8a4e; background: rgba(22, 163, 90, 0.13); }
.crm-stage.ev-attended { color: var(--muted); background: var(--surface-2); }
.crm-stage.ev-incrm { color: #0f8a4e; background: rgba(22, 163, 90, 0.13); }
.ev-topics { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.crm-tag.ev-topic { color: var(--muted); background: var(--surface-2); }
.crm-tag.ev-topic.ai { color: #7b3fb8; background: rgba(123, 63, 184, 0.12); }
.crm-tag.ev-topic.re { color: #0f7a5c; background: rgba(15, 122, 92, 0.12); }
.ev-info-sheet .sheet { max-width: 620px; }
.ev-info-head { display: flex; align-items: flex-start; gap: 14px; margin: 2px 0 10px; }
.ev-info-head .sheet-title { margin: 0 0 4px; line-height: 1.2; }
.ev-info-tags { margin: 0 0 12px; }
.ev-info-text { margin: 0 0 14px; line-height: 1.5; }
.ev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0 0 6px; }
.ev-fact { display: grid; align-content: start; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ev-fact span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ev-fact b { font-size: 14px; font-weight: 600; }
.ev-info-sheet .group-label { margin-top: 16px; }
.ev-info-sheet .card.list { margin: 0; }
.ev-speakers .row, .ev-info-sheet .card.list .row { min-height: 0; padding: 10px 14px; }
.ev-contact { color: inherit; text-decoration: none; }
.ev-contact .row-title { color: var(--accent-text); font-weight: 600; }
.ev-contact-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--accent-text); }
.ev-info-none { margin: 4px 0 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); line-height: 1.5; }
.ev-info-save { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sheet .ev-info-save .btn-secondary, .sheet .ev-info-save .btn-primary { margin: 0; }
.ev-info-sheet .btn-primary { margin-top: 18px; }
.ev-info-save .btn-primary { margin-top: 0; }
.ev-info-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ev-info-links .crm-btn { text-decoration: none; }
.ev-info-sheet .foot-note { margin: 12px 0 0; }
.ev-info-nospk { margin: 14px 2px 0; }
.ev-pc-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.ev-pc-links a { color: var(--accent-text); font-weight: 600; font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.ev-save { height: 34px; padding: 0 12px; font-size: 14px; }
.ev-statusbtn { border: 0; background: none; padding: 0; cursor: pointer; }
.ev-plus { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--accent-text); }
.ev-row { cursor: pointer; }
.ev-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.ev-todo { font-size: 13px; font-weight: 600; color: var(--attention); }
.ev-head { display: flex; flex-direction: column; gap: 14px; padding: 16px; margin: 20px 0 6px; }
.ev-head-top { display: flex; align-items: center; gap: 12px; }
.ev-head-top b { font-size: 17px; }
.ev-status { margin: 0; }
.ev-status .seg { padding: 8px 0; font-size: 14px; }
.ev-head-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-head-btns .crm-btn { height: 38px; text-decoration: none; }
.ev-notes { width: 100%; box-sizing: border-box; resize: vertical; min-height: 110px; margin: 0; font: inherit; }
.ev-todo-add { gap: 8px; }
.ev-todo-add .field { flex: 1; margin: 0; }
.ev-person .crm-btn { height: 36px; font-size: 13px; }
.ev-plain { border: 0; background: none; padding: 0; text-align: left; color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; }
.ev-page .crm-cl .group-label, .ev-page .crm-cr .group-label { margin-top: 18px; }
.ev-page .crm-cr > .group-label:first-child { margin-top: 0; }
@media (prefers-color-scheme: dark) {
  .crm-stage.ev-interested { color: #8db8f2; } .crm-stage.ev-going, .crm-stage.ev-incrm { color: #5fd69a; } .crm-tag.ev-topic.ai { color: #c7a2f2; } .crm-tag.ev-topic.re { color: #6fd3b0; background: rgba(111, 211, 176, 0.12); }
}
@media (min-width: 900px) {
  .crm-tr.ev-tr { grid-template-columns: minmax(280px, 2.6fr) 1.1fr 1.2fr 1fr 0.9fr 108px; }
  .ev-act { display: flex; justify-content: flex-end; }
  .ev-board .crm-col { flex: 1 0 260px; }
  .ev-detail .ev-head { margin-top: 0; }
}
.ev-page .crm-act-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--faint); display: grid; place-items: center; flex: none; }
.ev-page .crm-act-btn:hover { color: var(--muted); background: var(--surface-2); }
/* Events: the Location filter, a chip with a list. */
.ev-place-wrap { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; outline: none; }
.ev-place-wrap.on { color: var(--text); background: var(--seg-on); border-color: rgba(143, 184, 212, 0.45); }
.ev-place-wrap .icon { flex: none; }
.ev-place-text { padding: 6px 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.ev-pop-back { position: fixed; inset: 0; z-index: 30; }
.ev-pop { position: fixed; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: #121838; color: var(--text); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45); animation: ev-pop-in 0.14s ease-out; }
@keyframes ev-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ev-pop-top { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.ev-pop-find::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.ev-pop-find { flex: 1; min-width: 0; padding: 12px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; outline: none; }
.ev-pop-list { flex: 1; overflow-y: auto; padding: 6px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.ev-pop-label { padding: 12px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.ev-pop-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; outline: none; }
.ev-pop-row:hover, .ev-pop-row:focus-visible { background: var(--surface-2); }
.ev-pop-row.on { background: var(--seg-on); color: var(--accent-text); font-weight: 600; }
.ev-pop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-pop-n { flex: none; color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ev-pop-row.on .ev-pop-n { color: inherit; }
.pick-field { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; font: inherit; font-size: 16px; }
.pick-field:focus { border-color: var(--line); }
.pick-field:focus-visible { border-color: var(--accent); }
.pick-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-field .icon { flex: none; color: var(--muted); }
.ev-pop-none { margin: 0; padding: 18px 10px; color: var(--muted); font-size: 14px; text-align: center; }
@media (prefers-color-scheme: light) { .ev-pop { background: #fff; box-shadow: 0 18px 48px rgba(11, 20, 48, 0.16); } .ev-pop-row.on { background: #e8f1fc; } }
.nowrap { white-space: nowrap; }

/* Right-to-left languages (Arabic): flex rows and text already follow the page direction (i18n.ts sets
   dir="rtl"); these are the few things drawn for left-to-right that need turning around. */
[dir="rtl"] svg[data-icon="back"], [dir="rtl"] svg[data-icon="chevron"] { transform: scaleX(-1); }
[dir="rtl"] .back { margin: 0 -12px 4px 0; }
[dir="rtl"] .menu { left: auto; right: 0; transform: translateX(104%); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4); }
[dir="rtl"] .menu-back.open .menu { transform: none; }
/* Numbers with a sign (+1.8%) and English content (messages, names, briefs) keep their own order. */
[dir="rtl"] .chg { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .bubble, [dir="rtl"] [data-raw], [dir="rtl"] .brief-title, [dir="rtl"] .brief-text, [dir="rtl"] input, [dir="rtl"] textarea { unicode-bidi: plaintext; }
[dir="rtl"] [data-raw]:not(.bubble):not(.hist-text), [dir="rtl"] .brief-title, [dir="rtl"] .brief-text { text-align: right; }

/* Client tabs on wide screens, in the Admin console's look (dash.ts). */
.ax.dash { max-width: 1240px; }
.ax.dash > .back { margin: 0 0 6px -8px; }
.cx-grid.c2e { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cx-grid.c3e { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.dash-seg { width: auto; margin: 0; padding: 3px; }
.dash-seg .seg { padding: 6px 16px; font-size: 12.5px; min-height: 0; }
.cx-kpi.t-blue { --tone: #0c9dd8; --tone-bg: rgba(12, 157, 216, 0.12); }
button.cx-card { font: inherit; color: inherit; text-align: left; width: 100%; }
.dash-click { cursor: pointer; }
.dash-click:hover { border-color: var(--accent); }
.cx-kpi .cx-d .delta { font-size: 11.5px; }
.dash-panel { padding: 2px 0 4px; }
.dash-panel > h3 { padding: 14px 18px 6px; margin: 0; }
.dash-row { padding: 10px 18px; cursor: default; }
button.dash-row { cursor: pointer; }
button.dash-row:hover { background: var(--surface-2); }
.dash-row .ax-row-top { font-size: 13.5px; }
.dash-row .ax-row-sub { font-size: 12px; margin-top: 1px; }
.dash-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); flex: none; }
.dash-val { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dash-row > .icon, .dash-row > svg { color: var(--faint); flex: none; }
@media (max-width: 1180px) { .cx-grid.c3e { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Wide screens: every client screen in the Admin console's sizes. Small title, compact rows,
   14px corners, full width beside the sidebar. Phones are untouched. */
@media (min-width: 1100px) {
  .screen > .page:not(.home) { max-width: 1240px; padding: calc(26px + var(--safe-t)) 34px 40px; margin: 0 auto; }
  .screen > .page:not(.home)::before, .screen > .page:not(.home)::after { display: none; }
  .screen > .page.sub { max-width: 920px; }
  .page:not(.home) > .back { width: 36px; height: 36px; margin: 0 0 4px -8px; }
  .page:not(.home) > .page-title { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
  .page:not(.home) > .page-sub { font-size: 12.5px; margin: 2px 0 20px; }
  .page:not(.home) > .page-title + :not(.page-sub) { margin-top: 20px; }
  .page:not(.home) .card { border-radius: 14px; }
  .page:not(.home) .group { margin-bottom: 18px; }
  .page:not(.home) .group-label { color: var(--text); font-size: 13.5px; font-weight: 650; margin: 0 0 10px; }
  .page:not(.home) .row { min-height: 0; padding: 11px 18px; gap: 12px; }
  .page:not(.home) .row-title { font-size: 13.5px; }
  .page:not(.home) .row-detail { font-size: 12px; }
  .page:not(.home) .row-icon, .page:not(.home) .letter { width: 32px; height: 32px; font-size: 13px; }
  .page:not(.home) .row-icon svg { width: 17px; height: 17px; }
  .page:not(.home) .row-value { font-size: 12.5px; }
  .page:not(.home) .status { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
  .page:not(.home) .switch { width: 42px; height: 24px; }
  .page:not(.home) .check svg { width: 18px; height: 18px; }
  .page:not(.home) .search, .page:not(.home) .field { font-size: 13px; padding: 9px 12px; border-radius: 10px; }
  .page:not(.home) .search { margin-bottom: 18px; }
  .page:not(.home) .note { padding: 14px 18px; font-size: 13.5px; }
  .page:not(.home) .foot-note, .page:not(.home) .group-foot { font-size: 12px; text-align: left; }
  .page:not(.home) .stat strong { font-size: 24px; }
  .page:not(.home) .big-number { font-size: 30px; }
  .page:not(.home) .eyebrow { font-size: 12px; }
  .page:not(.home) .btn-primary, .page:not(.home) .btn-secondary { font-size: 13.5px; padding: 10px 16px; }
  /* Skills: smaller group tiles and heads. */
  .skill-group-head { padding: 11px 18px; }
  .skill-group-head .row-title { font-size: 14px; }
  .skill-group-head .row-detail { font-size: 12px; }
  .skill-badge { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
  .skill-badge svg { width: 17px; height: 17px; }
  /* Language: a grid of tiles instead of one long list. */
  .lang-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: none; border: 0; box-shadow: none; overflow: visible; }
  .lang-list > .row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--card-shadow); padding: 12px 16px; }
  .lang-list > .row[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
  .lang-list > .row:hover { background: var(--surface-2); }
}
@media (min-width: 1100px) {
  .apps-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
  .apps-col > :last-child { margin-bottom: 0; }
}
@media (min-width: 1100px) {
  /* Vault's figure cards get the Admin cards' coloured top line. */
  .vault-page > .vault-storage, .vault-page .vault-totals > .card { position: relative; overflow: hidden; }
  .vault-page > .vault-storage::before, .vault-page .vault-totals > .card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #0c9dd8, transparent 85%); }
  .vault-page .vault-totals > .card:nth-child(1)::before { background: linear-gradient(90deg, #2a3fb0, transparent 85%); }
  .vault-page .vault-totals > .card:nth-child(2)::before { background: linear-gradient(90deg, #7c5ce6, transparent 85%); }
}
.apps-col + .apps-col { margin-top: 20px; }
@media (min-width: 1100px) { .apps-col + .apps-col { margin-top: 0; } }
@media (min-width: 1100px) {
  .dash-lang { padding: 4px 18px 16px; }
  .dash-lang .lang-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dash-lang .lang-list > .row { padding: 9px 14px; min-height: 0; }
  .dash-lang + .dash-row { border-top: 1px solid var(--line); }
  .dash-row .switch { width: 42px; height: 24px; }
  .dash-row .menu-badge { margin-left: auto; }
}
@media (min-width: 1100px) {
  .page:not(.home) .switch, .dash-row .switch { width: 40px; height: 24px; border-radius: 7px; }
  .page:not(.home) .switch::after, .dash-row .switch::after { top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 5px; background-size: 11px; }
  .page:not(.home) .switch.on::after, .dash-row .switch.on::after { transform: translateX(16px); }
}
@media (min-width: 1100px) {
  .dash-lang .row-title { font-size: 13.5px; font-weight: 600; }
  .dash-lang .row-detail { font-size: 12px; }
  .dash-lang .check svg { width: 18px; height: 18px; }
}
@media (min-width: 1100px) {
  /* Skills: every group open, as panels in columns (each keeps its own height). */
  .page > .cx-grid { margin: 0 0 18px; }
  .skill-groups.skill-wide { display: flex; gap: 16px; align-items: flex-start; background: none; border: 0; box-shadow: none; overflow: visible; margin-bottom: 18px; }
  .skill-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
  .skill-wide .skill-group { margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--card-shadow); overflow: hidden; }
  .skill-wide .skill-group:not(.all):not(.searching) .skill-rows > .row.skill:nth-child(n+6) { display: none; }
  .skill-wide .skill-group.searching > .skill-more { display: none; }
  .skill-wide .row.skill .row-detail { -webkit-line-clamp: 1; }
  .skill-more { display: block; width: 100%; padding: 9px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent-text); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
  .skill-more:hover { background: var(--surface-2); }
  .apps-panel .skill-rows > .row { padding: 9px 16px; }
  .apps-panel-label { margin: 0; padding: 8px 16px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
  .apps-panel .skill-count.fix { color: var(--attention); background: var(--attention-bg); }
  .skill-badge.tone-apps { background: linear-gradient(135deg, #10b981, #0f766e); }
  .skill-wide .skill-group-head { cursor: default; pointer-events: none; padding: 12px 16px; }
  .skill-wide .skill-chev { display: none; }
  .skill-wide .skill-group[hidden] { display: none; }
  .page .row.skill { padding: 9px 16px; }
  .page .row.skill .row-title { font-size: 13px; }
  .page .row.skill .row-detail { font-size: 11.5px; }
  .page .skill-icon { width: 28px; height: 28px; font-size: 14px; }
  .page .skill-count { font-size: 11.5px; padding: 2px 8px; }
}
@media (min-width: 1100px) {
  .dash-chart-card { padding: 14px 18px 12px; }
  .dash-chart { display: flex; align-items: stretch; gap: 10px; height: 190px; }
  .dash-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .dash-bar-v { font-size: 11px; color: var(--muted); white-space: nowrap; }
  .dash-bar-col { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
  .dash-bar-col i { display: block; width: 100%; background: linear-gradient(180deg, rgba(12, 157, 216, 0.55), rgba(42, 63, 176, 0.55)); border-radius: 8px; }
  .dash-bar.now .dash-bar-col i { background: var(--twin); }
  .dash-bar.now .dash-bar-v { color: var(--text); font-weight: 600; }
  .dash-bar-l { font-size: 11.5px; color: var(--muted); }
  .ax.dash .cx-grid.c2 { align-items: stretch; }
}
.hub-matches { margin-top: 20px; }
@media (min-width: 1100px) {
  .skill-find { margin-top: 2px; }
  .skill-find > .search { margin-bottom: 12px; }
  .skill-find > .skill-add { margin-bottom: 0; }
  .skill-find .hub-matches { margin-top: 18px; }
}
/* Wide screens: every page's title starts under the line below the sidebar's logo, and the Twin glyph
   sits faintly in the lower right corner behind the content (not behind chat). */
@media (min-width: 1100px) {
  .screen > .page:not(.home), .screen > .ax { padding-top: calc(90px + var(--safe-t)); }
  .screen > .page.sub > .back, .screen > .ax > .back { margin-top: -46px; }
  /* The Twin mark, large and cut off by the corner (shell.ts): shown behind every screen but Home and Chat. */
  .corner-mark { display: block; position: fixed; right: -70px; bottom: -80px; width: 380px; height: 380px; pointer-events: none; user-select: none; }
  .shell:has(> .content > .screen:not(.parked):not(.leaving) > .home) > .corner-mark,
  .shell:has(> .content > .screen:not(.parked):not(.leaving) > .chat-split) > .corner-mark,
  .shell:has(> .content > .screen:not(.parked):not(.leaving) > .chat) > .corner-mark { display: none; }
}
@media (min-width: 1100px) {
  .skill-apps { margin: 2px 0 18px; }
  .skill-apps-title { font-size: 15px; font-weight: 650; margin: 0 0 12px; color: var(--text); }
}
.agent-pic { display: flex; align-items: center; gap: 16px; }
.agent-fields .setup-label:first-child { margin-top: 0; }
.agent-fields .field + .setup-label { margin-top: 12px; }
.agent-fields .btn-primary { width: 100%; margin-top: 14px; }
@media (min-width: 1100px) {
  .agent-profile-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
  .agent-profile-body .card { box-shadow: none; }
  .agent-profile-body .agent-pic { padding: 12px 14px; }
  .agent-profile-body .agent-fields { padding: 14px; }
  .agent-profile-body .field { font-size: 13px; padding: 9px 12px; border-radius: 10px; }
  .agent-profile-body .setup-label { font-size: 12px; }
  .agent-profile-body .btn-primary { font-size: 13.5px; padding: 10px 16px; }
}
.menu-agent-about { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.skill-apps-phone { margin-top: 24px; }
/* Sidebar folding: labels never wrap while the width changes; they are clipped and revealed as it grows. */
@media (min-width: 700px) {
  .tabbar { overflow: hidden; }
  .tabbar .tab, .rail-brand, .rail-me { overflow: hidden; }
  .tabbar .tab > span:not(.tab-icon), .rail-brand .nameplate, .rail-me-text, .rail-me-text b, .rail-me-text small { white-space: nowrap; }
  .rail-brand .nameplate { min-width: 0; overflow: hidden; }
  .rail-toggle { flex: none; }
  .tabbar .tab .tab-icon, .rail-me .me { flex: none; }
}
.rail-logo { display: flex; align-items: center; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 8px; }
.rail-logo:hover { opacity: 0.85; }
.rail-logo:focus-visible { outline: 2px solid #5cc8f5; outline-offset: 3px; }
@media (min-width: 700px) { .rail-logo { overflow: hidden; } }
/* Sidebar labels sit a pixel low so the letters line up with the middle of their icons. */
@media (min-width: 700px) { .tabbar .tab > span:not(.tab-icon), .rail-me-text b { position: relative; top: 1px; } }
