:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #202025;
  --text: #fafafa;
  --muted: #a1a1aa;
  --soft: #d4d4d8;
  --line: #27272a;
  --line-strong: #3f3f46;
  --accent: #14b8a6;
  --accent-2: #38bdf8;
  --accent-3: #f59e0b;
  --danger: #fb7185;
  --ok: #34d399;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.08), transparent 280px),
    linear-gradient(120deg, rgba(56, 189, 248, 0.08), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(20, 184, 166, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(56, 189, 248, 0.12)),
    var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(250, 250, 250, 0.04);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px 11px;
  border: 2px solid var(--accent);
  border-top-width: 5px;
  border-radius: 3px 3px 5px 5px;
}

.subtle-link {
  color: var(--soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  background: rgba(17, 17, 19, 0.72);
}

.subtle-link:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 24px;
}

.hero.compact {
  align-items: center;
}

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

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.15rem;
}

p {
  margin: 0;
  color: var(--muted);
}

.lede {
  max-width: 640px;
  margin-top: 16px;
  color: var(--soft);
  font-size: 1.08rem;
}

.assurance-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.assurance-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.76);
  color: var(--soft);
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.surface {
  background:
    linear-gradient(180deg, rgba(250, 250, 250, 0.04), transparent),
    rgba(17, 17, 19, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.form-grid,
.reports-section {
  display: grid;
  gap: 18px;
}

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

label {
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d0d10;
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(20, 184, 166, 0.7);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
  background: #111116;
}

input:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

input[type="file"] {
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 1px solid rgba(20, 184, 166, 0.7);
  border-radius: 6px;
  background: rgba(20, 184, 166, 0.1);
  color: var(--accent);
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.file-name {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

textarea {
  min-height: 300px;
  resize: vertical;
}

.code-textarea {
  min-height: 210px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #031615;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover:not(:disabled) {
  background: #2dd4bf;
  border-color: #2dd4bf;
  transform: translateY(-1px);
}

button.secondary {
  background: transparent;
  color: var(--accent);
}

button.secondary:hover:not(:disabled) {
  background: rgba(20, 184, 166, 0.08);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.small-button {
  margin-top: 12px;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.status {
  min-height: 28px;
  font-weight: 700;
  color: var(--muted);
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

.success-receipt {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(52, 211, 153, 0.55);
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.09);
  color: var(--soft);
  padding: 14px;
}

.success-receipt strong {
  color: var(--ok);
}

.success-receipt span {
  color: var(--soft);
  overflow-wrap: anywhere;
}

.form-footer,
.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pager span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.reports {
  display: grid;
  gap: 14px;
}

.report {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.report pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.6;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.reports-section {
  margin-top: 26px;
}

.section-heading {
  display: grid;
  gap: 4px;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 28px 0;
  }

  .page-header,
  .hero,
  .form-footer,
  .actions,
  .pager {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pager {
    display: grid;
    justify-items: stretch;
  }

  .page-header {
    display: grid;
  }

  .assurance-strip {
    justify-content: flex-start;
  }

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

  .file-name {
    white-space: normal;
  }

  button {
    width: 100%;
  }
}
