:root {
  color-scheme: light;
  --bg-1: #f5efe6;
  --bg-2: #eef3f7;
  --bg-3: #e7edf4;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(72, 85, 105, 0.14);
  --border-strong: rgba(72, 85, 105, 0.22);
  --text: #142033;
  --muted: #5d6a80;
  --muted-2: #7c879a;
  --accent: #0f766e;
  --accent-2: #0b8bb8;
  --accent-3: #d97706;
  --danger: #b42318;
  --success: #12714f;
  --shadow: 0 16px 44px rgba(32, 48, 75, 0.13);
  --shadow-soft: 0 10px 22px rgba(32, 48, 75, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(15, 118, 110, 0.16), transparent 28%),
    radial-gradient(circle at 92% 2%, rgba(217, 119, 6, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 42%, var(--bg-3) 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(22, 36, 55, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 36, 55, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 96%);
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.8;
  pointer-events: none;
}

.ambient-one {
  top: 38px;
  left: -36px;
  width: 170px;
  height: 170px;
  background: rgba(15, 118, 110, 0.12);
}

.ambient-two {
  top: 150px;
  right: -48px;
  width: 240px;
  height: 240px;
  background: rgba(11, 139, 184, 0.09);
}

.shell {
  width: min(1380px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 18px;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hero-copy,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.hero-copy {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.eyebrow,
.kicker,
.card-label,
.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent);
  margin: 0 0 6px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: #0f172a;
}

.hero-text {
  margin: 8px 0 0;
  max-width: 64ch;
  font-size: 0.89rem;
  line-height: 1.45;
  color: var(--muted);
}

.card-head,
.panel-head,
.preview-head,
.action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-panel-top {
  align-items: center;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  max-width: none;
}

.hero-chips .chip {
  padding: 7px 10px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: #243244;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  backdrop-filter: blur(10px);
}

.panel-label {
  color: var(--muted-2);
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.pill-live {
  background: rgba(18, 113, 79, 0.09);
  color: var(--success);
  border-color: rgba(18, 113, 79, 0.18);
}

.pill-good {
  background: rgba(18, 113, 79, 0.11);
  color: var(--success);
  border-color: rgba(18, 113, 79, 0.24);
}

.pill-warn {
  background: rgba(217, 119, 6, 0.1);
  color: #9a5904;
  border-color: rgba(217, 119, 6, 0.22);
}

.pill-bad {
  background: rgba(180, 35, 24, 0.09);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.22);
}

.pill-muted {
  background: rgba(255, 255, 255, 0.8);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(20, 32, 51, 0.12);
  color: #243244;
  font-size: 0.8rem;
  font-weight: 400;
  backdrop-filter: blur(10px);
}

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

.control-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 18px;
}

.panel-head {
  align-items: center;
  margin-bottom: 12px;
}

.panel h2,
.panel h3,
.card h3 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #142033;
}

.panel h2 {
  font-size: 1.55rem;
}

.card {
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
}

.card:last-child {
  margin-bottom: 0;
}

.card-head {
  align-items: center;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 1.02rem;
}

.copy,
.file-meta,
.log,
.summary-strip,
.empty-cell {
  color: var(--muted);
}

.copy {
  margin: 8px 0 0;
  line-height: 1.48;
  font-size: 0.88rem;
}

.action-row {
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.action-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  align-items: stretch;
}

.tariff-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, 0.75fr);
  gap: 10px;
  align-items: start;
}

.tariff-stack {
  height: 86px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stacked-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  height: 86px;
  align-self: stretch;
}

.stacked-actions > * {
  width: 100%;
}

button,
.download-link {
  font: inherit;
}

.primary-button,
.secondary-button,
.ghost-button,
.download-link {
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.primary-button.large {
  min-height: 46px;
  padding: 0 20px;
  width: 100%;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.9);
  color: #123;
  border-color: rgba(20, 32, 51, 0.14);
}

.ghost-button,
.download-link {
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  border-color: rgba(20, 32, 51, 0.1);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.download-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.primary-button:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.4), rgba(11, 139, 184, 0.38));
}

.download-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-meta {
  margin-top: 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.69rem;
  line-height: 1.3;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(20, 32, 51, 0.08);
  white-space: pre;
  overflow: auto;
  max-height: 220px;
}

.dropzone {
  margin-top: 10px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(15, 118, 110, 0.28);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.05), rgba(11, 139, 184, 0.03)),
    rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.dropzone strong {
  display: block;
  font-size: 0.92rem;
  color: #0f172a;
}

.dropzone span,
.dropzone small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dropzone-active {
  border-color: rgba(15, 118, 110, 0.52);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.09), rgba(11, 139, 184, 0.06)),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.dropzone-compact {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 12px;
}

.compact-status {
  min-height: 22px;
  padding: 0 10px;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  align-self: flex-start;
}

.dropzone-wide {
  padding-top: 14px;
  padding-bottom: 14px;
}

.card-cta {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.05), rgba(11, 139, 184, 0.03)),
    var(--panel-strong);
}

.output-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.9)),
    var(--panel-strong);
}

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

.stat {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(20, 32, 51, 0.1);
  padding: 12px 14px;
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  font-size: 1.1rem;
  color: #132236;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.84);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: #304057;
}

.summary-pill strong {
  font-family: inherit;
  font-size: inherit;
  color: #0f172a;
}

.log {
  margin-top: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(20, 32, 51, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.95));
  padding: 12px 14px;
  min-height: 92px;
  white-space: pre;
  overflow: auto;
  max-height: 240px;
  line-height: 1.32;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.69rem;
  color: #334155;
}

.preview-shell {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 32, 51, 0.08);
}

.preview-head {
  align-items: center;
  margin-bottom: 10px;
}

.preview-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #17324d, #0f2238);
  color: #fff;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: left;
  padding: 11px 10px;
}

.preview-table tbody td {
  padding: 10px 10px;
  border-top: 1px solid rgba(20, 32, 51, 0.08);
  vertical-align: top;
  font-size: 0.84rem;
  color: #223047;
}

.preview-table tbody tr:nth-child(even) td {
  background: rgba(15, 118, 110, 0.03);
}

.preview-table td.mono,
.preview-table th.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.preview-table td.status-good {
  color: var(--success);
  font-weight: 700;
}

.preview-table td.status-bad {
  color: var(--danger);
  font-weight: 700;
}

.empty-cell {
  text-align: center;
  padding: 26px 14px !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-chips {
    max-width: none;
    justify-content: flex-start;
  }

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

  .tariff-layout {
    grid-template-columns: 1fr;
  }

  .tariff-stack,
  .stacked-actions {
    height: auto;
  }

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

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

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 14px, 1380px);
    padding: 10px 0 14px;
  }

  .hero-copy,
  .panel,
  .card,
  .preview-shell {
    border-radius: 20px;
  }

  .hero-copy {
    padding: 2px 0 0;
  }

  .hero-chips {
    justify-content: flex-start;
  }

  .panel,
  .preview-shell {
    padding: 14px;
  }

  .tariff-layout,
  .action-row-4 {
    grid-template-columns: 1fr;
  }

  .tariff-stack,
  .stacked-actions {
    height: auto;
  }

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

  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .action-row > * {
    width: 100%;
  }

  .stacked-actions > * {
    width: 100%;
  }

  .dropzone {
    align-items: flex-start;
    flex-direction: column;
  }
}
