:root {
  color-scheme: light;
  --ink: #102a43;
  --navy: #0f172a;
  --blue: #1f7a8c;
  --teal: #0f766e;
  --gold: #f6c453;
  --surface: #f5fbff;
  --line: #d9e2ef;
  --muted: #64748b;
  --white: #ffffff;
  --good: #dcfce7;
  --warn: #fef3c7;
  --bad: #fee2e2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8fafc;
  color: #111827;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--gold);
  font-weight: 950;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.top-link {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.shell {
  width: min(1240px, calc(100% - 28px));
  margin: 26px auto 56px;
}

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

.sidebar,
.content,
.panel,
.app-summary {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}

.status-card,
.token-form,
.panel,
.app-summary {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.status-card {
  padding: 18px;
}

.label,
.eyebrow {
  display: inline-flex;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin: 8px 0;
  color: var(--ink);
  font-size: 1.2rem;
}

.status-card p,
.app-summary p,
.hint {
  color: #475569;
  line-height: 1.55;
}

.token-form {
  padding: 16px;
}

.token-form label,
.grid-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}

.required-mark {
  color: #dc2626;
  font-weight: 950;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0.82rem 0.9rem;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.16);
}

button,
.preview-link {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.72rem 1rem;
  background: var(--ink);
  color: white;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.preview-link:hover {
  transform: translateY(-1px);
}

button:disabled,
.disabled {
  opacity: 0.55;
  pointer-events: none;
}

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

.step {
  justify-content: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.step.active {
  background: var(--blue);
  color: white;
}

.content {
  display: grid;
  gap: 16px;
}

.alert {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--warn);
  color: #713f12;
  font-weight: 800;
}

.alert.good {
  background: var(--good);
  color: #14532d;
}

.alert.bad {
  background: var(--bad);
  color: #7f1d1d;
}

.app-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: clamp(18px, 3vw, 28px);
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  margin: 8px 0 8px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.02;
}

h2 {
  margin: 6px 0 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.preview-link {
  background: var(--gold);
  color: #07111f;
  white-space: nowrap;
}

.panel {
  display: none;
  padding: clamp(18px, 3vw, 28px);
}

.panel.active {
  display: block;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pill {
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

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

.grid-form .wide,
.grid-form button,
.hint {
  grid-column: 1 / -1;
}

.primary {
  width: max-content;
  max-width: 100%;
  background: var(--teal);
}

@media (max-width: 900px) {
  .workbench,
  .app-summary,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .step {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .shell {
    width: min(100% - 18px, 1240px);
    margin-top: 12px;
  }

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

  h1 {
    font-size: clamp(1.7rem, 9vw, 2.35rem);
  }
}
