:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #390440; background: #F6F5F8; color-scheme: light; font-synthesis: none;
  --ink: #390440; --purple: #8D03FC; --lime: #D0FC0A; --paper: #FFF;
  --muted: #706478; --line: #DED8E5; --red: #A72B3E; --soft: #F2E9FF;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { max-width: 1040px; margin: auto; padding: 0 36px calc(112px + env(safe-area-inset-bottom)); }
.header { height: 80px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.brand img { image-rendering: pixelated; flex-shrink: 0; }
.connection { font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.connection::before { content: ""; width: 6px; height: 6px; background: #A15D12; }
.navigation { display: flex; gap: 5px; justify-content: center; position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 5; background: var(--paper); border: 1px solid var(--line); padding: 7px; box-shadow: 4px 4px 0 #DFD7E7; max-width: calc(100% - 32px); }
.nav-button { min-height: 44px; padding: 11px 23px; border: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.nav-button:hover { background: #F3EFF7; color: var(--ink); }
.nav-button.selected { color: var(--ink); background: var(--lime); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
main { padding-top: 28px; }
h1 { font-size: 25px; letter-spacing: -.6px; font-weight: 650; margin: 0; }
h2 { font-size: 20px; letter-spacing: -.3px; margin: 0 0 16px; }
h3 { font-size: 15px; margin: 0 0 10px; }
.record-page { text-align: center; }
.record-page h1 { font-size: 22px; font-weight: 600; margin: 5px 0 24px; }
.record-panel { position: relative; padding: 32px 20px 27px; max-width: 400px; margin: auto; background: var(--paper); border: 1px solid var(--line); }
.record-panel::before { content: ""; position: absolute; width: 10px; height: 10px; top: -1px; right: -1px; background: var(--lime); box-shadow: -10px 0 0 var(--lime), 0 10px 0 var(--lime); }
.record-panel:has(.orb:focus-visible) { outline: 3px solid var(--purple); outline-offset: 5px; }
.orb { display: grid; place-items: center; position: relative; margin: auto; width: 132px; height: 132px; border: 0; padding: 0; background: var(--ink); color: var(--lime); clip-path: polygon(0 16px,16px 16px,16px 0,calc(100% - 16px) 0,calc(100% - 16px) 16px,100% 16px,100% calc(100% - 16px),calc(100% - 16px) calc(100% - 16px),calc(100% - 16px) 100%,16px 100%,16px calc(100% - 16px),0 calc(100% - 16px)); }
.orb::before { content: ""; position: absolute; inset: 3px; background: var(--purple); clip-path: inherit; }
.orb:hover::before { background: #7900DB; }
.orb:active { transform: translate(2px, 2px); }
.orb svg { position: relative; width: 44px; height: 44px; fill: currentColor; shape-rendering: crispEdges; }
.orb.recording::before { background: #FB5B57; }
.square { position: relative; width: 28px; height: 28px; background: var(--ink); }
.timer { font-size: 32px; font-weight: 550; letter-spacing: 1px; font-variant-numeric: tabular-nums; margin: 25px 0 8px; }
.record-label { font-weight: 600; font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.6; }
.record-panel > .hint { margin-top: 7px; font-size: 12px; }
.cancel { display: block; min-height: 44px; margin: 14px auto 0; border: 0; background: none; color: var(--red); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.footer-note { font-size: 12px; color: var(--muted); max-width: 400px; margin: 16px auto; line-height: 1.6; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.button { background: var(--purple); color: white; border: 2px solid var(--ink); border-radius: 0; min-height: 44px; padding: 10px 16px; font-size: 14px; font-weight: 550; line-height: 1.4; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; box-shadow: 2px 2px 0 var(--ink); }
.button:hover:not(:disabled) { background: #7900DB; }
.button:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.button.secondary { background: var(--paper); color: var(--ink); border-color: #B3A5BC; box-shadow: 2px 2px 0 #E2D9EB; }
.button.secondary:hover:not(:disabled) { background: var(--soft); }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); padding-left: 0; box-shadow: none; }
.button.quiet:hover:not(:disabled) { background: transparent; color: var(--ink); text-decoration: underline; }
.button.danger { color: var(--red); background: var(--paper); border-color: var(--red); box-shadow: 2px 2px 0 #EED8DE; }
.button.danger:hover:not(:disabled) { background: #FFF0F1; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); padding: 24px; margin-bottom: 18px; overflow-wrap: anywhere; }
.card p { line-height: 1.65; }
.card .hint { margin: 8px 0; }
.idea-row { display: block; width: 100%; text-align: left; color: var(--ink); cursor: pointer; }
.idea-row:hover { border-color: var(--purple); box-shadow: 3px 3px 0 #E4D8EE; }
.meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pill { font-size: 11px; padding: 5px 9px; background: #EAF5BF; color: #3E491A; }
.pill.error { background: #FFF0F1; color: var(--red); }
.idea-row h2 { font-size: 19px; line-height: 1.4; margin: 0 0 9px; }
.idea-row p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.2px; font-size: 11px; font-weight: 650; color: var(--muted); margin: 0 0 16px; }
.hero-card { border-left: 4px solid var(--purple); }
.hypothesis { font-size: 19px; line-height: 1.65 !important; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid .card { margin: 0; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.score { padding: 16px; background: var(--paper); border-top: 3px solid #D9C0EE; overflow-wrap: anywhere; }
.score strong { display: block; font-size: 25px; font-weight: 650; margin: 8px 0; }
.score span { font-size: 12px; color: var(--muted); }
.score p { font-size: 12px; margin: 0; line-height: 1.6; }
.prose { white-space: pre-wrap; line-height: 1.7; font-size: 15px; }
.transcript-disclosure { margin: 20px 0; }
.transcript-disclosure > summary { min-height: 44px; padding: 12px 0; }
.transcript { background: #FCFAFE; }
.card details { margin: 10px 0; }
summary { cursor: pointer; font-size: 14px; font-weight: 550; min-height: 32px; line-height: 1.6; }
.card li { font-size: 14px; line-height: 1.7; margin: 8px 0; }
.form-field { display: block; margin: 18px 0; }
.form-field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
input, textarea, select { border: 1px solid #A69AAD; border-bottom-width: 2px; background: #FCFBFD; color: var(--ink); border-radius: 0; padding: 12px; width: 100%; min-height: 44px; font-size: 16px; }
input:focus, textarea:focus, select:focus { border-color: var(--purple); background: var(--paper); }
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
input.code { text-transform: uppercase; letter-spacing: 2px; font-size: 19px; text-align: center; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--purple); flex-shrink: 0; }
.switch-label { display: flex; align-items: center; gap: 12px; line-height: 1.6; font-size: 14px; min-height: 44px; cursor: pointer; }
.settings { max-width: 680px; margin: 20px auto 0; }
.login { max-width: 420px; margin: 24px auto; }
.login h1 { font-size: 26px; margin-bottom: 16px; }
.login .card { padding: 28px; }
.login .button { width: 100%; }
.login .hint { font-size: 12px; }
.login > .link { display: block; width: fit-content; margin: auto; padding: 10px; }
.notice { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--ink); color: white; padding: 14px 18px; border-left: 4px solid var(--lime); box-shadow: 3px 3px 0 #BCAAC4; max-width: min(92vw,600px); width: max-content; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.update { position: fixed; bottom: calc(104px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 6; padding: 12px; background: var(--paper); border: 1px solid var(--line); max-width: 90vw; width: max-content; }
.loading, .empty { padding: 48px 20px; text-align: center; color: var(--muted); line-height: 1.7; font-size: 14px; }
.progress { background: var(--soft); padding: 16px 18px; font-size: 14px; line-height: 1.6; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.progress::before { content: ""; background: var(--purple); width: 8px; height: 8px; animation: blink 1.4s steps(2,end) infinite; flex-shrink: 0; }
.queue { max-width: 560px; margin: 28px auto; text-align: left; }
.queue h2 { font-size: 16px; }
.queue .card { padding: 19px; }
.queue .actions { margin-top: 12px; }
.queue audio { max-width: 100%; width: 100%; height: 36px; margin: 10px 0; }
.error-text { color: var(--red); font-size: 13px; line-height: 1.6; }
select.versions { width: auto; max-width: 100%; font-size: 14px; margin-bottom: 18px; }
.test-block { padding: 18px 0; border-top: 1px solid var(--line); }
.test-block:first-of-type { border-top: 0; padding-top: 0; }
.test-block p { font-size: 14px; margin: 8px 0; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin: 25px 0; gap: 10px; }
.link { color: var(--purple); text-underline-offset: 3px; font-size: 14px; }
@keyframes blink { 50% { opacity: .4; } }
@media(max-width: 640px) {
  .shell { padding: 0 20px calc(106px + env(safe-area-inset-bottom)); }
  .header { height: 72px; }
  .brand { font-size: 19px; }
  main { padding-top: 24px; }
  .navigation { bottom: max(16px,env(safe-area-inset-bottom)); width: 360px; gap: 3px; }
  .nav-button { padding: 10px 8px; flex: 1; font-size: 12px; }
  .card { padding: 20px; }
  .page-head { gap: 10px; align-items: center; }
  .page-head h1 { font-size: 23px; }
  .grid { grid-template-columns: 1fr; }
  .score-grid { gap: 8px; }
  .score { padding: 10px; }
  .score strong { font-size: 23px; }
  .score span { font-size: 11px; }
  .hypothesis { font-size: 17px; }
  .login { margin: 10px auto; }
  .login .card { padding: 22px; }
  .actions .button { flex-grow: 1; }
  .record-panel { padding: 28px 20px 24px; }
  .update { width: calc(100% - 40px); text-align: center; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
