@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #060814;
  --bg-deep: #090d1f;
  --panel: rgba(12, 16, 30, 0.88);
  --panel-2: rgba(255, 255, 255, 0.045);
  --panel-3: rgba(255, 255, 255, 0.03);
  --line: rgba(132, 154, 255, 0.18);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f5f7ff;
  --muted: #9ea8c6;
  --primary: #7e63ff;
  --primary-soft: rgba(126, 99, 255, 0.2);
  --secondary: #3ba8ff;
  --green: #63dfb2;
  --yellow: #f0c56c;
  --red: #ff6d8f;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(126, 99, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 168, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #050712 0%, #060914 45%, #04060e 100%);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(126, 99, 255, 0.18), transparent 18%),
    radial-gradient(circle at 80% 14%, rgba(59, 168, 255, 0.1), transparent 18%),
    radial-gradient(circle at 55% 88%, rgba(99, 223, 178, 0.07), transparent 20%);
  filter: blur(18px);
}

body::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 92%);
}

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

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

.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px;
  border-radius: 34px;
  border: 1px solid rgba(132, 154, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(16, 20, 38, 0.94), rgba(8, 11, 24, 0.94)),
    rgba(8, 11, 24, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(126, 99, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand-mark span {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transform-origin: center;
}

.brand-mark span:first-child {
  transform: translate(-50%, -70%) rotate(45deg);
}

.brand-mark span:last-child {
  width: 9px;
  height: 9px;
  transform: translate(-15%, -10%) rotate(45deg);
  opacity: 0.82;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
}

.brand-copy span,
.sub,
.card-head p,
.stage-copy,
.field textarea::placeholder,
.field input::placeholder,
.upload-card p,
.upload-card small,
small,
p {
  color: var(--muted);
}

.brand-copy span {
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  margin-bottom: 22px;
  border-radius: 22px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.nav-btn {
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-btn:hover,
.nav-btn.active {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(126, 99, 255, 0.22), rgba(59, 168, 255, 0.12)),
    rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(126, 99, 255, 0.26);
}

.nav-btn:hover {
  transform: translateY(-1px);
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: rise-in 0.3s ease;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: var(--shadow);
}

.workflow-panel,
.stage-panel {
  min-height: 100%;
}

.workflow-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-intro {
  display: grid;
  gap: 10px;
}

.eyebrow,
.section-label,
.quick-card span {
  margin: 0;
  color: #cfc4ff;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
}

.section-label {
  margin-bottom: 6px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  max-width: 13ch;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.sub {
  max-width: 54ch;
  font-size: 14px;
  line-height: 1.65;
}

.step-stack {
  display: grid;
  gap: 14px;
}

.upload-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.upload-card:hover {
  border-color: rgba(126, 99, 255, 0.42);
  background: rgba(126, 99, 255, 0.07);
  transform: translateY(-1px);
}

.upload-card.required {
  border-color: rgba(99, 223, 178, 0.24);
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-head h2 {
  font-size: 18px;
}

.step-head p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(126, 99, 255, 0.22);
  flex: 0 0 auto;
}

.upload-card input {
  width: 100%;
  color: var(--muted);
}

.upload-card input::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
}

.upload-card input:disabled,
.url-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-card input:disabled::file-selector-button {
  cursor: not-allowed;
}

.upload-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card small.url-hint {
  margin-top: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  opacity: 0.65;
  font-size: 0.78rem;
  line-height: 1.4;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
}

.field textarea,
.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(3, 5, 12, 0.72);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 132px;
}

.field textarea:focus,
.field input:focus,
.field select:focus {
  border-color: rgba(126, 99, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(126, 99, 255, 0.12);
  background: rgba(4, 7, 16, 0.92);
}

.field.small {
  margin: 0;
}

.status-note {
  margin-top: 6px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.url-processing-note {
  margin-top: 8px;
}

.url-processing-note strong {
  color: var(--text);
  font-weight: 750;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.primary,
.ghost {
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  min-height: 54px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), #5a79ff);
  box-shadow: 0 20px 42px rgba(89, 101, 255, 0.28);
}

.primary:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
}

.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.stage-panel.has-output .stage-hero,
.stage-panel.has-output .quick-points {
  display: none;
}

.stage-panel.has-output .output-shell {
  margin-top: 0;
}

.stage-panel.has-output .video-frame {
  min-height: 520px;
}

.stage-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 0;
}

.stage-hero.compact {
  max-width: 760px;
}

.stage-orb {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 45%, rgba(126, 99, 255, 0.34), rgba(126, 99, 255, 0.08) 65%, transparent 100%),
    rgba(126, 99, 255, 0.06);
  border: 1px solid rgba(126, 99, 255, 0.22);
  box-shadow: 0 24px 48px rgba(72, 47, 173, 0.22);
}

.stage-orb::before,
.stage-orb::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  background: linear-gradient(135deg, #ccbfff, #7aa9ff);
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 4px;
}

.stage-orb::before {
  width: 18px;
  height: 18px;
}

.stage-orb::after {
  width: 8px;
  height: 8px;
  opacity: 0.82;
  margin-left: 12px;
  margin-top: -10px;
}

.stage-title {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  max-width: 15ch;
}

.stage-copy {
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.65;
}

.quick-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--panel-2);
  min-height: 82px;
}

.quick-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.quick-card span {
  display: block;
  margin-bottom: 8px;
}

.output-shell {
  margin-top: 0;
  padding: 20px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(4, 7, 17, 0.74);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-head p {
  margin-top: 4px;
  line-height: 1.5;
  font-size: 14px;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  color: var(--green);
  border-color: rgba(99, 223, 178, 0.3);
}

.status-pill.bad {
  color: var(--red);
  border-color: rgba(255, 109, 143, 0.3);
}

.badge.primary {
  color: #e1d9ff;
  border-color: rgba(126, 99, 255, 0.28);
  background: rgba(126, 99, 255, 0.14);
}

.badge.fast {
  color: #d8ecff;
  border-color: rgba(59, 168, 255, 0.28);
  background: rgba(59, 168, 255, 0.12);
}

.badge.warn {
  color: var(--yellow);
  border-color: rgba(240, 197, 108, 0.3);
  background: rgba(240, 197, 108, 0.12);
}

.badge.danger {
  color: var(--red);
  border-color: rgba(255, 109, 143, 0.3);
  background: rgba(255, 109, 143, 0.12);
}

.badge.muted {
  color: var(--muted);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.25s ease;
}

.video-frame {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at top, rgba(126, 99, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(5, 7, 16, 0.94), rgba(2, 4, 10, 0.96));
  display: grid;
  place-items: center;
  padding: 16px;
}

.video-frame video {
  width: 100%;
  max-height: 540px;
  display: none;
  background: #000;
  object-fit: contain;
  border-radius: 18px;
}

.video-frame span {
  color: var(--muted);
}

.video-player {
  position: relative;
  z-index: 2;
  width: 100%;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: auto;
}

.video-player[hidden] {
  display: none !important;
}

.video-player video {
  width: 100%;
  max-height: 540px;
  display: block;
  background: #000;
  object-fit: contain;
  border-radius: 18px;
  cursor: pointer;
  pointer-events: auto;
}

.video-controls {
  position: absolute;
  z-index: 20;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border-radius: 14px;
  background: rgba(3, 5, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.video-control-button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  pointer-events: auto;
}

.video-control-button:hover,
.video-control-button:focus-visible {
  border-color: rgba(126, 99, 255, 0.55);
  background: rgba(126, 99, 255, 0.2);
  outline: none;
}

.video-seek {
  flex: 1 1 160px;
  min-width: 90px;
  cursor: pointer;
  accent-color: var(--primary);
  pointer-events: auto;
}

.video-time {
  flex: 0 0 auto;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.video-player:fullscreen,
.video-player:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: #000;
}

.video-player:fullscreen video,
.video-player:-webkit-full-screen video {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.links a {
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.links a:hover {
  border-color: rgba(126, 99, 255, 0.28);
  background: rgba(126, 99, 255, 0.08);
  transform: translateY(-1px);
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mode-btn:hover,
.mode-btn.active {
  color: var(--text);
  border-color: rgba(126, 99, 255, 0.34);
  background: rgba(126, 99, 255, 0.12);
  transform: translateY(-1px);
}

.advanced-panel {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 16px 16px;
}

.advanced-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 0;
  font-weight: 700;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel[open] summary {
  color: var(--text);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.silence-report {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.report-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.report-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-card strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.inline-warning {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(240, 197, 108, 0.24);
  background: rgba(240, 197, 108, 0.08);
  color: #f6dba1;
  font-size: 14px;
  line-height: 1.55;
}

.timeline-shell {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.timeline-head {
  margin-bottom: 14px;
}

.timeline-head h3,
.timeline-column h4 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.timeline-head p,
.timeline-column p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.timeline-bar {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.timeline-segment {
  height: 100%;
}

.timeline-segment.kept {
  background: linear-gradient(90deg, rgba(99, 223, 178, 0.92), rgba(79, 184, 255, 0.88));
}

.timeline-segment.removed {
  background: linear-gradient(90deg, rgba(255, 109, 143, 0.88), rgba(240, 197, 108, 0.78));
}

.timeline-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.timeline-column {
  min-width: 0;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.timeline-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.log-card {
  margin-top: 18px;
}

pre {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
  color: #dbe5ff;
  padding: 18px;
  font-size: 13px;
  line-height: 1.62;
}

code {
  color: #d8ccff;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .stage-title,
  h1 {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 14px;
  }

  .main {
    padding: 16px;
    border-radius: 24px;
  }

  .quick-points,
  .settings-grid,
  .controls,
  .mode-picker,
  .timeline-columns {
    grid-template-columns: 1fr;
  }

  .video-frame {
    min-height: 280px;
  }

  .video-controls {
    flex-wrap: wrap;
  }

  .video-seek {
    order: 10;
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .topbar,
  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-strip {
    grid-template-columns: 1fr;
  }

  .card,
  .output-shell {
    padding: 18px;
  }

  .upload-card {
    padding: 16px;
  }

  h1 {
    font-size: 30px;
  }

  .stage-title {
    font-size: 28px;
  }
}


.url-input {
  display: block;
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(3, 5, 12, 0.72);
  color: var(--text);
  padding: 13px 15px;
  font-size: 13px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.url-input::placeholder,
.upload-card .url-input::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.url-input:focus {
  border-color: rgba(126, 99, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(126, 99, 255, 0.12);
  background: rgba(4, 7, 16, 0.92);
}

.mode-lock,
.mode-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(3, 5, 12, 0.72);
  color: var(--text);
  padding: 14px 15px;
  min-height: 54px;
  display: flex;
  align-items: center;
  font-weight: 700;
}

.mode-select {
  appearance: auto;
  cursor: pointer;
  outline: none;
}

.mode-select:focus {
  border-color: rgba(126, 99, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(126, 99, 255, 0.12);
}

.usage-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 11px 13px;
  border: 1px solid rgba(131, 150, 214, .24);
  border-radius: 12px;
  background: rgba(12, 18, 41, .7);
}

.usage-row.selected {
  border-color: rgba(112, 97, 255, .75);
}

.usage-row.exhausted strong {
  color: #ffc2cf;
}

.usage-row span, .usage-row strong { font-weight: 700; }
.usage-row small { color: #b5bfdb; grid-column: 1 / -1; }
.usage-row a { color: #b4a4ff; grid-column: 1 / -1; font-weight: 700; }

.mode-select option:disabled {
  background: #02030a;
  color: rgba(255, 255, 255, 0.28);
}

/* VibeCut upload safety / legal acceptance */
.upload-terms-card {
  margin: 18px 0 6px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 194, 97, 0.35);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 194, 97, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.upload-terms-card .terms-title {
  font-weight: 800;
  color: #ffd38a;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.upload-terms-card p,
.upload-terms-card li {
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  line-height: 1.55;
}
.upload-terms-card ol {
  margin: 10px 0 10px 20px;
  padding: 0;
}
.upload-terms-card .terms-note {
  color: rgba(255, 211, 138, 0.92);
  margin-top: 10px;
}
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.24);
}
.terms-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.terms-check span {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  line-height: 1.45;
}
.compact-terms p {
  margin-bottom: 8px;
}
.legal-footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 8px 32px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
}
.legal-footer a,
.legal-footer span {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
}
.legal-footer a:hover {
  color: #fff;
}
.legal-page {
  max-width: 860px;
  margin: 40px auto;
  padding: 32px;
  color: rgba(255,255,255,0.86);
  line-height: 1.65;
}
.legal-page h1,
.legal-page h2 {
  color: #fff;
}


/* VibeCut Upload Terms modal overlay */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.terms-inline-note {
  margin: 12px 0 6px;
  color: rgba(255,255,255,0.66);
  font-size: 12px;
  line-height: 1.45;
}

.terms-inline-note.compact {
  margin-top: 10px;
}

.terms-accepted .terms-inline-note {
  color: rgba(170, 255, 207, 0.72);
}

.link-button,
.legal-footer-button {
  border: 0;
  background: transparent;
  color: #ffd38a;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.link-button:hover,
.legal-footer-button:hover {
  color: #fff;
  text-decoration: underline;
}

.terms-modal-open {
  overflow: hidden;
}

.terms-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(1, 3, 10, 0.78);
  backdrop-filter: blur(12px);
}

.terms-modal-overlay[hidden] {
  display: none !important;
}

.terms-modal-card {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 42px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(19, 22, 36, 0.98), rgba(8, 10, 19, 0.98));
  box-shadow: 0 28px 90px rgba(0,0,0,0.62), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}

.terms-modal-head {
  padding: 22px 26px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.terms-modal-head h2 {
  margin: 0 0 5px;
  color: #fff;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.terms-modal-head p {
  margin: 0;
  color: rgba(255,255,255,0.62);
  font-size: 13px;
}

.terms-modal-body {
  padding: 18px 26px;
  overflow: auto;
  color: rgba(255,255,255,0.84);
  line-height: 1.58;
  font-size: 14px;
}

.terms-modal-body ol {
  margin: 12px 0 12px 20px;
  padding: 0;
}

.terms-modal-body li {
  margin: 0 0 8px;
}

.terms-modal-note {
  color: rgba(255, 211, 138, 0.92);
  font-weight: 700;
}

.terms-modal-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 26px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
}

.terms-modal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255,255,255,0.86);
  font-size: 13px;
  line-height: 1.4;
}

.terms-modal-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.terms-accept-button {
  min-width: 110px;
}

.terms-accept-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

@media (max-width: 640px) {
  .terms-modal-actions {
    grid-template-columns: 1fr;
  }
  .terms-accept-button {
    width: 100%;
  }
}


/* Private beta account controls */
.account-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.account-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.account-link {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(126, 99, 255, 0.13);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
  .account-name { display: none; }
}

/* Report Abuse modal */
.abuse-modal-card {
  width: min(650px, calc(100vw - 32px));
}
.abuse-modal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.abuse-title-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.abuse-shield {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(145deg, #3f33c7, #7265ff);
  box-shadow: 0 12px 36px rgba(92, 76, 255, 0.32);
  transform: rotate(45deg);
}
.abuse-shield::first-letter {
  transform: rotate(-45deg);
}
.modal-close-button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.84);
  font-size: 28px;
  line-height: 1;
  padding: 0 3px;
  cursor: pointer;
}
.modal-close-button:hover { color: #fff; }
.abuse-modal-body {
  display: grid;
  gap: 15px;
}
.abuse-warning {
  margin: 0;
  color: #a9a0ff;
  font-size: 13px;
  line-height: 1.5;
}
.abuse-field {
  display: grid;
  gap: 7px;
}
.abuse-field > span {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.abuse-field em {
  color: rgba(255,255,255,0.56);
  font-style: normal;
  font-weight: 500;
}
.abuse-field small {
  color: rgba(255,255,255,0.52);
  font-size: 11px;
}
.abuse-field input,
.abuse-field select,
.abuse-field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: #0b1021;
  color: #fff;
  padding: 11px 13px;
  font: inherit;
  outline: none;
}
.abuse-field select:focus,
.abuse-field input:focus,
.abuse-field textarea:focus {
  border-color: #7265ff;
  box-shadow: 0 0 0 3px rgba(114,101,255,0.14);
}
.abuse-field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.5;
}
.abuse-count { text-align: right; }
.abuse-form-message {
  min-height: 20px;
  margin: 0;
  color: rgba(255,255,255,0.64);
  font-size: 12px;
  line-height: 1.45;
}
.abuse-form-message.ok { color: #9df0bd; }
.abuse-form-message.bad { color: #ff9da9; }
.abuse-full-page-link {
  margin: -5px 0 0;
  font-size: 12px;
}
.abuse-full-page-link a { color: #a99fff; }
.abuse-modal-actions {
  grid-template-columns: 1fr auto;
  justify-items: end;
}
.abuse-cancel-button,
.abuse-submit-button {
  min-width: 118px;
}
.abuse-modal-actions .abuse-cancel-button {
  justify-self: end;
}
@media (max-width: 640px) {
  .abuse-title-row { gap: 10px; }
  .abuse-shield { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
  .abuse-modal-actions { grid-template-columns: 1fr 1fr; }
  .abuse-cancel-button, .abuse-submit-button { width: 100%; }
}
