:root {
  --ink: #18302d;
  --ink-soft: #4f615e;
  --muted: #72817f;
  --paper: #fffdfa;
  --canvas: #f5f4ee;
  --panel: #ffffff;
  --line: #dedfd8;
  --line-strong: #c9cec7;
  --brand: #1f5c52;
  --brand-dark: #183f39;
  --brand-soft: #e4f0ec;
  --warm: #a8673f;
  --warm-soft: #f7ebe1;
  --danger: #a03f3b;
  --danger-soft: #fae8e6;
  --success: #26705d;
  --warning: #8c632c;
  --shadow-sm: 0 4px 16px rgba(25, 48, 45, 0.06);
  --shadow-md: 0 14px 40px rgba(25, 48, 45, 0.1);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --content: 1120px;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 7% -10%, rgba(200, 223, 214, 0.58), transparent 30rem),
    var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open,
body.teleprompter-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(31, 92, 82, 0.32);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(201, 206, 199, 0.75);
  background: rgba(255, 253, 250, 0.93);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
}

.brand__mark svg {
  width: 30px;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.icon-button,
.avatar-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
}

.icon-button svg {
  width: 22px;
}

.avatar-button {
  border-color: var(--brand-soft);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% - 2px);
  right: max(16px, env(safe-area-inset-right));
  width: min(280px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.account-menu__email {
  overflow: hidden;
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
}

.menu-action {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--danger);
  font-weight: 700;
}

#app-main {
  min-height: calc(100vh - 68px);
  padding: 22px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.page {
  width: min(100%, var(--content));
  margin: 0 auto;
  animation: page-in 220ms ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.35;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 7vw, 40px);
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(20px, 5vw, 26px);
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.lede,
.page-head p,
.section-head p {
  margin: 0;
  color: var(--ink-soft);
}

.section-head {
  margin-bottom: 16px;
}

.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-head--row h2 {
  margin-bottom: 2px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.panel + .panel,
.stack > * + * {
  margin-top: 16px;
}

.auth-page {
  display: grid;
  min-height: calc(100vh - 44px);
  padding-bottom: 0;
  place-items: center;
}

.auth-layout {
  display: grid;
  width: min(100%, 940px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.auth-intro {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: var(--brand-dark);
  color: white;
}

.auth-intro::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 270px;
  height: 270px;
  border: 50px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  content: "";
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-weight: 800;
}

.auth-logo .brand__mark {
  background: rgba(255, 255, 255, 0.15);
}

.auth-intro h1 {
  max-width: 10em;
  margin-bottom: 14px;
  font-size: clamp(30px, 7vw, 44px);
}

.auth-intro p {
  max-width: 28em;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.auth-points {
  display: grid;
  gap: 7px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.auth-points li::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d7aa82;
  content: "";
}

.auth-card {
  padding: 28px 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 12px;
  background: var(--canvas);
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button[aria-selected="true"] {
  background: var(--panel);
  color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(25, 48, 45, 0.08);
}

.form-grid {
  display: grid;
  gap: 17px;
}

.form-grid--two {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span:first-child,
.fieldset-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.required::after {
  margin-left: 3px;
  color: var(--danger);
  content: "*";
}

.field small,
.form-hint {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input,
select {
  padding: 0 13px;
}

textarea {
  min-height: 112px;
  padding: 12px 13px;
  line-height: 1.7;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 92, 82, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #99a39f;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 58px;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.input-with-action .text-action {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 36px;
  transform: translateY(-50%);
}

.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice {
  position: relative;
  display: inline-flex;
}

.choice input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.choice span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: white;
  color: var(--ink-soft);
  font-size: 14px;
}

.choice input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.choice input:focus-visible + span {
  outline: 3px solid rgba(31, 92, 82, 0.25);
  outline-offset: 2px;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.checkbox-line a,
.auth-links a,
.footer-links a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.auth-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row--end {
  justify-content: flex-end;
}

.button,
.button-secondary,
.button-ghost,
.button-danger {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}

.button:active,
.button-secondary:active,
.button-ghost:active,
.button-danger:active {
  transform: translateY(1px);
}

.button {
  background: var(--brand);
  color: white;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(31, 92, 82, 0.17);
}

.button:hover:not(:disabled) {
  background: var(--brand-dark);
}

.button-secondary {
  border-color: #b7d0c7;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 750;
}

.button-ghost {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.button-danger {
  border-color: #ecc4c1;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.button--block {
  width: 100%;
}

.button--small,
.button-secondary.button--small,
.button-ghost.button--small,
.button-danger.button--small {
  min-height: 40px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13px;
}

.button svg,
.button-secondary svg,
.button-ghost svg {
  width: 18px;
  height: 18px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
  padding: 27px 22px;
  border-radius: var(--radius-lg);
  background: var(--brand-dark);
  color: white;
}

.home-hero::after {
  position: absolute;
  right: -48px;
  bottom: -74px;
  width: 190px;
  height: 190px;
  border: 36px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  content: "";
}

.home-hero .eyebrow {
  color: #d8b18f;
}

.home-hero h1 {
  max-width: 16em;
  margin-bottom: 9px;
}

.home-hero p {
  max-width: 40em;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.quick-card {
  position: relative;
  display: grid;
  min-height: 142px;
  overflow: hidden;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.quick-card:hover {
  border-color: #b8cac4;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-card__icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--brand);
}

.quick-card:nth-child(2) .quick-card__icon {
  background: var(--warm-soft);
  color: var(--warm);
}

.quick-card__icon svg {
  width: 25px;
  height: 25px;
}

.quick-card h2 {
  margin: 0 0 3px;
  font-size: 19px;
}

.quick-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-card__arrow {
  color: var(--muted);
  font-size: 24px;
}

.status-strip {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
  font-size: 13px;
}

.status-strip--warning {
  border-color: #e7d4b8;
  background: #fff9ee;
  color: #6e522c;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--success);
}

.status-strip--warning .status-dot {
  background: var(--warning);
}

.topic-list,
.works-list {
  display: grid;
  gap: 14px;
}

.topic-card,
.work-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.topic-card {
  display: grid;
  gap: 15px;
}

.topic-card__number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.topic-card h2,
.work-card h2 {
  margin-bottom: 6px;
  font-size: 19px;
}

.meta-grid {
  display: grid;
  gap: 9px;
  margin: 0;
}

.meta-grid div {
  display: grid;
  grid-template-columns: 6em 1fr;
  gap: 7px;
  font-size: 13px;
}

.meta-grid dt {
  color: var(--muted);
}

.meta-grid dd {
  margin: 0;
  color: var(--ink-soft);
}

.tag-row,
.highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 12px;
}

.tag--accent {
  background: var(--warm-soft);
  color: #865136;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  padding: 40px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-state__icon svg {
  width: 31px;
}

.empty-state h2 {
  margin-bottom: 7px;
}

.empty-state p {
  max-width: 31em;
  margin: 0 auto 20px;
  color: var(--muted);
}

.loading-panel {
  display: grid;
  min-height: 320px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.loader {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #cbdad5;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.loader--large {
  width: 42px;
  height: 42px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-panel p,
.boot-screen p {
  margin: 12px 0 0;
  color: var(--muted);
}

.boot-screen {
  display: grid;
  min-height: 65vh;
  place-content: center;
  text-align: center;
}

.error-box {
  padding: 14px 16px;
  border: 1px solid #e9bfbb;
  border-radius: 12px;
  background: var(--danger-soft);
  color: #7a302d;
  font-size: 14px;
}

.script-shell {
  display: grid;
  gap: 16px;
}

.script-toolbar {
  position: sticky;
  z-index: 15;
  bottom: calc(72px + env(safe-area-inset-bottom));
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin-top: 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.script-toolbar::-webkit-scrollbar {
  display: none;
}

.script-toolbar button {
  flex: 0 0 auto;
}

.script-section {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.script-section__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 800;
}

.script-section__hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.script-section textarea,
.script-section input {
  border-color: transparent;
  background: var(--canvas);
}

.script-section textarea:focus,
.script-section input:focus {
  border-color: var(--brand);
  background: white;
}

.speech-area {
  min-height: 270px;
  font-size: 16px;
  line-height: 1.95;
}

.shot-list {
  display: grid;
  gap: 10px;
}

.shot-item {
  display: grid;
  gap: 9px;
  padding: 13px;
  border-radius: 12px;
  background: var(--canvas);
}

.shot-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shot-item__number {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.shot-item input,
.shot-item textarea {
  background: white;
}

.shot-item textarea {
  min-height: 80px;
}

.inline-add {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

.work-card {
  display: grid;
  gap: 13px;
}

.work-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-card__time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.work-card__summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-danger {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-danger h3 {
  color: var(--danger);
}

.legal-page {
  max-width: 820px;
}

.legal-page .panel {
  padding: clamp(22px, 5vw, 42px);
}

.legal-page h2 {
  margin-top: 30px;
  font-size: 20px;
}

.legal-page p,
.legal-page li {
  color: var(--ink-soft);
  font-size: 14px;
}

.legal-page ul {
  padding-left: 1.4em;
}

.legal-note {
  padding: 13px 15px;
  border-left: 4px solid var(--warm);
  border-radius: 8px;
  background: var(--warm-soft);
  color: #714932 !important;
}

.bottom-nav {
  position: fixed;
  z-index: 25;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 66px;
  padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  border-top: 1px solid rgba(201, 206, 199, 0.82);
  background: rgba(255, 253, 250, 0.96);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.bottom-nav a[aria-current="page"] {
  color: var(--brand);
  font-weight: 800;
}

.bottom-nav svg {
  width: 22px;
  height: 22px;
}

.dialog-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgba(13, 31, 28, 0.5);
  backdrop-filter: blur(4px);
  animation: fade-in 140ms ease both;
}

@keyframes fade-in { from { opacity: 0; } }

.dialog {
  width: min(100%, 480px);
  max-height: calc(100vh - 32px);
  margin: 0 auto;
  overflow: auto;
  padding: 22px;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
  animation: sheet-up 180ms ease both;
}

@keyframes sheet-up { from { transform: translateY(15px); } }

.dialog h2 {
  margin-bottom: 8px;
}

.dialog p {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

.toast-region {
  position: fixed;
  z-index: 200;
  top: calc(76px + env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  width: min(100%, 440px);
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: var(--shadow-md);
  color: white;
  font-size: 14px;
  animation: toast-in 180ms ease both;
}

.toast--error {
  background: #7c3532;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.teleprompter {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #090d0c;
  color: white;
}

.teleprompter__top,
.teleprompter__controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  background: rgba(9, 13, 12, 0.92);
}

.teleprompter__top {
  justify-content: space-between;
  border-bottom: 1px solid #26302e;
}

.teleprompter__top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teleprompter__top button,
.teleprompter__controls button {
  min-height: 42px;
  border: 1px solid #3b4845;
  border-radius: 10px;
  background: #19211f;
  color: white;
}

.teleprompter__top button {
  padding: 7px 12px;
}

.teleprompter__viewport {
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
}

.teleprompter__text {
  max-width: 920px;
  min-height: calc(100% + 65vh);
  margin: 0 auto;
  padding: 32vh 7vw 65vh;
  color: #f8faf9;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.8;
  letter-spacing: 0.035em;
  white-space: pre-wrap;
}

.teleprompter__text.is-mirrored {
  transform: scaleX(-1);
}

.teleprompter__controls {
  overflow-x: auto;
  padding-top: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid #26302e;
  scrollbar-width: none;
}

.teleprompter__controls::-webkit-scrollbar {
  display: none;
}

.teleprompter__controls label {
  display: grid;
  flex: 1 0 132px;
  gap: 3px;
  color: #bdc7c4;
  font-size: 11px;
}

.teleprompter__controls input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: #77b9a8;
}

.teleprompter__controls button {
  flex: 0 0 auto;
  padding: 7px 13px;
}

.teleprompter__controls .is-active {
  border-color: #77b9a8;
  background: #244c42;
}

.noscript {
  position: fixed;
  z-index: 999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
  text-align: center;
}

@media (min-width: 640px) {
  #app-main {
    padding-top: 34px;
  }

  .form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--full {
    grid-column: 1 / -1;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-backdrop {
    align-items: center;
  }

  .topic-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }

  .topic-card .button {
    align-self: center;
  }
}

@media (min-width: 840px) {
  .auth-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .auth-intro {
    min-height: 650px;
    padding: 48px;
  }

  .auth-logo {
    margin-bottom: 52px;
  }

  .auth-card {
    display: grid;
    align-content: center;
    padding: 48px;
  }

  .topbar {
    padding-right: max(28px, calc((100vw - var(--content)) / 2));
    padding-left: max(28px, calc((100vw - var(--content)) / 2));
  }

  .bottom-nav {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 22px;
    width: 76px;
    min-height: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    grid-template-columns: 1fr;
    transform: translateY(-50%);
  }

  #app-main {
    padding-bottom: 42px;
  }

  #app-header:not([hidden]) + #app-main {
    padding-left: 112px;
  }

  .script-toolbar {
    bottom: 18px;
  }
}

@media (min-width: 1100px) {
  .quick-card {
    min-height: 164px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
  }

  .quick-card__icon {
    grid-row: 1;
  }

  .quick-card > div:not(.quick-card__icon) {
    grid-column: 1 / -1;
  }

  .quick-card__arrow {
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
