/* ============================================================
   Swiftpoint Hub — the updates list (/updates).

   One list, two kinds. The kind is the first thing on every row and
   the only filter that matters, so it gets a colour of its own:
   the site in the accent lime, the mouse in the violet. A reader who
   only cares about firmware should be able to see, before reading a
   word, which entries are for them.

   Tokens, the reset, the header and the shared controls live in the
   shared layers and load first; only this page's layout is here.
   ============================================================ */

.up-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* ============ Page head ============ */

.up-head { padding: 40px 0 20px; }
.up-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
}
.up-head h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.up-lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
  max-width: 62ch;
  margin: 0;
}
.up-lede strong { color: var(--text); font-weight: 600; }

/* ============ Month headings ============ */

/* Thirty entries in one column is a list nobody scans. A month
   boundary is the one piece of structure that makes it navigable
   without a filter. */
.up-month {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.up-month::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}
.up-month:first-child { margin-top: 0; }

/* ============ An entry ============ */

.up-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.up-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  scroll-margin-top: calc(var(--hdr-total-h) + var(--sp-4));
}
.up-item:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* The accent is a bar down the left edge rather than a background.
   A whole card in red stops being a card and becomes an alarm, which
   is fine for the one entry that earns it and unreadable for the
   other twenty-nine. */
.up-item::before {
  content: '';
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--up-accent, var(--lime));
}
.up-item.a-lime { --up-accent: var(--lime); }
.up-item.a-blue { --up-accent: var(--blue); }
.up-item.a-teal { --up-accent: var(--teal); }
.up-item.a-violet { --up-accent: var(--violet); }
.up-item.a-orange { --up-accent: var(--orange); }
/* The one accent that does take the whole card: a reader has to
   notice this before anything else on the page. */
.up-item.a-critical {
  --up-accent: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
  background: linear-gradient(90deg, var(--red-dim), var(--surface) 220px);
}

.up-item-h {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.up-item-t {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--text);
}
.up-item-m {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-3);
}

/* The version, in a monospace chip: it is a number, and a number
   set in the body font does not look like one. */
.up-version {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line-med);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  white-space: nowrap;
}
.up-item.a-critical .up-version {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
  background: var(--red-dim);
}

.up-teaser {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0 0 4px;
}
.up-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.up-item-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  text-decoration: none;
}
a.up-item-tag:hover { color: var(--lime-hi); border-color: var(--line-strong); }

.up-item-a {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ============ The rendered body ============ */

.up-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-2);
  overflow-wrap: anywhere;
  margin-top: 4px;
}
.up-body > *:first-child { margin-top: 0; }
.up-body > *:last-child { margin-bottom: 0; }
.up-body p { margin: 0 0 0.85em; }
.up-body h1, .up-body h2, .up-body h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.3;
  margin: 1.4em 0 0.5em;
}
.up-body ul, .up-body ol { margin: 0 0 0.85em; padding-left: 1.5em; }
.up-body li { margin: 0.2em 0; }
.up-body a { color: var(--lime-hi); }
.up-body blockquote {
  margin: 0 0 0.85em;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line-strong);
  color: var(--text-3);
}
.up-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.36em;
  color: var(--text);
}
.up-body pre {
  margin: 0 0 0.9em;
  padding: 12px 14px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow-x: auto;
}
.up-body pre code { background: none; border: 0; padding: 0; font-size: 12.5px; }
.up-body .up-img,
.up-body img.fr-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.6em 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.up-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }

/* --- ::: added / changed / fixed / removed / security -------------
   The whole reason an update is readable at a glance. Each kind gets a
   filled badge, a glyph, a solid bar and a tinted ground, so the eye
   lands on it while moving down the page. The word is in the
   aria-label too, so none of this is colour-only for a screen
   reader. */
.up-entry {
  --entry-colour: var(--text-3);
  --entry-tint: var(--surface-2);
  position: relative;
  margin: 0 0 14px;
  padding: 15px 18px 15px 20px;
  border: 1px solid color-mix(in srgb, var(--entry-colour) 34%, transparent);
  border-left: 4px solid var(--entry-colour);
  border-radius: var(--r-sm);
  background: var(--entry-tint);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.12);
}
.up-entry-t {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 9px;
}
.up-entry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  /* The page background as the text colour: inverted, so the badge is
     the brightest thing in the block. In the light theme the kind
     colours are dark and the background is near white, so the same
     relationship holds. */
  color: var(--bg);
  background: var(--entry-colour);
  border-radius: var(--r-pill);
  padding: 3px 11px;
  white-space: nowrap;
}
.up-entry-badge::before {
  content: var(--entry-glyph, '');
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
}
.up-entry-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.up-entry-b {
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text-2);
}
.up-entry-b > *:last-child { margin-bottom: 0; }
.up-entry-added { --entry-colour: var(--teal); --entry-tint: var(--teal-dim); --entry-glyph: '+'; }
.up-entry-changed { --entry-colour: var(--blue); --entry-tint: var(--blue-dim); --entry-glyph: '~'; }
.up-entry-fixed { --entry-colour: var(--lime); --entry-tint: var(--lime-dim); --entry-glyph: '✓'; }
.up-entry-removed { --entry-colour: var(--orange); --entry-tint: var(--orange-dim); --entry-glyph: '✕'; }
.up-entry-security { --entry-colour: var(--red); --entry-tint: var(--red-dim); --entry-glyph: '!'; }

.up-note {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.up-note-t {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-3);
}
.up-note-b > *:last-child { margin-bottom: 0; }
.up-note-note { border-left-color: var(--blue); }
.up-note-info { border-left-color: var(--teal); }
.up-note-tip { border-left-color: var(--lime); }
.up-note-warning { border-left-color: var(--orange); }
.up-note-bad { color: var(--up-entry, var(--text-2)); }

/* ::: video — the same block the forum renders, under this surface's
   prefix. It needs its own copy for the same reason .up-note does: the
   three surfaces style their own output, and a prefix with no rules is a
   raw 300px-wide iframe in the middle of a release note. */
.up-video { margin: 0 0 14px; max-width: 100%; }
.up-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: var(--video-w, 640px);
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-raise);
}
.up-video-frame > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.up-video-cap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}
/* When the embed plays only part of the video. The player is told to
   stop from the page — an embed url carries no end the player honours —
   so without this the video halts for no visible reason and reads as a
   broken embed rather than as a clip somebody chose. */
.up-video-range {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  white-space: nowrap;
}
.up-video-link {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
}
.up-video-link:hover { color: var(--lime-hi); text-decoration: underline; }
.up-video-bad {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px dashed var(--orange);
  border-radius: var(--r-sm);
  color: var(--orange);
}

/* --- video: size and chapters -------------------------------------

   The player is capped rather than filling the column. A 16:9 frame at
   the width of a guide page is taller than the fold, which made a
   `::: video` read as "the whole page is this video" — the width is the
   one thing about an embed that is not content. `--video-w` is the single
   knob: a `size=480` in the markdown sets it inline on the figure, and
   the keywords below set it in css. */

.up-video--small { --video-w: 360px; }
.up-video--medium { --video-w: 640px; }
.up-video--large { --video-w: 100%; }

/* The chapter row. Each chip is a real link to the watch page at that
   second, so with scripting off — or before it has loaded — they are
   still the useful thing they were meant to be. js/video-player.js only
   takes over the click. */
.up-video-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.up-video-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raise);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  text-decoration: none;
}
.up-video-chip:hover {
  border-color: var(--lime-hi);
  color: var(--lime-hi);
  text-decoration: none;
}
.up-video-chip:focus-visible {
  outline: 2px solid var(--lime-hi);
  outline-offset: 2px;
}
.up-video-chip-t {
  font-variant-numeric: tabular-nums;
  color: var(--lime-hi);
  font-weight: 600;
}
.up-video-chip-l { color: var(--text-3); }


/* ::: spoiler — a native <details>, so it works with no script. */
.up-spoiler {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.up-spoiler > .up-spoiler-t {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.up-spoiler > .up-spoiler-t::-webkit-details-marker { display: none; }
/* The same two-part disclosure as the guides and the forum: caret on the
   left, word on the right. */
.up-spoiler > .up-spoiler-t::before {
  content: '▸';
  flex: none;
  font-size: 11px;
  color: var(--text-3);
  transition: transform var(--t-fast);
}
.up-spoiler[open] > .up-spoiler-t::before { transform: rotate(90deg); }
.up-spoiler > .up-spoiler-t::after {
  content: 'Show';
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.up-spoiler[open] > .up-spoiler-t::after {
  content: 'Hide';
  color: var(--lime-hi);
  border-color: color-mix(in srgb, var(--lime) 35%, transparent);
  background: var(--lime-dim);
}
.up-spoiler > .up-spoiler-t:hover { background: var(--surface-3); color: var(--lime-hi); }
.up-spoiler-b { padding: 0 12px 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.up-spoiler-b > *:last-child { margin-bottom: 0; }
.up-img-bad {
  display: inline-block;
  font-size: 12.5px;
  color: var(--text-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  padding: 2px 8px;
}
.up-steps-missing {
  margin: 0 0 0.9em;
  padding: 10px 12px;
  border: 1px dashed var(--orange);
  border-radius: var(--r-sm);
  color: var(--orange);
  font-size: 13px;
}

/* ============ Badges ============ */


.up-kind::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.up-kind.k-website { color: var(--lime-hi); background: var(--lime-dim); border-color: color-mix(in srgb, var(--lime) 40%, transparent); }
.up-kind.k-mouse { color: var(--violet); background: var(--violet-dim); border-color: color-mix(in srgb, var(--violet) 36%, transparent); }

.up-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

/* ============ The editor ============ */

/* The size and the behaviour of this modal are ui.css’s business now —
   see `.modal--form` and `.modal--full`. */

.up-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}
.up-form-main { min-width: 0; }
.up-form-side {
  position: sticky;
  top: 0;
  min-width: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}
@media (max-width: 1000px) {
  .up-form { grid-template-columns: minmax(0, 1fr); }
  .up-form-side { position: static; }
}

/* The writing surface gets a slightly larger face than the reply box:
   at full width a 13.5px monospace line runs to about a hundred
   characters, and a hundred characters of monospace is a line nobody
   can find the end of. */
#up-editor-mount .md-area {
  font-size: 14px;
  min-height: clamp(240px, 32vh, 420px);
  padding: 18px 20px;
}

/* Version and summary share a row: they are two halves of one thought
   — "what it is called" and "what changed" — and stacking them makes the
   form twice as tall for no gain. */
.up-field-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr);
  gap: 14px;
  align-items: start;
}
.up-field-row .field { margin-top: 0; }
@media (max-width: 620px) {
  .up-field-row { grid-template-columns: minmax(0, 1fr); }
}

.up-side-h {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
}
.up-side-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
}
.up-side-note b { color: var(--text-2); }

/* Inside the preview the card is a preview, not a page element. */
.up-form-side .up-item {
  padding: 14px 15px;
  border-radius: var(--r-sm);
}
.up-form-side .up-item::before { inset: 10px auto 10px 0; }
.up-form-side .up-item-t { font-size: 15px; }
.up-form-side .up-body { font-size: 13.5px; }

.up-legend {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0;
  margin-bottom: 10px;
}
.up-optional {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-4);
  margin-left: 6px;
}
.up-count {
  margin: 5px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
}
.up-count.is-near { color: var(--orange); }

/* Fields breathe. The form is one column of six things, and at full
   width with no rhythm between them it reads as a settings dump. */
.up-form-main .field { margin-bottom: 20px; }
.up-form-main .field:last-child { margin-bottom: 0; }
.up-form-main .field > label {
  display: block;
  margin-bottom: 7px;
}

.up-kinds { border: 0; padding: 0; margin: 0 0 16px; }
.up-kinds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 520px) {
  .up-kinds-grid { grid-template-columns: 1fr; }
}
.up-kind-card {
  position: relative;
  display: block;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.up-kind-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.up-kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.up-kind-card:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.up-kind-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-dim); }
.up-kind-card-n {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.up-kind-card:has(input:checked) .up-kind-card-n { color: var(--lime-hi); }
.up-kind-card-d {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}

/* The accent picker: six swatches, and the name of each in the
   tooltip. A grid of colours with no words is a guessing game. */
.up-accents { display: flex; gap: 9px; flex-wrap: wrap; }
.up-accent {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.up-accent::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--swatch);
}
.up-accent:hover { transform: scale(1.08); }
.up-accent[aria-checked='true'] {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-raise), 0 0 0 4px var(--text);
}
.up-accent.c-lime { --swatch: var(--lime); }
.up-accent.c-blue { --swatch: var(--blue); }
.up-accent.c-teal { --swatch: var(--teal); }
.up-accent.c-violet { --swatch: var(--violet); }
.up-accent.c-orange { --swatch: var(--orange); }
.up-accent.c-critical { --swatch: var(--red); }

.up-tagpick { display: flex; gap: 7px; flex-wrap: wrap; }
.up-tag {
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.up-tag:hover { color: var(--text); border-color: var(--line-strong); }
.up-tag[aria-pressed='true'] {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.up-tag[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Pin to the top. It is its own row rather than a field, so it gets a
   top rule to separate it from the form above — the one control in this
   dialog that changes where the entry appears rather than what it
   says. */
.up-pin-row {
  margin: 0 0 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.up-pin-row .fr-check { font-size: 13.5px; }

/* ============ Empty state ============ */

.up-empty h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}
.up-empty p {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.up-loading {
  padding: 40px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-3);
}
