/* ============================================================
   CERG News Manager

   Colour and type tokens mirror SFU's CLF stylesheet, using the same names
   (--c-p1, --f-font-weight--heavy, …) so anything lifted from an SFU page
   drops in unchanged.

   SFU's own faces — November, Lava, Countach — are licensed for sfu.ca only
   and cannot be served from here, so Archivo stands in at matching weights
   and widths. Everything else follows the CLF.
   ============================================================ */

:root {
  /* Colours, straight from the CLF */
  --c-p1: #cc0633;   /* SFU light red — primary */
  --c-p2: #a6192e;   /* SFU dark red — secondary */
  --c-p3: #000000;   /* body copy */
  --c-p4: #ffffff;
  --c-s1: #414042;
  --c-s2: #e6e7e8;
  --c-s3: #f5f5f5;
  --c-s4: #a7a9ac;
  --c-s5: #6d6f71;
  --c-s6: #49484a;
  --c-s7: #efefef;
  --c-s9: #d7d7d7;
  --c-transparent: #ffffff00;
  --c-focus-dark: #0b78e6;
  --c-focus-light: #85c0ff;
  --c-focus: var(--c-focus-dark);

  /* Type, mapped onto Archivo's variable axes */
  --f-font-family--body: 'Archivo', 'Arial', sans-serif;
  --f-font-family--icon: 'Material Symbols Outlined';
  --f-font-weight--heavy: 800;
  --f-font-weight--bold: 700;
  --f-font-weight--medium: 550;
  --f-font-weight--regular: 400;
  --f-font-weight--light: 300;
  --f-font-stretch--normal: 100%;
  --f-font-stretch--condensed: 83%;

  --transition-power-2-in-out: cubic-bezier(.66, 0, .34, 1);

  --space-1: .4rem;
  --space-2: .8rem;
  --space-3: 1.2rem;
  --space-4: 1.6rem;
  --space-5: 2.4rem;
  --space-6: 3.2rem;
}

html { font-size: 62.5%; }                 /* 1rem = 10px, as in the CLF */

*, *::before, *::after { box-sizing: border-box; }

/* Class-based display rules below would otherwise beat the browser's own
   [hidden] rule on specificity. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--c-p4);
  color: var(--c-p3);
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--light);
  font-stretch: var(--f-font-stretch--normal);
  font-size: 1.7rem;
  line-height: 2.6rem;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--heavy);
  font-stretch: var(--f-font-stretch--condensed);
  letter-spacing: normal;
  color: var(--c-s1);
  margin: 0;
}
h1 { font-size: 3.7rem; line-height: 4.2rem; }
h2 { font-size: 2.5rem; line-height: 2.9rem; color: var(--c-s6); }
h3 { font-size: 1.9rem; line-height: 2.2rem; color: var(--c-s6); }
h4 { font-size: 1.6rem; line-height: 2rem; color: var(--c-s6); }

p { margin: 0; }
a { color: var(--c-s5); }
strong, b { font-weight: var(--f-font-weight--bold); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--c-s3);
  padding: .1rem .4rem;
}

.material-symbols-outlined {
  font-family: var(--f-font-family--icon);
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  font-size: 2rem;
  /* Fixed square box: if the icon font ever fails to arrive, the ligature name
     is clipped instead of stretching whatever contains it. */
  inline-size: 1em;
  block-size: 1em;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 100;
  background: var(--c-p1);
  color: var(--c-p4);
  padding: var(--space-2) var(--space-3);
  font-weight: var(--f-font-weight--bold);
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: var(--space-2); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--c-s2);
  background: var(--c-p4);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  max-width: 156rem;
  margin: 0 auto;
}
.brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-3); }
.brand__unit {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--bold);
  font-stretch: var(--f-font-stretch--normal);
  text-transform: uppercase;
  color: var(--c-s1);
  font-size: 1.3rem;
}
.brand__title {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--heavy);
  font-stretch: var(--f-font-stretch--condensed);
  text-transform: uppercase;
  color: var(--c-s1);
  font-size: 2.1rem;
  line-height: 1;
}
.brand__logo { height: 3.6rem; width: auto; display: block; }

.header-right { display: flex; align-items: center; gap: var(--space-4); }
.who { display: flex; align-items: center; gap: var(--space-2); }
.who__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--c-s3);
  border-left: 3px solid var(--c-p1);
  padding: .5rem 1.1rem;
  font-size: 1.4rem;
  font-weight: var(--f-font-weight--medium);
  color: var(--c-s1);
}
.who__chip .material-symbols-outlined { font-size: 1.9rem; color: var(--c-p1); }

/* ============================================================
   Buttons — CLF button shape
   ============================================================ */
.btn {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--heavy);
  font-stretch: var(--f-font-stretch--condensed);
  text-transform: uppercase;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--c-transparent);
  border-radius: 0;
  padding: 1rem 2rem;
  font-size: 1.4rem;
  line-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn .material-symbols-outlined { font-size: 1.8rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary { background: var(--c-p1); color: var(--c-p4); border-color: var(--c-p1); }
.btn--primary:hover:not(:disabled) { background: var(--c-p2); border-color: var(--c-p2); }

.btn--outline { background: var(--c-transparent); color: var(--c-p1); border-color: var(--c-p1); }
.btn--outline:hover:not(:disabled) { background: var(--c-p1); color: var(--c-p4); }

/* Destructive stays outlined until hover, so it never reads as the primary
   action sitting next to Save. */
.btn--danger { background: var(--c-transparent); color: var(--c-p2); border-color: var(--c-p2); }
.btn--danger:hover:not(:disabled) { background: var(--c-p2); color: var(--c-p4); }

.btn--quiet {
  background: none;
  color: var(--c-s5);
  border-color: var(--c-transparent);
  text-transform: none;
  font-weight: var(--f-font-weight--medium);
  font-stretch: var(--f-font-stretch--normal);
  padding: .6rem .8rem;
  text-decoration: underline;
}
.btn--quiet:hover:not(:disabled) { color: var(--c-p1); }

.btn--small { font-size: 1.2rem; padding: .7rem 1.2rem; gap: .5rem; }
.btn--small .material-symbols-outlined { font-size: 1.6rem; }
.btn--tall { padding: 1.4rem 2rem; font-size: 1.5rem; }
.btn--block { display: flex; width: 100%; }

.icon-btn {
  font: inherit;
  background: var(--c-transparent);
  border: 1px solid var(--c-transparent);
  color: var(--c-s1);
  cursor: pointer;
  padding: .5rem;
  display: inline-flex;
  align-items: center;
}
.icon-btn:hover { color: var(--c-p1); }

/* ============================================================
   Sign in
   ============================================================ */
.signin { max-width: 46rem; margin: var(--space-6) auto; padding: 0 var(--space-4); }
.signin__card {
  border: 1px solid var(--c-s2);
  border-top: 4px solid var(--c-p1);
  padding: var(--space-5);
}
.signin__lede { color: var(--c-s5); margin: var(--space-3) 0 var(--space-5); font-size: 1.5rem; }

/* ============================================================
   Fields
   ============================================================ */
.field { margin-bottom: var(--space-5); border: 0; padding: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label,
.field__label {
  display: block;
  font-weight: var(--f-font-weight--bold);
  font-size: 1.5rem;
  color: var(--c-p3);
  margin-bottom: .5rem;
}
.field__optional { font-weight: var(--f-font-weight--light); color: var(--c-s5); }
.field__help {
  font-size: 1.3rem;
  line-height: 1.9rem;
  color: var(--c-s5);
  margin-top: .5rem;
  max-width: 62ch;
}
.field label + .field__help { margin-top: 0; margin-bottom: .6rem; }

.field__headrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: .6rem;
}
.field__headrow .field__label { margin-bottom: 0; }

input[type="text"], input[type="password"], input[type="date"],
input[type="url"], textarea {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--light);
  font-size: 1.6rem;
  line-height: 2.4rem;
  width: 100%;
  padding: .9rem 1rem;
  border: 1px solid var(--c-s4);
  border-radius: 0;
  background: var(--c-p4);
  color: var(--c-p3);
}
input:focus-visible, textarea:focus-visible { border-color: var(--c-focus); }
textarea { resize: vertical; }

.radio-pair { display: flex; gap: 0; }
.radio-pair__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  position: relative;
  font-size: 1.3rem;
  font-weight: var(--f-font-weight--medium);
  padding: .5rem 1.1rem;
  border: 1px solid var(--c-s4);
  cursor: pointer;
  margin: 0;
  background: var(--c-p4);
}
.radio-pair__option + .radio-pair__option { border-left: 0; }
/* The dot itself is hidden — the filled pill already says which is chosen —
   but the input stays in the page so it is still keyboard-operable. */
.radio-pair__option input,
.segmented__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.radio-pair__option:has(input:checked) {
  background: var(--c-p1);
  border-color: var(--c-p1);
  color: var(--c-p4);
}
.radio-pair__option:has(input:focus-visible),
.segmented__option:has(input:focus-visible) {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 1.4rem;
  line-height: 2rem;
  background: var(--c-s3);
  border-left: 4px solid var(--c-s4);
}
.alert .material-symbols-outlined { margin-top: .1rem; }
.alert--error { border-left-color: var(--c-p2); background: var(--c-s3); }
.alert--error .material-symbols-outlined { color: var(--c-p2); }
.alert--error p { color: var(--c-s1); }
.alert--warn { border-left-color: var(--c-p1); margin: var(--space-4) 0 0; }
.alert--warn .material-symbols-outlined { color: var(--c-p1); }
.alert--warn .btn { margin-top: var(--space-2); }

.form-error {
  color: var(--c-p2);
  font-weight: var(--f-font-weight--bold);
  font-size: 1.4rem;
  padding: var(--space-2) var(--space-3);
  background: var(--c-p4);
  border-left: 4px solid var(--c-p1);
  margin-top: var(--space-3);
}

/* ============================================================
   Layout
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 34rem 1fr;
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-5) var(--space-4);
  max-width: 156rem;
  margin: 0 auto;
}
@media (width <= 979px) { .layout { grid-template-columns: 1fr; } }
/* Grid children default to min-width:auto, which stops them shrinking below
   their content and pushes the page sideways on a phone. */
.layout > * { min-width: 0; }

.panel-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--c-s2);
}

/* ---------- Sidebar ---------- */
.actions {
  background: var(--c-s3);
  padding: var(--space-4);
  position: sticky;
  top: var(--space-4);
}
@media (width <= 979px) { .actions { position: static; } }
.actions .panel-head { justify-content: space-between; }
.actions__main { display: grid; gap: var(--space-2); }
.actions__advanced {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--c-s9);
}
.actions__subhead {
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--c-s5);
  margin-bottom: var(--space-3);
}
.actions__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }

/* ---------- Import ---------- */
.import { margin-top: var(--space-3); padding: var(--space-3); background: var(--c-p4); }
.import__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--space-2);
}
.import__note, .import__mode-help {
  font-size: 1.3rem;
  line-height: 1.9rem;
  color: var(--c-s5);
  margin-bottom: var(--space-3);
}
.import__mode-help { font-variant-numeric: tabular-nums; }

.segmented { border: 0; padding: 0; margin: 0 0 var(--space-2); }
.segmented legend {
  font-size: 1.3rem;
  font-weight: var(--f-font-weight--bold);
  text-transform: uppercase;
  color: var(--c-s5);
  padding: 0;
  margin-bottom: .6rem;
}
.segmented__options { display: flex; }
.segmented__option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  position: relative;
  font-size: 1.2rem;
  font-weight: var(--f-font-weight--medium);
  padding: .6rem .4rem;
  border: 1px solid var(--c-s4);
  cursor: pointer;
  text-align: center;
}
.segmented__option + .segmented__option { border-left: 0; }
.segmented__option:has(input:checked) {
  background: var(--c-p1); border-color: var(--c-p1); color: var(--c-p4);
}

.dropzone {
  border: 1px dashed var(--c-s4);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  margin-bottom: var(--space-3);
  background: var(--c-s3);
}
.dropzone.is-over { border-color: var(--c-p1); background: var(--c-p4); }
.dropzone__label { display: grid; justify-items: center; gap: .2rem; cursor: pointer; }
.dropzone__icon { color: var(--c-p1); font-size: 2.6rem; }
.dropzone__strong {
  font-weight: var(--f-font-weight--bold);
  color: var(--c-p1);
  font-size: 1.4rem;
}
.dropzone__hint { font-size: 1.2rem; color: var(--c-s5); }
.dropzone__file { font-size: 1.2rem; margin-top: var(--space-2); font-weight: var(--f-font-weight--bold); }
.dropzone:focus-within { outline: 2px solid var(--c-focus); outline-offset: 2px; }

.import__result { font-size: 1.3rem; line-height: 1.9rem; margin-top: var(--space-3); }
.import__result ul { margin: var(--space-2) 0 0; padding-left: 1.8rem; color: var(--c-s5); }

/* ---------- Recently deleted ---------- */
.recover { margin-top: var(--space-4); }
.disclosure {
  font-family: var(--f-font-family--body);
  font-size: 1.3rem;
  font-weight: var(--f-font-weight--bold);
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--c-transparent);
  color: var(--c-s5);
  cursor: pointer;
  padding: .5rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
}
.disclosure:hover { color: var(--c-p1); }
.disclosure__caret { font-size: 1.8rem; transition: transform .15s ease; }
.disclosure[aria-expanded="true"] .disclosure__caret { transform: rotate(90deg); }

.recover__list { margin-top: var(--space-2); font-size: 1.3rem; }
.recover__item { padding: var(--space-2) 0; border-bottom: 1px solid var(--c-s9); }
.recover__title { color: var(--c-s1); display: block; line-height: 1.8rem; }
.recover__meta { color: var(--c-s5); font-size: 1.2rem; display: block; margin-top: .2rem; }
.recover__actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.recover__empty { color: var(--c-s5); padding: var(--space-2) 0; }

/* ============================================================
   Preview
   ============================================================ */
.preview { min-height: 60vh; }
/* Stays put while scrolling, so the copy and delete controls are always in
   reach when picking items out of a long list. */
.preview__head {
  justify-content: flex-start;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--c-p4);
  padding-top: var(--space-3);
  margin-top: calc(var(--space-3) * -1);
}
.preview__mode { color: var(--c-s5); font-size: 1.4rem; text-transform: uppercase;
                 font-weight: var(--f-font-weight--bold); }
.preview__tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-2);
                  flex-wrap: wrap; }
.preview__count { font-size: 1.3rem; font-weight: var(--f-font-weight--bold); color: var(--c-s1); }

.list-empty {
  color: var(--c-s5);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  border: 1px dashed var(--c-s4);
}
.news-list { list-style: none; margin: 0; padding: 0; }

/* ---------- The red year bar, as it renders on the live page ---------- */
.year-marker {
  background-color: var(--c-p1);
  padding: 1rem 2rem;
  margin: 6rem 0 var(--space-4);
}
.year-marker h3 {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--heavy);
  font-stretch: var(--f-font-stretch--condensed);
  color: var(--c-p4);
  font-size: 2.5rem;
  line-height: 2.9rem;
  margin: 0;
}
.news-list > li:first-child .year-marker { margin-top: 0; }

/* ---------- A news item ---------- */
/* Leaves room for the sticky header when a row is scrolled to, so the row
   never ends up underneath it. */
.item, .year-marker, .editor { scroll-margin-top: 9rem; }

.item {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: var(--space-3);
  border: 1px solid var(--c-transparent);
  border-left: 3px solid var(--c-s2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: .4rem;
  cursor: pointer;
}
.item:hover { border-left-color: var(--c-p1); background: var(--c-s3); }
.item:focus-within { border-color: var(--c-focus); }
.item.is-selected {
  background: var(--c-s3);
  border-color: var(--c-p1);
  border-left-color: var(--c-p1);
}

/* Slower, so the move is easy to follow. */
.item.is-landed { animation: land 2.6s var(--transition-power-2-in-out); }
.item.is-reverted { animation: flash-grey 1.2s var(--transition-power-2-in-out); }
.item.is-flagged { animation: flash-attention 2.2s var(--transition-power-2-in-out); }
/* Not named 'revert': that is a CSS-wide keyword and would be ignored. */
@keyframes flash-grey {
  0%, 30% { background: var(--c-s3); border-color: var(--c-s4); border-left-color: var(--c-s4); }
  100%    { background: var(--c-transparent); border-color: var(--c-transparent); }
}
@keyframes flash-attention {
  0%, 15%  { background: var(--c-s3); border-color: var(--c-p2); border-left-color: var(--c-p2); }
  45%      { background: var(--c-transparent); border-color: var(--c-transparent); }
  60%      { background: var(--c-s3); border-color: var(--c-p2); border-left-color: var(--c-p2); }
  100%     { background: var(--c-transparent); border-color: var(--c-transparent); }
}
@keyframes land {
  0%, 35% { background: var(--c-s3); border-color: var(--c-p1); border-left-color: var(--c-p1); }
  100%    { background: var(--c-transparent); border-color: var(--c-transparent); }
}

.item__tools {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: .4rem;
}
/* Controls stay in the DOM for keyboard and screen-reader users; they fade in
   when the row is hovered or something inside it takes focus. They hold their
   space at all times, so rows never jump around under the pointer. */
.item__tools .btn {
  opacity: 0;
  transition: opacity .12s ease;
  padding: .5rem .7rem;
  font-size: 1.15rem;
  gap: .35rem;
}
.item__tools .btn .material-symbols-outlined { font-size: 1.5rem; }
.item:hover .item__tools .btn,
.item:focus-within .item__tools .btn,
.item.is-selected .item__tools .btn { opacity: 1; }
@media (hover: none) { .item__tools .btn { opacity: 1; } }
.item__tools .is-on { background: var(--c-p1); color: var(--c-p4); border-color: var(--c-p1); }

/* Clicking the card toggles selection, so its text is not selectable —
   a stray drag would otherwise highlight text instead. */
.item__card { min-width: 0; user-select: none; }

/* Matches the markup this tool generates for the live page. */
.item__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: .2rem;
}
.item__title {
  font-weight: var(--f-font-weight--medium);
  font-stretch: var(--f-font-stretch--normal);
  font-size: 1.7rem;
  line-height: 2.6rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.item__links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1.2rem; min-width: 0; }
.item__link {
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--medium);
  font-stretch: var(--f-font-stretch--normal);
  color: var(--c-p1);
  text-transform: uppercase;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}
.item__link::after {
  font-weight: var(--f-font-weight--light);
  content: " \2192";
}
.item__meta { font-size: 1.7rem; line-height: 2.6rem; }
.item__meta i { font-style: italic; }
.item__flag { font-size: 1.2rem; color: var(--c-p2); text-transform: uppercase;
              font-weight: var(--f-font-weight--bold); margin-top: .3rem; }

/* ---------- Editor, shown in the list where the item sits ---------- */
.editor {
  border-left: 3px solid var(--c-p1);
  background: var(--c-s3);
  padding: var(--space-4);
  margin-bottom: .4rem;
}
.editor__grid {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: var(--space-4);
  align-items: start;
}
.editor__side { display: grid; gap: var(--space-2); }
.editor__side-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
/* Adding a news item has nothing to delete, so Cancel takes the whole row. */
.editor--adding .editor__side-row { grid-template-columns: 1fr; }
.editor__byline {
  font-size: 1.2rem;
  line-height: 1.7rem;
  color: var(--c-s5);
  margin-top: var(--space-2);
}
.editor__byline span { display: block; }

@media (width <= 760px) {
  .editor__grid { grid-template-columns: 1fr; }
  /* On a phone the actions belong under the thing they act on. */
  .editor__side { order: 2; }
  .editor__fields { order: 1; }
}

.links { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: grid; gap: var(--space-2); }
.links__row { display: flex; gap: var(--space-2); align-items: center; }
.links__row input { flex: 1; min-width: 0; }

@media (width <= 560px) {
  .item { grid-template-columns: 1fr; }
  .item__tools { grid-auto-flow: column; justify-content: start; gap: var(--space-2); }
}

/* ============================================================
   Dialogs
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 19, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
  overflow-y: auto;
  z-index: 50;
}
.overlay[hidden] { display: none !important; }

.dialog {
  background: var(--c-p4);
  width: 100%;
  max-width: 66rem;
  margin: auto;
  box-shadow: 0 2.4rem 6rem rgba(0, 0, 0, .28);
  animation: dialog-in .18s var(--transition-power-2-in-out);
}
.dialog--wide { max-width: 86rem; }
.dialog--narrow { max-width: 44rem; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(1.2rem); }
  to   { opacity: 1; transform: none; }
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--c-s3);
  border-top: 4px solid var(--c-p1);
}
.dialog__head h2 { font-size: 2.2rem; line-height: 2.6rem; color: var(--c-s1); }
.dialog__sub { font-size: 1.3rem; color: var(--c-s5); margin-top: .3rem; }
.dialog__body { padding: var(--space-5); }
.dialog__foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--c-s2);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  background: var(--c-s3);
}

/* Numbered steps, with the counter set like a heading. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid;
         gap: var(--space-6); }
.step { counter-increment: step; display: grid; grid-template-columns: 4.4rem 1fr;
        gap: var(--space-2) var(--space-3); align-items: start; }
.step::before {
  content: counter(step);
  /* Row 1 only. Spanning further would create empty rows whose gaps showed up
     as dead space under each step. */
  grid-row: 1;
  grid-column: 1;
  font-family: var(--f-font-family--body);
  font-weight: var(--f-font-weight--heavy);
  font-stretch: var(--f-font-stretch--condensed);
  font-size: 2.5rem;
  line-height: 3.4rem;
  color: var(--c-p4);
  background: var(--c-p1);
  width: 3.6rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
}
.step > * { grid-column: 2; }
.step h3 { font-size: 1.9rem; line-height: 3.4rem; text-transform: uppercase; }
.step p { font-size: 1.5rem; line-height: 2.3rem; max-width: 62ch; }
.step__note { font-size: 1.3rem; color: var(--c-s5); }

.code-wrap { margin-bottom: var(--space-2); }
.code {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.2rem;
  line-height: 1.7;
  padding: var(--space-3);
  border: 1px solid var(--c-s4);
  background: var(--c-s3);
  color: var(--c-p3);
  resize: vertical;
}

.shot { margin: var(--space-3) 0 0; }
.shot img { width: 100%; height: auto; display: block; border: 1px solid var(--c-s2); }
.shot__placeholder {
  border: 1px dashed var(--c-s4);
  background: var(--c-s3);
  color: var(--c-s5);
  font-size: 1.3rem;
  padding: var(--space-5) var(--space-3);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  text-align: center;
}
.shot__placeholder .material-symbols-outlined { font-size: 3.2rem; color: var(--c-s4); }

.confirm__reassure { color: var(--c-s5); font-size: 1.4rem; margin-top: var(--space-2); }

/* ---------- Help ---------- */
.help__guide {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--c-s3);
  border-left: 3px solid var(--c-p1);
  color: var(--c-p3);
  text-decoration: none;
  margin-bottom: var(--space-5);
}
.help__guide:hover { background: var(--c-s7); }
.help__guide > span:nth-child(2) { flex: 1; }
.help__guide strong { display: block; font-size: 1.6rem; }
.help__guide-sub { font-size: 1.3rem; color: var(--c-s5); }
.help__guide .material-symbols-outlined { color: var(--c-p1); }

.help__item { display: flex; gap: var(--space-3); margin-bottom: var(--space-5); }
.help__item > .material-symbols-outlined { color: var(--c-p1); margin-top: .3rem; }
.help__item h3 { font-size: 1.6rem; line-height: 2.2rem; text-transform: uppercase;
                 margin-bottom: .3rem; }
.help__item p { font-size: 1.5rem; line-height: 2.3rem; max-width: 62ch; }

.help__support {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--c-s2);
  border-left: 3px solid var(--c-s4);
  font-size: 1.4rem;
}
.help__support .material-symbols-outlined { color: var(--c-s5); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-4);
  transform: translateX(-50%);
  background: var(--c-s1);
  color: var(--c-p4);
  padding: var(--space-3) var(--space-4);
  font-weight: var(--f-font-weight--medium);
  font-size: 1.4rem;
  z-index: 80;
  max-width: calc(100vw - 3.2rem);
  box-shadow: 0 .8rem 2.4rem rgba(0, 0, 0, .25);
}
.toast--bad { background: var(--c-p2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  .item { border-left-color: var(--c-p3); }
  input, textarea { border-color: var(--c-p3); }
}
