/* ============================================================
   ops.css — the operations console.

   Inherits the palette from tokens.css, which is copied from the
   marketing site, so the console tracks the brand and both themes
   without redefining a single colour. The marketing site is a slow
   descent; this is the opposite — dense, quiet, quick to scan.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-2);
  color: var(--ink);
  font: var(--t-body)/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--accent); color: var(--bg-1); padding: .6rem 1rem;
}
.skip:focus { left: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.35rem 1rem;
  background: var(--bg-3);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .35rem; }
.brand svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand span {
  font-family: var(--f-display); font-size: 1.02rem;
  letter-spacing: .02em; text-transform: uppercase; line-height: 1.1;
}
.brand i { font-style: normal; color: var(--ink-2); }
.brand small {
  display: block; font-family: var(--f-mono); font-size: .58rem;
  letter-spacing: .22em; color: var(--accent); text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .58rem .7rem; border-radius: var(--radius);
  color: var(--ink-2); text-decoration: none; font-size: .925rem;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--panel); color: var(--ink); }
.nav-item.is-active { background: var(--panel-2); color: var(--accent); font-weight: 600; }
.nav-item.is-active svg { opacity: 1; }

.who {
  margin-top: auto; display: grid; gap: .3rem; padding: .7rem;
  background: var(--panel); border-radius: var(--radius);
}
.who-name { font-size: .875rem; font-weight: 600; }
.who-role {
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
}
.who-role[data-role="admin"] { color: var(--metal); }
.who .btn { margin-top: .35rem; width: 100%; justify-content: center; }

/* ---------- main ---------- */
.main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 4rem; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.topbar h1 {
  margin: 0; font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.01em;
}
.topbar-actions { display: flex; gap: .5rem; }

.flash {
  margin: 0 0 1.2rem; padding: .7rem .9rem; border-radius: var(--radius);
  border-left: 3px solid var(--accent); background: var(--panel-2); font-size: .92rem;
}
.flash-error { border-left-color: #C2543F; }

/* ---------- cards ---------- */
.stats {
  display: grid; gap: .9rem; margin-bottom: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat {
  padding: 1.05rem 1.15rem; background: var(--panel-2);
  border: 1px solid var(--panel-edge); border-radius: var(--radius);
}
.stat b {
  display: block; font-family: var(--f-display); font-size: 2.4rem;
  line-height: 1; color: var(--accent);
}
.stat span {
  display: block; margin-top: .45rem; font-family: var(--f-mono);
  font-size: .64rem; letter-spacing: .17em; text-transform: uppercase; color: var(--ink-3);
}
.stat small { display: block; margin-top: .3rem; color: var(--ink-2); font-size: .8rem; }

.panel {
  background: var(--panel-2); border: 1px solid var(--panel-edge);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-bottom: 1.4rem;
}
.panel > h2 {
  margin: 0 0 .9rem; font-family: var(--f-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: .01em;
}
.panel > h2 small {
  color: var(--ink-3); font-family: var(--f-mono); font-size: .62rem;
  letter-spacing: .16em; margin-left: .5rem; text-transform: uppercase;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .915rem; }
th {
  text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line);
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500; white-space: nowrap;
}
td { padding: .68rem .7rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel); }
td .sub { display: block; color: var(--ink-3); font-size: .82rem; margin-top: .15rem; }
.num, td.num { font-family: var(--f-mono); font-size: .85rem; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }

.empty {
  margin: 0; padding: 2rem 1rem; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--radius); font-size: .92rem;
}

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; white-space: nowrap;
  background: var(--panel); color: var(--ink-2); border: 1px solid var(--line);
}
.badge[data-status="in_progress"], .badge[data-status="development"], .badge[data-status="sent"] {
  color: var(--accent); border-color: var(--slab-edge); background: var(--glow);
}
.badge[data-status="completed"], .badge[data-status="live"], .badge[data-status="paid"] {
  color: var(--accent-2); border-color: var(--slab-edge);
}
.badge[data-status="on_hold"], .badge[data-status="maintenance"], .badge[data-status="void"] {
  color: var(--metal); border-color: color-mix(in srgb, var(--metal) 40%, transparent);
}

/* ---------- forms ---------- */
.form { max-width: 44rem; }
.field { margin: 0 0 1rem; display: grid; gap: .35rem; }
.field label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.field label b { color: var(--accent); }
.field small { color: var(--ink-3); font-size: .78rem; }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: .92rem;
  color: var(--ink); background: var(--bg-1);
  border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.field-row {
  display: grid; gap: 0 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.3rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .95rem; border-radius: var(--radius); cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--bg-1); border: 1px solid transparent;
}
.btn:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel); }
.btn-quiet {
  background: transparent; color: var(--ink-3); border-color: var(--line);
  font-weight: 500; font-size: .78rem; padding: .35rem .6rem;
}
.btn-quiet:hover { background: var(--panel-2); color: var(--ink); }
.btn-danger {
  background: transparent; color: #C2543F;
  border-color: color-mix(in srgb, #C2543F 40%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, #C2543F 12%, transparent); }
.inline-form { display: inline; }

/* ---------- invoice builder ---------- */
.form-wide { max-width: 62rem; }
.i-hint { margin: -0.5rem 0 0.9rem; color: var(--ink-3); font-size: 0.85rem; }
.line-items { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.3rem; }
.line-items-head {
  display: grid; grid-template-columns: 1fr 6rem 8rem; gap: 0.5rem; padding: 0 0.1rem;
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.line-item-row { display: grid; grid-template-columns: 1fr 6rem 8rem; gap: 0.5rem; }
@media (max-width: 640px) {
  .line-items-head { display: none; }
  .line-item-row { grid-template-columns: 1fr; }
}
.field-row-check { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; align-items: center; margin: 0 0 1rem; }
.form-actions-tight { margin-top: 0; margin-bottom: 1.6rem; }

/* A native disclosure for a form section that's genuinely optional —
   collapsed by default so it reads as skippable, not as more required
   fields. */
.opt { margin: 0 0 1rem; }
.opt summary {
  cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--ink-2);
  margin-bottom: 0.6rem;
}
.opt summary:hover { color: var(--ink); }
.opt[open] summary { margin-bottom: 0.8rem; }
.check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--ink-2); font-weight: 500; }
.check input[type="checkbox"] { width: auto; }

/* ---------- activity ---------- */
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.activity li {
  display: flex; gap: .8rem; align-items: baseline; padding: .5rem .1rem;
  border-bottom: 1px solid var(--line-2); font-size: .9rem;
}
.activity li:last-child { border-bottom: 0; }
.activity time {
  margin-left: auto; color: var(--ink-3);
  font-family: var(--f-mono); font-size: .7rem; white-space: nowrap;
}
.activity .who-did { color: var(--ink-3); }

/* ---------- login ---------- */
body.signed-out { display: grid; place-items: center; min-height: 100vh; background: var(--bg-3); }
.gate { width: min(23rem, 92vw); padding: 1rem; }
.gate-brand {
  display: flex; align-items: center; gap: .6rem;
  justify-content: center; margin-bottom: 1.5rem;
}
.gate-brand svg { width: 30px; height: 30px; color: var(--accent); }
.gate-brand span {
  font-family: var(--f-display); font-size: 1.2rem;
  text-transform: uppercase; letter-spacing: .03em;
}
.gate-brand i { font-style: normal; color: var(--ink-2); }
.gate .panel { padding: 1.4rem; margin-bottom: 0; }
.gate h1 { margin: 0 0 1.2rem; font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; }
.gate .btn { width: 100%; justify-content: center; margin-top: .3rem; }
.gate .flash { margin-bottom: 1rem; }

/* ---------- narrow ---------- */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row;
    align-items: center; flex-wrap: wrap; gap: .8rem;
  }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .nav-item span { display: none; }
  .nav-item { padding: .5rem .75rem; }
  .who { margin-top: 0; margin-left: auto; grid-auto-flow: column; align-items: center; gap: .6rem; }
  .who .btn { margin-top: 0; width: auto; }
}

/* ---------- theme pickers ----------
   Radio inputs styled as cards. The control is still a plain radio, so the
   picker works with the keyboard and without JavaScript. */
.picks { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.picks-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }

.pick {
  position: relative; display: grid; gap: .25rem; align-content: start;
  padding: .85rem .9rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1);
}
.pick:hover { border-color: var(--ink-3); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--glow); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick b { font-family: var(--f-display); font-size: 1rem; letter-spacing: .01em; }
.pick small { color: var(--ink-3); font-size: .76rem; line-height: 1.4; }
.pick-m {
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
}
.pick-sm { gap: .3rem; }

.pick-swatch {
  display: grid; place-items: center; height: 2.6rem; margin-bottom: .35rem;
  border: 1px solid; border-radius: 2px;
}
.pick-swatch i { width: .55rem; height: .55rem; border-radius: 50%; }

.pick-dot { width: 1.5rem; height: 1.5rem; border-radius: 50%; margin-bottom: .3rem; }

.pick-diagram {
  display: grid; gap: 2px; height: 2.1rem; margin-bottom: .35rem; padding: .3rem;
  border: 1px solid var(--line-2); border-radius: 2px; background: var(--panel);
}
.pick-diagram i { background: var(--ink-3); opacity: .5; border-radius: 1px; }
.pick-diagram[data-layout="plate"] { grid-template-rows: 1fr 1fr 1fr; }
.pick-diagram[data-layout="split"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pick-diagram[data-layout="split"] i:first-child { grid-row: span 2; }
.pick-diagram[data-layout="full"] { grid-template-rows: 1.6fr 1fr; grid-template-columns: 1fr 1fr; }
.pick-diagram[data-layout="full"] i:first-child { grid-column: span 2; opacity: .8; }

/* ---------- image list ---------- */
.img-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .7rem; }
.img-row {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto;
  gap: .9rem; align-items: center;
  padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-1);
}
.img-row > img {
  width: 7rem; height: 4.6rem; object-fit: cover;
  border-radius: 2px; border: 1px solid var(--line);
  background: var(--panel);
}
.img-meta { display: grid; gap: .35rem; min-width: 0; }
.img-meta form { display: flex; gap: .4rem; align-items: center; }
.img-meta input { flex: 1; min-width: 0; padding: .35rem .5rem; font-size: .85rem; }
.img-meta .sub { color: var(--ink-3); font-size: .75rem; font-family: var(--f-mono); }
input[type="file"] { padding: .45rem; background: var(--panel); cursor: pointer; }

@media (max-width: 620px) {
  .img-row { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .img-row > img { width: 4.5rem; height: 3.2rem; }
  .img-row > form:last-child { grid-column: 2; justify-self: start; }
}

/* ---------- release-file list ---------- */
.rel-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .6rem; }
.rel-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: .9rem; align-items: center;
  padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-1);
}
.rel-meta { display: grid; gap: .2rem; min-width: 0; }
.rel-meta b { font-family: var(--f-mono); font-size: .88rem; word-break: break-all; }
.rel-meta .sub { color: var(--ink-3); font-size: .75rem; font-family: var(--f-mono); }

/* Which file to upload next, not just a sentence saying so — a static
   two-step version of the same connected-dot language the publish
   progress modal uses, so "step 1, then step 2" reads the same way
   everywhere in the console. */
.rel-steps { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.rel-step { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-3); }
.rel-step[data-state="active"] { color: var(--ink); font-weight: 600; }
.rel-step[data-state="ok"] { color: var(--ink-3); }
.rel-step small { display: block; font-weight: 400; color: var(--ink-3); font-size: .74rem; }
.rel-step-dot {
  flex: none; width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--line);
  position: relative;
}
.rel-step[data-state="active"] .rel-step-dot { border-color: var(--accent); }
.rel-step[data-state="ok"] .rel-step-dot { border-color: var(--accent); background: var(--accent); }
.rel-step[data-state="ok"] .rel-step-dot::after {
  content: ""; position: absolute; left: 2px; top: -1px; width: 3px; height: 6px;
  border: solid var(--bg-1); border-width: 0 2px 2px 0; transform: rotate(40deg);
}

/* ---------- gate extras (sign in / request access) ---------- */
.gate-note {
  margin: -.4rem 0 1.2rem;
  color: var(--ink-3); font-size: .86rem; line-height: 1.5;
}
.gate-alt {
  margin: 1rem 0 0; text-align: center;
  font-size: .84rem; color: var(--ink-3);
}
.gate-alt a { font-weight: 600; }
.gate .panel h1 + .field { margin-top: 0; }

/* ---------- access requests ---------- */
.req-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .6rem; }
.req {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding: .8rem .9rem;
  border: 1px solid var(--slab-edge); border-radius: var(--radius);
  background: var(--glow);
}
.req-who { display: grid; gap: .1rem; margin-right: auto; min-width: 0; }
.req-who b { font-size: .95rem; }
.req-who .sub { color: var(--ink-3); font-size: .78rem; }
.req-act { display: flex; gap: .4rem; align-items: center; }
.req-act select { width: auto; padding: .4rem .5rem; font-size: .85rem; }

.signup-toggle {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  margin-top: 1.2rem; padding-top: 1rem;
  border-top: 1px solid var(--line-2);
  font-size: .86rem; color: var(--ink-2);
}
.signup-toggle span { margin-right: auto; }
.signup-toggle b { color: var(--ink); }

/* ---------- publish/unpublish progress modal ---------- */
.progress-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 1.2rem;
  overflow-y: auto; /* belt-and-suspenders: the box below caps its own
    height, but a short/zoomed viewport still gets a real scrollbar here
    rather than losing whatever doesn't fit, footer buttons included. */
  background: rgba(4, 13, 17, 0.6);
}
.progress-box {
  width: min(28rem, 100%);
  max-height: calc(100vh - 2.4rem); overflow-y: auto;
  /* --panel-2 is deliberately near-transparent in dark mode (7.5% opaque)
     — it's meant to layer subtly over the page's own solid ground, not
     read on its own. That's wrong for a dialog floating over a dimmed
     backdrop of arbitrary page content: at that opacity the box was
     barely distinguishable from whatever was scrolled behind it. --bg-2
     is a real solid colour in both themes, so the box now reads as an
     actual card regardless of what's under the overlay. */
  background: var(--bg-2); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: 0 20px 50px rgba(4, 13, 17, 0.45);
  position: relative;
}
.progress-close {
  position: absolute; top: .6rem; right: .6rem; width: 1.8rem; height: 1.8rem;
  display: grid; place-items: center; border-radius: 50%; border: none;
  background: transparent; color: var(--ink-3); cursor: pointer; padding: 0;
}
.progress-close:hover { background: var(--panel); color: var(--ink); }
.progress-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.progress-close svg { width: 12px; height: 12px; }
.progress-box h2 {
  margin: 0 0 1rem; font-family: var(--f-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: .01em; text-align: center;
}

/* The brand mark, not a generic spinner — swaying like it's hanging from
   the ring at top, the same anchor the sidebar and masthead already use.
   Three states, driven by data-phase on the wrapper: working (sways,
   glows, indefinite — nothing here claims to know how long is left),
   ok (drops and settles the instant the real result says so), error
   (freezes mid-swing, tinted, because it didn't make it down). */
.progress-anchor {
  position: relative; width: 3.2rem; height: 3.2rem; margin: 0 auto 1rem;
  display: grid; place-items: center; color: var(--accent);
}
.progress-anchor-glow {
  position: absolute; inset: -.5rem; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  animation: anchor-pulse 2.2s ease-in-out infinite;
}
.progress-anchor svg {
  position: relative; z-index: 1; width: 100%; height: 100%;
  transform-origin: 50% 20%; /* the ring near the top — it hangs from there */
  animation: anchor-sway 2.2s ease-in-out infinite;
}

@keyframes anchor-sway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes anchor-pulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.1); } }

.progress-anchor[data-phase="ok"] svg { animation: anchor-drop .6s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.progress-anchor[data-phase="ok"] .progress-anchor-glow { animation: none; opacity: .95; }
@keyframes anchor-drop {
  0%   { transform: rotate(-7deg) translateY(0); }
  55%  { transform: rotate(0deg) translateY(.4rem); }
  100% { transform: rotate(0deg) translateY(0); }
}

.progress-anchor[data-phase="error"] svg { animation: none; transform: rotate(-3deg); color: #C2543F; }
.progress-anchor[data-phase="error"] .progress-anchor-glow {
  animation: none; opacity: .4; background: radial-gradient(circle, rgba(194, 84, 63, .4), transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  .progress-anchor svg, .progress-anchor-glow { animation: none !important; }
  .progress-anchor[data-phase="error"] svg { transform: none; }
}
/* A connected stepper, not a row of independent dots: each step draws the
   line down to the next one itself, and that line only turns solid once
   the step above it is genuinely done — so the accent colour visibly
   travels down the list exactly as fast as the real steps complete, one
   after another, never ahead of the server. */
.progress-steps { list-style: none; margin: 0; padding: 0; }
.progress-step {
  position: relative; display: flex; align-items: flex-start; gap: .7rem;
  font-size: .9rem; color: var(--ink-3); padding-bottom: 1.15rem;
}
.progress-step:last-child { padding-bottom: 0; }
.progress-step[data-state="ok"], .progress-step[data-state="active"] { color: var(--ink); }
.progress-step[data-state="error"] { color: #C2543F; }

.progress-step:not(:last-child)::before {
  content: ""; position: absolute; left: .5rem; top: 1.15rem; bottom: 0; width: 2px;
  background: var(--line); transition: background .35s ease;
}
.progress-step[data-state="ok"]:not(:last-child)::before { background: var(--accent); }
.progress-step[data-state="error"]:not(:last-child)::before { background: #C2543F; }

.progress-dot {
  flex: none; width: 1.1rem; height: 1.1rem; margin-top: .1rem; border-radius: 50%;
  border: 2px solid var(--line); position: relative; background: var(--bg-2);
  transition: border-color .25s ease, background .25s ease;
}
.progress-step[data-state="active"] .progress-dot {
  border-color: var(--accent); border-top-color: transparent;
  animation: progress-spin .8s linear infinite;
}
.progress-step[data-state="ok"] .progress-dot {
  border-color: var(--accent); background: var(--accent);
  animation: progress-pop .3s ease;
}
.progress-step[data-state="ok"] .progress-dot::after {
  content: ""; position: absolute; left: 3px; top: 0px; width: 4px; height: 8px;
  border: solid var(--bg-1); border-width: 0 2px 2px 0; transform: rotate(40deg);
}
.progress-step[data-state="error"] .progress-dot { border-color: #C2543F; background: var(--bg-2); }
.progress-step[data-state="error"] .progress-dot::before,
.progress-step[data-state="error"] .progress-dot::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 2px; height: 9px; background: #C2543F;
}
.progress-step[data-state="error"] .progress-dot::before { transform: rotate(45deg); }
.progress-step[data-state="error"] .progress-dot::after { transform: rotate(-45deg); }

@keyframes progress-spin { to { transform: rotate(360deg); } }
@keyframes progress-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .progress-step[data-state="active"] .progress-dot { animation: none; border-style: dashed; }
  .progress-step[data-state="ok"] .progress-dot { animation: none; }
}

.progress-detail {
  display: block; margin-top: .15rem; font-size: .78rem; color: #C2543F; font-family: var(--f-mono);
}
.progress-log {
  margin: 1rem 0 0; padding: .6rem .7rem; max-height: 8rem; overflow-y: auto;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius);
  font-family: var(--f-mono); font-size: .74rem; line-height: 1.5; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-all;
}
.progress-footer { margin-top: 1.2rem; display: flex; justify-content: flex-end; }

/* ---------- settings grid ----------
   Square tiles, side by side, name only — a picker to click through to a
   section's own page, not a card trying to summarize it. Fixed-size
   rather than stretched, so the grid reads as a grid (like an OS settings
   app) instead of a row of cards that happen to be square on one screen
   width and not another. */
.settings-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 8.5rem));
}
.settings-tile {
  position: relative; aspect-ratio: 1 / 1;
  display: grid; gap: .6rem; align-content: center; justify-items: center; text-align: center;
  padding: 1rem; background: var(--panel-2); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.settings-tile:hover { border-color: var(--accent); background: var(--glow); }
.settings-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-icon {
  width: 1.6rem; height: 1.6rem; color: var(--accent);
  padding: .55rem; box-sizing: content-box;
  background: var(--glow); border-radius: var(--radius);
}
.tile-title { font-family: var(--f-display); font-weight: 600; font-size: .88rem; color: var(--ink); line-height: 1.25; }

.tile-count {
  position: absolute; top: .5rem; right: .5rem;
  min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--metal); color: var(--bg-1);
  font-family: var(--f-mono); font-size: .68rem; font-weight: 600;
}
.tile-dot {
  position: absolute; top: .7rem; right: .7rem; width: .5rem; height: .5rem; border-radius: 50%;
}
.tile-dot-ok { background: var(--accent-2); }
.tile-dot-warn { background: var(--metal); }
