:root {
  --bg: #07090e;
  --bg-soft: #0c1018;
  --panel: rgba(14, 19, 29, 0.86);
  --panel-solid: #0e131d;
  --panel-raised: #121926;
  --line: rgba(146, 166, 199, 0.16);
  --line-strong: rgba(146, 166, 199, 0.32);
  --text: #edf2fb;
  --muted: #8b98ad;
  --muted-2: #647187;
  --accent: #6ee7c7;
  --accent-strong: #2fd3ad;
  --accent-ink: #05231c;
  --blue: #80b6ff;
  --blue-soft: rgba(128, 182, 255, 0.12);
  --amber: #ffc266;
  --amber-soft: rgba(255, 194, 102, 0.12);
  --red: #ff7b84;
  --red-soft: rgba(255, 123, 132, 0.1);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 18% -10%, rgba(47, 211, 173, 0.11), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(128, 182, 255, 0.08), transparent 30rem),
    var(--bg);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--mono);
  font-size: 0.86em;
  color: #c5d4e8;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.2;
}

.ambient-one {
  top: -16rem;
  left: -10rem;
  background: rgba(47, 211, 173, 0.5);
}

.ambient-two {
  top: 16rem;
  right: -22rem;
  background: rgba(73, 122, 255, 0.4);
}

.grid-overlay {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(146, 166, 199, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 166, 199, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(110, 231, 199, 0.5);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(110, 231, 199, 0.22), rgba(110, 231, 199, 0.03));
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  box-shadow: inset 0 0 24px rgba(110, 231, 199, 0.08);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-text small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge-green {
  border-color: rgba(110, 231, 199, 0.26);
  background: rgba(110, 231, 199, 0.07);
  color: var(--accent);
}

.badge-blue {
  border-color: rgba(128, 182, 255, 0.24);
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-amber {
  border-color: rgba(255, 194, 102, 0.26);
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-red {
  border-color: rgba(255, 123, 132, 0.26);
  background: var(--red-soft);
  color: var(--red);
}

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

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 6px;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
  padding: clamp(64px, 10vw, 122px) 0 clamp(54px, 8vw, 94px);
}

.eyebrow,
.index {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 700px;
  margin: 18px 0 22px;
  font-size: clamp(42px, 6.4vw, 78px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
  text-shadow: 0 0 42px rgba(110, 231, 199, 0.15);
}

.lede {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.hero-facts span {
  margin-right: 6px;
  color: var(--accent);
}

.parse-card,
.panel,
.analysis-card,
.detail-card,
.meta-card,
.note-card {
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(20, 28, 42, 0.72), rgba(9, 13, 20, 0.6));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.parse-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  overflow: hidden;
}

.parse-card::before {
  position: absolute;
  top: 0;
  left: 28px;
  width: 90px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
  content: "";
}

.parse-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(110, 231, 199, 0.07), 0 0 14px rgba(110, 231, 199, 0.6);
}

label,
.field-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.input-row {
  display: flex;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: rgba(4, 7, 12, 0.56);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input {
  padding: 0 15px;
  font-family: var(--mono);
  font-size: 13px;
}

input::placeholder {
  color: #58667e;
}

input:focus,
select:focus {
  border-color: rgba(110, 231, 199, 0.58);
  background: rgba(4, 7, 12, 0.76);
  box-shadow: 0 0 0 3px rgba(110, 231, 199, 0.08);
}

select {
  appearance: none;
  padding: 0 38px 0 13px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 21px,
    calc(100% - 14px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  font-size: 12px;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 150ms ease, opacity 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 30px rgba(47, 211, 173, 0.14);
}

.button-primary:hover:not(:disabled) {
  background: #8bf1d7;
}

.button-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.button-ghost:hover:not(:disabled) {
  border-color: rgba(110, 231, 199, 0.4);
  background: rgba(110, 231, 199, 0.06);
}

.button.is-loading .button-label {
  opacity: 0.4;
}

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(5, 35, 28, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .spinner {
  display: block;
}

.spinner-large {
  display: block;
  width: 30px;
  height: 30px;
  border-color: rgba(110, 231, 199, 0.2);
  border-top-color: var(--accent);
  margin-bottom: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint,
.control-note {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
}

.parse-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.panel {
  margin-top: 26px;
  padding: clamp(22px, 3.2vw, 36px);
  border-radius: var(--radius);
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.76fr);
  gap: 36px;
  align-items: center;
  border-color: rgba(255, 194, 102, 0.22);
}

.panel-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.panel-heading h2 {
  margin: 4px 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.03em;
}

.panel-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.login-form label {
  margin-bottom: 9px;
}

.inline-error {
  margin: 12px 0 0;
  color: var(--red);
  font-size: 12px;
}

.results {
  margin-top: 18px;
  animation: rise 380ms ease both;
}

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

.result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 18px;
  border-top: 1px solid var(--line);
}

.video-title {
  max-width: 820px;
  margin: 8px 0 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

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

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: #030508;
  aspect-ratio: 16 / 9;
}

.player-shell video {
  display: block;
  width: 100%;
  height: 100%;
  background: #030508;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(110, 231, 199, 0.055), transparent 48%),
    rgba(3, 5, 8, 0.78);
  text-align: center;
}

.player-overlay p {
  margin: 4px 0;
  color: var(--text);
  font-size: 14px;
}

.player-overlay small {
  color: var(--muted-2);
  font-size: 11px;
}

.player-spinner {
  background: rgba(3, 5, 8, 0.9);
}

.play-glyph {
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border: 1px solid rgba(110, 231, 199, 0.32);
  border-radius: 50%;
  background: rgba(110, 231, 199, 0.06);
  box-shadow: 0 0 36px rgba(110, 231, 199, 0.08);
}

.play-glyph::after {
  display: block;
  width: 0;
  height: 0;
  margin: 18px 0 0 22px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--accent);
  content: "";
}

.control-deck {
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--panel);
}

.control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.field {
  min-width: 0;
}

.segmented {
  display: flex;
  min-height: 48px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 7, 12, 0.45);
}

.segment {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 13px;
  font-size: 11px;
  white-space: nowrap;
}

.segment.active {
  background: rgba(110, 231, 199, 0.1);
  color: var(--accent);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.control-note {
  margin-top: 11px;
  min-height: 18px;
}

.notice,
.warnings {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(128, 182, 255, 0.22);
  border-radius: 12px;
  background: var(--blue-soft);
  color: #b8d2f7;
  font-size: 12px;
  line-height: 1.65;
}

.warnings {
  border-color: rgba(255, 194, 102, 0.2);
  background: var(--amber-soft);
  color: #e8c891;
}

.warnings ul {
  margin: 0;
  padding-left: 18px;
}

.analysis-column {
  display: grid;
  gap: 12px;
}

.analysis-card,
.detail-card,
.meta-card {
  padding: 20px;
  border-radius: 16px;
  box-shadow: none;
}

.analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.analysis-head h3 {
  margin: 6px 0 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.analysis-head h3 span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 18px;
}

.confidence-row {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  color: var(--muted);
  font-size: 11px;
}

.confidence-row strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}

progress {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.06);
}

progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.analysis-copy {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.candidate-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.candidate-button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10px;
}

.candidate-button:hover {
  border-color: rgba(110, 231, 199, 0.46);
  color: var(--accent);
}

.detail-card {
  color: var(--muted);
}

.detail-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}

.detail-card summary::-webkit-details-marker {
  display: none;
}

.detail-card summary span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.detail-card summary::after {
  margin-left: 8px;
  color: var(--muted-2);
  content: "+";
  font-family: var(--mono);
}

.detail-card[open] summary::after {
  content: "−";
}

.evidence-list,
.break-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  line-height: 1.65;
}

.evidence-list li,
.break-list li {
  position: relative;
  padding-left: 13px;
}

.evidence-list li::before,
.break-list li::before {
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.empty-line {
  color: var(--muted-2);
}

.empty-line::before {
  background: var(--muted-2) !important;
}

.meta-card {
  display: grid;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
}

.meta-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meta-card span {
  color: var(--muted-2);
}

.meta-card strong {
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.error-panel {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  border-color: rgba(255, 123, 132, 0.24);
  background: linear-gradient(150deg, rgba(38, 17, 23, 0.7), rgba(9, 13, 20, 0.7));
}

.error-icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 123, 132, 0.34);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--mono);
  font-size: 20px;
}

.error-copy h2 {
  margin: 6px 0 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.error-copy > p {
  max-width: 720px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.error-code {
  color: var(--red) !important;
  font-family: var(--mono);
  font-size: 10px !important;
}

.error-copy details {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 11px;
}

.error-copy pre {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--mono);
  font-size: 10px;
  white-space: pre-wrap;
}

.notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 64px;
}

.note-card {
  padding: 22px;
  border-radius: 16px;
  box-shadow: none;
}

.note-card h3 {
  margin: 12px 0 9px;
  font-size: 15px;
}

.note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 52px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100vw - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(110, 231, 199, 0.3);
  border-radius: 12px;
  background: rgba(9, 20, 18, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  color: #c9f7ea;
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 220ms ease both;
}

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 62px;
  }

  .parse-card {
    max-width: 680px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .analysis-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .shell {
    width: calc(100% - 28px);
  }

  .topbar {
    padding: 18px 0;
  }

  .brand-text small {
    display: none;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .hero-facts {
    display: grid;
    gap: 8px;
  }

  .parse-card,
  .panel {
    padding: 20px;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row .button {
    width: 100%;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .badge-row {
    justify-content: flex-start;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .analysis-column {
    grid-template-columns: 1fr;
  }

  .notes {
    grid-template-columns: 1fr;
    margin-top: 42px;
  }

  .footer {
    flex-direction: column;
    gap: 6px;
  }

  .action-row .button {
    flex: 1 1 140px;
  }

  .error-panel {
    flex-direction: column;
  }

  .toast {
    right: 14px;
    bottom: 14px;
  }
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(10px);
  animation: modal-fade 180ms ease both;
}

.download-modal {
  width: min(520px, 100%);
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 0%, rgba(110, 231, 199, 0.08), transparent 18rem),
    linear-gradient(145deg, #111824, #0a0e16);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62);
  animation: modal-rise 220ms ease both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin: 7px 0 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.modal-file {
  margin: 18px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.modal-progress {
  margin-top: 24px;
}

.modal-progress progress {
  height: 7px;
}

.download-stats {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.download-stats span:first-child {
  color: var(--accent);
}

.modal-status {
  min-height: 22px;
  margin: 20px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.modal-detail {
  min-height: 38px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.modal-actions .button {
  min-height: 42px;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 680px) {
  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .download-modal {
    width: 100%;
    border-radius: 18px;
  }

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