/* The customer page. It shares nothing with Tether the service but the look, exactly: this page's
 * tokens are Tether's own (DESIGN.md names what each is for), and the values live only here, dark
 * first as Tether is. The layout and behaviour follow the product the slice is built from: an ask
 * box at the center, sources above a streamed answer, a thread rail and an account menu. */
:root {
  color-scheme: dark;
  --bg: #151515;
  --side: #111111;
  --divider: #292929;
  --raised: #1f1f1f;
  --raised-2: #262626;
  --hover: #1c1c1c;
  --hover-2: #2a2a2a;
  --selected: #343434;
  --line: #2f2f2f;
  --line-2: #363636;
  --text: #f5f5f5;
  --text-2: #c1c2bf;
  --muted: #9c9c9a; /* 4.53:1 on the lightest surface under it, and more on the rest: its 12px hints need 4.5 */
  --faint: #5f5f5d;
  --shine: var(--text-2);
  --shine-peak: var(--text);
  --icon: #bebebc;
  --link: #81a6d7;
  --add: #53ca64;
  --accent: #e07d5a;
  --on-accent: #151515;
  --blue: #2c7cda;
  --ring: #3f77c1;
  --track: #333333;
  --pro: #a096eb; /* the one violet: what a paid plan opens. Used for the picker's plan badges. */
  --pro-tint: rgba(160, 150, 235, 0.16);
  --warn: #d6a03d;
  --err: #e5534b;
  --danger: #c04742;
  --on-danger: #ffffff;
  --chip: #2d2d2d;
  --hollow: #4f4f4f;
  --shadow: 0 14px 44px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --col: 760px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --side: #f7f7f6;
    --divider: #e6e6e4;
    --raised: #ffffff;
    --raised-2: #f1f1f0;
    --hover: #efefee;
    --hover-2: #ebebea;
    --selected: #e6e6e4;
    --line: #e3e3e1;
    --line-2: #d6d6d3;
    --text: #1a1a1a;
    --text-2: #3b3b39;
    --muted: #676764; /* 4.54:1 on the darkest surface under it, and more on the rest */
    --faint: #a8a8a5;
    --shine: var(--text);
    --shine-peak: color-mix(in srgb, var(--text) 30%, white);
    --icon: #5e5e5c;
    --link: #2d6cc0;
    --add: #1e9a44;
    --accent: #d97757;
    --on-accent: #241914;
    --ring: #3f77c1;
    --track: #e4e4e2;
    --pro: #4a3aa7;
    --pro-tint: rgba(74, 58, 167, 0.1);
    --warn: #9a6b14;
    --err: #c92a2a;
    --danger: #c04742;
    --on-danger: #ffffff;
    --chip: #f0f0ef;
    --hollow: #b8b8b5;
    --shadow: 0 14px 44px rgba(20, 20, 20, 0.14), 0 2px 6px rgba(20, 20, 20, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(63, 119, 193, 0.45); }

/* Icons are the inline SVG set in app.js (ICON), one stroke weight, sized to the text they sit with. */
svg.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic { display: inline-flex; }
.ic svg.i { display: block; }

/* ---------- shell and rail ---------- */
.app { position: relative; height: 100dvh; }
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100dvh; }
.rail {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--side); border-right: 1px solid var(--divider);
}
.rail-head { padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 14px; }
.rail-head .wordmark { padding: 0 6px; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.topbar { display: none; }

.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 650; letter-spacing: -0.01em;
  color: var(--text);
}
.wm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.wm-name { white-space: nowrap; }

/* the thread rail */
.new-thread {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 44px; padding: 0 12px;
  border: 0; border-radius: 9px;
  background: var(--raised); color: var(--text);
  font-size: 15px; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 140ms ease-out, background 140ms ease-out;
}
.new-thread svg.i { width: 15px; height: 15px; stroke-width: 2; color: var(--text-2); }
@media (hover: hover) { .new-thread:hover { background: var(--raised-2); } }
.new-thread:active { transform: scale(0.98); }

.threads { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.threads .th {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 8px 10px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2);
  font-size: 14.5px; text-align: left;
}
.threads .th svg.i { width: 14px; height: 14px; color: var(--muted); flex: none; }
.threads .th .th-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads .th.active { background: var(--selected); color: var(--text); }
.threads .th.active svg.i { color: var(--text-2); }
@media (hover: hover) { .threads .th:not(.active):hover { background: var(--hover); color: var(--text); } }
.threads .th:active { transform: scale(0.985); }

.threads .empty { padding: 22px 14px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.threads .empty .e-t { font-weight: 600; color: var(--text-2); }

.threads .sk { height: 44px; margin: 4px 0; border-radius: 9px; background: var(--hover); animation: skpulse 1.6s ease-in-out infinite; }
@keyframes skpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.rail-foot { padding: 10px 8px 12px; border-top: 1px solid var(--divider); }
.account {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 46px; padding: 0 10px;
  border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); font-size: 14px; text-align: left;
}
@media (hover: hover) { .account:hover { background: var(--hover); color: var(--text); } }
.account:active { transform: scale(0.98); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--chip); color: var(--text-2);
  font-size: 13px; font-weight: 650;
}
.acct-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chev { color: var(--muted); }
.acct-chev svg.i { width: 13px; height: 13px; }

/* the phone drawer: the rail is fixed and slides in (see the phone block at the end) */
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, 0.45); }

/* ---------- boot and welcome ---------- */
.boot {
  height: 100dvh; display: flex; align-items: center; justify-content: center;
  gap: 12px;
}
.boot .wordmark { font-size: 18px; }

.welcome {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  gap: 20px; max-width: 460px; margin: 0 auto; padding: 32px 20px;
}
.welcome .wordmark { font-size: 17px; }
.w-h1 {
  margin: 0; font-size: 32px; line-height: 1.2; font-weight: 700;
  letter-spacing: -0.02em; max-width: 14ch; text-wrap: balance;
}
.w-h2 {
  margin: 0; font-size: 24px; line-height: 1.25; font-weight: 650;
  letter-spacing: -0.015em; text-wrap: balance;
}
.lead { margin: 0; color: var(--text-2); font-size: 16px; max-width: 38ch; }

.signin { display: flex; flex-direction: column; gap: 8px; }
.signin label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.signin-row { display: flex; gap: 10px; }
.signin-row input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--raised); color: var(--text);
  font-size: 16px; /* 16px on a phone so it doesn't zoom into the field */
}
.signin-row input::placeholder { color: var(--faint); }
.signin-row input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(63, 119, 193, 0.25); }
.signin-row .btn { white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 0; border-radius: 9px;
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  transition: transform 140ms ease-out, background 140ms ease-out, color 140ms ease-out;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); } }
.btn:active { transform: scale(0.97); }

.notice { margin: 0; font-size: 14px; color: var(--text-2); }
.notice.err { color: var(--err); }
.linklike { border: 0; background: none; padding: 0; color: var(--link); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .linklike:hover { color: var(--ring); } }

/* ---------- home: the ask box ---------- */
.home { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.home-inner { width: 100%; max-width: min(var(--col), 92vw); }
.askcard-wrap { margin: 0; }
.askcard {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--raised);
  border: 1px solid var(--line-2); border-radius: 16px;
  padding: 6px 6px 6px 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.askcard:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(63, 119, 193, 0.22); }
.ask {
  flex: 1; min-width: 0; min-height: 40px; max-height: 180px;
  border: 0; outline: none; background: transparent; resize: none;
  color: var(--text); font-size: 16px; line-height: 1.5;
  padding: 10px 0;
}
.ask::placeholder { color: var(--faint); }
.ask.follow { font-size: 15px; }

.send {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  transition: transform 140ms ease-out, background 140ms ease-out, opacity 140ms ease-out;
}
.send svg.i { width: 17px; height: 17px; stroke-width: 2.1; }
@media (hover: hover) { .send:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); } }
.send:active:not(:disabled) { transform: scale(0.94); }
.send:disabled { background: var(--selected); color: var(--faint); cursor: default; }

.ask-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 0 4px; }
.search-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600;
  transition: transform 140ms ease-out, color 140ms ease-out, background 140ms ease-out, border-color 140ms ease-out;
}
.search-toggle .st-label { white-space: nowrap; }
.search-toggle.on { color: var(--ring); border-color: var(--ring); background: rgba(63, 119, 193, 0.12); }
.search-toggle:disabled { opacity: 0.5; cursor: default; }
.search-toggle:not(:disabled):active { transform: scale(0.97); }
@media (hover: hover) { .search-toggle:not(:disabled):hover { background: var(--hover); } .search-toggle.on:hover { background: rgba(63, 119, 193, 0.16); } }

.model-wrap { display: inline-flex; }
.model-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; max-width: 260px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-2);
  font-size: 14px;
  transition: transform 140ms ease-out, background 140ms ease-out;
}
.m-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.m-chev { color: var(--muted); display: inline-flex; }
.m-chev svg.i { width: 13px; height: 13px; }
.model-btn[aria-expanded="true"] { border-color: var(--line-2); background: var(--hover); }
@media (hover: hover) { .model-btn:hover { background: var(--hover); } }
.model-btn:active:not(:disabled) { transform: scale(0.97); }

/* ---------- menus (model picker, account) ---------- */
.menu-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.menu {
  position: fixed; min-width: 248px; max-width: min(320px, calc(100vw - 32px));
  max-height: calc(100dvh - 20px); overflow-y: auto;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px;
  pointer-events: auto; /* the layer behind is click-through; the menu itself must take real pointers */
  animation: menu-in 150ms cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 7px 10px;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 14px; text-align: left; color: var(--text-2);
}
.menu-item .mi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mi-name { font-weight: 600; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-prov { font-size: 12px; color: var(--muted); }
.mi-check { color: var(--ring); }
.mi-check svg.i { width: 14px; height: 14px; }
.menu-item .badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--pro-tint); color: var(--pro);
  text-transform: uppercase; flex: none;
}
.menu-item.locked { color: var(--muted); }
.menu-item.locked .mi-name { color: var(--muted); font-weight: 550; }
@media (hover: hover) { .menu-item:hover { background: var(--hover-2); } }
.menu-item:active { transform: scale(0.98); }
.menu-item.locked { cursor: pointer; }
.menu-cap { display: block; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: 0.02em; }
.acct-email-line { display: block; padding: 10px 12px 6px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the answer (thread) view ---------- */
.thread { min-height: 100%; }
.t-inner {
  max-width: var(--col); margin: 0 auto;
  padding: 34px 20px 60px;
  display: flex; flex-direction: column; gap: 26px;
}
.q-head {
  margin: 0; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.28;
  font-weight: 700; letter-spacing: -0.02em; text-wrap: balance;
}
.q-sub {
  margin: 0; font-size: 19px; line-height: 1.3;
  font-weight: 650; letter-spacing: -0.015em; text-wrap: balance;
}
.src-section { display: flex; flex-direction: column; gap: 10px; }
.src-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.src-label .src-count { color: var(--muted); font-weight: 500; }
.src-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.src-card {
  flex: 0 0 218px; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: 12px;
  background: var(--raised); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: transform 140ms ease-out, background 140ms ease-out, border-color 140ms ease-out;
}
.src-ic {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--pro-tint); color: var(--pro);
  font-size: 14px; font-weight: 700;
}
.src-t { font-size: 13.5px; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.src-d { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .src-card:hover { border-color: var(--line-2); background: var(--raised-2); } }
.src-card:active { transform: scale(0.97); }

.a-body { display: flex; flex-direction: column; gap: 14px; }
.a-body p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--text-2); }
.cite {
  display: inline-block; margin: 0 1px;
  color: var(--link); font-size: 13px; font-weight: 600;
  text-decoration: none; vertical-align: 1px;
  padding: 0 1px;
}
@media (hover: hover) { .cite:hover { text-decoration: underline; text-underline-offset: 3px; } }
.a-meta { font-size: 13px; color: var(--muted); }
.a-meta .by { color: var(--text-2); }

.a-note {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--raised); border: 1px solid var(--line);
}
.note-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.warn { background: var(--warn); }
.a-note .note-msg { margin: 0; color: var(--text); font-size: 15px; }
.a-note .note-msg small { color: var(--text-2); }
.a-note .note-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.a-note .note-reset { margin: 0; font-size: 13.5px; color: var(--text-2); flex: 1; min-width: 0; }
.a-note .up { color: var(--link); font-size: 14px; font-weight: 600; text-decoration: none; }
@media (hover: hover) { .a-note .up:hover { text-decoration: underline; text-underline-offset: 3px; } }

.followup { display: flex; flex-direction: column; gap: 8px; }
.followup .fl-label { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- plans ---------- */
.plans {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  gap: 14px; max-width: 880px; margin: 0 auto; padding: 40px 20px 48px;
}
.plans .wordmark { margin-bottom: 6px; }
.p-h1 { margin: 0; font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.p-lead { margin: 0; color: var(--text-2); max-width: 52ch; }
.plan-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
  gap: 12px; margin-top: 10px;
}
.pl-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: 12px;
  background: var(--raised); border: 1px solid var(--line);
}
.pl-card.current { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring) inset; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-name { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.current-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--selected); color: var(--text-2);
  text-transform: uppercase; flex: none;
}
.pl-price { display: flex; flex-direction: column; gap: 2px; }
.pl-price .pl-m { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.pl-price .pl-m:not(:first-child) { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.pl-inc { display: flex; flex-direction: column; gap: 2px; }
.pl-inc-label {
  margin: 0; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.pl-fam { margin: 0; font-size: 13.5px; color: var(--text-2); }
.pl-pri { margin: 0; font-size: 12.5px; color: var(--muted); }
.pl-cta { margin-top: auto; width: 100%; }
.plans-acts { display: flex; gap: 10px; margin-top: 10px; }
.plans-acts .btn { align-self: flex-start; }
#plans-back { background: var(--selected); color: var(--text); }
@media (hover: hover) { #plans-back:hover { background: var(--selected); color: var(--text); } }
.u-empty { margin: 0; color: var(--muted); }
.up-note { margin: 0; font-size: 14px; color: var(--text-2); }

/* ---------- usage ---------- */
.usage { min-height: 100%; }
.u-inner {
  max-width: var(--col); margin: 0 auto;
  padding: 34px 20px 60px;
  display: flex; flex-direction: column; gap: 18px;
}
.u-h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.u-plan { margin: 0; color: var(--text-2); }
.usage-bars { display: flex; flex-direction: column; gap: 20px; }
.bar { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bar-label { font-size: 15px; font-weight: 600; color: var(--text); }
.bar-value { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--add); transition: width 200ms ease-out; }
.bar.reached .bar-fill { background: var(--warn); }
.bar-reset { margin: 0; font-size: 12.5px; color: var(--muted); }
.u-reached { margin: 0; font-size: 14px; color: var(--warn); font-weight: 600; }
.u-cta { align-self: flex-start; }

/* the rail's Usage entry: a quiet row under New thread */
.rail-nav {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2);
  font-size: 14.5px; text-align: left;
  margin-top: -8px;
  transition: transform 140ms ease-out, background 140ms ease-out, color 140ms ease-out;
}
.rail-nav svg.i { width: 15px; height: 15px; color: var(--muted); flex: none; }
@media (hover: hover) { .rail-nav:hover { background: var(--hover); color: var(--text); } .rail-nav:hover svg.i { color: var(--text-2); } }
.rail-nav:active { transform: scale(0.98); }

/* ---------- the invite's guest and the inviter's menu ---------- */
/* The thread's top row holds the guest note (read-only invites) on the left and the Invite
 * affordance (a signed-in thread's owner) on the right. Never both at once. */
.thread-top { display: flex; flex-direction: column; gap: 12px; }
.guest-note {
  margin: 0; align-self: stretch;
  font-size: 15px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 9px;
}
.guest-note::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.invite-btn {
  display: inline-flex; align-items: center; gap: 7px;
  align-self: flex-end;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 600;
  transition: transform 140ms ease-out, background 140ms ease-out, border-color 140ms ease-out;
}
.invite-btn svg.i { width: 15px; height: 15px; color: var(--muted); }
.invite-btn[aria-expanded="true"] { border-color: var(--line-2); background: var(--hover); }
@media (hover: hover) { .invite-btn:hover { background: var(--hover); border-color: var(--line-2); color: var(--text); } .invite-btn:hover svg.i { color: var(--text-2); } }
.invite-btn:active { transform: scale(0.97); }

#home-note { margin-top: 14px; text-align: center; }

#invite-menu { min-width: 304px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.invite-form { display: flex; gap: 8px; padding: 6px 6px 8px; }
.invite-field {
  flex: 1; min-width: 0; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--raised-2); color: var(--text);
  font-size: 14px;
}
.invite-field::placeholder { color: var(--faint); }
.invite-field:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(63, 119, 193, 0.25); }
.invite-form .btn.small { height: 38px; background: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .invite-form .btn.small:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); } }
.menu-note { display: block; margin: 0; padding: 6px 10px 8px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.invite-made { padding: 2px 6px 6px; display: flex; flex-direction: column; gap: 2px; }
.invite-made-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px; }
.invite-link {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 13px; color: var(--text-2);
  background: var(--raised-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; user-select: all;
}
.invite-made-row .btn.small { flex: none; background: var(--selected); color: var(--text); }
.invite-list { display: flex; flex-direction: column; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 44px; }
.invite-row + .invite-row { border-top: 1px solid var(--divider); }
.invite-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.invite-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-meta { font-size: 12px; color: var(--muted); }
.invite-status {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--hover); color: var(--muted);
  text-transform: uppercase; flex: none;
}
.btn.small.danger-link { background: var(--hover); color: var(--err); }
@media (hover: hover) { .btn.small.danger-link:hover { background: var(--hover-2); color: var(--err); } }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
    width: min(320px, 84vw);
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: none;
  }
  .app.drawer-open .rail { transform: translateX(0); box-shadow: var(--shadow); }
  .rail-head .wordmark { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 4px;
    height: 56px; padding: 8px 10px;
    border-bottom: 1px solid var(--divider);
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .icon-btn {
    width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px;
    background: transparent; color: var(--text-2);
    display: grid; place-items: center;
    transition: transform 140ms ease-out, background 140ms ease-out;
  }
  .icon-btn svg.i { width: 21px; height: 21px; stroke-width: 1.8; }
  @media (hover: hover) { .icon-btn:hover { background: var(--hover); color: var(--text); } }
  .icon-btn:active { transform: scale(0.94); }
  .top-wordmark { border: 0; background: none; padding: 8px 10px; }
  .home { align-items: center; padding-top: 18vh; }
  .t-inner { padding: 22px 16px 44px; gap: 22px; }
  .q-head { padding-right: 0; }
  .src-card { flex-basis: 196px; }
  /* the 44px touch floor on a phone-first page: controls grow, never shrink */
  .send, .search-toggle, .model-btn, .btn { height: 44px; }
  .send { width: 44px; }
  .menu-item { min-height: 44px; }
  .rail-nav { min-height: 44px; }
  .invite-btn { height: 44px; }
  .invite-field { height: 44px; }
  .invite-form .btn.small, .invite-made-row .btn.small, .invite-row .btn.small { height: 44px; }
  .plans { justify-content: flex-start; padding: 28px 16px 44px; }
  .plans-acts { flex-wrap: wrap; }
  .u-inner { padding: 22px 16px 44px; }
  .u-cta { width: 100%; }
  .p-h1 { font-size: 28px; }
  .u-h1 { font-size: 26px; }
}

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