* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #a5aa9a;
  --bg-deep: #969c89;
  --surface: #f4f5ef;
  --surface-strong: #fbfbf7;
  --surface-soft: #e6e8dd;
  --surface-warm: #f7f1dc;
  --text: #262a20;
  --muted: #5f6553;
  --muted-soft: #858a7a;
  --accent: #e1be56;
  --accent-dark: #c9a437;
  --accent-deep: #8a711e;
  --accent-soft: #f7e9bd;
  --ok: #3e7d4f;
  --ok-soft: #e1eee1;
  --err: #a63d2e;
  --err-soft: #f3ddd8;
  --border: #b7bcab;
  --border-soft: rgba(132, 139, 116, .32);
  --shadow: 0 14px 36px rgba(38, 42, 32, .11), 0 2px 7px rgba(38, 42, 32, .07);
  --shadow-hover: 0 17px 38px rgba(38, 42, 32, .14), 0 0 0 1px rgba(201, 164, 55, .2);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html { color-scheme: light; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 14% -10%, rgba(255, 255, 255, .5), transparent 34rem),
    radial-gradient(circle at 92% 10%, rgba(247, 233, 189, .25), transparent 30rem),
    linear-gradient(145deg, #afb4a5 0%, var(--bg) 50%, #9ea492 100%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button, a { color: inherit; }
button { border: 0; }

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.hidden { display: none !important; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 0 clamp(18px, 3vw, 44px);
  background: rgba(251, 251, 247, .86);
  border-bottom: 1px solid rgba(126, 133, 110, .38);
  box-shadow: 0 5px 24px rgba(38, 42, 32, .07);
  backdrop-filter: blur(18px) saturate(115%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 720;
  letter-spacing: .01em;
  text-decoration: none;
}
.brand b { color: var(--accent-dark); font-weight: 500; }
.brand-wave { height: 30px; display: flex; align-items: center; gap: 3px; color: #8e925e; }
.brand-wave i { width: 3px; border-radius: 5px; background: currentColor; }
.brand-wave i:nth-child(1), .brand-wave i:nth-child(5) { height: 13px; opacity: .68; }
.brand-wave i:nth-child(2), .brand-wave i:nth-child(4) { height: 23px; }
.brand-wave i:nth-child(3) { height: 31px; color: var(--accent-dark); }

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.system-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.system-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(62, 125, 79, .1); }
.system-status.offline { color: var(--err); }
.system-status.offline i { background: var(--err); box-shadow: 0 0 0 4px rgba(166, 61, 46, .1); }
.system-telemetry { display: flex; align-items: center; gap: 7px; }
.metric-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: var(--muted);
  background: rgba(230, 232, 221, .54);
  border: 1px solid rgba(132, 139, 116, .24);
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: border-color .24s var(--ease), background .24s var(--ease), color .24s var(--ease);
}
.metric-chip small { color: var(--muted-soft); font-size: .58rem; font-weight: 760; letter-spacing: .08em; }
.metric-chip strong { color: var(--text); font-size: .72rem; font-weight: 680; }
.metric-chip em { color: var(--muted); font-size: .62rem; font-style: normal; }
.metric-chip.warning { color: var(--err); background: var(--err-soft); border-color: rgba(166, 61, 46, .28); }
.metric-chip.warning strong, .metric-chip.warning small { color: var(--err); }
.disk-metric { gap: 7px; }
.disk-metric strong { display: inline-flex; align-items: center; gap: 2px; }
.disk-metric .disk-read { color: #078a35; font-weight: 800; text-shadow: 0 0 8px rgba(7, 138, 53, .16); }
.disk-metric .disk-write { color: #d12f22; font-weight: 800; text-shadow: 0 0 8px rgba(209, 47, 34, .16); }
.read-arrow, .write-arrow { color: inherit; }
.topbar-divider { width: 1px; height: 24px; background: var(--border-soft); }
.topbar-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  cursor: pointer;
  transition: color .24s var(--ease), background .24s var(--ease), transform .24s var(--ease);
}
.topbar-button:hover { color: var(--text); background: var(--accent-soft); transform: translateY(-1px); }

/* Shell and panels */
.workspace-shell {
  width: min(1560px, calc(100% - 28px));
  margin: 18px auto 34px;
  display: grid;
  grid-template-columns: minmax(280px, 325px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(244, 245, 239, .9);
  border: 1px solid rgba(129, 136, 112, .36);
  border-radius: 15px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(108%);
}

.panel-kicker, .field-label {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 720;
  letter-spacing: .105em;
  text-transform: uppercase;
}
.panel-kicker { margin-bottom: 12px; }

.config-panel {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  padding: 22px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content-column { min-width: 0; }
.active-workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

/* Upload */
.dropzone {
  min-height: 109px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 13px 14px;
  text-align: left;
  color: var(--muted);
  background: rgba(251, 251, 247, .5);
  border: 1.5px dashed #adb29d;
  border-radius: 13px;
  cursor: pointer;
  outline: none;
  transition: transform .28s var(--ease), border-color .28s var(--ease), background .28s var(--ease), box-shadow .28s var(--ease);
}
.dropzone:hover, .dropzone:focus-visible {
  transform: translateY(-2px);
  color: var(--accent-deep);
  background: rgba(247, 233, 189, .42);
  border-color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(138, 113, 30, .11), 0 0 0 3px rgba(225, 190, 86, .12);
}
.dropzone.drag {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-dark);
  transform: translateY(-3px) scale(1.005);
  animation: dropPulse .9s ease-in-out infinite alternate;
}
.drop-icon { flex: 0 0 auto; width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone-copy { min-width: 0; display: grid; gap: 2px; }
.dropzone .dropzone-copy strong { color: #777d51; font-size: 1rem; font-weight: 650; }
.dropzone .dropzone-copy > span { font-size: .76rem; line-height: 1.3; }
.dropzone .dropzone-copy small { overflow: hidden; color: var(--muted-soft); font-size: .61rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
@keyframes dropPulse { to { box-shadow: 0 12px 28px rgba(138, 113, 30, .15), 0 0 18px rgba(225, 190, 86, .55); } }

.upload-status { margin-top: 12px; padding: 11px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(201, 164, 55, .42); animation: slideDown .28s var(--ease); }
.upload-status-row { display: flex; justify-content: space-between; gap: 12px; color: var(--accent-deep); font-size: .78rem; }

/* Sidebar fields and jobs */
.sidebar-section { padding: 21px 0 18px; border-bottom: 1px solid var(--border-soft); }
.field-label { display: flex; align-items: center; gap: 9px; }
.field-label .icon { width: 18px; height: 18px; stroke-width: 1.55; }
.job-list { display: grid; gap: 8px; margin-top: 11px; max-height: max(212px, calc(100vh - 348px)); overflow-y: auto; }
.job-list .empty { padding: 14px 10px; border-radius: 9px; background: rgba(230, 232, 221, .56); color: var(--muted); font-size: .8rem; text-align: center; }
.job-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  padding: 6px 6px 6px 8px;
  text-align: left;
  color: var(--text);
  background: rgba(251, 251, 247, .48);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: transform .24s var(--ease), background .24s var(--ease), border-color .24s var(--ease), box-shadow .24s var(--ease);
}
.job-item:hover { transform: translateY(-1px); background: var(--surface-strong); border-color: var(--border); box-shadow: 0 7px 16px rgba(38, 42, 32, .07); }
.job-item.active { background: var(--accent-soft); border-color: var(--accent-dark); box-shadow: inset 3px 0 var(--accent-dark); }
.job-item.working { position: relative; overflow: hidden; border-color: rgba(201, 164, 55, .48); }
.job-progress-track { position: absolute; right: 7px; bottom: 0; left: 7px; height: 3px; overflow: visible; background: rgba(201, 164, 55, .14); border-radius: 999px 999px 0 0; pointer-events: none; }
.job-progress-track i { position: relative; display: block; width: var(--job-progress, 0%); height: 100%; background: linear-gradient(90deg, #b8a347, var(--accent), #f1d77f); border-radius: inherit; box-shadow: 0 0 7px rgba(225, 190, 86, .48); transition: width .7s var(--ease); }
.job-progress-track i::after { content: ""; position: absolute; top: -2px; right: -2px; width: 5px; height: 7px; background: #f3d877; border-radius: 50%; box-shadow: 0 0 9px rgba(225, 190, 86, .9); animation: progressHeadPulse 1.15s ease-in-out infinite alternate; }
.job-item-select { min-width: 0; display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 9px; align-items: center; padding: 4px 0; color: inherit; background: transparent; text-align: left; cursor: pointer; outline: none; }
.job-item-select:focus-visible { border-radius: 7px; box-shadow: 0 0 0 2px var(--accent-dark); }
.job-file-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border-radius: 8px; }
.job-file-icon .icon { width: 17px; height: 17px; }
.job-item-copy { min-width: 0; }
.job-item-name { display: block; overflow: hidden; color: var(--text); font-size: .8rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.job-working-led { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--accent-dark); border: 1px solid rgba(138, 113, 30, .55); border-radius: 50%; box-shadow: 0 0 0 0 rgba(225, 190, 86, .35); vertical-align: 1px; animation: workingLed 1.15s ease-out infinite; }
.job-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 2px; color: var(--muted); font-size: .67rem; white-space: nowrap; }
.job-stage { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.job-stage strong { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.job-eta { flex: 0 0 auto; color: var(--accent-deep); font-weight: 660; font-variant-numeric: tabular-nums; }
.job-error-meta { color: var(--err); font-weight: 620; font-variant-numeric: tabular-nums; }
.job-item-actions { display: flex; gap: 2px; align-items: center; }
.job-item-action { width: 27px; height: 27px; display: grid; place-items: center; color: var(--muted); background: rgba(251, 251, 247, .66); border: 1px solid transparent; border-radius: 7px; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.job-item-action .icon { width: 15px; height: 15px; stroke-width: 1.9; }
.job-item-action:hover, .job-item-action:focus-visible { transform: translateY(-1px); outline: none; }
.job-item-action.download:hover, .job-item-action.download:focus-visible { color: var(--accent-deep); background: var(--accent-soft); border-color: var(--accent-dark); box-shadow: 0 4px 10px rgba(138, 113, 30, .12); }
.job-item-action.delete:hover, .job-item-action.delete:focus-visible { color: var(--err); background: var(--err-soft); border-color: rgba(166, 61, 46, .38); box-shadow: 0 4px 10px rgba(166, 61, 46, .1); }

.config-fields { display: grid; gap: 18px; padding-top: 19px; }
.sidebar-tools { padding-top: 14px; }
.field-group { display: grid; gap: 8px; }
.paired-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field-group-right .field-label { justify-content: flex-end; }
.select-wrap { position: relative; display: block; }
.select-wrap::after { content: ""; position: absolute; top: 50%; right: 14px; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select, input[type="number"], input[type="text"], input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 38px 10px 12px;
  color: var(--text);
  background: rgba(251, 251, 247, .75);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  outline: none;
  appearance: none;
  transition: border-color .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease);
}
select:hover, input[type="number"]:hover, input[type="text"]:hover, input[type="password"]:hover { background: var(--surface-strong); border-color: var(--border); }
select:focus-visible, input:focus-visible, textarea:focus-visible { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .2); }
select:disabled { opacity: .58; cursor: not-allowed; }

.advanced-settings { margin-top: -2px; border-top: 1px solid var(--border-soft); }
.advanced-settings summary { display: flex; justify-content: space-between; align-items: center; padding: 15px 0 3px; color: var(--muted); cursor: pointer; list-style: none; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary > span { display: flex; align-items: center; gap: 9px; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.advanced-settings .chevron { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .25s var(--ease); }
.advanced-settings[open] .chevron { transform: rotate(180deg); }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; animation: slideDown .25s var(--ease); }
.advanced-grid label { display: grid; gap: 5px; color: var(--muted); font-size: .68rem; }
.advanced-grid input { min-height: 38px; padding: 7px 9px; }

/* Empty workspace */
.empty-workspace { min-height: calc(100vh - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; cursor: pointer; outline: none; transition: transform .28s var(--ease), border-color .28s var(--ease), background .28s var(--ease), box-shadow .28s var(--ease); }
.empty-workspace:hover, .empty-workspace:focus-visible { transform: translateY(-2px); border-color: var(--accent-dark); box-shadow: var(--shadow-hover), 0 0 0 3px rgba(225, 190, 86, .14); }
.empty-workspace.drag { color: var(--accent-deep); background: rgba(247, 241, 220, .96); border-color: var(--accent-dark); transform: translateY(-3px) scale(1.003); animation: dropPulse .9s ease-in-out infinite alternate; }
.empty-workspace h1 { max-width: 640px; font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1.07; letter-spacing: -.045em; }
.empty-workspace p { max-width: 550px; margin: 16px auto 26px; color: var(--muted); }
.empty-orbit { position: relative; width: 88px; height: 88px; margin-bottom: 26px; border: 1px solid rgba(201, 164, 55, .45); border-radius: 50%; animation: orbitGlow 2.4s ease-in-out infinite alternate; }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; inset: 12px; border: 1px solid var(--border); border-radius: 50%; }
.empty-orbit::after { inset: 30px; background: var(--accent); border: 0; box-shadow: 0 0 22px rgba(225, 190, 86, .5); }
.empty-orbit i { position: absolute; top: 7px; left: 50%; width: 8px; height: 8px; background: var(--ok); border-radius: 50%; transform: translateX(-50%); }
@keyframes orbitGlow { to { box-shadow: 0 0 30px rgba(225, 190, 86, .22); transform: scale(1.02); } }

/* Confirmare explicita inainte de upload/procesare */
.prepare-workspace { min-height: calc(100vh - 120px); display: flex; flex-direction: column; gap: 20px; padding: 28px 30px; outline: none; animation: prepareIn .34s var(--ease) both; }
.prepare-workspace.drag { border-color: var(--accent-dark); box-shadow: var(--shadow-hover), 0 0 0 4px rgba(225, 190, 86, .15); }
.prepare-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.prepare-head .panel-kicker { margin-bottom: 5px; }
.prepare-head h1 { font-size: clamp(1.35rem, 2.2vw, 2rem); line-height: 1.15; letter-spacing: -.025em; }
.prepare-head p { margin-top: 7px; color: var(--muted); font-size: .86rem; }
.pending-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 154px; overflow-y: auto; }
.pending-file-item { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 9px 10px; background: rgba(251, 251, 247, .68); border: 1px solid var(--border-soft); border-radius: 10px; transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease); }
.pending-file-item:hover { transform: translateY(-1px); border-color: var(--border); box-shadow: 0 6px 14px rgba(38, 42, 32, .06); }
.pending-file-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent-deep); background: var(--accent-soft); border-radius: 9px; }
.pending-file-icon .icon { width: 18px; height: 18px; }
.pending-file-copy { min-width: 0; display: grid; gap: 2px; }
.pending-file-copy strong, .pending-file-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-file-copy strong { font-size: .82rem; }
.pending-file-copy small { color: var(--muted); font-size: .69rem; }
.pending-file-remove { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); background: transparent; border-radius: 7px; cursor: pointer; transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease); }
.pending-file-remove:hover { color: var(--err); background: var(--err-soft); transform: translateY(-1px); }
.pending-file-remove .icon { width: 15px; height: 15px; }
.processing-settings { min-width: 0; padding: 18px 20px 19px; background: rgba(230, 232, 221, .34); border: 1px solid var(--border-soft); border-radius: 12px; transition: opacity .24s var(--ease); }
.processing-settings:disabled { opacity: .62; }
.processing-settings legend { padding: 0 8px; color: var(--muted); font-size: .72rem; font-weight: 740; letter-spacing: .09em; text-transform: uppercase; }
.processing-config { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding-top: 0; }
.processing-config .field-group { align-content: start; }
.processing-config .language-fields { grid-column: span 2; }
.processing-config .deepl-usage { grid-column: span 3; align-self: center; }
.processing-config .chant-toggle { grid-column: span 2; align-self: center; }
.processing-config .initial-en-source { grid-column: 1 / -1; }
.processing-config .advanced-settings { grid-column: 1 / -1; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: .63rem; line-height: 1.3; }
.prepare-workspace .upload-status { margin-top: 0; }
.prepare-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.prepare-actions > p { max-width: 650px; color: var(--muted); font-size: .78rem; }
.prepare-actions > p strong { color: var(--text); }
.prepare-actions > div { display: flex; gap: 9px; flex: 0 0 auto; }
.process-button { min-width: 150px; }
@keyframes prepareIn { from { opacity: 0; transform: translateY(8px); } }

/* Audio */
.audio-panel { min-width: 0; padding: 15px 18px 12px; }
.transcript-panel { min-width: 0; padding: 24px 26px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.audio-head { align-items: center; }
.media-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: .86rem;
  font-weight: 680;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-summary #active-file-meta, .media-summary #active-file-size { color: var(--muted); font-size: .76rem; font-weight: 520; }
.media-separator { color: var(--border); font-weight: 400; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; color: var(--accent-deep); background: var(--accent-soft); border: 1px solid rgba(201, 164, 55, .42); border-radius: 999px; font-size: .73rem; font-weight: 650; white-space: nowrap; }
.status-chip::before { content: ""; width: 7px; height: 7px; background: var(--accent-dark); border-radius: 50%; animation: statusPulse 1.6s ease-in-out infinite; }
.status-chip.working { border-color: rgba(201, 164, 55, .62); box-shadow: 0 0 0 2px rgba(225, 190, 86, .08); }
.status-chip.working::before { animation: workingLed 1.15s ease-out infinite; }
.status-chip.done { color: var(--ok); background: var(--ok-soft); border-color: rgba(62, 125, 79, .28); }
.status-chip.done::before { background: var(--ok); animation: none; }
.status-chip.error { color: var(--err); background: var(--err-soft); border-color: rgba(166, 61, 46, .3); }
.status-chip.error::before { background: var(--err); animation: none; }
@keyframes statusPulse { 50% { opacity: .35; box-shadow: 0 0 0 5px rgba(225, 190, 86, .16); } }
@keyframes progressHeadPulse { to { opacity: .55; transform: scale(.72); } }
@keyframes waveformHeadPulse { to { opacity: .48; transform: scaleY(.82); } }
@keyframes waveformProcessScan { to { transform: translateX(460%); } }

.waveform-row { display: grid; grid-template-columns: minmax(0, 1fr) clamp(118px, 10vw, 138px); gap: 10px; align-items: center; margin: 8px 0 2px; }
.waveform-wrap { --processing-progress: 0%; position: relative; height: 72px; overflow: hidden; border-radius: 9px; transition: background .24s var(--ease), box-shadow .24s var(--ease); }
.waveform-wrap.scrubbing { background: rgba(247, 233, 189, .2); box-shadow: inset 0 0 0 1px rgba(201, 164, 55, .22); }
#waveform { position: relative; z-index: 2; display: block; width: 100%; height: 100%; cursor: ew-resize; touch-action: none; outline: none; }
#waveform:focus-visible { border-radius: 10px; box-shadow: inset 0 0 0 2px var(--accent-dark), inset 0 0 0 5px rgba(225, 190, 86, .18); }
.waveform-process { position: absolute; z-index: 3; inset: 0; overflow: hidden; background: rgba(230, 232, 221, .12); pointer-events: none; }
.waveform-process-fill { position: absolute; inset: 0 auto 0 0; width: var(--processing-progress); background: linear-gradient(90deg, rgba(247, 233, 189, .2), rgba(225, 190, 86, .3)); border-right: 2px solid rgba(201, 164, 55, .9); box-shadow: 8px 0 18px rgba(225, 190, 86, .23); transition: width .75s var(--ease); }
.waveform-process-fill::after { content: ""; position: absolute; top: 5px; right: -3px; bottom: 5px; width: 5px; background: rgba(244, 215, 119, .72); border-radius: 999px; filter: blur(1px); box-shadow: 0 0 13px rgba(225, 190, 86, .9); animation: waveformHeadPulse 1.1s ease-in-out infinite alternate; }
.waveform-process-copy { position: absolute; z-index: 3; top: 5px; right: 7px; display: flex; align-items: center; gap: 7px; padding: 3px 7px; color: var(--accent-deep); background: rgba(251, 251, 247, .86); border: 1px solid rgba(201, 164, 55, .28); border-radius: 999px; box-shadow: 0 3px 10px rgba(38, 42, 32, .06); font-size: .61rem; line-height: 1.3; backdrop-filter: blur(6px); }
.waveform-process-copy strong { font-size: .64rem; font-variant-numeric: tabular-nums; }
.waveform-process-copy small { color: var(--muted); font-variant-numeric: tabular-nums; }
.waveform-wrap.processing-scan .waveform-process-fill::before { content: ""; position: absolute; inset: 0; width: 28%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.44), transparent); transform: translateX(-110%); animation: waveformProcessScan 1.6s linear infinite; }
.waveform-stage-meters { position: absolute; z-index: 4; right: 7px; bottom: 5px; left: 7px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.waveform-stage-meter { --stage-progress: 0%; position: relative; display: block; height: 15px; overflow: hidden; padding: 1px 5px; color: var(--muted); background: rgba(251, 251, 247, .76); border: 1px solid rgba(183, 188, 171, .44); border-radius: 5px; box-shadow: 0 2px 7px rgba(38, 42, 32, .04); font-size: .52rem; line-height: 11px; backdrop-filter: blur(5px); }
.waveform-stage-meter > span { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 4px; }
.waveform-stage-meter strong { font-variant-numeric: tabular-nums; }
.waveform-stage-meter > i { position: absolute; z-index: 1; inset: 0 auto 0 0; width: var(--stage-progress); background: rgba(225, 190, 86, .28); border-right: 1px solid rgba(201, 164, 55, .7); transition: width .7s var(--ease), background .25s var(--ease); }
.waveform-stage-meter.complete { color: var(--ok); border-color: rgba(62, 125, 79, .3); }
.waveform-stage-meter.complete > i { background: rgba(62, 125, 79, .14); border-right-color: rgba(62, 125, 79, .48); }
.waveform-stage-meter.active { color: var(--accent-deep); border-color: rgba(201, 164, 55, .58); }
.waveform-stage-meter.active > i::after { content: ""; position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent); animation: waveformProcessScan 1.35s linear infinite; }
.waveform-process.error { background: rgba(166, 61, 46, .06); }
.waveform-process.error .waveform-process-fill { background: rgba(166, 61, 46, .08); border-right-color: rgba(166, 61, 46, .66); box-shadow: 8px 0 18px rgba(166, 61, 46, .1); }
.waveform-process.error .waveform-process-fill::after { display: none; }
.waveform-process.error .waveform-process-copy { color: var(--err); border-color: rgba(166, 61, 46, .28); }
.waveform-stage-meter.error { color: var(--err); border-color: rgba(166, 61, 46, .45); }
.waveform-stage-meter.error > i { background: rgba(166, 61, 46, .18); border-right-color: var(--err); }
.waveform-tooltip {
  position: absolute;
  z-index: 3;
  top: 5px;
  left: var(--wave-tooltip-x, 50%);
  padding: 3px 7px;
  color: #4d3e0c;
  background: rgba(247, 233, 189, .95);
  border: 1px solid rgba(201, 164, 55, .45);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(38, 42, 32, .1);
  font-size: .65rem;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.waveform-wrap.previewing .waveform-tooltip { opacity: 1; transform: translate(-50%, 0); }
.waveform-loading { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; color: var(--muted-soft); font-size: .78rem; background: linear-gradient(90deg, transparent, rgba(244, 245, 239, .8), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.vu-meter { position: relative; height: 84px; overflow: hidden; background: linear-gradient(145deg, #eef0e7 0%, #dde1d3 58%, #d2d7c7 100%); border: 1px solid #a8af9c; border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.72), inset 0 -5px 10px rgba(80,88,68,.08), 0 3px 9px rgba(38,42,32,.1); isolation: isolate; transition: border-color .24s var(--ease), box-shadow .24s var(--ease); }
.vu-meter::after { content: ""; position: absolute; z-index: 3; inset: 0 0 14px; background: linear-gradient(115deg, rgba(255,255,255,.3), transparent 25%, transparent 73%, rgba(107,103,66,.07)), repeating-linear-gradient(92deg, rgba(72,78,61,.018) 0 1px, transparent 1px 4px); border-radius: 10px 10px 7px 7px; pointer-events: none; }
.vu-meter.active { border-color: #aaa45f; box-shadow: inset 0 1px 0 rgba(255,255,255,.78), inset 0 -5px 10px rgba(80,88,68,.07), 0 3px 10px rgba(38,42,32,.1), 0 0 12px rgba(225,190,86,.18); }
.vu-meter svg { position: relative; z-index: 1; display: block; width: 100%; height: calc(100% - 14px); }
.vu-face { fill: #dce1d3; stroke: #969e8a; stroke-width: 1.2; }
.vu-window { fill: url(#vu-face-gradient); stroke: #b4a46f; stroke-width: 1; }
.vu-scale { fill: none; stroke: #4a3d23; stroke-width: 1.05; }
.vu-red-zone { fill: none; stroke: #a63d2e; stroke-width: 2.2; }
.vu-ticks { fill: none; stroke: #514328; stroke-width: .9; stroke-linecap: square; }
.vu-labels { fill: #413720; font-family: Georgia, "Times New Roman", serif; font-size: 5.7px; font-weight: 650; text-anchor: middle; }
.vu-labels .vu-hot-label { fill: #942f23; }
.vu-labels .vu-title { font-family: Inter, sans-serif; font-size: 9px; font-weight: 780; letter-spacing: 1px; }
.vu-needle { fill: #a63d2e; filter: drop-shadow(0 1px 1px rgba(38,22,15,.38)); }
.vu-pivot { fill: #5e6252; stroke: #35392f; stroke-width: 1; }
.vu-pivot-cap { fill: #c5a340; }
.vu-screw { fill: #aaae9c; stroke: #656b5a; stroke-width: .7; }
.vu-caption { position: absolute; z-index: 4; bottom: 4px; left: 50%; color: #5f6553; font-family: Inter, ui-sans-serif, sans-serif; font-size: .43rem; font-weight: 780; letter-spacing: .12em; line-height: 1; pointer-events: none; transform: translateX(-50%); white-space: nowrap; }
.player-controls { display: grid; grid-template-columns: 40px 34px 34px auto minmax(100px, 1fr) auto 19px 110px; gap: 8px; align-items: center; }
.round-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer; transition: transform .22s var(--ease), color .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease); }
.round-button:hover { transform: translateY(-2px); color: var(--text); background: var(--accent-soft); box-shadow: 0 6px 14px rgba(138, 113, 30, .12); }
.round-button.primary-round { width: 40px; height: 40px; color: var(--accent-deep); background: rgba(251, 251, 247, .8); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 190, 86, .08); }
.round-button.primary-round:hover { background: var(--accent); color: #4d3e0c; box-shadow: 0 8px 18px rgba(138, 113, 30, .2), 0 0 0 5px rgba(225, 190, 86, .12); }
.round-button .icon { width: 20px; height: 20px; }
.round-button > span { font-size: 1.5rem; line-height: 1; }
.round-button > small { position: absolute; top: 14px; font-size: .5rem; font-weight: 800; }
.time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.time.current { color: var(--ok); }
.volume-icon { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.range-input { --range-progress: 0%; width: 100%; height: 4px; padding: 0; background: linear-gradient(to right, var(--accent-dark) var(--range-progress), #cfd2c5 var(--range-progress)); border: 0; border-radius: 999px; outline: none; appearance: none; cursor: pointer; }
.range-input::-webkit-slider-thumb { width: 15px; height: 15px; background: var(--surface-strong); border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 2px 7px rgba(38, 42, 32, .14); appearance: none; transition: transform .2s var(--ease); }
.range-input::-moz-range-thumb { width: 12px; height: 12px; background: var(--surface-strong); border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 2px 7px rgba(38, 42, 32, .14); transition: transform .2s var(--ease); }
.range-input:hover::-webkit-slider-thumb { transform: scale(1.18); }
.range-input:hover::-moz-range-thumb { transform: scale(1.18); }

/* Progress compact, integrat în player */
.processing-strip {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 7px;
  padding-top: 7px;
  overflow: hidden;
  border-top: 1px solid var(--border-soft);
  white-space: nowrap;
}
.processing-strip.working::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, transparent 0%, var(--accent-dark) 42%, #f1d77c 50%, var(--accent-dark) 58%, transparent 100%); transform: translateX(-100%); animation: processSweep 1.65s linear infinite; pointer-events: none; }
.pipeline { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.pipeline-step { display: inline-flex; align-items: center; gap: 5px; text-align: left; }
.pipeline-step:not(:last-child)::after { content: "›"; margin-left: 4px; color: var(--border); font-size: .9rem; }
.pipeline-step.connector-done:not(:last-child)::after { color: var(--ok); }
.pipeline-node { width: 22px; height: 22px; display: grid; flex: 0 0 auto; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 50%; font-size: .58rem; font-weight: 760; transition: all .3s var(--ease); }
.pipeline-step.done .pipeline-node { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
.pipeline-step.active .pipeline-node { color: var(--accent-deep); background: var(--surface-strong); border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .12), 0 0 12px rgba(225, 190, 86, .25); animation: nodeBreath 1.6s ease-in-out infinite alternate; }
.pipeline-step.error .pipeline-node { color: var(--err); background: var(--err-soft); border-color: var(--err); }
.pipeline-step.retryable { margin: -3px; padding: 3px; color: inherit; background: rgba(243, 221, 216, .2); border: 1px solid transparent; border-radius: 7px; font: inherit; cursor: pointer; transition: background .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease), transform .22s var(--ease); }
.pipeline-step.retryable:hover { background: var(--err-soft); border-color: rgba(166, 61, 46, .3); box-shadow: 0 4px 11px rgba(166, 61, 46, .1); transform: translateY(-1px); }
.pipeline-step.retryable:focus-visible { border-color: var(--err); box-shadow: 0 0 0 3px rgba(166, 61, 46, .14); outline: none; }
.pipeline-step.retryable:disabled { cursor: wait; opacity: .62; }
.pipeline-step.retryable .pipeline-node { animation: retryErrorPulse 1.7s ease-in-out infinite; }
.pipeline-node .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.pipeline-label { color: var(--text); font-size: .71rem; font-weight: 650; }
.pipeline-state { color: var(--muted); font-size: .65rem; }
.pipeline-step.done .pipeline-state { color: var(--ok); }
.pipeline-step.active .pipeline-state { color: var(--accent-deep); }
.processing-core { position: relative; width: 7px; height: 7px; background: var(--accent-dark); border-radius: 50%; box-shadow: 0 0 7px rgba(225, 190, 86, .8); }
.processing-core::after { content: ""; position: absolute; inset: -4px; border: 1px solid rgba(201, 164, 55, .58); border-radius: 50%; animation: corePulse 1.15s ease-out infinite; }
.processing-message { min-width: 0; flex: 1 1 auto; overflow: hidden; color: var(--muted); font-size: .68rem; text-align: right; text-overflow: ellipsis; transition: opacity .24s var(--ease), transform .24s var(--ease); }
.processing-message.changed { animation: statusChange .35s var(--ease); }
@keyframes nodeBreath { to { box-shadow: 0 0 0 4px rgba(225, 190, 86, .08), 0 0 16px rgba(225, 190, 86, .32); } }
@keyframes statusChange { from { opacity: 0; transform: translateY(4px); } }
@keyframes processSweep { to { transform: translateX(100%); } }
@keyframes projectSweep { to { transform: translateX(100%); } }
@keyframes workingLed { 60%, 100% { box-shadow: 0 0 0 7px rgba(225, 190, 86, 0); opacity: .62; } }
@keyframes corePulse { to { inset: -9px; opacity: 0; } }
@keyframes retryErrorPulse { 50% { box-shadow: 0 0 0 4px rgba(166, 61, 46, .1); } }

/* Transcript */
.transcript-panel { min-height: 360px; }
.transcript-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.language-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-top: -5px; }
.language-tabs { display: flex; gap: 5px; }
.target-provenance { max-width: min(58vw, 680px); overflow: hidden; padding: 3px 7px; color: var(--muted); background: rgba(230, 232, 221, .5); border: 1px solid var(--border-soft); border-radius: 999px; font-size: .61rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.target-provenance.stale { color: #8a3a2e; background: rgba(243, 221, 216, .62); border-color: rgba(166, 61, 46, .3); font-weight: 680; }
.target-provenance.source-import { color: #526b3f; background: rgba(219, 230, 211, .52); border-color: rgba(92, 119, 72, .24); }
.language-tab { position: relative; padding: 3px 0 8px; color: var(--muted); background: transparent; font-size: .85rem; cursor: pointer; }
.language-tab + .language-tab { margin-left: 11px; }
.language-tab::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px; background: var(--accent-dark); border-radius: 2px; transition: right .24s var(--ease); }
.language-tab.active { color: var(--text); font-weight: 650; }
.language-tab.active::after { right: 0; }
.language-tab:disabled { opacity: .36; cursor: not-allowed; }
.transcript-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.alignment-review { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 6px 9px 6px 11px; color: #755a0c; background: rgba(247, 233, 189, .42); border: 1px solid rgba(201, 164, 55, .35); border-radius: 9px; font-size: .72rem; }
.alignment-review button { flex: 0 0 auto; padding: 4px 8px; color: var(--accent-deep); background: rgba(251, 251, 247, .72); border: 1px solid rgba(201, 164, 55, .4); border-radius: 7px; font-size: .68rem; font-weight: 680; cursor: pointer; transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease); }
.alignment-review button:hover { transform: translateY(-1px); background: var(--surface-strong); box-shadow: 0 4px 10px rgba(138, 113, 30, .12); }
.transcript-table-head, .transcript-row { display: grid; grid-template-columns: 42px 112px 112px 72px minmax(260px, 1fr) 38px; gap: 10px; align-items: center; }
.transcript-table-head { margin-top: 20px; padding: 0 12px 8px; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.transcript-rows { max-height: 415px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 11px; background: rgba(251, 251, 247, .48); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.transcript-row { position: relative; min-height: 47px; padding: 8px 12px; border-bottom: 1px solid rgba(183, 188, 171, .34); animation: rowIn .32s var(--ease) both; transition: background .22s var(--ease), box-shadow .22s var(--ease); }
.transcript-row:last-child { border-bottom: 0; }
.transcript-row:hover { background: rgba(247, 233, 189, .25); }
.transcript-row.playing { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent-dark); }
.transcript-row.low-confidence { box-shadow: inset 3px 0 rgba(201, 164, 55, .8); }
.transcript-row.omitted { background: rgba(243, 221, 216, .28); box-shadow: inset 3px 0 rgba(166, 61, 46, .72); }
.transcript-row.low-confidence.playing, .transcript-row.omitted.playing { box-shadow: inset 3px 0 var(--accent-dark), inset 6px 0 rgba(201, 164, 55, .34); }
.transcript-index { display: grid; gap: 2px; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.confidence-badge { width: max-content; padding: 1px 3px; color: #765b10; background: rgba(225, 190, 86, .2); border-radius: 4px; font-size: .52rem; font-weight: 720; }
.transcript-row.omitted .confidence-badge { color: var(--err); background: var(--err-soft); }
.transcript-time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.transcript-time.duration { color: var(--accent-deep); font-weight: 650; }
.transcript-text { min-width: 0; padding: 5px 7px; color: var(--text); border: 1px solid transparent; border-radius: 7px; font-size: .83rem; line-height: 1.45; }
.transcript-text[contenteditable="true"] { background: var(--surface-strong); border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .16); outline: none; }
.cue-action { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); background: transparent; border-radius: 7px; cursor: pointer; opacity: .7; transition: color .2s var(--ease), background .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease); }
.cue-action:hover { color: var(--accent-deep); background: var(--accent-soft); opacity: 1; transform: translateY(-1px); }
.cue-action .icon { width: 16px; height: 16px; }
.cue-actions-edit { display: flex; gap: 3px; }
.transcript-empty { padding: 52px 18px; color: var(--muted); text-align: center; background: rgba(251, 251, 247, .4); border: 1px dashed var(--border); border-radius: 11px; font-size: .85rem; }
.workspace-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }

/* Buttons and progress bars */
.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--text);
  background: rgba(251, 251, 247, .8);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  font-size: .8rem;
  font-weight: 610;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .24s var(--ease), background .24s var(--ease), border-color .24s var(--ease), box-shadow .24s var(--ease), color .24s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--surface-strong); border-color: var(--accent-dark); box-shadow: 0 7px 16px rgba(138, 113, 30, .12); }
.btn:focus-visible { outline: none; border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .22); }
.btn.primary { color: #3f330c; background: linear-gradient(135deg, #ead077, var(--accent)); border-color: var(--accent-dark); box-shadow: 0 5px 14px rgba(138, 113, 30, .15); }
.btn.primary:hover { background: linear-gradient(135deg, #f0d98d, #e3bd4b); box-shadow: 0 9px 20px rgba(138, 113, 30, .2), 0 0 0 3px rgba(225, 190, 86, .12); }
.btn.danger { margin-left: auto; color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); box-shadow: 0 7px 16px rgba(166, 61, 46, .1); }
.btn.cancel-operation { color: #755a0c; border-color: rgba(201, 164, 55, .4); }
.btn.cancel-operation:hover { background: var(--accent-soft); border-color: var(--accent-dark); }
.btn:disabled { opacity: .42; transform: none; box-shadow: none; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border-radius: 9px; cursor: pointer; transition: transform .22s var(--ease), color .22s var(--ease), background .22s var(--ease); }
.icon-button:hover { transform: rotate(3deg) translateY(-1px); color: var(--text); background: var(--accent-soft); }

.bar { position: relative; height: 10px; overflow: hidden; background: #d7d9cf; border: 1px solid rgba(129, 136, 112, .2); border-radius: 999px; box-shadow: inset 0 1px 3px rgba(38, 42, 32, .12); }
.bar.compact { height: 7px; margin-top: 7px; }
.fill { position: relative; width: 0; height: 100%; overflow: hidden; background: linear-gradient(90deg, var(--accent-dark), #f0d67f 48%, var(--accent)); background-size: 180% 100%; border-radius: inherit; box-shadow: 0 0 12px rgba(225, 190, 86, .5); transition: width .36s var(--ease); animation: liquid 1.2s linear infinite; }
.fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 48%, transparent 75%); transform: translateX(-100%); animation: sheen 1.25s ease-in-out infinite; }
.fill.indet { width: 38%; animation: liquid 1.2s linear infinite, indeterminate 1.1s var(--ease) infinite alternate; }
@keyframes liquid { to { background-position: -180% 0; } }
@keyframes sheen { to { transform: translateX(130%); } }
@keyframes indeterminate { from { margin-left: 0; } to { margin-left: 62%; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } }

/* Modal and notifications */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(38, 42, 32, .42); backdrop-filter: blur(8px); opacity: 1; visibility: visible; transition: opacity .25s var(--ease), visibility .25s var(--ease); }
.modal.hidden { display: flex !important; opacity: 0; visibility: hidden; pointer-events: none; }
.modal-box { width: min(880px, 100%); height: min(82vh, 780px); display: flex; flex-direction: column; gap: 16px; padding: 22px; background: rgba(244, 245, 239, .97); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 28px 80px rgba(38, 42, 32, .28); transform: translateY(0) scale(1); transition: transform .3s var(--ease); }
.modal.hidden .modal-box { transform: translateY(12px) scale(.985); }
.modal-box.compact-modal { width: min(580px, 100%); height: auto; max-height: calc(100vh - 36px); overflow-y: auto; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-head .panel-kicker { margin-bottom: 3px; }
.modal-head h2 { font-size: 1.22rem; }
.modal-foot { min-height: 40px; }
.editor-box { width: min(1260px, 100%); height: min(88vh, 900px); }
.editor-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 370px); gap: 14px; }
.editor-srt-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .73rem; font-weight: 680; }
#editor-text { flex: 1; width: 100%; min-height: 0; resize: none; padding: 16px; color: var(--text); background: var(--surface-strong); border: 1px solid var(--border); border-radius: 11px; outline: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84rem; line-height: 1.55; }
#editor-text:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .13); }
.editor-dictionary { min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; margin-top: 25px; padding-right: 2px; }
.editor-dictionary-card { flex: 0 0 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: rgba(230, 232, 221, .38); border: 1px solid var(--border-soft); border-radius: 11px; transition: flex-grow .3s var(--ease), border-color .24s var(--ease), background .24s var(--ease), box-shadow .24s var(--ease); }
.editor-dictionary-card.expanded { flex-grow: 1; border-color: rgba(201, 164, 55, .38); background: rgba(242, 241, 229, .72); box-shadow: 0 7px 18px rgba(82, 86, 66, .07); }
.editor-card-toggle { width: 100%; padding: 11px 12px; color: var(--text); background: transparent; border: 0; border-radius: 10px; text-align: left; cursor: pointer; }
.editor-card-toggle:hover { background: rgba(251, 251, 247, .42); }
.editor-card-toggle:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-dark); }
.editor-dictionary-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.editor-card-title { min-width: 0; display: grid; gap: 1px; }
.editor-dictionary-head strong { font-size: .84rem; }
.editor-dictionary-head small, .editor-card-body > small { color: var(--muted); font-size: .64rem; line-height: 1.35; }
.editor-card-summary { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.editor-card-badge { padding: 3px 6px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; font-size: .56rem; font-weight: 740; letter-spacing: .04em; text-transform: uppercase; }
.editor-card-chevron { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .26s var(--ease), stroke .24s var(--ease); }
.editor-dictionary-card.expanded .editor-card-chevron { transform: rotate(180deg); stroke: var(--accent-deep); }
.editor-card-body { flex: 0 1 auto; max-height: 0; display: flex; flex-direction: column; gap: 7px; overflow: hidden; padding: 0 12px; opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none; transition: max-height .3s var(--ease), padding .3s var(--ease), opacity .2s var(--ease), transform .24s var(--ease), visibility 0s linear .3s; }
.editor-dictionary-card.expanded .editor-card-body { flex: 1 1 auto; max-height: 1000px; padding: 0 12px 12px; opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; transition-delay: 0s; }
.modal.hidden .editor-card-body { visibility: hidden; pointer-events: none; }
.editor-card-body > label { color: var(--muted); font-size: .69rem; font-weight: 650; }
.editor-dictionary-card code { font-size: .82em; }
.editor-dictionary-card textarea { flex: none; width: 100%; height: 96px; min-height: 72px; padding: 8px 10px; resize: vertical; color: var(--text); background: rgba(251, 251, 247, .92); border: 1px solid var(--border); border-radius: 9px; outline: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; line-height: 1.42; }
.editor-dictionary-card[data-editor-section="vocabulary"].expanded textarea,
.editor-dictionary-card[data-editor-section="corrections"].expanded textarea { flex: 1 1 auto; height: auto; }
.editor-dictionary-card textarea:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .13); }
.editor-card-body .btn { position: static; align-self: flex-end; flex: 0 0 auto; min-width: 148px; margin-top: auto; }
.editor-settings-card { background: rgba(247, 241, 220, .5); border-color: rgba(201, 164, 55, .28); }
.editor-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; }
.editor-settings-grid label { display: grid; gap: 3px; color: var(--muted); font-size: .63rem; font-weight: 680; }
.editor-settings-grid input { width: 100%; min-height: 31px; padding: 4px 7px; color: var(--text); background: rgba(251, 251, 247, .92); border: 1px solid var(--border); border-radius: 7px; outline: none; font-size: .72rem; font-variant-numeric: tabular-nums; }
.editor-settings-grid input:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .13); }
.editor-settings-grid .editor-setting-wide { grid-column: 1 / -1; }
.editor-settings-card #editor-reflow-hint.unavailable { color: var(--err); }
#editor-status, #align-status { color: var(--muted); font-size: .78rem; }
.target-box { width: min(680px, 100%) !important; }
.target-current { display: grid; gap: 3px; padding: 11px 12px; color: var(--muted); background: rgba(230, 232, 221, .48); border: 1px solid var(--border-soft); border-radius: 10px; font-size: .76rem; line-height: 1.4; }
.target-current strong { color: var(--text); font-size: .79rem; }
.target-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.initial-en-source { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr); gap: 12px; align-items: center; }
.initial-en-source > small { color: var(--muted); font-size: .69rem; line-height: 1.4; }
.initial-en-source > small.error { color: var(--err); }
.compact-file-picker { min-height: 58px !important; padding: 9px 12px !important; }
.compact-file-picker > span { display: grid; gap: 2px; }
.compact-file-picker strong { color: var(--text); font-size: .77rem; }
.compact-file-picker small { color: var(--muted); font-size: .66rem; line-height: 1.35; }
.target-combination { min-height: 38px; padding: 9px 11px; color: var(--ok); background: rgba(219, 230, 211, .42); border: 1px solid rgba(92, 119, 72, .22); border-radius: 9px; font-size: .73rem; line-height: 1.4; }
.target-combination.duplicate { color: #755a0c; background: rgba(247, 233, 189, .42); border-color: rgba(201, 164, 55, .35); }
#target-status { color: var(--muted); font-size: .76rem; }
.import-srt-box { width: min(620px, 100%) !important; }
.import-srt-safety { font-size: .74rem; }
#srt-import-status { color: var(--muted); font-size: .76rem; }
.history-box { width: min(640px, 100%) !important; }
.history-list { display: grid; gap: 8px; min-height: 90px; max-height: 430px; overflow-y: auto; }
.history-empty { display: grid; place-items: center; min-height: 110px; color: var(--muted); font-size: .84rem; border: 1px dashed var(--border); border-radius: 10px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; background: rgba(251,251,247,.62); border: 1px solid var(--border-soft); border-radius: 10px; }
.history-copy { display: grid; gap: 3px; min-width: 0; }
.history-copy strong { overflow: hidden; color: var(--text); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.history-version { display: inline-block; margin-right: 7px; padding: 2px 5px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 5px; font-size: .64rem; }
.history-copy small, #history-status { color: var(--muted); font-size: .72rem; }
.history-restore { min-height: 34px; padding: 6px 10px; }
.modal-hint { color: var(--muted); font-size: .87rem; }
.file-picker { position: relative; display: grid; place-items: center; min-height: 88px; padding: 14px; color: var(--muted); background: rgba(251, 251, 247, .6); border: 1px dashed var(--border); border-radius: 11px; cursor: pointer; text-align: center; transition: transform .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease), box-shadow .22s var(--ease); }
.file-picker:hover, .file-picker:focus-within { color: var(--accent-deep); background: var(--accent-soft); border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(225, 190, 86, .13); }
.file-picker.drag { color: var(--accent-deep); background: var(--accent-soft); border-color: var(--accent-dark); box-shadow: 0 0 0 4px rgba(225, 190, 86, .14), 0 0 20px rgba(225, 190, 86, .28); transform: scale(1.01); animation: dropPulse .9s ease-in-out infinite alternate; }
.file-picker.invalid { color: var(--err); background: var(--err-soft); border-color: var(--err); }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.radio-group { display: grid; gap: 10px; }
.radio-group label { display: flex; gap: 11px; align-items: flex-start; padding: 12px; background: rgba(251, 251, 247, .55); border: 1px solid var(--border-soft); border-radius: 10px; cursor: pointer; }
.radio-group input { margin-top: 3px; accent-color: var(--accent-dark); }
.radio-group span { display: grid; gap: 2px; }
.radio-group small { color: var(--muted); }
.radio-group label.disabled { opacity: .45; cursor: not-allowed; }
.delete-project-box { position: relative; max-width: 510px !important; gap: 13px; overflow: hidden; border-color: rgba(166, 61, 46, .28); }
.delete-project-box::before { content: ""; position: absolute; top: -95px; right: -85px; width: 230px; height: 230px; background: radial-gradient(circle, rgba(243, 221, 216, .9), transparent 68%); pointer-events: none; }
.delete-warning-icon { position: absolute; z-index: 1; top: 21px; right: 22px; width: 42px; height: 42px; display: grid; place-items: center; color: var(--err); background: var(--err-soft); border: 1px solid rgba(166, 61, 46, .24); border-radius: 50%; }
.delete-warning-icon .icon { width: 20px; height: 20px; }
.delete-project-box h2 { position: relative; padding-right: 54px; font-size: 1.28rem; }
.delete-project-warning { position: relative; color: var(--text); font-size: .88rem; line-height: 1.5; }
.delete-project-list { display: grid; gap: 5px; margin-left: 19px; color: var(--muted); font-size: .82rem; }
.delete-project-list li::marker { color: var(--err); }
.delete-project-note { color: var(--err); font-size: .78rem; font-weight: 650; }
.delete-project-actions { justify-content: flex-end; margin-top: 3px; padding-top: 13px; border-top: 1px solid var(--border-soft); }
.btn.delete-confirm { color: #fff; background: linear-gradient(135deg, #bd5141, var(--err)); border-color: #8f3024; box-shadow: 0 5px 14px rgba(166, 61, 46, .18); }
.btn.delete-confirm:hover { color: #fff; background: linear-gradient(135deg, #ca5c4b, #973426); border-color: #7f291f; box-shadow: 0 8px 18px rgba(166, 61, 46, .24); }
.btn.delete-confirm:focus-visible { border-color: #7f291f; box-shadow: 0 0 0 3px rgba(166, 61, 46, .2), 0 5px 14px rgba(166, 61, 46, .18); }
.toast-region { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 250px; max-width: 380px; padding: 12px 14px; color: var(--text); background: rgba(251, 251, 247, .96); border: 1px solid var(--border); border-left: 4px solid var(--accent-dark); border-radius: 10px; box-shadow: var(--shadow); animation: toastIn .28s var(--ease) both; }
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--err); }
.toast.leaving { animation: toastOut .25s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px) scale(.98); } }
#confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

/* Responsive */
@media (max-width: 1080px) {
  .workspace-shell { grid-template-columns: 285px minmax(0, 1fr); }
  .config-panel { padding: 18px; }
  .audio-panel { padding: 14px 16px 11px; }
  .transcript-panel { padding: 21px; }
  .player-controls { grid-template-columns: 40px 34px 34px minmax(0, 1fr) auto; }
  .player-controls .time.current, .player-controls .volume-icon, .player-controls .volume { display: none; }
  .processing-strip { gap: 9px; }
  .pipeline { gap: 6px; }
  .pipeline-state { display: none; }
  .transcript-table-head, .transcript-row { grid-template-columns: 34px 98px 98px 64px minmax(190px, 1fr) 34px; gap: 7px; }
  .metric-chip em { display: none; }
  .processing-config { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .processing-config .language-fields, .processing-config .advanced-settings { grid-column: 1 / -1; }
  .processing-config .deepl-usage, .processing-config .chant-toggle { grid-column: auto; }
}

@media (max-width: 820px) {
  .topbar { height: 62px; }
  .workspace-shell { width: min(100% - 20px, 760px); grid-template-columns: 1fr; margin-top: 10px; }
  .config-panel { position: static; max-height: none; }
  .app-page.has-jobs .content-column { order: 1; }
  .app-page.has-jobs .config-panel { order: 2; }
  .dropzone { min-height: 109px; }
  .job-list { max-height: 170px; }
  .config-fields { grid-template-columns: 1fr 1fr; }
  .paired-fields { grid-column: 1 / -1; }
  .advanced-settings { grid-column: 1 / -1; }
  .empty-workspace { min-height: 500px; }
  .prepare-workspace { min-height: 500px; }
  .system-status > span { display: none; }
  .editor-box { height: calc(100vh - 24px); overflow-y: auto; }
  .editor-workspace { flex: none; grid-template-columns: 1fr; }
  .editor-srt-pane { min-height: 430px; }
  .editor-dictionary { overflow-y: visible; margin-top: 0; padding-right: 0; }
}

@media (max-width: 620px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand { flex-shrink: 0; gap: 7px; font-size: .92rem; white-space: nowrap; }
  .brand-wave { transform: scale(.8); transform-origin: left center; margin-right: -5px; }
  .topbar-actions { gap: 5px; }
  .system-status, .topbar-divider, .topbar-button span { display: none; }
  .system-telemetry { gap: 4px; }
  .metric-chip { min-height: 29px; gap: 3px; padding: 3px 5px; }
  .metric-chip small { font-size: .5rem; }
  .metric-chip strong { font-size: .64rem; }
  .disk-metric { gap: 4px; }
  .disk-metric > small { display: none; }
  .workspace-shell { width: calc(100% - 12px); }
  .config-fields { grid-template-columns: 1fr; }
  .prepare-workspace { gap: 15px; padding: 19px 15px; }
  .prepare-head { display: grid; }
  .prepare-head > button { justify-self: start; }
  .pending-files { grid-template-columns: 1fr; }
  .processing-settings { padding: 15px 12px; }
  .processing-config .language-fields, .processing-config .deepl-usage,
  .processing-config .chant-toggle, .processing-config .advanced-settings,
  .processing-config .initial-en-source { grid-column: auto; }
  .initial-en-source { grid-template-columns: 1fr; }
  .prepare-actions { display: grid; }
  .prepare-actions > div { width: 100%; }
  .prepare-actions .btn { flex: 1; }
  .glossary-editor-actions { display: grid; }
  .glossary-editor-actions .btn { width: 100%; }
  .editor-srt-pane { min-height: 360px; }
  .editor-dictionary-card { min-height: 0; }
  .editor-card-body .btn { width: 100%; }
  .advanced-settings { grid-column: auto; }
  .audio-panel { padding: 12px 11px 9px; border-radius: 13px; }
  .transcript-panel { padding: 17px 14px; border-radius: 13px; }
  .section-head { align-items: center; }
  .media-summary { font-size: .78rem; }
  .media-summary #active-file-meta, .media-summary #active-file-size { font-size: .68rem; }
  .status-chip { padding: 5px 8px; }
  .waveform-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 6px; margin-top: 6px; }
  .waveform-wrap { height: 64px; }
  .vu-meter { height: 74px; }
  .player-controls { grid-template-columns: 40px 32px 32px minmax(0, 1fr) auto; gap: 5px; }
  .processing-strip { gap: 7px; margin-top: 6px; padding-top: 6px; }
  .pipeline { gap: 4px; }
  .pipeline-step { gap: 3px; }
  .pipeline-step:not(:last-child)::after { margin-left: 1px; }
  .pipeline-node { width: 19px; height: 19px; font-size: .52rem; }
  .pipeline-label { font-size: .61rem; }
  .processing-message { font-size: .61rem; }
  .transcript-head { display: grid; }
  .transcript-actions { justify-content: flex-start; }
  .transcript-table-head { display: none; }
  .transcript-rows { max-height: 520px; }
  .transcript-row { grid-template-columns: 28px 1fr 32px; gap: 7px; padding: 10px 8px; }
  .transcript-time.start { grid-column: 2; grid-row: 1; }
  .transcript-time.end { grid-column: 2; grid-row: 1; justify-self: end; }
  .transcript-time.duration { grid-column: 2; grid-row: 1; justify-self: center; }
  .transcript-text { grid-column: 2; grid-row: 2; }
  .cue-action, .cue-actions-edit { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .transcript-index { grid-row: 1 / 3; align-self: center; }
  .workspace-actions .btn { flex: 1 1 auto; }
  .btn.danger { margin-left: 0; }
  .modal { padding: 8px; }
  .modal-box { padding: 16px; border-radius: 13px; }
}

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

/* ---- Vocabular & corecturi + elemente noi (2026-07-19) ---- */
.chant-toggle { display: flex; gap: 9px; align-items: center; padding: 4px 2px; color: var(--muted); font-size: .8rem; cursor: pointer; }
.chant-toggle input { width: 16px; height: 16px; accent-color: var(--accent-dark); cursor: pointer; }
.chant-toggle:hover { color: var(--text); }

.deepl-usage { padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: .72rem; }
.deepl-usage strong { color: var(--text); }
.deepl-usage.warning { border-color: var(--err); background: var(--err-soft); color: var(--err); }

.advanced-grid .full-row { grid-column: 1 / -1; }
.advanced-grid textarea { min-height: 52px; padding: 7px 9px; font: inherit; font-size: .78rem; color: var(--text); background: rgba(251, 251, 247, .9); border: 1px solid var(--border); border-radius: 9px; resize: vertical; }
.advanced-grid textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent-dark); }

.glossary-button { justify-content: center; width: 100%; }
.glossary-box { width: min(720px, 100%) !important; gap: 13px; }
.glossary-project { padding: 9px 11px; color: var(--text); background: var(--accent-soft); border: 1px solid rgba(201, 164, 55, .35); border-radius: 9px; font-size: .78rem; }
.glossary-project strong { color: var(--accent-deep); }
.glossary-editor { display: grid; gap: 9px; padding: 13px; background: rgba(230, 232, 221, .34); border: 1px solid var(--border-soft); border-radius: 11px; }
.glossary-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.glossary-editor-head > div { display: grid; gap: 2px; }
.glossary-editor-head strong { font-size: .88rem; }
.glossary-editor-head small { color: var(--muted); font-size: .68rem; font-weight: 450; }
.glossary-editor-head > span { padding: 4px 7px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; font-size: .61rem; font-weight: 720; letter-spacing: .04em; text-transform: uppercase; }
.glossary-field { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.glossary-field textarea { padding: 9px 11px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; line-height: 1.5; color: var(--text); background: rgba(251, 251, 247, .9); border: 1px solid var(--border); border-radius: 10px; resize: vertical; }
.glossary-field textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent-dark); }
.glossary-field code { font-size: .78em; }
.glossary-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.glossary-editor-actions small { max-width: 430px; color: var(--muted); font-size: .67rem; line-height: 1.4; }
.glossary-editor-actions .btn { flex: 0 0 auto; min-width: 148px; }
.glossary-status-row { min-height: 20px; justify-content: flex-start; }
.modal-hint code { padding: 1px 5px; background: var(--surface-soft); border-radius: 5px; font-size: .85em; }
