:root { color-scheme: light; --ink: #1c2634; --muted: #596779; --line: #dfe5ed; --red: #df2148; --soft-red: #fff0f3; --green: #267358; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #f5f7fa; color: var(--ink); font: 16px/1.55 Arial, Helvetica, sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { touch-action: manipulation; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid #226bc9; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; letter-spacing: -.5px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.4; }
.pocket { width: min(100% - 40px, 680px); margin: 0 auto; padding: 8px 0 max(28px, env(safe-area-inset-bottom)); }
.pocket-toolbar, .card-heading, .output-actions, .dialog-heading, .save-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pocket-toolbar { margin-bottom: 14px; }
.back-link { font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.quiet-button, .text-button, .icon-button { min-height: 44px; border: 0; background: transparent; color: var(--muted); padding: 10px 12px; font-size: 14px; border-radius: 10px; }
.quiet-button:hover, .text-button:hover, .icon-button:hover { background: #eaf0f6; color: var(--ink); }
.quiet-button { border: 1px solid var(--line); background: #fff; }
.eyebrow { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); vertical-align: middle; }
.steps { list-style: none; display: flex; justify-content: center; gap: 24px; margin: 30px 0 24px; padding: 0; font-size: 12px; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 7px; }
.steps span { width: 23px; height: 23px; display: inline-grid; place-items: center; border: 1px solid #d4dce6; border-radius: 50%; background: #fff; font-size: 11px; flex-shrink: 0; }
.capture-card, .result-card { padding: 22px; border: 1px solid var(--line); background: #fff; border-radius: 20px; box-shadow: 0 8px 30px #24354c04; }
.card-heading { flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.small-badge, .success-badge { display: inline-block; font-size: 10px; font-weight: 600; border-radius: 20px; padding: 5px 9px; color: var(--muted); background: #f1f4f8; }
.success-badge { color: var(--green); background: #edf7f1; }
.source-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 13px; background: #f0f3f7; }
.source-switch button { min-height: 44px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 14px; font-weight: 600; }
.source-switch button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 2px 5px #25354b0d; }
.source-panel { position: relative; text-align: center; padding: 16px 0 8px; }
.recorder-visual { display: flex; justify-content: center; align-items: center; gap: 5px; height: 30px; margin: 0 auto 8px; color: #ed8b9f; }
.recorder-visual span { height: 8px; width: 4px; border-radius: 3px; background: currentColor; }
.recorder-visual span:nth-child(2n) { height: 16px; }
.recorder-visual span:nth-child(3n) { height: 24px; }
.recorder-visual span:nth-child(5) { height: 30px; }
.is-recording .recorder-visual span { animation: sound 1s ease-in-out infinite alternate; }
.is-recording .recorder-visual span:nth-child(2n) { animation-delay: -.6s; }
.is-recording .recorder-visual span:nth-child(3n) { animation-delay: -.3s; }
.record-clock { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -1px; margin-bottom: 10px; }
.record-button { display: inline-flex; gap: 10px; justify-content: center; align-items: center; min-height: 48px; min-width: 190px; border: 1px solid #f3cad4; background: var(--soft-red); color: #ad1c3a; border-radius: 14px; font-weight: 700; padding: 10px 18px; margin-bottom: 10px; }
.record-button:hover { background: #ffe3ea; }
.record-symbol { width: 15px; height: 15px; background: var(--red); border-radius: 50%; }
.is-recording .record-symbol { border-radius: 3px; }
.helper { color: var(--muted); font-size: 13px; line-height: 1.6; }
.source-panel > .helper + .helper { margin-top: 4px; font-size: 11px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; text-decoration: none; font-size: 14px; font-weight: 600; }
.primary-button { color: #fff; background: var(--ink); }
.primary-button:hover { background: #34455b; color: #fff; }
.secondary-button { color: var(--ink); background: #fff; border-color: #d2dce7; }
.secondary-button:hover { background: #f5f7fa; }
.upload-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px; background: #f0f3f7; font-size: 24px; }
.source-panel h3 { margin-bottom: 6px; }
.upload-label { margin: 14px 0 8px; cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; bottom: 45px; left: 50%; }
.source-panel:focus-within .upload-label { outline: 3px solid #226bc9; outline-offset: 4px; }
.audio-review { padding: 14px 0 4px; margin-top: 8px; border-top: 1px solid var(--line); }
.audio-name { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; margin-bottom: 10px; }
audio { display: block; width: 100%; height: 44px; }
.audio-review .text-button { padding-left: 0; }
.request-status { color: var(--muted); font-size: 13px; text-align: center; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.request-status:empty { display: none; }
.request-status[data-tone="error"] { color: #af243d; }
.request-status[data-tone="busy"]::before { content: ''; display: inline-block; vertical-align: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #dce3ec; border-top-color: var(--ink); animation: spin 1s linear infinite; margin-right: 8px; }
.request-actions { display: flex; gap: 8px; justify-content: center; }
.capture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.request-actions:has(:not([hidden])) { margin-top: 12px; }
.replace-notice { text-align: center; margin-top: 14px; font-size: 11px; }
.result-card { margin-top: 16px; }
.result-card { scroll-margin-top: 120px; }
.result-card .card-heading { margin-bottom: 6px; }
.output-text { resize: vertical; min-height: 160px; max-height: 60dvh; margin: 14px 0 8px; background: #f8fafc; }
textarea, select, input[type="text"] { width: 100%; min-width: 0; border: 1px solid #d5dfe9; border-radius: 12px; padding: 13px; color: var(--ink); font-size: 16px; line-height: 1.6; }
textarea { resize: vertical; }
.output-actions { justify-content: flex-start; flex-wrap: wrap; }
.process-invite { display: grid; gap: 14px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
.process-invite h3 { margin-bottom: 5px; }
.process-invite .primary-button { width: 100%; }
.inline-warning { color: #8c5a13; background: #fff7e5; padding: 12px; margin-top: 12px; border-radius: 10px; font-size: 13px; }
.pocket-footer { margin-top: 16px; text-align: center; color: var(--muted); }
.pocket-footer p { font-size: 11px; line-height: 1.7; margin-top: 10px; }
.pocket-footer summary { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
.pocket-footer details[open] { text-align: left; }
.prompt-dialog { position: fixed; inset: 0; width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 40px); border: 1px solid var(--line); border-radius: 24px; margin: auto; padding: 22px; background: #fff; color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.prompt-dialog::backdrop { background: #18263b70; backdrop-filter: blur(4px); }
.dialog-heading { margin-bottom: 12px; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
.icon-button { font-size: 26px; width: 44px; flex-shrink: 0; }
.prompt-dialog label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.prompt-dialog textarea { min-height: 160px; }
.prompt-dialog select { background: #f8fafc; min-height: 50px; }
.model-settings { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
.model-settings > div { min-width: 0; }
.prompt-dialog details { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px 12px; }
.prompt-dialog details:not([open]) { padding-bottom: 0; }
.prompt-dialog summary { padding: 13px 0; min-height: 46px; font-size: 13px; color: var(--muted); }
.prompt-dialog details label { margin-top: 3px; }
.save-actions { justify-content: flex-start; flex-wrap: wrap; margin: 12px 0 8px; }
.danger { color: #ac2941; }
.dialog-feedback { font-size: 13px; color: var(--green); margin-top: 12px; overflow-wrap: anywhere; }
.dialog-footer { margin-top: 20px; padding-bottom: env(safe-area-inset-bottom); }
.dialog-footer .primary-button { width: 100%; }
.dialog-footer .helper { margin-top: 10px; text-align: center; }
html:has(.prompt-dialog[open]) { overflow: hidden; }
/* Prevent iOS focus zoom and keep every settings control comfortably tappable. */
.toolbox-key-dialog input { font-size: 16px; min-height: 44px; }
.toolbox-key-dialog button { min-height: 44px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sound { to { transform: scaleY(.45); } }
@media (max-width: 540px) {
  .pocket { width: calc(100% - 28px); padding-top: 4px; }
  .pocket-toolbar { margin-bottom: 12px; }
  .steps { gap: 10px; justify-content: space-between; margin-top: 24px; font-size: 10px; }
  .steps li { gap: 4px; }
  .steps span { width: 20px; height: 20px; font-size: 10px; }
  .capture-card, .result-card { padding: 18px 16px; border-radius: 18px; }
  .card-heading h2 { font-size: 18px; }
  .small-badge { font-size: 9px; }
  .output-actions { flex-wrap: nowrap; gap: 8px; }
  .output-actions .secondary-button { flex: 1; }
  .prompt-dialog { inset: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 16px); margin: 0; border-radius: 24px 24px 0 0; padding: 20px; }
}
@media (max-width: 420px) { .model-settings { grid-template-columns: 1fr; gap: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
