:root {
  color-scheme: light;
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f7f4ec;
  --panel: #ffffff;
  --paper: #fffdf8;
  --ink: #14242c;
  --muted: #68747b;
  --line: #ded8cb;
  --teal: #087f92;
  --teal-dark: #066a79;
  --olive: #737b2e;
  --success: #4f8a34;
  --gold: #d89a27;
  --soft-blue: #e9f5f8;
  --soft-olive: #f3f2df;
  --soft-gold: #fff1cf;
  --shadow: 0 18px 44px rgba(20, 36, 44, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 241, 207, 0.78), transparent 34%),
    linear-gradient(150deg, #f7f4ec 0%, #edf6f7 52%, #f6f1e2 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon,
.inline-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.inline-icon {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  grid-template-rows: 1fr auto auto 1fr;
  gap: 12px;
  background: linear-gradient(160deg, #fbfaf6 0%, #eaf5f7 54%, #fff1cf 100%);
  opacity: 1;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.splash-screen.hidden {
  visibility: hidden;
  opacity: 0;
}

.splash-mark {
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 98px;
  height: 98px;
  border-radius: 28px;
  background: linear-gradient(145deg, var(--teal), #0f9aa9);
  color: white;
  box-shadow: 0 24px 60px rgba(8, 127, 146, 0.26);
}

.splash-mark .icon {
  width: 46px;
  height: 46px;
}

.splash-name {
  grid-row: 3;
  font-size: 28px;
  font-weight: 900;
}

.splash-caption {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 84px;
}

.app-shell.locked .screen,
.app-shell.locked .bottom-nav {
  display: none;
}

.app-shell.locked .content {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 20px;
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(20, 36, 44, 0.06);
  backdrop-filter: blur(16px);
}

.brand-mark,
.avatar,
.channel-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(145deg, var(--teal), #0f9aa9);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(8, 127, 146, 0.22);
}

.brand-mark .icon,
.channel-avatar .icon {
  width: 22px;
  height: 22px;
}

.avatar {
  margin-left: auto;
  border-radius: 50%;
  background: var(--soft-gold);
  color: var(--ink);
  box-shadow: none;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.status-line,
.muted,
.channel-row span {
  color: var(--muted);
}

.content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 28px 18px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(27px, 8vw, 38px);
  line-height: 1.15;
  letter-spacing: 0;
}

.screen,
.login-panel {
  display: none;
}

.hidden {
  display: none !important;
}

.screen.active,
.login-panel.active {
  display: grid;
  gap: 10px;
  animation: screen-in 260ms ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(8, 127, 146, 0.18);
  border-radius: 8px;
  background: rgba(233, 245, 248, 0.84);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.pipeline-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(222, 216, 203, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #354950;
  font-size: 13px;
  font-weight: 800;
}

.stack,
.publish-stack {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

#screen-processing .stack {
  margin-top: 0;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.field span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.field input,
.field select,
.select-card {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input:focus,
.field select:focus,
.select-card:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(8, 127, 146, 0.22);
  outline-offset: 2px;
}

.field input:focus,
.field select:focus,
.select-card:focus-visible {
  border-color: rgba(8, 127, 146, 0.55);
  background: white;
  box-shadow: 0 10px 30px rgba(8, 127, 146, 0.12);
}

.select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
}

.select-card span,
.language-option span:last-child {
  display: grid;
  gap: 2px;
}

.select-card small,
.language-option small,
.empty-state span {
  color: var(--muted);
  font-size: 13px;
}

.notice,
.ready-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px 10px;
  padding: 14px;
  border: 1px solid #c7d7dc;
  border-radius: 8px;
  background: var(--soft-blue);
  color: #155061;
}

.notice strong,
.notice span {
  grid-column: 2;
}

.lock-notice {
  border-color: #d3ce9a;
  background: var(--soft-olive);
  color: #4e5520;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary {
  background: linear-gradient(145deg, var(--teal), #0f9aa9);
  color: white;
  box-shadow: 0 16px 34px rgba(8, 127, 146, 0.22);
}

.primary:hover {
  background: var(--teal-dark);
}

.primary:active,
.secondary:active {
  transform: translateY(1px);
}

.primary:disabled {
  cursor: not-allowed;
  background: #9bb8be;
  box-shadow: none;
}

.secondary {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover {
  border-color: rgba(8, 127, 146, 0.34);
  box-shadow: 0 12px 26px rgba(20, 36, 44, 0.08);
}

.wide {
  width: 100%;
}

.empty-state {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 22px 18px;
  border: 1px dashed #c8d5d8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--teal);
}

.ready-banner {
  margin: 18px 0 16px;
  border-color: #cbdcb8;
  background: #eef6e8;
  color: var(--success);
  font-weight: 800;
}

.preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 127, 146, 0.24), rgba(20, 36, 44, 0.82)),
    #17242a;
  box-shadow: var(--shadow);
}

.media-comparison {
  display: grid;
  gap: 18px;
}

.media-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.media-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.media-label .icon {
  color: var(--teal);
}

.original-video {
  border: 0;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.channel-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(20, 36, 44, 0.07);
}

.channel-row div:last-child {
  display: grid;
  gap: 3px;
}

.channel-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -18px 34px rgba(20, 36, 44, 0.08);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-item .icon {
  width: 21px;
  height: 21px;
}

.nav-item.active {
  background: var(--soft-blue);
  color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(8, 127, 146, 0.1);
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: auto;
  padding: 24px 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 241, 207, 0.86), transparent 36%),
    linear-gradient(160deg, #fbfaf6, #eaf5f7);
}

.progress-overlay.hidden {
  display: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 44, 0.34);
  backdrop-filter: blur(8px);
}

.sheet-panel {
  position: absolute;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  gap: 12px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(222, 216, 203, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 28px 70px rgba(20, 36, 44, 0.24);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 4px;
  border-radius: 999px;
  background: #c8d5d8;
}

.sheet-panel h2 {
  margin: 0 2px 4px;
  font-size: 22px;
  line-height: 1.2;
}

.language-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(8, 127, 146, 0.22);
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--ink);
  text-align: left;
}

.language-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
}

.overlay-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
  color: var(--teal);
  font-weight: 800;
}

.progress-ring {
  --progress-angle: 166deg;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  margin: 32px auto;
  border: 18px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(#fbfaf6, #fbfaf6) padding-box,
    conic-gradient(var(--teal) var(--progress-angle), #e4ded2 0) border-box;
  font-size: 44px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.steps {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.steps li:not(.done):not(.current)::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid #cfc8ba;
  border-radius: 50%;
}

.steps .done {
  color: var(--success);
  font-weight: 800;
}

.steps .current {
  color: var(--teal);
  font-weight: 900;
}

@media (min-width: 900px) {
  .app-shell.locked .content {
    width: min(100%, 520px);
    padding: 32px 24px;
  }

  .content {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 32px 112px;
  }

  .screen.active,
  .login-panel.active {
    padding: 28px;
    border: 1px solid rgba(222, 216, 203, 0.82);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.76);
    box-shadow: var(--shadow);
  }

  .pipeline-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sheet-panel {
    right: auto;
    bottom: 32px;
    left: 50%;
    width: min(440px, calc(100vw - 40px));
    transform: translateX(-50%);
  }

}
