:root {
  --background: #111315;
  --panel: #181b1e;
  --panel-soft: #1f2327;
  --panel-hover: #272c31;
  --border: #30363c;
  --border-strong: #454d55;
  --text: #f7f5f2;
  --muted: #9ca4aa;
  --accent: #f24f82;
  --accent-bright: #ff6d9a;
  --accent-soft: rgba(242, 79, 130, 0.14);
  --success: #7cdda9;
  --success-soft: rgba(124, 221, 169, 0.13);
  --warning: #f5c66f;
  --warning-soft: rgba(245, 198, 111, 0.13);
  --danger: #ff8d83;
  --danger-soft: rgba(255, 141, 131, 0.13);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--background);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at 70% -10%,
      rgba(242, 79, 130, 0.13),
      transparent 34rem
    ),
    var(--background);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 3px;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 23px;
  letter-spacing: -0.02em;
}

h3 {
  margin-top: 4px;
  font-size: 20px;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(330px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 88px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 19, 21, 0.92);
  backdrop-filter: blur(18px);
}

.eyebrow,
.section-label,
.field-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-center,
.header-actions,
.deck-tabs,
.title-row,
.card-navigation,
.transport-row,
.transport-buttons,
.time-readout,
.voiceover-row,
.voiceover-toggle,
.voiceover-volume,
.field-heading,
.edit-meta,
.review-heading {
  display: flex;
  align-items: center;
}

.header-center,
.header-actions {
  gap: 12px;
}

.header-actions {
  justify-content: flex-end;
}

.deck-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.deck-tab {
  min-width: 48px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.deck-tab.active {
  color: white;
  background: var(--accent);
}

.reviewer-field {
  position: relative;
  display: block;
  width: 176px;
  height: 44px;
}

.reviewer-field span {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 12px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
}

.reviewer-field input {
  width: 100%;
  height: 44px;
  padding: 15px 12px 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: var(--panel);
  font-size: 12px;
}

.reviewer-field input:focus,
textarea:focus,
select:focus {
  border-color: rgba(242, 79, 130, 0.7);
  box-shadow: 0 0 0 3px rgba(242, 79, 130, 0.1);
}

.progress-summary {
  display: grid;
  min-width: 104px;
  text-align: right;
}

.progress-summary strong {
  font-size: 16px;
}

.progress-summary span,
.muted {
  color: var(--muted);
  font-size: 11px;
}

#save-status.saving {
  color: var(--warning);
}

#save-status.saved {
  color: var(--success);
}

.button,
.icon-button,
.play-button,
.text-button {
  border: 0;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button:active,
.icon-button:active,
.play-button:active {
  transform: translateY(1px);
}

.button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
}

.button.primary {
  color: white;
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-bright);
}

.button.secondary {
  border-color: var(--border);
  background: var(--panel-soft);
}

.button.secondary:hover,
.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(470px, 1fr) minmax(340px, 390px);
  min-height: calc(100vh - 88px);
}

.sidebar,
.review-panel {
  background: rgba(24, 27, 30, 0.84);
}

.sidebar {
  position: sticky;
  top: 88px;
  height: calc(100vh - 88px);
  border-right: 1px solid var(--border);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-heading > div {
  display: grid;
  gap: 3px;
}

select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  color: var(--text);
  background: var(--panel-soft);
}

.sidebar-heading select {
  max-width: 118px;
  font-size: 11px;
}

.locale-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-locales {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.locale-tab {
  flex: 1 1 38px;
  min-width: 38px;
  height: 31px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.locale-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.locale-tab.active {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.card-list {
  height: calc(100vh - 207px);
  padding: 8px;
  overflow-y: auto;
}

.card-list-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.card-list-item:hover {
  background: var(--panel-soft);
}

.card-list-item.active {
  border-color: rgba(242, 79, 130, 0.5);
  background: var(--accent-soft);
}

.card-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  font-size: 17px;
  font-weight: 650;
  background: var(--panel-hover);
}

.card-list-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.card-list-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-list-copy span {
  color: var(--muted);
  font-size: 10px;
}

.completion-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 11px;
  font-weight: 800;
}

.completion-mark.complete {
  color: var(--success);
  background: var(--success-soft);
}

.completion-mark.issue {
  color: var(--warning);
  background: var(--warning-soft);
}

.viewer-column {
  min-width: 0;
  padding: 22px 24px 26px;
}

.viewer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.title-row {
  gap: 10px;
}

.viewer-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.review-pill {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-pill.pending {
  color: var(--muted);
  background: var(--panel-soft);
}

.review-pill.complete {
  color: var(--success);
  background: var(--success-soft);
}

.review-pill.issue {
  color: var(--warning);
  background: var(--warning-soft);
}

.card-navigation {
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  min-width: 42px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  font-size: 12px;
}

.media-area {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)), #0c0e10;
}

.video-stage {
  position: relative;
  width: auto;
  max-width: 100%;
  height: min(61vh, 700px);
  max-height: 700px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 13px;
  background: #08090a;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #08090a;
}

.language-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 12, 13, 0.74);
  backdrop-filter: blur(10px);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.media-loading,
.media-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: rgba(8, 9, 10, 0.8);
  font-size: 12px;
}

.media-error {
  color: var(--danger);
}

.transport-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.transport-row {
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
}

.transport-buttons {
  gap: 8px;
}

.play-button {
  display: grid;
  width: 46px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-size: 15px;
}

.play-button:hover {
  background: var(--accent-bright);
}

.time-readout {
  gap: 7px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.time-readout strong {
  color: var(--text);
}

.voiceover-row {
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.voiceover-toggle {
  gap: 9px;
  font-size: 12px;
}

.voiceover-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 150ms ease;
}

.toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  transition: transform 150ms ease;
}

.voiceover-toggle input:checked + .toggle-track {
  background: var(--accent);
}

.voiceover-toggle input:checked + .toggle-track span {
  transform: translateX(15px);
}

.voiceover-volume {
  flex: 1;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.voiceover-volume input {
  max-width: 130px;
}

.review-panel {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 88px);
  padding: 20px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.review-heading,
.field-heading,
.edit-meta {
  justify-content: space-between;
  gap: 14px;
}

.autosave-label {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-card,
.verdict-card,
.comment-card {
  display: grid;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-soft);
}

.canonical-card {
  background: rgba(255, 255, 255, 0.025);
}

.field-heading > div,
.verdict-card > div {
  display: grid;
  gap: 4px;
}

.field-heading strong,
.verdict-card strong,
.comment-card strong {
  font-size: 12px;
}

.field-heading select {
  max-width: 130px;
  font-size: 10px;
}

.canonical-text {
  max-height: 170px;
  padding-right: 6px;
  overflow-y: auto;
  color: #d5d6d7;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: #15181b;
  font-size: 12px;
  line-height: 1.55;
}

#localized-text {
  min-height: 155px;
  padding: 12px;
}

#review-comment {
  min-height: 82px;
  padding: 10px;
}

.text-button {
  padding: 4px 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.text-button:hover {
  color: var(--accent-bright);
}

.edit-meta {
  color: var(--muted);
  font-size: 9px;
}

#text-change-status.changed {
  color: var(--warning);
}

.verdict-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.verdict-options button {
  min-height: 44px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: #171a1d;
  font-size: 9px;
  font-weight: 750;
}

.verdict-options button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.verdict-options button[data-verdict="pending"].active {
  color: var(--text);
  background: var(--panel-hover);
}

.verdict-options button[data-verdict="ok"].active {
  border-color: rgba(124, 221, 169, 0.55);
  color: var(--success);
  background: var(--success-soft);
}

.verdict-options button[data-verdict="issue"].active {
  border-color: rgba(245, 198, 111, 0.55);
  color: var(--warning);
  background: var(--warning-soft);
}

.review-complete {
  width: 100%;
  min-height: 48px;
  border-color: rgba(124, 221, 169, 0.36);
  color: var(--success);
  background: var(--success-soft);
}

.review-complete:hover {
  border-color: var(--success);
}

.review-complete.completed {
  color: #111915;
  background: var(--success);
}

.review-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: var(--text);
  background: #272c31;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .brand-block {
    grid-row: span 2;
  }

  .header-center,
  .header-actions {
    justify-content: flex-end;
  }

  .workspace {
    grid-template-columns: 230px minmax(430px, 1fr) 350px;
  }
}

@media (max-width: 1040px) {
  .topbar {
    position: relative;
    top: auto;
  }

  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    top: 0;
    height: 100vh;
  }

  .review-panel {
    position: relative;
    top: auto;
    grid-column: 2;
    height: auto;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .video-stage {
    height: min(58vh, 650px);
  }
}

@media (max-width: 760px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
  }

  .brand-block {
    flex: 1 1 180px;
  }

  .header-center,
  .header-actions {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .progress-summary {
    margin-right: auto;
    text-align: left;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .card-list {
    display: flex;
    height: auto;
    padding: 8px 10px 12px;
    overflow-x: auto;
  }

  .card-list-item {
    flex: 0 0 205px;
  }

  .viewer-column {
    padding: 18px 14px;
  }

  .video-stage {
    height: min(62vh, 590px);
  }

  .review-panel {
    padding: 18px 14px 28px;
  }
}

@media (max-width: 480px) {
  .reviewer-field {
    width: 145px;
  }

  .header-actions .button {
    flex: 1;
  }

  .viewer-heading {
    align-items: flex-start;
  }

  .voiceover-row,
  .transport-row {
    align-items: stretch;
    flex-direction: column;
  }

  .voiceover-volume {
    justify-content: flex-start;
  }

  .voiceover-volume input {
    max-width: none;
  }

  .verdict-options {
    grid-template-columns: 1fr;
  }
}
