:root {
  color-scheme: dark;
  --bg: #070b16;
  --surface: #0f1629;
  --surface-2: #151f36;
  --text: #f3f6ff;
  --muted: #9da9c2;
  --border: rgba(255,255,255,.10);
  --accent: #7c5cff;
  --accent-2: #5d3ef2;
  --danger: #ef476f;
  --success: #42d392;
  --shadow: 0 24px 70px rgba(0,0,0,.30);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #eef2fa;
  --text: #12182a;
  --muted: #616c82;
  --border: rgba(16,24,40,.12);
  --accent: #6547ed;
  --accent-2: #4e32d4;
  --shadow: 0 24px 70px rgba(48,56,89,.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 50% 0%, rgba(124,92,255,.17), transparent 34rem), var(--bg);
  color: var(--text);
}
button, select, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { color: var(--text); text-decoration: none; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--danger); font-size: 1.4rem; filter: drop-shadow(0 0 8px rgba(239,71,111,.65)); }
.icon-button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.hero { max-width: 790px; text-align: center; margin: 64px auto 42px; }
.eyebrow, .label { color: #9f8cff; font-size: .76rem; font-weight: 800; letter-spacing: .13em; margin: 0 0 10px; }
.hero h1 { font-size: clamp(2.45rem, 7vw, 5rem); line-height: .98; letter-spacing: -.055em; margin: 0; }
.hero p { color: var(--muted); font-size: 1.08rem; line-height: 1.7; margin: 24px auto 0; max-width: 680px; }
.recorder-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 22px; align-items: start; }
.panel { background: color-mix(in srgb, var(--surface) 95%, transparent); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.preview-panel, .settings-panel, .result-panel, .info-panel { padding: 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading.compact { margin-bottom: 8px; }
.panel-heading h2 { margin: 0; font-size: 1.2rem; }
.recording-badge { display: flex; gap: 7px; align-items: center; color: #ff6b8b; font-weight: 800; font-size: .82rem; }
.recording-badge span { width: 9px; height: 9px; background: currentColor; border-radius: 50%; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.preview-stage { position: relative; min-height: 410px; overflow: hidden; display: grid; place-items: center; border-radius: 16px; background: #02040a; border: 1px solid var(--border); }
.preview-stage video { width: 100%; height: 100%; max-height: 560px; object-fit: contain; background: #000; }
.empty-state { text-align: center; color: var(--muted); padding: 30px; }
.empty-state h3 { color: #dce3f4; margin: 18px 0 6px; }
html[data-theme="light"] .empty-state h3 { color: var(--text); }
.empty-state p { margin: 0; }
.screen-icon { width: 82px; height: 54px; border: 3px solid #58647d; border-radius: 8px; margin: auto; position: relative; }
.screen-icon::after { content: ""; position: absolute; width: 28px; height: 3px; background: #58647d; left: 24px; bottom: -12px; border-radius: 4px; box-shadow: 0 6px 0 -1px #58647d; }
.screen-icon span { position: absolute; inset: 9px; border-radius: 4px; background: linear-gradient(135deg, rgba(124,92,255,.4), rgba(93,62,242,.05)); }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.68); font-size: clamp(5rem, 15vw, 10rem); font-weight: 900; color: white; z-index: 4; }
.status-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); margin-top: 16px; font-variant-numeric: tabular-nums; }
.status-row > div { display: flex; align-items: center; gap: 9px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #6d778c; }
.status-dot.active { background: var(--danger); box-shadow: 0 0 0 5px rgba(239,71,111,.13); }
.setting-group { border-top: 1px solid var(--border); margin-top: 18px; }
.switch-row { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { color: var(--muted); line-height: 1.45; margin-top: 4px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 48px; height: 28px; border-radius: 99px; background: #394157; padding: 3px; transition: .2s ease; }
.switch::after { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s ease; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.field { margin-top: 18px; }
.field label { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 8px; }
select { width: 100%; padding: 12px 13px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: var(--surface-2); outline: none; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.15); }
.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.button-stack { margin-top: 24px; display: grid; gap: 10px; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 13px 18px; border: 0; text-decoration: none; font-weight: 800; cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 24px rgba(93,62,242,.22); }
.button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.button.danger { background: rgba(239,71,111,.12); color: #ff7292; border: 1px solid rgba(239,71,111,.25); }
.compatibility-note { min-height: 20px; margin: 16px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.result-panel { margin-top: 22px; }
.result-panel video { display: block; width: 100%; max-height: 560px; background: #000; border-radius: 14px; }
.text-button { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 700; }
.result-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; }
.result-actions strong, .result-actions span { display: block; }
.result-actions span { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 72px 0 22px; }
.feature-grid article { padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.025); }
.feature-grid article > span { font-size: 1.55rem; }
.feature-grid h3 { margin: 13px 0 7px; }
.feature-grid p, .info-panel li { color: var(--muted); line-height: 1.6; }
.info-panel { margin-bottom: 70px; }
.info-panel h2 { margin-top: 0; }
.info-panel ol { padding-left: 22px; }
.notice { margin-top: 20px; padding: 16px; border-radius: 12px; background: rgba(124,92,255,.09); border: 1px solid rgba(124,92,255,.18); color: var(--muted); line-height: 1.55; }
.notice strong { color: var(--text); }
footer { border-top: 1px solid var(--border); color: var(--muted); text-align: center; padding: 30px 16px; font-size: .88rem; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .recorder-grid { grid-template-columns: 1fr; }
  .preview-stage { min-height: 320px; }
}
@media (max-width: 650px) {
  .hero { margin-top: 36px; }
  .hero h1 { font-size: 2.7rem; }
  .feature-grid { grid-template-columns: 1fr; margin-top: 44px; }
  .two-column-fields { grid-template-columns: 1fr; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .result-actions .button { width: 100%; }
  .preview-panel, .settings-panel, .result-panel, .info-panel { padding: 16px; }
  .preview-stage { min-height: 245px; }
}
