:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --bg-2: #e9f0ff;
  --ink: #151515;
  --muted: rgba(21, 21, 21, 0.52);
  --soft: rgba(255, 255, 255, 0.58);
  --soft-strong: rgba(255, 255, 255, 0.78);
  --line: rgba(21, 21, 21, 0.10);
  --line-strong: rgba(21, 21, 21, 0.18);
  --accent: #111111;
  --shadow: 0 24px 80px rgba(40, 35, 25, 0.14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.95), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(186,207,255,0.58), transparent 28%),
    linear-gradient(145deg, var(--bg), #f4e6d1 54%, var(--bg-2));
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px; }
.card, .setup-card { width: min(100%, 460px); }
.glass-card {
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 30px;
  background: linear-gradient(150deg, rgba(255,255,255,0.72), rgba(255,255,255,0.38));
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.18);
}
.brand { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.kicker { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.title { margin: 0; font-size: clamp(38px, 9vw, 62px); line-height: 0.92; letter-spacing: -0.075em; }
.subtle { margin: 0; max-width: 31ch; color: var(--muted); font-size: 15px; line-height: 1.45; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 18px; margin-top: 18px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 14px 28px rgba(0,0,0,0.16); }
.slim-link { margin-top: 16px; font-size: 13px; color: var(--muted); }

.setup-shell { align-items: center; }
.setup-card { display: flex; flex-direction: column; gap: 14px; }
.setup-title { margin: 0; font-size: clamp(36px, 10vw, 56px); line-height: 0.95; letter-spacing: -0.075em; }
.setup-copy { margin-bottom: 4px; }
.setup-gap { margin-top: 8px; }
.language-stack { display: grid; gap: 10px; margin-top: 6px; }
.language-row {
  width: 100%; min-height: 76px; display: flex; align-items: center; justify-content: space-between; text-align: left;
  padding: 15px 16px; border-radius: 22px; border: 1px solid rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.50); color: var(--ink); box-shadow: inset 0 1px rgba(255,255,255,0.85);
}
.row-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.language-row strong { font-size: 22px; letter-spacing: -0.04em; }
.chevron { font-size: 32px; line-height: 1; color: rgba(21,21,21,0.32); transform: rotate(90deg); }
.scene-strip { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.scene-strip::-webkit-scrollbar { display: none; }
.scene-chip { flex: 0 0 auto; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.38); color: var(--ink); }
.scene-chip.active { background: #111; border-color: #111; color: #fff; }
.scene-input { min-height: 48px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.44); color: var(--ink); padding: 0 15px; outline: none; }
.scene-input:focus { border-color: var(--line-strong); background: rgba(255,255,255,0.66); }
.compact-cta { align-self: stretch; text-align: center; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(20,20,20,0.14); opacity: 0; backdrop-filter: blur(2px); }
.language-sheet {
  position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30; max-height: min(78vh, 680px); display: flex; flex-direction: column; gap: 14px;
  padding: 10px 14px 14px; border-radius: 30px; background: rgba(250,250,250,0.88); border: 1px solid rgba(255,255,255,0.86);
  box-shadow: 0 28px 90px rgba(0,0,0,0.22); backdrop-filter: blur(28px) saturate(1.2);
}
.sheet-handle { width: 44px; height: 5px; border-radius: 999px; background: rgba(0,0,0,0.16); align-self: center; margin: 3px 0 1px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 3px 0 0; font-size: 26px; letter-spacing: -0.055em; }
.sheet-close { width: 40px; height: 40px; border: 0; border-radius: 999px; background: rgba(0,0,0,0.06); color: var(--ink); font-size: 25px; }
.search-wrap { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.search-wrap input { width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; outline: none; background: rgba(255,255,255,0.72); color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 500; }
.language-list { min-height: 180px; overflow: auto; display: grid; gap: 7px; padding-right: 2px; }
.language-option { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px 0 15px; border-radius: 15px; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: left; }
.language-option small { color: var(--muted); font-size: 11px; font-weight: 800; }
.language-option.selected { background: rgba(17,17,17,0.92); color: #fff; }
.language-option.selected small { color: rgba(255,255,255,0.62); }
.empty-state { padding: 18px; color: var(--muted); text-align: center; }
.sheet-done { margin-top: 0; width: 100%; }

.translate-shell { min-height: 100vh; display: flex; flex-direction: column; padding: 14px; gap: 10px; }
.translate-topbar { height: 42px; display: flex; justify-content: space-between; align-items: center; }
.back { font-size: 14px; color: var(--muted); font-weight: 700; }
.mode-pill { max-width: 68vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 34px; display: flex; align-items: center; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,0.48); border: 1px solid rgba(255,255,255,0.56); color: rgba(21,21,21,0.62); font-size: 13px; font-weight: 700; }
.translate-board { position: relative; flex: 1; display: grid; grid-template-rows: 1fr auto 1fr; min-height: 0; border-radius: 28px; overflow: hidden; background: rgba(255,255,255,0.34); border: 1px solid rgba(255,255,255,0.60); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(1.15); }
.translation-panel { min-height: 0; display: flex; flex-direction: column; padding: 20px; }
.original-panel { justify-content: flex-end; }
.translated-panel { justify-content: flex-start; }
.panel-label { margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.stage-text { max-height: 100%; overflow: auto; font-size: clamp(26px, 8vw, 54px); line-height: 1.03; letter-spacing: -0.07em; font-weight: 720; }
.translated-panel .stage-text { color: rgba(21,21,21,0.66); }
.horizontal-divider { position: relative; height: 1px; display: flex; align-items: center; justify-content: flex-end; margin: 0 20px; }
.horizontal-divider span { position: absolute; left: 0; right: 0; height: 1px; background: rgba(21,21,21,0.16); }
.canvas-control { position: relative; z-index: 1; min-width: 82px; height: 42px; margin-right: 0; border-radius: 999px; border: 1px solid rgba(255,255,255,0.72); background: #111; color: #fff; font-weight: 800; box-shadow: 0 13px 34px rgba(0,0,0,0.20); }
.canvas-control.recording { background: #ff3b30; }
.translate-footer { display: flex; align-items: center; justify-content: space-between; min-height: 38px; }
.ghost-btn { min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.36); color: var(--ink); padding: 0 13px; font-weight: 700; }
.status { font-size: 12px; color: var(--muted); font-weight: 700; }
.tiny-status { min-height: 18px; display: flex; align-items: center; }

@media (min-width: 760px) {
  .translate-shell { max-width: 760px; margin: 0 auto; padding: 20px; }
  .translation-panel { padding: 30px; }
  .horizontal-divider { margin: 0 30px; }
}
