/* Glance for the web. Light editor on the website's pastel background; the prompter is pure black. */

:root {
  --accent: #0b6bff;          /* Glance Blue */
  --accent-hover: #005ae6;
  --accent-a10: rgba(11, 107, 255, 0.1);
  --accent-a20: rgba(11, 107, 255, 0.2);
  --highlight: #ffd60a;       /* Highlight Yellow */
  --danger: #e5383b;
  --fg: #0a0a0a;
  --secondary: #666;
  --tertiary: #999;
  --border: rgba(10, 10, 10, 0.08);
  --card: rgba(255, 255, 255, 0.72);
  --font: Geist, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --prompter-font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --prompter-weight: 600;
  --read-opacity: 0.35;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  font-family: var(--font);
  color: var(--fg);
  background: #fafafa;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 3px solid rgba(11, 107, 255, 0.45); outline-offset: 2px; }

/* ---------- Background (same as the website) ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(40deg, #fff, #eef1f3);
  pointer-events: none;
}
.blobs { position: absolute; inset: 0; filter: blur(40px); opacity: 0.6; }
.blob { position: absolute; border-radius: 50%; }
.blob--1 { width: 70vmax; height: 70vmax; left: -42vmax; top: 10vh; background: radial-gradient(circle, rgba(221, 74, 255, 0.75) 0, rgba(221, 74, 255, 0) 50%); animation: drift-a 26s ease-in-out infinite; }
.blob--2 { width: 80vmax; height: 80vmax; right: -40vmax; top: -45vmax; background: radial-gradient(circle, rgba(100, 220, 255, 0.8) 0, rgba(100, 220, 255, 0) 50%); animation: drift-b 34s ease-in-out infinite; }
.blob--3 { width: 55vmax; height: 55vmax; left: 30vw; top: 25vh; background: radial-gradient(circle, rgba(240, 90, 90, 0.45) 0, rgba(240, 90, 90, 0) 50%); animation: drift-c 40s ease-in-out infinite; }
.blob--4 { width: 60vmax; height: 60vmax; left: -15vw; bottom: -40vmax; background: radial-gradient(circle, rgba(140, 100, 255, 0.45) 0, rgba(140, 100, 255, 0) 50%); animation: drift-b 30s ease-in-out infinite reverse; }
.blob--5 { width: 50vmax; height: 50vmax; right: -25vmax; bottom: -10vh; background: radial-gradient(circle, rgba(11, 107, 255, 0.3) 0, rgba(11, 107, 255, 0) 50%); animation: drift-a 28s ease-in-out infinite reverse; }
@keyframes drift-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8vw, -6vh); } }
@keyframes drift-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6vw, 8vh); } }
@keyframes drift-c { 0%, 100% { transform: translate(-10vw, -5vh); } 50% { transform: translate(10vw, 5vh); } }
body.reading .backdrop { display: none; }
.editor[hidden] { display: none !important; }
body.reading { background: #000; }

/* ---------- Shared controls ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.button--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -8px rgba(11, 107, 255, 0.55); }
.button--primary:hover:not(:disabled) { background: var(--accent-hover); }
.button--secondary { border: 1px solid #e5e5e5; background: #fff; color: var(--fg); }
.button--secondary:hover:not(:disabled) { background: #f5f5f5; }
.button--danger { background: var(--danger); color: #fff; }
.button--danger:hover { background: #cc2a2d; }
.button--large { min-height: 52px; padding: 14px 30px; font-size: 17px; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-button:hover { background: rgba(10, 10, 10, 0.06); color: var(--fg); }
.icon-button--danger:hover { background: rgba(229, 56, 59, 0.1); color: var(--danger); }

.link-button {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.link-button:hover { text-decoration: underline; }

.tag {
  padding: 2px 10px;
  border: 1px solid var(--accent-a20);
  border-radius: 999px;
  background: var(--accent-a10);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Screens ---------- */

.screen { position: fixed; inset: 0; }

/* ---------- Editor: a full-viewport web layout ---------- */

.editor {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "brand controls" "library doc";
}

.brandbar, .controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.brandbar {
  grid-area: brand;
  padding: var(--safe-top) 16px 0 max(20px, env(safe-area-inset-left));
  border-right: 1px solid var(--border);
}
.controls {
  grid-area: controls;
  padding: var(--safe-top) max(16px, env(safe-area-inset-right)) 0 24px;
}
.brandbar__spacer, .controls__spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.brand img { border-radius: 7px; box-shadow: 0 2px 6px rgba(11, 107, 255, 0.25); }
.only-phone { display: none; }

.library {
  grid-area: library;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 10px max(10px, var(--safe-bottom)) max(10px, env(safe-area-inset-left));
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.4);
}
.library__head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px 12px; }
.library__head h2 { font-size: 12px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.library__actions { display: flex; gap: 2px; }
.library__list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.library__item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: background-color 0.12s ease;
}
.library__item:hover { background: rgba(10, 10, 10, 0.05); }
.library__item[aria-current="true"] { background: var(--accent); color: #fff; }
.library__item b { overflow: hidden; font-size: 14.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.library__item span { font-size: 12.5px; color: var(--secondary); }
.library__item[aria-current="true"] span { color: rgba(255, 255, 255, 0.8); }

/* The writing column stays a comfortable width while the editor fills the viewport. */
.doc {
  --gutter: max(32px, calc((100% - 820px) / 2));
  grid-area: doc;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.72);
}
.doc__head { display: flex; align-items: center; gap: 12px; padding: 32px var(--gutter) 6px; }
.doc__title { flex: 1; min-width: 0; overflow: hidden; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; }
.doc__body {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 12px var(--gutter) 32px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 18px;
  line-height: 1.7;
  color: #1d1d1f;
}
.doc__body::placeholder { color: var(--tertiary); }
.doc__drop {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  font-weight: 600;
  pointer-events: none;
}
.doc__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 40px;
  padding: 8px max(16px, env(safe-area-inset-right)) max(8px, var(--safe-bottom)) 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--secondary);
}
.stats { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mode-note { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc__saved { color: var(--tertiary); white-space: nowrap; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(10, 10, 10, 0.06); }
.segmented button {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.segmented button:hover { color: var(--fg); }
.segmented button[aria-checked="true"] { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.controls .button { min-height: 38px; padding: 8px 18px; font-size: 14.5px; }

/* ---------- Sheets and modals ---------- */

dialog { padding: 0; border: 0; color: var(--fg); }
dialog::backdrop { background: rgba(10, 10, 20, 0.25); backdrop-filter: blur(2px); }

.sheet {
  width: min(420px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px -20px rgba(20, 20, 60, 0.35);
}
.sheet__inner { display: flex; flex-direction: column; max-height: inherit; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 8px 22px; }
.sheet__head h2 { font-size: 19px; font-weight: 700; }
.sheet__body { overflow-y: auto; padding: 0 22px 22px; }

.group { margin: 0; padding: 14px 0 6px; border: 0; border-top: 1px solid var(--border); }
.group:first-child { border-top: 0; }
.group legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-size: 12px; font-weight: 600; color: var(--tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.row { clear: both; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; font-size: 15px; }
.row > span { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }
.row output { color: var(--secondary); font-weight: 400; font-variant-numeric: tabular-nums; }
.row small { display: block; font-size: 12.5px; font-weight: 400; color: var(--secondary); }
.row--toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.row--toggle > span { flex-direction: column; gap: 0; }
.row--info { gap: 4px; }
.row--info .link-button { align-self: flex-start; padding-left: 0; }
.row select {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
}
input[type="range"] { width: 100%; margin: 4px 0; accent-color: var(--accent); }

/* Segmented choices built from radio buttons (keyboard: Tab in, arrows to change). */
.choice { display: flex; margin: 0; padding: 3px; border: 0; border-radius: 12px; background: rgba(10, 10, 10, 0.06); }
.choice label { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 4px 6px; border-radius: 9px; color: var(--secondary); font-size: 14px; font-weight: 500; text-align: center; white-space: nowrap; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice label:hover { color: var(--fg); }
.choice label:has(input:checked) { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.choice label:has(input:focus-visible) { outline: 3px solid rgba(11, 107, 255, 0.45); outline-offset: 1px; }
.choice--fonts label { font-size: 15px; }
.row__label { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }

input[type="checkbox"][role="switch"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: #d8d8dc;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
input[type="checkbox"][role="switch"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
input[type="checkbox"][role="switch"]:checked { background: #34c759; }
input[type="checkbox"][role="switch"]:checked::after { transform: translateX(18px); }

.level { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(10, 10, 10, 0.08); }
.level__bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8ab8ff, var(--accent)); transition: width 0.06s linear; }
.level__bar.speaking { background: linear-gradient(90deg, #6ee7a0, #22c55e); }
.level__threshold { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--fg); opacity: 0.6; }
.level-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.level-row .link-button { flex: none; }

/* Settings over the prompter: a dark side sheet so the text stays visible. */
body.reading .sheet {
  position: fixed;
  inset: 12px 12px 12px auto;
  margin: 0;
  max-height: calc(100dvh - 24px);
  height: fit-content;
  background: rgba(28, 28, 30, 0.9);
  color: #f5f5f7;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
  --border: rgba(255, 255, 255, 0.1);
  --secondary: #a1a1a6;
  --tertiary: #8e8e93;
}
body.reading .sheet::backdrop { background: transparent; backdrop-filter: none; }
body.reading .sheet .icon-button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
body.reading .sheet .row select { border-color: #3a3a3c; background: #2c2c2e; }
body.reading .sheet .choice { background: rgba(255, 255, 255, 0.08); }
body.reading .sheet .choice label:hover { color: #fff; }
body.reading .sheet .choice label:has(input:checked) { background: #48484a; color: #fff; box-shadow: none; }
body.reading .sheet .level { background: rgba(255, 255, 255, 0.12); }
body.reading .sheet .level__threshold { background: #fff; }
body.reading .sheet input[type="checkbox"][role="switch"] { background: #48484a; }
body.reading .sheet input[type="checkbox"][role="switch"]:checked { background: #34c759; }
body.reading .sheet .link-button { color: #4c93ff; }

.modal {
  width: min(460px, calc(100vw - 32px));
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px -20px rgba(20, 20, 60, 0.4);
}
.modal__inner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 26px 22px; text-align: center; }
.modal__icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-a10); color: var(--accent); }
.modal h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.modal p { font-size: 15px; line-height: 1.55; color: var(--secondary); text-wrap: pretty; }
.modal p strong { color: var(--fg); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--secondary); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.modal__actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; margin-top: 6px; }
.modal__actions--row { flex-direction: row; justify-content: center; }
.modal__actions--row .button { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.2s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Prompter ---------- */

.prompter { background: #000; color: #fff; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage { position: absolute; inset: 0; overflow: hidden; cursor: default; }
.prompter.idle .stage { cursor: none; }
.mirror { position: absolute; inset: 0; }
.mirror.flipped { transform: scaleX(-1); }
.column {
  position: absolute;
  inset: 0;
  width: var(--column-width, 72%);
  margin: 0 auto;
}
.text {
  position: relative;
  margin: 0;
  font-family: var(--prompter-font);
  font-weight: var(--prompter-weight, 600);
  font-size: var(--prompter-size, 52px);
  line-height: var(--prompter-line, 64px);
  letter-spacing: 0.005em;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: #fff;
  will-change: transform;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
.text .w { color: #fff; transition: color 0.12s ease; }
.text .w.read { color: rgba(255, 255, 255, var(--read-opacity)); }
.text .w.now { color: var(--highlight); }

/* Lines above the reading line fade out; the bottom of the screen fades too. */
.fade { position: absolute; left: 0; right: 0; pointer-events: none; }
.fade--top { top: 0; height: var(--reading-top, 120px); background: linear-gradient(#000 0%, rgba(0, 0, 0, 0.75) 45%, rgba(0, 0, 0, 0) 100%); }
.fade--bottom { bottom: 0; height: 28%; background: linear-gradient(rgba(0, 0, 0, 0), #000 92%); }

.badge-pause {
  position: absolute;
  top: calc(var(--safe-top) + 16px);
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--prompter-font);
  font-size: min(30vh, 40vw);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown span { animation: count-pop 0.9s ease both; }
@keyframes count-pop { from { opacity: 0; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1); } to { opacity: 0.85; } }

.caption {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 96px);
  max-width: min(640px, calc(100vw - 32px));
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(30, 30, 32, 0.95);
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.done { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); }
.done__card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 36px; border-radius: 24px; background: rgba(28, 28, 30, 0.95); text-align: center; animation: pop-in 0.25s ease both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.done__card h2 { font-size: 28px; font-weight: 700; }
.done__card p { color: #a1a1a6; }
.done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.pill-button { min-height: 44px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--highlight); color: #000; font-size: 15px; font-weight: 600; }
.pill-button:hover { background: #ffe14d; }
.pill-button--light { background: rgba(255, 255, 255, 0.14); color: #fff; }
.pill-button--light:hover { background: rgba(255, 255, 255, 0.22); }

/* The auto-hiding control bar. */
.hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 20px);
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.prompter.preview .hud { display: none; }
.prompter.idle .hud { opacity: 0; transform: translateY(12px); }
.bar {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(36, 36, 38, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.prompter.idle .bar { pointer-events: none; }
.bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bar__btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.bar__btn--main { width: 48px; height: 48px; background: #fff; color: #000; }
.bar__btn--main:hover { background: #e8e8ed; color: #000; }
.bar__btn--small { width: 32px; height: 32px; font-size: 20px; font-weight: 500; line-height: 1; }
.bar__btn .icon-play { display: none; }
.prompter.paused .bar__btn .icon-play { display: block; }
.prompter.paused .bar__btn .icon-pause { display: none; }
.bar__sep { width: 1px; height: 24px; margin: 0 4px; background: rgba(255, 255, 255, 0.14); }
.bar__status { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.85); white-space: nowrap; }
.bar__speed { display: flex; align-items: center; }
.bar__wpm { min-width: 64px; font-size: 13px; font-weight: 500; text-align: center; color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums; }
.privacy { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }
.privacy.local { background: rgba(52, 199, 89, 0.18); color: #6ee7a0; }
.privacy.cloud { background: rgba(255, 159, 10, 0.18); color: #ffc46b; }

.meter { position: relative; display: inline-flex; width: 10px; height: 10px; }
.meter i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transition: background-color 0.15s ease, transform 0.08s linear; }
.meter.live i { background: rgba(255, 255, 255, 0.55); }
.meter.speaking i { background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.25); }
.meter.off { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .editor { grid-template-columns: 220px minmax(0, 1fr); }
  .controls { padding-left: 16px; gap: 8px; }
  .segmented button { padding: 6px 10px; }
  #simulate { display: none; }
  .mode-note { display: none; }
}

@media (max-width: 760px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "brand" "library" "doc" "controls";
  }
  .only-phone { display: inline-flex; }
  .not-phone { display: none; }
  .brandbar { min-height: 52px; padding-right: 8px; border-right: 0; }
  .library { flex-direction: row; align-items: center; padding: 8px 8px 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .library__head { order: 2; padding: 0 0 0 4px; }
  .library__head h2 { display: none; }
  .library__list { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 6px; scrollbar-width: none; }
  .library__list::-webkit-scrollbar { display: none; }
  .library__item { flex: none; width: auto; max-width: 200px; padding: 6px 12px; border-radius: 999px; background: rgba(10, 10, 10, 0.05); }
  .library__item span { display: none; }
  .doc { --gutter: 18px; }
  .doc__head { padding-top: 16px; }
  .doc__title { font-size: 22px; }
  .doc__body { padding-top: 6px; padding-bottom: 16px; font-size: 16.5px; }
  .doc__foot { min-height: 34px; padding: 6px 18px; }
  .controls {
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    padding: 10px 12px max(10px, var(--safe-bottom));
    border-top: 1px solid var(--border);
    border-bottom: 0;
  }
  .controls__spacer { display: none; }
  .segmented { flex: 1 1 100%; }
  .segmented button { flex: 1; padding: 7px 4px; font-size: 13px; }
  #simulate { display: inline-flex; flex: 1; }
  #start { flex: 2; }
  .controls .button { min-height: 44px; }
  #mac-link { display: none; }
  .hud { bottom: calc(var(--safe-bottom) + 12px); }
  .bar { gap: 0; padding: 4px; }
  .bar__btn { width: 38px; height: 38px; }
  .bar__btn--main { width: 44px; height: 44px; }
  .bar__status .bar__mode, .bar__speed, .bar__speed + .bar__sep, .bar [data-action="fullscreen"] { display: none; }
  .caption { bottom: calc(var(--safe-bottom) + 80px); }
}

@media (max-width: 420px) {
  .bar__sep { margin: 0 2px; }
  .privacy { display: none; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .blob, .countdown span, .toast, .done__card { animation: none; }
  .text .w, .hud, .button, .level__bar { transition: none; }
}
