/* 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 { position: relative; 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; }
/* The first screen: the mark, a welcome and a progress bar (like the CRM's) while the app gets ready.
   The bar fills on its own to 92% and the app finishes it when the first screen is ready. */
.boot-box { display: flex; flex-direction: column; align-items: center; width: min(260px, calc(100vw - 64px)); }
.boot-glyph { width: 56px; height: 56px; object-fit: contain; margin-bottom: 22px; }
.boot-glyph.branded { border-radius: 14px; background: var(--twin); padding: 10px; box-sizing: border-box; }
.boot-title { margin: 0; white-space: nowrap; font-size: min(22px, 5.4vw); font-weight: 700; line-height: 1.25; color: #0b1030; text-align: center; letter-spacing: -0.01em; }
.boot-sub { margin: 6px 0 18px; font-size: 15px; line-height: 1.3; color: #4a5578; text-align: center; }
.boot-bar { width: 100%; height: 6px; border-radius: 3px; background: #e2e8f2; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #0c9dd8, #2a3fb0); animation: boot-fill 6s cubic-bezier(0.15, 0.75, 0.3, 1) forwards; }
@keyframes boot-fill { from { width: 4%; } to { width: 92%; } }
.branded-boot .boot-splash .boot-glyph:not(.branded) { visibility: hidden; }
/* Still on the logo after 12 seconds (theme-boot.js): a note and Try again under it. */
.boot-slow { position: absolute; left: 24px; right: 24px; bottom: calc(48px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.boot-slow p { margin: 0; color: #4a5578; font-size: 15px; }
.boot-slow button { border: 0; border-radius: 14px; padding: 13px 28px; font: inherit; font-weight: 600; font-size: 16px; color: #fff; background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }

/* 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-text.lines .sn { display: 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%); width: max-content; max-width: calc(100% - 40px); box-sizing: border-box; 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; }
/* Every sheet fits the screen it's on: a short screen, a fold, or one with the keyboard up (the
   viewport shrinks with the keyboard, interactive-widget=resizes-content). Taller ones scroll inside. */
.sheet { box-sizing: border-box; max-height: calc(100% - 12px - var(--safe-t)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, 0.35) transparent; }
@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: var(--twin); 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 .page-sub .sn { display: block; }
.welcome .page-sub .sn, .ob .page-sub .sn { display: block; }
.consent-point .sn { display: block; }
.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.ft-doc { color: var(--accent-text); }
.ext-tile.ft-sheet { color: #35b37e; }
.ext-tile.ft-image { color: #d66aa3; }
.ext-tile.ft-media { color: #9b7bea; }
.ext-tile.ft-other { color: var(--muted); }
.vault-file .row-title, .vault-act .row-title { word-break: break-word; }
.row-detail.facts { display: block; overflow: hidden; }
.row-detail.facts > span { display: flex; flex-wrap: wrap; margin-inline-start: -14px; }
.row-detail .fact { min-width: 0; overflow-wrap: anywhere; }
.row-detail .fact::before { content: "·"; display: inline-block; width: 14px; text-align: center; }
.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: calc(32px + var(--safe-b)); }
  .screen:has(> .chat) { padding-bottom: 0; }
  .chat { max-width: 880px; }
  .chat .composer { padding-bottom: calc(18px + var(--safe-b)); }
  .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: calc(36px + var(--safe-b)); }
  .sheet-back { align-items: center; justify-content: center; padding: 24px 24px calc(24px + var(--safe-b)); }
  .sheet { max-width: 460px; max-height: 100%; border-radius: 22px; padding: 22px 24px 22px; animation: fade 0.18s ease-out; }
  /* Connect <AI app>: wide, the steps on the left and how to save on the right. How to save alone: pictures side by side. */
  .ai-wide .sheet { max-width: 900px; }
  .ai-wide .ai-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: stretch; }
  .ai-wide .ai-cols > .ai-steps { margin-top: 0; display: flex; flex-direction: column; }
  .ai-wide .ai-cols > .ai-steps > .card { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .ai-wide .ai-cols > .ai-how { order: 1; }
  .ai-wide .ai-cols > .ai-addr { order: 2; }
  .ai-wide .ai-cols .ai-list { padding-top: 0; }
  /* Then, to save: full width, the two pictures side by side. */
  .ai-wide .ai-cols + .ai-steps .ai-part { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; padding-right: 14px; }
  .ai-wide .ai-cols + .ai-steps .ai-part > .ai-list { grid-column: 1 / -1; }
  .ai-wide .ai-cols + .ai-steps .ai-part > .ai-shot { margin-right: 0; align-self: start; }
  .ai-guide:not(.ai-wide) .sheet { max-width: 720px; }
  .ai-guide:not(.ai-wide) .ai-part { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; padding-right: 14px; }
  .ai-guide:not(.ai-wide) .ai-part > .ai-list { grid-column: 1 / -1; }
  .ai-guide:not(.ai-wide) .ai-part > .ai-shot { margin-right: 0; align-self: start; }
  .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); }
html.ed-xappx .ob-steps { display: none; }
.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; }
/* Sign-up step 2 in XAPPX: with or without an agent, two cards side by side (stacked on small phones). */
.ob-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; }
.ob-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.ob-choice[aria-checked="true"] { border-color: var(--accent-text); background: var(--x-chip, var(--surface-2)); }
.ob-choice-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent-text); }
.ob-choice b { display: block; font-size: 15px; font-weight: 600; }
.ob-choice small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 3px; }
.ob-choice small .sn { display: block; }
/* Phones: one card per row, icon beside the text, so each sentence keeps to one line. */
@media (max-width: 699px) { .ob-choices { grid-template-columns: minmax(0, 1fr); } .ob-choice { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; } .ob-choice-ic { flex: none; } }
.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; }
/* XAPPX: the wide-screen page rule (margin 2px 0 20px) would pull the welcome lines to the left. */
html.ed-xappx .page.welcome > .page-sub { margin-left: auto; margin-right: auto; }
.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: 6px; }
.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; }
/* The role picker and the line that says what the role may do: the line sits close under the picker
   it describes, with the same room before the button as between the other parts of the dialog. */
.role-pick { margin: 0 0 20px; }
.role-pick .segmented { margin-bottom: 0; }
.role-text { margin: 8px 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-save { margin: 0 0 16px; }
.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-lines > span { display: block; }
.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); }
/* The agent's conversations with other agents and vaults, beside search. */
.head-chats { flex: none; position: relative; color: var(--muted); }
.head-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.head-count[hidden] { display: none; }
.ac-sheet .sheet { padding-left: 8px; padding-right: 8px; }
.ac-sheet .crm-sheet-head { margin-left: 4px; }
.ac-sheet .cl-label:first-child { padding-top: 4px; }
.ac-body { padding-bottom: 8px; }
.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; }
/* Add files: picked, or dropped anywhere on the Vault screen (the box lights up while dragging). */
.vault-drop { margin: 0 0 16px; border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); transition: border-color 0.15s, background-color 0.15s; }
.vault-drop.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.vault-ups { border-top: 1px solid var(--line); }
.vault-up .row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-up.ready .tray-track, .vault-up.failed .tray-track { display: none; }
.vault-up.failed .row-detail { color: var(--alert); }
.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); }
/* Secure box: the card in the chat the person taps when they have the value ready, and the steps in the box. */
.ask-card { display: flex; flex-direction: column; align-items: stretch; align-self: flex-start; box-sizing: border-box; width: min(320px, calc(100% - 56px)); margin: 2px 0 10px 44px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ask-head { display: flex; align-items: center; gap: 10px; }
.ask-text { display: flex; flex-direction: column; min-width: 0; }
.ask-title { font-weight: 600; font-size: 15px; }
.ask-sub { font-size: 13px; color: var(--muted); }
.ask-acts { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.ask-acts .ask-go { width: auto; flex: 1; margin: 0; padding: 10px 14px; font-size: 15px; white-space: nowrap; }
.ask-acts .text-btn { white-space: nowrap; }
.ask-steps { margin: 0 0 4px; padding-left: 22px; color: var(--text); font-size: 15px; line-height: 1.5; }
.ask-steps li { margin: 2px 0; }
.ask-steps .text-btn { padding: 0; text-decoration: underline; }
.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; }
.pj-novault { margin: 0 0 16px; }
.pj-novault .sheet-text { margin-bottom: 10px; }
.pj-novault .sn { display: block; }
.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; }
/* A note above the sign-in form, for example an invite link that no longer works. */
.signin-notice { margin: -14px 0 18px; padding: 10px 12px; border-radius: 12px; background: #fff4e0; color: #7a4b00; font-size: 14px; line-height: 1.45; }
.signin-notice .sn { display: block; }
html.ed-xappx .signin-notice { background: rgba(240, 170, 60, 0.12); color: #f2c27a; }
@media (prefers-color-scheme: light) { html.ed-xappx .signin-notice { background: #fff4e0; color: #7a4b00; } }

/* 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: var(--rail-text, #c9d2ec);
    background: var(--rail-bg, 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: var(--rail-text, #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: var(--rail-on, linear-gradient(90deg, rgba(12, 157, 216, 0.32), rgba(42, 63, 176, 0.12))); box-shadow: inset 3px 0 0 var(--rail-on-mark, #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: var(--rail-text, #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: var(--twin); 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; }
  /* A slim band: "<agent> is ready" on top, "Evening, Jim · date" under it, the agent pill centred on the right. */
  .home-band { border-radius: 24px; padding: 22px 220px 22px 28px; display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; }
  .home-band::before { display: none; }
  .home-band > * { max-width: none; margin-left: 0; margin-right: 0; }
  .home-band .greeting { grid-row: 1; grid-column: 1 / -1; font-size: 26px; margin: 0 0 6px; }
  .home-band .band-sub { grid-row: 2; grid-column: 1; font-size: 14px; }
  .home-band .band-meta { grid-row: 2; grid-column: 2; font-size: 14px; }
  .home-band .band-meta::before { content: "\00b7"; margin: 0 8px; }
  .home-band .band-mark { right: -24px; bottom: -64px; width: 150px; }
  .home-head { position: absolute; top: 50%; right: 28px; transform: translateY(-50%); min-height: 0; margin: 0; 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-drop, .vault-page > .vault-search, .vault-page > .vault-results, .vault-page > .text-btn { grid-column: 1 / -1; }
  .vault-page > .vault-drop { margin-bottom: 20px; }
  .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 lists beside each other end level (a long name wraps whole,
     never cut). 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:not([hidden]) { align-self: stretch; display: flex; flex-direction: column; }
  .vault-page > .group > .card.list { flex: 1; }
  .vault-page > .vault-activity > .act-seg { display: none; }
  /* Connect your AI chat on PC: the four apps side by side across the page, each in its own card. */
  .vault-page > .group.vault-ai { grid-column: 1 / -1; align-self: start; margin-bottom: 20px; }
  .vault-page > .group.vault-ai > .card.list { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .vault-page > .group.vault-ai .card.list > :nth-child(n) { display: flex; }
  .vault-page > .group.vault-ai .card.list > .row { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--card-shadow); padding-left: 18px; padding-right: 14px; gap: 10px; }
  .vault-page > .group.vault-ai .ai-row::before { right: 0; bottom: auto; width: auto; height: 3px; background: linear-gradient(90deg, var(--ai-c, var(--accent)), transparent 85%); }
  .vault-page > .group.vault-ai .ai-row-gemini::before { background: linear-gradient(90deg, #4285f4, #9b72cb 45%, transparent 85%); }
}

/* 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:not(.row) { 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:not(.row) .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; }
  .chat-split .head-chats { margin-left: auto; }
  .chat-split .head-chats + .head-search { margin-left: 0; }
  .chat-split .head-gear { 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 calc(18px + var(--safe-b)); 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; }
/* Unread, like a messenger: bold name and last message, the time in the accent colour, a count. */
.cl-row.unread .cl-name { font-weight: 800; }
.cl-row.unread .cl-sub { color: var(--text); font-weight: 600; }
.cl-row.unread .cl-time { color: var(--accent-text); font-weight: 700; }
.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; }
/* The + sits in a column as wide as the pictures above it, so the words line up with the names. */
.cl-add { display: flex; align-items: center; gap: 12px; 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-ic { width: 42px; flex: none; display: grid; place-items: center; }
.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 14px; }
.list-mode .cl-add-ic { width: 48px; }
.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: calc(24px + var(--safe-b)); } .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); }
.list-mode .a2a-faces { width: 48px; height: 48px; }
.list-mode .a2a-faces .cl-face { width: 32px; height: 32px; font-size: 13px; }
.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: calc(18px + var(--safe-b)); } }
.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)); }
  /* The profile button sits where Home's does and lines up with the page titles (centre 40px). */
  .home-band { padding-top: calc(14px + var(--safe-t)); }
  .shell > .me-fixed { top: calc(22px + var(--safe-t)); }
  .shell:has(> .content > .screen:not(.parked):not(.leaving):not(.staged) .chat-head) > .me-fixed { top: calc(34px + var(--safe-t)); }
}
/* It fades with the screens instead of jumping in or out (shell.ts applyMe). */
.shell > .me-fixed.me-in { animation: screen-in 0.18s ease-out both; }
.shell > .me-fixed.me-out { animation: screen-out 0.16s ease-out forwards; }
/* A chat opened with a back arrow has no profile button beside it: its buttons go to the edge. */
@media (max-width: 1099px) { .chat-head:has(> .head-back) { padding-right: 10px; } }
/* 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; width: fit-content; max-width: 100%; box-sizing: border-box; gap: 4px; background: var(--seg); border-radius: 12px; padding: 4px; margin: -6px 0 20px; overflow-x: auto; scrollbar-width: none; }
.ax-tabs button { background: none; border: 1px solid transparent; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 14px; 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); background: var(--seg-on); border-color: rgba(143, 184, 212, 0.45); }
.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; }
/* A name with a tag beside it (You, Invited): the name shortens, the tag stays whole. */
.cx-who > .cx-who { min-width: 0; flex: 0 1 auto; }
.cx-who > .cx-pill { flex: none; }
.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 0 16px; }
.ax.narrow .ax-tabs button { font-size: 14px; padding: 8px 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; }
.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); }
}

.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; }
/* Phones: the sections share the width (no sideways scrolling); More sits on its own line below. */
.crm-sections { display: flex; flex-wrap: wrap; column-gap: 6px; row-gap: 0; margin: 18px 0 14px; }
.crm-sections > .crm-sec { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 6px; }
.crm-sections:has(> .more)::after { content: ""; flex-basis: 100%; height: 0; }
.crm-sections > .crm-sec.more { flex: 0 0 auto; padding: 0 14px; order: 1; margin-top: 8px; }
.crm-sections:has(> .crm-sec:nth-child(4)) > .crm-sec:not(.more) > .icon { display: none; }
@media (max-width: 380px) { .crm-sections > .crm-sec { font-size: 13.5px; } }
.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); }
/* Phones: the figures in two columns (no sideways scrolling); an odd last one spans the row. */
.crm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.crm-stats > .crm-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.crm-stat { min-width: 0; 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; }
/* Search and the blue button the same height, with the usual space before what comes next. */
.crm-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.crm-toolbar + .crm-filters { margin-top: 0; }
.crm-search { flex: 1; min-width: 0; margin: 0; height: 44px; box-sizing: border-box; }
.crm-toolbar > .crm-addbtn, .page:not(.home) .crm-toolbar > .crm-search { 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 { flex-wrap: wrap; margin: 12px 0 14px; }
.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 { grid-template-columns: repeat(5, 1fr); }
  .crm-stats > .crm-stat:last-child:nth-child(odd) { grid-column: auto; }
  .crm-sections { flex-wrap: nowrap; }
  .crm-sections:has(> .more)::after { display: none; }
  .crm-sections > .crm-sec.more { margin-top: 0; }
  .crm-sections > .crm-sec, .crm-sections > .crm-sec.more { flex: none; padding: 0 14px; }
  .crm-sections:has(> .crm-sec:nth-child(4)) > .crm-sec:not(.more) > .icon { display: inline-flex; }
  .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; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 6px 0 4px; }
.crm-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
.crm-field > span:first-child { 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 0; }
.crm-check input { width: 20px; height: 20px; margin: 0; accent-color: #1f6fd0; }
.crm-del { margin-top: 6px; color: var(--alert); }
.crm-sheet .sheet { max-height: min(92vh, 100%); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, 0.35) transparent; }
.crm-fsheet .sheet { display: flex; flex-direction: column; overflow: hidden; }
.crm-fsheet .crm-sheet-head { flex: none; }
.crm-sheet-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; margin: 0 -24px; padding: 0 24px 2px; scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, 0.35) transparent; }
.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: calc(18px + var(--safe-b)); } }
/* 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 0 16px; }
.crm-sec { height: 38px; padding: 0 13px; font-size: 14.5px; border-radius: 11px; }
.crm-stats { gap: 10px; margin-bottom: 16px; }
.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 0 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; }
  /* Centered screens (welcome, "on the way") keep their subtitle under the title. */
  .page.welcome:not(.home) > .page-sub { margin-left: auto; margin-right: auto; }
  .page.welcome:not(.home) .foot-note { text-align: center; }
  .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; } }

/* Pull to refresh: a round button that follows the finger down from the top, then spins. */
.ptr { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; z-index: 30; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bubble); color: var(--muted); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18); opacity: 0; transform: translate(-50%, -46px); pointer-events: none; }
.ptr.ready, .ptr.spin { color: var(--accent-text); }
.ptr.spin svg { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (min-width: 700px) and (hover: hover) { .ptr { display: none; } }
html, body { overscroll-behavior-y: none; }
/* CRM: up to five quick actions in one row (WhatsApp shows when the number has its country code). */
.crm-quick { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.crm-q span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* CRM: social and web links on a contact. */
.crm-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.crm-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; font-size: 14px; font-weight: 600; color: var(--accent-text); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; }
.crm-linkbox { border: 1px solid var(--sheet-line); border-radius: 14px; padding: 0 14px; }
.crm-linkbox > summary { cursor: pointer; padding: 13px 0; font-weight: 600; color: var(--sheet-text); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.crm-linkbox > summary::-webkit-details-marker { display: none; }
.crm-linkbox > summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--sheet-muted); }
.crm-linkbox[open] > summary::after { content: "–"; }
.crm-linkbox[open] { padding-bottom: 12px; display: grid; gap: 12px; }
/* CRM: pick a file from the vault. */
.crm-vpick { display: grid; gap: 10px; min-height: 120px; max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 12px; }
.crm-vpath { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--sheet-text); }
.crm-vpick .row.busy { opacity: 0.55; }
.loading.small { min-height: 100px; }
/* CRM: Social finder on a contact. */
.crm-links-row .row-text { gap: 2px; }
.crm-link.found { padding: 0 4px 0 0; gap: 0; border-style: dashed; }
.crm-link.found > a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; color: inherit; text-decoration: none; }
.crm-link-x { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.crm-link-x:hover { background: var(--surface-2); color: var(--text); }
.crm-found-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--attention); background: var(--attention-bg); vertical-align: middle; }
.crm-found-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 13px; color: var(--attention); }
.crm-find { display: grid; gap: 6px; margin-top: 10px; }
.crm-find-btn { justify-self: start; height: 38px; color: var(--accent-text); }
.crm-find-btn.busy { opacity: 0.75; }
.spinner.tiny { width: 14px; height: 14px; border-width: 2px; }
/* CRM: Social finder settings. Everything inside an option lines up with its title (radio 20px + gap 12px). */
.crm-finder { display: grid; gap: 10px; margin: 14px 0 4px; }
.crm-finder-opt { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 16px; }
.crm-finder-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.crm-finder-pick { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.crm-finder-pick .row-text { display: grid; gap: 3px; }
.crm-radio { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--faint); box-sizing: border-box; }
.crm-finder-opt.on .crm-radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 5px); }
.crm-finder-body { display: grid; gap: 10px; margin: -4px 0 0 32px; padding-bottom: 16px; }
.crm-finder-body .crm-check { padding: 0; margin: 0; color: var(--text); }
.crm-finder-body .crm-field { margin: 0; }
.crm-finder-body p { margin: 0; }
.crm-finder-key { display: flex; gap: 8px; }
.crm-finder-key .field { flex: 1; min-width: 0; height: 44px; }
.crm-finder-key .crm-btn { height: 44px; }
.crm-finder-saved { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.crm-finder .row-detail { white-space: normal; }
.crm-finder-notes { display: grid; gap: 2px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.crm-finder-notes p { margin: 0; }
/* CRM import: a file in an older format shows, greyed, with how to fix it. */
.crm-vpick .row.off { opacity: 0.55; cursor: default; }
.crm-vpick-both .row-icon { color: var(--accent-text); }
.crm-import-status:empty { display: none; }
.crm-vpick-more { justify-self: start; padding: 4px 2px; }
.crm-vpick .row.busy { opacity: 1; }
.crm-vpick .row.busy .row-detail { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); }

/* CRM laid out like the Admin console (title and actions, tabs, summary cards, then the list). */
.crm-cx > .back { margin: 0 0 6px -8px; }
.crm-cx .cx-btn { display: inline-flex; align-items: center; gap: 6px; }
.crm-cx .crm-kpi { font: inherit; color: inherit; text-align: left; display: flex; flex-direction: column; justify-content: flex-start; }
.crm-cx .crm-kpi .cx-v { line-height: 32px; height: 32px; }
.crm-cx .crm-kpi .cx-v.sm { margin: 2px 0 0; display: flex; align-items: center; }
.crm-cx .crm-kpi.go { cursor: pointer; }
.crm-cx .crm-kpi.go:hover { border-color: var(--accent); }
.crm-cx .crm-kpi.t-violet .cx-v.sm { color: var(--accent-text); }
.crm-cx .crm-cxbar .cx-filters { flex: 1; min-width: 0; }
.crm-cx .crm-cxbar .cx-search { width: 300px; flex: none; height: auto; }
.crm-cx .cx-chip .icon { margin-left: 2px; }
.ax.narrow.crm-cx .cx-btn { font-size: 14px; padding: 10px 14px; }
.ax.narrow.crm-cx .crm-cxbar { flex-direction: column-reverse; }
.ax.narrow.crm-cx .crm-cxbar .cx-search { width: 100%; }

/* CRM contact, console style. */
.crm-ct .cx-top { align-items: center; }
.crm-ct-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.crm-ct .crm-ct-av { width: 48px; height: 48px; font-size: 17px; flex: none; }
.crm-ct-name { min-width: 0; }
.crm-ct-name h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-ct-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.crm-ct-meta .crm-score { font-size: 14px; }
.crm-ct-dot::before { content: "·"; margin-right: 8px; color: var(--faint); }
.crm-ct-quick { display: flex; gap: 10px; flex-wrap: wrap; }
.crm-ct-q { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.crm-ct-q:hover { border-color: var(--accent); }
.crm-ct-q.off { color: var(--faint); cursor: default; opacity: 0.6; }
.crm-ct-q.off:hover { border-color: var(--line); }
.crm-ct-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.crm-ct-card h3 .cx-link { margin-left: auto; }
.crm-ct-none { font-size: 13px; margin: 0; }
.crm-ct-rows > .row { padding: 10px 0; min-height: 0; border-top: 1px solid var(--line); background: none; border-radius: 0; }
.crm-ct-rows > .row:first-child { border-top: 0; padding-top: 2px; }
.crm-ct .crm-deal-box { margin: 0; }
.crm-dt { align-items: baseline; border-top: 0; padding: 8px 0; }
.crm-dt-l { flex: none; width: 76px; color: var(--muted); font-size: 12.5px; }
.crm-dt-v { flex: 1; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.crm-dt-v .cx-filters { gap: 6px; }
.crm-dt-links .crm-links-row { padding: 0; min-height: 0; border: 0; background: none; }
.crm-dt-links .crm-links-row .row-text > .row-detail:first-child { display: none; }
.crm-dt-links .crm-find { margin-top: 0; }
.ax.narrow.crm-ct .cx-top { flex-direction: column; align-items: flex-start; }
.ax.narrow.crm-ct .crm-ct-name h1 { font-size: 26px; white-space: normal; }
.ax.narrow.crm-ct .crm-ct-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.ax.narrow.crm-ct .crm-ct-q { flex-direction: column; height: auto; padding: 10px 0; gap: 4px; justify-content: center; font-size: 12.5px; }
.ax.narrow.crm-ct .crm-ct-col { gap: 12px; }
.ax.narrow.crm-ct .crm-dt-v { font-size: 15px; }
.ax.narrow.crm-ct .crm-dt-l { font-size: 13px; width: 70px; }
.crm-ct-card h3 .cx-link { font-size: 13px; line-height: 20px; }
.crm-dt-links .crm-links + .crm-find, .crm-dt-links .crm-links + .crm-found-note, .crm-dt-links .crm-found-note + .crm-find { margin-top: 10px; }

/* CRM collaborators. */
.crm-shared-sub { display: grid; gap: 4px; justify-items: start; }
.crm-shared-title { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 10px; margin-bottom: 4px; }
.ax.narrow .crm-shared-title { margin-bottom: 12px; }
.crm-shared-title .cx-pill { position: relative; top: 1px; }
.crm-share-seg { margin-top: 10px; }
.crm-share-list { margin-top: 24px; }
.crm-share-av { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.crm-ro .crm-find, .crm-ro .crm-link-x, .crm-ro .crm-found-note button, .crm-ro .crm-acts { display: none; }
.crm-ro .crm-tick, .crm-ro .crm-steps button, .crm-ro .crm-act, .crm-ro .crm-deal-name { pointer-events: none; }
.crm-ro .crm-addbtn { display: none; }
.crm-share-invite { margin-top: 18px; }
.vapp-shared { margin-top: 28px; }
.vapp-shared > .group-label { margin: 0 0 12px; }
.crm-share-links { display: flex; justify-content: center; gap: 20px; }
.crm-share-page > .consent-card { padding: 2px 18px; margin: 4px 0 0; }
.crm-share-foot { margin-top: 16px; }
@media (min-width: 900px) { .crm-share-page > .consent-card, .crm-share-foot { max-width: 720px; } .crm-share-links { justify-content: flex-start; } }
@media (min-width: 900px) { .crm-share-foot > .text-btn.block { width: auto; align-self: flex-start; } }
.crm-agent-row .row-text { gap: 2px; }
.crm-agent-note { margin-top: 10px; }
/* CRM lists, industry and ticking (phase 8j) */
.crm-listrow { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; }
.crm-sheet .crm-field + .group { margin-top: 14px; }
.crm-lists { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px 1px; }
.crm-lists::-webkit-scrollbar { display: none; }
.crm-list { flex: none; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.crm-list .n { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 1px 7px; }
.crm-list.on { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent) inset; }
.crm-list.on .n { background: var(--seg-on); color: var(--accent-text); }
.crm-list svg { color: var(--muted); flex: none; } .crm-list.on svg { color: var(--accent-text); }
.crm-list.add { color: var(--accent-text); border-style: dashed; }
.crm-selbtn { flex: none; }
.crm-ind { display: inline-block; width: fit-content; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: rgba(12, 157, 216, 0.1); color: #0b7fb0; white-space: nowrap; border: 0; font-family: inherit; }
.crm-ind.re { background: rgba(23, 166, 92, 0.11); color: #0f7a45; } .crm-ind.fi { background: rgba(42, 63, 176, 0.1); color: #2a3fb0; }
.crm-ind.hc { background: rgba(229, 72, 122, 0.1); color: #b8285a; } .crm-ind.co { background: rgba(254, 147, 9, 0.12); color: #a85d00; }
.crm-ind.le { background: rgba(123, 63, 184, 0.11); color: #6b2fa6; } .crm-ind.mk { background: rgba(229, 96, 10, 0.1); color: #b4490a; }
.crm-ind.no { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.crm-two .crm-ind { margin-top: 3px; }
.crm-prow .crm-ind { margin-top: 4px; }
.crm-prow .row-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-tick { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--faint); flex: none; display: grid; place-items: center; background: var(--surface); color: #fff; padding: 0; cursor: pointer; }
.crm-tick.on { background: var(--accent); border-color: var(--accent); }
.crm-who { gap: 12px; }
.crm-th-who { display: flex; align-items: center; gap: 12px; }
.crm-prow.ticking { gap: 12px; }
.crm-bulk { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(28px + var(--safe-b)); z-index: 40; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 18px; border-radius: 16px; background: #0d1530; color: #fff; box-shadow: 0 12px 40px rgba(13, 21, 48, 0.35); white-space: nowrap; max-width: calc(100vw - 24px); box-sizing: border-box; }
.crm-bulk b { margin-right: 10px; font-weight: 600; }
.crm-bulk button { font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.1); border: 0; border-radius: 10px; padding: 8px 12px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.crm-bulk button.x { background: none; padding: 8px; }
@media (max-width: 899px) { .crm-bulk { bottom: calc(104px + var(--safe-b)); } }
.crm-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 16px; width: 100%; box-sizing: border-box; font: inherit; color: var(--text); background: none; border: 0; text-align: left; }
.crm-rule + .crm-rule { border-top: 1px solid var(--line); }
.crm-rule > span { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.crm-rule i { font-style: normal; color: var(--muted); }
.crm-rule-op { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.crm-rule-x { border: 0; background: none; color: var(--muted); padding: 4px; cursor: pointer; display: grid; place-items: center; }
.crm-rule.add { color: var(--accent-text); font-weight: 600; grid-template-columns: auto 1fr; cursor: pointer; }
.crm-count { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; padding: 12px 16px; border-radius: 12px; background: var(--live-bg); color: var(--live); font-weight: 600; }
.crm-list-save { margin-top: 16px; }
.crm-ind-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.crm-ind-grid .crm-ind { font-size: 14px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.crm-own-ind { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.crm-own-ind .field { flex: 1; min-width: 0; margin: 0; }
.sheet .crm-own-ind .btn-secondary { width: auto; margin: 0; padding: 0 18px; }
.crm-sug { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; }
.crm-sug + .crm-sug { border-top: 1px solid var(--line); }
.crm-sug input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.crm-sug b { display: block; font-weight: 600; } .crm-sug small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.sheet .card.list + .group, .sheet .card.list + div > .group { margin-top: 18px; }
.crm-looking { margin: 14px 2px 0; }
.crm-note { margin-top: 10px; }
.crm-ind-field { display: block; }
.crm-ind-field .field { width: 100%; box-sizing: border-box; }
@media (prefers-color-scheme: dark) {
  .crm-ind { background: rgba(80, 180, 240, 0.14); color: #8fd0f5; } .crm-ind.re { background: rgba(95, 214, 154, 0.14); color: #6fdcaa; }
  .crm-ind.fi { background: rgba(140, 160, 255, 0.16); color: #aab8ff; } .crm-ind.hc { background: rgba(240, 120, 160, 0.15); color: #f39abb; }
  .crm-ind.co { background: rgba(254, 170, 60, 0.15); color: #ffc070; } .crm-ind.le { background: rgba(190, 150, 240, 0.15); color: #cfaaf5; } .crm-ind.mk { background: rgba(250, 150, 90, 0.15); color: #ffb080; }
  .crm-ind.no { background: var(--surface-2); color: var(--muted); }
  .crm-bulk { background: #1d2a52; }
}
.crm-tagrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.crm-tagrow .crm-ind { margin: 0; }
.crm-prow .crm-tagrow { margin-top: 4px; }
.crm-lvl { display: inline-block; width: fit-content; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: var(--surface-2); color: var(--text); white-space: nowrap; line-height: inherit; }
/* Companies as a table on laptops (phase 8l) */
@media (min-width: 900px) {
  .crm-tr.crm-co-tr { grid-template-columns: minmax(240px, 2.4fr) minmax(120px, 1fr) minmax(150px, 1.3fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) 24px; }
  .crm-co-tr .row-chevron { color: var(--faint); display: grid; place-items: center; }
}
.crm-cos .crm-prow .crm-tagrow .crm-lvl { font-weight: 500; }
/* Progress bars: opening the CRM, a vault file, an import (phase 8m) */
.crm-progress { display: grid; gap: 8px; width: 100%; }
.crm-progress-text { font-size: 14px; font-weight: 600; color: var(--text); }
.crm-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.crm-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #0c9dd8, #2a3fb0); }
.crm-open-card { width: min(320px, calc(100vw - 64px)); display: grid; gap: 10px; }
.crm-open-card p { margin: 0; }
.crm-import-status { margin: 4px 0 12px; }
.crm-import-status:empty { display: none; }
.row-detail .crm-progress { margin-top: 4px; gap: 6px; }
.row-detail .crm-progress-text { font-size: 13px; font-weight: 500; color: var(--muted); }
.row-detail .crm-bar { height: 6px; }
/* Sheet titles with a back arrow, searchable pickers, people on a list (phase 8n) */
.crm-sheet-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px -6px; }
.crm-sheet-head .sheet-title { margin: 0; }
.crm-sheet-back { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.crm-sheet-back:hover { background: var(--surface-2); }
.crm-pick-search { margin-bottom: 10px; }
.crm-pick-search .field, .crm-sheet .group > .field[type=search] { width: 100%; box-sizing: border-box; margin: 0; }
.crm-pick-scroll { max-height: min(48vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.crm-pick-n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 10px; }
.crm-pick-none { padding: 14px 16px; margin: 0; }
.crm-person-row { gap: 12px; }
.crm-person-row .crm-av { width: 34px; height: 34px; font-size: 12px; flex: none; }
.crm-person-row .row-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-add-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--accent-text); display: grid; place-items: center; cursor: pointer; flex: none; }
.crm-found { margin-top: 8px; }
.crm-sheet .group > .field[type=search] { margin-top: 2px; }
.crm-ct-lists { gap: 6px; align-items: center; }
.crm-ct-lists .crm-list-addpill { border: 1px dashed var(--line); background: none; color: var(--accent); cursor: pointer; gap: 3px; padding: 1px 8px; font-family: inherit; }
.crm-ct-lists .crm-list-addpill:hover { background: var(--surface-2); }
.crm-list-pill { display: inline-flex; align-items: center; gap: 4px; }
.crm-list-pill button { border: 0; background: none; padding: 0 0 0 2px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.crm-cfield .field { width: 100%; box-sizing: border-box; margin: 0; }
.crm-cfield .row-detail, .crm-found .row-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-cfield .row-text, .crm-found .row-text { min-width: 0; }
.crm-cpicked { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px; }

/* Chatter: Agent Connect and Vault Connect as two tabs of one page. */
.chatter-tabs { margin: 4px 0 22px; }
.chatter-tabs .seg { font-size: 15px; padding: 9px 0; }
@media (min-width: 700px) {
  .chatter-tabs { width: fit-content; }
  .chatter-tabs .seg { flex: none; padding: 8px 22px; }
}
/* Vault Connect */
.vc-face { background: linear-gradient(135deg, #2bb673, #167a4c); color: #fff; font-weight: 700; font-size: 15px; border: 0; }
.vc-sheet .sheet-text { margin-bottom: 18px; }
.vc-codebox { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px 16px; margin: 0 0 16px; border-radius: 14px; background: var(--seg); }
.vc-code { font-size: 30px; font-weight: 700; letter-spacing: 0.12em; color: var(--text); min-height: 40px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.vc-code.off { color: var(--muted); text-decoration: line-through; }
.vc-code .spinner { width: 24px; height: 24px; }
.vc-err { font-size: 14px; letter-spacing: 0; font-weight: 600; color: var(--alert); text-align: center; }
.vc-left { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 18px; }
.vc-copy { display: flex; align-items: center; justify-content: center; gap: 8px; }
.vc-small { font-size: 13px; color: var(--muted); text-align: center; margin: 14px 0 0; }
.vc-field { width: 100%; box-sizing: border-box; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; }
.vc-field::placeholder { color: var(--faint); font-weight: 600; }
.vc-status { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; margin: 0 0 22px; }
.vc-status .vc-start { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.vc-status .vc-start:disabled { opacity: 0.45; box-shadow: none; }
.vc-why { font-size: 13px; color: var(--muted); line-height: 1.45; text-align: center; margin: 0; }
.vc-status.running { flex-direction: row; align-items: center; gap: 16px; }
.vc-st-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vc-st-text b { font-size: 16px; font-weight: 700; }
.vc-st-text small { font-size: 13px; color: var(--muted); }
.vc-prog { display: block; height: 6px; border-radius: 3px; background: var(--seg); overflow: hidden; margin-top: 8px; }
.vc-prog i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--sky), var(--indigo)); transition: width 0.4s ease; }
.vc-stop { width: auto; margin: 0; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; color: var(--alert); }
.vc-foundcard { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.vc-sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 0 0; }
.vc-sub:first-child { margin-top: 0; }
.vc-has { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; }
.vc-over { display: flex; align-items: flex-start; gap: 10px; }
.vc-over-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--seg); color: var(--accent-text); }
.vc-over > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vc-over b { font-size: 14px; font-weight: 700; }
.vc-over small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.vc-text { font-size: 14px; line-height: 1.45; margin: 0; }
.vc-skip { display: flex; align-items: flex-start; gap: 8px; margin: 10px 4px 0; font-size: 13px; line-height: 1.4; color: var(--attention); }
.vc-skip .icon { flex: none; margin-top: 2px; }
.vc-hint { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
/* Vault Connect inside the Chats screen on a computer: the conversation scrolls in the middle, Start or
   Stop sits in the bar under it, and the details panel holds the folders, settings and earlier chats. */
.vc-chat > .vc-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 8px max(16px, calc((100% - 1000px) / 2)) 24px; }
.vc-chat > .vc-thread > .day:first-child { margin-top: 12px; }
.vc-head-face { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.vc-found-in { margin-top: 18px; }
.vc-found-in .group { margin: 0; }
.vc-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vc-bar-text .vc-prog { max-width: 320px; }
.vc-bar .btn-primary:disabled { opacity: 0.45; box-shadow: none; }
/* With the details open the bar is narrow: the words take the full width, the button sits under them. */
.chat-pane.cd-open .vc-bar { flex-wrap: wrap; row-gap: 10px; }
.chat-pane.cd-open .vc-bar > p, .chat-pane.cd-open .vc-bar > .vc-bar-text { flex-basis: 100%; }
.chat-pane.cd-open .vc-bar > button { margin-left: auto; }
.vc-panel-body .group + .group, .vc-panel-body > div + div { margin-top: 22px; }
.vc-panel-body .vc-remove { margin-top: 14px; }
/* A shared folder's row opens what's inside; the switch beside it stays its own button. */
.vc-folder, .vc-item { padding-top: 0; padding-bottom: 0; gap: 10px; }
.vc-folder-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 74px; padding: 14px 0; background: none; border: 0; color: inherit; text-align: left; font: inherit; cursor: pointer; }
span.vc-folder-open { cursor: default; }
.vc-folder-open .row-chevron { flex: none; margin-left: auto; }
.vc-item .switch:disabled { opacity: 0.45; }
.vc-folder .row-title, .vc-item .row-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-browse { display: flex; flex-direction: column; gap: 12px; }
.vc-browse .card.list { margin: 0; }
.vc-browse .vc-hint { margin: 0 4px; }
.vc-browse-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.vc-browse-back { flex: none; margin-left: -8px; }
.vc-browse-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vc-browse-title b { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-browse-title small { font-size: 13px; color: var(--muted); }
.vc-sheet .vc-browse { max-height: 72dvh; overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; }
.vc-folder .switch { margin-left: 8px; }
.vc-thread { overflow: visible; flex: none; padding: 4px 0 0; }
.vc-thread > :first-child { margin-top: 0; }
.vc-thread .msg-note { margin-top: 6px; }
.vc-note span { display: block; }
.vc-set { margin: 0; }
.vc-remove { margin-top: 14px; color: var(--alert); }
.vc-past { display: flex; flex-direction: column; gap: 12px; max-height: 70dvh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.vc-past .group { margin: 0; }
/* Phones: one column, with your folders right under Start so they can be switched during a chat. */
.vc-page { display: flex; flex-direction: column; }
.vc-main, .vc-side { display: contents; }
.vc-o1 { order: 1; } .vc-o2 { order: 2; } .vc-o3 { order: 3; } .vc-o4 { order: 4; } .vc-o5 { order: 5; } .vc-o6 { order: 6; }
.vc-o2 .group, .vc-o3 .group, .vc-o4 .group, .vc-o5 .group, .vc-o6 .group { margin-bottom: 22px; }
.vc-skip { margin-bottom: 4px; }
@media (min-width: 1100px) {
  .page.vc-link, .screen > .page.sub.vc-link { max-width: none; margin: 0; padding-left: 34px; padding-right: 34px; }
  .vc-page { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; max-width: 1400px; }
  .vc-main, .vc-side { display: flex; flex-direction: column; min-width: 0; }
  .vc-sheet.vc-wide { max-width: 640px; }
}
.crm-when { display: inline-flex; flex-wrap: wrap; gap: 4px 28px; }
.crm-when, .crm-when > span { font-weight: 400; color: var(--text); }
.crm-when small { font-size: inherit; font-weight: 400; color: var(--muted); margin-right: 8px; }
.crm-dt:has(.crm-list-addpill) { align-items: center; }

/* Foldables and tablets (700 to 1099px): the sidebar starts folded, and when opened it's the trimmed
   version, so the page keeps its room. Computers keep the full sidebar. */
@media (min-width: 700px) and (max-width: 1099px) {
  html:not(.rail-mini) .tabbar { width: 168px; padding-left: 10px; padding-right: 10px; }
  html:not(.rail-mini) .tabbar .tab { gap: 9px; padding: 8px; font-size: 13.5px; }
  html:not(.rail-mini) .rail-brand { padding-left: 4px; padding-right: 0; }
  html:not(.rail-mini) .rail-brand .nameplate { font-size: 17px; }
  html:not(.rail-mini) .rail-me { padding: 8px; gap: 8px; }
  html:not(.rail-mini) .rail-me-text small { display: none; }
  /* The sidebar already carries the logo, so Home's header doesn't repeat it. */
  .home-head > .nameplate { display: none; }
  .home-head-right { margin-left: auto; }
  /* The account is at the foot of the sidebar, so Home's header doesn't repeat it either. */
  .home-head-right > .me { display: none; }
  .home-head { min-height: 0; margin-bottom: 18px; }
}

/* No signal: what was saved on this device is showing (offline.ts). */
.offline-note { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 1px; max-width: calc(100% - 32px); padding: 8px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.35; text-align: center; white-space: nowrap; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); pointer-events: none; animation: drop 0.2s ease-out; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, 6px); } }
.offline-note strong { font-weight: 650; }
.offline-note span { opacity: 0.8; }
html.is-offline .thread { padding-bottom: 72px; }
html.is-offline .toast { bottom: calc(160px + var(--safe-b)); }
html.is-offline:has(.composer) .toast { bottom: calc(208px + var(--safe-b)); }
@media (min-width: 700px) {
  .offline-note { bottom: calc(36px + var(--safe-b)); }
  html.is-offline .toast { bottom: calc(96px + var(--safe-b)); }
  html.is-offline:has(.composer) .toast { bottom: calc(136px + var(--safe-b)); }
}

/* Channels: a "#" tile for a channel in the chat list, the header and the archived list. */
.cl-face.ch-face, .cl-row .cl-face.ch-face { border-radius: 12px; background: linear-gradient(135deg, #f0a43a, #d0602a); font-size: 20px; font-weight: 700; }
.chat-head .head-photo.ch-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #f0a43a, #d0602a); color: #fff; font-size: 22px; font-weight: 700; cursor: default; }
.head-agent { color: var(--text); font-weight: 600; }
.row-icon.ch-row-mark { border-radius: 12px; border: 0; background: linear-gradient(135deg, #f0a43a, #d0602a); color: #fff; font-size: 19px; font-weight: 700; }
.ch-start { text-align: center; padding: 24px 16px 8px; }
.ch-start-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.ch-start-text { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.ch-sheet .ch-label { margin: 14px 0 8px; }
.ch-name { position: relative; display: block; }
.ch-hash { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; font-weight: 700; pointer-events: none; }
.ch-sheet .field { margin: 0; }
.ch-sheet .field:not(.pick-field) { display: block; }
.ch-sheet .ch-name .field { padding-left: 32px; }
.ch-sheet .ch-brief { resize: none; font: inherit; font-size: 16px; line-height: 1.4; }
.ch-sheet .form-error:empty { display: none; }
.ch-sheet .form-error { margin: 12px 0 0; }
.ch-sheet .btn-primary { margin-top: 20px; }
.ch-sheet .ch-archive { margin-top: 10px; }
.ch-note { text-align: center; margin: 10px 0 0; }
.chat-split .head-chevron.ch-chev { display: inline-flex; }
.ch-sheet .ch-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ch-sheet .ch-hint:empty { display: none; }
.ch-vault-wait { color: var(--muted); }
.head-folder { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-sheet .ch-delete { margin-top: 6px; color: var(--alert); }
.ch-arch-row { cursor: default; }
.ch-arch-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.ch-arch-actions .text-btn { padding: 6px 0; font-weight: 600; }
.ch-arch-actions .ch-danger { color: var(--alert); }
.ch-arch-empty { margin: 0; color: var(--muted); font-size: 14px; }
.ch-sheet .btn-danger { display: block; width: 100%; margin-top: 20px; padding: 13px 16px; font-size: 16px; }
.ch-sheet .btn-danger + .btn-secondary { margin-top: 10px; }
.ch-arch-actions .ch-spacer { visibility: hidden; }
.ch-sheet .ch-folder[hidden] { display: none; }
.vault-refs-label { display: flex; align-items: center; gap: 5px; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.vault-refs-label .icon { color: var(--accent-text); }

.notify-more { cursor: pointer; }

/* Channel details (chdetails.ts): a panel on the right of the chat on wide screens, a page on phones. */
.head-gear { flex: none; color: var(--muted); }
.cd-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; width: 420px; max-width: 100%; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(7, 10, 24, 0.12); animation: cd-in 0.18s ease-out; }
.cd-panel.out { animation: cd-out 0.16s ease-in forwards; }
.chat-pane.cd-open > .chat { margin-right: 420px; transition: margin-right 0.18s ease-out; }
.chat-pane.cd-open .head-info { display: none; } /* the model and the like make room for the panel */
@keyframes cd-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cd-out { to { transform: translateX(24px); opacity: 0; } }
.cd-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 16px 8px 24px; }
.cd-bar-title { font-size: 17px; font-weight: 700; }
.cd-close { color: var(--muted); }
.cd-panel .cd-body { flex: 1; overflow-y: auto; padding: 8px 24px 28px; }
.cd-page .page-title + .cd-body { margin-top: 24px; }
.cd-wait { display: grid; place-items: center; padding: 48px 0; }
.cd-error { color: var(--muted); text-align: center; padding: 32px 0; margin: 0; }
.cd-head { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 14px; margin: 0 0 24px; }
.cd-mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #f0a43a, #d0602a); color: #fff; font-size: 26px; font-weight: 700; }
.cd-head-text { min-width: 0; }
.cd-name { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-brief { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-brief.none { color: var(--faint); }
.btn-secondary.cd-edit { width: auto; margin: 0; padding: 8px 16px; font-size: 14px; }
.cd-group { margin: 0 0 24px; }
.cd-group:last-child { margin-bottom: 0; }
.cd-label { margin: 0 0 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-shadow); overflow: hidden; }
.cd-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; }
.cd-row:first-child { border-top: 0; }
.cd-row.tap, .cd-action { cursor: pointer; }
.cd-row.tap:hover, .cd-action:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cd-row > .icon:last-child { flex: none; color: var(--faint); }
.cd-row .cl-face { width: 42px; height: 42px; }
.cd-ic { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text); }
.cd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cd-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-sub { color: var(--muted); font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-tag { flex: none; }
.cd-tag.own { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cd-tag.wait { color: #b86e00; background: rgba(255, 176, 32, 0.16); }
.cd-action .cd-title { color: var(--accent-text); }
.cd-action.danger .cd-title, .cd-action.danger .cd-ic { color: var(--alert); }
.cd-fact { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 50px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 15px; }
.cd-fact:first-child { border-top: 0; }
.cd-fact span { color: var(--muted); }
.cd-fact b { font-weight: 600; }
/* Sheets: invite a person, add an agent, a member. */
.ch-sheet .cd-days { margin: 0; }
.ch-sheet .cd-inline { margin-top: 14px; box-shadow: none; }
.ch-sheet .cd-guard { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.ch-sheet .cd-guard .icon { flex: none; margin-top: 2px; color: var(--accent-text); }
.ch-sheet .cd-guard p { margin: 0; font-size: 14px; line-height: 1.45; }
/* Picking one of my agents (radio rows) and the agreement boxes under the guard note. */
.cd-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--faint); box-sizing: border-box; }
.cd-pick[aria-checked="true"] .cd-radio { border: 6px solid var(--accent); }
.cd-pick:disabled { cursor: default; opacity: 0.55; }
.ch-sheet .agree-check { margin: 14px 0 0; }
.ch-sheet .agree-check + .agree-check { margin-top: 10px; }
.ch-sheet .agree-check + .form-error, .ch-sheet .agree-check + .btn-primary { margin-top: 16px; }
.cd-code { margin: 4px 0 8px; padding: 18px 12px; border-radius: 14px; background: var(--surface-2); text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; font-weight: 700; letter-spacing: 0.06em; }
.cd-code-note { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.btn-secondary.cd-add { width: auto; margin: 0; padding: 7px 16px; font-size: 14px; }
.btn-secondary.cd-add.done { color: var(--live); }
.cd-empty { margin: 0; color: var(--muted); font-size: 14px; }
.ch-sheet .cd-their .field { margin: 0; }
.cd-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cd-sheet-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; }
.cd-sheet-head .sheet-title { margin: 0; }
.cd-sheet-head .cd-sub { white-space: normal; }
/* Channels with more members: who wrote a message, and the @ list above the message box. */
.msg-who { margin: 0 6px 4px; font-size: 12.5px; font-weight: 700; color: var(--accent-text); }
.msg-who.guest { color: #1f9a62; }
.msg-face { width: 29px; height: 29px; flex: none; margin-bottom: 20px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.msg-face.green { background: linear-gradient(135deg, #2bb673, #167a4c); }
.msg-face img { width: 100%; height: 100%; object-fit: cover; }
.composer-field { position: relative; }
.mention-pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 10; width: min(340px, 100%); padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(7, 10, 24, 0.18); }
.mention-pop[hidden] { display: none; }
.mention-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mention-item:hover, .mention-item:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); outline: none; }
.mention-name { font-size: 15px; font-weight: 600; }
.mention-sub { margin-left: auto; color: var(--muted); font-size: 13px; }
/* A channel's header line stays one line: the folder name gives way first. */
.chat-head .head-text:has(.head-agent) { min-width: 0; }
.head-status:has(.head-agent) { flex-wrap: nowrap; min-width: 0; }
.head-status:has(.head-agent) > * { flex: none; white-space: nowrap; }
.head-status:has(.head-agent) > .head-vault { flex: 0 1 auto; min-width: 0; }
.head-status:has(.head-agent) .head-folder { max-width: none; min-width: 0; }

/* ===== XAPPX app (html.ed-xappx, brand.ts edition) =====
   Its own look over the same screens, taken from the XAPPX website: deep navy, hairline edges,
   the cyan to blue to violet gradient on main buttons, a soft glow, Space Grotesk headings and Inter
   text. A top bar on wide screens, a bar grounded to the bottom edge on phones. Light and dark. */
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
html.ed-xappx {
  --bg: #0c1119; --bg-top: #0c1119; --surface: #101725; --surface-2: #182134; --bubble: #182134; --x-panel: #141c2b;
  --line: #1c2636; --text: #edf2fa; --muted: #93a3bc; --faint: #758397;
  --accent: #19b4ff; --accent-text: #3cc3ff; --x-ink: #00131f;
  --x-grad: linear-gradient(90deg, #02beff 0%, #2f80ff 50%, #7a74ff 100%);
  --x-chip: linear-gradient(135deg, rgba(2, 190, 255, 0.16), rgba(122, 116, 255, 0.16));
  --x-hover: rgba(47, 128, 255, 0.55);
  --glow: radial-gradient(60% 50% at 90% 0%, rgba(47, 128, 255, 0.20), transparent 70%), radial-gradient(50% 45% at 0% 100%, rgba(122, 116, 255, 0.14), transparent 70%);
  --num: linear-gradient(#edf2fa, #edf2fa); --card-shadow: none;
  --user-1: #1a2d4d; --user-2: #1a2d4d; --ring-1: #02beff; --ring-2: #7a74ff;
  --bar: #0a0d14; --seg: #101725; --seg-on: rgba(47, 128, 255, 0.18);
  --sky: #02beff; --indigo: #2f80ff; --twin: var(--x-grad); --navy: #0c1119;
}
@media (prefers-color-scheme: light) {
  html.ed-xappx {
    --bg: #f5f7fb; --bg-top: #f5f7fb; --surface: #ffffff; --surface-2: #edf1f8; --bubble: #edf1f8; --x-panel: #eceff5;
    --line: #e1e7f0; --text: #0c1119; --muted: #5b6b82; --faint: #8a98ad;
    --accent: #0a8fd6; --accent-text: #0a7fc0;
    --x-chip: linear-gradient(135deg, rgba(2, 190, 255, 0.12), rgba(122, 116, 255, 0.12));
    --glow: radial-gradient(60% 50% at 90% 0%, rgba(47, 128, 255, 0.12), transparent 70%), radial-gradient(50% 45% at 0% 100%, rgba(122, 116, 255, 0.08), transparent 70%);
    --num: linear-gradient(#0c1119, #0c1119);
    --user-1: #dceafc; --user-2: #dceafc; --bar: #ffffff; --seg: #edf1f8; --seg-on: rgba(47, 128, 255, 0.12);
  }
  html.ed-xappx .msg.user .bubble { color: #0b1220; }
}
/* Inter is drawn at Source Sans 3's x-height (Twin Chat's text face), so every line takes the same
   width as in Twin Chat and the one-line checks in all 10 languages still hold. */
html.ed-xappx body, html.ed-xappx input, html.ed-xappx textarea, html.ed-xappx button, html.ed-xappx select { font-size-adjust: 0.478; }
html.ed-xappx body { font-family: "Inter", system-ui, sans-serif; }
html.ed-xappx .page-title, html.ed-xappx .greeting, html.ed-xappx .sheet-title, html.ed-xappx .signin-sheet h1, html.ed-xappx .cl-title { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.01em; }
html.ed-xappx .card { border: 1px solid var(--line); box-shadow: none; }
html.ed-xappx .btn-primary { background: var(--x-grad); color: var(--x-ink); box-shadow: none; }
html.ed-xappx .btn-primary.danger { background: var(--alert); color: #fff; }
html.ed-xappx .msg.user .bubble { background: var(--user-1); color: var(--text); box-shadow: none; }
html.ed-xappx .msg.assistant .bubble { border: 0; }
html.ed-xappx .seg.on { border-color: transparent; }
html.ed-xappx .field { border-color: var(--line); }
html.ed-xappx .field:focus { border-color: var(--accent); }
html.ed-xappx .menu .me-big, html.ed-xappx .shell > .me-fixed, html.ed-xappx .rail-me .me { background: var(--x-grad); color: var(--x-ink); border: 0; }

/* The wordmark */
.nameplate.xmark { gap: 0; font: 700 22px/1 "Space Grotesk", sans-serif; letter-spacing: 0.18em; color: var(--text); }
.nameplate.xmark i { font-style: normal; }

/* Phones: the bar sits on the bottom edge, full width and square, like TikTok's. */
html.ed-xappx .tab-help { display: none; }
@media (max-width: 699px) {
  html.ed-xappx .tabbar { left: 0; right: 0; bottom: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 8px 6px calc(8px + var(--safe-b)); background: var(--bar); backdrop-filter: none; -webkit-backdrop-filter: none; }
  html.ed-xappx .tab { gap: 4px; padding: 0; font-size: 11px; color: var(--muted); }
  html.ed-xappx .tab .tab-icon { width: 44px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
  html.ed-xappx .tab[aria-current="page"] { color: var(--accent-text); }
  html.ed-xappx .tab[aria-current="page"] .tab-icon { background: var(--x-chip); }
}
/* Five tabs on a small phone: every label whole, with room between them in every language. */
@media (max-width: 379px) {
  html.ed-xappx .tabbar { padding-left: 2px; padding-right: 2px; }
  html.ed-xappx .tab { min-width: 0; font-size: 10.5px; }
}

/* Wide screens: a top bar like the XAPPX website. */
@media (min-width: 700px) {
  html.ed-xappx .shell { flex-direction: column; }
  html.ed-xappx .tabbar {
    order: -1; width: auto; height: 72px; flex: none; flex-direction: row; align-items: center; gap: 4px;
    padding: var(--safe-t) 32px 0; background: var(--bar); border: 0; border-bottom: 1px solid var(--line); color: var(--muted);
  }
  html.ed-xappx .rail-brand { display: flex; padding: 0; margin: 0 28px 0 0; border: 0; color: var(--text); }
  html.ed-xappx .tabbar .tab { flex: none; flex-direction: row; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 500; }
  html.ed-xappx .tabbar .tab .tab-icon { display: none; }
  html.ed-xappx .tabbar .tab[aria-current="page"] { background: var(--x-chip); box-shadow: none; color: var(--text); }
  html.ed-xappx .tabbar .tab.tab-extra, html.ed-xappx .tabbar .tab.tab-more { display: none; }
  html.ed-xappx .tabbar .tab.tab-help { display: flex; margin-left: auto; }
  html.ed-xappx .tabbar .tab.tab-help { width: 44px; height: 44px; padding: 0; border-radius: 50%; justify-content: center; }
  html.ed-xappx .tabbar .tab.tab-help[aria-current="page"] { background: none; }
  html.ed-xappx .tabbar .tab.tab-help[aria-current="page"] .xappy-face { box-shadow: 0 0 0 2px var(--accent-text); }
  html.ed-xappx .xappy-face { display: block; width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgba(47, 128, 255, 0.28); transition: transform 0.2s ease; }
  html.ed-xappx .tabbar .tab.tab-help:hover .xappy-face { transform: scale(1.08); }
  html.ed-xappx .rail-me { width: auto; margin: 0 0 0 8px; padding: 0; border: 0; background: none; }
  html.ed-xappx .rail-me .me { width: 36px; height: 36px; font-size: 14px; }
  html.ed-xappx .rail-me-text { display: none; }
  html.ed-xappx .menu-item.menu-extra { display: flex; }
  html.ed-xappx .menu-item.menu-help { display: none; }
  html.ed-xappx .tabbar .tab span:not(.tab-icon) { position: static; }
}
@media (min-width: 700px) and (hover: hover) and (pointer: fine) {
  html.ed-xappx .tabbar .tab:hover:not([aria-current="page"]) { background: var(--surface); color: var(--text); }
}
/* Tablets: the six tabs as icons, so the bar fits; pointing at one shows its name. */
@media (min-width: 700px) and (max-width: 979px) {
  html.ed-xappx .tabbar { padding: var(--safe-t) 20px 0; }
  html.ed-xappx .rail-brand { margin-right: 12px; }
  html.ed-xappx .tabbar .tab { padding: 0 10px; }
  html.ed-xappx .tabbar .tab .tab-icon { display: grid; }
  html.ed-xappx .tabbar .tab > span:not(.tab-icon) { display: none; }
}

/* Build (xhome.ts) and Websites (websites.ts) */
.xb { padding: calc(24px + var(--safe-t)) 20px 32px; max-width: 1360px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.xb-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; height: 100%; padding-bottom: 32px; }
.xb-side { min-height: 0; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.xb-hero { display: flex; flex-direction: column; gap: 12px; }
.xb-eyebrow { margin: 0; color: var(--accent-text); font: 500 12px/16px ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.22em; }
.xb-title { margin: 0; font: 700 30px/38px "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.xb-title.sm { font-size: 28px; line-height: 36px; }
.xb-sub { margin: 0; color: var(--muted); font-size: 15px; line-height: 24px; }
.xb-sub span { display: block; }
.xb-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.xb-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 15px/1 "Inter", sans-serif; cursor: pointer; }
.xb-btn.primary { background: var(--x-grad); color: var(--x-ink); border-color: transparent; }
.xb-label { margin: 32px 0 14px; color: var(--text); font: 600 15px/22px "Space Grotesk", "Inter", sans-serif; }
/* XAPPX Build: the choices in one greyish box with round corners, its title inside. */
.xb-panel { margin-top: 32px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--x-panel, var(--surface-2)); }
.xb-panel > .xb-label { margin: 0 0 14px; }
@media (max-width: 699px) { .xb-panel { margin-top: 24px; padding: 14px 12px 12px; border-radius: 18px; } }
.xb-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.xb-card { display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); text-align: start; font: inherit; cursor: pointer; }
.xb-card.soon { cursor: default; }
.xb-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.xb-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--x-chip); color: var(--accent-text); }
.xb-card.soon .xb-ic { background: var(--surface-2); color: var(--muted); }
.xb-soon { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.xb-soon.big { height: 28px; padding: 0 12px; border-radius: 14px; font-size: 13px; color: var(--accent-text); background: var(--x-chip); }
.xb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xb-text b { font: 700 16px/22px "Space Grotesk", "Inter", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xb-text small { color: var(--muted); font-size: 13px; line-height: 18px; white-space: nowrap; }
.xb-card .xb-text small span { display: block; }
.xb-recents { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.xb-recent { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); text-align: start; font: inherit; cursor: pointer; }
.xb-recent.wide { width: 100%; }
.xb-recent > svg { margin-inline-start: auto; color: var(--muted); flex: none; }
.xb-recent .xb-text b { font: 600 14px/20px "Inter", sans-serif; }
.xb-face { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #2d6bff; color: #fff; font: 700 15px/1 "Space Grotesk", sans-serif; overflow: hidden; }
.xb-face.ch, .xb-face.ic { border-radius: 12px; background: var(--surface-2); color: var(--accent-text); }
.xb-face img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 700px) {
  .xb { padding: 24px 32px 32px; }
  .xb-title { font-size: 40px; line-height: 48px; }
  .xb-title.sm { font-size: 32px; line-height: 40px; }
  .xb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .xb-card { padding: 20px; min-height: 140px; }
  .xb-recents { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
/* Build's cards three across only where each keeps its longest line in every language. */
@media (min-width: 1100px) { .xb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Pick up where you left off: three across only when each card fits its longest line in every
   language (about 250px); else two, the odd last one full width; one on a narrow column. */
.xb-main { container-type: inline-size; }
@container (max-width: 781px) {
  .xb-recents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xb-recent:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@container (max-width: 515px) { .xb-recents { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 700px) and (max-width: 1099px) { .xb-title { font-size: 34px; line-height: 42px; } }
.ws-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ws-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ws-step { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ws-n { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--x-chip); color: var(--accent-text); font: 700 14px/1 "Space Grotesk", sans-serif; }
@media (min-width: 700px) { .ws-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }

/* Market Intelligence (intel.ts) */
.mi .xb-main { max-width: 960px; margin: 0 auto; width: 100%; }
.xb-btn.sm { height: 36px; padding: 0 14px; font-size: 14px; gap: 6px; flex: none; }
.mi-market { margin-top: 24px; }
.mi-market-top { display: flex; align-items: center; gap: 12px; }
.mi-market-top .xb-text { flex: 1; }
.mi-market-top .xb-text small { white-space: normal; }
.mi-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.mi-fact { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.mi-fact small { color: var(--muted); font-size: 12px; line-height: 16px; }
.mi-fact b { font: 600 14px/20px "Inter", sans-serif; overflow-wrap: anywhere; }
.mi-warn { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 170, 0, 0.12); color: var(--text); font-size: 14px; line-height: 20px; }
/* Each sentence on its own line; inside a form (or right under a field label) the form's own gap is the spacing. */
.mi-warn .sn { display: block; }
.mi-form > .mi-warn, .mi-field > .mi-warn, .mi-field .mi-warn:first-child { margin-top: 0; }
/* Fields in these forms take no margin of their own: the form's gap spaces everything evenly. */
.mi-form .field { margin: 0; }
.sheet .sheet-title + .mi-form { margin-top: 14px; }
.mi-note { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.mi-note .sn { display: block; }
.mi .pj-novault { margin: 16px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mi .pj-novault p { margin: 0; font-size: 14px; line-height: 20px; }
.mi .pj-novault p span { display: block; }
.mi-busy { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.mi-busy .spinner { flex: none; }
.mi-busy p { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 20px; }
.mi-busy p span { color: var(--muted); }
.mi .card.note { margin-top: 16px; }
.mi .card.note p span { display: block; }
.mi-report { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--x-panel, var(--surface-2)); }
.mi-rhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mi-rhead .xb-label { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.mi-rhead h2 { margin: 0; font: 700 22px/28px "Space Grotesk", "Inter", sans-serif; }
.mi-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.mi-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--x-chip); color: var(--accent-text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.mi-chip.partial, .mi-chip.v-pending { background: rgba(255, 170, 0, 0.14); color: #b77700; }
.mi-chip.failed, .mi-chip.v-failed { background: rgba(255, 70, 70, 0.12); color: #d33; }
.mi-chip.quiet { background: var(--surface); color: var(--muted); }
.mi-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.mi-block h3 { margin: 0 0 10px; font: 600 16px/22px "Space Grotesk", "Inter", sans-serif; }
.mi-list, .mi-plain, .mi-sources { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.mi-item { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.mi-list.hl .mi-item { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.mi-item p { margin: 0; }
.mi-h { font-size: 15px; line-height: 22px; }
.mi-s { margin-top: 4px !important; color: var(--text); font-size: 14px; line-height: 21px; }
.mi-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 19px; }
.mi-meta .sn { display: block; }
.mi-unc { font-style: italic; }
.mi-src { color: var(--accent-text); font-weight: 600; font-size: 13px; text-decoration: none; }
.mi-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.pj-row .mi-tag { flex: none; }
.mi-empty { margin: 0; color: var(--muted); font-size: 14px; }
.mi-plain { gap: 8px; padding-inline-start: 18px; list-style: disc; font-size: 14px; line-height: 21px; }
.mi-sources { gap: 10px; padding-inline-start: 22px; list-style: decimal; font-size: 14px; line-height: 20px; }
.mi-sources a { color: var(--accent-text); text-decoration: none; overflow-wrap: anywhere; }
.mi-sources small { display: block; color: var(--muted); font-size: 12px; }
.mi-st.failed { color: #d33; }
.pj-row:disabled { cursor: default; opacity: 0.8; }
.mi-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 0; border: 0; background: none; color: var(--accent-text); font: 600 14px/20px "Inter", sans-serif; cursor: pointer; }
.mi-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 12px; }
.mi-field .field-label { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.mi-row { display: flex; gap: 8px; align-items: center; }
.mi-row .field { flex: 1; min-width: 0; }
.mi-row .mi-num, .mi-row .mi-time { flex: 0 0 120px; }
.mi-row .mi-unit { flex: 0 0 110px; }
.mi-places { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.mi-places .row { width: 100%; }
.mi-place-on { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--accent-text); font-weight: 600; font-size: 14px; }
.mi-osm { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.mi-cats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mi-cat { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 20px; cursor: pointer; margin-top: 8px; }
.mi-cats .mi-cat { margin-top: 0; }
.mi-cat input { margin-top: 3px; flex: none; }
.mi-cat .sn { display: block; }
/* Media and Podcast (media.ts, podcast.ts, adminmedia.ts) */
.md-segs { display: inline-flex; gap: 4px; margin-top: 24px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.md-segs button { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 14px/1 "Inter", sans-serif; cursor: pointer; }
.md-segs button.on { background: var(--x-chip); color: var(--accent-text); }
/* XAPPX Media switch: a pill that slides under the chosen tab, and the new part fading in. */
.md-segs { position: relative; }
.md-segs button { position: relative; z-index: 1; transition: color 0.2s; }
.md-segs button.on { background: none; }
.md-ind { position: absolute; top: 4px; left: 4px; height: 36px; width: 0; border-radius: 999px; background: var(--x-chip); pointer-events: none; }
.md-segs.md-ready .md-ind { transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.28s cubic-bezier(0.3, 0.7, 0.2, 1); }
.md-body.md-swap > * { animation: md-in 0.26s ease-out both; }
.md-body.md-swap > *:nth-child(2) { animation-delay: 0.03s; }
.md-body.md-swap > *:nth-child(3) { animation-delay: 0.06s; }
@keyframes md-in { from { opacity: 0; transform: translateY(8px); } }
.xb-btn.md-off { visibility: hidden; }
/* XAPPX Agents with no agent yet: the heading with Make an agent beside it. */
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ag-head .page-title { margin: 0; min-width: 0; }
.ag-head .xb-btn { flex: none; width: auto; margin: 0; }
@media (max-width: 699px) { .ag-head .xb-btn { height: 38px; padding: 0 14px; font-size: 14px; gap: 6px; } }
.ag-head + .card, .ag-head + .note { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .md-segs.md-ready .md-ind, .md-segs button { transition: none; } .md-body.md-swap > * { animation: none; } }
.md-body { margin-top: 16px; display: flow-root; }
.md-body > :first-child { margin-top: 0; }
.md-plan { margin-top: 0; display: flex; align-items: center; gap: 12px; }
.md-plan .xb-text { flex: 1; }
.md-plan .xb-text small span { display: block; }
.md-list { margin-top: 16px; }
.md-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mi-chip.md-delivered, .mi-chip.pc-approved, .mi-chip.pc-ready { background: rgba(16, 185, 129, 0.14); color: #0e9f6e; }
.mi-chip.md-in_progress, .mi-chip.pc-voicing, .mi-chip.pc-writing, .mi-chip.pc-draft { background: var(--x-chip); color: var(--accent-text); }
.mi-chip.md-canceled, .mi-chip.pc-held { background: var(--surface); color: var(--muted); }
.mi-chip.pc-failed { background: rgba(255, 70, 70, 0.12); color: #d33; }
.pj-row .mi-chip { flex: none; }
.md-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.md-type { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-align: start; font: inherit; cursor: pointer; }
.md-type b { font-size: 14px; }
.md-type small { color: var(--muted); font-size: 12px; line-height: 16px; }
.md-type.on { border-color: var(--accent); background: var(--x-chip); }
.md-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.md-chip { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 500 14px/1 "Inter", sans-serif; cursor: pointer; }
.md-chip.on { border-color: var(--accent); background: var(--x-chip); color: var(--accent-text); font-weight: 600; }
.md-info { margin-top: 8px; }
.md-file { font-size: 14px; max-width: 100%; }
.md-track { display: flex; gap: 0; margin: 20px 0 0; padding: 0; list-style: none; }
.md-track li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; color: var(--muted); font-size: 12px; text-align: center; }
.md-track li::before { content: ""; position: absolute; top: 6px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--line); }
.md-track li:first-child::before { display: none; }
.md-track li.on { color: var(--text); font-weight: 600; }
.md-track li.on::before { background: var(--accent); }
.md-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); position: relative; z-index: 1; }
.md-track li.on .md-dot { background: var(--accent); border-color: var(--accent); }
.md-files { display: flex; flex-direction: column; gap: 8px; }
.md-filerow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.md-filerow .xb-text { flex: 1; }
.md-filerow .xb-text b { font: 600 14px/20px "Inter", sans-serif; }
.md-review { width: auto; height: 36px; padding: 0 8px; font-size: 13px; flex: none; }
.md-player { width: 100%; margin-top: 8px; border-radius: 12px; background: #000; max-height: 420px; }
audio.md-player { background: none; height: 44px; }
.md-watch { margin-top: 8px; text-decoration: none; }
.md-add { margin-top: 10px; }
.md-link { color: var(--accent-text); font-weight: 600; font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.md-brief { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 21px; }
.md-res-list { display: flex; flex-direction: column; gap: 8px; }
.md-res { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.md-res .xb-text { gap: 4px; }
.md-res .xb-text b { white-space: normal; font: 600 14px/20px "Inter", sans-serif; }
.md-res-body { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; white-space: pre-wrap; }
.md-res.locked { opacity: 0.75; }
.md-more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent-text); }
.md-more .mi-form { margin-top: 10px; }
.pc-script { font: 15px/1.6 "Inter", sans-serif; min-height: 280px; }
.pc-player { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.md-ep { margin-top: 0; }
.md-admin { padding: 16px 20px; }
.md-admin h3 { margin: 16px 0 8px; font-size: 15px; }
.md-admin > h3:first-child { margin-top: 0; }
.md-admin.mi-form { margin-top: 12px; }
.md-adminpane { display: flex; flex-direction: column; gap: 16px; }
.md-adminpane .mi-row .field { flex: 1; }
@media (max-width: 699px) {
  .md-segs { display: flex; width: 100%; }
  .md-segs button { flex: 1; padding: 0 8px; }
  .md-plan { flex-wrap: wrap; }
  .md-plan .xb-text { flex: 1 1 180px; }
  .md-plan .xb-text b, .mi-market-top .xb-text b { white-space: normal; }
  /* Phones: Build's cards are rows (icon, name and detail, arrow), so every detail fits on its line. */
  .xb-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .xb-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
  .xb-card .xb-top { display: contents; }
  .xb-card .xb-ic { flex: none; }
  .xb-card .xb-text { order: 1; flex: 1; }
  .xb-card .xb-top > :last-child:not(.xb-ic) { order: 2; flex: none; }
  .xb-card .xb-text b { white-space: normal; }
  .md-types { grid-template-columns: minmax(0, 1fr); }
  .md-actions .xb-btn { width: auto; }
}
@media (max-width: 699px) {
  .mi-facts { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
  .mi-fact { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; border: 0; border-radius: 0; background: none; padding: 10px 12px; }
  .mi-fact + .mi-fact { border-top: 1px solid var(--line); }
  .mi-fact small { font-size: 13px; flex: none; }
  .mi-fact b { text-align: end; overflow-wrap: normal; }
  .mi-market-top .xb-text b { white-space: normal; }
  .mi-report { padding: 14px 12px; border-radius: 18px; }
  .mi-rhead { flex-direction: column; }
  .mi-chips { justify-content: flex-start; }
  .mi-cats { grid-template-columns: minmax(0, 1fr); }
  .xb-btn.sm { width: auto; }
  .mi-market-top { flex-wrap: wrap; }
  .mi .pj-novault { flex-direction: column; align-items: stretch; }
}

/* Workflows and Community before anything is picked (wide screens) */
.pane-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px; text-align: center; color: var(--muted); }
.pane-empty-ic { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 16px; background: var(--x-chip, var(--surface-2)); color: var(--accent-text); }
.pane-empty-title { margin: 0; color: var(--text); font-weight: 600; font-size: 16px; }
.pane-empty-text { margin: 0; font-size: 14px; }
html.ed-xappx .corner-mark { display: none; }
/* Phones: the wordmark on the left of the avatar's line, the page under it. */
.xb-markrow { display: none; }
@media (max-width: 699px) {
  html.ed-xappx .xb { padding-top: calc(18px + var(--safe-t)); }
  html.ed-xappx .xb-markrow { display: flex; align-items: center; height: 40px; margin-bottom: 20px; }
}
html.ed-xappx .vault-page > .vault-storage::before, html.ed-xappx .vault-page .vault-totals > .card::before, html.ed-xappx .cx-kpi::before { display: none; }
.chat-pane > .pane-empty { height: 100%; box-sizing: border-box; }
html.ed-xappx .cl-face.ch-face, html.ed-xappx .cl-row .cl-face.ch-face { background: var(--surface-2); color: var(--accent-text); }
html.ed-xappx .vc-face { background: var(--surface-2); color: var(--accent-text); }
@media (max-width: 699px) {
  .ws-head { flex-direction: column; align-items: flex-start; gap: 12px; padding-right: 52px; }
  /* The avatar sits top right on phones, also in Arabic: titles keep clear of it. */
  html.ed-xappx .cl-title { padding-right: 68px; }
  /* The quick answers are questions: a size that keeps each on one line in all 10 languages. */
  html.ed-xappx .row.faq .row-title { font-size: 16px; }
}

/* XAPPX first screens (the welcome, Hello, the language list and sign in): the app's own ground in
   both themes, its wordmark, no Twin glyph and no gradient. */
html.ed-xappx .splash, html.ed-xappx .signin, html.ed-xappx .hello { background: var(--bg); color: var(--text); }
html.ed-xappx .signin-mark { display: none; }
html.ed-xappx .boot-mark { font-size: 26px; margin-bottom: 26px; }
html.ed-xappx .boot-title { color: var(--text); font-family: "Space Grotesk", "Inter", sans-serif; }
html.ed-xappx .boot-sub, html.ed-xappx .boot-slow p { color: var(--muted); }
html.ed-xappx .boot-bar { background: var(--surface-2); }
html.ed-xappx .boot-bar i, html.ed-xappx .boot-slow button { background: var(--x-grad); color: var(--x-ink); }
html.ed-xappx .hello-word { font-family: "Space Grotesk", "Inter", sans-serif; color: var(--muted); }
html.ed-xappx .hello-word .hello-line:last-child { background: none; color: var(--text); letter-spacing: 0.06em; }
html.ed-xappx .hello-foot, html.ed-xappx .hello-name, html.ed-xappx .hello.pick .lead { color: var(--muted); }
html.ed-xappx .hello.pick h1 { font-family: "Space Grotesk", "Inter", sans-serif; }
html.ed-xappx .pick-list { background: var(--surface); border: 1px solid var(--line); }
html.ed-xappx .pick-row { border-top: 0; color: var(--text); padding: 12px 18px; }
html.ed-xappx .pick-row[aria-checked="true"] { background: var(--x-chip); }
html.ed-xappx .pick-row small { color: var(--muted); }
html.ed-xappx .pick-check { color: var(--accent-text); }
html.ed-xappx .signin-sheet h1, html.ed-xappx .signin-sheet .agree-check { color: var(--text); }
html.ed-xappx .signin-sheet .lead, html.ed-xappx .consent { color: var(--muted); }
html.ed-xappx .signin-sheet input:not([type=checkbox]) { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
html.ed-xappx .signin-sheet input:not([type=checkbox]):focus { border-color: var(--accent); box-shadow: none; }
html.ed-xappx .signin-sheet .agree-check .inline-link, html.ed-xappx .signin .inline-link, html.ed-xappx .signin-sheet .text-btn { color: var(--accent-text); }
html.ed-xappx .signin-brand .nameplate { color: var(--text); }
/* XAPPX sign in: the app's backdrop (glows and the dot grid) behind, and XAPPY waving beside the
   words on wide screens, above them on phones. */
html.ed-xappx .signin { isolation: isolate; }
html.ed-xappx .signin::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 640px at 50% 42%, rgba(47, 128, 255, 0.13), transparent 70%), radial-gradient(760px 540px at 88% 0%, rgba(122, 116, 255, 0.15), transparent 70%), var(--bg);
}
html.ed-xappx .signin::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(122, 116, 255, 0.30) 1px, transparent 1.5px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(75% 75% at 50% 42%, transparent 14%, #000 58%, transparent 96%);
  mask-image: radial-gradient(75% 75% at 50% 42%, transparent 14%, #000 58%, transparent 96%);
}
@media (prefers-color-scheme: light) {
  html.ed-xappx .signin::before { background: radial-gradient(900px 640px at 50% 42%, rgba(47, 128, 255, 0.08), transparent 70%), radial-gradient(760px 540px at 88% 0%, rgba(122, 116, 255, 0.10), transparent 70%), var(--bg); }
  html.ed-xappx .signin::after { background-image: radial-gradient(rgba(47, 128, 255, 0.20) 1px, transparent 1.5px); }
}
html.ed-xappx .signin-xappy { display: block; align-self: flex-start; width: auto; height: 150px; margin: 0 0 18px -6px; filter: drop-shadow(0 12px 28px rgba(47, 128, 255, 0.28)); }
@media (max-height: 700px) { html.ed-xappx .signin-xappy { height: 112px; margin-bottom: 14px; } }
@media (min-width: 900px) and (min-height: 600px) {
  html.ed-xappx .signin-sheet { max-width: 920px; }
  html.ed-xappx .signin-center { flex-direction: row; align-items: center; justify-content: center; gap: 72px; }
  html.ed-xappx .signin-xappy { align-self: center; height: min(440px, 60vh); margin: 0; }
  html.ed-xappx .signin-form { flex: 0 1 384px; min-width: 0; }
}
/* The wordmark's letter spacing stops at its last letter, so it sits truly centred. */
.nameplate.xmark i:last-child { margin-inline-end: -0.18em; }
html.ed-xappx .hello-word .hello-line:last-child { margin-inline-end: -0.06em; }
/* Right-to-left (Arabic): the wordmark and the English line above the title still read left to right. */
.nameplate.xmark { direction: ltr; }
html[dir="rtl"] .xb-eyebrow { direction: ltr; text-align: right; }
/* Phones: the two buttons stacked full width, the same in every language. */
@media (max-width: 699px) { .xb-btns { flex-direction: column; } .xb-btn { width: 100%; justify-content: center; } }
html[dir="rtl"] .xb-markrow { justify-content: flex-end; }
/* XAPPX website touches: cards light up their edge when pointed at; the wordmark in the website's colours. */
@media (hover: hover) and (pointer: fine) {
  .xb-card:not(.soon):hover, .xb-recent:hover { border-color: var(--x-hover, var(--line)); }
}
.nameplate.xmark .c { color: #02beff; } .nameplate.xmark .b { color: #2f80ff; } .nameplate.xmark .v { color: #7a74ff; }
/* Build, Websites and Apps on wide screens (Build without the agent beside it): the page sits in the
   middle of the screen. A longer page starts at the top and scrolls as usual. */
@media (min-width: 700px) {
  html.ed-xappx .xb:not(.xb-split) { min-height: calc(100vh - 73px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 72px; }
  /* Media has tabs of different lengths: it starts at the top so switching never moves the page. */
  html.ed-xappx .xb.md { justify-content: flex-start; padding-top: 48px; }
}

/* XAPPX overview pages: where you are on top, one panel with the thing, its status and its two main
   actions, a line of facts you check often, then its figures as tiles; the lists under it are
   panels with their title inside. */
html.ed-xappx .xv-crumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
html.ed-xappx .xv-crumbs strong { color: var(--text); font-weight: 600; }
html.ed-xappx .xv-crumbs svg { opacity: 0.7; flex: none; }
html.ed-xappx .xv > .page-title { margin-bottom: 18px; }
.xv-head { display: flex; flex-direction: column; gap: 18px; padding: 22px; border-radius: 20px; margin-bottom: 20px; }
.xv-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.xv-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--x-chip, var(--surface-2)); color: var(--accent-text); }
.xv-who { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.xv-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.xv-name strong { font-size: 18px; font-weight: 700; }
.xv-pill { padding: 3px 10px; border-radius: 999px; background: rgba(74, 222, 128, 0.14); color: #4ade80; font-size: 12px; font-weight: 600; }
.xv-sub { color: var(--muted); font-size: 14px; }
.xv-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.xv-strip { display: flex; flex-wrap: wrap; gap: 10px 32px; padding: 14px 18px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.xv-fact { display: inline-flex; gap: 8px; white-space: nowrap; }
.xv-fact-l { color: var(--muted); }
.xv-fact b { font-weight: 600; }
.xv-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.xv-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; font: inherit; text-align: start; }
button.xv-tile { cursor: pointer; transition: border-color 0.15s ease; }
button.xv-tile:hover { border-color: var(--accent-text); }
.xv-tile-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.xv-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; }
.xv-num b { font-size: 26px; font-weight: 700; line-height: 1.2; }
.xv-num small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.xv-tile-s { color: var(--muted); font-size: 12.5px; }
.xv-bar { margin-top: 8px; }
html.ed-xappx .xv > .group:not([hidden]) { padding: 18px 0 4px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
html.ed-xappx .xv > .group > .group-label { padding: 0 22px; color: var(--text); font-size: 16px; font-weight: 600; }
html.ed-xappx .xv > .group > .group-label .text-btn { margin-inline-end: -8px; }
html.ed-xappx .xv > .group > .card.list { border: 0; border-radius: 0 0 20px 20px; background: none; box-shadow: none; }
@media (prefers-color-scheme: light) { .xv-pill { background: rgba(34, 197, 94, 0.14); color: #15803d; } }
@media (min-width: 700px) { .vault-page > .xv-crumbs, .vault-page > .xv-head { grid-column: 1 / -1; } }
/* Under the top bar the path sits close to it; the larger gap is for Twin Chat's side rail. */
@media (min-width: 1100px) { html.ed-xappx .screen > .page.xv { padding-top: calc(28px + var(--safe-t)); } }
@media (max-width: 899px) { .xv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) {
  .xv-head { padding: 16px; gap: 16px; }
  /* Phone: icon and name on one line, the sentence under them across the full width. */
  .xv-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; }
  .xv-who { display: contents; }
  .xv-icon { width: 44px; height: 44px; border-radius: 12px; }
  .xv-sub, .xv-acts { grid-column: 1 / -1; }
  .xv-acts { width: 100%; }
  .xv-acts .xb-btn { flex: 1; justify-content: center; padding: 0 12px; }
  .xv-strip { flex-direction: column; gap: 8px; padding: 12px 14px; }
  .xv-tile { padding: 14px; }
}

/* XAPPX backdrop inside the app: a fine dot grid, even across the whole screen, on the plain
   background. No glow (the launch and sign-in screens keep theirs). Behind everything; only drawn,
   no image to load. Light mode: the same, lighter dots. */
html.ed-xappx .shell::before, html.ed-xappx .solo::before { background: var(--bg); }
html.ed-xappx .shell::after, html.ed-xappx .solo::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(122, 116, 255, 0.20) 1px, transparent 1.5px);
  background-size: 14px 14px;
  /* Soft, slightly out of focus: sharp dots across a whole screen tire the eyes. */
  filter: blur(0.7px);
}
@media (prefers-color-scheme: light) {
  html.ed-xappx .shell::after, html.ed-xappx .solo::after { background-image: radial-gradient(rgba(47, 128, 255, 0.14) 1px, transparent 1.5px); }
}

/* Website and app builder (websites.ts): the bar on top (name, version, computer or phone, point,
   publish), the conversation on the left and the live preview on the right. Phones show one side
   at a time (Chat or Preview). The list of sites and apps uses Build's rows. */
.pj-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.pj-row .pj-live { margin-inline-start: auto; }
.pj-live { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; background: rgba(74, 222, 128, 0.14); color: #4ade80; font-size: 12px; font-weight: 600; text-decoration: none; }
.pj-live[hidden] { display: none; }
@media (prefers-color-scheme: light) { .pj-live { background: rgba(34, 197, 94, 0.14); color: #15803d; } }
.screen:has(> .pj) { overflow: hidden; padding: 0 !important; }
.pj { display: flex; flex-direction: column; height: 100%; }
.pj-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pj-back { margin: 0 -4px 0 -10px; }
.pj-name { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 10px; }
.pj-name strong { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pj-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pj-ver { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: 500 14px/1 inherit; }
.pj-tool { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: 500 14px/1 inherit; cursor: pointer; }
.pj-tool[hidden] { display: none; }
.pj-tool[aria-pressed="true"] { background: var(--x-chip, var(--surface-2)); border-color: var(--accent-text); color: var(--accent-text); }
.pj-tool:disabled { opacity: 0.45; cursor: default; }
.pj-segs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pj-seg { display: grid; place-items: center; width: 38px; height: 34px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.pj-seg[aria-pressed="true"] { background: var(--x-chip, var(--surface-2)); color: var(--accent-text); }
.xb-btn.pj-publish { height: 36px; padding: 0 16px; font-size: 14px; }
.xb-btn.pj-publish:disabled { opacity: 0.45; cursor: default; }
.pj-tabs { display: none; }
.pj-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); }
.pj-chat { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); background: var(--surface); }
.pj-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.pj-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.pj-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-msg.user { align-self: flex-end; background: var(--x-chip, var(--surface-2)); }
.pj-msg.agent { align-self: flex-start; background: var(--surface-2); }
.pj-vchip { display: inline-flex; align-items: center; height: 26px; margin-top: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--accent-text); font: 600 12px/1 inherit; cursor: pointer; }
.pj-msg-pick, .pj-pick { display: flex; align-items: center; gap: 6px; color: var(--accent-text); font-size: 12px; }
.pj-msg-pick { margin-bottom: 6px; }
.pj-msg-pick span, .pj-pick span { overflow-wrap: anywhere; }
.pj-working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.pj-working[hidden] { display: none; }
.pj-dots { display: inline-flex; gap: 4px; }
.pj-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); animation: pj-dot 1.2s ease-in-out infinite; }
.pj-dots i:nth-child(2) { animation-delay: 0.15s; } .pj-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pj-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pj-dots i { animation: none; opacity: 0.7; } }
.pj-composer { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.pj-pick { padding: 6px 8px 6px 10px; border-radius: 10px; background: var(--x-chip, var(--surface-2)); }
.pj-pick[hidden] { display: none; }
.pj-pick-x { margin-inline-start: auto; display: grid; place-items: center; width: 24px; height: 24px; border: 0; background: none; color: inherit; cursor: pointer; }
.pj-field { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.pj-input { flex: 1; min-height: 44px; max-height: 160px; padding: 11px 0; border: 0; background: none; color: var(--text); font: 15px/1.45 inherit; resize: none; outline: none; }
.pj-field .send:disabled { opacity: 0.4; }
.pj-view { min-height: 0; display: flex; }
.pj-stage { flex: 1; position: relative; display: flex; justify-content: center; padding: 18px; min-height: 0; }
.pj-device { flex: 1; display: flex; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22); }
.pj-stage.phone .pj-device { flex: 0 1 390px; border: 8px solid #0b0f19; border-radius: 30px; }
.pj-stage.picking .pj-device { outline: 2px dashed var(--accent-text); outline-offset: 5px; }
.pj-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.pj-empty { position: absolute; inset: 18px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); text-align: center; }
.pj-empty[hidden] { display: none; }
.pj-empty p { margin: 0; }
.pj-brief { min-height: 96px; resize: vertical; }
.pj-pub { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 12px; }
.pj-pub.off { opacity: 0.55; }
.pj-pub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pj-pub-head .xb-text { display: flex; flex-direction: column; gap: 2px; }
.pj-pub-head small { color: var(--muted); font-size: 13px; }
.pj-pub-row { display: flex; gap: 8px; }
.pj-pub-row .field { flex: 1; min-width: 0; }
.pj-domain { flex: 0 0 auto !important; width: auto; }
@media (max-width: 899px) {
  .pj-bar { padding: 8px 12px; }
  .pj-tabs { display: flex; order: 3; width: 100%; margin: 0; }
  .pj-tools { order: 4; width: 100%; }
  .pj-segs { display: none; }
  .pj-tools .xb-btn.pj-publish { margin-inline-start: auto; }
  .pj-body { grid-template-columns: minmax(0, 1fr); }
  .pj-chat { border: 0; }
  .pj:not(.show-chat) .pj-chat { display: none; }
  .pj.show-chat .pj-view { display: none; }
  .pj-stage { padding: 10px; }
  .pj-empty { inset: 10px; }
}
@media (max-width: 699px) { .pj { padding-bottom: calc(69px + var(--safe-b)); } }
/* Build's agent pane is narrow: its header keeps the name and status, the model strip stays in Agents. */
html.ed-xappx .xb-side .head-info { display: none; }

/* XAPPX launch screen (build.mjs): navy like the XAPPX website whatever the theme, the dot grid and a
   soft glow, the app icon inside a turning ring of the brand gradient, the name, the tagline and a
   thin progress line. The welcome words stay for screen readers (the progress line's label). */
html.ed-xappx .boot-splash { background: radial-gradient(420px 320px at 50% 46%, rgba(47, 128, 255, 0.14), transparent 70%), radial-gradient(600px 420px at 85% 0%, rgba(122, 116, 255, 0.16), transparent 70%), #0c1119; isolation: isolate; }
html.ed-xappx .boot-splash::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(rgba(122, 116, 255, 0.34) 1px, transparent 1.5px); background-size: 14px 14px; -webkit-mask-image: radial-gradient(60% 60% at 50% 46%, transparent 18%, #000 60%, transparent 92%); mask-image: radial-gradient(60% 60% at 50% 46%, transparent 18%, #000 60%, transparent 92%); }
html.ed-xappx .boot-box { width: auto; }
html.ed-xappx .xboot-icon { position: relative; width: 136px; height: 136px; margin-bottom: 22px; }
/* Just the X, no white tile: a soft glow keeps its dark strokes visible on the dark screen. */
html.ed-xappx .xboot-icon img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 10px rgba(47, 128, 255, 0.55)) drop-shadow(0 0 30px rgba(122, 116, 255, 0.22)); animation: xboot-spin 1.6s linear infinite; }
html.ed-xappx .boot-splash .boot-mark { margin-bottom: 12px; font-size: 30px; color: #edf2fa; }
html.ed-xappx .xboot-tag { margin: 0; color: #02beff; font: 500 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.32em; white-space: nowrap; }
html.ed-xappx .boot-splash .boot-title, html.ed-xappx .boot-splash .boot-sub { display: none; }
/* XAPPX loads with the turning X alone: the bar stays in the page (the app still waits on it) but takes no room and isn't seen. */
html.ed-xappx .boot-splash .boot-bar { width: 168px; height: 0; visibility: hidden; }
html.ed-xappx .boot-splash .boot-bar i { border-radius: 1px; background: linear-gradient(90deg, #02beff, #2f80ff, #7a74ff); box-shadow: 0 0 10px rgba(47, 128, 255, 0.8); }
html.ed-xappx .boot-splash .boot-slow p { color: #93a3bc; }
/* The X turns like a coin: upright, around its own vertical line. */
@keyframes xboot-spin { from { transform: perspective(700px) rotateY(0deg); } to { transform: perspective(700px) rotateY(360deg); } }
/* XAPPX: while something loads, the X turns (no ring). The small spinner inside buttons stays a ring:
   the X can't be read at that size. */
html.ed-xappx .spinner:not(.tiny) { width: 38px; height: 38px; border: 0; border-radius: 0; background: url("/glyph.png") center / contain no-repeat; filter: drop-shadow(0 0 3px rgba(47, 128, 255, 0.6)); animation: xboot-spin 1.6s linear infinite; }
@media (prefers-reduced-motion: reduce) { html.ed-xappx .xboot-icon img, html.ed-xappx .spinner:not(.tiny) { animation: none; } }
/* A status chip sits at the end of a row, before its arrow. */
.pj-row .mi-chip { margin-inline-start: auto; }
.pj-row .mi-chip + svg { margin-inline-start: 0; }
.pj-row .mi-tag + svg { margin-inline-start: 0; }
.pj-row .mi-tag { margin-inline-start: auto; }
/* Twin Chat has Media too (media.ts): the XAPPX tokens its screens use, in Twin Chat's own colours. */
html:not(.ed-xappx) {
  --x-grad: var(--accent);
  --x-ink: #ffffff;
  --x-chip: color-mix(in srgb, var(--accent) 16%, transparent);
  --x-panel: var(--surface-2);
}
/* Media in Twin Chat (mediatwin.ts): Twin Chat's own page, cards and buttons. */
.md-tpage .segmented { max-width: 360px; }
.md-tadd { margin: 0 0 24px; }
.md-tphone { display: none; }
.md-samples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.md-sample { overflow: hidden; padding: 0; }
.md-sframe { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0b1630, #1d3b78); }
.md-sframe iframe, .md-splay { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.md-splay { display: flex; align-items: center; justify-content: center; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.md-splay img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.md-sbtn { position: relative; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.md-sinfo { padding: 12px 16px 14px; }
.md-sinfo p { margin: 0; }
@media (max-width: 699px) { .md-samples { grid-template-columns: minmax(0, 1fr); } }
/* Media brand kit (mediabrand.ts) and request details, both apps. */
.md-brandrow { width: 100%; margin-top: 12px; border: 1px solid var(--line); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.md-brandrow > .icon:last-child { color: var(--muted); flex: none; }
.mb-card { padding: 16px; }
.mb-hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 20px; }
.mb-hint .sn, .mi-meta.mb-hint .sn { display: block; }
.mi-block .mb-hint { margin: -4px 0 12px; }
.mb-form { margin-bottom: 0; }
.mb-filebox { display: flex; flex-direction: column; gap: 10px; }
.mb-filebox .md-files:empty { display: none; }
.mb-chosen .md-filerow { background: var(--surface-2); border-color: transparent; padding: 8px 10px; }
.mb-chosen .row-icon { width: 36px; height: 36px; }
.mb-filebox > .xb-btn { align-self: flex-start; width: auto; }
.md-cancel { margin-top: 16px; color: var(--alert); }
.mb-filebox .md-filerow .row-icon { width: 36px; height: 36px; }
.md-tpage .md-filerow { background: var(--surface-2); border-color: transparent; }
.mb-ftext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-ftext b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.mb-ftext small { color: var(--muted); font-size: 13px; }
.mb-addfile { display: inline-flex; align-items: center; justify-content: center; gap: 8px; align-self: flex-start; width: auto; min-height: 40px; padding: 0 16px; }
.mb-x { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.mb-x:hover { background: var(--surface-2); color: var(--text); }
.mb-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mb-color { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
dd .mb-color { padding-inline-end: 10px; }
.mb-swatch { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.12); flex: none; }
.mb-hex { font-weight: 600; font-size: 13px; letter-spacing: 0.02em; }
.mb-add-color { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px dashed var(--line); border-radius: 12px; background: none; color: var(--accent-text); font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.mb-picker { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mb-consent { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.mi-form > .mb-consent { margin-top: 0; }
.mb-consent-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mb-consent-text b { font-weight: 600; font-size: 15px; }
.mb-consent-text small { color: var(--muted); font-size: 13px; line-height: 18px; }
.mb-save { margin-top: 20px; }
.md-tpage > .btn-primary:last-child { margin-top: 8px; }
.md-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; line-height: 20px; }
.md-dl dt { color: var(--muted); }
.md-dl dd { margin: 0; overflow-wrap: anywhere; }
.mb-links { display: flex; flex-direction: column; gap: 2px; }
.mb-kind { margin: 14px 0 8px; }
.mb-drow { display: flex; padding: 12px 16px; }
.mb-drow .row-text { display: flex; flex-direction: column; gap: 2px; }
.mb-drow .row-detail { font-size: 13px; }
.md-due { max-width: 220px; }
.mb-sum > span { white-space: nowrap; }
/* Twin Chat sizes for the Media forms: titles 13.5px, details 12px, like its rows. */
html:not(.ed-xappx) .md-chip { font-family: inherit; font-size: 13.5px; font-weight: 500; height: 32px; padding: 0 12px; }
html:not(.ed-xappx) .md-chip.on { font-weight: 600; }
html:not(.ed-xappx) .mi-field .field-label { font-size: 13.5px; }
html:not(.ed-xappx) .mi-form .mi-meta, html:not(.ed-xappx) .sheet .mi-meta { font-size: 12px; line-height: 17px; }
html:not(.ed-xappx) .md-type b { font-size: 13.5px; font-weight: 600; }
html:not(.ed-xappx) .md-type small { font-size: 12px; }
html:not(.ed-xappx) .mb-hint { font-size: 12px; line-height: 17px; }
html:not(.ed-xappx) .mb-ftext b, html:not(.ed-xappx) .mb-consent-text b { font-size: 13.5px; font-weight: 600; }
html:not(.ed-xappx) .mb-ftext small, html:not(.ed-xappx) .mb-consent-text small { font-size: 12px; line-height: 17px; }
html:not(.ed-xappx) .mb-hex { font-size: 12px; }
html:not(.ed-xappx) .mb-add-color { font-size: 13.5px; }
html:not(.ed-xappx) .mb-drow .row-detail { font-size: 12px; }
html:not(.ed-xappx) .sheet .md-link { font-size: 13.5px; }
@media (max-width: 699px) { .md-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .md-dl dd { margin-bottom: 8px; } }
@media (max-width: 699px) { .md-twide { display: none; } .md-tphone { display: block; } }
.md-tbtn { width: auto; margin: 0; padding: 8px 16px; font-size: 14px; flex: none; text-decoration: none; display: inline-flex; align-items: center; }
.md-tnum { font-weight: 700; font-size: 16px; }
.md-tend { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); flex: none; }
.md-tpage .row-detail .sn { display: block; }
.md-tplayer { margin: 0 0 12px; width: 100%; }
.md-tcancel { margin-top: 12px; }
.md-tpage .card.note .md-link { color: var(--accent-text); }
/* Twin Chat Media: the in-card button is for wide screens, the full-width one for phones. */
@media (max-width: 699px) { .btn-primary.md-twide { display: none; } }
@media (min-width: 1100px) { .md-samples { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- The Media team's own screen (mediateam.ts): the app's name, "Media team", their account, and Media under it ---- */
.mt-shell > .mt-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + var(--safe-t)) 20px 6px; }
.mt-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mt-tag { flex: none; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 5px 10px; border-radius: 999px; background: var(--seg-on); color: var(--accent-text); white-space: nowrap; }
.mt-me { flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.mt-acts { flex: none; display: flex; align-items: center; gap: 10px; }
.mt-bell { position: relative; flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: var(--seg-on); color: var(--accent-text); border: 1px solid var(--line); cursor: pointer; }
.mt-bell .badge { top: -6px; right: -8px; }
.segmented.mt-tabs { flex: none; margin: 12px 20px 0; }
.mt-tabs .seg { padding: 9px 0; font-size: 15px; }
.mt-notice { align-items: flex-start; text-align: left; }
.mt-notice .row-text { min-width: 0; }
.mt-notice .row-title, .mt-notice .row-detail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Her tabs start at the top, like Media: no centring of a short page, and the header already clears the status bar. */
.mt-shell .screen > .page::before, .mt-shell .screen > .page::after { display: none; }
.mt-shell .screen > .page:not(.home) { padding-top: 18px; }
.mt-notice:disabled { opacity: 1; cursor: default; }
.mt-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.mt-notice.unread .mt-dot { background: var(--accent); }
.mt-when { flex: none; color: var(--muted); font-size: 13px; white-space: nowrap; margin-top: 2px; }
.mt-me .me { display: grid; place-items: center; background: var(--seg-on); color: var(--accent-text); border: 1px solid var(--line); }
.mt-shell .screen { padding-bottom: calc(28px + var(--safe-b)); }
.shell.mt-shell { flex-direction: column; }
.mt-shell .ax { padding-top: 22px; }
@media (min-width: 900px) {
  .mt-shell > .mt-top { width: 100%; max-width: 1240px; margin: 0 auto; box-sizing: border-box; padding: 22px 34px 0; }
  .segmented.mt-tabs { width: 300px; align-self: flex-start; margin: 16px 0 0 max(34px, calc((100% - 1240px) / 2 + 34px)); }
  .mt-shell .screen > .page:not(.home) { padding-top: 22px; }
}

/* Vault tab: Claude and ChatGPT connected to the vault, and how to connect one (vault.ts aiSection) */
.ai-ic { background: var(--twin); color: #fff; border: 0; }
/* Each AI app has its own colored line, like the storage overview: down the left on phones, across the top on PC. */
.ai-apps .ai-row { position: relative; }
.ai-apps .ai-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--ai-c, var(--accent)), transparent 90%); }
.ai-row-claude { --ai-c: #d97757; }
.ai-row-chatgpt { --ai-c: #10a37f; }
.ai-row-gemini { --ai-c: #6f7cf0; }
.ai-row-grok { --ai-c: var(--text); }
.ai-row .ai-open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.ai-row .ai-connect { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--accent-text); font-weight: 600; }
.ai-row .ai-remove { flex: none; padding: 6px 2px; font-weight: 600; }
.ai-sheet .ai-lead { margin: 0 0 14px; }
.ai-sheet .ai-lead .sn { display: block; }
.ai-url { padding: 14px 16px; margin: 0; }
.ai-url-text { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14.5px; overflow-wrap: anywhere; color: var(--text); }
.ai-sheet .ai-copy { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.ai-steps { margin-top: 18px; }
.ai-steps .group-label { margin: 0 0 8px; }
.ai-list { margin: 0; padding: 12px 18px 12px 38px; }
.ai-list li { padding: 4px 0; line-height: 1.4; }
.ai-sheet .foot-note { margin-top: 16px; }

/* How to save (Claude and ChatGPT): pictures in each app's own chat style, light like their apps */
.ai-sheet .ai-guide-btn { margin-top: 16px; }
.ai-guide .ai-part { padding: 4px 0 14px; }
.ai-guide .ai-part .ai-list { padding-bottom: 6px; }
.ai-shot { margin: 8px 14px 0; border-radius: 12px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.1); box-shadow: 0 6px 18px rgba(11, 16, 48, 0.08); font-size: 14px; line-height: 1.4; }
.ai-shot-bar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: 12px; font-weight: 600; }
.ai-shot-dots { display: flex; gap: 4px; }
.ai-shot-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
.ai-shot-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.ai-shot-me { align-self: flex-end; max-width: 92%; padding: 7px 12px; }
.ai-shot-say { align-self: flex-start; }
.ai-shot-tool { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.ai-shot-ask { padding: 10px 12px; border-radius: 10px; }
.ai-shot-ask p { margin: 0 0 8px; font-weight: 600; }
.ai-shot-ask-btns { display: flex; justify-content: flex-end; gap: 8px; }
.ai-shot-btn { padding: 4px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; }
/* Claude: warm paper, serif replies */
.ai-shot-claude { background: #faf9f5; color: #1f1e1d; }
.ai-shot-claude .ai-shot-bar { background: #d97757; color: #fff; }
.ai-shot-claude .ai-shot-me { background: #f0eee6; border-radius: 12px; }
.ai-shot-claude .ai-shot-say { font-family: ui-serif, Georgia, "Times New Roman", serif; font-size: 14.5px; }
.ai-shot-claude .ai-shot-tool { border: 1px solid #e3dfd3; color: #5b574a; background: #fff; }
.ai-shot-claude .ai-shot-ask { background: #fff; border: 1px solid #e3dfd3; }
.ai-shot-claude .ai-shot-btn { border: 1px solid #d9d4c7; color: #3d3929; }
.ai-shot-claude .ai-shot-btn.on { background: #d97757; color: #fff; border-color: #d97757; }
.ai-shot-claude .ai-shot-tool svg { color: #d97757; }
.ai-shot-claude { border-color: #e7b9a6; }
/* ChatGPT: white, grey pill for your message */
.ai-shot-chatgpt { background: #fff; color: #0d0d0d; }
.ai-shot-chatgpt .ai-shot-bar { background: #10a37f; color: #fff; }
.ai-shot-chatgpt .ai-shot-me { background: #f1f1f1; border-radius: 18px; }
.ai-shot-chatgpt .ai-shot-tool { border: 1px solid #e5e5e5; color: #5d5d5d; background: #fafafa; border-radius: 999px; }
.ai-shot-chatgpt .ai-shot-ask { background: #f9f9f9; border: 1px solid #e5e5e5; border-radius: 14px; }
.ai-shot-chatgpt .ai-shot-btn { border: 1px solid #d9d9d9; color: #0d0d0d; border-radius: 999px; }
.ai-shot-chatgpt .ai-shot-btn.on { background: #10a37f; color: #fff; border-color: #10a37f; }
.ai-shot-chatgpt .ai-shot-tool svg { color: #10a37f; }
.ai-guide .foot-note .sn { display: block; }
.ai-sheet .ai-part-claude .group-label { color: #c15f3c; font-weight: 700; }
.ai-sheet .ai-part-chatgpt .group-label { color: #10a37f; font-weight: 700; }
.ai-sheet .ai-part-claude .card { border-top: 4px solid #d97757; }
.ai-sheet .ai-part-chatgpt .card { border-top: 4px solid #10a37f; }
.ai-sheet .ai-part-claude .ai-list li::marker { color: #d97757; font-weight: 700; }
.ai-sheet .ai-part-chatgpt .ai-list li::marker { color: #10a37f; font-weight: 700; }
.ai-sheet .ai-part-gemini .group-label { color: #6f63d3; font-weight: 700; }
.ai-sheet .ai-part-gemini .card { border-top: 4px solid #7b8cf0; }
.ai-sheet .ai-part-gemini .ai-list li::marker { color: #6f63d3; font-weight: 700; }
.ai-sheet .ai-part-grok .group-label { color: var(--text); font-weight: 700; }
.ai-sheet .ai-part-grok .card { border-top: 4px solid #0d0d0d; }
.ai-sheet .ai-part-grok .ai-list li::marker { color: var(--text); font-weight: 700; }
.ai-sheet .ai-connect-card { padding: 14px 14px 12px; }
.ai-connect-card .ai-url { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ai-connect-card .ai-copy { margin-top: 10px; }
.ai-sheet .ai-connect-card .ai-list { padding: 10px 4px 0 24px; }
.ai-sheet .ai-app-note { margin: 6px 0 0 4px; color: var(--muted); font-size: 13.5px; }
.ai-sheet .ai-app-note .sn { display: block; }
/* Gemini: white, soft blue bubble, its blue to violet bar */
.ai-shot-gemini { background: #fff; color: #1f1f1f; }
.ai-shot-gemini .ai-shot-bar { background: linear-gradient(90deg, #4285f4 0%, #9b72cb 60%, #d96570 100%); color: #fff; }
.ai-shot-gemini .ai-shot-me { background: #e9eef6; border-radius: 18px 4px 18px 18px; }
.ai-shot-gemini .ai-shot-tool { border: 1px solid #dde3ea; color: #444746; background: #f8fafd; border-radius: 999px; }
.ai-shot-gemini .ai-shot-tool svg { color: #0b57d0; }
.ai-shot-gemini .ai-shot-ask { background: #f8fafd; border: 1px solid #dde3ea; border-radius: 16px; }
.ai-shot-gemini .ai-shot-btn { border: 1px solid #c4c7c5; color: #0b57d0; border-radius: 999px; }
.ai-shot-gemini .ai-shot-btn.on { background: #0b57d0; color: #fff; border-color: #0b57d0; }
/* Grok: black bar, plain grey bubble, black buttons */
.ai-shot-grok { background: #fff; color: #0d0d0d; }
.ai-shot-grok .ai-shot-bar { background: #0d0d0d; color: #fff; }
.ai-shot-grok .ai-shot-me { background: #efefef; border-radius: 20px; }
.ai-shot-grok .ai-shot-tool { border: 1px solid #e2e2e2; color: #555; background: #f7f7f7; border-radius: 999px; }
.ai-shot-grok .ai-shot-ask { background: #f7f7f7; border: 1px solid #e2e2e2; border-radius: 16px; }
.ai-shot-grok .ai-shot-btn { border: 1px solid #d0d0d0; color: #0d0d0d; border-radius: 999px; }
.ai-shot-grok .ai-shot-btn.on { background: #0d0d0d; color: #fff; border-color: #0d0d0d; }

/* Your look (look.ts): a person's own colours, name and logo. "Powered by Twin Chat" stays. */
.np-own { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.np-own > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-pow { font-size: 0.62em; font-weight: 500; opacity: 0.8; letter-spacing: 0.01em; white-space: nowrap; }
.rail-brand .np-pow { display: none; }
.rail-pow { display: none; }
@media (min-width: 700px) {
  .rail-pow:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 10px; font-size: 12px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.02em; }
  .rail-pow img { width: 14px; height: 14px; opacity: 0.6; }
  /* A minimized sidebar shows no names, so no "Powered by" line either. */
  .rail-mini .rail-pow:not([hidden]) { display: none; }
}
.look-sub { margin: 0 18px 4px; color: var(--muted); font-size: 14px; }
.look-tiles { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 12px; padding: 10px 18px 18px; }
.look-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; min-width: 0; }
.look-tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.look-dot { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 4px 10px rgba(0, 0, 0, 0.12); }
.look-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.look-note { margin-top: -6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.look-ck { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.look-ck .icon { stroke-width: 3; }
.look-id { display: flex; align-items: center; gap: 18px; padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.look-logo { width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--twin); display: grid; place-items: center; overflow: hidden; }
.look-logo img { max-width: 46px; max-height: 46px; object-fit: contain; }
/* Their own logo fills the tile like an app icon, whatever its shape. */
.look-logo.own { display: block; background: var(--surface-2); }
.look-logo.own img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.nameplate-logo.own { width: 1.6em; height: 1.6em; max-width: none; object-fit: cover; border-radius: 0.38em; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.look-id-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.look-hint + .look-hint { margin-top: -6px; }
.look-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.look-in { height: 42px; max-width: 360px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--surface-2); font: inherit; font-size: 16px; color: var(--text); outline: none; }
.look-in:focus { border-color: var(--accent); }
.look-hint { font-size: 12.5px; color: var(--muted); }
.look-id-btns { display: flex; gap: 10px; flex: none; }
.look-btn { height: 40px; padding: 0 18px; border-radius: 20px; border: 0; background: var(--twin); color: #fff; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.look-btn.plain { background: var(--surface-2); color: var(--text); }
.look-btn:disabled { opacity: 0.6; }
.look-seg { min-width: 300px; }
.look-seg .seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0; font-size: 15px; }
/* XAPPX keeps its switches as they were. */
html.ed-xappx .switch.on { background: linear-gradient(135deg, #0c9dd8, #2a3fb0); }
.look-prev { margin: 4px 0 18px; border-radius: 22px; padding: 20px 22px 22px; color: #fff; background: var(--band); box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 2px; }
.look-prev .nameplate { margin-bottom: 14px; font-size: 18px; }
.look-prev small { opacity: 0.85; font-size: 14px; }
.look-prev b { font-size: 26px; letter-spacing: -0.01em; }
.look-card .look-id { border-top: 0; flex-wrap: wrap; padding: 16px; }
.look-card .look-id-btns { width: 100%; }
.look-card .look-id-btns .look-btn { flex: 1; }
.look-card .look-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; }
.look-card.pad { padding: 14px; }
.look-card .look-seg { min-width: 0; }

/* ---- Business Card (card.ts, cardpage.ts) ---- */
.card-pill { vertical-align: middle; margin-inline-start: 12px; font-family: "Source Sans 3", sans-serif; letter-spacing: 0; position: relative; top: -4px; }
.card-top { display: flex; align-items: center; gap: 28px; margin-bottom: 22px; }
.card-qr { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; text-align: center; }
.card-top { --cc: var(--accent); }
.card-cc { flex: 1; max-width: 420px; aspect-ratio: 1.75; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--cc); box-shadow: 0 10px 28px rgba(15, 25, 60, 0.12); overflow: hidden; }
.card-cc-head { display: flex; align-items: center; gap: 12px; }
.card-face-cc { width: 52px; height: 52px; font-size: 19px; }
.card-cc .card-face-cc:not(.has-photo) { background: var(--cc); }
.card-cc-id { display: flex; flex-direction: column; min-width: 0; }
.card-cc-name { font-family: "Creato Display", "Source Sans 3", sans-serif; font-weight: 700; font-size: 20px; line-height: 1.2; }
.card-cc-who { color: var(--muted); font-size: 14px; }
.card-cc-bio { flex: none; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-cc-lines { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.card-cc-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.card-cc-line .icon { color: var(--cc); flex: none; }
.card-cc-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-swatch-now { width: 22px; height: 22px; border-radius: 50%; background: var(--cc, var(--accent)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); flex: none; }
.card-swatches { display: grid; grid-template-columns: repeat(auto-fill, 48px); gap: 14px; justify-content: center; padding: 6px 0 12px; }
.card-swatch { --cc: var(--accent); width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: var(--cc); padding: 0; cursor: pointer; position: relative; display: grid; place-items: center; }
.card-swatch.on { box-shadow: 0 0 0 3px var(--accent-text); }
.card-swatch-own { background: var(--surface-2); color: var(--muted); overflow: hidden; }
.card-swatch-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
/* Our own color picker (colorpick.ts): the same on every device. */
.cp { display: flex; flex-direction: column; gap: 16px; }
.cp-sv { position: relative; height: 190px; border-radius: 14px; touch-action: none; cursor: crosshair; background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0)), var(--hue, #f00); box-shadow: inset 0 0 0 1px var(--line); }
.cp-hue { position: relative; height: 26px; border-radius: 13px; touch-action: none; cursor: pointer; background: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); box-shadow: inset 0 0 0 1px var(--line); }
.cp-dot { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); transform: translate(-50%, -50%); pointer-events: none; box-sizing: border-box; }
.cp-hue .cp-dot { top: 50%; }
.cp-row { display: flex; align-items: center; gap: 14px; }
.cp-swatch { width: 48px; height: 48px; border-radius: 50%; flex: none; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.cp-hexlabel { flex: 1; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; font-weight: 600; }
.cp-hex { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.cp-hex.bad { border-color: var(--alert); }
.card-fliphint { display: none; }
@media (max-width: 640px) {
  .card-top { display: grid; perspective: 1200px; margin-bottom: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .card-top > .card-qr, .card-top > .card-cc { grid-area: 1 / 1; width: 100%; max-width: none; aspect-ratio: 1.75; box-sizing: border-box; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.55s ease; }
  .card-top > .card-qr { transform: rotateY(180deg); justify-content: center; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--cc); box-shadow: 0 10px 28px rgba(15, 25, 60, 0.12); }
  .card-top > .card-qr .card-qrimg { width: auto; height: 84%; padding: 4px; margin: 0; border-radius: 10px; }
  .card-top > .card-qr .card-url { font-size: 14px; }
  .card-top > .card-qr .card-urlnote { font-size: 12px; }
  .card-top.flipped > .card-cc { transform: rotateY(-180deg); }
  .card-top.flipped > .card-qr { transform: rotateY(0deg); }
  .card-cc { padding: 18px 20px; gap: 8px; }
  .card-cc-bio { -webkit-line-clamp: 1; font-size: 13px; }
  .card-fliphint { display: block; text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 20px; }
}
.card-flip { display: grid; perspective: 1200px; margin-bottom: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.card-flip > .card-qr, .card-flip > .card-cc { grid-area: 1 / 1; width: 100%; max-width: none; aspect-ratio: 1.75; box-sizing: border-box; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.55s ease; }
.card-flip > .card-qr { transform: rotateY(180deg); justify-content: center; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--cc); box-shadow: 0 10px 28px rgba(15, 25, 60, 0.12); }
.card-flip > .card-qr .card-qrimg { width: auto; height: 84%; padding: 4px; margin: 0; border-radius: 10px; }
.card-flip > .card-qr .card-url { font-size: 14px; }
.card-flip > .card-qr .card-urlnote { font-size: 12px; }
.card-flip.flipped > .card-cc { transform: rotateY(-180deg); }
.card-flip.flipped > .card-qr { transform: rotateY(0deg); }
.card-flip { margin-bottom: 10px; }
.card-flip > .card-cc { max-width: none; }
.cardpg-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
@media (prefers-reduced-motion: reduce) { .card-top > .card-qr, .card-top > .card-cc { transition: none; } }
.card-qrimg { width: 184px; height: 184px; image-rendering: pixelated; border-radius: 14px; background: #fff; padding: 8px; margin-bottom: 8px; }
.card-url { font-weight: 600; overflow-wrap: anywhere; }
.card-urlnote { color: var(--muted); font-size: 14px; }
.card-stats { margin: 0 0 12px; }
.card-stats .stat { padding: 14px 16px; }
.card-stats .stat strong { font-size: 28px; }
.card-statnote { margin: 0 0 24px; }
.card-face { flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 700; background: var(--twin); }
.card-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-face-sm { width: 44px; height: 44px; font-size: 16px; }
.card-face-lg { width: 104px; height: 104px; font-size: 36px; border: 4px solid var(--bg); box-sizing: content-box; }
.card-row { gap: 12px; }
.card-rowmain { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; margin: 0; text-align: start; color: inherit; font: inherit; }
.card-sw { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.card-sw small { font-size: 12px; color: var(--muted); }
.card-page .row-detail { overflow: hidden; text-overflow: ellipsis; }
.card-unpub { margin-top: 24px; }
.card-hint { color: var(--sheet-muted, var(--muted)); font-size: 14px; margin: 2px 0 10px; }
.card-bio { resize: vertical; min-height: 84px; font-family: inherit; }
.card-plabel { margin-top: 18px; }
.card-contact { padding: 12px 16px; }
.card-cline { display: block; margin: 2px 0; font-size: 15px; overflow-wrap: anywhere; }
.card-preview { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--bg); }
.card-preview .cardpg { padding-bottom: 18px; }
.card-qrfull { position: fixed; inset: 0; z-index: 60; background: #fff; color: #0b1030; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; }
.card-qrbig { width: min(78vw, 60vh, 420px); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.card-qrname { font-family: "Creato Display", "Source Sans 3", sans-serif; font-weight: 700; font-size: 26px; margin-top: 8px; }
.card-qrhint { color: #5b6785; font-size: 16px; }

.cardpg-wrap { min-height: 100%; }
.cardpg { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 20px calc(28px + var(--safe-b)); box-sizing: border-box; }
.cardpg-band { height: 124px; margin: 0 -20px; background: var(--cc, var(--twin)); }
.cardpg-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: -56px; margin-bottom: 18px; }
.cardpg-name { font-size: 30px; margin-top: 10px; overflow-wrap: anywhere; }
.cardpg-who { color: var(--muted); font-size: 16px; margin-top: 4px; overflow-wrap: anywhere; }
.cardpg-bio { font-size: 16px; line-height: 1.45; margin-top: 12px; overflow-wrap: anywhere; }
.cardpg-btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; }
.cardpg-list { margin: 20px 0 0; }
.cardpg-list .row { text-decoration: none; box-sizing: border-box; }
.cardpg-own { display: block; text-align: center; text-decoration: none; color: var(--accent-text); margin-top: 20px; box-sizing: border-box; }
.cardpg-pow { display: flex; align-items: center; justify-content: center; gap: 6px; }
.cardpg-pow img { width: 14px; height: 14px; }
.cardpg-none .cardpg-head { margin-top: 28px; }
@media (min-width: 700px) { .cardpg { padding-top: 28px; } .cardpg-band { border-radius: 22px; margin: 0; } }
.cardpg .cardpg-name + .cardpg-who { margin-top: 4px; }
.cardpg .cardpg-name + .cardpg-bio { margin-top: 12px; }

/* ---- Terms and Privacy (legal.ts) ---- */
.prose.legal .legal-updated { color: var(--muted); font-size: 14px; margin: 0 0 18px; text-align: start; }
.prose.legal .legal-h { font-size: 19px; font-weight: 700; margin: 26px 0 8px; color: var(--text); }
.prose.legal .legal-list { margin: 0 0 14px; padding-inline-start: 22px; }
.prose.legal .legal-list li { color: var(--text); font-size: 16px; line-height: 1.5; margin: 0 0 6px; }
.prose.legal .legal-note { margin-top: 30px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.prose.legal .legal-note p { color: var(--muted); font-size: 14px; text-align: start; margin: 0 0 6px; }
.prose.legal .legal-note p:last-child { margin-bottom: 0; }

/* AI consent and beta notice: one column. The tick sits in a box as wide as the card above, its
   box in line with the card's text; the button under it; the two links side by side, centered. */
.consent-foot .agree-check { margin: 12px 0 0; padding: 13px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); align-items: flex-start; }
/* The box sits beside the first line, the way a checkbox is read, not between the two lines. */
.consent-foot .agree-check .agree-box { margin: 1px 0 0; }
.consent-foot .btn-primary { margin: 12px 0 0; }
.consent-links { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 6px; }
.consent-links .text-btn { padding: 10px 2px; }
.card-ask { align-items: center; }
.card-askbtns { display: flex; gap: 8px; flex: none; }
.card-askbtn { width: auto; min-height: 38px; padding: 0 14px; font-size: 14px; margin: 0; }
.cardpg-flipped { padding-top: calc(28px + var(--safe-t)); }
.cardpg-acts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cardpg-act { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; text-decoration: none; }
.cardpg-need { text-align: center; color: var(--muted); font-size: 14px; margin: 2px 0; }
.cardpg-acts .cardpg-own { margin-top: 0; }
@media (max-width: 420px) { .card-ask { flex-wrap: wrap; } .card-askbtns { width: 100%; padding-left: 56px; } }
/* PDF pages drawn on phones (pdfview.ts) */
.viewer-pdf-pages { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.viewer-pdf-page { display: block; width: 100%; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(15, 25, 60, 0.18); }
/* Files dragged over the chat (computers) */
.chat-drop { outline: 2px dashed var(--accent); outline-offset: -8px; border-radius: 18px; }
.chat-drop .list { opacity: 0.55; }
.vapp-icon.navy { background: linear-gradient(135deg, #2a5bd7, #13246b); } .vapp-icon.rose { background: linear-gradient(135deg, #f0457a, #b0247e); }
/* Chats title with the Chatter icon beside it */
.cl-head { display: flex; align-items: center; gap: 8px; padding-right: 14px; }
.cl-head .cl-title { flex: 1; min-width: 0; }
.cl-chatter { flex: none; margin-top: -10px; color: var(--accent-text); }
.list-mode .cl-head { padding-right: 68px; }
.list-mode .cl-chatter { margin-top: -8px; }
.head-chatter { flex: none; color: var(--muted); }
/* Phones: three icons in the chat header, so they sit closer together and the status line stays on one line */
@media (max-width: 640px) {
  .chat-head { gap: 8px; }
  .chat-head .head-chatter, .chat-head .head-chats, .chat-head .head-search { width: 32px; height: 32px; padding: 4px; margin: 0; }
  .chat-head .head-chatter { margin-left: auto; }
  .chat-head .head-chatter + .head-chats, .chat-head .head-chatter + .head-chats + .head-search { margin-left: -6px; }
}

/* Twin Business Card (April's board): Ask my Twin, footer, Deep Blue small text, email signature, brand. */
.cardpg { --deep: #2a3fb0; }
:root[data-theme="dark"] .cardpg { --deep: var(--accent-text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cardpg { --deep: var(--accent-text); } }
.cardpg-hint, .cardpg-need { color: var(--deep); }
.cardpg-twin { margin-top: 10px; }
.cardpg-twin .icon { color: var(--cc, var(--accent)); }
.cardpg-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
.cardpg-ownlink { color: var(--deep); font-weight: 600; font-size: 15px; text-decoration: none; text-align: center; }
.cardpg-ownlink:hover { text-decoration: underline; }
.cardpg-foot .cardpg-pow { margin: 0; }
.cardpg-branded .btn-primary.cardpg-btn { background: var(--brand-a); background-image: none; color: #fff; }
.cardpg-branded .cardpg-pow img { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }

.twin-sheet .sheet { display: flex; flex-direction: column; max-height: min(86vh, 720px); padding-bottom: calc(12px + var(--safe-b)); }
.twin-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 8px; }
.twin-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.twin-name { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twin-tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--cc, #2a3fb0); border-radius: 999px; padding: 3px 8px; }
.twin-note { margin: 0 4px 10px; font-size: 13px; color: var(--sheet-muted); }
.twin-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; min-height: 120px; }
.twin-msg { max-width: 85%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.twin-msg.twin-q { align-self: flex-end; background: var(--cc, #2a3fb0); color: #fff; border-bottom-right-radius: 5px; }
.twin-msg.twin-a { align-self: flex-start; background: #eef1f7; color: var(--sheet-text); border-bottom-left-radius: 5px; }
.twin-msg.typing { display: flex; gap: 4px; padding: 13px 14px; }
.twin-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b8; animation: twin-dot 1.2s infinite ease-in-out; }
.twin-msg.typing span:nth-child(2) { animation-delay: 0.15s; } .twin-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes twin-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.twin-ways { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.twin-way { display: flex; align-items: center; gap: 7px; color: #2a3fb0; font-weight: 600; text-decoration: none; font-size: 14px; }
.twin-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 4px 10px; }
.twin-chip { border: 1px solid var(--sheet-line); background: #fff; color: #2a3fb0; border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.twin-bar { display: flex; gap: 8px; align-items: center; padding: 8px 4px 0; border-top: 1px solid var(--sheet-line); }
.twin-bar .twin-input { flex: 1; margin: 0; }
.twin-send { flex: none; }

.sig-box { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--sheet-line); overflow-x: auto; }
.sig { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sig-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--cc, #0f1d4a); border-radius: 12px; padding: 12px; }
.sig-card .card-face-sm { flex: none; }
.sig-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sig-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.sig-who { color: #c9d3ea; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.sig-ask { flex: none; background: #1a9be0; color: #fff; font-weight: 700; font-size: 12px; border-radius: 8px; padding: 7px 10px; white-space: nowrap; }
@media (max-width: 420px) { .sig-card .card-face-sm { display: none; } .sig-qr { width: 54px; height: 54px; } .sig { gap: 8px; } }
.sig-qr { flex: none; width: 64px; height: 64px; image-rendering: pixelated; }
.sheet-pad { margin: 0 4px 10px; }
.signin-done { margin: 6px 0 18px; text-align: left; }
/* The Twin Business Card at the top of the account menu. */
.menu-card { padding: 14px 20px 10px; border-bottom: 1px solid var(--line); }
.menu-card .card-flip { margin: 0; }
.menu-card .card-cc { padding: 14px 16px; gap: 6px; }
.menu-card .card-cc-name { font-size: 17px; }
.menu-card .card-cc-who, .menu-card .card-cc-bio { font-size: 12px; }
.menu-card .card-cc-bio { -webkit-line-clamp: 1; }
.menu-card .card-cc-line { font-size: 12px; }
.menu-card .card-qr { padding: 10px; }
.menu-card-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.menu-card-open { display: block; margin: 4px auto 0; font-size: 14px; }
.menu-card-make { margin: 0 -20px; width: calc(100% + 40px); }
/* The menu card turns over like a real card: a little lift as it turns. */
.menu-card-flip > .card-cc, .menu-card-flip > .card-qr { transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.8s ease; will-change: transform; }
.menu-card-flip:active > .card-cc, .menu-card-flip:active > .card-qr { box-shadow: 0 16px 34px rgba(15, 25, 60, 0.2); }
/* Card backgrounds */
.card-cc.bg-wash { background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 24%, var(--surface)) 0%, var(--surface) 72%); }
.card-cc.bg-aurora { background: radial-gradient(110% 90% at 100% 0%, color-mix(in srgb, var(--cc) 48%, transparent) 0%, transparent 62%), radial-gradient(80% 80% at 0% 100%, color-mix(in srgb, var(--cc) 30%, transparent) 0%, transparent 60%), var(--surface); }
.card-cc.bg-lines { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--cc) 14%, transparent) 0 2px, transparent 2px 14px), var(--surface); }
.card-cc.bg-dots { background: radial-gradient(color-mix(in srgb, var(--cc) 34%, transparent) 1.3px, transparent 1.8px) 0 0 / 14px 14px, var(--surface); }
.card-cc.bg-solid { background: linear-gradient(135deg, var(--cc), color-mix(in srgb, var(--cc) 62%, #000)); border-color: transparent; border-top-color: rgba(255, 255, 255, 0.35); }
.card-cc.bg-image { background: linear-gradient(rgba(6, 10, 24, 0.58), rgba(6, 10, 24, 0.58)), var(--bgimg) center / cover; border-color: transparent; }
.card-cc.on-dark, .card-cc.on-dark .card-cc-name { color: #fff; }
.card-cc.on-dark .card-cc-who, .card-cc.on-dark .card-cc-line { color: rgba(255, 255, 255, 0.82); }
.card-cc.on-dark .card-cc-line .icon { color: #fff; }
.card-cc.on-dark .card-face-cc:not(.has-photo) { background: rgba(255, 255, 255, 0.22); }
.card-bgopts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; padding: 4px 0 8px; }
.card-bgopt { display: flex; flex-direction: column; gap: 6px; align-items: stretch; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); font: inherit; }
.card-bgopt .card-bgmini { width: 100%; max-width: none; flex: none; padding: 10px 12px; gap: 6px; border-top-width: 3px; box-shadow: none; }
.card-bgopt.on .card-bgmini { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.card-bgmini-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--cc); flex: none; }
.card-bgmini.on-dark .card-bgmini-dot { background: rgba(255, 255, 255, 0.5); }
.card-bgmini-l1, .card-bgmini-l2 { height: 6px; border-radius: 3px; background: currentColor; opacity: 0.35; width: 70%; }
.card-bgmini-l2 { width: 45%; }
.card-bgmini-add { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); border-style: dashed; border-top: 1px dashed var(--line); }
.card-bgopt-name { font-size: 13px; font-weight: 600; text-align: center; }
