/* ============================================================
   /move-from-arc/ only (Nov 2026 rewrite). Loaded after refresh.css,
   versus.css and arc-pages.css; every class here is .ag-*.
   Colours come from the refresh.css tokens. The site is light-only
   (no dark palette anywhere), so this page follows it: the drawings
   use the same tokens, so a future site-wide dark theme only has to
   redefine the tokens.
   Motion: transform and opacity only, once, when a block scrolls into
   view (the inline script adds .ag-anim to <html> and .is-in to the
   block). Nothing moves with prefers-reduced-motion, and without JS
   everything is simply shown.
   ============================================================ */

.ag-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Hero additions ---------- */
.ag-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.sbb-legal ul.ag-hero-facts > li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.sbb-legal ul.ag-hero-facts > li::before { content: none; }
.ag-hero-facts svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

/* ---------- Deadline block: timeline + checklist ---------- */
.ag-deadline {
  margin-top: 30px;
  padding: 22px 24px 24px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.10), rgba(255, 255, 255, 0.92) 64%);
  box-shadow: var(--shadow-soft);
}
.ag-deadline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
}
.sbb-legal .ag-deadline h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.ag-days {
  display: inline-block;
  min-width: 15ch;
  color: var(--warning);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ag-tl { margin-top: 14px; }
.ag-tl svg { display: block; width: 100%; height: auto; overflow: visible; }
.ag-tl text { font-family: var(--ui-font); fill: var(--text); }
.ag-tl .t-date { font-size: 20px; font-weight: 700; }
.ag-tl .t-what { font-size: 16px; fill: #5f6168; }
.ag-tl .t-key { fill: var(--danger); }
.ag-tl .t-warn { fill: var(--warning); }
.ag-tl .t-today { font-size: 15px; font-weight: 700; fill: var(--accent); letter-spacing: .06em; }
.ag-tl .axis { stroke: rgba(29, 29, 31, 0.16); stroke-width: 4; stroke-linecap: round; }
.ag-tl .window { fill: var(--accent); opacity: .9; }
.ag-tl .after { stroke: rgba(29, 29, 31, 0.18); stroke-width: 4; stroke-dasharray: 2 7; stroke-linecap: round; }
.ag-tl .dot { fill: #fff; stroke: var(--text); stroke-width: 3; }
.ag-tl .dot-key { fill: var(--danger); stroke: #fff; stroke-width: 3; }
.ag-tl .dot-warn { fill: #fff; stroke: var(--warning); stroke-width: 3.5; }
.ag-tl .dot-done { fill: rgba(29, 29, 31, 0.28); stroke: none; }
.ag-tl .today-pin { fill: var(--accent); }
.ag-tl .tick { stroke: rgba(29, 29, 31, 0.18); stroke-width: 1.5; }

/* The same dates as a list: the phone layout, and the text that screen readers get. */
.ag-tl-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}
.sbb-legal .ag-tl-list > li {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 14px 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.sbb-legal .ag-tl-list > li::before {
  content: '';
  position: absolute;
  left: 4px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--text);
}
.sbb-legal .ag-tl-list > li::after {
  content: '';
  position: absolute;
  left: 9px; top: 20px; bottom: -4px;
  width: 2px;
  background: rgba(29, 29, 31, 0.14);
}
.sbb-legal .ag-tl-list > li:last-child::after { content: none; }
.sbb-legal .ag-tl-list > li.is-past::before { background: rgba(29, 29, 31, 0.28); border-color: transparent; }
.sbb-legal .ag-tl-list > li.is-warn::before { border-color: var(--warning); }
.sbb-legal .ag-tl-list > li.is-key::before { background: var(--danger); border-color: var(--danger); }
.ag-tl-list b { font-weight: 700; font-variant-numeric: tabular-nums; }
.sbb-legal .ag-tl-list > li.is-key b,
.sbb-legal .ag-tl-list > li.is-key span { color: var(--danger); }
.sbb-legal .ag-tl-list > li.is-warn b { color: var(--warning); }

.ag-checklist {
  margin: 18px 0 0;
  padding: 16px 18px 6px;
  border-radius: var(--radius-panel);
  background: var(--control-bg);
  border: 1px solid var(--panel-border);
}
.sbb-legal .ag-checklist h3 { margin: 0 0 8px; color: var(--text); font-size: 16px; font-weight: 700; }
.ag-checklist ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
  counter-reset: agc;
}
.sbb-legal .ag-checklist ol > li {
  counter-increment: agc;
  position: relative;
  padding: 6px 0 10px 34px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.sbb-legal .ag-checklist ol > li::before {
  content: counter(agc);
  position: absolute;
  left: 0; top: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.ag-checklist a { font-weight: 600; }
.ag-min { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- Where things go: the route map ---------- */
.ag-map {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px;
}
.sbb-legal .ag-map > li {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.sbb-legal .ag-map > li::before { content: none; }
/* Arrow between cards */
.ag-map > li + li > .ag-arrow {
  position: absolute;
  left: -24px;
  top: 64px;
  width: 22px;
  height: 14px;
  color: var(--accent);
}
.ag-map__art {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #f3f5f9;
}
.ag-map__step {
  display: block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.ag-map__title { display: block; margin-top: 3px; color: var(--text); font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.ag-map__text { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ag-map-alt {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px dashed var(--field-border);
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.sbb-legal .ag-map-alt p { color: var(--muted); font-size: 14.5px; }
.ag-map-alt strong { color: var(--text); }

/* Drawing parts shared by the small route drawings */
.ag-art-line { fill: #d9dee8; }
.ag-art-line-d { fill: #b9c1d0; }
.ag-art-acc { fill: var(--accent); }
.ag-art-acc-soft { fill: rgba(26, 115, 232, 0.16); }
.ag-art-card { fill: #fff; stroke: rgba(29, 29, 31, 0.10); }
.ag-art-text { font-family: var(--ui-font); font-size: 11px; font-weight: 700; fill: var(--text); }
.ag-art-text-m { font-family: var(--ui-font); font-size: 10px; font-weight: 600; fill: #5f6670; }
.ag-art-text-w { font-family: var(--ui-font); font-size: 10px; font-weight: 700; fill: #fff; }
.ag-art-arc { fill: url(#ag-arc-grad); }

/* ---------- What survives ---------- */
.ag-survive {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}
.ag-survive__art svg { display: block; width: 100%; height: auto; }
.ag-survive__groups { display: grid; gap: 12px; }
.ag-group {
  padding: 14px 16px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  background: var(--panel);
}
.ag-group--ok { border-color: var(--success-border); background: linear-gradient(180deg, var(--success-bg), rgba(255,255,255,.9) 80%); }
.ag-group--side { border-color: var(--warning-border); background: linear-gradient(180deg, rgba(245, 158, 11, 0.09), rgba(255,255,255,.9) 80%); }
.ag-group--no { border-color: var(--danger-border); background: linear-gradient(180deg, var(--danger-bg), rgba(255,255,255,.9) 80%); }
.sbb-legal .ag-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}
.ag-group h3 svg { width: 20px; height: 20px; flex: none; }
.ag-group--ok h3 svg { color: var(--success); }
.ag-group--side h3 svg { color: var(--warning); }
.ag-group--no h3 svg { color: var(--danger); }
.sbb-legal .ag-group li { color: var(--text); font-size: 15px; line-height: 1.55; }
.sbb-legal .ag-group--ok ul li::before { background: var(--success); }
.sbb-legal .ag-group--side ul li::before { background: #d97706; }
.sbb-legal .ag-group--no ul li::before { background: var(--danger); }
.ag-survive__art text { font-family: var(--ui-font); }

/* ---------- Screenshots ---------- */
.ag-shot { margin: 16px 0 0; }
.ag-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.ag-shot--panel img { max-width: 396px; }
.ag-shot--half img { max-width: 560px; }
.ag-shot figcaption { margin-top: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ag-shot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.ag-shot-pair .ag-shot { margin: 0; }

/* Annotated bar: numbered pins above the strip, legend below */
.ag-annot { position: relative; padding-top: 30px; }
.ag-pin {
  position: absolute;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.ag-pin::after {
  content: '';
  position: absolute;
  top: 22px; left: 10px;
  width: 2px; height: 10px;
  background: var(--text);
}
.ag-legend {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}
.sbb-legal .ag-legend > li {
  position: relative;
  padding-left: 30px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.sbb-legal .ag-legend > li::before {
  content: attr(data-n);
  position: absolute;
  left: 0; top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

/* ---------- Steps: small extras on top of .sbb-arc-steps ---------- */
.ag-time {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
  white-space: nowrap;
}
.ag-os {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ag-os > div {
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-control);
  background: var(--control-bg);
}
.sbb-legal .ag-os p { font-size: 15px; line-height: 1.6; }
.ag-os__label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ag-tip {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
}
.sbb-legal .ag-tip p { font-size: 15px; line-height: 1.6; }
.ag-honest {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  background: var(--panel);
}
.sbb-legal .ag-honest ul { margin-top: 8px; }
.sbb-legal .ag-honest li { font-size: 15.5px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  border: 1px solid var(--field-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font: 600 0.86em/1.5 var(--ui-font);
  text-align: center;
}

/* Focus: visible ring on everything this page adds */
.ag-checklist a:focus-visible,
.sbb-arc-steps a:focus-visible,
.ag-map-alt a:focus-visible,
.sbb-arc-next__card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Motion (once, on scroll into view) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .ag-anim [data-ag-reveal]:not(.is-in) .ag-r { opacity: 0; transform: translateY(10px); }
  .ag-anim [data-ag-reveal] .ag-r { transition: opacity .5s var(--ease), transform .6s var(--ease); }
  .ag-anim [data-ag-reveal].is-in .ag-r:nth-child(2) { transition-delay: .08s; }
  .ag-anim [data-ag-reveal].is-in .ag-r:nth-child(3) { transition-delay: .16s; }
  .ag-anim [data-ag-reveal].is-in .ag-r:nth-child(4) { transition-delay: .24s; }
  .ag-anim [data-ag-reveal].is-in .ag-r:nth-child(5) { transition-delay: .32s; }

  /* Timeline: the window to act grows from today to 22 Dec, then the dots land. */
  .ag-anim .ag-tl:not(.is-in) .window { transform: scaleX(0); }
  .ag-tl .window { transform-box: fill-box; transform-origin: left center; transition: transform 1.1s var(--ease) .15s; }
  .ag-anim .ag-tl:not(.is-in) .pop { opacity: 0; transform: scale(.4); }
  .ag-tl .pop { transform-box: fill-box; transform-origin: center; transition: opacity .35s ease, transform .5s var(--ease); }
  .ag-tl .pop.d1 { transition-delay: .2s; }
  .ag-tl .pop.d2 { transition-delay: .45s; }
  .ag-tl .pop.d3 { transition-delay: .9s; }
  .ag-tl .pop.d4 { transition-delay: 1.15s; }
  .ag-tl .pop.d5 { transition-delay: 1.35s; }
  .ag-anim .ag-tl:not(.is-in) .fade { opacity: 0; }
  .ag-tl .fade { transition: opacity .6s ease .3s; }

  /* Route map: cards rise in order, arrows slide in after them. */
  .ag-anim .ag-map:not(.is-in) > li { opacity: 0; transform: translateY(12px); }
  .ag-map > li { transition: opacity .45s ease, transform .55s var(--ease); }
  .ag-map > li:nth-child(2) { transition-delay: .12s; }
  .ag-map > li:nth-child(3) { transition-delay: .24s; }
  .ag-map > li:nth-child(4) { transition-delay: .36s; }
  .ag-map > li:nth-child(5) { transition-delay: .48s; }
  .ag-anim .ag-map:not(.is-in) .ag-arrow { opacity: 0; transform: translateX(-8px); }
  .ag-arrow { transition: opacity .35s ease .55s, transform .45s var(--ease) .55s; }
  .ag-anim .ag-map:not(.is-in) .ag-art-move { transform: translateY(6px); opacity: 0; }
  .ag-art-move { transition: opacity .4s ease .7s, transform .5s var(--ease) .7s; }

  /* Sidebar drawing: what comes over gets its tick, one row after another. */
  .ag-anim .ag-survive:not(.is-in) .ag-tickmark { opacity: 0; transform: scale(.3); }
  .ag-tickmark { transform-box: fill-box; transform-origin: center; transition: opacity .3s ease, transform .45s var(--ease); }
  .ag-tickmark.k1 { transition-delay: .15s; }
  .ag-tickmark.k2 { transition-delay: .3s; }
  .ag-tickmark.k3 { transition-delay: .45s; }
  .ag-tickmark.k4 { transition-delay: .6s; }
  .ag-tickmark.k5 { transition-delay: .8s; }
  .ag-tickmark.k6 { transition-delay: .95s; }
}

/* ---------- Layout switches ---------- */
@media (min-width: 721px) {
  .ag-tl-list { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 960px) {
  .ag-map { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .ag-map > li + li > .ag-arrow { display: none; }
  .ag-map > li:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .ag-tl { display: none; }
  .ag-deadline { padding: 18px 16px 18px; }
  .sbb-legal .ag-deadline h2 { font-size: 20px; }
  .ag-checklist ol,
  .ag-os,
  .ag-legend,
  .ag-shot-pair { grid-template-columns: minmax(0, 1fr); }
  .ag-survive { grid-template-columns: minmax(0, 1fr); }
  .ag-survive__art { max-width: 260px; margin: 0 auto; }
  .ag-annot { padding-top: 26px; }
  .ag-pin { width: 20px; height: 20px; margin-left: -10px; font-size: 11px; }
  .ag-pin::after { top: 20px; left: 9px; height: 6px; }
}
@media (max-width: 480px) {
  .ag-map { grid-template-columns: minmax(0, 1fr); }
  .ag-map > li { flex-direction: row; gap: 12px; align-items: flex-start; }
  .ag-map__art { width: 96px; flex: none; }
  .ag-map__step { margin-top: 0; }
}

/* ---------- "Three things that will feel familiar" ---------- */
.sbb-legal ul.ag-after { margin-top: 12px; display: grid; gap: 10px; }
.sbb-legal ul.ag-after > li { font-size: 16px; line-height: 1.65; color: var(--text); }

/* ---------- Fixes after the first screenshot round ---------- */
.sbb-legal ul.ag-hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; margin-bottom: 14px; }
.sbb-legal ul.ag-hero-facts > li { width: auto; padding: 0 12px; margin: 0; }
.sbb-legal .sbb-arc-sec > p.sbb-arc-src { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.sbb-legal .sbb-arc-steps ol.ag-legend { list-style: none; padding-left: 0; margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sbb-legal .sbb-arc-steps ol.ag-legend > li { padding-left: 30px; font-size: 14.5px; }
.ag-shot-stack { display: grid; gap: 12px; margin-top: 14px; }
.ag-shot-stack .ag-shot { margin: 0; }
.ag-shot-stack img { max-width: 676px; }
.ag-inline-shot { display: block; width: 100%; max-width: 314px; height: auto; margin-top: 8px; border: 1px solid var(--panel-border); border-radius: 10px; box-shadow: var(--shadow-soft); }

.sbb-legal .sbb-arc-steps figure + p { margin-top: 14px; }
.sbb-legal .sbb-arc-steps .ag-shot + .ag-shot { margin-top: 12px; }

.ag-pin { left: var(--x); }
.ag-shot picture, .ag-annot picture { display: block; }
@media (max-width: 600px) { .ag-pin { left: var(--xm); } }
/* Phones: a fixed two-column grid, so the font swap (fallback -> Inter) cannot re-wrap the pills and shift the page. */
.sbb-legal ul.ag-hero-facts > li { white-space: nowrap; }
@media (max-width: 600px) {
  .sbb-legal ul.ag-hero-facts { display: grid; grid-template-columns: repeat(2, max-content); }
}
@media (max-width: 600px) {
  /* Same reason: the two hero buttons fit on one line in the fallback font but not in Inter. Stack them always. */
  .sbb-arc-cta-row { flex-direction: column; align-items: flex-start; }
}
