:root {
  color-scheme: light;
  --bg: #f3f5ef;
  --panel: #ffffff;
  --ink: #17231d;
  --muted: #68736d;
  --line: #dfe5dd;
  --soft: #f4f7f2;
  --accent: #c8f277;
  --accent-strong: #91c33e;
  --accent-dark: #243d19;
  --danger: #c74848;
  --danger-soft: #fff0ed;
  --warning: #8b5e15;
  --warning-soft: #fff7e3;
  --shadow: 0 14px 40px rgba(29, 49, 37, .06);
  --radius: 24px;
  font-family: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(145, 195, 62, .35); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }

.topbar { height: 82px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(243, 245, 239, .88); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--ink); color: var(--accent); }
.brand-mark svg { width: 22px; height: 22px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 24px; line-height: 1; letter-spacing: -.8px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.local-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #69a934; box-shadow: 0 0 0 4px rgba(105, 169, 52, .12); }
.next-id { padding-left: 22px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.next-id strong { display: block; margin-top: 2px; color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 15px; letter-spacing: 1.2px; }

.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; font-weight: 650; font-size: 13px; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { background: var(--ink); color: #fff; box-shadow: 0 5px 14px rgba(23, 35, 29, .12); }
.button-primary:not(:disabled):hover { background: #293c32; box-shadow: 0 8px 20px rgba(23, 35, 29, .16); }
.button-primary svg { color: var(--accent); }
.button-secondary { background: #eef5e5; color: var(--accent-dark); border-color: #dceac9; }
.button-secondary:hover { background: #e5f1d7; }
.button-ghost { background: transparent; border-color: var(--line); }
.button-ghost:hover { background: var(--soft); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger svg { color: #fff; }
.danger-text { color: var(--danger); }
.text-button { padding: 2px; border: 0; background: none; color: #527c2b; font-size: 12px; font-weight: 650; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.icon-button:hover { background: var(--soft); }

.app-shell { width: min(1440px, calc(100% - clamp(32px, 7vw, 112px))); margin: 0 auto; }
.intro { min-height: 280px; padding: 48px 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: #6b814e; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.8px; }
h1 { margin: 0; font-size: clamp(40px, 4.2vw, 64px); line-height: .98; letter-spacing: -2.8px; font-weight: 720; }
h1 span { color: #6b7a70; font-weight: 450; }
.intro-copy { max-width: 610px; margin: 22px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.overview { flex: 0 0 auto; display: flex; align-items: stretch; padding: 25px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.overview > div { min-width: 118px; padding: 0 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.overview > div:first-child { padding-left: 0; }
.overview > div:last-child { padding-right: 0; border: 0; }
.overview strong { font-size: 25px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.overview span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }

.stepper { margin: 0 0 22px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .5); overflow: hidden; }
.stepper li { min-height: 53px; display: flex; align-items: center; justify-content: center; gap: 9px; position: relative; color: #8a948e; font-size: 12px; font-weight: 600; border-right: 1px solid var(--line); transition: .2s ease; }
.stepper li:last-child { border-right: 0; }
.stepper li span { font-size: 9px; font-family: "SFMono-Regular", Consolas, monospace; }
.stepper li.active { color: var(--ink); background: var(--accent); }
.stepper li.complete { color: #47632f; background: #eff5e8; }
.stepper li.complete span::after { content: ' ✓'; }

.workspace { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 22px; }
.panel { background: var(--panel); border: 1px solid rgba(211, 220, 210, .8); border-radius: var(--radius); box-shadow: var(--shadow); }
.recorder-panel, .metadata-panel { padding: 28px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.panel-heading h2, .library-heading h2, .modal-heading h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.6px; }
.soft-badge, .required-note { padding: 6px 10px; border-radius: 20px; background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 650; }
.support-message { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.5; }
.recorder-stage { min-height: 363px; padding: 24px 16px; border-radius: 18px; background: var(--soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.record-rings { width: 126px; height: 126px; display: grid; place-items: center; border: 1px solid #dce5d7; border-radius: 50%; transition: .2s ease; }
.record-button { width: 88px; height: 88px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--accent); cursor: pointer; box-shadow: 0 10px 30px rgba(23, 35, 29, .2); transition: transform .18s ease, background .18s ease; }
.record-button svg { width: 30px; height: 30px; stroke-width: 1.5; }
.record-button:hover { transform: scale(1.05); background: #2a3e33; }
.recorder-stage.recording .record-rings { border-color: rgba(199, 72, 72, .3); animation: pulse 1.5s infinite; }
.recorder-stage.recording .record-button { background: var(--danger); color: #fff; }
.recorder-stage.recording .record-button svg { display: none; }
.recorder-stage.recording .record-button::after { content: ''; width: 24px; height: 24px; border-radius: 6px; background: currentColor; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(199, 72, 72, .06); } }
.record-timer { margin-top: 18px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.record-hint { margin: 7px 0 12px; color: var(--muted); font-size: 12px; }
.level-track { width: min(220px, 80%); height: 4px; border-radius: 4px; overflow: hidden; background: #e1e7df; }
.level-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent-strong); transition: width .06s linear; }
.recording .level-track span { background: var(--danger); }
.recording-limit { margin: 15px 0 0; color: #939c96; font-size: 10px; }
.record-controls { display: flex; gap: 8px; margin-top: 18px; }
.draft-preview { margin-top: 18px; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.preview-heading > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 650; }
.preview-heading svg { width: 16px; height: 16px; }
audio { width: 100%; height: 42px; display: block; }
.file-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.file-facts > span { padding: 10px; background: var(--soft); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.file-facts small { color: var(--muted); font-size: 9px; }
.file-facts strong { font-size: 12px; }
.duration-warning { margin-top: 12px; padding: 10px 12px; display: flex; align-items: flex-start; gap: 8px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 11px; line-height: 1.45; }
.duration-warning svg { flex: 0 0 auto; width: 16px; height: 16px; }
.preview-actions { display: flex; gap: 8px; margin-top: 14px; }
.preview-actions .button:first-child { flex: 1; }

.field-group { min-width: 0; padding: 0; margin: 0 0 18px; border: 0; }
.field-group legend, .field-label { width: 100%; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 12px; color: #34433a; font-size: 11px; font-weight: 700; }
.field-label { margin-top: 16px; }
.field-label span { color: #919a94; font-size: 9px; font-weight: 450; text-align: right; }
.language-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.language-switch label { cursor: pointer; }
.language-switch input { position: absolute; opacity: 0; pointer-events: none; }
.language-switch label > span { padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; transition: .15s ease; }
.language-switch strong { font-size: 13px; }
.language-switch small { color: var(--muted); font-size: 9px; }
.language-switch input:checked + span { border-color: #a8c977; background: #f0f7e7; box-shadow: inset 0 0 0 1px #a8c977; }
.language-switch input:focus-visible + span { outline: 3px solid rgba(145, 195, 62, .35); }
textarea, input[type="text"], input[type="search"], select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
textarea, input[type="text"], select { padding: 12px 13px; }
textarea { resize: vertical; min-height: 100px; line-height: 1.55; font-size: 14px; }
input[type="text"], select { min-height: 44px; font-size: 13px; }
select { cursor: pointer; }
textarea:focus, input[type="text"]:focus, input[type="search"]:focus, select:focus { outline: none; border-color: #9cbd70; box-shadow: 0 0 0 3px rgba(145, 195, 62, .12); }
textarea.invalid, input.invalid, select.invalid { border-color: var(--danger); }
.field-under { display: flex; justify-content: space-between; align-items: flex-start; }
.field-under > span { padding-top: 5px; color: #9ba39e; font-size: 9px; }
.field-error { min-height: 0; margin: 4px 0 0; color: var(--danger); font-size: 10px; }
.field-error:empty { display: none; }
.field-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.confirmation { margin: 20px 0 16px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.confirmation input { position: absolute; opacity: 0; }
.confirmation > span { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #cbd4ca; border-radius: 6px; color: transparent; }
.confirmation svg { width: 14px; height: 14px; stroke-width: 2.5; }
.confirmation input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--accent); }
.confirmation input:focus-visible + span { outline: 3px solid rgba(145, 195, 62, .35); }
.confirmation em { padding-top: 1px; color: var(--muted); font-size: 11px; line-height: 1.45; font-style: normal; }
.save-button { width: 100%; min-height: 49px; }
.save-note { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 12px 0 0; color: #8a948e; font-size: 9px; }
.save-note svg { width: 13px; height: 13px; }
.form-error { padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 11px; line-height: 1.5; }

.library-panel { margin-top: 22px; padding: 28px; }
.library-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.library-heading h2 span { display: inline-grid; place-items: center; min-width: 25px; height: 25px; margin-left: 6px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 11px; vertical-align: 2px; }
.library-actions { display: flex; gap: 8px; align-items: center; }
.search-field { position: relative; width: 210px; }
.search-field svg { position: absolute; top: 12px; left: 12px; width: 17px; height: 17px; color: #8e9891; }
.search-field input { height: 42px; padding: 0 12px 0 38px; font-size: 12px; }
.library-actions select { width: 130px; min-height: 42px; }
.selection-bar { margin-bottom: 10px; padding: 9px 12px; display: flex; align-items: center; gap: 18px; background: #f0f6e8; border-radius: 10px; color: var(--muted); font-size: 12px; }
.selection-bar > span { margin-right: auto; color: var(--ink); }
.record-list-head, .record-row { display: grid; grid-template-columns: 28px 62px minmax(220px, 1.3fr) minmax(180px, .8fr) 92px 90px 118px; gap: 12px; align-items: center; }
.record-list-head { padding: 0 12px 10px; color: #929b95; font-size: 9px; text-transform: uppercase; letter-spacing: .8px; }
.record-row { min-height: 105px; padding: 14px 12px; border-top: 1px solid #edf0eb; }
.record-row:hover { background: #fcfdfb; }
.record-check, .record-check input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--ink); }
.record-id { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; font-weight: 700; }
.record-phrase { min-width: 0; }
.record-phrase p { margin: 0 0 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; line-height: 1.45; }
.metadata-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.metadata-chips span { padding: 3px 6px; border-radius: 5px; background: var(--soft); color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 8px; }
.metadata-chips span:first-child { background: #edf5e3; color: #527332; }
.record-audio audio { height: 34px; min-width: 170px; }
.record-file { display: flex; flex-direction: column; gap: 5px; font-size: 10px; }
.record-file span { color: var(--muted); }
.record-status { display: inline-flex; align-items: center; gap: 6px; color: #558033; font-size: 10px; }
.record-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #76a94b; }
.record-status.warning { color: var(--warning); }
.record-status.warning::before { background: #d59b38; }
.record-actions { display: flex; gap: 4px; }
.record-actions .icon-button { width: 34px; height: 34px; border-color: transparent; background: var(--soft); }
.record-actions .icon-button:hover { background: #e8eee4; }
.record-actions .icon-button:last-child:hover { color: var(--danger); background: var(--danger-soft); }
.record-actions svg { width: 15px; height: 15px; }
.empty-state { padding: 50px 20px 44px; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 17px; background: var(--soft); color: #819073; }
.empty-state h3 { margin: 0 0 7px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.stats-panel { padding: 26px 28px; }
.stats-panel .panel-heading { margin-bottom: 18px; }
.language-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.language-card { padding: 18px; border-radius: 14px; background: var(--soft); }
.language-card > div { display: flex; justify-content: space-between; align-items: baseline; }
.language-card strong { font-size: 24px; }
.language-card span { font-family: "SFMono-Regular", Consolas, monospace; color: var(--muted); font-size: 11px; }
.language-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.emotion-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.emotion-item { display: grid; grid-template-columns: 80px 1fr 66px; align-items: center; gap: 8px; font-size: 10px; }
.emotion-item > span { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; }
.emotion-item > div { height: 5px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.emotion-item > div > i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: #a8cd70; }
.emotion-item strong { text-align: right; font-size: 11px; }
.footer { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #8a948e; font-size: 10px; }
.footer span { display: inline-flex; align-items: center; gap: 7px; }
.footer svg { width: 14px; height: 14px; }

.modal { width: min(580px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 30px 100px rgba(18, 30, 23, .24); overflow-y: auto; }
.modal::backdrop { background: rgba(18, 30, 23, .55); backdrop-filter: blur(5px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-copy { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
#editAudio { margin-bottom: 20px; }
.export-options { display: grid; gap: 8px; }
.export-options label { cursor: pointer; }
.export-options input { position: absolute; opacity: 0; }
.export-options label > span { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; }
.export-options input:checked + span { border-color: #a8c977; background: #f0f7e7; box-shadow: inset 0 0 0 1px #a8c977; }
.export-options strong { font-size: 13px; }
.export-options small { color: var(--muted); font-size: 11px; }
.export-errors { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--danger-soft); color: #8f3838; font-size: 11px; }
.export-errors ul { max-height: 160px; margin: 8px 0 0; padding-left: 20px; overflow: auto; }
.export-errors li { margin: 5px 0; }
.export-progress { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.progress-orbit { width: 48px; height: 48px; border: 3px solid #e4ebdf; border-top-color: #86ad50; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.export-progress h3 { margin: 20px 0 7px; font-size: 17px; }
.export-progress p { margin: 0; color: var(--muted); font-size: 12px; }
.progress-track { width: 80%; height: 5px; margin-top: 22px; overflow: hidden; border-radius: 5px; background: var(--soft); }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent-strong); transition: width .2s ease; }
.confirm-modal { max-width: 450px; }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { max-width: 390px; padding: 13px 16px; display: flex; align-items: flex-start; gap: 9px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 12px 35px rgba(18, 30, 23, .25); font-size: 12px; line-height: 1.5; animation: toast-in .2s ease; }
.toast svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--accent); }
.toast.error { background: #843c3c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .local-badge { display: none; }
  .overview > div { min-width: 105px; padding: 0 16px; }
  .record-list-head, .record-row { grid-template-columns: 25px 55px minmax(190px, 1.2fr) minmax(160px, .8fr) 80px 105px; }
  .record-list-head > span:nth-child(6), .record-row > .record-status { display: none; }
  .library-heading { align-items: flex-start; }
  .library-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 920px) {
  .topbar { height: 72px; }
  .next-id { display: none; }
  .intro { align-items: flex-start; flex-direction: column; gap: 30px; }
  .overview { width: 100%; }
  .overview > div { flex: 1; }
  .workspace { grid-template-columns: 1fr; }
  .recorder-stage { min-height: 320px; }
  .library-heading { flex-direction: column; }
  .library-actions { width: 100%; justify-content: flex-start; }
  .search-field { flex: 1; width: auto; }
  .record-list-head { display: none; }
  .records-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .record-row { min-width: 0; padding: 16px; display: grid; grid-template-columns: 25px 1fr auto; gap: 10px; border: 1px solid var(--line); border-radius: 14px; }
  .record-row > .record-id { grid-column: 2; }
  .record-row > .record-actions { grid-column: 3; grid-row: 1; }
  .record-row > .record-phrase { grid-column: 1 / -1; }
  .record-row > .record-audio { grid-column: 1 / -1; }
  .record-row > .record-file { grid-column: 1 / 3; flex-direction: row; gap: 12px; }
  .record-row > .record-status { display: inline-flex; grid-column: 3; }
  .record-audio audio { min-width: 0; }
}

@media (max-width: 640px) {
  :root { --radius: 19px; }
  .topbar { padding: 0 16px; }
  .brand strong { font-size: 21px; }
  .brand small { display: none; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .topbar .button { min-height: 40px; padding: 0 13px; }
  .topbar .button span { display: none; }
  .app-shell { width: calc(100% - 24px); }
  .intro { min-height: 0; padding: 32px 4px 26px; }
  h1 { font-size: 43px; letter-spacing: -2px; }
  .intro-copy { margin-top: 17px; font-size: 13px; }
  .overview { padding: 17px 0; }
  .overview > div { min-width: 0; padding: 0 10px; }
  .overview strong { font-size: 19px; }
  .overview span { font-size: 8px; line-height: 1.35; }
  .stepper { border-radius: 13px; }
  .stepper li { min-height: 46px; font-size: 0; gap: 0; }
  .stepper li span { font-size: 10px; }
  .recorder-panel, .metadata-panel, .library-panel, .stats-panel { padding: 20px 16px; }
  .panel-heading { margin-bottom: 18px; }
  .panel-heading h2, .library-heading h2 { font-size: 20px; }
  .required-note { display: none; }
  .recorder-stage { min-height: 300px; padding: 20px 12px; }
  .record-rings { width: 112px; height: 112px; }
  .record-button { width: 80px; height: 80px; }
  .file-facts { gap: 5px; }
  .file-facts > span { padding: 9px 7px; }
  .file-facts small { font-size: 8px; }
  .file-facts strong { font-size: 10px; }
  .field-label { flex-direction: column; gap: 3px; }
  .field-label span { text-align: left; }
  .field-columns { grid-template-columns: 1fr; gap: 0; }
  .language-switch label > span { padding: 12px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .library-heading { margin-bottom: 16px; }
  .library-actions { display: grid; grid-template-columns: 1fr auto; }
  .search-field { grid-column: 1 / -1; width: 100%; }
  .library-actions select { width: 100%; }
  .records-list { grid-template-columns: 1fr; }
  .record-row { padding: 14px 12px; }
  .selection-bar { flex-wrap: wrap; gap: 10px 16px; }
  .selection-bar > span { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .language-stats { gap: 8px; }
  .language-card { padding: 14px; }
  .emotion-stats { gap: 12px; }
  .emotion-item { grid-template-columns: 70px 1fr 60px; }
  .footer { padding: 25px 4px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; }
  .modal { padding: 22px 18px; }
  .modal-actions .button { flex: 1; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


.app-topbar { display: grid; grid-template-columns: auto 1fr auto; }
.main-nav { display: flex; justify-content: center; gap: 5px; }
.main-nav button { padding: 10px 13px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.main-nav button svg { width: 16px; height: 16px; }
.main-nav button.active { background: var(--ink); color: #fff; }
.main-nav button.active svg { color: var(--accent); }
.user-summary { display: flex; flex-direction: column; text-align: right; }
.user-summary strong { font-size: 12px; }
.user-summary span { color: var(--muted); font-size: 9px; }
.notification-button { position: relative; }
.notification-button > span { position: absolute; top: -6px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 10px; background: var(--danger); color: #fff; font-size: 9px; }
.role-shell { padding-bottom: 50px; }
.role-heading { min-height: 190px; padding: 40px 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.role-heading h1 { font-size: clamp(36px, 4vw, 52px); letter-spacing: -2px; }
.role-heading p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.record-workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 22px; }
.phrase-panel, .record-help, .detail-audio, .comments-panel { padding: 28px; }
.record-language { max-width: 420px; margin-bottom: 14px; }
.phrase-start { width: 100%; }
.phrase-display { padding: 24px; margin: 18px 0; border: 1px solid #dbe8cb; border-radius: 16px; background: #f4f8ed; }
.phrase-display > p { margin: 0 0 14px; font-size: clamp(20px, 2.3vw, 30px); line-height: 1.35; letter-spacing: -.5px; }
.phrase-display .text-button { margin-top: 16px; }
.record-help { background: var(--ink); color: #fff; }
.record-help .section-kicker { color: var(--accent); }
.record-help h2 { margin: 0 0 28px; font-size: 28px; line-height: 1.15; }
.record-help ol { margin: 0; padding: 0; list-style: none; }
.record-help li { padding: 18px 0; display: grid; grid-template-columns: 30px 1fr; gap: 8px; border-top: 1px solid #38483f; color: #c3cec7; font-size: 12px; line-height: 1.55; }
.record-help li span { color: var(--accent); font-family: monospace; font-size: 10px; }
.record-help .save-note { color: #94a299; }
.trim-panel { padding: 14px; margin: 15px 0; border-radius: 12px; background: var(--soft); }
.trim-panel > div { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 11px; }
.trim-panel label { display: grid; grid-template-columns: 55px 1fr; align-items: center; gap: 8px; margin: 7px 0; color: var(--muted); font-size: 10px; }
.trim-panel input { width: 100%; accent-color: var(--ink); }
.trim-panel .button { width: 100%; min-height: 34px; margin-top: 6px; font-size: 10px; }
.recording-table-head, .server-record-row { display: grid; grid-template-columns: 28px minmax(240px, 1.5fr) 110px 90px 90px 140px; align-items: center; gap: 12px; }
.recording-table-head { padding: 0 12px 12px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .8px; }
.server-record-row { padding: 15px 12px; border-top: 1px solid var(--line); }
.server-record-row.inactive { background: #fffafa; }
.server-record-phrase { min-width: 0; }
.server-record-phrase a { display: flex; align-items: flex-start; gap: 12px; }
.server-record-phrase a > strong { flex: 0 0 auto; font-family: monospace; font-size: 12px; }
.server-record-phrase a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.server-record-phrase .metadata-chips { margin: 7px 0 0 64px; }
.record-dubber { font-size: 11px; font-weight: 650; }
.record-file { font-size: 11px; }
.record-file small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.comment-count { position: absolute; margin: -20px 0 0 20px; font-size: 8px; }
.inline-player { grid-column: 2 / -1; color: var(--muted); font-size: 11px; }
.section-actions { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.section-actions p { color: var(--muted); font-size: 12px; }
.user-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.user-card { padding: 22px; }
.user-card-top { display: flex; align-items: center; justify-content: space-between; }
.user-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #eaf3de; color: #567636; font-size: 18px; font-weight: 750; }
.user-card h3 { margin: 17px 0 4px; font-size: 17px; }
.user-card > p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.user-card-stats { margin: 20px 0; padding: 14px 0; display: flex; align-items: baseline; gap: 7px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.user-card-stats strong { font-size: 24px; }
.user-card-stats span { color: var(--muted); font-size: 10px; }
.user-card-actions { display: flex; gap: 7px; }
.user-card-actions .button { flex: 1; padding: 0 10px; font-size: 10px; }
.group-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.group-card { padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.group-card h3 { margin: 12px 0 5px; }
.group-card p { margin: 0; color: var(--muted); font-size: 11px; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-tags span { padding: 5px 8px; border-radius: 7px; background: var(--soft); color: var(--muted); font-size: 9px; }
.permission-list { max-height: 350px; overflow: auto; }
.permission-list .confirmation { margin: 8px 0; padding: 10px; border-radius: 10px; background: var(--soft); }
.permission-list small { display: block; margin-top: 3px; color: #94a097; }
.notifications-panel { position: fixed; top: 72px; right: 25px; z-index: 40; width: min(390px, calc(100% - 24px)); max-height: calc(100dvh - 95px); padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 20px 60px #1b2d2430; overflow: auto; }
.notifications-panel > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.notification-item { padding: 12px 4px; display: block; border-top: 1px solid var(--line); }
.notification-item.unread { background: linear-gradient(90deg, #f2f8e9, transparent); }
.notification-item strong { display: block; margin-top: 7px; font-size: 11px; }
.notification-item p { margin: 5px 0; font-size: 12px; line-height: 1.45; }
.notification-item small { color: var(--muted); font-size: 9px; }
.empty-notifications { padding: 25px 0; color: var(--muted); font-size: 12px; text-align: center; }
.detail-shell { padding-bottom: 60px; }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; }
.detail-audio audio { margin: 26px 0 15px; }
.detail-actions { display: flex; gap: 8px; margin-top: 20px; }
.rerecord-panel { padding: 18px; margin-top: 20px; border-radius: 14px; background: var(--soft); }
.rerecord-panel h3 { margin: 0; }
.rerecord-panel p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.rerecord-panel audio { margin: 14px 0; }
.rerecord-panel .record-timer { display: inline-block; margin: 0 0 0 15px; font-size: 18px; }
.comment-card { padding: 14px 0; border-top: 1px solid var(--line); }
.comment-card > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.comment-card.error > div span { color: var(--danger); }
.comment-card p { margin: 9px 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.comment-card small { color: var(--muted); font-size: 9px; }
#commentForm { margin-top: 20px; }
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 15% 20%, #e8f4d5, transparent 35%), var(--bg); }
.login-layout { width: min(1040px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: 0 25px 80px #24372b12; overflow: hidden; }
.login-intro { min-height: 590px; padding: 42px; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: #fff; }
.login-intro .brand-mark { background: var(--accent); color: var(--ink); }
.login-intro .brand small { color: #9aaba0; }
.login-intro h1 { font-size: clamp(38px, 4vw, 52px); }
.login-intro h1 span { color: #a5b5aa; }
.login-intro p:not(.eyebrow) { max-width: 430px; margin-top: 20px; color: #afbeb4; font-size: 13px; line-height: 1.65; }
.login-privacy { display: flex; align-items: center; gap: 8px; color: #9eaea3; font-size: 10px; }
.login-privacy svg { width: 15px; color: var(--accent); }
.login-card { padding: 45px 38px; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { margin: 0; font-size: 27px; }
.login-card > div:first-child > p:last-child { color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-card form { margin-top: 20px; }
.login-submit { width: 100%; margin-top: 25px; min-height: 49px; }
.login-demo { margin-top: 25px; padding: 14px; display: flex; flex-direction: column; gap: 5px; border-radius: 11px; background: var(--soft); color: var(--muted); font-size: 10px; }
.login-demo code { color: var(--ink); font-size: 12px; }
.login-demo small { font-size: 9px; }

@media (max-width: 1050px) {
  .app-topbar { grid-template-columns: auto auto; }
  .main-nav { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35; padding: 6px; border: 1px solid var(--line); border-radius: 15px; background: #fffffff2; box-shadow: 0 10px 40px #1b2d2420; backdrop-filter: blur(15px); }
  .main-nav button { flex: 1; justify-content: center; }
  .role-shell { padding-bottom: 90px; }
  .recording-table-head, .server-record-row { grid-template-columns: 25px minmax(200px, 1fr) 80px 85px 125px; }
  .recording-table-head span:nth-child(3), .server-record-row > .record-dubber { display: none; }
  .user-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .record-workspace, .detail-grid { grid-template-columns: 1fr; }
  .record-help { display: none; }
  .role-heading { min-height: 155px; padding-top: 25px; align-items: flex-start; }
  .role-heading .button { min-width: 45px; padding: 0 12px; font-size: 0; }
  .role-heading .button svg { margin: 0; }
  .user-summary { display: none; }
  .main-nav button { padding: 9px 5px; font-size: 9px; }
  .main-nav button svg { width: 15px; }
  .recording-table-head { display: none; }
  .server-record-row { grid-template-columns: 22px 1fr auto; gap: 9px; padding: 16px 5px; }
  .server-record-phrase { grid-column: 2 / 4; }
  .server-record-row > .record-file { grid-column: 2; }
  .server-record-row > .record-status { grid-column: 3; }
  .server-record-row > .record-actions { grid-column: 2 / 4; }
  .inline-player { grid-column: 1 / -1; }
  .server-record-phrase a > span { white-space: normal; }
  .user-grid, .group-grid { grid-template-columns: 1fr; }
  .section-actions { align-items: flex-start; }
  .section-actions p { max-width: 50%; }
  .login-body { padding: 12px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 230px; padding: 28px; }
  .login-intro > div { margin: 45px 0; }
  .login-intro h1 { font-size: 36px; }
  .login-intro p:not(.eyebrow) { display: none; }
  .login-card { padding: 30px 25px; }
  .detail-actions { flex-direction: column; }
}


.trim-panel > .waveform-trimmer { display: block; margin: 0 0 10px; }
.waveform-canvas-wrap { position: relative; width: 100%; height: 116px; border: 1px solid var(--line); border-radius: 11px; background: #fff; overflow: visible; touch-action: none; cursor: crosshair; }
.waveform-canvas { width: 100%; height: 100%; display: block; border-radius: 10px; }
.waveform-selection { position: absolute; top: 0; bottom: 0; background: rgba(200, 242, 119, .12); border-left: 1px solid rgba(117, 157, 72, .25); border-right: 1px solid rgba(117, 157, 72, .25); pointer-events: none; }
.waveform-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #1e3328; transform: translateX(-1px); pointer-events: none; opacity: .75; }
.waveform-handle { position: absolute; top: 0; bottom: 0; z-index: 3; width: 24px; padding: 0; border: 0; background: transparent; transform: translateX(-50%); cursor: ew-resize; touch-action: none; }
.waveform-handle > span { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #527832; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.waveform-handle > span::before { content: ''; position: absolute; top: 8px; left: 50%; width: 13px; height: 20px; border-radius: 4px; background: #527832; transform: translateX(-50%); box-shadow: 0 2px 6px rgba(33, 57, 40, .2); }
.waveform-handle-end > span::before { top: auto; bottom: 8px; }
.waveform-handle:hover > span, .waveform-handle.dragging > span, .waveform-handle:focus-visible > span { background: #233c17; }
.waveform-handle:hover > span::before, .waveform-handle.dragging > span::before { background: #233c17; }
.waveform-handle:focus-visible { outline: none; }
.waveform-handle:focus-visible > span::before { outline: 3px solid rgba(145, 195, 62, .35); outline-offset: 3px; }
.waveform-legend { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.waveform-selection-time { color: var(--ink); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; white-space: nowrap; }
#replacementWaveform { margin: 12px 0 18px; }
@media (max-width: 640px) {
  .waveform-canvas-wrap { height: 100px; }
  .waveform-legend > span:first-child { max-width: 170px; }
}


.input-device { margin: 15px 0; display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 8px 12px; }
.input-device > label { color: var(--muted); font-size: 11px; font-weight: 650; }
.input-device > p { grid-column: 2; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.input-device > p.warning, #inputStatus.warning { color: var(--danger); }
.password-field { position: relative; width: 100%; }
.password-field input { width: 100%; min-height: 44px; padding: 12px 82px 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease; }
.password-field input:focus { outline: none; border-color: #9cbd70; box-shadow: 0 0 0 3px rgba(145, 195, 62, .12); }
.password-toggle { position: absolute; top: 50%; right: 7px; min-height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: var(--soft); color: var(--muted); font-size: 10px; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { color: var(--ink); background: #eaf0e5; }
.password-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
@media (max-width: 640px) {
  .input-device { grid-template-columns: 1fr; }
  .input-device > p { grid-column: 1; }
}


.trim-panel > .audio-track-heading { margin-bottom: 12px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.audio-track-heading > strong { margin-right: auto; font-size: 12px; }
.audio-track-actions { display: flex; align-items: center; gap: 5px; }
.audio-track-actions .icon-button, .track-play-button { width: 36px; height: 36px; flex: 0 0 auto; }
.audio-track-actions .icon-button svg, .track-play-button svg { width: 16px; height: 16px; }
.audio-track-actions #saveRecordingButton { border-color: #bcd795; background: #eef6e4; color: #4c722c; }
.audio-track-actions #saveRecordingButton:hover { background: #e3f0d4; }
.track-play-button { border-color: var(--ink); background: var(--ink); color: var(--accent); }
.track-play-button:hover { background: #2b4034; }
@media (max-width: 420px) {
  .audio-track-heading { gap: 7px; }
  .audio-track-heading > strong { font-size: 11px; }
  .audio-track-actions { gap: 3px; }
  .audio-track-actions .icon-button, .track-play-button { width: 34px; height: 34px; }
}


.phrase-metadata { gap: 7px; margin-top: 12px; }
.phrase-metadata span { padding: 8px 11px; border-radius: 8px; font-family: inherit; font-size: 12px; font-weight: 650; line-height: 1.35; }
.phrase-metadata span:nth-child(1) { background: #eaf4df; color: #46672d; }
.phrase-metadata span:nth-child(2) { background: #fff0df; color: #875c27; }
.phrase-metadata span:nth-child(3) { background: #e8eff7; color: #49647e; }
@media (max-width: 480px) {
  .phrase-metadata { align-items: stretch; flex-direction: column; }
  .phrase-metadata span { width: 100%; font-size: 13px; }
}


.review-button.reviewed { border-color: #b9d995; background: #e7f3da; color: #4f7d2d; }
.review-button.reviewed::after { content: ''; position: absolute; width: 5px; height: 5px; margin: -20px 0 0 18px; border-radius: 50%; background: #68a440; }
.review-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; cursor: pointer; }
.review-filter input { position: absolute; opacity: 0; }
.review-filter > span { position: relative; width: 32px; height: 18px; border-radius: 12px; background: #d8dfd5; transition: .15s ease; }
.review-filter > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: .15s ease; }
.review-filter input:checked + span { background: #779e50; }
.review-filter input:checked + span::after { transform: translateX(14px); }
.review-filter input:focus-visible + span { outline: 3px solid rgba(145, 195, 62, .3); outline-offset: 2px; }
@media (min-width: 1051px) {
  .recording-table-head, .server-record-row { grid-template-columns: 28px minmax(240px, 1.5fr) 110px 90px 90px 170px; }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .recording-table-head, .server-record-row { grid-template-columns: 25px minmax(200px, 1fr) 80px 85px 160px; }
}
@media (max-width: 760px) {
  .review-filter { width: 100%; padding: 6px 0; }
}
