/* ExAI home-screen app. One style everywhere, as ExAI on ExTV (docs/mockups, direction C). */

:root {
  --bg: #04060D;
  --blue: #2D6BFF;
  --blue-soft: #8FB4FF;
  --link: #9CC3FF;
  --amber: #FFB547;
  --green: #4ADE80;
  --white: #FFFFFF;
  --text-2: #E7ECF5;
  --text-3: #C9D2E3;
  --muted: #8E99AE;
  --muted-2: #6F7A8E;
  --ink: #0D0F12;
  --danger: #FF8A80;

  --card: rgba(13, 15, 18, 0.88);
  --card-strong: rgba(13, 15, 18, 0.92);
  --rim: rgba(255, 255, 255, 0.12);
  --hair: rgba(255, 255, 255, 0.07);
  --glass: rgba(120, 130, 150, 0.26);
  --glass-bubble: rgba(120, 130, 150, 0.30);
  --glass-btn: rgba(120, 130, 150, 0.22);
  --glass-rim: rgba(255, 255, 255, 0.16);
  --chip-bg: rgba(13, 15, 18, 0.7);
  --icon-bg: rgba(13, 15, 18, 0.6);
  --icon-rim: rgba(255, 255, 255, 0.14);
  --disc-bg: rgba(255, 255, 255, 0.18);
  --disc-rim: rgba(255, 255, 255, 0.22);
  --field-bg: rgba(255, 255, 255, 0.06);

  --r-card: 22px;
  --font: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --pad-bottom: max(22px, var(--safe-bottom));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
/* iOS 26 home-screen apps can leave a strip under the window (the window is shorter than the screen). The root
   background paints that strip, so it carries the colours of the stage's bottom edge instead of plain black. */
html { background: linear-gradient(90deg, #0A1531 0%, #11275D 25%, #163276 50%, #11275D 75%, #0A1531 100%) var(--bg); }
body {
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.blue { color: var(--blue-soft); }
.amber { color: var(--amber); }
.green { color: var(--green); }

/* ---- the stage: near-black with blue light rising from the bottom and a faint glow at the top ---- */

/* Pinned to all four edges: in an iPhone home-screen app 100vh/100dvh stop above the home-indicator strip, which
   then showed as a black band; a fixed box with top/bottom 0 covers the whole screen, safe areas included. */
.stage {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(130% 70% at 50% 108%, rgba(45, 107, 255, 0.55), rgba(45, 107, 255, 0.10) 45%, rgba(4, 6, 13, 0) 70%),
    var(--bg);
}
.stage-right {
  background:
    radial-gradient(130% 70% at 50% 108%, rgba(45, 107, 255, 0.45), rgba(45, 107, 255, 0.08) 45%, rgba(4, 6, 13, 0) 70%),
    var(--bg);
}

/* On an inline span the gradient runs along the text itself (lines laid end to end), so the last word ends blue
   even when the title wraps; on a block it would stretch to the box width and the text would stay white. */
.grad {
  display: inline;
  -webkit-box-decoration-break: slice;
  box-decoration-break: slice;
  background: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF 55%, #8FB4FF 85%, #6E8BFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- the orb: the ExTV orb video, round-masked (no square, no halo) ---- */

.orb {
  position: relative;
  flex: none;
  border-radius: 50%;
  background: url(exai-orb.webp) center / cover no-repeat;
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 70%);
  mask-image: radial-gradient(circle, #000 58%, transparent 70%);
  transform-origin: 50% 50%;
}
.orb-video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.orb-big { width: 210px; height: 210px; }
.orb-small { width: 56px; height: 56px; }
/* small sizes get a tighter edge, the wide soft fade read as blur at 56 px */
.orb-small { -webkit-mask-image: radial-gradient(circle, #000 63%, transparent 68%); mask-image: radial-gradient(circle, #000 63%, transparent 68%); }
.orb-login { width: 190px; height: 190px; }
.is-busy .orb { animation: orb-pulse 1.25s ease-in-out infinite; }
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .orb-video { visibility: hidden; }
  .is-busy .orb { animation: none; }
}

/* ---- headers ---- */

.home-head, .chat-head, .page-head { flex: none; }
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(22px, calc(var(--safe-top) + 8px)) 22px 0;
}
.logo { display: block; color: var(--white); }
.logo-home { height: 26px; width: auto; }
.logo-chat { align-self: flex-start; height: 19px; width: auto; margin-bottom: 5px; }
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--icon-rim);
  background: var(--icon-bg);
  color: var(--white);
  text-decoration: none;
}
.icon-btn { position: relative; flex: none; }
.head-btns { display: flex; align-items: center; gap: 8px; flex: none; }
/* a reminder is due: a small amber dot on the bell */
.badge-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--bg); }
.icon-btn:active, .round-btn:active, .voice:active { transform: scale(0.96); }

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(20px, calc(var(--safe-top) + 6px)) 18px 10px;
}
.orb-slot-small { width: 56px; height: 56px; flex: none; }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-title .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: max(26px, calc(var(--safe-top) + 10px)) 22px 12px;
}
.page-head .page-title { flex: 1; min-width: 0; }
/* the back chevron above the date (Reminders, Settings): small to the eye, a 44 px target */
.back-btn { position: relative; display: flex; align-items: center; width: 32px; height: 28px; margin: -4px 0 6px -8px; color: var(--text-3); }
.back-btn::after { content: ""; position: absolute; inset: -8px -6px; }
.back-btn:active { color: var(--white); }
.page-head .date { font-size: 14px; color: var(--muted); }
.page-head h1 { margin: 4px 0 0; font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.round-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 23px;
  border: 1px solid var(--disc-rim);
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

/* ---- start screen vs. conversation (one page) ---- */

.is-home .chat-head, .is-home .thread { display: none; }
.is-chat .home-head, .is-chat .hero, .is-chat .chips { display: none; }

.hero { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.orb-slot-big { display: flex; justify-content: center; padding-top: 18px; min-height: 228px; }
.greet { display: flex; flex-direction: column; gap: 6px; padding: 8px 26px 0; }
.greet .hello { font-size: 18px; color: var(--text-3); }
.greet .title { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.6px; }
.greet .line { margin-top: 4px; font-size: 14px; color: var(--muted); }
.now-card { margin: 18px 16px 0; flex: none; }
.now-card .row { min-height: 0; padding: 13px 16px; }
.now-card .row-end { max-width: 62%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- cards and rows ---- */

.card {
  border-radius: var(--r-card);
  background: var(--card);
  border: 1px solid var(--rim);
}
.list { overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: none;
  color: var(--white);
  text-decoration: none;
  font-size: 15px;
  text-align: left;
  width: 100%;
}
.row:last-child { border-bottom: 0; }
.row.empty { color: var(--muted); }
.row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-main small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.row-end { font-size: 15px; font-weight: 500; text-align: right; }
.row-end.muted { font-weight: 400; }
.row-wrap { align-items: flex-start; }
.row-wrap .dot { margin-top: 6px; }
.row-x {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -12px -12px -12px -4px;
  border: 0;
  border-radius: 22px;
  background: none;
  color: var(--muted-2);
}
.row-x:active { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.row-wrap .row-x { margin-top: -10px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.dot-amber { background: var(--amber); }
.dot-green { background: var(--green); }
.dot-blue { background: var(--blue); }

/* ---- chips, ask bar, voice disc ---- */

.chips { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.chip {
  position: relative;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-rim);
  background: var(--chip-bg);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
}
.chip::after { content: ""; position: absolute; inset: -3px 0; }   /* 46 px touch target, 40 px pill */
.chip:active { background: rgba(120, 130, 150, 0.3); }

.askbar { flex: none; padding: 0 16px 14px; }
.ask {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 7px 0 18px;
  border-radius: 30px;
  background: var(--glass);
  border: 1px solid var(--glass-rim);
  color: var(--text-2);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.ask > svg { flex: none; }
.cam { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 44px; margin-left: -10px;
  border: 0; background: transparent; color: var(--white); }
.attach { position: relative; align-self: flex-start; margin: 0 0 8px 6px; width: 64px; height: 64px; }
.attach[hidden] { display: none; }
.attach img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 1px solid var(--rim); display: block; }
.attach-x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 14px; border: 1px solid var(--rim);
  background: rgba(13, 15, 18, 0.96); color: var(--white); display: flex; align-items: center; justify-content: center; }
.attach-x::after { content: ""; position: absolute; inset: -8px; }
.msg-photo { display: block; max-width: 180px; max-height: 180px; border-radius: 16px; margin: 0 0 6px auto; object-fit: cover; }
.ask-div { flex: none; width: 1px; height: 26px; background: rgba(255, 255, 255, 0.28); }
.ask input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--white);
  font-size: 16px;
}
.ask input::placeholder { color: var(--muted); opacity: 1; }
.voice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 23px;
  border: 1px solid var(--disc-rim);
  background: var(--disc-bg);
  color: var(--white);
  touch-action: none;
  -webkit-touch-callout: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.voice::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.voice .i-send { display: none; }
.has-text .voice { background: var(--blue); border-color: transparent; }
.has-text .voice .i-wave { display: none; }
.has-text .voice .i-send { display: block; }
.voice.is-rec {
  background: var(--blue);
  border-color: rgba(143, 180, 255, 0.8);
  box-shadow: 0 0 0 6px rgba(45, 107, 255, 0.25), 0 0 28px rgba(45, 107, 255, 0.7);
  animation: rec-glow 1.2s ease-in-out infinite;
}
@keyframes rec-glow { 50% { box-shadow: 0 0 0 10px rgba(45, 107, 255, 0.15), 0 0 36px rgba(45, 107, 255, 0.9); } }
/* listening: a ring that follows the voice level (--lvl 0..1, set by app.js from the recorder) */
.voice.is-rec::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(143, 180, 255, 0.85);
  opacity: calc(0.3 + var(--lvl, 0) * 0.7);
  transform: scale(calc(1 + var(--lvl, 0) * 0.4));
  transition: transform 0.08s linear, opacity 0.08s linear;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .voice.is-rec { animation: none; } .voice.is-rec::before { transition: none; } }
/* ExAI speaking: the mic button is a stop button (a tap interrupts and listens), the orb can be tapped too */
.voice.is-stop .i-wave { display: none; }
.voice.is-stop::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: currentColor; }
.has-text .voice.is-stop::before { display: none; }
.is-speaking .orb { cursor: pointer; }

/* ---- bottom menu with the short coloured bar ---- */

.tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px 8px var(--pad-bottom);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tab.is-active { color: var(--white); font-weight: 700; }
.tab-bar { display: block; width: 22px; height: 3px; border-radius: 2px; background: var(--blue); visibility: hidden; }
.tab.is-active .tab-bar { visibility: visible; }
.tab-conversations .tab-bar { background: var(--blue-soft); }
.tab-reminders .tab-bar { background: var(--amber); }
.tab-memory .tab-bar { background: var(--green); }
.tab-settings .tab-bar { background: var(--blue-soft); }

/* ---- the conversation ---- */

.thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 16px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.thread > :first-child { margin-top: auto; }
.thread { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px); mask-image: linear-gradient(to bottom, transparent 0, #000 18px); }
.msg-user { align-self: flex-end; max-width: 80%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg-dev { margin-right: 8px; font-size: 11px; color: var(--muted); letter-spacing: 0.2px; }
.bubble {
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--glass-bubble);
  border: 1px solid var(--icon-rim);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.answer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.answer.md { white-space: normal; }
.answer p { margin: 0; }
.answer strong { color: var(--white); font-weight: 700; }
.answer .md-list { display: flex; flex-direction: column; }
.answer .md-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hair); color: var(--white); line-height: 1.2; }
.answer .md-item .dot { align-self: flex-start; margin-top: 4px; }
.answer .md-time { flex: none; width: 46px; font-weight: 700; }
.answer .md-text { flex: 1; min-width: 0; }
.answer.note { color: var(--muted); }
.answer .answer-by { margin: -4px 0 0; font-size: 12px; line-height: 1.3; color: var(--muted); white-space: normal; }   /* „отговори Gemini“, the voice fallback note */
.listen {
  align-self: flex-start;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1px solid rgba(143, 180, 255, 0.45);
  background: rgba(45, 107, 255, 0.16);
  color: var(--blue-soft);
  font-size: 14px;
  font-weight: 500;
}
.thinking { flex-direction: row; gap: 6px; padding: 18px 16px; align-self: flex-start; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-soft); opacity: 0.35; animation: think 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes think { 30% { opacity: 1; transform: translateY(-2px); } }

/* the action that waits for a yes */
.pending {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--card-strong);
  border-color: rgba(143, 180, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(45, 107, 255, 0.10), 0 -20px 40px -20px rgba(45, 107, 255, 0.45) inset;
}
.pending-kind { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--blue-soft); }
.pending-grid { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; font-size: 14px; line-height: 1.45; }
.pending-grid > span { overflow-wrap: anywhere; }
.pending-grid .k { color: var(--muted); }
.pending-text { font-size: 14px; line-height: 1.5; color: var(--text-3); overflow-wrap: anywhere; }
.pending-body { white-space: pre-wrap; }
.pending-body.is-collapsed { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.pending-more { align-self: flex-start; margin-top: -6px; padding: 6px 0; border: 0; background: none; color: var(--blue-soft); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pending-note { margin: 0; font-size: 13px; color: var(--amber); }
.pending.is-done { border-color: var(--rim); box-shadow: none; }

/* ---- buttons ---- */

.btn-row { display: flex; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 46px;
  padding: 0 18px;
  border-radius: 23px;
  border: 0;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.18); background: var(--glass-btn); color: var(--white); font-weight: 500; }
.btn-primary { background: var(--blue); color: var(--white); font-weight: 700; }
.btn-danger { background: var(--danger); color: var(--ink); font-weight: 700; }
.btn-white { background: var(--white); color: var(--ink); font-weight: 700; }
.btn-block { width: 100%; flex: none; }
.btn-sm { flex: none; height: 44px; padding: 0 16px; font-size: 14px; }
.link-btn { position: relative; margin-left: auto; padding: 0 4px; border: 0; background: none; color: var(--link); font-size: 14px; font-weight: 500; }
.link-btn::after { content: ""; position: absolute; inset: -13px -8px; }

/* ---- reminders, shopping ---- */

.scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll > * { flex: none; }
.scroll {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
}
.group { display: flex; flex-direction: column; gap: 8px; }
.group h2 { display: flex; align-items: center; margin: 0 6px; font-size: 15px; font-weight: 500; color: var(--text-3); }

.due {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--card-strong);
  border-color: rgba(255, 181, 71, 0.55);
  box-shadow: 0 -24px 44px -24px rgba(255, 181, 71, 0.45) inset;
  transition: opacity 0.25s, transform 0.25s;
}
.due.is-gone { opacity: 0; transform: scale(0.98); }
.due-top { display: flex; align-items: center; gap: 10px; }
.due-when { flex: 1; font-size: 14px; font-weight: 500; color: var(--amber); }
.due-repeat { font-size: 13px; color: var(--muted); }
.due-text { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }

.checklist { display: flex; flex-direction: column; padding: 4px 16px; }
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-size: 15px;
  border-top: 1px solid var(--hair);
}
.check:first-child { border-top: 0; }
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0 4px;
  border-radius: 4px;
  background: #FFFFFF;
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.check input:checked {
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%230D0F12' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check { position: relative; }
.check span { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 12px 0; }
.check.is-done { color: var(--muted-2); text-decoration: line-through; }
.check-add { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--hair); }
.check-add:first-child { border-top: 0; }
.check-plus { display: flex; width: 20px; justify-content: center; color: var(--green); }
.check-add input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; color: var(--white); font-size: 16px; }
.check-add input::placeholder { color: var(--muted); }

/* ---- conversations ---- */

.conv-row { min-height: 64px; padding: 12px 16px; }
.conv-row:active { background: rgba(255, 255, 255, 0.05); }
.dot-none { background: transparent; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 500; }
.conv-devices { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.conv-when { flex: none; align-self: flex-start; padding-top: 1px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.is-current .conv-when { color: var(--blue-soft); font-weight: 500; }

/* above the ask bar in a conversation that is not the current one */
.old-line { flex: none; margin: 0 16px 8px; text-align: center; font-size: 13px; color: var(--muted); }
.is-home .old-line { display: none; }

/* ---- forms ---- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.pad { padding: 16px; }
.pad-x { padding: 0 16px; }
.row-details > .stack { padding: 4px 16px 16px; }
.row-details { border-bottom: 1px solid var(--hair); }
.row-details:last-child { border-bottom: 0; }
.row-details > summary { list-style: none; cursor: pointer; border-bottom: 0; }
.row-details > summary::-webkit-details-marker { display: none; }
.row-details[open] > summary .row-end { transform: rotate(45deg); }
.row-end svg { display: block; transition: transform 0.2s; }
.row-form { flex-direction: column; align-items: stretch; gap: 10px; }
.row-line { display: flex; align-items: center; gap: 10px; }
.row-sub { padding-left: 38px; min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
.row-btn { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field-pair { display: flex; gap: 10px; }
.field-port { flex: 0 0 34%; }
.input, .field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--icon-rim);
  background: var(--field-bg);
  color: var(--white);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input { flex: 1; min-width: 0; }
.field textarea { resize: vertical; line-height: 1.45; }
.field select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238E99AE' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field select option { background: #12151B; color: var(--white); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-soft); box-shadow: 0 0 0 3px rgba(45, 107, 255, 0.25); }
.field input::placeholder, .input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.form-msg { margin: 0; font-size: 14px; color: var(--muted); }
.form-msg:empty { display: none; }
.form-msg.pad-x { padding: 0 16px 14px; }
.form-msg.is-err, .form-error { color: var(--danger); }
.form-msg.is-ok { color: var(--green); }
.form-error { margin: 0; font-size: 14px; }
.hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.row-form .hint { margin: -2px 0 0; }
.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; font-size: 15px; line-height: 1.35; color: var(--text-2); }
.key-banner { flex: none; display: block; margin: 10px 18px 0; text-decoration: none; }
.flash { margin: 0; padding: 12px 16px; border-radius: 16px; background: rgba(255, 181, 71, 0.12); border: 1px solid rgba(255, 181, 71, 0.4); color: var(--amber); font-size: 14px; }

.switch { position: relative; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; inset: -7px -4px; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }   /* 45 px tall touch target */
.switch span { position: absolute; inset: 0; border-radius: 16px; background: rgba(120, 130, 150, 0.35); transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--white); transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue-soft); outline-offset: 2px; }
.radio { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; color: var(--muted); }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }

.pair { padding: 18px 16px 14px; border-bottom: 1px solid var(--hair); text-align: center; }
.pair-code {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 8px;
  padding-left: 8px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF 55%, #8FB4FF 85%, #6E8BFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pair-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.pair-note [data-countdown] { color: var(--amber); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- sheet (new reminder) ---- */

.sheet {
  width: calc(100% - 24px);
  max-width: 496px;
  margin: auto auto max(12px, var(--safe-bottom));
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
}
.sheet::backdrop { background: rgba(4, 6, 13, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 16px; background: rgba(13, 15, 18, 0.97); }
.sheet-card h2 { margin: 0 0 2px; font-size: 20px; font-weight: 700; }
.sheet-note { margin: -6px 0 2px; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ---- sign-in and offline ---- */

.login {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: max(24px, var(--safe-top)) 16px var(--pad-bottom);
}
.login-title { text-align: center; margin-bottom: 14px; }
.login-title h1 { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.6px; }
.login-title p { margin: 8px 0 0; font-size: 15px; }
.login-card { width: 100%; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 16px; }

/* ---- toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--pad-bottom) + 76px);
  z-index: 10;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(13, 15, 18, 0.96);
  border: 1px solid var(--rim);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* short phones: a smaller orb so the start screen still fits */
@media (max-height: 700px) {
  .orb-big { width: 150px; height: 150px; }
  .orb-slot-big { min-height: 160px; padding-top: 6px; }
  .greet .title { font-size: 30px; }
}
.voice-pick { display: flex; gap: 8px; align-items: center; }
.voice-pick select { flex: 1; min-width: 0; }
.hear { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; height: 44px; padding: 0 18px; border-radius: 22px;
  border: 1px solid var(--rim); background: rgba(255, 255, 255, 0.08); color: var(--white); font-size: 15px; font-weight: 500; }
.hear.is-on { background: var(--blue); border-color: var(--blue); }
