/* Voice data gather app: the style of index.html. */
:root {
  --bg-top: #e4f1f7; --bg-bottom: #f5f7fa;
  --card: #ffffff; --ink: #142130; --muted: #5d6c7d; --line: #dde5ed; --field: #fafcfe;
  --brand: #0f7c9c; --brand-dark: #0a5d75; --brand-soft: #e2f2f8;
  --ok: #12a37a; --ok-soft: #e1f5ee; --danger: #d33a48; --danger-soft: #fdecee; --warn: #b7791f;
  --radius: 16px; --shadow: 0 12px 32px rgba(18, 40, 66, 0.10);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); line-height: 1.5;
       font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
       background: linear-gradient(170deg, var(--bg-top), var(--bg-bottom) 55%) fixed; }
.hidden { display: none !important; }

header { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(255, 255, 255, 0.85);
         border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
        background: linear-gradient(135deg, var(--brand), #22a6c4); box-shadow: 0 4px 12px rgba(15, 124, 156, 0.35); }
.brand h1 { font-size: 18px; margin: 0; letter-spacing: 0.01em; }
.brand p { margin: 0; font-size: 13px; color: var(--muted); }
.spacer { flex: 1; }

.steps { display: flex; max-width: 760px; margin: 28px auto 0; padding: 0 20px; }
.step { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.step::after { content: ""; flex: 1; height: 2px; margin: 0 6px; background: var(--line); border-radius: 1px; }
.step:last-child { flex: none; }
.step:last-child::after { display: none; }
.step .dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
             font-weight: 700; font-size: 13px; background: #fff; border: 2px solid var(--line); }
.step.active { color: var(--ink); font-weight: 600; }
.step.active .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done::after { background: var(--ok); }

main { max-width: 760px; margin: 18px auto 32px; padding: 0 20px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 36px;
        animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h2 { margin: 0 0 6px; font-size: 25px; }
.lead { color: var(--muted); margin: 0 0 8px; }
.field-label { display: block; font-weight: 600; margin: 22px 0 8px; }
input[type=text], select { width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; color: var(--ink);
                           border: 1px solid var(--line); border-radius: 10px; background: var(--field);
                           transition: border-color 0.15s, box-shadow 0.15s; }
input[type=text]:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
#accentOther { margin-top: 10px; }

.segmented { display: inline-flex; position: relative; border: 1px solid var(--line); border-radius: 10px;
             overflow: hidden; background: var(--field); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 10px 30px; cursor: pointer; font-weight: 600; color: var(--muted); transition: background 0.15s; }
.segmented label + input + label { border-left: 1px solid var(--line); }
.segmented input:checked + label { background: var(--brand); color: #fff; }
.segmented input:focus-visible + label { box-shadow: inset 0 0 0 3px #9fd3e4; }

.consent { margin-top: 26px; padding: 16px 18px; border-radius: 12px; background: var(--brand-soft);
           border: 1px solid #c7e5ef; font-size: 14px; }
.consent p { margin: 0 0 10px; color: #29465a; }
.consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.link { color: var(--brand-dark); font-weight: 600; background: none; border: 0; padding: 0; font: inherit;
        text-decoration: underline; cursor: pointer; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions.center { justify-content: center; }
button { font: inherit; font-size: 16px; font-weight: 600; padding: 12px 26px; border-radius: 10px;
         border: 1px solid transparent; cursor: pointer; transition: background 0.15s, box-shadow 0.15s, transform 0.05s; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(15, 124, 156, 0.25); }
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.ghost:hover:not(:disabled) { background: #f2f6f9; }
.danger { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(211, 58, 72, 0.25); }
.danger:hover:not(:disabled) { background: #b72d3a; }
.big { font-size: 18px; padding: 15px 30px; min-width: 150px; }
.help-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; }
.help-btn .q { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff;
               display: grid; place-items: center; font-size: 13px; }
kbd { display: inline-block; font: inherit; font-size: 12px; font-weight: 600; line-height: 1; padding: 4px 7px;
      margin-left: 6px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.18); background: rgba(255, 255, 255, 0.22); }
.ghost kbd, .howto kbd, dialog kbd { background: #f2f5f8; border-color: #cfd8e1; color: var(--ink); }

.error { color: var(--danger); margin-top: 14px; min-height: 1.5em; font-weight: 600; }
.speaker { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 6px 14px;
           border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; font-size: 14px; }
.meter { height: 12px; border-radius: 6px; background: #edf1f5; overflow: hidden; margin-top: 10px; }
.meter div { height: 100%; width: 0; border-radius: 6px; background: var(--ok); transition: width 0.06s linear; }
.meter-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.howto { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
            border: 1px solid var(--line); background: var(--field); }
.howto .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
            background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 13px; }

.rec-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
        background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; font-size: 14px; }
.pill.rec { margin-left: auto; background: var(--danger-soft); color: var(--danger); font-variant-numeric: tabular-nums; }
.pill.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.progress { height: 6px; border-radius: 3px; background: #edf1f5; overflow: hidden; margin-top: 16px; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #22a6c4); transition: width 0.3s; }
.command-box { margin: 24px 0 18px; padding: 42px 24px; border-radius: var(--radius); text-align: center;
               background: linear-gradient(180deg, #f6fbfd, #ebf5f9); border: 1px solid #d3e8f0; }
.command-label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
#command { font-size: 46px; font-weight: 700; line-height: 1.2; min-height: 1.2em; }
#command.pop { animation: pop 0.22s ease-out; }
@keyframes pop { from { opacity: 0.2; transform: scale(0.97); } to { opacity: 1; transform: none; } }
#command .num { color: var(--brand); }
.status { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; min-height: 1.5em; }
.status.warn { color: var(--warn); font-weight: 600; }

.done-head { display: flex; align-items: center; gap: 16px; }
.done-icon { width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.stat { padding: 16px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.files { margin-top: 14px; font-size: 13px; color: var(--muted); word-break: break-all; }

dialog { border: 0; padding: 0; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(10, 30, 50, 0.3);
         width: min(700px, calc(100% - 32px)); max-height: calc(100vh - 32px); color: var(--ink); }
dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
dialog::backdrop { background: rgba(14, 30, 46, 0.5); }
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 20px; margin: 0; flex: 1; }
.dialog-body { padding: 6px 24px 8px; flex: 1; min-height: 0; overflow: auto; }
.dialog-body h3 { font-size: 16px; margin: 20px 0 6px; color: var(--brand-dark); }
.dialog-body p, .dialog-body li { color: #33475b; }
.dialog-body ul, .dialog-body ol { padding-left: 22px; margin: 6px 0; }
.dialog-body li { margin: 4px 0; }
.data-note { margin-top: 18px; padding: 4px 18px 10px; border-radius: 12px; background: #fff8e9; border: 1px solid #f0dcae; }
.data-note h3 { color: #8a5a10; }
.dialog-foot { padding: 14px 24px 20px; text-align: right; }
.dialog-foot button + button { margin-left: 8px; }
dialog.confirm { width: min(440px, calc(100% - 32px)); }
.close-x { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1; }

.code-card { max-width: 460px; margin: 60px auto 0; text-align: center; }
input.code-input { width: 100%; max-width: 280px; margin-top: 18px; text-align: center; font-size: 30px; font-weight: 700;
                   letter-spacing: 0.4em; text-indent: 0.4em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.code-card .actions { justify-content: center; }

footer { text-align: center; font-size: 12px; color: var(--muted); padding: 0 20px 28px; }

@media (max-width: 600px) {
  header { padding: 12px 16px; }
  .brand p, .step .label { display: none; }
  .card { padding: 24px 20px; }
  #command { font-size: 32px; }
  .big { min-width: 0; flex: 1; padding: 14px 16px; }
  .stats { grid-template-columns: 1fr; }
  .code-card { margin-top: 28px; }
}
