:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #657084;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warning: #a15c07;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafc;
  padding: 2px 6px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h1,
.intro h2,
.step-heading h2,
.auth-panel h1,
.admin-box h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill {
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 8px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.status-pill.saved {
  border-color: rgba(15, 118, 110, 0.34);
  color: var(--accent);
}

.status-pill.error {
  border-color: rgba(180, 35, 24, 0.34);
  color: var(--danger);
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px 32px 48px;
}

.sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
}

#stepNav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
  text-decoration: none;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e9f5f3;
  color: var(--accent);
  font-weight: 700;
}

.nav-item strong {
  font-size: 13px;
}

.admin-box,
.intro,
.step-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-box {
  margin-top: 16px;
  padding: 16px;
}

.admin-box h2 {
  font-size: 16px;
}

.admin-box form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-box p,
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.workspace {
  display: grid;
  gap: 18px;
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
}

.intro h2 {
  font-size: 22px;
}

.intro p {
  max-width: 860px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

#configForm {
  display: grid;
  gap: 18px;
}

.step-card {
  padding: 22px;
  scroll-margin-top: 110px;
}

.step-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.step-heading span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.step-heading h2 {
  font-size: 20px;
}

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

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

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

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
button,
.link-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input,
textarea {
  width: 100%;
  background: #fbfcfe;
  padding: 10px 12px;
  color: var(--ink);
}

textarea {
  resize: vertical;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  padding: 0 16px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

button:hover,
.link-button:hover {
  border-color: #9aa6b7;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.metadata-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.attribute-table {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attribute-table > * {
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.attribute-table > div {
  background: #f7fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attribute-table input {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.attribute-table label {
  justify-content: center;
  font-weight: 600;
}

.test-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.user-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.user-row strong {
  display: block;
}

.user-row small {
  color: var(--muted);
}

.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
  backdrop-filter: blur(12px);
}

.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-panel h1 {
  font-size: 26px;
}

.auth-panel form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .sidebar {
    position: static;
  }

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

  .intro,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two,
  .grid.four,
  .metadata-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #stepNav,
  .attribute-table {
    grid-template-columns: 1fr;
  }

  .attribute-table input {
    border-left: 0;
  }

  .topbar {
    padding: 16px 18px;
  }

  .step-card,
  .intro,
  .auth-panel {
    padding: 18px;
  }
}
