:root {
  --bg: #071019;
  --bg-2: #0d1723;
  --panel: rgba(13, 22, 35, 0.96);
  --panel-2: rgba(17, 28, 44, 0.98);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f7fb;
  --muted: #98a9bf;
  --accent: #dce9ff;
  --green: #57d298;
  --amber: #ffcd6d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(106, 164, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #050a10 0%, #08101a 100%);
}

a { color: inherit; text-decoration: none; }

.shell {
  width: min(1580px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.topbar,
.brand,
.layout,
.hero-stats,
.workspace,
.section-head.row,
.actions,
.form-grid,
.meta-strip {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 12, 18, 0.82);
  box-shadow: var(--shadow);
}

.brand {
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  border: 1px solid var(--line-strong);
  font-weight: 700;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy small,
.eyebrow,
.ghost-link,
.field span,
.note p,
.meta-pill span {
  color: var(--muted);
}

.layout {
  margin-top: 16px;
  flex-direction: column;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: 30px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.lede,
.note p {
  max-width: 72ch;
  line-height: 1.65;
}

.hero-stats {
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-stats article,
.meta-pill {
  min-width: 180px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.hero-stats span,
.meta-pill span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-stats strong {
  font-size: 1.1rem;
}

.workspace {
  gap: 16px;
  align-items: flex-start;
}

.control-panel {
  width: 360px;
  flex: 0 0 360px;
  padding: 24px;
  background: var(--panel-2);
}

.result-panel {
  min-width: 0;
  flex: 1 1 auto;
  padding: 24px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head.row {
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
}

.form-grid {
  flex-direction: column;
  gap: 16px;
}

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

.field input,
.field select,
.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  font: inherit;
}

.field input,
.field select {
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button,
.secondary-button {
  padding: 0 16px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: #061019;
  background: #ffffff;
  font-weight: 700;
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.secondary-button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.note {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}

.inline-code {
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-family: ui-monospace, monospace;
}

.status-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.status-banner.loading {
  border-color: rgba(255, 205, 109, 0.25);
  color: var(--amber);
}

.status-banner.success {
  border-color: rgba(87, 210, 152, 0.24);
  color: var(--green);
}

.status-banner.error {
  border-color: rgba(255, 107, 107, 0.24);
  color: #ff9f9f;
}

.meta-strip {
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1280px;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.45;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.placeholder-row td {
  color: var(--muted);
}

.small-list {
  display: grid;
  gap: 6px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .workspace {
    flex-direction: column;
  }

  .control-panel {
    width: 100%;
    flex-basis: auto;
  }
}
