* { box-sizing: border-box; }

/* the app's one motion curve: quick start, soft landing */
:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); color-scheme: dark; }
/* no grey tap flash (each control has its own pressed look), no font inflation in landscape */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* controls are pressed, not selected; content stays selectable */
button, [role="radio"] { -webkit-user-select: none; user-select: none; }

html, body {
  margin: 0;
  height: 100%;
  /* ink-navy gradient — the avatar renders over this, continuous with the stage */
  background: radial-gradient(ellipse 110% 100% at 42% 10%, #1b2937 0%, #101a25 52%, #0b121b 100%);
  color: #e8e8ec;
  font: 15px/1.4 system-ui, sans-serif;
  overflow: hidden;
  /* no pull-to-refresh or bounce reloading the app mid-call */
  overscroll-behavior: none;
}

#layout {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 33%);
}

#stage {
  position: relative;
  margin: 1.2rem 0.6rem 4.5rem max(1.2rem, env(safe-area-inset-left, 0px));
  border-radius: 0;
  background: transparent;
  border: 0;
  border-inline-end: 1px solid rgba(177, 192, 207, 0.09);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A quiet frame beside either the local avatar or live video. */
#stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: none;
}

#stage-hint {
  color: #a4acb9;
  font-size: 1rem;
  line-height: 1.8;
  padding: 2rem;
  text-align: center;
}
#stage.has-content #stage-hint { display: none; }
body:not([data-mode]):has(#login, #entry) #stage-hint { display: none; }
/* the what's-new note has done its job once a first question is answered */
#stage-hint.retired { opacity: 0 !important; transition: opacity 0.35s ease !important; }
#stage-content {
  position: absolute;
  inset: 0;
  display: flex;
  padding: clamp(16px, 3vw, 48px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #394453 transparent;
  container-type: inline-size;
}
#stage-content:focus-visible { outline: 1px solid #91abc3; outline-offset: -4px; }

#side {
  position: relative;
}

#avatar {
  position: absolute;
  inset: 0 0 3.6rem 0;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
  /* same ink-navy family as the in-app sky, so boot doesn't feel like a different app */
  background: radial-gradient(ellipse 120% 90% at 50% 30%, #26242f 0%, #17161e 52%, #0d0c11 100%);
  z-index: 10;
}

/* ---- entry: choose chat or voice ---- */
#entry { justify-content: flex-start; overflow-y: auto; }
#entry-inner {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: min(56rem, 100%);
  padding: 2rem 1.25rem;
}
#entry-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8f96c4;
}
#entry-role { color: #c9cdf0; }
#switch-account { padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: #a9aedb; background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(169, 174, 219, 0.35); text-underline-offset: 3px; }
#entry-title {
  margin: 0.3rem 0 1.8rem;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  color: #ecebf5;
}
#entry-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 12.5rem;
  padding: 1.6rem 1.5rem 1.4rem;
  font: inherit;
  text-align: start;
  color: #e8e4f4;
  background: #141220;
  border: 1px solid #2a2740;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 160ms var(--ease), background 0.2s ease, opacity 0.2s var(--ease);
}

.mode-card:focus-visible { outline: 2px solid #7c93e6; outline-offset: 3px; }

/* ---- a notice the caller asked for (registration has opened) ---- */
.app-notice { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.85rem 1.1rem; color: #e8e6f4; background: linear-gradient(135deg, rgba(95, 211, 95, 0.16), rgba(95, 211, 95, 0.05)); border: 1px solid rgba(95, 211, 95, 0.45); border-radius: 14px; animation: new-in 0.3s var(--ease) both; }
.app-notice b { font-size: 1rem; color: #f2f0fb; }
.app-notice span { font-size: 0.9rem; color: #c9cde0; line-height: 1.6; }
.app-notice.is-chat { margin: 0 auto 1rem; width: min(36rem, 100%); }
.app-notice.is-stage { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 30; width: min(30rem, calc(100% - 2rem)); padding-inline-end: 2.6rem; }
.app-notice.is-stage { animation-name: notice-in; }
@keyframes notice-in { from { opacity: 0; transform: translate(-50%, 6px); } to { transform: translate(-50%, 0); } }
.app-notice button { position: absolute; top: 0.45rem; inset-inline-end: 0.6rem; width: 1.8rem; height: 1.8rem; font-size: 1.2rem; color: #c9cde0; background: none; border: 0; border-radius: 50%; cursor: pointer; }

/* ---- what's new: noticed at once, never in the way ---- */
.new-note {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.8rem;
  text-align: start;
  padding: 0.95rem 1.1rem;
  color: #fff3e3;
  /* something new to try, never a warning: a glowing edge that slowly flows round the card.
     A new shade for each update so a returning user sees it changed — 2026-10-23: legendary
     (the game-loot orange and gold; warm tones only, never a rainbow). Was teal with gold */
  border: 1px solid transparent;
  border-radius: 14px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(255, 128, 0, 0.24), transparent 55%) padding-box,
    radial-gradient(120% 160% at 100% 100%, rgba(255, 196, 92, 0.16), transparent 55%) padding-box,
    linear-gradient(#24150a, #24150a) padding-box,
    linear-gradient(110deg, #ff8000, #ffcf6b, #ff9a1f, #ffe2a3, #ff8000) border-box;
  background-size: 100% 100%, 100% 100%, 100% 100%, 300% 100%;
  box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.12), 0 8px 32px -10px rgba(255, 128, 0, 0.6);
  animation: new-in 0.3s var(--ease) both, new-flow 9s linear infinite;
}
/* a soft sheen glides across now and then */
.new-note::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.09) 50%, transparent 62%);
  transform: translateX(-100%);
  animation: new-sheen 7s ease-in-out 0.9s infinite;
}
.new-badge {
  position: relative;
  overflow: hidden;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 1px rgba(70, 30, 0, 0.5);
  background: linear-gradient(120deg, #c85a00, #ff8000 45%, #ffc861);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 4px 16px -4px rgba(255, 128, 0, 0.85);
}
/* letter spacing pulls Arabic letters apart */
[dir="rtl"] .new-badge { letter-spacing: 0; }
.new-spark { width: 1em; height: 1em; fill: currentColor; filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9)); animation: new-twinkle 2.6s ease-in-out infinite; }
/* a glint across the badge every few seconds */
.new-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: new-sweep 5s ease 0.6s infinite;
}
.new-text { position: relative; flex: 1 1 14rem; min-width: 0; }
.new-title { margin: 0; font-size: 0.98rem; font-weight: 600; line-height: 1.5; color: #fff6ea; }
/* the word that matters, in legendary gold */
.new-hot { font-weight: 800; letter-spacing: 0.02em; color: #ffb547; text-shadow: 0 0 12px rgba(255, 128, 0, 0.55); }
[dir="rtl"] .new-hot { letter-spacing: 0; }
@keyframes new-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes new-flow { to { background-position: 0 0, 0 0, 0 0, 150% 0; } }
@keyframes new-sheen { 0% { transform: translateX(-100%); } 24%, 100% { transform: translateX(100%); } }
@keyframes new-sweep { 0% { transform: translateX(-120%); } 22%, 100% { transform: translateX(120%); } }
@keyframes new-twinkle { 0%, 100% { transform: scale(0.85) rotate(0deg); opacity: 0.85; } 50% { transform: scale(1.12) rotate(45deg); opacity: 1; } }
/* between the entry question and the mode cards */
.new-note.is-entry { width: 100%; margin: -0.6rem 0 1.4rem; }
/* chat welcome: above the usual suggestions */
.new-note.is-chat { max-width: 36rem; margin: 0 auto 1.5rem; }
/* the empty voice and avatar stage */
.new-note.is-stage { max-width: 34rem; margin: 0 auto; }
.mode-card:disabled { cursor: default; }
.mode-card:disabled:not(.is-loading) { opacity: 0.45; }
.mode-card svg {
  width: 1.9rem;
  height: 1.9rem;
  margin-bottom: 0.7rem;
  fill: none;
  stroke: #9aa6e0;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode-name { font-size: 1.12rem; font-weight: 600; color: #f0eefa; }
.mode-desc { font-size: 0.88rem; line-height: 1.5; color: #8d88a6; }
.mode-status { margin-top: auto; padding-top: 0.6rem; min-height: 1.2em; font-size: 0.82rem; color: #a49cc0; }
.mode-card.is-loading { border-color: #4b5795; }
.mode-card.is-loading .mode-status::before {
  content: '';
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-inline-end: 0.5rem;
  vertical-align: -0.08rem;
  border-radius: 50%;
  border: 2px solid rgba(124, 147, 230, 0.25);
  border-top-color: #7c93e6;
  animation: veil-rot 0.9s linear infinite;
}

#subtitles {
  position: fixed;
  right: 16.5%;
  bottom: 5.5rem;
  transform: translateX(50%);
  max-width: min(30vw, 24rem);
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: rgba(15, 14, 20, 0.62);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  text-align: center;
  font-size: 1.1rem;
  white-space: pre-wrap;
  z-index: 5;
}
#subtitles:empty, #subtitles.hidden { display: none; }

#controls {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 15, 21, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 6;
}
#controls.hidden { display: none; }

#controls button,
#controls select,
#controls input {
  font: inherit;
  color: inherit;
  background: #1d1c26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}
#controls button { cursor: pointer; }
#controls button:disabled { opacity: 0.4; cursor: default; }
#controls button.active { border-color: #7c93e6; }
#controls button svg { width: 1.05em; height: 1.05em; vertical-align: -0.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mic-btn.muted { background: #3a1d28; border-color: #8a4a56; }
/* hold-to-talk on any touch screen (phone, iPad, phone on its side): a finger
   drifting mid-hold must not pan, zoom, select or call up a menu */
#mic-btn { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) { #controls #mic-btn { min-width: 3.25rem; min-height: 3.25rem; } }

#speak-form { display: flex; gap: 0.4rem; }
#speak-text { width: 20rem; }

.pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #1d1c26;
  color: #9a9aa4;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill.error { color: #cf8f9b; }

/* push-to-talk: pressed (the mic still opening), then recording. The press
   answers at once; red means the mic is really listening */
#controls #mic-btn.arming, #controls #mic-btn.recording { transform: scale(0.96); transition: transform 120ms var(--ease), background-color 0s, border-color 0s; }
#controls #mic-btn.arming { background: #3a2230; border-color: #7a4552; }
#mic-btn.recording {
  background: #57202c;
  border-color: #b0576a;
}
/* a soft ring breathes round it — a separate layer, so nothing repaints */
#mic-btn.recording::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 7px solid rgba(214, 86, 110, 0.1);
  border-radius: inherit;
  pointer-events: none;
  animation: rec-pulse 1.1s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0; }
  50% { transform: scale(1); opacity: 1; }
}

/* ---- login overlay ---- */
#login {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #17141f 0%, #0d0b12 70%);
}
#login-form {
  display: flex; flex-direction: column; gap: 0.7rem;
  width: min(21rem, 86vw); padding: 2.2rem 2rem;
  background: #141220; border: 1px solid #2a2740; border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
#login-form h1 { font-size: 1.25rem; letter-spacing: 0.06em; color: #d8d3ea; margin-bottom: 0.2rem; }
.login-hint { color: #8d88a6; font-size: 0.78rem; margin-bottom: 0.5rem; }
#login-form input {
  background: #1b1927; border: 1px solid #322e4a; border-radius: 8px;
  color: #e8e4f4; padding: 0.6rem 0.8rem; font-size: 0.95rem;
}
#login-form input:focus { outline: none; border-color: #7c93e6; }
#login-form button {
  margin-top: 0.4rem; padding: 0.6rem; border-radius: 8px; border: 1px solid #46528a;
  background: #232b4d; color: #dfe4ff; font-size: 0.95rem; cursor: pointer;
  transition: background 0.2s ease, transform 160ms var(--ease);
}
#login-err { color: #e06c85; font-size: 0.82rem; min-height: 1.1em; }

/* ---- settings: pronunciation corrections and team notes ---- */
#settings-btn, #modes-btn {
  position: fixed;
  top: 1rem;
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #cfd3e6;
  background: rgba(16, 15, 21, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.25s ease;
}

/* change mode sits beside the gear */
#modes-btn { right: calc(max(1rem, env(safe-area-inset-right, 0px)) + 3rem); }
#modes-btn svg { stroke-width: 1.6; }
:is(#settings-btn, #modes-btn).hidden { display: none; }
:is(#settings-btn, #modes-btn) svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#settings {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 6, 12, 0.6);
  backdrop-filter: blur(3px);
}
#settings.hidden { display: none; }
#settings.open { animation: settings-in 0.22s var(--ease); }
@keyframes settings-in { from { opacity: 0; } }

#settings-sheet {
  display: flex;
  flex-direction: column;
  width: min(44rem, 100%);
  max-height: 100%;
  background: #141220;
  border: 1px solid #2a2740;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  animation: settings-rise 0.22s var(--ease);
}
@keyframes settings-rise { from { transform: translateY(10px); } }

#settings-sheet header,
#settings-sheet footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.3rem;
}
#settings-sheet header { border-bottom: 1px solid #241f38; }
#settings-sheet footer { border-top: 1px solid #241f38; justify-content: flex-end; }
#settings-sheet h2 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #d8d3ea;
}
#settings-close {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  color: #8c85a6;
  background: transparent;
  border: 1px solid transparent;
}
#settings-close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

#settings-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.4rem 1.3rem 1.1rem;
  scrollbar-width: thin;
  scrollbar-color: #394453 transparent;
}
#settings-body section { margin-top: 1.1rem; }
#settings-body h3 {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8f96c4;
}
.settings-hint { margin: 0 0 0.7rem; color: #7d7694; font-size: 0.8rem; line-height: 1.5; }
.settings-foot { margin: 1.4rem 0 0; color: #8a84a6; font-size: 0.75rem; text-align: center; }

.settings-rows { display: flex; flex-direction: column; gap: 0.45rem; }
.settings-row {
  display: grid;
  align-items: center;
  gap: 0.4rem;
}
.settings-row.correction { grid-template-columns: 1fr auto 1fr auto; }
.settings-row.note { grid-template-columns: 1fr auto; }
.settings-arrow { color: #5f5977; font-size: 0.9rem; }

.settings-row input,
.settings-row textarea {
  width: 100%;
  font: inherit;
  color: #e8e4f4;
  background: #1b1927;
  border: 1px solid #322e4a;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}
.settings-row textarea { resize: vertical; min-height: 2.6rem; line-height: 1.5; }
.settings-row input:focus,
.settings-row textarea:focus { outline: none; border-color: #7c93e6; }
.settings-row input::placeholder,
.settings-row textarea::placeholder { color: #77728f; }

.settings-remove {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  color: #8a84a6;
  background: transparent;
  border: 1px solid transparent;
  align-self: start;
  margin-top: 0.3rem;
}
.settings-remove svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.settings-byline {
  grid-column: 1 / -1;
  color: #8a84a6;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding-left: 0.2rem;
}

.settings-add {
  margin-top: 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  color: #9aa6e0;
  background: transparent;
  border: 1px dashed #37325a;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 160ms var(--ease);
}

#settings-status { flex: 1; font-size: 0.78rem; color: #7d7694; }
#settings-status.ok { color: #7fbf9a; }
#settings-status.err { color: #e06c85; }

#settings-save {
  font: inherit;
  padding: 0.5rem 1.4rem;
  border-radius: 8px;
  border: 1px solid #46528a;
  background: #232b4d;
  color: #dfe4ff;
  cursor: pointer;
  transition: background 0.2s ease, transform 160ms var(--ease);
}
#settings-save:disabled { opacity: 0.55; cursor: default; }

/* ---- HeyGen live-avatar video ---- */
/* contain = full frame visible ("zoomed out"); letterbox blends into the
   dark backdrop. Portrait avatar variants keep the bars minimal. */
#heygen-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0d0b12; }
#heygen-video.hidden { display: none; }
#side.heygen #avatar { visibility: hidden; }

/* ---- graceful avatar-mode crossfade ---- */
#heygen-video { opacity: 0; transition: opacity 0.45s ease; pointer-events: none; -webkit-touch-callout: none; }
#heygen-video.live { opacity: 1; }
#avatar-veil {
  position: absolute; inset: 0; z-index: 7;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  background: rgba(10, 8, 18, 0.55); color: #ecebf5; font-size: 0.85rem;
  backdrop-filter: blur(8px) saturate(0.8);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 150ms var(--ease), visibility 0s linear 150ms;
}
/* shown only if the wait outlasts 150 ms: a quick swap never flashes it */
#avatar-veil.on { opacity: 1; visibility: visible; transition: opacity 200ms var(--ease) 150ms, visibility 0s linear 150ms; }
#avatar-veil span { padding: 0.4rem 0.95rem; border-radius: 999px; background: rgba(13, 12, 17, 0.82); font-weight: 500; }
.veil-spin {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: #9aabf0;
  animation: veil-rot 0.9s linear infinite;
}
#avatar-veil:not(.on) .veil-spin { animation-play-state: paused; }
@keyframes veil-rot { to { transform: rotate(360deg); } }

/* ---- global interaction smoothness ---- */
#controls button, #controls select, .pill {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

/* overlays fade instead of popping; pointer-events off so the UI beneath is
   immediately interactive while the fade completes */
#login, #entry { transition: opacity 0.4s ease; }
#login.bye, #entry.bye { opacity: 0; pointer-events: none; }
/* the members' page, while it asks whether they are signed in: nothing shows but the background — neither the sign-in
   nor the screen behind it (main.js memberEnter; the same rule is inline in the page's head, so it holds from the first frame) */
html.checking body > * { visibility: hidden !important; }

/* controls bar rises in when it first appears */
#controls:not(.hidden) { animation: rise-in 0.26s var(--ease); }
@keyframes rise-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* subtitles: gentle rise on each new line (display toggle restarts it) */
#subtitles:not(:empty) { animation: sub-in 0.2s var(--ease); }
@keyframes sub-in { from { opacity: 0; transform: translateX(50%) translateY(6px); } to { transform: translateX(50%) translateY(0); } }

/* login rejection: physical feedback */
#login-form.shake { animation: form-shake 0.34s ease; }
@keyframes form-shake {
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}


/* ---- modes: one shell at a time ---- */
#chat { display: none; }
body[data-mode="chat"] #chat { display: flex; }
body[data-mode="chat"] :is(#layout, #controls, #subtitles) { display: none; }

/* ---- sources the last spoken answer cited ---- */
#sources {
  position: fixed; z-index: 6; left: max(1.4rem, env(safe-area-inset-left, 0px)); bottom: 5.4rem; right: calc(33% + 1.2rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  overscroll-behavior-x: contain;
  animation: sub-in-src 0.24s var(--ease);
}
#sources[hidden] { display: none; }
/* letter spacing pulls Arabic letters apart */
#sources > span { font-size: 0.72rem; color: #8b95a8; margin-inline-end: 0.15rem; }
#sources a {
  display: inline-flex; align-items: baseline; gap: 0.45rem; max-width: 22rem;
  padding: 0.32rem 0.75rem; border-radius: 999px; font-size: 0.8rem; color: #e3e6ee; text-decoration: none;
  background: rgba(16, 22, 30, 0.85); backdrop-filter: blur(8px); border: 1px solid rgba(196, 178, 141, 0.35);
  transition: border-color 0.15s, background 0.15s, transform 160ms var(--ease);
}
#sources a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sources a small { flex: 0 0 auto; font-size: 0.72rem; color: #8b95a8; }
#sources a:focus-visible { border-color: #c4b28d; background: rgba(24, 32, 44, 0.95); }
@keyframes sub-in-src { from { opacity: 0; transform: translateY(6px); } }
body[data-mode="chat"] #sources { display: none; }

/* ---- voice mode: a quiet orb stands in for the avatar ---- */
#voice-orb { display: none; }
body[data-mode="voice"] :is(#avatar, #heygen-video, #avatar-veil) { display: none !important; }
body[data-mode="voice"] #voice-orb {
  --level: 0;
  position: absolute;
  inset: 0 0 3.6rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  user-select: none;
}
.orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 8.5rem;
  height: 8.5rem;
  margin-bottom: 1.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #1f2c3a 0%, #121b25 72%);
  border: 1px solid rgba(196, 178, 141, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  transition: border-color 0.3s ease, transform 0.38s var(--ease);
}
/* two hairline rings; while speaking they swell with the reply's loudness */
.orb::before, .orb::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(196, 178, 141, 0.2);
  transform: scale(calc(1 + var(--level) * 0.16));
  transition: border-color 0.3s ease;
}
.orb::after { inset: -32px; border-color: rgba(196, 178, 141, 0.1); transform: scale(calc(1 + var(--level) * 0.3)); }
.orb-mark { font-size: 2.7rem; font-weight: 600; line-height: 1; color: #c4b28d; }
.orb-name { font-size: 1.15rem; font-weight: 600; color: #f0eefa; }
.orb-sub { font-size: 0.78rem; letter-spacing: 0.03em; color: #8b95a8; }
/* pressed, mic still opening: a hint of red, no pulse yet */
#voice-orb[data-state="arming"] .orb { border-color: rgba(214, 86, 110, 0.3); }
/* listening turns on at once (it confirms the press); it fades back out */
#voice-orb[data-state="listening"] .orb { border-color: rgba(214, 86, 110, 0.65); transition: border-color 0s, transform 0.38s var(--ease); }
#voice-orb[data-state="listening"] .orb::before, #voice-orb[data-state="listening"] .orb::after { transition: border-color 0s; }
#voice-orb[data-state="listening"] .orb::before { border-color: rgba(214, 86, 110, 0.45); animation: orb-listen 1.4s ease-in-out infinite; }
#voice-orb[data-state="listening"] .orb::after { border-color: rgba(214, 86, 110, 0.16); }
/* thinking: one hairline arc travels the inner ring */
#voice-orb[data-state="thinking"] .orb::before { border-color: rgba(196, 178, 141, 0.1); border-top-color: rgba(196, 178, 141, 0.8); animation: veil-rot 1.1s linear infinite; }
#voice-orb[data-state="speaking"] .orb { border-color: rgba(196, 178, 141, 0.6); }
#voice-orb[data-state="speaking"] .orb::before { border-color: rgba(196, 178, 141, 0.45); }
#voice-orb[data-state="speaking"] .orb::after { border-color: rgba(196, 178, 141, 0.24); }
@keyframes orb-listen { 50% { transform: scale(1.05); opacity: 0.65; } }

/* ---- text chat ---- */
#chat {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--app-top, 0px);
  height: var(--app-height, 100dvh);
  flex-direction: column;
  z-index: 5;
}
#chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(env(safe-area-inset-top, 0px), 0.8rem) calc(7.4rem + env(safe-area-inset-right, 0px)) 0.8rem max(1.25rem, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(177, 192, 207, 0.09);
  background: rgba(11, 18, 27, 0.55);
  backdrop-filter: blur(10px);
}
.chat-id { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
#chat-mark {
  display: grid;
  place-items: center;
  flex: 0 0 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 600;
  color: #16222e;
  background: #c4b28d;
}
#chat-name { font-size: 1.02rem; font-weight: 600; color: #f0eefa; line-height: 1.3; }
#chat-sub { font-size: 0.76rem; color: #8b95a8; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#chat-persona {
  display: flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: #0f151e;
  border: 1px solid #263140;
}
#chat-persona button {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.3rem 0.85rem;
  border: 0;
  border-radius: 999px;
  color: #8b95a8;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 160ms var(--ease);
}
#chat-persona button[aria-checked="true"] { color: #eef1ff; background: #232b4d; }
#chat-persona button:focus-visible { outline: 2px solid #7c93e6; outline-offset: 1px; }

body[data-mode="chat"] :is(#settings-btn, #modes-btn) {
  top: calc(var(--app-top, 0px) + max(env(safe-area-inset-top, 0px), 0.8rem) + 0.05rem);
  width: 2.3rem;
  height: 2.3rem;
  box-shadow: none;
}
body[data-mode="chat"] #modes-btn { right: calc(max(1rem, env(safe-area-inset-right, 0px)) + 2.75rem); }

#chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #394453 transparent;
}
/* Your bubbles sit on the right; each message's text reads in its own
   direction, so Arabic starts from the right edge of its bubble. */
#chat-thread {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-height: 100%;
  width: min(46rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
}

#chat-welcome {
  margin: auto 0;
  padding: 2rem 0 1rem;
  text-align: center;
}
#chat-greeting { margin: 0; font-size: 1.7rem; font-weight: 500; color: #f0eefa; }
#chat-intro { margin: 0.5rem 0 1.6rem; font-size: 1.02rem; color: #8b95a8; }
#chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
.chat-chip {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  color: #d9deea;
  background: #121a25;
  border: 1px solid #263140;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 160ms var(--ease);
}


.chat-msg { display: flex; flex-direction: column; min-width: 0; }
.chat-msg.is-user { align-items: flex-end; }
.chat-msg.is-user .chat-bubble {
  max-width: min(85%, 34rem);
  padding: 0.65rem 1rem;
  color: #eef1ff;
  background: #1f2940;
  border: 1px solid #2d3a57;
  border-radius: 18px;
  border-end-end-radius: 6px;
}
.chat-bubble {
  font-size: 1.02rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.is-bot .chat-bubble { color: #e3e6ee; padding: 0 0.15rem; }
.chat-msg.is-user { animation: chat-in 0.18s var(--ease); }

.chat-typing { display: inline-flex; gap: 5px; padding: 0.6rem 0.1rem; }
.chat-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6d7890;
  animation: chat-dot 1.2s ease-in-out infinite;
}
.chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } }

.chat-cut { align-self: flex-start; margin-top: 0.3rem; font-size: 0.74rem; letter-spacing: 0.05em; color: #8b95a8; }

/* citations: a small numbered link where a fact is used, the documents listed under the reply */
.chat-cite {
  display: inline-grid; place-items: center;
  min-width: 1.15rem; height: 1.15rem; margin-inline: 0.2rem 0.1rem; padding: 0 0.25rem;
  border-radius: 999px; vertical-align: 0.3em;
  font: 600 0.66rem/1 system-ui, sans-serif; color: #16222e; background: #c4b28d;
  text-decoration: none; transition: background 0.15s;
}
.chat-cite:focus-visible { background: #e2d2ab; }
/* a web address or email written in a reply */
.chat-link { color: inherit; text-decoration: underline; text-decoration-color: #c4b28d; text-underline-offset: 3px; overflow-wrap: anywhere; }
.chat-sources { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.7rem; }
.chat-sources-head { font-size: 0.72rem; color: #8b95a8; margin-inline-end: 0.15rem; }
.chat-source {
  display: inline-flex; align-items: center; gap: 0.45rem; max-width: 100%;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem; border-radius: 999px;
  font-size: 0.8rem; color: #d7dbe6; text-decoration: none;
  background: #141d29; border: 1px solid #263140; transition: border-color 0.15s, background 0.15s, transform 160ms var(--ease);
}
.chat-source b { display: grid; place-items: center; flex: 0 0 auto; width: 1.15rem; height: 1.15rem; border-radius: 50%; font-size: 0.66rem; color: #16222e; background: #c4b28d; }
.chat-source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-source small { flex: 0 0 auto; color: #8b95a8; font-size: 0.72rem; }
.chat-note { align-self: center; max-width: 90%; font-size: 0.84rem; text-align: center; color: #8b95a8; }
.chat-note-error { color: #e0949f; }

.chat-visual {
  container-type: inline-size;
  margin-top: 0.9rem;
  animation: chat-in 0.24s var(--ease);
}
/* new values in a card already on screen: a short settle, not a second entrance */
.chat-visual.is-update { animation: chat-update 200ms var(--ease); }
@keyframes chat-update { from { opacity: 0.85; filter: blur(2px); } }
.chat-visual .visual-board { width: 100%; margin: 0; }
/* a single hero number is sized for the stage; in a transcript it only needs to lead */
.chat-visual .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-value { font-size: clamp(56px, 13cqw, 96px); }
.chat-visual .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-heading { margin-bottom: 30px; }
.chat-visual .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade, .visual-money, .visual-countdown) { padding-block: clamp(28px, 5cqw, 44px); }

#chat-banner {
  align-self: center;
  margin-bottom: 0.4rem;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  color: #d5b17e;
  background: #1d1a12;
  border: 1px solid #3a321f;
  border-radius: 999px;
}
#chat-banner[hidden] { display: none; }

#chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  width: min(46rem, calc(100% - 1.5rem));
  margin: 0 auto max(env(safe-area-inset-bottom, 0px), 0.9rem);
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  background: #111822;
  border: 1px solid #2a3444;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease;
}
#chat-form:focus-within { border-color: #46528a; }
#chat-input {
  flex: 1;
  min-width: 0;
  max-height: 160px;
  margin: 0;
  padding: 0.5rem 0;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #eef1ff;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
}
#chat-input::placeholder { color: #5f6a7e; }
#chat-input:placeholder-shown { direction: rtl; }
#chat-send {
  display: grid;
  place-items: center;
  flex: 0 0 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #0f1522;
  background: #9aabf0;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 160ms var(--ease);
}
#chat-send:disabled { cursor: default; opacity: 0.3; }
#chat-send svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#chat-send .icon-stop { display: none; fill: currentColor; stroke: none; }
#chat-send.is-stop { background: #d8dcea; }
#chat-send.is-stop .icon-send { display: none; }
#chat-send.is-stop .icon-stop { display: block; }

/* Formal information graphics. One composed surface; color carries emphasis. */
.visual-board {
  --visual-ink: #f1efe8;
  --visual-muted: #a5b2c1;
  --visual-line: #34414e;
  --visual-brass: #c4b28d;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  align-items: stretch;
  gap: 0;
  width: min(100%, 840px);
  flex: 0 0 auto;
  margin: auto;
  color: var(--visual-ink);
  background: #16222e;
  border: 1px solid #35424f;
  border-radius: 4px;
  box-shadow: 0 24px 64px -36px #00000070, inset 0 1px #ffffff03;
  -webkit-font-smoothing: antialiased;
}
.visual-board:empty { display: none; }
.visual-board::before {
  content: '';
  position: absolute;
  top: -1px;
  inset-inline-start: clamp(24px, 5cqw, 44px);
  width: 48px;
  height: 2px;
  background: var(--visual-brass);
}
.visual-board[data-layout="single"] { grid-template-columns: minmax(0, 1fr); }
.visual-card {
  --accent: #c4b28d;
  min-width: 0;
  padding: clamp(26px, 5cqw, 44px);
  overflow-wrap: anywhere;
}
.visual-wide { grid-column: 1 / -1; }
.visual-board[data-layout="split"] > .visual-card + .visual-card,
.visual-board[data-layout="metrics"] > .visual-card:nth-child(2) { border-inline-start: 1px solid var(--visual-line); }
.visual-board[data-layout="metrics"] > .visual-card:last-child { grid-column: 1 / -1; border-top: 1px solid var(--visual-line); }
.visual-board[data-layout="brief"] > .visual-card + .visual-card { border-top: 1px solid var(--visual-line); background: #101a241f; }
.visual-board[data-layout="brief"][data-count="2"] > .visual-card:last-child { grid-column: 1 / -1; }
.visual-board[data-layout="brief"][data-count="3"] > .visual-card:last-child { border-inline-start: 1px solid var(--visual-line); }
.visual-board[data-layout="stack"] > .visual-card { grid-column: 1 / -1; }
.visual-board[data-layout="stack"] > .visual-card + .visual-card { border-top: 1px solid var(--visual-line); }
.visual-card.tone-good, .visual-bar.tone-good { --accent: #91b9aa; }
.visual-card.tone-warn, .visual-bar.tone-warn { --accent: #d5b17e; }
.visual-card.tone-bad, .visual-bar.tone-bad { --accent: #d79c9a; }
.visual-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.visual-label { margin: 0; color: var(--visual-muted); font-size: 13px; line-height: 1.7; font-weight: 500; text-align: start; }
.visual-label:dir(ltr) { text-transform: uppercase; letter-spacing: .12em; }
.visual-label:dir(rtl) { font-size: 18px; }
/* an Arabic title in a heading laid out left to right: flip it so the title sits on the right. A heading
   that is itself right to left (contact, place, email, form, ticket) is already the right way round:
   flipping it too sent those titles to the left, under cards whose titles were on the right (2026-10-22) */
.visual-heading:dir(ltr):has(.visual-label:dir(rtl)) { flex-direction: row-reverse; }
.visual-heading > .visual-symbol { width: 19px; height: 19px; flex-basis: 19px; margin-top: 2px; color: var(--visual-brass); opacity: .8; }
.visual-wide > .visual-heading { margin-bottom: 8px; padding-bottom: 25px; border-bottom: 1px solid var(--visual-line); }
.visual-wide .visual-label { font-size: clamp(21px, 3.2cqw, 28px); color: var(--visual-ink); font-weight: 450; letter-spacing: -.02em; text-transform: none; }
.visual-wide .visual-label:dir(rtl) { letter-spacing: 0; }
.visual-wide .visual-heading > .visual-symbol { margin-top: 8px; }
.visual-metric, .visual-trend-summary { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.visual-value {
  color: var(--visual-ink);
  font-size: clamp(44px, 9cqw, 78px);
  line-height: 1.05;
  font-weight: 350;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums lining-nums;
}
.visual-value:dir(rtl) { letter-spacing: 0; }
/* a number never breaks inside itself: a longer one gets the smaller size instead */
.visual-value, .visual-previous { overflow-wrap: normal; }
.visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-value { font-size: clamp(76px, 17cqw, 136px); }
.visual-board[data-layout="single"] :is(.visual-stat, .visual-grade, .visual-money, .visual-countdown) { padding-block: clamp(36px, 6cqw, 56px); }
.visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-heading { margin-bottom: 50px; }
.visual-value-long, .visual-board[data-layout="single"] .visual-stat .visual-value-long { font-size: clamp(26px, 5cqw, 44px); letter-spacing: -.025em; line-height: 1.35; }
.visual-countdown .visual-value { font-size: clamp(28px, 6cqw, 58px); line-height: 1.2; letter-spacing: -.025em; }
.visual-denominator { color: var(--visual-muted); font-size: clamp(18px, 3cqw, 26px); font-weight: 350; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.visual-unit { display: inline-block; color: var(--visual-muted); font-size: 13px; line-height: 1.7; }
.visual-card > .visual-unit { display: block; margin-top: 20px; }
.visual-symbol { width: 23px; height: 23px; flex: 0 0 23px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: round; color: var(--accent); }
div.visual-delta { display: flex; gap: clamp(16px, 5cqw, 44px); align-items: center; flex-wrap: wrap; }
.visual-previous { color: var(--visual-muted); font-size: clamp(32px, 6cqw, 54px); font-weight: 350; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.visual-delta .visual-symbol { width: 36px; height: 36px; flex-basis: 36px; color: var(--visual-brass); }
.visual-note { display: flex; align-items: flex-start; gap: 22px; }
.visual-contact .visual-label, .visual-card.visual-contact .visual-label { color: var(--visual-ink); font-size: clamp(20px, 3.4cqw, 26px); font-weight: 500; }
.visual-contact-role { display: block; margin: -4px 0 14px; color: var(--visual-muted); font-size: 14px; line-height: 1.6; }
.visual-contact { display: grid; gap: 10px; margin: 0; }
.visual-contact > div { display: grid; grid-template-columns: minmax(7.5em, auto) 1fr; gap: 12px; align-items: baseline; }
.visual-contact dt { color: var(--visual-muted); font-size: 13px; }
.visual-contact dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0; font-size: clamp(15px, 2.4cqw, 18px); overflow-wrap: anywhere; }
/* any link in any card: the card's ink, underlined in its accent (never browser blue on navy) */
.visual-card :where(a) { color: var(--visual-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
/* «نسخ» and «تم النسخ» share one cell, so the button never changes width */
.visual-copy { display: inline-grid; padding: 2px 10px; font: inherit; font-size: 12px; color: var(--visual-muted); background: transparent; border: 1px solid color-mix(in srgb, var(--visual-muted) 45%, transparent); border-radius: 999px; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, transform 160ms var(--ease); }
.visual-copy > span { grid-area: 1 / 1; transition: opacity 160ms var(--ease), filter 160ms var(--ease); }
.visual-copy > span:last-child, .visual-copy.is-copied > span:first-child { opacity: 0; filter: blur(2px); }
.visual-copy.is-copied > span:last-child { opacity: 1; filter: none; }
.visual-copy.is-copied { color: #b9d6cb; border-color: color-mix(in srgb, #91b9aa 55%, transparent); }
.visual-card.visual-place .visual-label { color: var(--visual-ink); font-size: clamp(20px, 3.4cqw, 26px); font-weight: 500; }
/* a place: its pin on a map, the pin icon opening Maps */
/* a square map widget with the pin, as Google Maps shows it */
/* the map spans the card (a 340px square left the rest of the card empty beside it, 2026-10-22) */
.visual-map { margin: 4px 0 18px; overflow: hidden; border: 1px solid var(--visual-line); border-radius: 12px; background: #0f1821; aspect-ratio: 16 / 9; min-height: 220px; width: 100%; }
/* cards whose words are all Arabic (their labels too) run right to left as a whole: the map, the
   button and the status sit on the right, in line with the title and the rows */
.visual-card:is(.visual-place, .visual-contact, .visual-email, .visual-form, .visual-ticket) { direction: rtl; }
.visual-map iframe { display: block; width: 100%; height: 100%; border: 0; filter: saturate(0.85); }
.visual-pin { display: grid; place-items: center; color: var(--visual-brass); border-radius: 999px; padding: 4px; margin: -4px; transition: background 0.2s ease, transform 160ms var(--ease); }
.visual-pin .visual-symbol { color: inherit; }
.visual-pin:active { transform: scale(0.95); }
.visual-map-link { display: inline-block; margin-top: 16px; padding: 8px 16px; font-size: 14px; color: var(--visual-ink); text-decoration: none; border: 1px solid var(--accent); border-radius: 999px; transition: background 0.2s ease, transform 160ms var(--ease); }
.visual-contact-hours { flex-direction: column; align-items: flex-start; gap: 2px; }
/* what the agent did for the caller: an email sent, a form filed, a ticket */
:is(.visual-email, .visual-form, .visual-ticket) .visual-label { color: var(--visual-ink); font-size: clamp(20px, 3.4cqw, 26px); font-weight: 500; }
:is(.visual-email, .visual-form, .visual-ticket) .visual-heading { margin-bottom: 18px; }
.visual-action-rows { margin-top: 4px; grid-template-columns: fit-content(40%) minmax(0, 1fr); column-gap: 12px; row-gap: 10px; align-items: baseline; }
.visual-action-rows > div { display: contents; }
.visual-status { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 4px 12px 4px 10px; color: #b9d6cb; font-size: 13px; line-height: 1.6; border: 1px solid color-mix(in srgb, #91b9aa 55%, transparent); border-radius: 999px; background: color-mix(in srgb, #91b9aa 12%, transparent); }
.visual-status .visual-symbol { width: 15px; height: 15px; flex-basis: 15px; color: #91b9aa; stroke-width: 2; }
.visual-status .visual-symbol path { stroke-dasharray: 1; }
:is(.chat-visual, #stage-content) .visual-status .visual-symbol path { animation: status-check 380ms var(--ease) 300ms backwards; }
@keyframes status-check { from { stroke-dashoffset: 1; } }
.visual-sent { margin: 20px 0 0; }
.visual-mail-body { margin: 16px 0 0; padding: 14px 16px; color: var(--visual-ink); font-size: clamp(14px, 2.2cqw, 16px); line-height: 1.85; white-space: pre-wrap; border-inline-start: 2px solid var(--accent); background: #ffffff07; border-radius: 0 10px 10px 0; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.visual-mail-body:dir(rtl) { border-radius: 10px 0 0 10px; }
.visual-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.visual-attachments li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; color: var(--visual-ink); font-size: 13px; border: 1px solid var(--visual-line); border-radius: 999px; }
.visual-attachments .visual-symbol { width: 15px; height: 15px; flex-basis: 15px; color: var(--visual-muted); }
.visual-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--visual-brass) 45%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--visual-brass) 7%, transparent); }
.visual-ref-label { color: var(--visual-muted); font-size: 13px; }
/* spaced Arabic digits would run right to left (the spaces between them take
   their direction): kept in the order they are said and copied */
.visual-ref-digits { unicode-bidi: bidi-override; direction: ltr; flex: 1 1 auto; color: var(--visual-ink); font-size: clamp(24px, 4.4cqw, 32px); font-weight: 400; letter-spacing: .12em; font-variant-numeric: tabular-nums; text-align: center; }
.visual-next { margin-top: 20px; }
.visual-next-label { display: block; margin-bottom: 8px; color: var(--visual-muted); font-size: 13px; }
.visual-next ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.visual-next li { display: flex; gap: 10px; align-items: baseline; color: var(--visual-ink); font-size: clamp(14px, 2.2cqw, 16px); line-height: 1.7; counter-increment: step; }
.visual-next li::before { content: counter(step, arabic-indic); flex: 0 0 22px; height: 22px; display: inline-grid; place-items: center; color: var(--visual-brass); font-size: 12px; border: 1px solid color-mix(in srgb, var(--visual-brass) 50%, transparent); border-radius: 50%; }
.visual-note:has(.visual-note-text:dir(rtl)) { flex-direction: row-reverse; }
.visual-note > .visual-symbol { margin-top: 8px; }
.visual-note-text { line-height: 1.6; font-size: clamp(20px, 3.7cqw, 30px); font-weight: 400; letter-spacing: -.015em; }
.visual-note-text:dir(rtl) { letter-spacing: 0; }
.visual-board:not([data-layout="single"]) .visual-note-text { font-size: 19px; line-height: 1.8; letter-spacing: 0; }
.visual-board:not([data-layout="single"]) .visual-note { gap: 16px; }
.visual-rows { margin: 0; }
.visual-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--visual-line); min-width: 0; }
.visual-row:last-child { border-bottom: 0; padding-bottom: 8px; }
.visual-course { flex: 1; display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 20px; align-items: baseline; min-width: 0; }
.visual-row:has(.visual-row-name:dir(rtl)) { flex-direction: row-reverse; }
.visual-course:has(.visual-row-name:dir(rtl)) { direction: rtl; text-align: right; }
.visual-course:has(.visual-row-name:dir(rtl)) .visual-code { text-align: right; }
.visual-course > :only-child { grid-column: 1 / -1; }
.visual-code { color: var(--visual-brass); font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .025em; }
.visual-row-name { color: var(--visual-ink); font-size: 17px; line-height: 1.7; }
.visual-badge { flex: 0 1 auto; max-width: 30%; color: #b7c3d0; font-size: 12px; font-variant-numeric: tabular-nums; text-align: end; line-height: 1.7; }
.visual-row dt { color: var(--visual-muted); font-size: 14px; flex: 1; }
.visual-row dd { margin: 0; font-size: 17px; font-weight: 400; text-align: end; flex: 1; }
.visual-track { height: 4px; background: #344351; overflow: hidden; }
.visual-fill { height: 100%; background: var(--accent); transform-origin: left center; }
.visual-card > .visual-track, div.visual-gauge { margin-top: 32px; }
.visual-scale { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--visual-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.visual-completion { display: grid; grid-template-columns: minmax(0, 1fr) 106px; align-items: center; gap: 22px; }
.visual-completion .visual-unit { margin-top: 16px; }
.visual-ring { width: 100%; height: auto; overflow: visible; }
.visual-ring circle { fill: none; stroke-width: 3; }
.visual-ring-track { stroke: #344351; }
.visual-ring-value { stroke: var(--accent); }
.visual-ring text { fill: var(--visual-ink); font: 400 22px system-ui, sans-serif; letter-spacing: -.03em; }
.visual-ring-unit { fill: var(--visual-muted); font-size: 13px; }
.visual-board[data-layout="single"] .visual-completion { grid-template-columns: minmax(0, 1fr) 144px; }
.visual-board:not([data-layout="single"]) .visual-completion .visual-value { font-size: clamp(40px, 6cqw, 56px); }
.visual-board:not([data-layout="single"]) .visual-completion .visual-metric { gap: 8px; }
.visual-board:not([data-layout="single"]) .visual-completion .visual-denominator { font-size: 18px; }
div.visual-gauge { position: relative; }
.visual-threshold { position: absolute; top: -5px; bottom: -5px; width: 1px; background: #e1bd84; }
/* the danger number sits above the track, whole, and inside the card at either end */
.visual-threshold span { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); color: #e1bd84; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.visual-threshold.is-end span { transform: translateX(-100%); }
.visual-threshold.is-start span { transform: none; }
.visual-gauge + .visual-scale { margin-top: 26px; }
.visual-day { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 28px; padding: 24px 0; border-top: 1px solid var(--visual-line); }
.visual-day:first-child { border-top: 0; }
.visual-day:last-child { padding-bottom: 8px; }
.visual-day-name { color: var(--visual-brass); font-size: 13px; font-weight: 500; line-height: 1.8; padding-inline-start: 12px; border-inline-start: 1px solid #bbaa8580; }
.visual-event { align-items: baseline; justify-content: flex-start; padding-block: 12px; }
.visual-event:first-child { padding-top: 0; }
.visual-event:last-child { padding-bottom: 0; }
.visual-time { flex: 0 0 82px; font-size: 13px; color: var(--visual-muted); font-variant-numeric: tabular-nums; }
.visual-event-title { font-size: 15px; line-height: 1.7; }
.visual-event-body { display: flex; flex-direction: column; min-width: 0; }
.visual-event-sub { font-size: 13px; line-height: 1.5; color: var(--visual-muted); }
.visual-event-flag { font-size: 12px; line-height: 1.5; color: var(--visual-brass); }
.visual-event-flag.is-clash { font-weight: 600; }
.visual-asked { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--visual-line); }
.visual-asked-title { font-size: 13px; color: var(--visual-muted); margin-bottom: 4px; }
.visual-asked ul { margin: 0; padding-inline-start: 18px; }
.visual-asked li { font-size: 14px; line-height: 1.7; }
/* a schedule card's own line when it has no class of ours; a student's courses from other departments, with no time:
   a dashed box and an empty time, so it never reads as a class of the week */
.visual-card-note { margin: 14px 0 0; font-size: 15px; line-height: 1.7; color: var(--visual-ink); }
.visual-outside { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--visual-brass); border-radius: 10px; background: rgba(196, 178, 141, 0.06); }
.visual-outside-title { font-size: 14px; font-weight: 600; line-height: 1.6; color: var(--visual-brass); }
.visual-outside-sub { font-size: 13px; line-height: 1.6; color: var(--visual-muted); }
.visual-outside ul { list-style: none; margin: 8px 0 0; padding: 0; }
.visual-outside-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; align-items: start; padding: 8px 0; border-top: 1px solid var(--visual-line); }
.visual-outside-row:first-child { border-top: 0; }
.visual-outside-time { justify-self: start; padding: 0 8px; border: 1px dashed var(--visual-muted); border-radius: 999px; font-size: 11px; line-height: 20px; color: var(--visual-muted); white-space: nowrap; }
.visual-outside-body { display: flex; flex-direction: column; min-width: 0; }
.visual-outside-code { font-variant-numeric: tabular-nums; }
.visual-wish-kind { display: inline-block; padding: 0 7px; margin-inline-end: 4px; border-radius: 999px; font-size: 11px; line-height: 18px; border: 1px solid var(--visual-line); color: var(--visual-muted); }
.visual-wish-kind.is-must { border-color: var(--visual-brass); color: var(--visual-brass); }
.visual-kind-ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-inline-start: 8px; }
.visual-kind-q { font-size: 12px; color: var(--visual-brass); }
.visual-kind-pick { display: none; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--visual-brass); background: none; color: var(--visual-ink); font: inherit; font-size: 12px; cursor: pointer; }
.chat-visual .visual-kind-pick { display: inline-block; }
.visual-kind-pick:hover { background: rgba(196, 178, 141, 0.15); }
/* in an Arabic timetable an English title or a bare room code still lines up on the right */
.visual-agenda[dir="rtl"] :is(.visual-time, .visual-event-title, .visual-event-sub) { text-align: right; }
ol.visual-steps { list-style: none; padding: 28px 0 0; margin: 0; }
.visual-step { display: flex; align-items: flex-start; gap: 24px; padding-bottom: 30px; position: relative; }
.visual-step:last-child { padding-bottom: 0; }
.visual-step:not(:last-child)::after { content: ''; position: absolute; top: 37px; bottom: 6px; inset-inline-start: 16px; width: 1px; background: var(--visual-line); }
.visual-step-index { width: 33px; height: 33px; display: grid; place-items: center; flex-shrink: 0; font: 11px/1 ui-monospace, monospace; border: 1px solid #53606b; border-radius: 2px; color: var(--visual-muted); }
.is-complete .visual-step-index { color: #9ac8b7; border-color: #668779; }
.visual-step-index .visual-symbol { width: 15px; height: 15px; color: inherit; }
.visual-step-label { display: block; font-size: 17px; line-height: 1.7; }
.visual-step-detail { display: block; margin-top: 5px; color: var(--visual-muted); font-size: 13px; }
.visual-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 20px; }
.visual-option { padding: 8px 0 0; padding-inline-end: 24px; min-width: 0; }
.visual-option + .visual-option { border-inline-start: 1px solid var(--visual-line); padding: 8px 0 0; padding-inline-start: 30px; }
.visual-option.is-recommended .visual-option-heading { color: #a8c9ba; }
.visual-option-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: clamp(20px, 3.5cqw, 28px); font-weight: 400; margin-bottom: 25px; letter-spacing: -.025em; }
.visual-option-heading .visual-symbol { color: #91b9aa; width: 18px; height: 18px; }
/* tracking pulls Arabic letters apart */
.visual-board :is(.visual-value, .visual-option-heading, .visual-label, .visual-note-text, .visual-denominator, .visual-previous):dir(rtl) { letter-spacing: 0 !important; }
/* an Arabic table reads from the right: key right, value left */
.visual-row:has(> dt:dir(rtl)) { flex-direction: row-reverse; }
.visual-option-line { display: block; color: var(--visual-muted); font-size: 14px; line-height: 1.9; margin-top: 10px; }
.visual-option-line:nth-child(2) { color: var(--visual-ink); font-size: 16px; }
div.visual-bars { display: grid; gap: 28px; padding-top: 26px; }
.visual-bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; margin-bottom: 13px; font-size: 15px; }
.visual-bar-value { color: var(--visual-ink); font-size: 19px; font-weight: 400; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.visual-bars .visual-track { height: 6px; }
.visual-bars + .visual-scale { margin-top: 24px; }
.visual-trend > .visual-heading { margin-bottom: 28px; }
.visual-trend-summary { gap: 18px; }
.visual-trend-summary .visual-value { font-size: clamp(40px, 8cqw, 64px); }
.visual-chart { display: block; width: 100%; height: auto; margin-top: 22px; overflow: visible; color: var(--accent); }
.visual-gridline { stroke: var(--visual-line); stroke-width: .65; }
.visual-axis { fill: var(--visual-muted); font: 10px system-ui, sans-serif; }
.visual-chart-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visual-chart-dot { fill: #16222e; stroke: var(--accent); stroke-width: 1.5; }
.visual-chart-dot.is-end { fill: var(--accent); }
.visual-point-value { fill: var(--visual-ink); font: 11px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.visual-chart-captions { display: grid; grid-template-columns: repeat(var(--segments), minmax(0, 1fr)); margin: -12px 5.1282% 0 7.6923%; color: var(--visual-muted); font-size: 10px; }
.visual-chart-captions > span { grid-row: 1; justify-self: start; transform: translateX(-50%); width: max-content; max-width: min(100px, 80%); text-align: center; }
.visual-chart-captions > .visual-axis-last { justify-self: end; transform: translateX(50%); }
.visual-data-points { display: none; }
.is-selected { background: #c4b28d08; box-shadow: inset 2px 0 var(--visual-brass); padding-inline: 16px; }
.is-secondary { opacity: .65; }
.visual-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@container (max-width: 620px) {
  .visual-board { grid-template-columns: minmax(0, 1fr); }
  .visual-card { padding: 28px; }
  .visual-board[data-layout] > .visual-card + .visual-card { border-inline-start: 0; border-top: 1px solid var(--visual-line); }
  .visual-board::before { inset-inline-start: 28px; }
  .visual-heading { margin-bottom: 25px; }
  .visual-value { font-size: 56px; }
  .visual-value-long { font-size: 28px; }
  .visual-course { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .visual-row-name { font-size: 16px; }
  .visual-row { padding-block: 20px; }
  .visual-chart-captions, .visual-point-value { display: none; }
  .visual-data-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; font-size: 12px; margin-top: 4px; }
  .visual-data-points > div { display: flex; justify-content: space-between; gap: 12px; }
  /* the caption wraps; the number never does */
  .visual-data-points > div > span:first-child { min-width: 0; color: var(--visual-muted); }
  .visual-data-points > div > span:last-child { flex-shrink: 0; white-space: nowrap; }
  .visual-axis { display: none; }
  .visual-board[data-layout="single"] .visual-completion { grid-template-columns: minmax(0, 1fr) 108px; }
}
@container (max-width: 370px) {
  .visual-card { padding: 22px; }
  .visual-board::before { inset-inline-start: 22px; width: 36px; }
  .visual-heading { gap: 14px; }
  .visual-wide > .visual-heading { padding-bottom: 20px; }
  .visual-label { font-size: 11px; }
  .visual-label:dir(rtl) { font-size: 16px; }
  .visual-wide .visual-label { font-size: 21px; }
  .visual-comparison { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .visual-option, .visual-option + .visual-option { border-inline-start: 0; padding: 0; }
  .visual-option + .visual-option { border-top: 1px solid var(--visual-line); padding-top: 24px; }
  .visual-day { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; } /* «الأربعاء» on one line */
  .visual-day-name { padding-inline-start: 8px; font-size: 12px; }
  /* stacked, each line spans the row (a column flex "baseline" pins to the left even in Arabic) */
  .visual-event { flex-direction: column; gap: 6px; align-items: stretch; }
  .visual-time { flex-basis: auto; }
  .visual-event-title { font-size: 14px; }
  .visual-row { gap: 16px; }
  .visual-row-name { font-size: 15px; }
  .visual-badge { max-width: 28%; font-size: 11px; }
  div.visual-delta { gap: 16px; }
  .visual-delta .visual-value { font-size: 40px; }
  .visual-delta .visual-symbol { flex-basis: 24px; }
  .visual-completion, .visual-board[data-layout="single"] .visual-completion { grid-template-columns: minmax(0, 1fr) 84px; gap: 16px; }
  .visual-completion .visual-metric { gap: 8px; }
  .visual-completion .visual-value { font-size: 48px; }
  .visual-completion .visual-denominator { font-size: 18px; }
  .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-value { font-size: 86px; }
  .visual-board[data-layout="single"] .visual-stat .visual-value-long { font-size: 28px; }
  .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-heading { margin-bottom: 36px; }
}
/* hover effects only where a pointer can hover: a tap leaves :hover stuck on
   touch screens (a highlighted chip, a gear frozen mid-rotation) */
@media (hover: hover) and (pointer: fine) {
  #settings-btn:hover { color: #fff; border-color: rgba(124, 147, 230, 0.55); transform: rotate(35deg); }
  #modes-btn:hover { color: #fff; border-color: rgba(124, 147, 230, 0.55); }
  .mode-card:hover:not(:disabled) { border-color: #4b5795; background: #17152a; transform: translateY(-2px); }
  .chat-chip:hover { border-color: #46528a; background: #161f2d; }
  .app-notice button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
  #login-form button:hover { background: #2a3560; }
  #settings-close:hover { color: #e8e4f4; border-color: #322e4a; }
  .settings-remove:hover { color: #e06c85; border-color: #45283a; }
  .settings-add:hover { color: #cdd4ff; border-color: #55609c; background: rgba(124, 147, 230, 0.06); }
  #settings-save:hover { background: #2a3560; }
  #sources a:hover { border-color: #c4b28d; background: rgba(24, 32, 44, 0.95); }
  .chat-cite:hover { background: #e2d2ab; }
  .chat-source:hover { border-color: #c4b28d; background: #18222f; }
  .visual-copy:hover { color: var(--visual-ink); border-color: var(--accent); }
  .visual-map-link:hover, .visual-pin:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
}
/* pressed: every control answers the finger at once, before it lifts */
.mode-card:active:not(:disabled), :is(.chat-chip, #chat-persona button):active { transform: scale(0.98); }
#chat-send:active:not(:disabled), .visual-copy:active { transform: scale(0.95); }
:is(#login-form button, #settings-save:not(:disabled), .settings-add, #sources a, .chat-source, .visual-map-link, #modes-btn):active { transform: scale(0.97); }
/* any touch screen: 16px fields, or iOS zooms in on focus and stays zoomed */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* ---- phones ----
   Voice: the avatar fills the screen like a video call, visual cards rise as a
   sheet over its lower half, and a thumb-sized push-to-talk sits in a dock.
   Chat: full screen, composer pinned above the keyboard. */
@media (max-width: 700px) {
  :root { --dock-h: calc(11rem + env(safe-area-inset-bottom, 0px)); }

  #settings-btn, #modes-btn { top: max(env(safe-area-inset-top, 0px), 0.75rem); right: 0.75rem; }
  #modes-btn { right: 3.65rem; }

  #login-form { padding: 1.9rem 1.5rem; }

  /* the top line clears the gear */
  #entry-inner { padding: max(env(safe-area-inset-top, 0px), 3.4rem) 1.1rem max(env(safe-area-inset-bottom, 0px), 1.5rem); }
  #entry-title { margin-bottom: 1.4rem; font-size: 1.3rem; }
  #entry-modes { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .mode-card {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.2rem;
    min-height: 0;
    padding: 1.15rem 1.2rem;
  }
  .mode-card svg { grid-row: 1 / span 3; width: 1.8rem; height: 1.8rem; margin: 0.1rem 0 0; }
  .mode-status { grid-column: 2; padding-top: 0.35rem; }
  .mode-status:empty { display: none; }

  /* voice */
  #layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    top: var(--app-top, 0px);
    bottom: auto;
    height: var(--app-height, 100dvh);
  }
  #side { grid-area: 1 / 1; }
  #avatar { inset: 0 0 var(--dock-h) 0; }
  #heygen-video { inset: 0 0 var(--dock-h) 0; height: auto; }
  /* the figure moves up into the room above the card sheet (figure-fit.js),
     on the sheet's own curve */
  #avatar, #heygen-video { transform-origin: 50% 0; }
  #avatar { transition: transform 0.38s var(--ease); }
  #heygen-video { transition: opacity 0.45s ease, transform 0.38s var(--ease); }
  /* shrunk, the video reads as a framed picture rather than a cut-off one */
  #heygen-video.fitted { border-radius: 0 0 26px 26px; }
  #avatar-veil { bottom: var(--dock-h); }
  /* The visuals live in an opaque bottom sheet that belongs to the layout:
     it rises out of the dock, follows its content's height (published by
     VisualStage.fit as --visual-board-h), and stops short of the face. Every
     card change then happens on a solid surface — never as translucent text
     over the avatar. */
  #stage {
    position: absolute;
    left: 0;
    right: 0;
    top: 38%;
    bottom: var(--dock-h);
    margin: 0;
    border: 0;
    z-index: 3;
    pointer-events: none;
  }
  /* full height, moved rather than resized: it slides to show exactly the
     board (--sheet-shift, from VisualStage.fit), so a size change mid-speech
     is a cheap transform, never a re-layout every frame */
  #stage-content {
    inset: 0;
    display: block;
    padding: 0;
    background: #16222e;
    border-top: 1px solid #35424f;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px -14px rgba(0, 0, 0, 0.65);
    scrollbar-width: none;
    /* parked below the dock, where #stage's clipping hides it — so it never
       needs to fade, and is never see-through over the avatar */
    transform: translateY(calc(100% + 40px));
    /* leaving is quicker than arriving */
    transition: transform 0.26s var(--ease);
  }
  #stage-content::-webkit-scrollbar { display: none; }
  #stage.has-content #stage-content {
    transform: translateY(var(--sheet-shift, 0px));
    pointer-events: auto;
    transition: transform 0.38s var(--ease);
  }
  /* more below the fold: fade the last rows into the sheet rather than cut
     one in half. A sticky overlay in the sheet's own colour — a mask would
     make the sheet itself transparent and show the avatar through it. */
  #stage-content[data-more]::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 56px;
    margin-top: -56px;
    background: linear-gradient(to bottom, rgba(22, 34, 46, 0), #16222e 85%);
    pointer-events: none;
  }
  /* the sheet is the surface; the board inside drops its own frame */
  #stage-content .visual-board {
    width: 100%;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #stage-hint {
    position: absolute;
    left: 50%;
    bottom: 0.4rem;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 2rem);
    padding: 0.4rem 1rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #c3cad8;
    background: rgba(11, 18, 27, 0.72);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    transition: opacity 0.25s ease 0.2s;
  }
  /* fade rather than blink: it steps aside for the sheet and returns after it */
  #stage.has-content #stage-hint { display: block; opacity: 0; transition-delay: 0s; }
  /* the what's-new note is the pill here: badge and title, no more */
  #stage-hint:has(.new-note) { padding: 0; background: none; backdrop-filter: none; border-radius: 0; }
  .new-note.is-stage { flex-wrap: nowrap; align-items: center; gap: 0.55rem; padding: 0.5rem 0.85rem; border-radius: 999px; }
  .new-note.is-stage .new-title { font-size: 0.86rem; }
  .new-note.is-entry { margin: -0.4rem 0 1.1rem; }

  /* Phone-sized cards, in the voice sheet and in chat: the same information
     in less height, so a sheet shows whole cards and a reply keeps its text
     in view. */
  :is(.chat-visual, #stage-content) .visual-card { padding: 20px 22px; }
  :is(.chat-visual, #stage-content) .visual-board::before { inset-inline-start: 22px; }
  :is(.chat-visual, #stage-content) .visual-heading { margin-bottom: 14px; }
  :is(.chat-visual, #stage-content) .visual-wide > .visual-heading { margin-bottom: 0; padding-bottom: 12px; }
  :is(.chat-visual, #stage-content) .visual-wide .visual-label { font-size: 19px; }
  :is(.chat-visual, #stage-content) .visual-value { font-size: 42px; }
  :is(.chat-visual, #stage-content) .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-value { font-size: 60px; }
  :is(.chat-visual, #stage-content) .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade, .visual-money, .visual-countdown) { padding-block: 22px; }
  :is(.chat-visual, #stage-content) .visual-status .visual-symbol path { animation-delay: 360ms; }
  :is(.chat-visual, #stage-content) .visual-board[data-layout="single"] :is(.visual-stat, .visual-grade) .visual-heading { margin-bottom: 16px; }
  :is(.chat-visual, #stage-content) .visual-countdown .visual-value { font-size: 30px; }
  :is(.chat-visual, #stage-content) .visual-previous { font-size: 30px; }
  :is(.chat-visual, #stage-content) .visual-delta .visual-symbol { width: 26px; height: 26px; flex-basis: 26px; }
  :is(.chat-visual, #stage-content) .visual-note { gap: 14px; }
  :is(.chat-visual, #stage-content) .visual-note > .visual-symbol { margin-top: 5px; }
  :is(.chat-visual, #stage-content) .visual-note-text { font-size: 18px; line-height: 1.6; }
  :is(.chat-visual, #stage-content) .visual-row { padding-block: 12px; }
  :is(.chat-visual, #stage-content) .visual-row:last-child { padding-bottom: 2px; }
  :is(.chat-visual, #stage-content) .visual-row-name { font-size: 15px; line-height: 1.6; }
  :is(.chat-visual, #stage-content) .visual-course { gap: 3px; }
  :is(.chat-visual, #stage-content) .visual-row dd { font-size: 15px; }
  :is(.chat-visual, #stage-content) .visual-card > .visual-track, :is(.chat-visual, #stage-content) div.visual-gauge { margin-top: 18px; }
  :is(.chat-visual, #stage-content) .visual-scale { margin-top: 8px; }
  :is(.chat-visual, #stage-content) .visual-gauge + .visual-scale { margin-top: 14px; }
  :is(.chat-visual, #stage-content) .visual-card > .visual-unit { margin-top: 8px; }
  :is(.chat-visual, #stage-content) .visual-completion { grid-template-columns: minmax(0, 1fr) 84px; gap: 16px; }
  :is(.chat-visual, #stage-content) .visual-completion .visual-unit { margin-top: 6px; }
  :is(.chat-visual, #stage-content) .visual-day { padding: 12px 0; gap: 14px; }
  :is(.chat-visual, #stage-content) .visual-day:last-child { padding-bottom: 2px; }
  :is(.chat-visual, #stage-content) .visual-event { padding-block: 6px; }
  :is(.chat-visual, #stage-content) .visual-event-title { font-size: 14px; line-height: 1.55; }
  :is(.chat-visual, #stage-content) ol.visual-steps { padding-top: 14px; }
  :is(.chat-visual, #stage-content) .visual-step { gap: 16px; padding-bottom: 16px; }
  :is(.chat-visual, #stage-content) .visual-step-label { font-size: 15px; line-height: 1.5; }
  :is(.chat-visual, #stage-content) .visual-step-detail { margin-top: 2px; }
  :is(.chat-visual, #stage-content) .visual-step-index { width: 28px; height: 28px; }
  :is(.chat-visual, #stage-content) .visual-step:not(:last-child)::after { top: 32px; inset-inline-start: 14px; }
  :is(.chat-visual, #stage-content) div.visual-bars { gap: 14px; padding-top: 12px; }
  :is(.chat-visual, #stage-content) .visual-bar-label { margin-bottom: 7px; font-size: 14px; }
  :is(.chat-visual, #stage-content) .visual-bar-value { font-size: 16px; }
  :is(.chat-visual, #stage-content) .visual-bars + .visual-scale { margin-top: 12px; }
  :is(.chat-visual, #stage-content) .visual-comparison { padding-top: 8px; }
  :is(.chat-visual, #stage-content) .visual-option-heading { margin-bottom: 10px; font-size: 18px; }
  :is(.chat-visual, #stage-content) .visual-option-line { margin-top: 2px; line-height: 1.6; }
  :is(.chat-visual, #stage-content) .visual-option-line:nth-child(2) { font-size: 15px; }
  :is(.chat-visual, #stage-content) .visual-trend > .visual-heading { margin-bottom: 12px; }
  :is(.chat-visual, #stage-content) .visual-trend-summary .visual-value { font-size: 38px; }
  :is(.chat-visual, #stage-content) .visual-chart { margin-top: 8px; }

  #controls {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    height: var(--dock-h);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr); /* the chip pair sits dead center */
    grid-template-rows: auto auto auto;
    align-content: end;
    align-items: center;
    column-gap: 0.6rem;
    row-gap: 0.6rem;
    padding: 0.6rem 1rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 0;
    background: linear-gradient(to top, rgba(8, 12, 18, 0.98) 62%, rgba(8, 12, 18, 0));
    backdrop-filter: none;
    box-shadow: none;
  }
  #controls:not(.hidden) { animation: dock-in 0.26s var(--ease); }
  #controls #status {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    /* a message the caller must read wraps rather than being cut at both ends */
    max-width: 100%;
    white-space: normal;
    text-align: center;
    text-wrap: balance;
    padding: 0;
    background: none;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9aa3b8;
  }
  #controls #status.error { color: #e0949f; text-transform: none; letter-spacing: 0.02em; }
  #controls #voice { grid-column: 2; grid-row: 1; }
  #controls #avatar-mode { grid-column: 3; grid-row: 1; }
  #controls :is(#voice, #avatar-mode) {
    max-width: 100%;
    padding: 0.4rem 1.9rem 0.4rem 0.95rem;
    appearance: none;
    -webkit-appearance: none;
    color: #c9cedc;
    background: #151b26 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%239aa3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.7rem center / 0.75rem;
    border-color: #273142;
  }
  #controls #mic-btn {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    display: grid;
    place-items: center;
    width: 4.75rem;
    height: 4.75rem;
    padding: 0;
    border-radius: 50%;
    color: #eef1ff;
    background: #232b4d;
    border: 1px solid #46528a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(124, 147, 230, 0.08);
  }
  #controls #mic-btn svg { width: 1.9rem; height: 1.9rem; }
  #controls #mic-btn.recording { background: #57202c; border-color: #b0576a; }
  /* tuning knobs stay on desktop */
  #controls :is(#boost-btn, #speak-form, #mood, #gesture, #llm, #tts-mode, #subtitles-btn) { display: none; }
  /* voice mode: the voice picker sits alone, centred; the orb keeps clear of
     the visuals sheet by moving into the space above it */
  body[data-mode="voice"] #controls #voice { grid-column: 2 / 4; justify-self: center; }
  /* moved and scaled, never re-laid-out: it lands centred in the top 38% */
  body[data-mode="voice"] #voice-orb { inset: 0 0 var(--dock-h) 0; transition: transform 0.38s var(--ease); }
  body[data-mode="voice"] .orb { transform-origin: 50% 100%; }
  body[data-mode="voice"] .orb-sub { transition: opacity 0.15s ease-out; }
  body[data-mode="voice"]:has(#stage.has-content) #voice-orb { transform: translateY(calc(-31% + var(--dock-h) * 0.19)); }
  body[data-mode="voice"]:has(#stage.has-content) .orb { transform: scale(0.62); }
  body[data-mode="voice"]:has(#stage.has-content) .orb-sub { opacity: 0; }
  #subtitles { right: 50%; bottom: calc(var(--dock-h) + 0.5rem); max-width: 90vw; }
  /* on a phone the bottom belongs to the dock and the visuals sheet: sources sit up top */
  #sources { top: max(env(safe-area-inset-top, 0px), 0.75rem); bottom: auto; left: 0.75rem; right: 6.6rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  /* a notice drops below the gear and the chips step aside for it */
  .app-notice.is-stage { top: calc(max(env(safe-area-inset-top, 0px), 0.75rem) + 2.9rem); }
  body:has(.app-notice.is-stage) #sources { visibility: hidden; }
  #sources a { flex: 0 0 auto; max-width: 16rem; }

  /* chat */
  #chat-head { padding-inline: 1rem 6.6rem; }
  body[data-mode="chat"] #settings-btn { right: 0.75rem; }
  body[data-mode="chat"] #modes-btn { right: 3.45rem; }
  #chat-persona button { padding: 0.3rem 0.7rem; }
  #chat-thread { padding: 1.2rem 0.9rem 0.75rem; gap: 1.2rem; }
  #chat-greeting { font-size: 1.5rem; }
  #chat-suggestions { flex-direction: column; align-items: stretch; }
  .chat-chip { text-align: start; padding: 0.75rem 1rem; }
  #chat-form { width: calc(100% - 1rem); margin-bottom: max(env(safe-area-inset-bottom, 0px), 0.5rem); }
  #chat-send { flex-basis: 2.6rem; height: 2.6rem; }
}
@media (max-width: 380px) {
  #chat-sub { display: none; }
}
@keyframes dock-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-only { from { opacity: 0; } }
@keyframes dot-fade { 0%, 60%, 100% { opacity: 0.35; } 30% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .new-note, .new-note::after, .new-badge::after, .new-spark { animation: none; }
  #avatar { transition: none !important; }
  #heygen-video { transition: opacity 0.45s ease !important; }
  /* what arrives still fades in; nothing slides, shakes, pulses or scales */
  :is(.chat-msg.is-user, .chat-visual:not(.is-update), .app-notice, #subtitles, #sources, #controls, #settings, #settings-sheet) { animation-name: fade-only !important; }
  .chat-visual.is-update, #login-form.shake, .orb::before, .orb::after, #mic-btn::after, .visual-status .visual-symbol path { animation: none !important; }
  .chat-typing i { animation-name: dot-fade !important; }
  #stage *, #stage *::before, #stage *::after { animation: none !important; transition-property: opacity !important; scroll-behavior: auto !important; }
  #voice-orb, .orb, .orb::before, .orb::after { transition: none !important; }
  :is(.mode-card, .chat-chip, #chat-persona button, #chat-send, .visual-copy, #login-form button, #settings-save, .settings-add, #sources a, .chat-source, .visual-map-link, #settings-btn, #modes-btn, #mic-btn) { transform: none !important; }
}
/* the phone sheet appears and goes as a fade, already at its place */
@media (prefers-reduced-motion: reduce) and (max-width: 700px) {
  #stage-content { transform: translateY(var(--sheet-shift, 0px)) !important; opacity: 0; transition: opacity 0.2s ease !important; }
  #stage.has-content #stage-content { opacity: 1; }
}

/* the personal sign-in (MEMBERS.md): their own schedule as a PDF, top-left, out of the way of the mode button */
/* the signed-in page's own corner: language, their PDF, suggestions — above the sign-in screen too */
#member-bar {
  position: fixed;
  top: 1rem;
  left: max(1rem, env(safe-area-inset-left, 0px));
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: calc(100vw - 7rem);
}
.member-chip {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 20, 26, 0.72);
  backdrop-filter: blur(8px);
  color: #e9e4d8;
  font: 600 0.8rem/1.2 "IBM Plex Sans Arabic", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.member-chip:hover { border-color: rgba(196, 178, 141, 0.6); }
#login:not(.bye) ~ #member-bar :is(#member-pdf, #member-pdf-old, #pastwish-btn, #suggest-btn, #pass-btn, #signout-btn, #confirm-btn) { display: none; }
#member-bar.in-chat { position: static; justify-content: center; max-width: none; padding: 0.5rem 1rem; border-bottom: 1px solid rgba(177, 192, 207, 0.09); }
/* the testers' «new» note and their corrections panel belong to /test */
body[data-app="member"] .new-note { display: none; }
body[data-app="member"] #modes-btn { right: max(1rem, env(safe-area-inset-right, 0px)); }
:is(#suggest-panel, #pass-panel, #pastwish-panel) {
  position: fixed;
  top: 3.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 61;
  width: min(24rem, calc(100vw - 2rem));
  padding: 1rem 1rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 15, 21, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: #e9e4d8;
  font: 400 0.9rem/1.6 "IBM Plex Sans Arabic", system-ui, sans-serif;
}
:is(#suggest-panel, #pass-panel, #pastwish-panel)[hidden] { display: none; }
:is(#suggest-panel, #pass-panel, #pastwish-panel) p { margin: 0 1.6rem 0.6rem 0; }
:is(#suggest-panel, #pass-panel, #pastwish-panel)[dir="rtl"] p { margin: 0 0 0.6rem 1.6rem; }
:is(#suggest-panel textarea, #pass-panel input) {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  resize: vertical;
}
.suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.6rem; }
.suggest-status { font-size: 0.8rem; color: #b8b2a2; }
.suggest-send {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 0;
  background: #c4b28d;
  color: #17151c;
  font: 600 0.85rem/1.2 "IBM Plex Sans Arabic", system-ui, sans-serif;
  cursor: pointer;
}
.suggest-send:disabled { opacity: 0.5; }
.suggest-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  border: 0;
  background: none;
  color: #b8b2a2;
  font-size: 1.3rem;
  cursor: pointer;
}
:is(#suggest-panel, #pass-panel, #pastwish-panel)[dir="rtl"] .suggest-close { right: auto; left: 0.6rem; }
#pass-panel input { display: block; margin-bottom: 0.5rem; }
body[data-app="member"] #login-form input[type="email"] { direction: ltr; text-align: left; }
/* in Arabic its hint sits on the right like the password's; the address typed in still reads left to right */
body[data-app="member"] #login-form[dir="rtl"] input[type="email"]:placeholder-shown { direction: rtl; text-align: right; }
/* signing in: the button says it is working, and a wrong password marks its box (main.js memberLogin) */
#login-form button:hover:not(:disabled) { background: #2b3560; }
#login-form button:active:not(:disabled) { transform: scale(0.98); }
#login-form button:disabled { cursor: progress; opacity: 0.85; }
#login-form.busy button[type="submit"] { display: flex; align-items: center; justify-content: center; gap: 0.55rem; }
#login-form.busy button[type="submit"]::before {
  content: ''; width: 0.9rem; height: 0.9rem; border-radius: 50%;
  border: 2px solid rgba(223, 228, 255, 0.3); border-top-color: #dfe4ff;
  animation: login-spin 0.7s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
#login-form input.bad, #login-form input.bad:focus { border-color: #e06c85; }
/* «نسيت كلمة السر؟»: a quiet link under the button; in its mode the password box steps aside */
#login-form .login-link { align-self: center; margin-top: 0.2rem; padding: 0.2rem; border: 0; background: none; color: #a9aedb; font-size: 0.8rem; text-decoration: underline; text-decoration-color: rgba(169, 174, 219, 0.35); text-underline-offset: 3px; cursor: pointer; }
#login-form .login-link:hover { color: #dfe4ff; }
#login-form[data-mode="forgot"] #login-pass { display: none; }
#forgot-note:not(:empty) { color: #9fd3b0; font-size: 0.82rem; padding: 0.45rem 0.6rem; border-radius: 6px; background: rgba(120, 200, 150, 0.1); }
#login-err:not(:empty) { padding: 0.45rem 0.6rem; border-radius: 6px; background: rgba(224, 108, 133, 0.1); }

/* the page in Arabic is laid out from the right: the corner buttons on the right, the mode button on the left
   (i18n.js marks body[data-lang]; the chat's header and box take dir="rtl") */
body[data-app="member"][data-lang="ar"] #member-bar:not(.in-chat) { left: auto; right: max(1rem, env(safe-area-inset-right, 0px)); }
body[data-app="member"][data-lang="ar"] #modes-btn { right: auto; left: max(1rem, env(safe-area-inset-left, 0px)); }
body[data-app="member"][data-lang="ar"] #chat-head { padding-inline: max(1.25rem, env(safe-area-inset-right, 0px)) calc(7.4rem + env(safe-area-inset-left, 0px)); }
@media (max-width: 700px) {
  body[data-app="member"][data-lang="ar"] #chat-head { padding-inline: 1rem 6.6rem; }
}
/* the chat box in English: its hint from the left, «Type your question…» */
body[data-app="member"][data-lang="en"] #chat-input:placeholder-shown { direction: ltr; text-align: left; }
/* phones: the corner buttons smaller, so they take two rows at most and stay clear of the voice circle */
@media (max-width: 700px) {
  body[data-app="member"] .member-chip { padding: 0.36rem 0.62rem; font-size: 0.74rem; }
  body[data-app="member"] #member-bar { gap: 0.35rem; max-width: calc(100vw - 5rem); } /* one mode button beside it, not two */
}
/* the expressiveness boost belongs to /test (owner, 2026-10-31) */
body[data-app="member"] #boost-btn { display: none !important; }

/* the members' page: one voice and one registrar, never a choice (owner, 2026-10-30) */
body[data-app="member"] :is(#voice, #chat-persona) { display: none !important; }

/* desktop: hold the space bar to talk (main.js initSpaceHint) — above the controls, in voice and avatar only */
#space-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  body[data-app="member"]:is([data-mode="voice"], [data-mode="avatar"]) #space-hint { display: flex; }
}
#space-hint {
  position: fixed;
  /* the bottom row, to the left of the controls (the card ends above it; the subtitles sit above the right side) */
  right: calc(50% + 9.5rem);
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  align-items: center;
  gap: 0.8rem;
  max-width: calc(50vw - 11rem);
  padding: 0.45rem 0.95rem 0.45rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 15, 21, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color: #e9e4d8;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#space-hint.learned { opacity: 0; transform: translateY(8px); pointer-events: none; }
#space-hint p { margin: 0; font: 500 0.88rem/1.5 "IBM Plex Sans Arabic", system-ui, sans-serif; text-wrap: balance; }
#space-hint svg { width: 6.2rem; height: auto; flex: none; overflow: visible; }
#space-hint .sh-base { fill: #0c0b10; }
#space-hint .sh-key rect { fill: #262430; stroke: rgba(196, 178, 141, 0.55); stroke-width: 1.2; }
#space-hint .sh-key text { fill: #c4b28d; font: 600 11px "IBM Plex Sans", system-ui, sans-serif; letter-spacing: 0.06em; }
#space-hint .sh-mic { fill: none; stroke: #c4b28d; stroke-width: 1.8; }
#space-hint .sh-mic-arc, #space-hint .sh-waves path { fill: none; stroke: #c4b28d; stroke-width: 1.8; stroke-linecap: round; }
#space-hint .sh-key { animation: sh-press 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
#space-hint .sh-waves { animation: sh-talk 2.8s ease-in-out infinite; }
@keyframes sh-press { 0%, 18% { transform: translateY(0); } 26%, 74% { transform: translateY(3.5px); } 82%, 100% { transform: translateY(0); } }
@keyframes sh-talk { 0%, 26% { opacity: 0; } 34%, 66% { opacity: 1; } 74%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #space-hint .sh-key, #space-hint .sh-waves { animation: none; } #space-hint .sh-waves { opacity: 1; } }
/* after their round (main.js roundClosed): a thank-you, their old schedule and their wishes, nothing else */
#round-closed { display: flex; flex-direction: column; align-items: center; width: min(44rem, 100%); }
.rc-title { margin: 0.4rem 0 0.7rem; font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 600; text-align: center; color: #ecebf5; }
.rc-text { max-width: 34rem; margin: 0 0 1.9rem; font-size: 1.04rem; line-height: 1.85; text-align: center; color: #c9cde0; }
.rc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: 100%; }
.rc-actions.is-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rc-btn { min-height: 10.5rem; text-decoration: none; }
/* the sign card on the final page (staff who haven't signed their «مزاولة»): its own row above the buttons */
.rc-sign { width: 100%; min-height: 0; margin-bottom: 1rem; }
/* the staff's open page on the final schedule (main.js finalNote): the closed page's «we are here» step, as a note */
#final-note { display: flex; gap: 0.9rem; align-items: flex-start; width: 100%; margin: -0.6rem 0 1.4rem; padding: 0.9rem 1.1rem; text-align: start; background: #1f1a12; border: 1px solid rgba(196, 178, 141, 0.55); border-radius: 12px; }
#final-note .fn-icon { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; color: #1a150b; background: #e2cf9f; }
#final-note svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#final-note .fn-body { flex: 1; min-width: 0; }
#final-note .fn-title { margin: 0.1rem 0 0.2rem; font-size: 1.05rem; font-weight: 600; color: #f6ecd2; }
#final-note .fn-text { margin: 0; font-size: 0.95rem; line-height: 1.75; color: #d9cfb6; }
/* the new schedule: first, full width, and unmistakable */
#rc-new { position: relative; grid-column: 1 / -1; min-height: 0; padding: 1.7rem 1.7rem 1.6rem; background: #1f1a12; border-color: #c4b28d; box-shadow: 0 0 0 1px rgba(196, 178, 141, 0.35), 0 18px 50px rgba(0, 0, 0, 0.4); }
#rc-new:hover { border-color: #e2cf9f; background: #262016; }
#rc-new svg { stroke: #e2cf9f; }
#rc-new .mode-name { font-size: 1.55rem; color: #f6ecd2; }
#rc-new .mode-desc { color: #d9cfb6; }
.rc-new-pill { position: absolute; top: 1.3rem; inset-inline-end: 1.3rem; padding: 0.28rem 0.95rem; border-radius: 999px; font-size: 1rem; font-weight: 700; color: #1a150b; background: #e2cf9f; animation: rc-new 2.6s ease-in-out infinite; }
@keyframes rc-new { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 207, 159, 0.5); } 50% { box-shadow: 0 0 0 9px rgba(226, 207, 159, 0); } }
/* where the plan stands */
.rc-plan { width: 100%; margin-top: 2.2rem; }
.rc-plan-title { margin: 0 0 1.1rem; font-size: 1.2rem; font-weight: 600; color: #ecebf5; }
.rc-steps { margin: 0; padding: 0; list-style: none; }
.rc-step { position: relative; display: flex; gap: 1rem; padding-bottom: 1.25rem; }
.rc-step:last-child { padding-bottom: 0; }
.rc-step:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: 1.2rem; top: 2.6rem; bottom: 0.1rem; width: 2px; margin-inline-start: -1px; background: #2f2c47; }
.rc-step.is-done:not(:last-child)::before { background: #91b9aa; }
.rc-node { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; color: #8d88a6; background: #141220; border: 1.5px solid #2f2c47; }
.rc-node svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rc-step.is-done .rc-node { color: #0f1b16; background: #91b9aa; border-color: #91b9aa; }
.rc-step.is-now .rc-node { color: #1a150b; background: #e2cf9f; border-color: #e2cf9f; box-shadow: 0 0 0 5px rgba(226, 207, 159, 0.18); }
.rc-step-body { flex: 1; min-width: 0; padding-top: 0.22rem; }
.rc-step.is-now .rc-step-body { margin-top: -0.55rem; padding: 0.75rem 1rem 0.85rem; background: #1f1a12; border: 1px solid rgba(196, 178, 141, 0.55); border-radius: 12px; }
.rc-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.rc-step-no { font-size: 0.82rem; color: #8d88a6; }
.rc-step-name { font-size: 1.05rem; font-weight: 600; color: #ecebf5; }
.rc-step.is-now .rc-step-no { color: #d9cfb6; }
.rc-step.is-now .rc-step-name { color: #f6ecd2; }
.rc-step-tag { padding: 0.08rem 0.65rem; border-radius: 999px; font-size: 0.8rem; color: #c9cde0; border: 1px solid rgba(255, 255, 255, 0.16); }
.rc-step-tag[hidden] { display: none; }
.rc-step.is-now .rc-step-tag { font-weight: 700; color: #1a150b; background: #e2cf9f; border-color: #e2cf9f; }
.rc-step-text { margin: 0.25rem 0 0; font-size: 0.95rem; line-height: 1.7; color: #b9bcd0; }
.rc-step.is-done .rc-step-name, .rc-step.is-done .rc-step-text { color: #a4a8bd; }
@media (prefers-reduced-motion: reduce) { .rc-new-pill { animation: none; } }
.rc-btn .mode-name { font-size: 1.2rem; }
.rc-btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.rc-btn[aria-expanded="true"] { border-color: #4b5795; background: #17152a; }
.rc-btn.is-loading { cursor: progress; opacity: 0.75; }
#rc-list { width: 100%; margin-top: 1rem; padding: 0.4rem 1.2rem; box-sizing: border-box; color: #e8e4f4; background: #141220; border: 1px solid #2a2740; border-radius: 14px; font-size: 0.95rem; line-height: 1.7; }
#rc-list[hidden] { display: none; }
#rc-list:not(:has(ol)) { padding: 1rem 1.2rem; color: #a49cc0; }
#rc-list ol { margin: 0; padding: 0; list-style: none; counter-reset: wish; }
#rc-list li { display: flex; align-items: baseline; gap: 0.8rem; padding: 0.75rem 0; border-bottom: 1px solid rgba(177, 192, 207, 0.09); counter-increment: wish; }
#rc-list li:last-child { border-bottom: 0; }
#rc-list li::before { content: counter(wish); min-width: 1.2rem; color: #8d88a6; font-variant-numeric: tabular-nums; }
#entry-inner[dir="rtl"] #rc-list li::before { content: counter(wish, arabic-indic); }
.rc-wish { flex: 1; }
.rc-kind { flex: none; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: #b8b2c8; border: 1px solid rgba(255, 255, 255, 0.14); }
.rc-kind.is-must { color: #e9d9b0; border-color: rgba(196, 178, 141, 0.55); background: rgba(196, 178, 141, 0.1); }
.rc-kind.is-preferred { color: #c9d3f5; border-color: rgba(124, 147, 230, 0.45); background: rgba(124, 147, 230, 0.08); }
@media (max-width: 700px) {
  .rc-actions, .rc-actions.is-three { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  #rc-new { padding: 1.4rem 1.3rem 1.3rem; }
  #rc-new .mode-name { font-size: 1.35rem; }
  .rc-plan { margin-top: 1.7rem; }
  .rc-btn { min-height: 0; }
  .rc-text { margin-bottom: 1.4rem; font-size: 1rem; }
}

/* ---- the line for voice and video (queue.js): where people wait when every call line is busy ---- */
#vq { z-index: 40; justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; height: var(--app-height, 100dvh); }
#vq[hidden] { display: none; }
#vq-inner {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(27rem, 100%);
  padding: max(env(safe-area-inset-top, 0px), var(--vq-top, 4rem)) 1.25rem max(env(safe-area-inset-bottom, 0px), 1.75rem);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  text-align: center;
}
#vq [hidden] { display: none !important; }
#vq-title { margin: 0 0 1.4rem; font-size: clamp(1.3rem, 3.4vw, 1.6rem); font-weight: 600; line-height: 1.4; color: #ecebf5; }
#vq-ring { position: relative; flex: none; width: 10rem; height: 10rem; margin-bottom: 1.1rem; }
#vq-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 6; }
.vq-track { stroke: #2a2740; }
.vq-arc { stroke: #7c93e6; stroke-linecap: round; transition: stroke-dashoffset 0.5s linear, stroke 0.3s ease; }
#vq-figure { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; }
#vq-number { font-size: 3.1rem; font-weight: 600; line-height: 1.05; color: #f2f1fb; font-variant-numeric: tabular-nums; }
#vq-label { font-size: 0.88rem; color: #a9aedb; }
#vq-ahead { margin: 0; font-size: 1.08rem; font-weight: 600; color: #dfe1f5; }
#vq-eta { margin: 0.2rem 0 0; font-size: 0.95rem; color: #a9aedb; }
#vq-note { margin: 1rem 0 0; max-width: 24rem; font-size: 0.95rem; line-height: 1.75; color: #b9bcd0; }
#vq-link { margin: 0.8rem 0 0; padding: 0.5rem 0.9rem; font-size: 0.88rem; line-height: 1.6; color: #e9d9ae; background: rgba(226, 207, 159, 0.09); border: 1px solid rgba(226, 207, 159, 0.25); border-radius: 10px; }
#vq-primary {
  width: 100%;
  min-height: 3.5rem;
  margin-top: 0.4rem;
  padding: 0.8rem 1.2rem;
  font: 600 1.15rem/1.3 "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: #14120b;
  background: #e2cf9f;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease), background 0.2s ease;
}
#vq-primary:active { transform: scale(0.98); }
#vq-primary:focus-visible, #vq-leave:focus-visible, #vq-warn-ok:focus-visible { outline: 2px solid #7c93e6; outline-offset: 3px; }
#vq[data-phase="offered"] .vq-arc { stroke: #e2cf9f; }
#vq[data-phase="offered"] #vq-number { color: #f6ecd2; }
#vq[data-phase="offered"] #vq-primary { animation: vq-call 1.6s var(--ease) infinite; }
@keyframes vq-call { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 207, 159, 0.45); } 60% { box-shadow: 0 0 0 12px rgba(226, 207, 159, 0); } }
#vq[data-phase="away"] .vq-arc { stroke: #8d88a6; }
#vq-chat { width: 100%; min-height: 0; margin-top: 1.5rem; padding: 0.95rem 1.1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.85rem; row-gap: 0.1rem; align-items: center; box-shadow: none; touch-action: manipulation; }
#vq-chat svg { grid-row: 1 / span 2; width: 1.6rem; height: 1.6rem; margin: 0; }
#vq-chat .mode-name { font-size: 1rem; font-weight: 600; }
#vq-chat .mode-desc { font-size: 0.85rem; line-height: 1.5; }
#vq-leave { margin-top: 0.75rem; min-height: 2.75rem; padding: 0.5rem 1.1rem; font: 500 0.92rem/1.3 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #a9aedb; background: none; border: 0; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
#vq-leave:hover { color: #dfe1f5; }
html.vq-open #space-hint { display: none; }

/* the warning in a call: over the figure or the orb, clear of the corner's buttons, never over the talk button */
#vq-warn {
  position: fixed;
  top: max(calc(env(safe-area-inset-top, 0px) + 0.75rem), 4.1rem);
  left: 50%;
  z-index: 55;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: min(34rem, calc(100vw - 1.5rem));
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: #f6ecd2;
  background: #1f1a12;
  border: 1px solid rgba(226, 207, 159, 0.45);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
#vq-warn[hidden] { display: none; }
#vq-warn-text { flex: 1; min-width: 0; margin: 0; font-size: 0.93rem; line-height: 1.6; text-align: start; }
#vq-warn-ok { flex: none; min-height: 2.75rem; padding: 0.45rem 1rem; font: 600 0.93rem/1.2 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #14120b; background: #e2cf9f; border: 0; border-radius: 9px; cursor: pointer; touch-action: manipulation; }

/* why a call ended, above the choice of chat, voice and video */
#vq-notice { width: 100%; max-width: 40rem; margin: 0 0 1.1rem; padding: 0.75rem 1rem; font-size: 0.95rem; line-height: 1.7; text-align: center; color: #f6ecd2; background: #1f1a12; border: 1px solid rgba(226, 207, 159, 0.3); border-radius: 12px; }
#vq-notice[hidden] { display: none; }

@media (max-height: 640px) {
  #vq-title { margin-bottom: 0.8rem; font-size: 1.2rem; }
  #vq-ring { width: 7rem; height: 7rem; margin-bottom: 0.6rem; }
  #vq-number { font-size: 2.1rem; }
  #vq-label { font-size: 0.78rem; }
  #vq-note { margin-top: 0.6rem; font-size: 0.88rem; }
  #vq-chat { margin-top: 0.9rem; }
}
@media (max-width: 700px) {
  #vq-warn { padding: 0.65rem 0.7rem 0.65rem 0.85rem; gap: 0.6rem; }
  #vq-warn-text { font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  #vq[data-phase="offered"] #vq-primary { animation: none; }
  .vq-arc { transition: none; }
}

/* their «مزاولة» sheet (main.js initConfirm, 2026-11-07): a full page over the site, office hours, «seen and agreed», a
   signature pad. The button stands out until they have signed */
#confirm-btn.is-due { border-color: rgba(196, 178, 141, 0.85); color: #f3e3bd; box-shadow: 0 0 0 3px rgba(196, 178, 141, 0.14); }
#confirm-btn.is-due::after { content: ''; display: inline-block; width: 0.45rem; height: 0.45rem; margin-inline-start: 0.4rem; border-radius: 50%; background: #e0b85a; vertical-align: middle; }
body.cf-open { overflow: hidden; }
#confirm-sheet { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem 2rem; background: rgba(8, 8, 12, 0.72); backdrop-filter: blur(6px); }
#confirm-sheet[hidden] { display: none; }
#confirm-sheet .cf-card { position: relative; width: min(42rem, 100%); margin-top: 2rem; padding: 1.4rem 1.4rem 1.2rem; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(16, 15, 21, 0.98); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); color: #e9e4d8; font: 400 0.92rem/1.6 "IBM Plex Sans Arabic", system-ui, sans-serif; }
#confirm-sheet .cf-close { position: absolute; top: 0.7rem; right: 0.8rem; border: 0; background: none; color: #b8b2a2; font-size: 1.5rem; line-height: 1; cursor: pointer; }
#confirm-sheet[dir="rtl"] .cf-close { right: auto; left: 0.8rem; }
#confirm-sheet .cf-title { margin: 0 0 0.4rem; font-size: 1.15rem; font-weight: 700; padding-inline-end: 2rem; }
#confirm-sheet .cf-lead { margin: 0 0 0.6rem; color: #c9c3b4; }
#confirm-sheet .cf-pdf { display: inline-block; margin-bottom: 0.9rem; color: #e0c98f; text-underline-offset: 3px; }
#confirm-sheet .cf-h { margin: 0.9rem 0 0.5rem; font-size: 0.95rem; font-weight: 700; color: #f1ead8; }
#confirm-sheet .cf-hours { display: grid; gap: 0.45rem; }
#confirm-sheet .cf-day { display: grid; grid-template-columns: 8.4rem 7.2rem 7.2rem 1fr; gap: 0.5rem; align-items: center; padding: 0.35rem 0.5rem; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; }
#confirm-sheet .cf-day.is-bad { border-color: #e06c85; }
#confirm-sheet .cf-day-name { font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
#confirm-sheet .cf-day.is-extra { margin-top: -0.25rem; }
#confirm-sheet .cf-day.is-extra .cf-day-name b { opacity: 0.45; font-weight: 500; }
#confirm-sheet .cf-add, #confirm-sheet .cf-del { padding: 0.15rem 0.45rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: #d8c9a0; font: inherit; font-size: 0.75rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
#confirm-sheet .cf-del { margin-inline-start: auto; font-size: 0.95rem; line-height: 1; padding: 0.15rem 0.5rem; color: #e8a0ae; }
#confirm-sheet .cf-add:hover, #confirm-sheet .cf-del:hover { background: rgba(255, 255, 255, 0.08); }
#confirm-sheet .cf-time { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: #b8b2a2; }
#confirm-sheet select, #confirm-sheet .cf-place { min-width: 0; padding: 0.42rem 0.5rem; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05); color: inherit; font: inherit; }
#confirm-sheet select { direction: ltr; flex: 1; }
#confirm-sheet select option { color: #111; }
#confirm-sheet .cf-total { margin: 0.5rem 0 0; font-size: 0.85rem; color: #9fd3b0; }
#confirm-sheet .cf-total.is-off { color: #e0b85a; }
#confirm-sheet .cf-agree { display: flex; align-items: center; gap: 0.55rem; margin: 1rem 0 0.2rem; font-weight: 600; cursor: pointer; }
#confirm-sheet .cf-agree input { width: 1.15rem; height: 1.15rem; accent-color: #c4b28d; }
#confirm-sheet .cf-pad { position: relative; height: 9.5rem; border-radius: 12px; background: #f7f5ef; border: 1px dashed rgba(196, 178, 141, 0.7); overflow: hidden; }
#confirm-sheet .cf-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#confirm-sheet .cf-pad-hint { position: absolute; inset: auto 0 0.6rem; text-align: center; color: #9a927f; font-size: 0.82rem; pointer-events: none; }
#confirm-sheet .cf-pad.has-ink .cf-pad-hint { display: none; }
#confirm-sheet .cf-pad-row { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-top: 0.4rem; font-size: 0.8rem; color: #b8b2a2; }
#confirm-sheet .cf-clear { border: 0; background: none; color: #b8b2a2; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
#confirm-sheet .cf-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 1rem; }
#confirm-sheet .cf-status { font-size: 0.85rem; color: #c9c3b4; }
#confirm-sheet .cf-save { padding: 0.6rem 1.4rem; border-radius: 999px; border: 0; background: #c4b28d; color: #17151c; font: 700 0.92rem/1.2 "IBM Plex Sans Arabic", system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
#confirm-sheet .cf-save:disabled { opacity: 0.5; cursor: progress; }
@media (max-width: 600px) {
  #confirm-sheet { padding: 0.5rem 0.5rem 1.5rem; }
  #confirm-sheet .cf-card { margin-top: 0.5rem; padding: 1.1rem 0.9rem 1rem; }
  #confirm-sheet .cf-day { grid-template-columns: 1fr 1fr; }
  #confirm-sheet .cf-day-name { grid-column: 1 / -1; }
  #confirm-sheet .cf-place { grid-column: 1 / -1; }
  #confirm-sheet .cf-row { flex-direction: column-reverse; align-items: stretch; }
  #confirm-sheet .cf-save { width: 100%; }
}
#confirm-card { grid-column: 1 / -1; border-color: rgba(196, 178, 141, 0.55); background: linear-gradient(180deg, rgba(196, 178, 141, 0.12), rgba(196, 178, 141, 0.04)); }
#confirm-card svg { color: #e0c98f; }
#pastwish-panel { max-height: min(70vh, 30rem); overflow-y: auto; width: min(28rem, calc(100vw - 2rem)); }
.pastwish-list { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: 0.45rem; }
.pastwish-list li { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.rc-wish-head { margin: 0.8rem 0 0.4rem; font-size: 0.92rem; color: #e0c98f; }
