:root {
  --bg: #050913;
  --panel: rgba(9, 15, 31, 0.82);
  --panel-strong: rgba(11, 18, 38, 0.94);
  --border: rgba(244, 114, 182, 0.18);
  --border-strong: rgba(244, 114, 182, 0.28);
  --text: #f5f7ff;
  --muted: rgba(221, 230, 255, 0.68);
  --pink: #f472b6;
  --amber: #f59e0b;
  --blue: #60a5fa;
  --green: #22c55e;
  --danger: #fb7185;
  --shadow: 0 30px 80px rgba(1, 6, 18, 0.58);
  --mono: "Orbitron", sans-serif;
  --body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 16% 18%, rgba(244, 114, 182, 0.14), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(245, 158, 11, 0.12), transparent 28%),
    linear-gradient(180deg, #050913 0%, #02050d 100%);
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
}

.page-noise,
.page-grid,
.page-orb {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.page-noise {
  opacity: 0.15;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.26) 0 0.7px, transparent 0.9px),
    radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.16) 0 0.8px, transparent 1px);
  background-size: 16px 16px, 24px 24px;
  mix-blend-mode: soft-light;
}

.page-grid {
  background-image:
    linear-gradient(rgba(244, 114, 182, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 114, 182, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 88%);
}

.page-orb {
  filter: blur(96px);
  opacity: 0.48;
}

.page-orb--pink {
  inset: auto auto 8% -8%;
  width: 30rem;
  height: 30rem;
  background: rgba(244, 114, 182, 0.2);
}

.page-orb--amber {
  inset: 0 -8% auto auto;
  width: 28rem;
  height: 28rem;
  background: rgba(245, 158, 11, 0.18);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.app-header,
.hero-panel,
.panel,
.footer-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(11, 18, 37, 0.92) 0%, rgba(7, 12, 26, 0.84) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 24px;
  margin-bottom: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(245, 158, 11, 0.14)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(244, 114, 182, 0.24);
  color: var(--pink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(244, 114, 182, 0.08);
}

.brand-icon svg {
  width: 28px;
  height: 28px;
}

.brand-kicker,
.panel-eyebrow,
.hero-eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--pink);
}

.brand-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 114, 182, 0.3);
  background: rgba(244, 114, 182, 0.08);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 36px;
  margin-bottom: 22px;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 114, 182, 0.64), transparent);
}

.hero-copy {
  max-width: 780px;
}

.hero-title {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-title span {
  display: block;
}

.accent-word {
  color: var(--amber);
  text-shadow: 0 0 28px rgba(245, 158, 11, 0.24);
}

.hero-description {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #ffe4f3;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 22px;
}

.panel {
  border-radius: 28px;
  padding: 28px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.panel-header h2,
.footer-panel h2 {
  margin: 0;
  font-size: 1.5rem;
}

.upload-zone {
  position: relative;
  min-height: 260px;
  border-radius: 24px;
  border: 1.5px dashed rgba(244, 114, 182, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(5, 9, 19, 0.55);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.upload-zone.is-dragging {
  border-color: rgba(244, 114, 182, 0.45);
  transform: translateY(-2px);
  background:
    linear-gradient(180deg, rgba(244, 114, 182, 0.08), rgba(245, 158, 11, 0.06)),
    rgba(5, 9, 19, 0.7);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.upload-inner {
  max-width: 420px;
}

.upload-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(244, 114, 182, 0.14), rgba(245, 158, 11, 0.16)),
    rgba(255, 255, 255, 0.02);
  color: var(--pink);
  border: 1px solid rgba(244, 114, 182, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 50px rgba(244, 114, 182, 0.08);
}

.upload-icon svg {
  width: 42px;
  height: 42px;
}

.upload-title {
  margin: 0;
  font-size: 1.4rem;
}

.upload-description {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.75;
}

.upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.upload-badge strong {
  color: var(--pink);
}

.file-card,
.stats-grid,
.action-row,
.status-card,
.preview-meta,
.notes-list,
.tips-panel,
.mode-grid,
.range-block,
.group-block,
.plan-panel {
  margin-top: 20px;
}

.file-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.file-card__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.16), rgba(245, 158, 11, 0.16));
  color: #f9a8d4;
}

.file-card__icon svg {
  width: 28px;
  height: 28px;
}

.file-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.file-card__label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.file-card__name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  word-break: break-word;
}

.file-card__placeholder {
  color: rgba(216, 229, 255, 0.5);
}

.file-card__chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.18);
  color: var(--pink);
  font-size: 0.75rem;
  white-space: nowrap;
}

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

.stat-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.stat-card strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.45;
}

.mode-label,
.field-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-grid {
  display: grid;
  gap: 12px;
}

.mode-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.mode-card:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 114, 182, 0.22);
}

.mode-card.is-active {
  border-color: rgba(244, 114, 182, 0.34);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.08), rgba(245, 158, 11, 0.06));
}

.mode-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mode-card strong {
  display: block;
  font-size: 1rem;
}

.mode-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.22s ease, background 0.22s ease;
}

.field-input:focus {
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.06);
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.85rem;
}

.group-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-inline .field-input {
  max-width: 140px;
}

.tips-panel,
.notes-list,
.plan-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(244, 114, 182, 0.05);
  border: 1px solid rgba(244, 114, 182, 0.14);
}

.tips-panel h3,
.notes-list h3,
.plan-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.tips-panel ul,
.notes-list ul,
.plan-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.plan-panel ul {
  max-height: 320px;
  overflow: auto;
}

.plan-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1.7;
}

.plan-item {
  margin-bottom: 8px;
}

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

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(244, 114, 182, 0.24);
  background: rgba(244, 114, 182, 0.08);
}

.action-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.action-btn--primary {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(245, 158, 11, 0.2));
  border-color: rgba(244, 114, 182, 0.26);
  box-shadow: 0 20px 50px rgba(244, 114, 182, 0.08);
}

.status-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-ring {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 22px;
}

.status-ring svg {
  transform: rotate(-90deg);
}

.status-ring__bg,
.status-ring__fill {
  fill: none;
  stroke-width: 8;
}

.status-ring__bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.status-ring__fill {
  stroke: url(#pdf-split-ring);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.28s ease;
}

.status-ring__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 1.3rem;
}

.status-copy {
  text-align: center;
}

.status-copy h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.status-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.stage-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.stage-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.02);
}

.stage-item.is-active .stage-dot {
  background: var(--pink);
  box-shadow: 0 0 0 8px rgba(244, 114, 182, 0.08);
}

.stage-item.is-done .stage-dot {
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.08);
}

.stage-item strong {
  font-size: 0.95rem;
}

.stage-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.preview-empty {
  padding: 22px;
  border-radius: 22px;
  min-height: 160px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  text-align: center;
}

.preview-empty h3 {
  margin: 0 0 10px;
}

.preview-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

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

.meta-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta-card strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.55;
}

.footer-panel {
  margin-top: 22px;
  border-radius: 28px;
  padding: 28px;
}

.footer-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
  max-width: 760px;
}

.pdf-split-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(244, 114, 182, 0.22);
  background: rgba(8, 12, 26, 0.95);
  color: var(--text);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  font: 700 14px var(--body);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.pdf-split-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pdf-split-toast.is-error {
  border-color: rgba(251, 113, 133, 0.3);
}

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

@media (max-width: 760px) {
  .app-shell {
    padding: 20px 16px 60px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-panel,
  .panel,
  .footer-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .stats-grid,
  .preview-meta,
  .action-row {
    grid-template-columns: 1fr;
  }

  .upload-content {
    min-height: 220px;
    padding: 22px;
  }

  .group-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .group-inline .field-input {
    max-width: none;
  }
}
