/* Smartlists - an operating register, not a dashboard.
   The page's job is confidence: which list, when it last changed, did my file land, is it live.
   Light-only on purpose. This is an occasional internal tool on a known screen, and one well-tuned surface beats two half-tuned ones.
   No web fonts, no external requests at all - the system stacks are used deliberately: a grotesque for language, a monospace for every filename and every count, because filenames and counts ARE this domain. */

:root {
  --paper:     #ECEEE8;
  --panel:     #F7F8F4;
  --ink:       #131A22;
  --ink-soft:  #5A6672;
  --rule:      #D3D8CE;
  --rule-firm: #B8BFB2;
  --signal:    #1B3A5C;  /* actions, focus, in-progress fill */
  --live:      #2C6E49;  /* the word "Live", and only that */
  --flag:      #9C3717;  /* rejected / needs attention, and only that */

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --measure: 68rem;
}

* { box-sizing: border-box; }

/* The UA stylesheet's [hidden] { display: none } is a plain author-overridable rule, so any class here that sets `display` silently defeats the hidden attribute - which is how a "Sign out" link ended up showing on the signed-out screen (.account sets display: flex). Every toggle on this page uses `hidden`, so it is worth enforcing once rather than remembering per rule. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ---- preview banner ---------------------------------------------------- */

.banner {
  margin: 0;
  padding: 0.5rem var(--gutter);
  background: var(--flag);
  color: #fff;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

/* ---- masthead: the thesis is "what is live right now" ------------------- */

.masthead {
  border-bottom: 1px solid var(--rule-firm);
  padding: clamp(1.75rem, 1rem + 3vw, 3rem) 0 clamp(1.25rem, 0.75rem + 2vw, 2rem);
}

.masthead-inner,
.sheet,
.footnote {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

.headline-block { flex: 1 1 26rem; min-width: 0; }

.headline {
  margin: 0;
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.15;
}

.headline.is-stale { color: var(--flag); }

.composition {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* The reason a build was held or failed is prose, so it gets the sans face - the mono line above it is for data only. */
.masthead-note {
  margin: 0.75rem 0 0;
  max-width: 44rem;
  font-size: 0.8125rem;
  color: var(--flag);
}

/* Already resolved, so it reports rather than warns. */
.masthead-note.is-settled { color: var(--ink-soft); }

.note-lead { display: block; font-weight: 600; }

.warn-list {
  margin: 0.375rem 0 0;
  padding-left: 1.1rem;
}

.warn-list li { margin-top: 0.125rem; }

.note-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  margin-top: 0.75rem;
}

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

.account {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.account-who { color: var(--ink-soft); }

/* Only appears in the last few minutes of a session, so it should read as a heads-up, not an alarm. */
.account-timer {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--flag);
}

/* ---- buttons ------------------------------------------------------------ */

.btn {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--rule-firm);
  border-radius: 2px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { border-color: var(--signal); color: var(--signal); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-primary {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
}

.btn-primary:hover:not(:disabled) { background: #14283F; border-color: #14283F; color: #fff; }

.link-btn {
  font: inherit;
  font-size: 0.8125rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--signal);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- gates (signed out, fatal error) ------------------------------------ */

.gate {
  padding: clamp(3rem, 2rem + 5vw, 6rem) 0;
  max-width: 34rem;
}

.gate-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.gate-copy {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

/* ---- the register ------------------------------------------------------- */

.group { padding: 2.5rem 0 0; }

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule-firm);
}

.group-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.group-note {
  margin: 0;
  flex: 1 1 22rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* A slot row. The row itself is the drop target AND the progress indicator - that is the one
   bold move on this page, so everything around it stays quiet. */
.slot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem 9rem auto;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding: 0.75rem;
  margin-inline: -0.75rem;
  border-bottom: 1px solid var(--rule);
  transition: background-color 120ms linear;
}

.slot::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  background: rgba(27, 58, 92, 0.09);
  pointer-events: none;
  transition: width 160ms linear;
}

.slot > * { position: relative; }

.slot.is-target { background: var(--panel); box-shadow: inset 0 0 0 1px var(--signal); }
.slot.is-busy   { background: var(--panel); }

.slot-label { min-width: 0; }

.slot-name {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.slot-part {
  font-weight: 400;
  color: var(--ink-soft);
}

.slot-file {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  word-break: break-all;
}

.slot-rows {
  font-size: 1.25rem;
  line-height: 1.1;
  text-align: right;
}

.slot-rows-unit {
  display: block;
  font-family: var(--sans);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.slot-rows.is-empty { color: var(--ink-soft); font-size: 0.8125rem; }

.slot-when {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: right;
}

.slot-when-by { display: block; }

.slot-action {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.link-btn:disabled { opacity: 0.5; cursor: default; text-decoration: none; }

.slot-nofile {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.slot-state {
  display: block;
  font-family: var(--sans);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.slot-state.is-live     { color: var(--live); }
.slot-state.is-working  { color: var(--signal); }
.slot-state.is-rejected { color: var(--flag); }

/* A rejection has to be readable without hunting, so it takes a full row of its own. */
.slot-message {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid var(--flag);
  background: rgba(156, 55, 23, 0.06);
  font-size: 0.8125rem;
  color: var(--flag);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* No max-width here: the grouped rule above already sets one plus `margin-inline: auto`, so narrowing it would re-centre the paragraph and break its left alignment with the masthead and the register. */
.footnote {
  margin: 3rem auto 3rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

/* Without this the browser default serif-ish monospace at 1em would sit taller than the sentence around it. */
.footnote code {
  font-family: var(--mono);
  font-size: 0.95em;
  color: var(--ink);
}

/* ---- narrow screens ----------------------------------------------------- */

@media (max-width: 46rem) {
  .slot {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.625rem;
  }
  .slot-label { grid-column: 1 / -1; }
  .slot-rows  { grid-column: 1; text-align: left; }
  .slot-when  { grid-column: 1; text-align: left; }
  .slot-action { grid-row: 2 / 4; grid-column: 2; align-self: center; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
