/*
 * app.css - layout and type of the app shell and the NOW screen.
 *
 * RULE: no colour and no font family is written in this file. Both come from
 * the custom properties that app/design/tokens.js generates from the one token
 * table (--c-*, --font-*, --w-*, --track-*). To restyle, change the table.
 *
 * Sizes are the "points" of design/astrolabe/DESIGN.md section 7 (CSS px).
 * Two arrangements: [data-layout="phone"] (below 700 px of width) and
 * [data-layout="desktop"]; the attribute is set on #app by the shell from the
 * store, so CSS and JavaScript never disagree about which one is in force.
 *
 * --v is a length between 0.5px and 1px: the vertical rhythm of the phone
 * arrangement, 1px on a 852 px tall screen, tighter on short ones. Vertical
 * gaps are written calc(var(--v) * N) so that the reference screen gets the
 * design's exact positions and a small phone still fits.
 */

:root {
  color-scheme: dark;
  --v: clamp(0.5px, (100dvh - 560px) / 292, 1px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* the phone arrangement keeps this much free above the instrument's outermost ring */
  --inset-top: max(calc(var(--safe-top) + 32px), clamp(40px, 10.68dvh, 91px));
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--c-void);
  color: var(--c-bone);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-reading);
  font-weight: var(--w-value);
  font-variant-numeric: tabular-nums lining-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* A focus ring in the design language: one lumen hairline, set off from the mark. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--c-lumen);
  outline-offset: 4px;
  border-radius: 2px;
}

/*
 * An instrument, not a page: a double click or a drag over the engravings selects nothing and shows no text
 * cursor. Only the reading of NOW (worth copying) and the "go to" field take a selection, coloured from the
 * tokens instead of the browser's blue.
 */
#app {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
}

#app .reading,
#app input {
  -webkit-user-select: text;
  user-select: text;
}

#app .reading {
  cursor: text;
}

::selection {
  background: var(--c-lumen-dim);
  color: var(--c-bone);
}

/* a scrolling box with more below than it shows (shell/dom.js watchOverflow sets the class): its content
   fades out towards the bottom edge, the cue that there is more (the scroll bars are hidden) */
.more-below {
  mask-image: linear-gradient(to bottom, black calc(100% - 34px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 34px), transparent);
}

/* resolves the CSS length --inset-top to px for the canvas layout (shell.js reads its height) */
.inset-probe {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  width: 0;
  height: var(--inset-top);
}

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

/*
 * Touch targets: a small engraved control (the NOW marks, the mode, the sigils, a tumbler, the ladder's focus
 * mark, the "go to" field) answers a finger over at least 44 x 44 px around it, without changing what is
 * drawn: an invisible ::before reaches out by half the shortfall on each side (a pseudo-element is hit as
 * its element). Where two controls stand closer than 44 px (the phone's WAVE: the mode, "go to", NOW and the
 * tumblers within 50 px of height) wave.css sets the sides (--hit-top / -bottom / -left / -right) so that the
 * areas meet without covering each other's own box; test/browser-touch.test.js measures every one with
 * elementFromPoint.
 */
.sigil-button,
.wave-now {
  position: relative;
}

.mode-toggle::before,
.now-mark::before,
.sigil-button::before,
.wave-now::before,
.tumbler::before,
.ladder-focus::before,
.wave-goto::before {
  content: '';
  position: absolute;
  top: var(--hit-top, min(0px, calc((100% - 44px) / 2)));
  bottom: var(--hit-bottom, min(0px, calc((100% - 44px) / 2)));
  left: var(--hit-left, min(0px, calc((100% - 44px) / 2)));
  right: var(--hit-right, min(0px, calc((100% - 44px) / 2)));
}

/* ------------------------------------------------------------------ type */

/* Engraved words: capitals (made in JavaScript so that Greek letters stay lowercase), tracked. */
.caps {
  font-family: var(--font-caps);
  font-weight: var(--w-caps);
  letter-spacing: var(--track-caps);
  white-space: nowrap;
}

/* A reading: numerals bone, unit letters and # ash. */
.u {
  color: var(--c-ash);
}

/* Every Earth translation: its own colour, led by the Earth sign. Empty and hidden in pure mode. */
.earth {
  color: var(--c-earth);
  font-weight: var(--w-earth);
  font-style: var(--earth-style);
  white-space: nowrap;
}

/* the 200 ms cross-fade of the annotations when the mode is toggled (not on first paint) */
#app.mode-fade .earth {
  animation: earth-in 200ms linear;
}

.earth .sign {
  font-size: 1.05em;
  font-style: normal;
  margin-right: 0.3em;
}

@keyframes earth-in {
  from {
    opacity: 0;
  }
}

/* --------------------------------------------------------------- marks */

svg {
  display: block;
  overflow: visible;
}

.ink {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.solid {
  fill: currentColor;
  stroke: none;
}

.glyphs path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glyphs path.dot {
  fill: currentColor;
  stroke: none;
}

.glyphs {
  color: var(--c-lumen);
  filter: drop-shadow(0 0 var(--glow-sigma-phone) var(--c-glow-lumen));
}

.glyphs.sol {
  color: var(--c-sol);
  filter: drop-shadow(0 0 var(--glow-sigma-phone) var(--c-glow-sol));
}

.beads .bead {
  fill: var(--c-void);
  stroke: var(--c-etch3);
  stroke-width: 0.8;
}

.beads .bead.lit {
  fill: var(--c-lumen);
  stroke: var(--c-lumen);
}

.pentad-mark {
  color: var(--c-sol);
}

.pentad-mark .ink {
  stroke-width: 0.9;
}

.pentad-mark .vertex {
  fill: var(--c-void);
  stroke: currentColor;
  stroke-width: 0.7;
}

.pentad-mark .vertex.lit {
  fill: currentColor;
}

.pentad-mark .numeral {
  font-family: var(--font-caps);
  font-weight: var(--w-caps);
  font-size: 8px;
  letter-spacing: 0.05em;
  fill: currentColor;
}

.quarter-mark {
  color: var(--c-lumen);
}

.quarter-mark .faint {
  stroke: var(--c-etch3);
  stroke-width: 0.8;
}

.sun-mark,
.sun-row .quarter-mark {
  color: var(--c-sol);
}

/* ------------------------------------------------------------- the shell */

#ground {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
}

#screen {
  position: relative;
  min-width: 0;
  min-height: 0;
  transition: opacity 240ms linear;
}

#screen.leaving {
  opacity: 0;
}

.sigils {
  display: flex;
}

.sigil-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--c-etch3);
}

.sigil-button .caps {
  font-size: 6.5px;
  line-height: 8px;
  /* centre the ink, not the advance: the last letter's tracking hangs off the right */
  margin-right: calc(var(--track-caps) * -1);
}

.sigil-button[aria-current='page'] {
  color: var(--c-lumen);
}

.sigil-button[aria-current='page'] .caps {
  color: var(--c-ash);
}

.mode-toggle {
  display: flex;
  align-items: center;
  color: var(--c-etch3);
}

.mode-toggle .cross {
  opacity: 0;
  transition: opacity 200ms linear;
}

[data-mode='earth'] .mode-toggle .mode-ring {
  color: var(--c-bone);
}

[data-mode='earth'] .mode-toggle .cross {
  opacity: 1;
}

[data-mode='earth'] .mode-toggle .caps {
  color: var(--c-ash);
}

/* The way back while the cursor is away from the present: on every screen. */
.now-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-lumen);
  z-index: 3;
}

.now-mark .caps {
  font-size: 7.5px;
}

.now-mark .offset {
  font-size: 12.5px;
  color: var(--c-bone);
  white-space: nowrap;
}

.now-mark .ring {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

/* phone: screen above, sigils bottom centre, the mode in the top right corner */
#app[data-layout='phone'] {
  grid-template-rows: minmax(0, 1fr) auto;
}

#app[data-layout='phone'] #screen {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

#app[data-layout='phone'] .rail {
  display: contents;
}

#app[data-layout='phone'] .rail-rule {
  display: none;
}

#app[data-layout='phone'] .sigils {
  grid-row: 2;
  justify-content: center;
  gap: 0;
  padding-top: calc(var(--v) * 47.1);
  padding-bottom: max(var(--safe-bottom), calc(var(--v) * 38));
}

#app[data-layout='phone'] .sigil-button {
  width: 70px;
  gap: 4px;
  padding-bottom: 6px;
}

#app[data-layout='phone'] .mode-toggle {
  position: absolute;
  z-index: 3;
  top: calc(var(--inset-top) - 18px);
  right: 21px;
  flex-direction: row-reverse;
  gap: 8px;
}

#app[data-layout='phone'] .mode-toggle .caps {
  font-size: 7.5px;
}

#app[data-layout='phone'] .now-mark {
  position: absolute;
  top: calc(var(--inset-top) - 39px);
  left: 50%;
  transform: translateX(-50%);
}

/* desktop: a rail on the left (mode at the top, the four sigils centred), the screen beside it */
#app[data-layout='desktop'] {
  grid-template-columns: 88px minmax(0, 1fr);
}

#app[data-layout='desktop'] .rail {
  position: relative;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#app[data-layout='desktop'] .rail-rule {
  position: absolute;
  right: 0;
  top: 40px;
  bottom: 40px;
  width: 1px;
  background: var(--c-etch1);
}

#app[data-layout='desktop'] #screen {
  grid-column: 2;
  overflow: hidden;
}

#app[data-layout='desktop'] .sigils {
  flex-direction: column;
  gap: clamp(2px, 3.25dvh, 26px);
  /* the design centres the four marks, not the marks with their words */
  transform: translateY(6px);
}

#app[data-layout='desktop'] .sigil-button {
  width: 64px;
  gap: 6px;
  padding: 6px 0 4px;
}

#app[data-layout='desktop'] .mode-toggle {
  position: absolute;
  top: clamp(8px, 5.9dvh, 47px);
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 9px;
}

#app[data-layout='desktop'] .mode-toggle .caps {
  font-size: 6.5px;
  line-height: 8px;
  margin-right: calc(var(--track-caps) * -1);
  color: var(--c-etch3);
}

#app[data-layout='desktop'] .now-mark {
  position: absolute;
  top: clamp(52px, 14dvh, 112px);
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 6px;
}

/* ------------------------------------------------------- the instrument */

.instrument {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.instrument-canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.instrument-centre {
  position: absolute;
  border-radius: 50%;
}

.instrument-centre:focus-visible {
  outline-offset: -6px;
  border-radius: 50%;
}

.limb {
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.limb:active {
  cursor: grabbing;
}

.limb canvas {
  pointer-events: none;
}

.limb-curved {
  position: absolute;
}

.limb-curved:focus-visible {
  outline-offset: -2px;
  border-radius: 0 0 50% 50% / 0 0 60% 60%;
}

.limb-straight {
  width: 100%;
  height: 64px;
}

/* ----------------------------------------------------------- NOW, common */

.now {
  position: relative;
  height: 100%;
}

.now .value {
  white-space: nowrap;
}

.pentad {
  display: flex;
  align-items: center;
  color: var(--c-sol);
}

/* outside the catalogue the reading is replaced by engraved words (design ruling 7).
   The selector carries [data-layout] so that it outranks the two per-layout
   `.reading` rules further down: without it their 38 / 50 px won and the words
   ran off both edges of the screen. */
#app[data-layout] .out-of-catalogue .reading {
  font-family: var(--font-caps);
  font-weight: var(--w-caps);
  font-size: 9.5px;
  line-height: 38px;
  letter-spacing: var(--track-caps);
  color: var(--c-ash);
}

.countdown .cd-label,
.sun .caps,
.upcoming .caps {
  color: var(--c-ash);
}

.sun .caps {
  color: var(--c-sol-label);
}

.rule {
  height: 0;
  border: 0;
  margin: 0;
  border-top: 0.75px solid var(--c-etch2);
}

/* ------------------------------------------------------------ NOW, phone */

#app[data-layout='phone'] .now {
  display: flex;
  flex-direction: column;
}

/* the instrument takes the height the text leaves; on a very short screen it keeps a usable size and the page scrolls */
#app[data-layout='phone'] .now-instrument {
  flex: 1 1 0;
  min-height: calc(var(--inset-top) + 190px);
}

#app[data-layout='phone'] .now-info {
  flex: none;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

/* designed for a 393 px wide screen; screens/now/now.js sets --column-scale below that width */
#app[data-layout='phone'] .now-column {
  zoom: var(--column-scale, 1);
}

#app[data-layout='phone'] .pentad {
  position: absolute;
  z-index: 2;
  top: calc(var(--inset-top) - 25px);
  left: 18px;
  gap: 6px;
}

#app[data-layout='phone'] .pentad .caps {
  font-size: 8px;
}

#app[data-layout='phone'] .pentad-mark {
  transform: translateY(2px);
}

#app[data-layout='phone'] .pentad-detail,
#app[data-layout='phone'] .majors,
#app[data-layout='phone'] .upcoming,
#app[data-layout='phone'] .countdown .glyphs,
#app[data-layout='phone'] .countdown .cd-head,
#app[data-layout='phone'] .rule-upcoming {
  display: none;
}

#app[data-layout='phone'] .date-words {
  font-size: 9.5px;
  line-height: 12px;
  letter-spacing: var(--track-date);
  color: var(--c-ash);
  margin-top: calc(var(--v) * 12.5);
  /* centre the ink: the last letter's tracking hangs off the right */
  padding-left: var(--track-date);
}

#app[data-layout='phone'] .reading {
  font-size: 38px;
  line-height: 1;
  font-weight: var(--w-reading);
  margin-top: calc(var(--v) * 12);
  white-space: nowrap;
}

.reading .term {
  margin-left: 0.316em;
}

.reading .term:first-child {
  margin-left: 0;
}

.reading .fine {
  font-size: 0.5em;
  font-weight: var(--w-value);
  color: var(--c-ash);
}

.reading .term.fine {
  margin-left: 0.632em;
}

.reading .fine + .fine {
  margin-left: 0.316em;
}

#app[data-layout='phone'] .earth-line {
  font-size: 11.5px;
  line-height: 14px;
  letter-spacing: 0.04em;
  margin-top: calc(var(--v) * 5);
}

#app[data-layout='phone'] .countdowns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 360px;
  max-width: 100%;
  margin: calc(var(--v) * 16) auto 0;
  position: relative;
}

/* the hairline between the two columns */
#app[data-layout='phone'] .countdowns::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 9px;
  bottom: -2px;
  border-left: 0.75px solid var(--c-etch2);
}

#app[data-layout='phone'] .countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 9px;
}

#app[data-layout='phone'] .countdown .cd-label {
  font-size: 7.5px;
  line-height: 10px;
  margin-top: calc(var(--v) * 6);
  padding-left: var(--track-caps);
}

#app[data-layout='phone'] .countdown .cd-span {
  font-size: 19px;
  line-height: 22px;
  margin-top: calc(var(--v) * 3);
}

#app[data-layout='phone'] .countdown .earth {
  font-size: 9.5px;
  line-height: 12px;
  margin-top: 1px;
}

#app[data-layout='phone'] .rule-sun {
  margin: calc(var(--v) * 15.5) 20px 0;
  border-image: linear-gradient(to right, transparent, var(--c-etch2) 15%, var(--c-etch2) 85%, transparent) 1;
}

#app[data-layout='phone'] .sun {
  display: grid;
  grid-template-columns: 98px 82px 92px 1fr;
  align-items: start;
  text-align: left;
  margin-top: calc(var(--v) * 16.5);
  padding-left: 20px;
  max-width: 393px;
  margin-left: auto;
  margin-right: auto;
}

#app[data-layout='phone'] .sun .glyphs {
  margin: 3px 0 0 6.5px;
}

#app[data-layout='phone'] .sun .caps {
  font-size: 7.2px;
  line-height: 10px;
}

#app[data-layout='phone'] .sun .value {
  font-size: 18px;
  line-height: 21px;
  margin-top: 2px;
}

#app[data-layout='phone'] .sun .earth {
  font-size: 9px;
  line-height: 12px;
  margin-top: 2px;
}

/* Earth mode sets the same blocks a little closer, to make room for its lines (DESIGN.md section 7) */
#app[data-layout='phone'][data-mode='earth'] .date-words {
  margin-top: calc(var(--v) * 6.5);
}

#app[data-layout='phone'][data-mode='earth'] .reading {
  margin-top: calc(var(--v) * 8);
}

#app[data-layout='phone'][data-mode='earth'] .countdowns {
  margin-top: calc(var(--v) * 13);
}

#app[data-layout='phone'][data-mode='earth'] .rule-sun {
  margin-top: calc(var(--v) * 2.5);
}

#app[data-layout='phone'][data-mode='earth'] .sigils {
  padding-top: calc(var(--v) * 28);
}

/* ---------------------------------------------------------- NOW, desktop */

/*
 * The right column of DESIGN.md section 7, in the positions of the 1280 x 800
 * reference: Pentad line 92, majors 132 + 30 n, reading 296, the period pair
 * 358, the Sun 490, next thresholds 586 (baselines). It is a flow, so Earth
 * mode's extra lines push what follows down, and a short window scrolls it.
 */
#app[data-layout='desktop'] .now {
  display: grid;
  /* the instrument takes what the column leaves; extra width goes to the column, then to air on both sides.
     The column is never under 330 px: designed 382 px wide, it may be scaled down only to 0.86, where its
     smallest words (7.2 px) reach the design's floor of 6.2 px (screens/now/now.js fitColumn) */
  grid-template-columns: minmax(0, 1100px) clamp(330px, 29.85vw, 520px);
  justify-content: center;
  column-gap: 26px;
  padding-right: clamp(16px, 4.4vw, 56px);
}

#app[data-layout='desktop'] .now-instrument {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

#app[data-layout='desktop'] .now-info {
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  padding-top: clamp(16px, 9.375dvh, 75px);
  padding-bottom: 24px;
  /* a long Earth line in the last column may reach into the margin instead of being cut */
  padding-right: 40px;
  margin-right: -40px;
}

/* designed 382 px wide; screens/now/now.js sets --column-scale to the box's width / 382 */
#app[data-layout='desktop'] .now-column {
  width: 382px;
  zoom: var(--column-scale, 1);
}

#app[data-layout='desktop'] .date-words,
#app[data-layout='desktop'] .cd-label .cd-letter,
#app[data-layout='desktop'] .countdown .earth .dur,
#app[data-layout='desktop'] .rule-countdowns {
  display: none;
}

#app[data-layout='desktop'] .pentad {
  gap: 9px;
  height: 26px;
  margin-left: -3px;
}

#app[data-layout='desktop'] .pentad .caps {
  font-size: 9px;
  position: relative;
  top: -1.5px;
}

#app[data-layout='desktop'] .majors {
  margin-top: 12px;
}

#app[data-layout='desktop'] .major {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: baseline;
  height: 30px;
  line-height: 29px;
  border-bottom: 1px solid var(--c-etch1);
}

#app[data-layout='desktop'] .major .letter {
  font-size: 15px;
  color: var(--c-ash);
}

#app[data-layout='desktop'] .major .name {
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--c-major-name);
  position: relative;
  top: -1px;
}

#app[data-layout='desktop'] .major:last-child .name {
  color: var(--c-bone);
}

#app[data-layout='desktop'] .major .quarter {
  font-size: 9px;
  color: var(--c-ash);
  margin-right: calc(var(--track-caps) * -1);
  position: relative;
  top: -1px;
}

#app[data-layout='desktop'] .reading {
  font-size: 50px;
  line-height: 1;
  font-weight: var(--w-reading);
  margin-top: 20px;
  white-space: nowrap;
}

#app[data-layout='desktop'] .earth-line {
  font-size: 13px;
  line-height: 16px;
  margin-top: 6.5px;
}

#app[data-layout='desktop'] .countdowns {
  display: grid;
  grid-template-columns: 196px 1fr;
  margin-top: 55px;
}

#app[data-layout='desktop'][data-mode='earth'] .countdowns {
  margin-top: 57.5px;
}

/* one period: the glyph pair on the left, its letter, counter, next threshold and span beside it */
#app[data-layout='desktop'] .countdown {
  position: relative;
  height: 80px;
}

#app[data-layout='desktop'] .countdown > * {
  position: absolute;
  left: 78px;
}

#app[data-layout='desktop'] .countdown .glyphs {
  left: 4.25px;
  top: 6.3px;
}

#app[data-layout='desktop'] .countdown .cd-head {
  top: -10px;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

#app[data-layout='desktop'] .countdown .cd-head .cd-letter {
  font-size: 20px;
  line-height: 22px;
}

#app[data-layout='desktop'] .countdown .cd-head .caps {
  font-size: 7.2px;
  color: var(--c-ash);
  position: relative;
  top: -1px;
}

#app[data-layout='desktop'] .countdown .beads {
  top: 19px;
}

#app[data-layout='desktop'] .countdown .cd-label {
  top: 37px;
  font-size: 7.2px;
  line-height: 9px;
}

#app[data-layout='desktop'] .countdown .cd-span {
  top: 45px;
  font-size: 17px;
  line-height: 22px;
}

#app[data-layout='desktop'] .countdown .earth {
  top: 67px;
  font-size: 10px;
  line-height: 13px;
}

#app[data-layout='desktop'] .rule-sun {
  margin-top: 22px;
}

#app[data-layout='desktop'] .sun {
  display: grid;
  grid-template-columns: 118px 90px 94px 1fr;
  align-items: start;
  margin-top: 30px;
  min-height: 62px;
}

#app[data-layout='desktop'] .sun .glyphs {
  margin: 1.8px 0 0 4.75px;
}

#app[data-layout='desktop'] .sun .caps {
  font-size: 7.2px;
  line-height: 10px;
}

#app[data-layout='desktop'] .sun .value {
  font-size: 19px;
  line-height: 22px;
  margin-top: 4px;
}

#app[data-layout='desktop'] .sun .earth {
  font-size: 10px;
  line-height: 13px;
  margin-top: 1px;
}

#app[data-layout='desktop'] .rule-upcoming {
  margin-top: 13px;
}

#app[data-layout='desktop'] .upcoming {
  margin-top: 12px;
}

#app[data-layout='desktop'] .upcoming-title {
  font-size: 7.2px;
  line-height: 10px;
}

#app[data-layout='desktop'] .upcoming-rows {
  margin-top: 2.5px;
}

#app[data-layout='desktop'] .upcoming-row {
  display: grid;
  grid-template-columns: 20px 22px auto 1fr auto 100px;
  align-items: center;
  column-gap: 0;
  height: 27px;
}

.upcoming-row .quarter-mark {
  grid-column: 1;
  margin-left: -2px;
  transform: translateY(1px);
}

.upcoming-row .symbol {
  grid-column: 2;
  font-size: 15px;
  justify-self: center;
}

.upcoming-row .caps {
  grid-column: 3;
  font-size: 7.5px;
  margin-left: 8px;
}

.upcoming-row.sun-row .caps {
  color: var(--c-sol-label);
}

/* list leader: 1 on / 4 off */
.upcoming-row .leader {
  grid-column: 4;
  height: 1px;
  margin: 0 14px;
  background: repeating-linear-gradient(to right, var(--c-etch1) 0 1px, transparent 1px 5px);
}

.upcoming-row .earth {
  grid-column: 5;
  font-size: 10px;
  justify-self: end;
}

.upcoming-row .span {
  grid-column: 6;
  font-size: 15px;
  justify-self: end;
  white-space: nowrap;
}

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  #screen,
  .mode-toggle .cross {
    transition: none;
  }

  #app.mode-fade .earth {
    animation: none;
  }
}
