:root {
  --bg: #0d1117;
  --panel: #f3eee5;
  --panel-alt: #e7dfd1;
  --ink: #161616;
  --ink-soft: #4c4a44;
  --line: rgba(22, 22, 22, 0.12);
  --accent: #ff6b35;
  --accent-2: #2ec4b6;
  --accent-3: #ffd166;
  --danger: #b42318;
  --paper-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 107, 53, 0.2), transparent 24%),
    radial-gradient(circle at 88% 20%, rgba(46, 196, 182, 0.16), transparent 22%),
    linear-gradient(180deg, #0c1016 0%, #0a0f14 100%);
  color: #f3eee5;
  padding: 28px 16px 40px;
}

.page {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: 1.55fr 0.8fr;
  gap: 24px;
  margin-bottom: 24px;
}

.masthead-copy,
.status-card,
.panel,
.login-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--paper-shadow);
}

.masthead-copy {
  padding: 44px 40px;
  background:
    linear-gradient(135deg, rgba(255, 107, 53, 0.22), rgba(255, 107, 53, 0) 40%),
    linear-gradient(180deg, rgba(243, 238, 229, 0.08), rgba(243, 238, 229, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-card {
  padding: 28px;
  background: linear-gradient(180deg, #1a2430 0%, #121921 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.overline,
.eyebrow,
.status-title {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: rgba(243, 238, 229, 0.68);
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  max-width: 11ch;
  font-family: "DM Serif Display", serif;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

h2 {
  color: var(--ink);
  font-size: 29px;
  line-height: 1.05;
}

.intro {
  max-width: 62ch;
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(243, 238, 229, 0.82);
}

.dashboard {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 24px;
}

.left-rail,
.main-stage {
  display: grid;
  gap: 24px;
  align-self: start;
}

.panel {
  padding: 28px;
  background: var(--panel);
  color: var(--ink);
}

.compose-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0)),
    var(--panel);
}

.notes-panel {
  background: linear-gradient(180deg, var(--panel-alt), var(--panel));
}

.results-panel {
  min-height: 420px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.32)),
    rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(22, 22, 22, 0.08);
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
}

.summary-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading-inline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

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

.field span {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

textarea,
select,
.button,
.text-input {
  font: inherit;
}

textarea,
select,
.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

textarea {
  min-height: 270px;
  resize: vertical;
  padding: 18px 20px;
  line-height: 1.6;
}

select {
  padding: 12px 14px;
}

.text-input {
  min-height: 48px;
  padding: 0 14px;
}

.hint-card {
  margin-top: 18px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-md);
  background: rgba(46, 196, 182, 0.1);
  border: 1px solid rgba(46, 196, 182, 0.18);
}

.hint-card strong {
  display: block;
  margin-bottom: 6px;
}

.hint-card p,
.notes-copy {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.actions-compact {
  margin-top: 0;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  background: #1f2937;
  color: #f8f6f1;
}

.button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.24);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #ff8f5a);
  color: #221611;
  font-weight: 700;
}

.button-secondary {
  background: linear-gradient(135deg, var(--accent-2), #71e1d6);
  color: #082524;
  font-weight: 700;
}

.button-ghost {
  min-height: 40px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f6f1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pipeline {
  list-style: none;
  margin: 18px 0 24px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.pipeline li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(243, 238, 229, 0.9);
}

.pipeline span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.18);
  color: #ffd7c7;
  font-weight: 700;
}

.status-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(243, 238, 229, 0.72);
}

.status-footer strong {
  color: #fff7ef;
}

.status-auth {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.auth-user {
  color: rgba(243, 238, 229, 0.78);
  font-size: 14px;
}

.empty-state {
  min-height: 250px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(22, 22, 22, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.16), transparent 42%),
    rgba(255, 255, 255, 0.46);
  color: var(--ink-soft);
  padding: 28px;
}

.hidden {
  display: none;
}

.results-wrap {
  overflow: auto;
}

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

.results-table th,
.results-table td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.results-table th {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-table tbody tr {
  transition: background-color 160ms ease;
}

.results-table tbody tr.row-generated {
  background: rgba(46, 196, 182, 0.05);
}

.results-table tbody tr.row-published {
  background: rgba(255, 107, 53, 0.08);
}

.row-title {
  display: inline-block;
  font-size: 15px;
}

.url-cell a {
  color: #0f6257;
  word-break: break-all;
}

.final-url-wrap {
  display: grid;
  gap: 8px;
}

.final-url-state {
  color: var(--ink-soft);
  font-size: 12px;
}

.copy-button {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15, 98, 87, 0.18);
  border-radius: 999px;
  background: rgba(46, 196, 182, 0.1);
  color: #0f6257;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:hover {
  background: rgba(46, 196, 182, 0.18);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-match {
  background: rgba(46, 196, 182, 0.16);
  color: #0d5d53;
}

.status-review {
  background: rgba(255, 209, 102, 0.24);
  color: #8d5b00;
}

.status-missing {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stage-done {
  background: rgba(46, 196, 182, 0.16);
  color: #0d5d53;
}

.stage-live {
  background: rgba(255, 107, 53, 0.16);
  color: #8d3c17;
}

.stage-pending {
  background: rgba(255, 209, 102, 0.22);
  color: #8d5b00;
}

.stage-idle {
  background: rgba(22, 22, 22, 0.08);
  color: var(--ink-soft);
}

.log {
  margin: 0;
  min-height: 220px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #10161d;
  color: #d8e1ea;
  white-space: pre-wrap;
  line-height: 1.55;
  overflow: auto;
}

code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.08);
  font-size: 0.92em;
}

.login-page {
  width: min(960px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
}

.login-copy {
  padding: 42px 38px;
  background:
    linear-gradient(145deg, rgba(255, 107, 53, 0.22), rgba(255, 107, 53, 0) 45%),
    linear-gradient(180deg, #1b2633 0%, #111923 100%);
}

.login-form {
  display: grid;
  gap: 16px;
  padding: 42px 34px;
  background: var(--panel);
  color: var(--ink);
}

.login-intro {
  max-width: 32ch;
}

.login-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
  font-weight: 700;
}

.login-button {
  margin-top: 6px;
}

@media (max-width: 1100px) {
  .masthead,
  .dashboard,
  .login-card {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 14px 10px 28px;
  }

  .masthead-copy,
  .status-card,
  .panel,
  .login-copy,
  .login-form {
    padding: 24px 22px;
    border-radius: 22px;
  }

  .panel-heading-inline,
  .status-auth {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(38px, 12vw, 58px);
  }

  .results-table {
    min-width: 680px;
  }
}
