/* SRI shared design system (see ~\sri-ai-hq\public\index.html for the reference
   implementation). Tokens, glow, cards and chips match the rest of the HQ tools. */

:root {
  --bg: #07080d;
  --shell: #0d101a;
  --card: #141927;
  --inset: #0c0f19;
  --ink: #f4f6fb;
  --dim: #8b93a7;
  --faint: #5a617a;
  --line: rgba(226, 230, 246, 0.07);
  --line-strong: rgba(226, 230, 246, 0.12);
  --blue: #2962ff;
  --blue-soft: #5b8cff;
  --blue-ink: #8fa8ff;
  --green: #34d07c;
  --amber: #ffb84d;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --font: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

/* display:grid on .shell would otherwise beat the UA rule for [hidden]. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px 460px at 18% -10%, rgba(41, 98, 255, 0.18), transparent 70%),
    radial-gradient(560px 420px at 95% 8%, rgba(41, 98, 255, 0.12), transparent 72%);
}

.wrap {
  position: relative;
  z-index: 1;
}

a {
  color: var(--blue-ink);
  text-decoration: none;
}

a:hover {
  color: #b9c8ff;
  text-decoration: underline;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--blue-ink);
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 600;
}

h2 {
  font-size: 21px;
  font-weight: 600;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

p {
  margin: 0 0 14px;
  color: #d3d8e6;
}

.muted {
  color: var(--dim);
}

.faint {
  color: var(--faint);
}

/* ---------- chrome ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 26, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar img {
  height: 26px;
  width: auto;
  display: block;
}

.topbar .sep {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
}

.topbar .who {
  font-size: 13px;
  color: var(--dim);
}

.topbar .who b {
  color: var(--ink);
  font-weight: 600;
}

.topbar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--dim);
  white-space: nowrap;
}

.chip.live {
  color: var(--green);
  border-color: rgba(52, 208, 124, 0.34);
  background: rgba(52, 208, 124, 0.08);
}

.chip.blue {
  color: var(--blue-ink);
  border-color: rgba(41, 98, 255, 0.4);
  background: rgba(41, 98, 255, 0.1);
}

.chip.amber {
  color: var(--amber);
  border-color: rgba(255, 184, 77, 0.34);
  background: rgba(255, 184, 77, 0.08);
}

/* ---------- layout ---------- */

.shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}

.rail {
  position: sticky;
  top: 63px;
  align-self: start;
  max-height: calc(100vh - 63px);
  overflow-y: auto;
  padding: 26px 20px 40px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}

.main {
  padding: 34px clamp(20px, 4vw, 52px) 90px;
  min-width: 0;
}

/* ---------- progress ---------- */

.progress-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.ring {
  position: relative;
  width: 54px;
  height: 54px;
  flex: none;
}

.ring svg {
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.ring .track {
  stroke: rgba(226, 230, 246, 0.1);
}

.ring .val {
  stroke: var(--blue);
  transition: stroke-dashoffset 0.5s ease;
  filter: drop-shadow(0 0 6px rgba(41, 98, 255, 0.6));
}

.ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.progress-head .label {
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim);
}

.progress-head .label b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- rail nav ---------- */

.chapter {
  margin-bottom: 18px;
}

.chapter > .name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 10px 8px;
}

.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--dim);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.16s ease;
}

.navitem:hover {
  color: var(--ink);
  background: rgba(226, 230, 246, 0.04);
}

.navitem.active {
  color: var(--ink);
  background: rgba(41, 98, 255, 0.12);
  border-color: rgba(41, 98, 255, 0.36);
}

.navitem .tick {
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: transparent;
}

.navitem.done .tick {
  border-color: var(--green);
  background: rgba(52, 208, 124, 0.16);
  color: var(--green);
}

.navitem span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin: 0 0 16px;
}

.card.tight {
  padding: 16px 18px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}

.applink {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 17px 18px;
  text-decoration: none;
  color: inherit;
  transition: 0.18s ease;
}

.applink:hover {
  transform: translateY(-3px);
  border-color: rgba(41, 98, 255, 0.45);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  text-decoration: none;
}

.applink .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.applink h3 {
  font-size: 14.5px;
}

.applink p {
  margin: 0;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
}

.ico {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(41, 98, 255, 0.14);
  border: 1px solid rgba(41, 98, 255, 0.3);
}

.ico svg {
  width: 16px;
  height: 16px;
  stroke: var(--blue-soft);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- step body ---------- */

.step-head {
  margin-bottom: 24px;
}

.step-head .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lede {
  font-size: 16.5px;
  color: #c8cfe0;
  max-width: 68ch;
  margin: 12px 0 0;
}

.section {
  margin: 26px 0 0;
}

.section > h2 {
  margin-bottom: 4px;
}

.section > .sub {
  color: var(--dim);
  font-size: 13.5px;
  margin: 0 0 14px;
  max-width: 72ch;
}

ul.plain,
ol.plain {
  margin: 0 0 14px;
  padding-left: 20px;
  color: #d3d8e6;
}

ul.plain li,
ol.plain li {
  margin-bottom: 7px;
}

/* checklist */

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--inset);
  margin-bottom: 9px;
  cursor: pointer;
  transition: 0.16s ease;
}

.check:hover {
  border-color: var(--line-strong);
}

/* Checklists that follow a card grid need air; the grid's gap does not apply
   across the boundary. */
.grid + .check,
.card + .check,
.note + .check {
  margin-top: 20px;
}

.check.on {
  border-color: rgba(52, 208, 124, 0.36);
  background: rgba(52, 208, 124, 0.06);
}

.check input {
  appearance: none;
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  position: relative;
}

.check input:checked {
  border-color: var(--green);
  background: rgba(52, 208, 124, 0.2);
}

.check input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check .txt {
  min-width: 0;
}

.check .txt b {
  display: block;
  font-weight: 500;
  font-size: 14px;
}

.check .txt small {
  display: block;
  color: var(--dim);
  font-size: 12.5px;
  margin-top: 3px;
  line-height: 1.5;
}

/* callouts */

.note {
  border-left: 2px solid var(--blue);
  background: rgba(41, 98, 255, 0.07);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 13px 16px;
  margin: 0 0 16px;
  font-size: 13.5px;
  color: #cfd6e6;
}

.note.warn {
  border-color: var(--amber);
  background: rgba(255, 184, 77, 0.07);
}

.note.good {
  border-color: var(--green);
  background: rgba(52, 208, 124, 0.07);
}

.note b {
  color: var(--ink);
}

.note :last-child {
  margin-bottom: 0;
}

/* forms */

.fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

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

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}

.field label .req {
  color: var(--blue-ink);
}

/* Matches bare <input> too: an input with no type attribute is still a text
   box, and input[type="text"] does not select it. */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--inset);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: #4d5470;
}

.field .hint {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 5px;
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(41, 98, 255, 0.35);
  transition: 0.16s ease;
}

.btn:hover {
  background: #1f55f0;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(226, 230, 246, 0.06);
  border-color: rgba(226, 230, 246, 0.22);
}

.btn.sm {
  padding: 7px 13px;
  font-size: 12.5px;
  box-shadow: none;
}

.footnav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.footnav .spacer {
  flex: 1;
}

.saved {
  font-size: 12px;
  color: var(--faint);
}

.saved.ok {
  color: var(--green);
}

/* table */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line-strong);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

.scroll-x {
  overflow-x: auto;
}

/* misc */

.kv {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 8px 16px;
  font-size: 13.5px;
}

.kv dt {
  color: var(--faint);
}

.kv dd {
  margin: 0;
  color: #d8dded;
  word-break: break-word;
}

.bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(226, 230, 246, 0.1);
  overflow: hidden;
  min-width: 64px;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--blue-soft));
}

.center-pane {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.pane {
  width: 100%;
  max-width: 420px;
  background: var(--shell);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 34px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.err {
  color: #ff8b8b;
  font-size: 13px;
  min-height: 18px;
}

.railtoggle {
  display: none;
}

/* The topbar is the one row that cannot shrink on its own: the chips refuse to
   wrap, which pushed the whole document wider than a phone screen. */
@media (max-width: 640px) {
  .topbar {
    gap: 12px;
    padding: 14px 16px;
  }
  .topbar img {
    height: 21px;
  }
  .topbar .sep,
  .topbar .hide-sm {
    display: none;
  }
  .topbar .who {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 25px;
  }
  .lede {
    font-size: 15.5px;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 18px 18px 24px;
  }
  .rail.collapsed .chapter {
    display: none;
  }
  .railtoggle {
    display: inline-flex;
  }
  .main {
    padding: 24px 18px 70px;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .kv dd {
    margin-bottom: 10px;
  }
}

@media print {
  body::before,
  .rail,
  .topbar,
  .footnav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card {
    background: #fff;
    border-color: #ccc;
  }
}
