:root {
  color-scheme: dark;
  --bg: #070b12;
  --surface: rgba(18, 25, 37, 0.94);
  --surface-strong: #121925;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f8fc;
  --accent: #56e39f;
  --accent-ink: #052217;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% -10%, rgba(55, 209, 143, 0.13), transparent 34rem),
    linear-gradient(180deg, #0a1019 0%, var(--bg) 68%);
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.app-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(86, 227, 159, 0.24);
  border-radius: 12px;
  background: rgba(86, 227, 159, 0.09);
  box-shadow: inset 0 0 18px rgba(86, 227, 159, 0.05);
}

.brand-mark i {
  width: 3px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(86, 227, 159, 0.6);
}
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 20px; }
.brand-mark i:nth-child(3) { height: 14px; }

.brand strong { display: block; white-space: nowrap; font-size: 15px; letter-spacing: -0.01em; }
.brand small { display: block; margin-top: 2px; color: #748096; font-size: 8px; font-weight: 700; letter-spacing: 0.2em; }

.capture-card {
  min-height: 0;
  flex: 0 0 auto;
  display: grid;
  grid-template-rows: auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #020405;
}

.preview-frame {
  --preview-aspect: 4 / 5;
  position: relative;
  width: 100%;
  aspect-ratio: var(--preview-aspect);
  overflow: hidden;
  isolation: isolate;
  background: #020405;
}

.preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 5, 9, 0.52) 0%, transparent 24%, transparent 48%, rgba(2, 5, 9, 0.84) 100%);
}

.preview-frame video { width: 100%; height: 100%; display: block; object-fit: contain; background: #020405; }
.preview-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.preview-frame:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; }
.preview-frame:-webkit-full-screen { width: 100%; height: 100%; aspect-ratio: auto; }

.top-overlay {
  position: absolute;
  z-index: 4;
  top: clamp(32px, 5%, 48px);
  left: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.recognition-details { margin-top: 10px; color: #b8c3d2; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }

.viewfinder { position: absolute; top: 2%; right: 5%; bottom: 5%; left: 5%; z-index: 3; pointer-events: none; opacity: 0.58; }
.viewfinder i { position: absolute; width: clamp(40px, 12vw, 56px); height: clamp(40px, 12vw, 56px); border-color: rgba(255, 255, 255, 0.7); border-style: solid; }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; border-radius: 6px 0 0; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; border-radius: 0 6px 0 0; }
.viewfinder i:nth-child(3) { bottom: 0; right: 0; border-width: 0 1px 1px 0; border-radius: 0 0 6px; }
.viewfinder i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; border-radius: 0 0 0 6px; }

.status-overlay {
  position: relative;
  z-index: 5;
  margin: 12px 16px 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(8, 13, 21, 0.78);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(10px) saturate(1.08);
}

.status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.status-kicker { display: inline-flex; align-items: center; gap: 7px; color: #a7b2c2; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.status-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(86, 227, 159, 0.8); animation: pulse 2s ease-in-out infinite; }
.status-hint { color: #798596; font-size: 10px; }

#status { color: #f2f6fb; font-size: 13px; font-weight: 600; line-height: 1.45; word-break: break-word; }
#status[data-tone="error"] { color: #ffaaaa; }
#status[data-tone="success"] { color: #9ff0c8; }

.diagnostics { margin-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.diagnostics summary { padding-top: 10px; display: flex; justify-content: space-between; color: #96a2b3; font-size: 11px; cursor: pointer; list-style: none; user-select: none; }
.diagnostics summary::-webkit-details-marker { display: none; }
.diagnostics summary span { color: #687587; }
.diagnostics[open] summary span { font-size: 0; }
.diagnostics[open] summary span::after { content: "收起"; font-size: 11px; }
.status-history summary strong { font-weight: 400; }
.status-history ol { margin: 10px 0 0; padding: 0; list-style: none; max-height: 240px; overflow-y: auto; }
.status-history li { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.status-history small { color: #96a2b3; font-size: 11px; font-variant-numeric: tabular-nums; }
.status-history p { margin: 4px 0 0; color: #dbe4ef; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

#liveStatus { max-height: 150px; padding-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: auto; color: #b8c3d2; font-size: 10px; line-height: 1.35; scrollbar-width: thin; }
#liveStatus div { min-width: 0; padding: 7px 8px; overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, 0.045); text-overflow: ellipsis; white-space: nowrap; }
#liveStatus strong { color: #738095; font-weight: 500; }

.panel { padding: 16px; display: grid; grid-template-columns: 1fr; background: linear-gradient(180deg, rgba(20, 28, 40, 0.98), #111823); border-top: 1px solid var(--line); }

button { position: relative; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 0; border-radius: 12px; font-weight: 750; cursor: pointer; transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease; }
button:active:not(:disabled) { transform: scale(0.98); }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: 0.58; }

.control-icon-button { min-height: 56px; }
.control-icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.connection-action[data-action="connect"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(50, 213, 140, 0.17); }
.connection-action[data-action="connect"]:hover { background: #6aebac; box-shadow: 0 10px 28px rgba(50, 213, 140, 0.24); }
.connection-action[data-action="disconnect"] { border: 1px solid rgba(255, 112, 112, 0.42); background: rgba(255, 91, 91, 0.1); color: #ffb2b2; }
.connection-action[data-action="disconnect"]:hover { background: rgba(255, 91, 91, 0.18); }
.connection-action .disconnect-icon { display: none; }
.connection-action[data-action="disconnect"] .connect-icon { display: none; }
.connection-action[data-action="disconnect"] .disconnect-icon { display: block; }
.recording-action { border: 1px solid rgba(255, 112, 112, 0.32); background: rgba(255, 91, 91, 0.08); color: #ffb2b2; }
.recording-action:hover { background: rgba(255, 91, 91, 0.16); }
.recording-action .record-icon { fill: none; stroke: currentColor; }
.recording-action .record-icon .record-ring { fill: none; stroke: currentColor; stroke-width: 1.8; }
.recording-action .record-icon .record-dot { fill: #ff5454; stroke: none; }
.recording-action .stop-record-icon { display: none; }
.recording-action .stop-record-icon { fill: currentColor; stroke: none; }
.recording-action[data-phase="waiting"], .recording-action[data-phase="paused"] { color: #ffd166; background: rgba(255, 209, 102, 0.16); border-color: #ffd166; box-shadow: 0 0 10px rgba(255, 209, 102, 0.15); }
.recording-action[data-phase="waiting"] .record-dot { fill: #ffd166; }
.recording-action[data-phase="saving"] { color: #8ddcff; background: rgba(141, 220, 255, 0.15); border-color: #8ddcff; }
.recording-action[data-phase="recording"] { border-color: rgba(255, 91, 91, 0.72); background: rgba(255, 91, 91, 0.2); color: #fff; box-shadow: 0 0 0 1px rgba(255, 91, 91, 0.12), 0 8px 24px rgba(255, 50, 50, 0.18); }
.recording-action[data-phase="recording"]::after { content: ""; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: #ff4f4f; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82), 0 0 8px rgba(255, 79, 79, 0.9); animation: pulse 1.2s ease-in-out infinite; }
.recording-action[data-action="stop"] .record-icon { display: none; }
.recording-action[data-action="stop"] .stop-record-icon { width: 18px; height: 18px; display: block; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.preview-frame .header-actions.fullscreen-controls { position: absolute; z-index: 7; bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); left: 50%; gap: 6px; padding: 6px; transform: translateX(-50%); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 9px; background: rgba(8, 13, 21, 0.78); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36); backdrop-filter: blur(12px); }
.header-icon-button { width: 34px; min-height: 34px; padding: 0; border: 1px solid rgba(86, 227, 159, 0.3); border-radius: 9px; background: linear-gradient(180deg, rgba(86, 227, 159, 0.14), rgba(86, 227, 159, 0.06)); color: #d9f8e9; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.08); transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease; }
.header-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-icon-button .fullscreen-exit-icon { display: none; }
.header-icon-button#toggleFullscreen[data-active="true"] .fullscreen-enter-icon { display: none; }
.header-icon-button#toggleFullscreen[data-active="true"] .fullscreen-exit-icon { display: block; }
.header-icon-button .rotate-icon { transform: rotate(var(--rotation-angle, 0deg)); transition: transform 180ms ease; }
.header-icon-button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(86, 227, 159, 0.65); background: rgba(86, 227, 159, 0.2); color: #fff; box-shadow: 0 6px 16px rgba(18, 108, 72, 0.28), inset 0 1px rgba(255, 255, 255, 0.12); }
.header-icon-button:active:not(:disabled) { transform: translateY(0) scale(0.94); }
.header-icon-button.recording-action[data-action="record"] svg { width: 20px; height: 20px; }
.header-icon-button#switchCamera::after { content: "后"; position: absolute; top: -4px; right: -4px; min-width: 11px; height: 11px; padding: 0 1px; display: grid; place-items: center; border-radius: 5px; background: #657284; color: #fff; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82); font-size: 7px; font-weight: 800; line-height: 1; }
.header-icon-button#switchCamera[data-facing="user"] { border-color: rgba(91, 174, 255, 0.82); background: linear-gradient(180deg, rgba(91, 174, 255, 0.3), rgba(42, 106, 176, 0.2)); color: #fff; box-shadow: 0 0 0 1px rgba(91, 174, 255, 0.12), 0 6px 18px rgba(34, 92, 153, 0.3), inset 0 1px rgba(255, 255, 255, 0.14); }
.header-icon-button#switchCamera[data-facing="user"]::after { content: "前"; background: #5baeff; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82), 0 0 8px rgba(91, 174, 255, 0.85); }
.header-icon-button#switchCamera[data-applying="true"]::after { content: ""; min-width: 7px; width: 7px; height: 7px; padding: 0; border-radius: 50%; background: #ffc857; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82), 0 0 8px rgba(255, 200, 87, 0.9); animation: pulse 700ms ease-in-out infinite; }
.header-icon-button#rotateCamera::after { content: attr(data-rotation) "°"; position: absolute; top: -4px; right: -4px; min-width: 12px; height: 10px; padding: 0 1px; display: grid; place-items: center; border-radius: 5px; background: #657284; color: #fff; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82); font-size: 6px; font-weight: 800; line-height: 1; }
.header-icon-button#rotateCamera[data-active="true"] { border-color: rgba(184, 139, 255, 0.86); background: linear-gradient(180deg, rgba(184, 139, 255, 0.32), rgba(112, 69, 180, 0.2)); color: #fff; box-shadow: 0 0 0 1px rgba(184, 139, 255, 0.12), 0 6px 18px rgba(91, 55, 151, 0.3), inset 0 1px rgba(255, 255, 255, 0.14); }
.header-icon-button#rotateCamera[data-active="true"]::after { background: #b88bff; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82), 0 0 8px rgba(184, 139, 255, 0.85); }
.header-icon-button#flipCamera::after { content: ""; position: absolute; top: -3px; right: -3px; width: 6px; height: 6px; border-radius: 50%; background: #657284; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82); transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.header-icon-button#flipCamera[data-active="true"] { border-color: rgba(86, 227, 159, 0.9); background: linear-gradient(180deg, rgba(86, 227, 159, 0.38), rgba(32, 167, 108, 0.24)); color: #fff; box-shadow: 0 0 0 1px rgba(86, 227, 159, 0.15), 0 6px 18px rgba(18, 108, 72, 0.34), inset 0 1px rgba(255, 255, 255, 0.16); }
.header-icon-button#flipCamera[data-active="true"]::after { background: #56e39f; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82), 0 0 8px rgba(86, 227, 159, 0.9); transform: scale(1.12); }
.header-icon-button#flipCamera[data-applying="true"]::after { background: #ffc857; box-shadow: 0 0 0 2px rgba(7, 11, 18, 0.82), 0 0 8px rgba(255, 200, 87, 0.9); animation: pulse 700ms ease-in-out infinite; }

.wechat-recording-sheet { position: fixed; top: max(76px, calc(env(safe-area-inset-top) + 14px)); right: 12px; left: 12px; z-index: 100; display: flex; justify-content: flex-end; pointer-events: none; }
.wechat-recording-sheet[hidden] { display: none; }
.wechat-recording-panel { position: relative; width: min(100%, 320px); min-height: 64px; padding: 11px 10px 11px 12px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 32px; align-items: center; gap: 10px; pointer-events: auto; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; background: rgba(17, 24, 35, 0.96); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42); backdrop-filter: blur(12px); animation: wechat-tip-in 180ms ease-out; }
.wechat-recording-pointer { position: absolute; top: -70px; right: -4px; width: 34px; height: 66px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 3px 8px rgba(86, 227, 159, 0.35)); animation: wechat-pointer 1.4s ease-in-out infinite; }
.wechat-recording-menu { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 50%; background: rgba(86, 227, 159, 0.13); color: var(--accent); }
.wechat-recording-menu i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.wechat-recording-panel p { min-width: 0; margin: 0; color: #c7d0dc; font-size: 13px; line-height: 1.45; }
.wechat-recording-panel p strong { color: #fff; font-weight: 700; }
.wechat-recording-panel p .wechat-recording-warning { color: #ffd166; font-size: 14px; text-shadow: 0 0 12px rgba(255, 209, 102, 0.22); }
.wechat-recording-close { width: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #9aa6b6; }
.wechat-recording-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.wechat-recording-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@keyframes wechat-tip-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wechat-pointer { 0%, 100% { transform: translateY(2px); opacity: 0.72; } 50% { transform: translateY(-3px); opacity: 1; } }

@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.76); } }

@media (max-width: 420px) {
  .app-shell { padding-top: max(10px, env(safe-area-inset-top)); padding-left: 10px; padding-right: 10px; }
  .app-header { padding: 0 5px; margin-bottom: 8px; gap: 12px; }
  .app-header > .header-actions { display: grid; grid-template-columns: repeat(5, 34px); column-gap: 6px; row-gap: 8px; flex-shrink: 0; }
  .app-header > .header-actions > :nth-child(6) { grid-row: 2; grid-column: 5; }
  .app-header > .header-actions > :nth-child(7) { grid-row: 2; grid-column: 4; }
  .app-header > .header-actions > :nth-child(8) { grid-row: 2; grid-column: 3; }
  .app-header > .header-actions > :nth-child(9) { grid-row: 2; grid-column: 2; }
  .app-header > .header-actions > :nth-child(10) { grid-row: 2; grid-column: 1; }
  .capture-card { border-radius: 20px; }
  .panel { padding: 13px; }
  .status-overlay { margin: 10px 12px 12px; }
}

@media (max-width: 389px) {
  .app-header { gap: 8px; }
  .app-header > .header-actions { grid-template-columns: repeat(5, 30px); column-gap: 4px; }
  .app-header > .header-actions .header-icon-button { width: 30px; min-height: 30px; }
}

@media (max-height: 700px) {
  .app-header { min-height: 40px; margin-bottom: 8px; }
  .brand-mark { width: 34px; height: 34px; }
}

@media (min-width: 760px) {
  .app-shell { padding-top: 30px; padding-bottom: 24px; }
}

@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; }
}

.help-button { color: #a7b2c2; margin-top: 8px; font-size: 13px; min-height: 40px; background: transparent; }
.help-button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.recording-status-home { display: flex; justify-content: flex-end; }
.recording-status { gap: 6px; color: #c6d0de; display: flex; font-size: 11px; line-height: 20px; align-items: center; white-space: nowrap; margin: -6px 2px 10px; }
.recording-status i { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #a7b2c2; }
.recording-status[data-phase="recording"] i { background: #ff6262; }
.recording-status[data-phase="waiting"] i, .recording-status[data-phase="paused"] i { background: #ffd166; }
.recording-status[data-warning="true"] i { background: #ffd166; }
#recordingAudio { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#recordingAudio[data-warning="true"] { color: #ffd166; }
.recording-status { max-width: 100%; }
.recording-timer { flex-shrink: 0; }
.recording-timer { color: #f5f8fc; font-variant-numeric: tabular-nums; }
.fullscreen-controls .recording-status { margin: 0; right: 0; padding: 3px 8px; position: absolute; border-radius: 6px; bottom: calc(100% + 6px); background: rgba(8, 13, 21, 0.8); }
.help-notice { color: #ffe4a1; font-size: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(66, 46, 8, 0.94); }
.recording-status[hidden], .help-notice[hidden], .onboarding[hidden] { display: none; }
.onboarding { inset: 0; z-index: 200; position: fixed; overflow: hidden; isolation: isolate; }
.onboarding-spotlight { position: fixed; border-radius: 12px; pointer-events: none; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78); }
.onboarding-card { margin: 0; z-index: 1; padding: 18px; display: flex; position: fixed; overflow: hidden; border-radius: 16px; background: #121e2d; flex-direction: column; border: 1px solid rgba(86, 227, 159, 0.45); box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55); }
.onboarding-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.onboarding-heading { gap: 12px; display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; }
.onboarding-progress { font-size: 12px; color: var(--accent); }
.onboarding-skip { color: #b7c3d2; padding: 0 10px; font-size: 13px; min-height: 36px; background: transparent; }
.onboarding-card h2 { font-size: 20px; line-height: 1.4; margin: 8px 0 12px; }
.onboarding-card h2:focus { outline: none; }
.onboarding-card p { font-size: 14px; margin: 0 0 14px; line-height: 1.7; overflow-wrap: anywhere; }
.onboarding-limit { padding: 12px; color: #cfdae8; border-radius: 8px; background: rgba(255, 255, 255, 0.055); }
.onboarding-actions { gap: 10px; display: flex; flex-shrink: 0; padding-top: 8px; justify-content: flex-end; }
.onboarding-previous { color: #dce4ee; background: #26354a; }
.onboarding-next { color: var(--accent-ink); background: var(--accent); }
.onboarding-previous:disabled { cursor: default; }

@media (max-width: 359px) {
  .app-header { padding-left: 0; padding-right: 0; }
  .app-header .brand { gap: 8px; }
  .app-header .brand-mark { width: 32px; height: 32px; }
  .app-header .brand small { font-size: 7px; letter-spacing: .12em; }
  .app-header > .header-actions { grid-template-columns: repeat(5, 28px); }
  .app-header > .header-actions .header-icon-button { width: 28px; min-height: 28px; }
  .onboarding-card { padding: 14px; }
}

@media (max-width: 420px) {
  .recording-status-home .recording-status { min-width: 0; margin: 0 2px 8px; gap: 6px; line-height: 20px; }
  .recording-status-home #recordingAudio { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Recording results appear only in the dialog, including in fullscreen. */
.dance-choice[hidden], .dance-choice [hidden], #recordingResults[hidden] { display: none !important; }
.dance-choice { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: #000b; }
.dance-choice > div { width: min(100%, 420px); max-height: 85dvh; overflow: auto; padding: 24px; border-radius: 18px; background: #142237; color: #fff; }
.dance-choice button { display: block; width: 100%; min-height: 40px; font-size: 13px; margin-top: 12px; color: #fff; padding: 8px 12px; background: #235a91; border: 0; border-radius: 10px; cursor: pointer; }
.dance-choice button:disabled { opacity: .5; cursor: default; }
.dance-choice p { overflow-wrap: anywhere; }
.dance-choice progress, .dance-choice select { width: 100%; }
.dance-choice select { padding: 10px; color: #fff; background: #142237; border: 1px solid #567; border-radius: 8px; }
.dance-choice img { display: block; width: 192px; height: 192px; background: white; margin: 12px auto; }
.dance-choice a { display: inline-block; color: #8ddcff; padding: 8px 0; }
.recording-result-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#webDanceUploadChoice > .recording-result-card { width: min(100%, 440px); padding: 24px; border: 1px solid #ffffff1c; background: linear-gradient(145deg, #172c32, #111c29 65%); box-shadow: 0 24px 80px #0009, inset 0 1px #ffffff06; border-radius: 22px; }
.recording-result-heading { display: flex; align-items: center; gap: 12px; }
.recording-result-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border: 1px solid #62dab52b; border-radius: 14px; background: #62dab510; color: #78e2bd; }
.recording-result-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.recording-result-eyebrow { color: #8baaa9; font-size: 11px; letter-spacing: .12em; }
.recording-result-card h2 { margin: 4px 0 0; font-size: 22px; line-height: 1.35; }
.recording-result-card p { margin: 0; line-height: 1.7; font-size: 14px; }
#webDanceUploadMessage { margin: 18px 0; color: #cad8de; }
#recordingCurrentStatus { margin-top: 18px; padding: 12px 14px; border: 1px solid #78e2bd24; border-radius: 12px; background: #78e2bd0a; color: #9ee8c9; font-size: 13px; }
#recordingResultIdentity { color: #a8b9c6; font-size: 12px; padding-bottom: 10px; border-bottom: 1px solid #ffffff10; }
.recording-result-details { display: grid; gap: 12px; padding: 16px; border: 1px solid #ffffff0e; border-radius: 14px; background: #050c143b; }
#recordingResultSelect { min-height: 40px; padding: 9px 12px; font-size: 13px; border-color: #ffffff26; border-radius: 9px; background: #1a2a36; }
#recordingResultSelect:focus-visible { outline: 2px solid #78e2bd; outline-offset: 2px; }
#recordingResultText { color: #a9b9c8; font-size: 13px; }
#recordingResultReason { color: #f2c784; font-size: 13px; }
#recordingResultWork { color: #9ee8c9; font-size: 13px; overflow-wrap: anywhere; }
#recordingResultWork:empty { display: none; }
.recording-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #ffffff10; }
#webDanceUploadChoice .recording-result-actions button { width: auto; margin: 0; min-height: 40px; font-size: 13px; }
#webDanceUploadChoice #webDanceUploadConfirm { color: #08241d; background: #6be0b4; font-weight: 600; }
#webDanceUploadChoice #webDanceUploadClose { color: #cfdae4; background: #ffffff09; border: 1px solid #ffffff1c; }
#webDanceUploadChoice .recording-result-actions button:focus-visible, #currentDanceSessionLink:focus-visible { outline: 2px solid #78e2bd; outline-offset: 3px; }
#webDanceUploadChoice #webDanceUploadConfirm:not(:disabled):hover { background: #91edca; }
#webDanceUploadChoice #webDanceUploadClose:hover { background: #ffffff12; }
#recordingResultProgress { accent-color: #6be0b4; height: 6px; border: 0; border-radius: 4px; overflow: hidden; }
#recordingResultQr { width: min(100%, 192px); height: auto; aspect-ratio: 1; margin: 0 auto; border: 8px solid white; border-radius: 10px; }
@media (max-width: 359px) {
  #webDanceUploadChoice > .recording-result-card { padding: 20px; }
}

#currentDanceSessionReason { color: #8fa4b4; font-size: 12px; margin-top: 16px; }
#recordingResultQrHint { color: #a8b9c6; font-size: 12px; text-align: center; }
#currentDanceSessionLink { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border: 1px solid #78e2bd24; border-radius: 12px; color: #9ee8c9; background: #78e2bd08; font-size: 14px; font-weight: 600; text-decoration: none; }
#currentDanceSessionLink:hover { background: #78e2bd14; border-color: #78e2bd55; }
#currentDanceSessionLink svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
