/* Windows has no flag emoji: its emoji font draws a flag's two regional letters (🇪🇬 as
   "EG"). This font carries only the flags (Twemoji, CC-BY 4.0) and the unicode-range keeps it to
   them, so every other character still comes from the fonts after it. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("assets/fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  font-display: swap;
}
/* UI contract and component exceptions: see ../STYLES.md. */
::selection {
  background: rgba(0, 221, 245, 0.35);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
  font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button svg,
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
  transition:
    background-color 0.15s,
    box-shadow 0.15s,
    scale 0.15s;
}
button:active {
  scale: 0.96;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
:focus {
  outline: none;
}
/* Pointer focus must not hide the persistent ASMR selection outline. */
:focus:not(:focus-visible):not(.asmr-theme[aria-pressed="true"]) {
  outline: none !important;
}



button[hidden],
[hidden] {
  display: none !important;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.properties {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
  --section-divider-color: rgba(255, 255, 255, 0.06);
  z-index: 3;
  inset: auto;
  width: auto;
  color: var(--ink);
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 29%),
    linear-gradient(322deg, var(--glass-sheen), transparent 29%),
    radial-gradient(var(--glare-size) at 0% 0%, rgb(var(--glare-color) / calc(var(--glare-strength) * var(--glare-opacity) * var(--glare-tl-opacity))), transparent var(--glare-reach)),
    radial-gradient(var(--glare-size) at 100% 100%, rgb(var(--glare-color) / calc(var(--glare-strength) * var(--glare-opacity) * var(--glare-br-opacity))), transparent var(--glare-reach)),
    var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--glass-shadow);
  isolation: isolate;
  transform: translateZ(0);
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.create-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  /* 20px more room above the logomark than below the credit. */
  padding: 60px 0 40px;
}
.create-footer-logomark {
  display: block;
  height: 60px;
  width: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.create-footer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.create-footer-version {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: var(--text-meta);
  font-weight: var(--weight-regular);
  line-height: 1;
  letter-spacing: var(--tracking-text);
  color: var(--ink);
}
.create-footer-channel {
  color: var(--secondary);
  padding: 2px 4px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  line-height: 1;
}
.create-footer-link {
  font-size: var(--text-meta);
  font-weight: var(--weight-regular);
  line-height: 1;
  letter-spacing: var(--tracking-text);
  color: var(--muted);
  opacity: 0.6;
  text-decoration: none;
  transition: color 0.16s ease, opacity 0.16s ease;
}
.create-footer-link:hover {
  color: var(--ink);
  text-decoration: underline;
}
/* The data licences (MET Norway, Open-Meteo: CC BY 4.0) ask for credit; it reads like the
   studio link, its source names linked. */
.create-footer-credit {
  margin: 32px 0 8px; /* 40px above the credit and 16px below it to About, with the 8px column gap */
  opacity: 0.3;
}
.create-footer-credit:hover {
  color: var(--muted);
  text-decoration: none;
}
.create-footer-credit a {
  color: inherit;
}
.create-footer-credit a:hover {
  color: var(--ink);
}
.controls {
  position: static;
  min-height: 0;
  flex: 1;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 0 24px 72px;
  overflow-x: hidden;
  overflow-y: auto;
  contain: content;
  will-change: scroll-position;
}
.control-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.control-section:first-child {
  padding-top: 0;
}
#section-style {
  padding-top: 28px;
}
.panel-view > .control-section:last-child,
.panel-view > .control-section:last-of-type,
#aurora-section {
  border-bottom: none;
}
#aurora-section {
  padding-bottom: 0;
}
#aurora-section .control-note:last-child {
  margin-bottom: 0;
}
.control-section > *:last-child {
  margin-bottom: 0 !important;
}
h2 svg,
h2 .heading-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 21px;
  margin-bottom: 10px;
}
.label-row output {
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
  padding: 0 6px;
}
#hour-output {
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  background: none;
  padding: 0;
  line-height: inherit;
}
input[type="range"] {
  width: 100%;
  margin: 0;
  display: block;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  border: none;
}
/* Every slider except time of day is a pull slider: the track is a glass bar
   filled from the left by --progress, with the label and value laid over it. */
input[type="range"]:not(.time-range) {
  position: absolute;
  inset: 0;
  height: var(--pull-h, 44px);
  border-radius: inherit;
  background: transparent;
  padding: 0;
}
input[type="range"]:not(.time-range)::-webkit-slider-runnable-track {
  width: 100%;
  height: var(--pull-h, 44px);
  border-radius: inherit;
  border: none;
  background: linear-gradient(to right, var(--pull-fill) var(--progress, 0%), var(--pull-track) var(--progress, 0%));
}
input[type="range"]:not(.time-range)::-moz-range-track {
  width: 100%;
  height: var(--pull-h, 44px);
  border-radius: inherit;
  border: none;
  background: linear-gradient(to right, var(--pull-fill) var(--progress, 0%), var(--pull-track) var(--progress, 0%));
}
/* A thin grip at the fill's edge, shown while pointing, focused or dragging. */
input[type="range"]:not(.time-range)::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 4px;
  height: 22px;
  margin-top: 11px;
  border-radius: 999px;
  background: #fff;
  border: none;
  box-shadow: var(--pull-thumb-shadow);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 140ms ease, transform 140ms ease;
}
input[type="range"]:not(.time-range)::-moz-range-thumb {
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: none;
  box-shadow: var(--pull-thumb-shadow);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 140ms ease, transform 140ms ease;
}
/* Ticks and labels span the globe's travel (half a globe in from each edge), so
   00:00 and 24:00 sit under the globe at the ends. Labels centre on zero-width
   grid tracks at 0/25/50/75/100 %. */
.time-ticks {
  display: flex;
  justify-content: space-between;
  margin: 9px calc(var(--globe-size) / 2) 0;
}
.time-ticks i {
  width: 1px;
  height: 3px;
  background: var(--line);
}
.time-ticks i:nth-child(6n + 1) {
  height: 5px;
}
.range-labels {
  display: grid;
  grid-template-columns: repeat(5, 0);
  justify-content: space-between;
  font-size: var(--text-meta);
  opacity: 0.6;
  margin: 5px calc(var(--globe-size) / 2) 0;
}
.range-labels span {
  justify-self: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.time-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}
.control-section .time-header h2 {
  margin: 0;
  font-size: var(--text-body);
  letter-spacing: var(--tracking-heading);
}
.time-caption {
  margin: 0;
  font-size: var(--text-caption);
  display: flex;
  align-items: center;
  gap: 6px;
}
.text-button svg {
  width: 13px;
  height: 13px;
}
.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 24px;
}
.preset {
  padding: 0;
  border-radius: 12px;
  background: transparent !important;
  position: relative;
}
.preset img {
  width: 100%;
  height: 39px;
  display: block;
  background: #a9cde2;
}

.preset span {
  display: block;
  margin-top: 9px;
  white-space: nowrap;
}

.celestial-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0 0 12px;
}
/* The subtitle sits under the heading (.section-header, like Weather and Clouds); the cards
   keep the 24px it used to leave above the Sun group. */
.celestial-options.celestial-bodies {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 24px;
}
/* The gap the eye sees under Weather's subtitle ends at the letters of its "Conditions" label
   (a 21px line around 14px text), 5px below that label's box: 27.5px from subtitle baseline to
   ink. The Sun cards' edge is their ink, so their header sits 5px further off to match. */
#section-celestial .section-header {
  margin-bottom: 25px;
}
/* Weather's subtitle sits 2px further above its "Conditions" label than the shared 18px
   (user, 17 November 2026); Sun, moon & stars below keeps the same visible gap (5px more,
   for the label's leading). */
#weather-effects-section .section-header {
  margin-bottom: 20px;
}
#section-style h2,
#section-adjustments h2 {
  margin-bottom: 16px;
}
.celestial {
  min-width: 0;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  text-align: center;
}
.celestial svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.celestial span {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

/* The eclipse picture at the left across both rows, the title over its status in the middle,
   the switch at the right; the sliders span the card below. */
.eclipse-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) var(--sw-width, 50px);
  column-gap: 12px;
  row-gap: 4px;
  margin: 24px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s, background-color 0.15s;
}
/* A section title with its action (location switch, shuffle) at the right and a
   subtitle that wraps beneath the title, never under the action. */
.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  /* The title row is at least the location switch's 24px, so a title with no action (Sun, moon
     & stars) sits its subtitle as far below as Weather's does. */
  grid-template-rows: minmax(24px, auto);
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  margin-bottom: var(--section-label-gap, 18px);
}
.section-header h2 {
  margin: 0;
}
.section-header .control-note {
  grid-column: 1;
  margin: 0;
}
.eclipse-card.active {
  border-color: rgba(0, 221, 245, 0.35);
  background: rgba(0, 221, 245, 0.08);
}
.eclipse-header,
.eclipse-title {
  display: contents;
}
.eclipse-title > span {
  grid-column: 2;
  grid-row: 1;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--ink);
}
.eclipse-header .toggle-switch {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}
.eclipse-card .control-note {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  min-width: 0;
}
.eclipse-card > :not(.eclipse-header):not(.control-note) {
  grid-column: 1 / -1;
}
/* The eclipses as the sky renderer draws them, cropped round like the Sun and Moon orbs. */
.eclipse-title .eclipse-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  /* Its top on the title's mean line (x-height): 9px into the 21px line of 12px text. */
  margin-top: 9px;
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 50%;
}
/* Canvas-chrome glass tokens are typed so the dark/frosted switch can ease: the glass is a
   gradient stack, which a plain background transition cannot interpolate. */
@property --floating-glass-fill {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --glass-border {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --glass-inner-line {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --glass-sheen {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --glass-rim {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --glass-low-rim {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --floating-icon-color {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --control-hover {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --control-strong {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
@property --glass-ambient-strength {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --glass-ambient-rgb {
  syntax: "<number>+";
  inherits: true;
  initial-value: 0 0 0;
}
@property --sw-thumb-w {
  syntax: "<length>";
  inherits: true;
  initial-value: 25px;
}
@property --sw-inset {
  syntax: "<length>";
  inherits: true;
  initial-value: 2px;
}
.toggle-switch,
.tuning-control {
  --held-glass-fill: linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 38%, rgba(255, 255, 255, 0.13)), rgba(255, 255, 255, 0.04);
  --held-glass-border: rgba(255, 255, 255, 0.3);
  --held-glass-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.22), inset -1px 0 0 rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.2);
  --held-glass-filter: url("#slider-glass-refraction") blur(0.35px) saturate(180%) contrast(1.1);
}
.toggle-switch {
  --sw-width: 50px;
  --sw-height: 24px;
  --sw-border: 1px;
  --sw-inset: 2px;
  --sw-thumb-w: 25px;
  --sw-thumb-w-press: 36px;
  --sw-inset-press: 1px;
  --sw-travel: calc(var(--sw-width) - 2 * var(--sw-border) - 2 * var(--sw-inset));
  position: relative;
  flex: 0 0 auto;
  width: var(--sw-width);
  height: var(--sw-height);
  padding: 0;
  border: var(--sw-border) solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
.toggle-switch:hover {
  border-color: rgba(255, 255, 255, 0.28);
}
.toggle-switch:focus-visible {
  outline: 2px solid #00a8bb;
  outline-offset: 3px;
}
.toggle-switch:active {
  --sw-thumb-w: var(--sw-thumb-w-press);
  --sw-inset: var(--sw-inset-press);
  --sw-travel: calc(var(--sw-width) - 2 * var(--sw-border) - 2 * var(--sw-inset-press));
}
.switch-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #232a30;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.toggle-switch[aria-checked="true"] .switch-track {
  background: var(--switch-active-fill);
}
.switch-thumb {
  position: absolute;
  top: var(--sw-inset);
  bottom: var(--sw-inset);
  left: var(--sw-inset);
  width: var(--sw-thumb-w);
  height: auto;
  border-radius: 999px;
  border: 0.5px solid transparent;
  background: #fff;
  transform: translateX(0);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.18s ease,
    bottom 0.18s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}
.toggle-switch[aria-checked="true"] .switch-thumb {
  transform: translateX(calc(var(--sw-travel) - var(--sw-thumb-w)));
}
.toggle-switch:active .switch-thumb {
  background: var(--held-glass-fill);
  border-color: var(--held-glass-border);
  box-shadow: var(--held-glass-shadow);
  -webkit-backdrop-filter: var(--held-glass-filter);
  backdrop-filter: var(--held-glass-filter);
}
/* Location switches mark their state inside the thumb: a pin while the section
   follows the location, a crossed-out pin while it is set by hand. */
.location-switch .switch-thumb {
  display: grid;
  place-items: center;
}
.location-switch .switch-thumb svg {
  grid-area: 1 / 1;
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
  transition: opacity 0.22s ease;
}
.location-switch .switch-icon-on {
  color: #00808f;
  opacity: 0;
}
.location-switch .switch-icon-off {
  color: #232a30;
  opacity: 0.45;
}
.location-switch[aria-checked="true"] .switch-icon-on {
  opacity: 0.9;
}
.location-switch[aria-checked="true"] .switch-icon-off {
  opacity: 0;
}
.location-switch:active .switch-thumb svg {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .switch-thumb {
    transition: none;
  }
}
/* Eclipses: a caps heading like Sun, Moon and Stars above the two cards, spaced as a slider
   group is: 26px from the slider above to the heading, 15px from the heading to the card. */
.eclipse-group { margin-top: 18px; }
.eclipse-group > #eclipse-card { margin-top: 15px; } /* collapses with the heading's 8px */
/* The section's last-child rule no longer reaches the Lunar card inside the group. */
.eclipse-group > :last-child { margin-bottom: 0; }
#lunar-eclipse-card.active {
  border-color: rgba(226, 140, 115, 0.35);
  background: rgba(226, 140, 115, 0.08);
}
/* Solar and lunar eclipse sliders: 10px down to the dashed divider, 14px below it. */
#eclipse-tuning,
#lunar-eclipse-tuning {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.styles {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.style {
  font-size: var(--text-caption);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.style-thumb {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #a9cde2;
  box-shadow: inset 0 0 0 1px #00000014;
}
/* Realistic is drawn live from the current sky; until then it shows the default one. */
.style[data-style="realistic"] .style-thumb {
  background: #a9cde2 url("assets/thumbs/style-realistic.webp") center / cover;
}
/* The thumbnails are pictures (scripts/render-thumbs.js), so pressing one must never start an
   image drag instead of a click (draggable="false" in the markup; this for Safari). They keep
   the pointer: the cloud and aurora buttons are display: contents, so a click that passed
   through the picture would land on the card behind it, not on the button. */
.preset img,
.aurora-preset img,
img.style-thumb {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
.aurora-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 24px;
}
.aurora-preset {
  padding: 0;
  border: 0;
  background: transparent !important;
}
.aurora-preset img {
  display: block;
  width: 100%;
  /* The old 60.5:43 picture, 4px shorter (cqi: the card wrap is the container). */
  height: calc(100cqi * 43 / 60.5 - 4px);
  border-radius: 12px;
  background: #07111d;
  box-shadow: inset 0 0 0 1px var(--line);
  outline: none;
}
.aurora-preset span {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aurora-preset.active span {
  color: var(--accent-ink);
}
/* Left to right in the order the emissions stand in the sky, lowest first. */
.aurora-palettes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin: 0 0 24px;
}
.aurora-palette {
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px;
  background: transparent;
  cursor: pointer;
}
.aurora-palette.active {
  background: rgba(0, 221, 245, 0.15);
  border-color: rgba(0, 221, 245, 0.35);
}
.aurora-presets .style.active {
  background: rgba(0, 221, 245, 0.15);
  border-color: rgba(0, 221, 245, 0.35);
  color: var(--accent-ink);
}
.palette-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}
/* Each swatch pairs a palette's signature layers, in their emission colours. */
.swatch-emerald {
  background: linear-gradient(135deg, #22f513, #1dd111);
}
.swatch-crimson {
  background: linear-gradient(135deg, #eb0030, #20e012);
}
.swatch-magenta {
  background: linear-gradient(135deg, #22f013, #d900f0);
}
.swatch-sar {
  background: linear-gradient(135deg, #f02534, #a4101d);
}
.swatch-sunlit {
  background: linear-gradient(135deg, #6900e6, #21e613);
}
.atmospheric-phenomena-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--control-grid-gap);
  margin: 0;
}
.weather-phenomena-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--control-grid-gap);
  margin: 0;
}
/* Reserve grid-to-tuning space only when controls are shown — same rhythm as the
   location card gap above Conditions/Phenomena. */
.atmospheric-phenomena-grid + #atmospheric-tuning:not([hidden]) {
  margin-top: var(--section-label-gap, 18px);
}
/* Weather groups take the standard 18px group rhythm, each carrying its own gap above (the
   first one under the grid too), so a group sliding open or shut takes its gap with it. */
#weather-tuning > .tuning-group {
  margin-top: var(--section-label-gap, 18px);
}
/* Phenomenon groups keep the Sun, moon & stars rhythm (.tuning-group, 18px apart); the
   first, All phenomena, is always shown, so it alone sits flush. */
.atmos-item {
  font-size: var(--text-caption);
  border: 1px solid var(--line);
  border-color: var(--selection-card-rest-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  padding: 12px 4px;
  color: var(--muted);
  background: var(--selection-card-rest-fill);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    scale 0.15s ease;
  text-align: center;
  min-height: 48px;
}
.atmos-item-icon {
  font-size: var(--text-label);
  line-height: 1;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Conditions (24px) and Phenomena (28px) cards draw their own painted icons, not emoji; the
   global svg rule would stroke them as line icons, so they opt out. */
.weather-phenomena-grid .atmos-item-icon {
  height: 24px;
}
/* Phenomena icons draw 4px larger than Conditions. */
.atmospheric-phenomena-grid .atmos-item-icon,
.atmospheric-phenomena-grid .atmos-item-icon .ph-icon {
  width: 28px;
  height: 28px;
}
.atmos-item-icon .ph-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: none;
}
/* Hail and Snow draw 2px larger; the -1px margin keeps the 24px slot so labels stay aligned. */
[data-weather="weatherHail"] .atmos-item-icon .ph-icon,
[data-weather="weatherSnow"] .atmos-item-icon .ph-icon {
  width: 26px;
  height: 26px;
  margin: -1px;
}
.atmos-item-label {
  font-size: var(--text-meta);
  font-weight: var(--weight-medium);
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.search-field {
  display: flex;
  border: 1px solid #dce2d4;
  overflow: hidden;
}
.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 10px;
  background: transparent;
}
.search-field button {
  padding: 8px;
  display: grid;
  place-items: center;
}
.search-field svg {
  width: 16px;
  height: 16px;
}
.location-result small {
  display: block;
  margin-top: 3px;
}
.panel-footer {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.canvas-top {
  position: absolute;
  top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  left: 29px;
  right: 29px;
}
.scene-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sky-status-gap);
  /* A button (it opens the sky details card): no button chrome, the status looks as before. */
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: inherit;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  color: var(--ink);
  text-shadow: 0 1px 5px rgba(33, 68, 96, 0.245);
  transition: color 200ms ease-out, text-shadow 200ms ease-out, opacity 200ms ease-out;
}
/* Not the global button:hover fill: the status keeps no box behind it. */
.scene-label:hover {
  background: none;
}
/* No press shrink: the open card measures the status to sit its header exactly on it. */
.scene-label:active,
.sky-details-head:active {
  scale: 1;
}
.scene-label:disabled {
  cursor: default;
  pointer-events: none;
}
.scene-label:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}
/* A small chevron after the title says the status opens; in the open card's header it points up. */
:is(.scene-label:not(:disabled), .sky-details-head) .scene-title::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  background: currentColor;
  opacity: 0.8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 200ms ease-out;
}
.sky-details-head .scene-title::after {
  transform: rotate(180deg);
}
/* The phone modal closes on any tap: its header has no chevron to point anywhere. */
#sky-details:modal .sky-details-head .scene-title::after {
  display: none;
}
/* Open, the card's own header stands in for the status, which it covers exactly. */
.scene-label.is-open {
  opacity: 0;
}

.canvas-panel.canvas-ui-light .scene-label {
  text-shadow: 0 1px 5px rgba(33, 68, 96, 0.4);
}
/* A pale sky behind the status itself (skyStatusDark in app.js) takes dark ink. */
.canvas-panel.sky-status-dark .scene-label {
  color: var(--light-ink);
  text-shadow: none;
}
.scene-title {
  font-weight: var(--weight-medium);
  font-size: var(--text-body);
  letter-spacing: var(--tracking-heading);
}
.scene-label #scene-detail {
  display: inline-block;
  min-width: 28ch;
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.8;
}
/* A feature switched on while its shader still builds (syncBuilding in app.js). */
.scene-label .sky-preparing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-meta);
  white-space: nowrap;
  opacity: 0.8;
}
.scene-label .sky-preparing[hidden] {
  display: none;
}
.scene-label .sky-preparing::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: skyPreparing 1.2s ease-in-out infinite;
}
@keyframes skyPreparing {
  50% {
    opacity: 0.25;
  }
}
.export-wrap {
  position: relative;
  flex-shrink: 0;
  pointer-events: auto;
}

.canvas-bottom {
  position: absolute;
  bottom: 26px;
  right: 29px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  height: 44px;
  align-items: center;
  pointer-events: none;
  left: 29px;
}

/* Until the first sky is drawn (the shaders can take a while to build on a first visit
   with a slow GPU), the canvas shows the sky's colours and says what it is waiting for. */
.canvas-panel.sky-pending::after {
  content: "Preparing the sky\2026";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 16px;
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-text);
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 9999px;
  background: rgb(0 0 0 / 0.32);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.24);
  pointer-events: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.canvas-panel:fullscreen {
  border-radius: 0;
  width: 100vw;
  height: 100vh;
}
.canvas-panel:-webkit-full-screen {
  border-radius: 0;
  width: 100vw;
  height: 100vh;
}
.canvas-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 5;
  border-radius: 0;
}
/* iPhone Safari has no Fullscreen API for a page element, so its full screen is this
   class. The phone layout sizes the canvas to 44% of the page, which kept it a strip at
   the top; like record mode it now fills the visible viewport, over the panel. */
@media (max-width: 700px) {
  .canvas-panel.is-fullscreen {
    width: 100vw;
    height: 100dvh;
    z-index: 40;
  }
}
body:is(.record-mode, .fullscreen-mode) :is(.sky-tabs, .desktop-navigation) {
  display: none !important;
}
:fullscreen .canvas-top,
.canvas-panel:fullscreen .canvas-top,
.canvas-panel.is-fullscreen .canvas-top {
  display: none !important;
}
:-webkit-full-screen .canvas-top,
.canvas-panel:-webkit-full-screen .canvas-top {
  display: none !important;
}
.night .scene-label {
  color: var(--ink);
}
@media (min-height: 980px) {
  .control-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }
  .brand {
    padding-top: 30px;
    padding-bottom: 30px;
  }
  .preset img {
    height: 47px;
  }
  .styles .style {
    padding: 8px;
  }
}
@media (min-width: 1700px) {
  .studio {
    grid-template-columns: 350px minmax(0, 1fr);
    padding: 28px;
    gap: 28px;
  }
  .controls {
    padding: 0 27px;
  }
  .brand {
    padding-left: 27px;
    padding-right: 27px;
  }
  .preset img {
    height: 47px;
  }
  .style {
    font-size: var(--text-caption);
  }
  .label-row {
    font-size: var(--text-body);
  }
  .panel-footer {
    font-size: var(--text-caption);
  }
}
@media (max-width: 1050px) {

  .controls {
    padding: 0 19px;
  }


}
@media (max-width: 700px) {
  .studio {
    height: 100dvh;
    min-height: 0;
    grid-template-columns: 1fr;
  }


  .controls {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 23px 72px;
    grid-template-columns: 1fr 1fr;
    gap: 0 25px;
  }
  .control-section {
    padding: 32px 0;
  }
  .control-section:nth-child(3) {
    grid-column: 1/-1;
  }
  .control-section:nth-child(4) {
    grid-column: 1/-1;
  }
  .presets {
    gap: 11px;
  }
  /* The old 60.5:43 picture, 4px shorter (cqi: the card wrap is the container). */
  .preset img {
    height: calc(100cqi * 43 / 60.5 - 4px);
  }

  .style { font-size: var(--text-caption); flex-direction: row; padding: 8px; gap: 10px; }
  .label-row {
    font-size: var(--text-body);
  }


  .scene-label {
    gap: var(--sky-status-gap);
  }

  .control-section h2 {
    font-size: var(--text-body);
    letter-spacing: var(--tracking-heading);
  }

  .time-header {
    margin-bottom: 14px;
  }
}
@media (max-width: 380px) {
  .controls {
    display: block;
  }
}
.label-row,
.label-row output,
.celestial,
.export-button {
  font-size: var(--text-body);
}
.preset span {
  font-size: var(--text-meta);
}
.text-button {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 12px;
  padding: 0 3px;
  font-size: var(--text-caption);
}
.panel-footer {
  font-size: var(--text-caption);
}
.panel-footer .text-button,
.panel-footer .text-button svg {
  color: var(--ink);
}
.panel-footer > span {
  color: var(--subtext);
}

.search-field input,
.location-result,
.export-menu label,
.export-menu select {
  font-size: var(--text-body);
}
.export-menu button {
  font-size: var(--text-body);
}
.export-menu button span {
  font-size: var(--text-caption);
}

@media (max-width: 700px) {
  .controls {
    display: block;
  }
  .styles {
    grid-template-columns: 1fr 1fr;
  }
  .preset span {
    font-size: var(--text-meta);
  }
  .scene-label #scene-detail {
    font-size: var(--text-meta);
  }
  /* Phones drop the time from the scene line; the time slider shows it. The sky details
     card heads itself with a copy of that line (.sky-details-head-detail), which keeps it. */
  .scene-detail-time {
    display: none;
  }
  .sky-details-head-detail .scene-detail-time {
    display: inline;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Both panes belong to the viewport; only properties own a scroll area. */
.control-note {
  margin: 12px 0 16px;
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  line-height: 1.45;
  letter-spacing: var(--tracking-text);
}
.control-note:empty {
  display: none;
  margin: 0;
}
.control-note + .control-note {
  margin-top: -8px;
  margin-bottom: 16px;
}
.control-note a {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.control-note a:hover {
  color: var(--ink);
}
#style-description {
  margin: 12px 0 16px;
}
#style-description:empty {
  display: none;
  margin: 0;
}
.tuning-control {
  --pull-h: 40px;
  position: relative;
  height: var(--pull-h);
  margin: 14px 0 0;
  border-radius: 32px;
  border: 0.5px solid var(--glass-border);
  box-shadow: inset 0 0.5px 0 var(--glass-rim), inset 0 -0.5px 0 var(--glass-low-rim);
  overflow: hidden;
  isolation: isolate;
}
.tuning-control:first-child { margin-top: 0; }
#haze-tuning,
#city-light-tuning { margin-bottom: var(--section-label-gap, 18px); }
/* The Phenomena label stands 24px below the haze and city light sliders, over the usual 18px
   (the slider's 18px bottom margin collapses into this one). */
#atmospheric-details > .label-row:first-child { margin-top: 26px; }
/* A separate lens keeps the native range's value geometry stable while held. */
.tuning-control::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(5px, calc(2px + (100% - 4px) * var(--held-progress, 0)), calc(100% - 5px));
  width: 4px;
  height: 22px;
  box-sizing: border-box;
  border: 0.5px solid transparent;
  border-radius: 999px;
  background: #fff;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1), height 0.18s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.14s ease;
}
.tuning-control:hover::after,
.tuning-control:has(input:focus-visible)::after {
  opacity: 1;
}
.tuning-control.slider-held::after {
  width: 8px;
  height: 30px;
  opacity: 1;
  background: var(--held-glass-fill);
  border-color: var(--held-glass-border);
  box-shadow: var(--held-glass-shadow);
  -webkit-backdrop-filter: var(--held-glass-filter);
  backdrop-filter: var(--held-glass-filter);
}
@media (prefers-reduced-motion: reduce) {
  .tuning-control::after { transition: none; }
}
.tuning-group { margin-top: 18px; }
.tuning-group:first-child { margin-top: 0; }
/* 8px above every slider heading; a phenomenon's shuffle sits at its right end, its
   negative margins keeping the heading the height of its text. */
.tuning-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  margin: 0 0 8px 4px;
  font-size: var(--text-meta);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  color: var(--muted);
}
.tuning-group .tuning-control:first-child { margin-top: 0; }
/* JS builds these sliders after first paint; --rows (index.html) reserves their height. */
[id$="-tuning"]:empty { min-height: calc(var(--rows, 0) * 52px - 8px); }
.tuning-control:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--focus); }
/* Touch: app.js drives these from the wrapper, see touchSlide. */
@media (pointer: coarse) {
  .tuning-control,
  .time-range-wrap { touch-action: pan-y; }
  .tuning-control input[type="range"],
  .time-range-wrap input.time-range { pointer-events: none; }
}
.tuning-control .label-row {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0 14px;
  font-size: var(--text-body);
  pointer-events: none;
}
/* Slider rows: the name reads in white, its value quieter beside it at the same size. */
.tuning-control .label-row,
.tuning-control .label-row label {
  color: var(--ink);
}
.tuning-control .label-row output {
  font-size: inherit;
  font-weight: var(--weight-regular);
  color: var(--muted);
  background: none;
  padding: 0;
}
/* The words in a slider's value ("Below horizon · 100%") are thin, the figure stays regular. */
.label-row output .output-info { font-weight: var(--weight-thin); }
/* The " · " between info and figure: its spaces plus 1.5px either side. */
.label-row output .output-sep { padding: 0 1.5px; }
.select-label { display: block; margin: 22px 0 8px; font-size: var(--text-body); }
.control-section select,
.control-section .text-field { width: 100%; min-height: 38px; border: 1px solid var(--line); padding: 7px 14px; font-size: var(--text-body); font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif; letter-spacing: var(--tracking-text); }
select option { font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif; background: #141b20; color: var(--ink); }
.control-section .text-field:focus-visible { outline: 2px solid var(--accent-line, #00a4b8); outline-offset: 1px; }
/* One switch per line with its label, as the eclipse cards lay theirs out. */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: var(--text-body); color: var(--secondary); }
#ascii-options .control-note { margin: 8px 0 0; }
#sky-canvas { display: block; width: 100%; height: 100%; border: none; outline: none; touch-action: none; }
@media (max-width: 700px) {

  .brand h1 {
    font-size: var(--text-title);
    letter-spacing: var(--tracking-heading);
  }

}
@media (max-height: 560px) {
  .studio { padding: 8px; gap: 8px; }
  .brand { padding-top: 10px; padding-bottom: 10px; }
  .panel-footer { padding-top: 8px; padding-bottom: 8px; }
}

/* Liquid Glass interface: a dedicated glass inspector sits beside the sky. */
:root {
  --tracking-text: 0px;
  --tracking-heading: 0.5px;
  --sky-status-gap: 4px;
  --control-grid-gap: 12px;
  --section-label-gap: 18px;
  --selection-card-rest-fill: rgba(255, 255, 255, 0.04);
  --selection-card-rest-line: rgba(255, 255, 255, 0.07);
  --switch-active-fill: linear-gradient(90deg, #00a8bb 0%, #00808f 100%);
  --text-micro: 8px;
  --text-meta: 10px;
  --text-caption: 12px;
  --text-body: 14px;
  --text-label: 16px;
  --text-heading: 18px;
  --text-title: 20px;
  --text-title-large: 22px;
  --text-display: 24px;
  --weight-thin: 100;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 650;
  font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif;
  font-size: var(--text-body);
  line-height: 1.45;
  font-synthesis: none;
  letter-spacing: var(--tracking-text);
  --app-background: #000;
  --glass-ambient-rgb: 139 194 226;
  --glass-fill: rgba(2, 7, 12, 0.46);
  --glass-border: rgba(195, 227, 246, 0.12);
  --glass-inner-line: rgba(242, 251, 255, 0.065);
  --glass-sheen: rgba(239, 250, 255, 0.028);
  --glass-rim: rgba(244, 251, 255, 0.1);
  --glass-low-rim: rgba(31, 87, 121, 0.21);
  --glass-ambient-strength: 0.09;
  --glass-reflection-strength: 0.055;
  --glass-directional-sheen: rgb(255 255 255 / 0.04);
  /* Sidebar Ambient Glare Controls: customize lighting, intensity, reach and balance */
  --sidebar-glare-opacity: 1;
  --sidebar-glare-tl-opacity: 1;
  --sidebar-glare-br-opacity: 1;
  --sidebar-glare-color: var(--glass-ambient-rgb);
  --sidebar-glare-strength: 0.09;
  --sidebar-glare-reflection-strength: 0.055;
  --sidebar-glare-size: 125% 78%;
  --sidebar-glare-reach: 58%;
  /* Glare aliases for quick developer control */
  --glare-opacity: var(--sidebar-glare-opacity);
  --glare-strength: var(--sidebar-glare-strength);
  --glare-reflection-strength: var(--sidebar-glare-reflection-strength);
  --glare-br-opacity: var(--sidebar-glare-br-opacity);
  --glare-tl-opacity: var(--sidebar-glare-tl-opacity);
  --glare-size: var(--sidebar-glare-size);
  --glare-reach: var(--sidebar-glare-reach);
  --glare-color: var(--sidebar-glare-color);
  --canvas-border: rgba(255, 255, 255, 0.025);
  --canvas-panel-shadow: none;
  --glass-filter: blur(30px) saturate(145%) contrast(1.08);
  --glass-shadow: 0 32px 80px rgba(0, 0, 0, 0.72), 0 12px 28px rgba(0, 0, 0, 0.42);
  --floating-fill: rgba(4, 6, 7, 0.7);
  --floating-border: rgba(255, 255, 255, 0.09);
  --floating-shadow: none;
  --floating-glass-fill: rgba(2, 7, 12, 0.18);
  --floating-icon-color: var(--ink);
  --floating-icon-opacity: 1;
  --menu-frost-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.144) 0%, rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.15) 100%),
    radial-gradient(120% 85% at 0% 0%, rgba(255, 255, 255, 0.168), transparent 60%),
    rgba(18, 24, 30, 0.38);
  --menu-frost-border: rgba(255, 255, 255, 0.18);
  --menu-frost-rim: rgba(255, 255, 255, 0.29);
  --menu-frost-filter: blur(40px) saturate(180%) contrast(1.05);
  --menu-control-bg: rgba(255, 255, 255, 0.13);
  --menu-control-border: rgba(255, 255, 255, 0.13);
  --menu-control-hover: rgba(255, 255, 255, 0.26);
  --menu-text-primary: var(--ink);
  --menu-text-secondary: var(--secondary);
  --menu-text-muted: var(--muted);
  --line: rgba(255, 255, 255, 0.12);
  /* Shared text hierarchy; menu and selected-card tokens alias these roles. */
  --muted: #aab4ae;
  --subtext: rgba(255, 255, 255, 0.52);
  --ink: #f4f7f5;
  --secondary: #d7ded9;
  --accent: #00ddf5;
  --accent-ink: var(--accent);
  --danger-ink: #ff6b6b;
  --light-ink: #121c22;
  --light-secondary: rgba(18, 28, 34, 0.72);
  --light-muted: rgba(18, 28, 34, 0.64);
  --light-subtext: rgba(18, 28, 34, 0.52);
  --accent-fill: rgba(0, 221, 245, 0.15);
  --accent-line: rgba(0, 221, 245, 0.35);
  /* Selected-card stroke: lit along the top edge, fading down the sides, a faint return at
     the bottom, so the card reads raised. */
  --selection-card-stroke: linear-gradient(180deg, rgba(150, 245, 255, 0.7) 0%, rgba(0, 221, 245, 0.32) 28%, rgba(0, 221, 245, 0.1) 72%, rgba(0, 221, 245, 0.24) 100%);
  --selection-card-ink: var(--ink);
  --selection-card-fill: #021317;
  --control-fill: rgba(255, 255, 255, 0.055);
  --control-hover: rgba(255, 255, 255, 0.1);
  --control-strong: rgba(255, 255, 255, 0.12);
  --track-fill: #00c4dc;
  --pull-track: rgba(255, 255, 255, 0.06);
  --pull-fill: rgba(255, 255, 255, 0.11);
  --pull-thumb-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  --focus: var(--accent);
  --scroll-thumb: rgba(255, 255, 255, 0.12);
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--app-background);
}

.studio {
  margin: auto;
  --studio-gap: 12px;
  position: relative;
  display: grid;
  grid-template-columns: 348px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--studio-gap);
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  padding: 12px;
  background: var(--app-background);
}

.canvas-panel {
  /* One quick ease-out carries every button and the toast between dark and frosted glass. */
  transition:
    --floating-glass-fill 200ms ease-out,
    --glass-border 200ms ease-out,
    --glass-inner-line 200ms ease-out,
    --glass-sheen 200ms ease-out,
    --glass-rim 200ms ease-out,
    --glass-low-rim 200ms ease-out,
    --floating-icon-color 200ms ease-out,
    --control-hover 200ms ease-out,
    --control-strong 200ms ease-out,
    --glass-ambient-strength 200ms ease-out,
    --glass-ambient-rgb 200ms ease-out;
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
  position: relative;
  inset: auto;
  min-height: 0;
  border: 0.5px solid var(--canvas-border);
  outline: none;
  border-radius: 30px;
  background: transparent;
  box-shadow: var(--canvas-panel-shadow, none);
}


.desktop-navigation {
  position: relative;
  z-index: 3;
  color: var(--ink);
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 29%),
    linear-gradient(322deg, var(--glass-sheen), transparent 29%),
    var(--glass-fill);
  border: none;
  outline: none;
  box-shadow: none;
  isolation: isolate;
  transform: translateZ(0);
  display: none;
}

.properties::before,
.mobile-nav-scrim::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(112deg, var(--glass-directional-sheen), transparent 23%, transparent 72%, rgb(var(--glare-color) / calc(var(--glare-reflection-strength) * var(--glare-opacity)))),
    radial-gradient(92% 54% at 7% 0%, rgb(var(--glare-color) / calc(var(--glare-reflection-strength) * var(--glare-opacity) * var(--glare-tl-opacity))), transparent 65%),
    radial-gradient(92% 54% at 93% 100%, rgb(var(--glare-color) / calc(var(--glare-reflection-strength) * var(--glare-opacity) * var(--glare-br-opacity))), transparent 65%);
  box-shadow: inset 0 -0.5px 0 var(--glass-low-rim);
  opacity: var(--glare-opacity);
}

.properties::after,
.mobile-nav-scrim::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(var(--glare-size) at 100% 100%, rgb(var(--glare-color) / calc(var(--glare-strength) * var(--glare-opacity) * var(--glare-br-opacity))), transparent var(--glare-reach)),
    radial-gradient(92% 54% at 93% 100%, rgb(var(--glare-color) / calc(var(--glare-reflection-strength) * var(--glare-opacity) * var(--glare-br-opacity))), transparent 65%);
  opacity: calc(var(--glare-opacity) * var(--glare-br-opacity));
}

.properties > * {
  position: relative;
  z-index: 2;
}

.properties > .controls {
  position: static;
  contain: none;
  will-change: auto;
}

.brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 28px 20px;
}

.brand h1 {
  white-space: nowrap;
  margin: 0;
  color: var(--ink);
  font-size: var(--text-title-large);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
}

.preset.active span {
  color: var(--accent-ink);
}

/* Apple Liquid Glass Navigation & Anchor Chips */
.sky-nav-container {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  padding: 2px 20px 14px;
}

.sky-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  gap: 2px;
  margin-bottom: 20px;
}

.sky-tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-text);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.sky-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.sky-tab.active {
  color: var(--ink);
  font-weight: var(--weight-semibold);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.13) 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.35);
}

/* Horizontal scrolling anchor chips */
.anchor-bar {
  position: relative;
  width: 100%;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.anchor-bar[hidden] {
  display: none !important;
}

.anchor-track {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 2px outline + 2px offset must fit inside the scroll clipping boundary. */
  padding: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.3), black 12px, black calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.3), black 12px, black calc(100% - 12px), transparent);
}

/* Keyboard focus must remain fully opaque, including chips at either edge. */
.anchor-track:has(.anchor-chip:focus-visible) {
  mask-image: none;
  -webkit-mask-image: none;
}

.anchor-track::-webkit-scrollbar {
  display: none;
}

.anchor-chip {
  flex-shrink: 0;
  white-space: nowrap;
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-text);
  line-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  background:
    linear-gradient(138deg, rgba(255, 255, 255, 0.075), transparent 52%, rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
  border: 0.5px solid transparent;
  color: var(--muted);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.16),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.2),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(14px) saturate(175%);
  backdrop-filter: blur(14px) saturate(175%);
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.anchor-chip:hover {
  background:
    linear-gradient(138deg, rgba(255, 255, 255, 0.11), transparent 52%, rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.07);
  border-color: transparent;
  color: var(--ink);
  transform: translateY(-0.5px);
}

.anchor-chip.active,
.anchor-chip.active:hover {
  color: var(--ink);
  background:
    linear-gradient(138deg, rgba(255, 255, 255, 0.075), transparent 52%, rgba(255, 255, 255, 0.025)),
    var(--accent-fill);
  border-width: 0.25px;
  border-color: var(--accent-line);
  font-weight: var(--weight-regular);
  box-shadow:
    0 3px 12px rgba(0, 0, 0, 0.18),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.24),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.045);
}

/* Panel views inside controls */
.panel-view[hidden] {
  display: none !important;
}

.tab-styles-active #location-menu {
  display: none;
}

.tab-asmr-active .sky-nav-container,
.tab-asmr-active > .brand,
.tab-asmr-active .panel-footer {
  display: none;
}

#view-asmr > .control-section:first-child {
  padding-top: 20px;
}

#section-asmr h2 {
  margin-bottom: 20px;
}

.asmr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 14px;
}

.asmr-theme {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 3.5;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 12px;
  background: transparent;
  isolation: isolate;
  cursor: pointer;
}

@media (hover: hover) {
  #asmr-grid .asmr-theme:hover {
    outline: 1px solid rgba(255, 255, 255, 0.38);
    outline-offset: 2px;
  }
}

#asmr-grid .asmr-theme[aria-pressed="true"] {
  outline: none;
}

.asmr-theme[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -3.5px;
  border: 1.5px solid var(--track-fill);
  border-radius: 16px;
  pointer-events: none;
}

.asmr-theme img {
  display: block;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.asmr-selected-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 48%, rgba(255, 255, 255, 0.08)) padding-box,
    var(--switch-active-fill) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.42) 70%, rgba(255, 255, 255, 0.16)) border-box;
  color: #000;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.25),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.4),
    inset 0 -0.5px 0 rgba(0, 45, 55, 0.25);
  -webkit-backdrop-filter: blur(3px) saturate(1.3);
  backdrop-filter: blur(3px) saturate(1.3);
  pointer-events: none;
}

.asmr-theme[aria-pressed="true"] .asmr-selected-mark {
  display: grid;
}

.asmr-selected-mark svg {
  width: 11px;
  height: 11px;
  stroke-width: 3.5px;
}

.canvas-panel.asmr-active .export-wrap {
  visibility: hidden;
  pointer-events: none;
}

.canvas-panel.asmr-active .layers-wrap,
.canvas-panel.asmr-active .mobile-canvas-menu-wrap,
.canvas-panel.asmr-active #undo,
.canvas-panel.asmr-active #redo {
  display: none;
}

.controls {
  /* Match the horizontal edge used by the desktop navigation tabs. */
  --controls-pad: 20px;
  /* JS measures the browser scrollbar lane, including overlay scrollbars. */
  --scrollbar-lane: 11px;
  padding-block: 0 72px;
  padding-inline-start: var(--controls-pad);
  padding-inline-end: calc(var(--controls-pad) - var(--scrollbar-lane));
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.controls.is-scrolling {
  scrollbar-color: var(--scroll-thumb) transparent;
}

/* Fallback for engines without the standard thin scrollbar mode. */
@supports selector(::-webkit-scrollbar) {
  .controls::-webkit-scrollbar {
    width: 8px;
  }

  .controls::-webkit-scrollbar-track {
    background: transparent;
    margin-block: 4px;
  }

  .controls::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
  }

  .controls.is-scrolling::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
  }

  .controls.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
  }
}

.control-section,
.panel-footer,
.location-result {
  border-color: var(--line);
}

/* Section dividers sit quieter than card borders and list lines. */
.control-section,
.panel-footer {
  border-color: var(--section-divider-color);
}

h2 { font-size: var(--text-body); font-weight: var(--weight-semibold); line-height: 1.2; letter-spacing: var(--tracking-heading); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.label-row,
.select-label {
  color: var(--secondary);
}
.range-labels,
.time-caption,
.preset span,
.celestial {
  color: var(--muted);
}
.control-note,
.panel-footer {
  color: var(--subtext);
}

.label-row output {
  color: var(--secondary);
  background: var(--control-fill);
  border-radius: 7px;
}

button:hover { background-color: var(--control-hover); }
button.active { background: var(--accent-fill); }
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
input:not([type="range"]):focus,
select:focus,
input:not([type="range"]):focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent);
}
canvas:focus,
canvas:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Time of day: a full-width native range whose thumb is an invisible globe-sized
   square; the globe canvas rides its centre. A native thumb's centre travels from
   half a thumb in from each edge, so the painted track spans exactly that range. */
#section-time {
  padding-top: 26px;
  --globe-size: 38px;
}

.time-range-wrap {
  --hour-fraction: 0.58333;
  position: relative;
  height: 42px;
  margin-top: 6px;
}

.time-range-wrap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--globe-size) / 2);
  right: calc(var(--globe-size) / 2);
  height: 9px;
  border-radius: 6px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #182947, #675f7d, #d99e80, #9ac4da, #6fb9e5, #dfb675, #9c697d, #172744);
}

.time-range-wrap input.time-range {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
}

.time-range-wrap input.time-range::-webkit-slider-thumb {
  width: var(--globe-size);
  height: var(--globe-size);
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.time-range-wrap input.time-range::-moz-range-thumb {
  width: var(--globe-size);
  height: var(--globe-size);
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.earth-globe {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: calc(var(--globe-size) / 2 + (100% - var(--globe-size)) * var(--hour-fraction));
  display: block;
  width: var(--globe-size);
  height: var(--globe-size);
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  transform: translate(-50%, -50%);
}

input[type="range"]:focus,
input[type="range"]:focus-visible {
  outline: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.time-range:focus-visible + .earth-globe {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (forced-colors: active) {
  :focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: 2px;
  }
}


.celestial,
.style,
.search-field,
.control-section select {
  color: var(--secondary);
  background: var(--control-fill);
  border-color: var(--line);
  border-radius: 12px;
}

.celestial,
.style {
  min-height: 44px;
}

.celestial:not(.active),
.weather-item:not(.active):not(.triggered),
.atmos-item:not(.active):not(.triggered) {
  color: var(--muted);
}

.celestial.active {
  color: var(--selection-card-ink);
  border-width: 0.5px;
  border-color: var(--accent-line);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}
.style.active {
  color: var(--accent-ink);
  background: var(--accent-fill);
  border-color: var(--accent-line);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}

.atmos-item:not(.active):not(.triggered),
#section-style .style:not(.active) {
  color: var(--muted);
  background: var(--selection-card-rest-fill);
  border-color: var(--selection-card-rest-line);
}

.atmos-item.active,
.atmos-item.triggered,
#section-style .style.active {
  border-width: 0.5px;
  background: var(--selection-card-fill);
  border-color: var(--accent-line);
  color: var(--selection-card-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
/* Picked Weather, Sun/Moon/Stars and Phenomena cards label in teal; Style cards keep white. */
.celestial.active,
.atmos-item.active,
.atmos-item.triggered {
  color: var(--accent-ink);
}

.celestial .celestial-orb {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
}
.celestial[data-celestial="showSun"] .celestial-orb {
  width: 29px;
  height: 29px;
}
.celestial:not(.active) .celestial-orb {
  opacity: 0.58;
  filter: saturate(0.72) brightness(0.88);
}

.celestial.active {
  background: var(--selection-card-fill);
}

.preset.active img,
.aurora-preset.active img {
  box-shadow: none;
  outline: 1.5px solid var(--track-fill);
  outline-offset: 2.5px;
  filter: brightness(0.8);
}

.preset img {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  outline: none;
}

.search-field input,
.control-section select,
.control-section .text-field {
  color: var(--ink);
}
.control-section .text-field {
  background: var(--control-fill);
  border-color: var(--line);
  border-radius: 12px;
}
/* Drawn chevron, inset to match the row padding, in place of the OS one that hugs the edge. */
.control-section select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab4ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  padding-right: 40px;
  cursor: pointer;
}

.search-field input::placeholder { color: var(--muted); opacity: 0.82; }

.panel-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  width: 100%;
  margin: 0;
  padding: 24px 24px 16px;
  border-top: none;
  box-sizing: border-box;
  background: linear-gradient(
    to top,
    #04070a 70%,
    rgba(4, 7, 10, 0.85) 45%,
    transparent
  );
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}


.export-button,
.canvas-toolbar,
.fullscreen-button,
.sound-toggle-button,
.snapshot-shutter,
.record-hud-panel,
.snapshot-thumb,
#toast,
#earphone-hint,
#canvas-error {
  position: relative;
  color: var(--ink);
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 32%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / var(--glass-ambient-strength)), transparent 58%),
    var(--floating-glass-fill, var(--glass-fill));
  border: 0.5px solid var(--glass-border);
  box-shadow:
    inset 0 0.5px 0 var(--glass-rim),
    inset 0 0 0 0.5px var(--glass-inner-line),
    inset 0 -0.5px 0 var(--glass-low-rim);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  isolation: isolate;
  /* The light/dark glass switch follows the sky: glass and ink change together, quickly. */
  transition:
    background 200ms ease-out,
    box-shadow 200ms ease-out,
    color 200ms ease-out,
    border-color 200ms ease-out;
}

.export-button {
  gap: 9px;
  font-weight: var(--weight-medium);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 200ms ease-out, box-shadow 200ms ease-out, transform 150ms ease;
}

.export-label { display: none; }

.export-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.export-button:hover {
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 26%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / calc(var(--glass-ambient-strength) * 1.5)), transparent 55%),
    var(--control-strong);
}

.export-button:active {
  transform: scale(0.97);
}

.export-menu {
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  margin: 0;
  max-width: none;
  width: 272px;
  padding: 18px;
  border-radius: 22px;
  color: var(--menu-text-primary);
  background: var(--menu-frost-bg);
  border: 0.5px solid var(--menu-frost-border);
  box-shadow:
    inset 0 0.75px 0.5px var(--menu-frost-rim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.09),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: var(--menu-frost-filter);
  backdrop-filter: var(--menu-frost-filter);
  isolation: isolate;
}

.export-menu p,
.export-menu .menu-heading {
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  color: var(--menu-text-muted);
  margin: 0 0 16px;
}

/* The heading reads as the sub-panel titles (Embed sky, Export video) do: muted all but
   vanished on the frosted daylight menu. */
.export-menu .menu-heading {
  display: flex;
  color: var(--menu-text-secondary);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.export-menu .menu-heading .key-hint {
  flex: 0 0 auto;
}

.key-hint {
  font-family: inherit;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-text);
  text-transform: none;
  color: var(--subtext);
  border: 0;
  background: none;
  padding: 0;
  min-width: 1.2em;
  text-align: right;
  pointer-events: none;
}

.export-menu label,
.export-menu .export-field-label {
  display: block;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--secondary);
  margin-bottom: 7px;
}

/* Option buttons (video length, aspect ratio): three in a row, the detail under the name.
   The ID outranks the generic `.export-menu button:not(…)` layout. */
:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

:is(#export-aspect, #record-aspect, #embed-mode) {
  margin-bottom: 14px;
}

/* Export sky: as far above Attach sky status as the preview sits above PNG. */
#export-aspect, #embed-mode {
  margin-bottom: 30px;
}

:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-option {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  width: auto;
  margin: 0;
  padding: 8px 4px;
}

:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-option .export-format {
  font-size: var(--text-caption);
}

:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-detail {
  margin: 0;
  font-size: var(--text-meta);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  color: var(--menu-text-secondary);
}

/* Embed sky: Live and This sky, two in a row. */
#embed-mode {
  grid-template-columns: repeat(2, 1fr);
}

/* The iframe code: read-only, selectable, in the menu's control glass. app.js sizes it to
   the code, so no scrollbar shows; a long "This sky" code stops at max-height and still
   scrolls by wheel or touch. */
.export-menu .embed-code {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  resize: none;
  font: var(--weight-regular) var(--text-meta) / 1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
  color: var(--menu-text-primary);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  word-break: break-all;
  max-height: 168px;
  overflow-y: auto;
  scrollbar-width: none;
}

.export-menu .embed-code::-webkit-scrollbar {
  display: none;
}

/* 10px, the scale's smallest step, with 24px of room under the code at every width. */
.export-menu #embed-summary {
  margin-top: 24px;
  font-size: var(--text-meta);
}

.export-menu .embed-code:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent);
}

/* ?embed: the sky and, unless status=0, its status line; nothing else. The tooltip and the
   earphone hint live on <body>, outside the studio, so they are named here too. */
html.embed :is(#glass-tooltip, #earphone-hint, .earphone-hint-modal),
html.embed .studio > :not(.canvas-panel),
html.embed .canvas-panel > :not(#sky-canvas, .canvas-top, .embed-brand, .canvas-bottom),
html.embed:not(.embed-fullscreen) .canvas-bottom,
html.embed .canvas-bottom > :not(#fullscreen),
html.embed .canvas-top > :not(.scene-label),
html.embed .sky-preparing,
html.embed-no-status .canvas-top {
  display: none !important;
}
/* An embed is often far smaller than the studio's canvas, so its corner furniture scales with
   the frame's shorter side (vmin is the iframe's own viewport). At the standard 800 x 450 the
   status keeps the studio's 14/10px; it steps down to 10/8px in a phone-width frame. The
   status and the logomark sit the same distance in from their corners. */
html.embed {
  --embed-inset: clamp(12px, calc(3vmin + 4px), 20px);
}
html.embed .canvas-top {
  top: var(--embed-inset);
  left: var(--embed-inset);
  right: var(--embed-inset);
}
html.embed .scene-title {
  font-size: clamp(var(--text-meta), 3.12vmin, var(--text-body));
}
html.embed .scene-label #scene-detail {
  font-size: clamp(var(--text-micro), 2.23vmin, var(--text-meta));
}
html.embed .canvas-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
}
/* A shared Link (the embed opened as its own page): the studio's full-screen button, top right
   in the status's inset, across from the status; it fades when idle like full screen's. */
html.embed-fullscreen .canvas-bottom {
  top: var(--embed-inset);
  right: var(--embed-inset);
  bottom: auto;
  left: auto;
  display: block;
  height: auto;
}

/* Embed attribution: the logomark in the bottom-right corner, opening the studio in a new tab.
   Embeds only. It scales with the iframe's shorter side (vmin is the frame's own viewport):
   36px tall in the standard 800 x 450 embed, down to 20px in a phone-width one, in its own
   3:4, with a margin of 3vmin + 4px (12-20px) and a corner a quarter of its height. */
.embed-brand {
  display: none;
}
html.embed .embed-brand {
  --embed-mark: clamp(20px, 8vmin, 36px);
  position: absolute;
  right: var(--embed-inset);
  bottom: var(--embed-inset);
  z-index: 2;
  display: block;
  width: calc(var(--embed-mark) * 0.75);
  height: var(--embed-mark);
  border-radius: calc(var(--embed-mark) * 0.25);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3));
  transition: transform 150ms ease;
}
html.embed .embed-brand img {
  display: block;
  width: 100%;
  height: 100%;
}
html.embed .embed-brand:hover {
  transform: scale(1.06);
}
html.embed .embed-brand:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Twice the summary's usual 12px from the buttons above it. */
#video-export-options .export-video-summary {
  margin-top: 24px;
}

/* Picked: the active switch's teal (--switch-active-fill's #00a8bb → #00808f) at half
   strength, so the menu's glass shows through; glass rims only, no drop shadow. */
:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-option[aria-pressed="true"],
:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-option[aria-pressed="true"]:hover {
  color: #fff;
  background:
    linear-gradient(138deg, rgba(255, 255, 255, 0.12), transparent 52%),
    linear-gradient(90deg, rgba(0, 168, 187, 0.5) 0%, rgba(0, 128, 143, 0.5) 100%);
  border-color: rgba(0, 221, 245, 0.45);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.4),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.08);
}

:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-option[aria-pressed="true"] :is(.export-format, .length-detail) {
  color: #fff;
}

/* The picked rule above sets box-shadow, so the focus ring is restated after it. */
:is(#video-duration, #export-aspect, #record-aspect, #embed-mode) .length-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 40%, transparent);
}

.export-menu select {
  width: 100%;
  padding: 10px 12px;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif;
  color: var(--menu-text-primary);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  margin-bottom: 14px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 32px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.export-menu select:hover {
  background-color: var(--menu-control-hover);
  border-color: rgba(255, 255, 255, 0.48);
}

.export-menu .export-status-switch {
  margin: 12px 0 0;
  color: var(--menu-text-primary, var(--secondary));
}

.export-menu .export-status-preview {
  display: flex;
  flex-direction: column;
  gap: var(--sky-status-gap);
  margin: 6px 0 30px;
  color: var(--ink);
  text-shadow: 0 1px 5px rgba(33, 68, 96, 0.245);
  transition: opacity 150ms ease;
}

.export-menu .export-status-preview.is-dimmed {
  opacity: 0.3;
}

.export-menu .export-status-title {
  font-weight: var(--weight-medium);
  font-size: var(--text-body);
  letter-spacing: var(--tracking-heading);
}

.export-menu .export-status-flag {
  margin-right: 0.4em;
  font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif;
  font-weight: var(--weight-regular);
}

.export-menu .export-status-detail {
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.8;
}

.export-menu .export-status-preview + button[data-export] {
  margin-top: 0;
}

/* Embed sky's Copy link: in the preview's 30px slot, then the code's own 24px to "Embed code". */
.export-menu .export-video-action#embed-link {
  margin: 0 0 24px;
}

/* PNG and JPG share one row: name and download icon only, the rows' 10px gap between. */
.export-menu .export-image-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

#export-image-row button[data-export] {
  margin-top: 0;
}

/* Export sky's format rows sit 10px apart (the Layers and phone menus keep 7px). */
#export-options > button {
  margin-top: 10px;
}

.export-menu .export-status-switch .toggle-switch {
  flex: 0 0 auto;
  margin: 0;
  display: block;
}

.export-menu select:focus,
.export-menu select:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent);
}

.export-menu button:not(.toggle-switch):not(.export-back):not(.layers-header-action):not(.layer-action):not(.layer-text-delete):not(.layer-preset-icon-action) {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--menu-text-primary);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

.export-menu button:not(.toggle-switch):not(.export-back):not(.layers-header-action):not(.canvas-menu-action):not(.layer-action):not(.layer-text-delete):not(.layer-preset-icon-action) {
  width: 100%;
  justify-content: space-between;
  margin-top: 7px;
}

.export-menu button:not(.toggle-switch):not(.export-back):not(.layers-header-action):not(.layer-action):not(.layer-text-delete):not(.layer-preset-icon-action):hover {
  background: var(--menu-control-hover);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.export-menu button:not(.toggle-switch):not(.export-back):not(.layers-header-action):not(.layer-action):not(.layer-text-delete):not(.layer-preset-icon-action):active {
  transform: scale(0.98);
  background: color-mix(in srgb, var(--menu-control-hover) 85%, #fff);
}

.export-menu button:not(.toggle-switch):not(.export-back):not(.layers-header-action):not(.layer-action):not(.layer-text-delete):not(.layer-preset-icon-action):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 40%, transparent);
}

.export-menu .export-format {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-text);
  color: var(--menu-text-primary);
}

.export-menu .export-desc,
.export-menu button:not(.toggle-switch):not(.layer-text-delete) span:not(.export-format) {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--menu-text-secondary);
  margin-left: auto;
  margin-right: 6px;
}

.export-menu .export-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2;
  color: var(--menu-text-secondary);
  opacity: 0.9;
  transition: transform 150ms ease, color 150ms ease, opacity 150ms ease;
}

.export-menu button:hover .export-icon {
  color: var(--menu-text-primary);
  transform: translateY(1px);
  opacity: 1;
}

.export-menu .export-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  justify-content: flex-start;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  /* Secondary, not muted, at rest: the way back reads on a bright sky too. */
  color: var(--menu-text-secondary);
  cursor: pointer;
}

.export-menu .export-back:hover {
  color: var(--menu-text-primary);
}

.export-menu .export-back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 2.1;
}

.export-video-summary {
  display: block;
  margin-top: 12px;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  line-height: 1.45;
  color: var(--menu-text-secondary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.export-menu .export-video-action,
.export-menu .export-cancel {
  margin-top: 14px;
}

/* Progress: the label with the percentage in its right corner, the bar under them and
   24px of room before the button below. Shared by the video export and the recording. */
.export-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.export-progress-row label {
  margin: 0;
}

.export-progress-row output {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--menu-text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#video-export-progress .export-cancel {
  margin-top: 24px;
}

#video-export-meter {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--menu-control-bg);
  accent-color: var(--accent-fill);
}

#video-export-meter::-webkit-progress-bar {
  background: var(--menu-control-bg);
}

#video-export-meter::-webkit-progress-value {
  background: var(--accent-fill);
}

#video-export-meter::-moz-progress-bar {
  background: var(--accent-fill);
}

.export-error {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, #ff8b7c 45%, transparent);
  border-radius: 10px;
  color: var(--menu-text-primary);
  background: color-mix(in srgb, #ff8b7c 13%, var(--menu-control-bg));
  font-size: var(--text-caption);
  line-height: 1.4;
}

.canvas-toolbar {
  grid-column: 2;
  justify-self: center;
  transform: none;
  display: flex;
  align-items: center;
  pointer-events: auto;
  gap: 4px;
  height: 44px;
  padding: 2px 5px;
  border-radius: 999px;
  transition: padding-inline 200ms ease-in-out, opacity 300ms ease;
}

.canvas-toolbar:has(.tool:is(:hover, .active)) {
  padding-inline: 2.5px;
}

.tool {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  opacity: var(--floating-icon-opacity, 1);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 200ms ease-out,
    transform 120ms ease,
    box-shadow 200ms ease-out,
    border-color 200ms ease-out;
}

.tool svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
  opacity: var(--floating-icon-opacity, 1);
}

.tool:hover {
  background: var(--control-hover);
  color: var(--ink);
}

.tool:active {
  transform: scale(0.92);
}

@keyframes dice-roll {
  0% {
    transform: rotate(0deg) scale(1);
  }
  35% {
    transform: rotate(180deg) scale(1.18);
  }
  70% {
    transform: rotate(330deg) scale(0.95);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.tool.rolling svg {
  animation: dice-roll 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool.active {
  color: var(--ink);
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 26%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / calc(var(--glass-ambient-strength) * 1.35)), transparent 55%),
    var(--control-strong);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 0.5px 0 var(--glass-rim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.22),
    inset 0 -0.5px 0 var(--glass-low-rim);
}

.tool:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--focus) 45%, transparent);
}

.fullscreen-button,
.sound-toggle-button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--ink);
  cursor: pointer;
  transition: background 200ms ease-out, box-shadow 200ms ease-out, transform 150ms ease, border-color 200ms ease-out;
}

.canvas-bottom > #fullscreen {
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

.fullscreen-button svg,
.sound-toggle-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.1;
}

.fullscreen-button:hover,
.sound-toggle-button:hover,
.snapshot-shutter:hover {
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 26%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / calc(var(--glass-ambient-strength) * 1.5)), transparent 55%),
    var(--control-strong);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.fullscreen-button:active,
.sound-toggle-button:active {
  transform: scale(0.92);
}

.fullscreen-button:focus-visible,
.sound-toggle-button:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent);
}

.sound-toggle-button.active {
  color: var(--ink);
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 32%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / var(--glass-ambient-strength)), transparent 58%),
    var(--floating-glass-fill, var(--glass-fill));
  border: 0.5px solid var(--glass-border);
  box-shadow:
    inset 0 0.5px 0 var(--glass-rim),
    inset 0 0 0 0.5px var(--glass-inner-line),
    inset 0 -0.5px 0 var(--glass-low-rim);
}

.canvas-panel.canvas-ui-light {
  --floating-glass-fill: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(14, 22, 28, 0.11);
  --glass-inner-line: rgba(255, 255, 255, 0.34);
  --glass-sheen: rgba(255, 255, 255, 0.22);
  --glass-rim: rgba(255, 255, 255, 0.72);
  --glass-low-rim: rgba(14, 22, 28, 0.08);
  --glass-ambient-strength: 0.045;
  --glass-ambient-rgb: 180 200 210;
  --glass-filter: blur(24px) saturate(130%) contrast(1.03);
  --floating-icon-color: rgba(18, 28, 34, 0.82);
  --control-hover: rgba(14, 22, 28, 0.06);
  --control-strong: rgba(255, 255, 255, 0.72);
}

.canvas-panel.canvas-ui-light :is(.export-button, .canvas-toolbar, .fullscreen-button, .sound-toggle-button, .snapshot-shutter, .record-hud-panel, #toast, #earphone-hint) {
  box-shadow:
    0 4px 14px rgba(12, 20, 28, 0.07),
    inset 0 0.5px 0 var(--glass-rim),
    inset 0 0 0 0.5px var(--glass-inner-line),
    inset 0 -0.5px 0 var(--glass-low-rim);
}

.canvas-panel.canvas-ui-light #toast {
  color: var(--light-ink);
}

.canvas-panel.canvas-ui-light .record-hud {
  --ink: var(--light-ink);
  --secondary: var(--light-secondary);
  --muted: var(--light-muted);
  --subtext: var(--light-subtext);
  --menu-text-primary: var(--ink);
  --menu-text-secondary: var(--secondary);
  --menu-text-muted: var(--muted);
  --menu-control-bg: rgba(255, 255, 255, 0.28);
  --menu-control-border: rgba(14, 22, 28, 0.14);
}

/* Icons always read the animated token (it is --ink on dark glass), so they ease with the glass. */
.canvas-panel :is(.fullscreen-button, .sound-toggle-button, .export-button, .tool, .snapshot-shutter) {
  color: var(--floating-icon-color);
}

.canvas-panel.canvas-ui-light .snapshot-shutter-icon {
  filter: brightness(0) saturate(100%);
  opacity: 0.82;
}

.canvas-panel.canvas-ui-light .snapshot-shutter-icon,
.snapshot-shutter-icon {
  transition: filter 200ms ease-out, opacity 200ms ease-out;
}

.canvas-panel.canvas-ui-light .tool.active,

.canvas-panel.canvas-ui-light :is(.fullscreen-button:hover, .sound-toggle-button:hover, .tool:hover, .export-button:hover, .snapshot-shutter:hover) {
  box-shadow:
    0 6px 18px rgba(12, 20, 28, 0.09),
    inset 0 0.5px 0 var(--glass-rim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.48),
    inset 0 -0.5px 0 var(--glass-low-rim);
}

#toast {
  position: absolute;
  top: 25px;
  left: 50%;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-text);
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 9999px;
  pointer-events: none;
  max-width: calc(100% - 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: toast-fade-in 0.42s ease-out;
}

#toast .sky-at {
  opacity: 0.7;
  margin-right: 0.35em;
}
#toast .toast-flag {
  margin-left: 0.45em;
}

#toast svg,
#toast .toast-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  flex-shrink: 0;
}
#toast .toast-icon-trailing {
  margin-right: 0;
  margin-left: 8px;
}
#toast .toast-icon-success {
  stroke: #34d399;
  color: #34d399;
}

/* Liquid-glass entrance: the pill stretches past its width and settles, like a rubber band. */
@keyframes toast-fade-in {
  0% { opacity: 0; transform: translate(-50%, -6px) scale(0.7, 0.9); }
  35% { opacity: 1; transform: translate(-50%, 0) scale(1.06, 0.95); }
  60% { transform: translate(-50%, 0) scale(0.98, 1.02); }
  80% { transform: translate(-50%, 0) scale(1.01, 0.995); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes toast-fade-in-bottom {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.7, 0.9); }
  35% { opacity: 1; transform: translate(-50%, 0) scale(1.06, 0.95); }
  60% { transform: translate(-50%, 0) scale(0.98, 1.02); }
  80% { transform: translate(-50%, 0) scale(1.01, 0.995); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

#canvas-error {
  top: 40%;
  left: 10%;
  right: 10%;
  line-height: 1.6;
  font-size: var(--text-body);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px 22px;
}

@media (max-width: 1050px) {
  .studio {
    grid-template-columns: 310px minmax(0, 1fr);
    --studio-gap: 8px;
    gap: var(--studio-gap);
    padding: 8px;
  }
  .canvas-panel { inset: auto; }
  .properties {
    inset: auto;
    width: auto;
  }
  .brand { padding: 28px 17px; }
  .brand h1 {
    font-size: var(--text-title);
    letter-spacing: var(--tracking-heading);
  }
  .controls {
    --controls-pad: 16px;
  }
  .panel-footer {
    padding-inline: 18px;
  }
  .canvas-top,
  .canvas-bottom { left: 22px; }
  .canvas-top { right: 22px; }
  .canvas-bottom { justify-content: flex-end; right: 22px; }
}

@media (max-width: 700px) {
  .studio {
    display: flex;
    flex-direction: column;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  .canvas-panel {
    position: relative;
    order: -1;
    inset: auto;
    width: auto;
    height: 44%;
    min-height: 0;
    border-radius: 25px;
    flex-shrink: 0;
  }
  /* The chips sit beside the logo here: the row's bottom padding is the gap under them. */
  .brand { padding: 20px 16px 18px; }
  .brand-logo { height: 24px; }
  .properties > .mobile-nav-scrim {
    display: block;
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    /* Reach the nav's top; fade the glass and reflections across the upper half. */
    height: 49px;
    z-index: 49;
    pointer-events: none;
    background: inherit;
    border-radius: 0 0 24px 24px;
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    -webkit-mask-image: linear-gradient(to top, #000 50%, transparent 100%);
    mask-image: linear-gradient(to top, #000 50%, transparent 100%);
  }
  .sky-nav-container {
    position: absolute;
    top: 14px;
    right: 16px;
    left: calc(16px + 51.43px + 17.45px);
    padding: 0;
  }
  .sky-tab {
    height: 32px;
    padding: 0 6px;
    font-size: var(--text-body);
  }
  .sky-tabs {
    position: absolute;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    margin: 0;
    transform: none;
    z-index: 50;
    isolation: isolate;
    background:
      linear-gradient(138deg, rgba(255, 255, 255, 0.1), transparent 42%, rgba(255, 255, 255, 0.045)),
      rgba(16, 19, 23, 0.64);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      0 12px 32px rgba(0, 0, 0, 0.44),
      inset 0 0.5px 0 rgba(255, 255, 255, 0.1),
      inset 0 -0.5px 0 rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(24px) saturate(185%);
    backdrop-filter: blur(24px) saturate(185%);
  }
  .sky-tabs::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(112deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 76%, rgba(255, 255, 255, 0.025));
  }
  .sky-tab:hover {
    background: rgba(255, 255, 255, 0.09);
  }
  .sky-tab.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .sky-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  .controls {
    --controls-pad: 16px;
    /* Overlay-scrollbar fallback; JS replaces this with the measured lane. */
    --scrollbar-lane: 0px;
  }
  #section-time { padding-top: 18px; }
  #section-style { padding-top: 20px; }
  .properties { overflow: hidden; position: relative; inset: auto; width: min(100%, 400px); max-width: 400px; align-self: center; min-height: 0; border-radius: 25px; flex: 1; --section-space: 30px; }
  .control-section,
  .panel-footer { padding-block: var(--section-space); }
  #aurora-section:has(+ .panel-footer:not([hidden])) {
    padding-bottom: var(--section-space);
  }
  .canvas-top { top: 18px; left: 18px; right: 18px; }
  .canvas-bottom {
    right: 18px;
    bottom: 16px;
    left: 18px;
  }
  /* Opened modally on phones: top layer, centred, scrim from ::backdrop. */
  .export-menu {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(300px, 100vw - 40px);
    height: fit-content;
    max-height: calc(100dvh - 80px);
  }
  .export-menu .menu-heading .key-hint { display: none; }
  .export-menu::backdrop { background: rgb(0 0 0 / 0.55); }
  /* The place search opens as a sheet at the top of the screen, out of the controls panel,
     over the same scrim; its list runs down to the keyboard (sizeLocationSheet in app.js). */
  .location-sheet {
    position: fixed;
    inset: calc(env(safe-area-inset-top, 0px) + 12px) 12px auto;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    overflow: visible;
    /* It sits in the canvas chrome, which passes taps through; the sheet takes them. */
    pointer-events: auto;
  }
  .location-sheet::backdrop { background: rgb(0 0 0 / 0.55); }
  .location-sheet .location-popover { position: static; }
  .panel-footer {
    position: static;
    margin-top: 0;
    padding-inline: 0;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: var(--section-divider-color);
    background: transparent;
    font-size: var(--text-caption);
    color: var(--ink);
  }
  .panel-footer .text-button,
  .panel-footer .text-button svg {
    color: var(--ink);
  }
  .panel-footer > span {
    color: var(--subtext);
  }
  /* Leave a clear landing area above the floating tabs for Reset and last items. */
  .controls {
    padding-bottom: 72px;
    scroll-padding-bottom: 72px;
  }
  .export-button { width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .export-label { display: none; }
  .anchor-bar { max-height: 48px; }
  .anchor-chip {
    /* Android Chrome can expose scroll-layer seams through backdrop filters
       inside the masked chip track. Keep the glass paint independent of scroll. */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #toast {
    top: auto;
    bottom: 80px;
    min-height: 28px;
    padding: 5px 14px;
    font-size: var(--text-caption);
    max-width: calc(100% - 48px);
    animation: toast-fade-in-bottom 0.42s ease-out;
  }
}

/* Desktop navigation is a separate surface above the settings panel. */
.mobile-nav-scrim { display: none; }
.properties-column { display: contents; }

@media (min-width: 701px) {
  .properties-column {
    display: flex;
    flex-direction: column;
    gap: var(--studio-gap);
    min-width: 0;
    min-height: 0;
  }
  .properties-column > .properties { flex: 1; }
  /* Beside the canvas these shadows only show where their blur spills onto it, and an
     undithered CSS shadow over a dark sky steps into visible bands in its left corner. */
  .properties-column > .properties,
  .properties-column .sky-tabs { box-shadow: none; }
  .desktop-navigation {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding: 12px;
    border-radius: 24px;
  }
  .desktop-navigation .brand { padding: 0; }
  .desktop-navigation .brand-logo { height: 28px; }
  .desktop-navigation .sky-tabs {
    flex: 1;
    min-width: 0;
    margin: 0;
    isolation: isolate;
    background:
      linear-gradient(138deg, rgba(255, 255, 255, 0.1), transparent 42%, rgba(255, 255, 255, 0.045)),
      rgba(16, 19, 23, 0.64);
    border: 0.2px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.44);
    -webkit-backdrop-filter: blur(24px) saturate(185%);
    backdrop-filter: blur(24px) saturate(185%);
  }
  .desktop-navigation .sky-tabs::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(112deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 76%, rgba(255, 255, 255, 0.025));
  }
  .desktop-navigation .sky-tab {
    height: 32px;
    padding: 0 5px;
    font-size: var(--text-body);
  }
  .desktop-navigation .sky-tab:hover { background: rgba(255, 255, 255, 0.09); }
  .desktop-navigation .sky-tab.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .desktop-navigation .sky-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  /* The chips sit as far below the panel's top edge as in from its left (25px). */
  .properties-column .sky-nav-container { padding-top: 20px; }
}

/* One material, with flat controls inside it. The tint follows the current sky. */

.presets,
.aurora-presets,
.celestial-options,
.styles {
  gap: var(--control-grid-gap);
}


.shuffle-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px -4px -4px 0;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  cursor: pointer;
  transition: color 150ms ease;
}

.shuffle-button:hover { color: var(--ink); }
.shuffle-button svg { width: 12px; height: 12px; stroke-width: 2.4px; }
.tuning-group-heading .shuffle-button { margin: -8px -4px -8px 0; }

.label-row:has(+ .weather-phenomena-grid:not(:has(.weather-item.active))) .shuffle-button,
.label-row:has(+ .atmospheric-phenomena-grid:not(:has(.atmos-item.active))) .shuffle-button,
.label-row:has(+ .aurora-presets:not(:has(.aurora-preset.active))) .shuffle-button {
  display: none;
}

.preset-wrap,
.aurora-preset-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  position: relative;
  min-width: 0;
  container-type: inline-size;
}

.preset,
.aurora-preset {
  display: contents;
  width: 100%;
  min-width: 0;
}

/* Cloud and aurora formations as framed cards (experiment): the picture inset 4px in a
   grid card, its name centred beneath. The button has no box (display: contents), so the
   wrap carries the card: grid-card fill and rest line, the gradient ring when picked. */
.preset-wrap,
.aurora-preset-wrap {
  padding: 4px 4px 0;
  border: 1px solid var(--selection-card-rest-line);
  border-radius: 12px;
  background: var(--selection-card-rest-fill);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.preset-wrap:has(.preset.active),
.aurora-preset-wrap:has(.aurora-preset.active) {
  border-color: transparent;
  background: var(--selection-card-fill);
}
.preset-wrap:has(.preset.active)::before,
.aurora-preset-wrap:has(.aurora-preset.active)::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: var(--selection-card-stroke);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.preset-wrap:has(.preset:focus-visible),
.aurora-preset-wrap:has(.aurora-preset:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.preset-wrap .preset img,
.aurora-preset-wrap .aurora-preset img,
.preset-wrap .preset.active img,
.aurora-preset-wrap .aurora-preset.active img {
  border-radius: 8px;
  box-shadow: none;
  outline: none;
  filter: none;
}
.preset-wrap .preset > span,
.aurora-preset-wrap .aurora-preset > span {
  margin-top: 0;
  padding: 7px 0 8px;
  text-align: center;
}

.preset img,
.aurora-preset img,
.preset-shuffle,
.aurora-preset-shuffle {
  grid-column: 1;
  grid-row: 1;
}

.preset > span,
.aurora-preset > span {
  grid-column: 1;
  grid-row: 2;
}

.preset-shuffle,
.aurora-preset-shuffle {
  position: relative;
  z-index: 2;
  justify-self: center;
  align-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink);
  background: rgb(5 12 16 / 0.68);
  border: 1px solid rgb(255 255 255 / 0.42);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgb(0 0 0 / 0.38), inset 0 1px rgb(255 255 255 / 0.12);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 150ms ease, transform 150ms ease;
}

.preset-shuffle svg,
.aurora-preset-shuffle svg { width: 15px; height: 15px; }
.preset-shuffle:hover,
.aurora-preset-shuffle:hover {
  background: rgb(5 12 16 / 0.68);
}
.preset-wrap:focus-within .preset-shuffle,
.aurora-preset-wrap:focus-within .aurora-preset-shuffle {
  opacity: 1;
  transform: none;
}
@media (hover: hover) {
  .preset-wrap:hover .preset-shuffle,
  .aurora-preset-wrap:hover .aurora-preset-shuffle {
    opacity: 1;
    transform: none;
  }
}

.preset-wrap:has([data-preset="clear"]) .preset-shuffle,
[data-preset="clear"] ~ .preset-shuffle {
  display: none !important;
}

@media (max-width: 700px) {
  .preset-wrap:has(.preset.active) .preset-shuffle,
  .aurora-preset-wrap:has(.aurora-preset.active) .aurora-preset-shuffle {
    opacity: 1;
    transform: none;
  }
  #section-time {
    --globe-size: 34px;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .properties,
  .export-button,
  .canvas-toolbar,
  .export-menu,
  .fullscreen-button,
  .sound-toggle-button,
  .record-hud-panel,
  .snapshot-thumb,
  .snapshot-shutter,
  #glass-tooltip,
  #toast,
  #canvas-error {
    background: color-mix(in srgb, var(--app-background) 94%, transparent);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .properties,
  .export-button,
  .canvas-toolbar,
  .export-menu,
  .fullscreen-button,
  .sound-toggle-button,
  .record-hud-panel,
  .snapshot-thumb,
  .snapshot-shutter,
  #glass-tooltip,
  #toast,
  #canvas-error {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--app-background);
  }
}

@media (prefers-contrast: more) {
  .properties,
  .export-button,
  .canvas-toolbar,
  .export-menu,
  .fullscreen-button,
  .sound-toggle-button,
  .record-hud-panel,
  .snapshot-thumb {
    border-width: 2px;
  }
  :root { --muted: #c8cfca; --glass-fill: rgba(0, 0, 0, 0.9); }
}

/* Compact location picker */
.location-menu {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin: 28px 0 0;
  grid-column: 1 / -1;
}
.current-location {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  gap: 0;
  padding: 10px 14px;
  color: var(--secondary);
  text-align: left;
  background: color-mix(in srgb, var(--control-fill) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 0 1px rgb(255 255 255 / 0.14);
}
.current-location:hover { background: var(--control-hover); }
.current-location-flag { flex-shrink: 0; margin-inline-end: 10px; font-size: var(--text-label); line-height: 1; }
.location-summary {
  display: flex;
  align-items: baseline;
  flex: 1;
  min-width: 0;
  margin-inline-end: 8px;
  overflow: hidden;
  gap: 4px;
}
.location-summary-separator { flex-shrink: 0; color: var(--muted); font-size: var(--text-meta); }
#current-location-name {
  min-width: 0;
  overflow: hidden;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#current-location-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-location .chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--muted);
  transition: transform 150ms ease;
}
.current-location[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.location-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 20px;
  color: var(--menu-text-primary);
  background:
    linear-gradient(168deg, rgba(28, 36, 48, 0.94) 0%, rgba(16, 21, 29, 0.96) 50%, rgba(10, 14, 20, 0.98) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.38),
    inset 0 0.75px 0.5px rgba(255, 255, 255, 0.25),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: var(--menu-frost-filter);
  backdrop-filter: var(--menu-frost-filter);
  isolation: isolate;
  overflow: hidden;
}

.location-popover .search-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 2px;
  border-radius: 12px;
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.location-popover .search-field:focus-within {
  border-color: var(--menu-control-border);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.14);
}

.location-popover .search-field input:focus,
.location-popover .search-field input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

.location-popover .search-field input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  color: var(--menu-text-primary);
  background: transparent;
  border: none;
  outline: none;
}

.location-popover .search-field input::placeholder {
  color: var(--menu-text-muted);
}

/* The button fills the field's height, so its hover sits 2px in on every side, and its
   radius is the field's less that inset and the border (12 - 2 - 1), concentric with it. */
.location-popover .search-field button {
  display: inline-flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--menu-text-muted);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.location-popover .search-field button:hover {
  color: var(--menu-text-primary);
  background: var(--menu-control-hover);
}

.location-popover .search-field button svg {
  width: 15px;
  height: 15px;
}

.location-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  margin-top: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 6px;
  padding-bottom: 4px;
}

.location-no-results {
  margin: 0;
  padding: 10px;
  color: var(--menu-text-muted);
  font-size: var(--text-body);
}

/* Apple Liquid Glass thin custom scrollbar */
.location-results::-webkit-scrollbar {
  width: 4px;
}
.location-results::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.location-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  box-shadow: inset 0 0.5px 0.5px rgba(255, 255, 255, 0.35);
}
.location-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0.5px 0.5px rgba(255, 255, 255, 0.6);
}

.location-result {
  border-bottom: 1px solid var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  gap: 2px;
  padding: 6px 30px 6px 10px;
  color: var(--menu-text-primary);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 12px;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.location-result:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -4.5px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--line);
  opacity: 0.4;
  pointer-events: none;
}

.location-result:hover {
  background: var(--menu-control-hover);
}

.location-result:hover::after {
  opacity: 0;
}

.location-result:active {
  background: var(--menu-control-bg);
}

.location-result.active {
  color: var(--accent-ink);
  background: transparent;
}

.location-result.active::before {
  content: '✓';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--accent-ink);
}

.location-result > span {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  line-height: 1.25;
}

.location-result.active > span {
  font-weight: var(--weight-semibold);
}

.location-result small {
  overflow: hidden;
  font-size: var(--text-caption);
  /* Room for flag glyphs and descenders, which a clipped single line would cut. */
  line-height: 1.4;
  color: var(--menu-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-result.active small {
  color: var(--accent-ink);
}

/* The answer being replaced stays readable, a step back, until the new one lands. */
.location-results.is-busy {
  opacity: 0.55;
  transition: opacity 150ms ease 120ms;
}

.location-result:focus-visible {
  outline: 2px solid var(--accent-line, #00a4b8);
  outline-offset: -2px;
}

/* "Myanmar · 178 cities" above a country's or region's list. */
.location-area {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 2px 10px 4px;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  color: var(--menu-text-primary);
}
.location-area span {
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  color: var(--menu-text-muted);
}

/* A country or region to open, marked with a chevron like any link inward. */
.location-explore svg {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  color: var(--menu-text-muted);
  transform: translateY(-50%) rotate(-90deg);
}

.location-offline {
  margin: 0;
  padding: 4px 10px;
  font-size: var(--text-caption);
  color: var(--menu-text-muted);
}

#weather-status {
  display: none;
}

.time-caption > .time-swatch {
  display: inline-block;
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: var(--time-swatch-color, #6fb9e5);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.35), 0 1px 2px rgb(0 0 0 / 0.2);
}

/* Intro splash screen overlay */
.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: default;
  /* The script after the splash in index.html fades it when the intro film ends and
     switches this animation off. It is the last resort for a page where that script
     never runs (scripts off): the splash still clears after nine seconds. */
  animation: introFade 0.5s ease 9s forwards, introHide 0s 9.5s forwards;
}

@keyframes introFade {
  to {
    opacity: 0;
  }
}

@keyframes introHide {
  to {
    visibility: hidden;
  }
}

.intro-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: min(780px, calc(100vw - 48px));
  padding: 16px;
  gap: 28px;
  box-sizing: border-box;
  color: var(--ink);
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 29%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / var(--glass-ambient-strength)), transparent 58%),
    var(--glass-fill);
  border: 0.5px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-inner-line);
  isolation: isolate;
  transform: translateZ(0);
}

.intro-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(112deg, var(--glass-directional-sheen), transparent 23%, transparent 72%, rgb(var(--glass-ambient-rgb) / var(--glass-reflection-strength))),
    radial-gradient(92% 54% at 7% 0%, rgb(var(--glass-ambient-rgb) / var(--glass-reflection-strength)), transparent 65%);
  box-shadow: inset 0 0.5px 0 var(--glass-rim), inset 0.5px 0 0 rgb(255 255 255 / 0.07), inset 0 -0.5px 0 var(--glass-low-rim);
  opacity: 1;
}

.intro-card > * {
  position: relative;
  z-index: 1;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-self: center;
  flex: 1 1 240px;
  min-width: 170px;
  padding: 8px 0 8px 12px;
  gap: 32px;
  text-align: left;
}

.intro-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  margin: 0;
}

.intro-tagline {
  font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif;
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  padding: 0;
  letter-spacing: var(--tracking-text);
  text-align: left;
}

.intro-loading {
  font-family: 'Twemoji Country Flags', 'Google Sans Flex', sans-serif;
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  color: var(--subtext);
  opacity: 0.6;
  display: flex;
  align-items: baseline;
  margin: 0;
  text-align: left;
}

.intro-dots {
  display: inline-flex;
  margin-left: 1px;
  letter-spacing: var(--tracking-text);
}

.intro-dots span {
  display: inline-block;
  opacity: 0.2;
  animation: introDotPulse 1.2s infinite ease-in-out both;
}

.intro-dots span:nth-child(1) {
  animation-delay: 0s;
}

.intro-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.intro-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes introDotPulse {
  0%, 100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1.5px);
  }
}

.intro-media {
  flex: 1.4 1 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  background: url('assets/skystudio-intro-poster-v5.webp') center / cover no-repeat;
}

.intro-video {
  width: 100%;
  height: auto;
  max-height: 290px;
  aspect-ratio: 1918 / 1080;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  pointer-events: none;
}

@media (max-width: 700px) {
  .intro-card {
    flex-direction: column-reverse;
    gap: 24px;
    border-radius: 22px;
    width: min(440px, calc(100vw - 32px));
    max-height: 90vh;
    overflow-y: auto;
  }
  .intro-media {
    width: 100%;
    flex: 0 0 auto;
    border-radius: 16px;
  }
  .intro-video {
    width: 100%;
    max-height: none;
    border-radius: 16px;
  }
  .intro-content {
    width: 100%;
    flex: 0 0 auto;
    padding: 0;
    gap: 16px;
  }
  .intro-logo {
    height: 40px;
  }
  .intro-tagline {
    font-size: var(--text-caption);
    color: var(--muted);
  }
  .intro-loading {
    font-size: var(--text-caption);
  }
}

.record-hud-panel .record-volume-control {
  --pull-h: 36px;
  flex: 0 0 132px;
  width: 132px;
  height: var(--pull-h);
  margin: 0;
}
.record-hud-panel .record-volume-control .label-row {
  justify-content: flex-end;
  padding: 0 10px;
  font-size: var(--text-caption);
}
.record-hud-panel .record-volume-control .label-row output {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}
.record-hud-panel .record-volume-control input[type="range"]::-webkit-slider-thumb {
  margin-top: calc((var(--pull-h) - 22px) / 2);
}
.record-hud-panel .record-volume-control input[type="range"]::-moz-range-thumb {
  height: 22px;
}
.record-sound-toggle {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 13px;
  color: var(--ink);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  cursor: pointer;
}
.record-sound-toggle svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}
.record-sound-toggle:active {
  transform: scale(0.96);
}
.sound-toggle-button {
  position: absolute;
  left: 26px;
  bottom: 26px;
  z-index: 7;
}

.snapshot-shutter {
  position: absolute;
  left: 50%;
  bottom: calc(26px + 52px + 20px);
  z-index: 8;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  min-width: 88px;
  min-height: 88px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(-50%);
  transition: background 200ms ease-out, box-shadow 200ms ease-out, transform 150ms ease;
}
.snapshot-shutter-icon {
  display: block;
  width: 34px;
  height: 34px;
  opacity: 0.7;
}
.snapshot-shutter:hover {
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 26%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / calc(var(--glass-ambient-strength) * 1.5)), transparent 55%),
    var(--control-strong);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.snapshot-shutter:active {
  transform: translateX(-50%) scale(0.94);
}
.snapshot-shutter:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent);
}

#glass-tooltip {
  --tooltip-fill: var(--floating-glass-fill, var(--glass-fill));
  --tooltip-border: var(--glass-border);
  --tooltip-inner-line: var(--glass-inner-line);
  --tooltip-sheen: var(--glass-sheen);
  --tooltip-rim: var(--glass-rim);
  --tooltip-low-rim: var(--glass-low-rim);
  --tooltip-ambient-rgb: var(--glass-ambient-rgb);
  --tooltip-ambient-strength: var(--glass-ambient-strength);
  --tooltip-text-color: var(--muted);
  --tooltip-glass-background:
    linear-gradient(142deg, var(--tooltip-sheen), transparent 32%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--tooltip-ambient-rgb) / var(--tooltip-ambient-strength)), transparent 58%),
    var(--tooltip-fill);
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px 10px;
  color: var(--tooltip-text-color);
  -webkit-text-fill-color: currentColor;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  border-radius: 10px;
  background: var(--tooltip-glass-background);
  border: 0.5px solid var(--tooltip-border);
  box-shadow:
    inset 0 0.5px 0 var(--tooltip-rim),
    inset 0 0 0 0.5px var(--tooltip-inner-line),
    inset 0 -0.5px 0 var(--tooltip-low-rim);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms ease;
}
#glass-tooltip.is-dice {
  isolation: isolate;
  background: none;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#glass-tooltip.is-dice::before,
#glass-tooltip.is-dice::after {
  content: "";
  position: absolute;
  top: -0.5px;
  left: -0.5px;
  width: calc(100% + 1px);
  height: calc(100% + 9px);
  pointer-events: none;
}
#glass-tooltip.is-dice::before {
  z-index: -2;
  background: var(--tooltip-glass-background);
  clip-path: var(--tooltip-shape);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
#glass-tooltip.is-dice::after {
  z-index: -1;
  background: var(--tooltip-border);
  -webkit-mask: var(--tooltip-outline) 0 0 / 100% 100% no-repeat;
  mask: var(--tooltip-outline) 0 0 / 100% 100% no-repeat;
}
#glass-tooltip.is-side {
  text-align: center;
}
#glass-tooltip.is-canvas-light {
  --tooltip-fill: rgba(255, 255, 255, 0.2);
  --tooltip-border: rgba(14, 22, 28, 0.11);
  --tooltip-inner-line: rgba(255, 255, 255, 0.34);
  --tooltip-sheen: rgba(255, 255, 255, 0.22);
  --tooltip-rim: rgba(255, 255, 255, 0.72);
  --tooltip-low-rim: rgba(14, 22, 28, 0.08);
  --tooltip-ambient-rgb: 180 200 210;
  --tooltip-ambient-strength: 0.045;
  --tooltip-text-color: var(--light-muted);
}
#glass-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 701px) {
  #glass-tooltip {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
  }
}

.snapshot-stack-wrap {
  position: absolute;
  right: 22px;
  bottom: 24px;
  z-index: 7;
  width: 96px;
  height: 68px;
  pointer-events: auto;
}
.snapshot-stack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.snapshot-clear {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  right: auto;
  top: auto;
  z-index: 5;
  padding: 5px 9px;
  color: var(--ink);
  font-size: var(--text-meta);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-text);
  white-space: nowrap;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 140ms ease, visibility 140ms ease, transform 140ms ease;
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 32%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / var(--glass-ambient-strength)), transparent 58%),
    var(--floating-glass-fill, var(--glass-fill));
  border: 0.5px solid var(--glass-border);
  box-shadow:
    inset 0 0.5px 0 var(--glass-rim),
    inset 0 0 0 0.5px var(--glass-inner-line),
    inset 0 -0.5px 0 var(--glass-low-rim);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
.snapshot-stack-wrap:hover .snapshot-clear,
.snapshot-stack-wrap:focus-within .snapshot-clear {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%);
}
.snapshot-clear:hover {
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 26%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / calc(var(--glass-ambient-strength) * 1.5)), transparent 55%),
    var(--control-strong);
}
.snapshot-clear:active {
  transform: translateX(-50%) scale(0.96);
}
.snapshot-thumb {
  position: absolute;
  inset: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
  pointer-events: auto;
  outline: 1px solid oklch(1 0 0 / 0.1);
}
.snapshot-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.snapshot-thumb:hover {
  transform: scale(1.03);
}
.snapshot-thumb:active {
  transform: scale(0.96);
}
.snapshot-lightbox {
  max-width: min(920px, calc(100vw - 40px));
  padding: 16px;
  border: 0.5px solid var(--menu-frost-border);
  border-radius: 22px;
  color: var(--menu-text-primary);
  background: var(--menu-frost-bg);
  box-shadow:
    inset 0 0.75px 0.5px var(--menu-frost-rim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: var(--menu-frost-filter);
  backdrop-filter: var(--menu-frost-filter);
}
.snapshot-lightbox::backdrop {
  background: rgb(0 0 0 / 0.55);
}
.snapshot-lightbox img {
  display: block;
  width: 100%;
  max-height: min(70vh, 640px);
  object-fit: contain;
  border-radius: 14px;
  outline: 1px solid oklch(1 0 0 / 0.1);
}
.snapshot-lightbox form {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.record-hud {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 8;
  transform: translateX(-50%);
  pointer-events: auto;
}
.record-hud-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 10px 7px 16px;
  border-radius: 22px;
}
.record-hud-panel p {
  margin: 0 8px 0 0;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  color: var(--menu-text-muted);
}
.record-live-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff453a;
  box-shadow: 0 0 0 0 rgb(255 69 58 / 0.55);
  animation: record-live-pulse 1.15s ease-in-out infinite;
}
@keyframes record-live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgb(255 69 58 / 0.55);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.88);
    box-shadow: 0 0 0 4px rgb(255 69 58 / 0);
  }
}
#record-timer {
  min-width: 3.4em;
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-text);
}
.record-stop {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 13px;
  color: var(--ink);
  background: rgba(210, 45, 45, 0.9);
  border: 1px solid rgba(255, 120, 120, 0.42);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.record-stop:hover {
  background: rgba(228, 55, 55, 0.96);
}
#record-done {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 13px;
  color: var(--accent-ink);
  background: var(--accent-fill);
  border: 1px solid var(--accent-line);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
#record-done:hover {
  background: color-mix(in srgb, var(--accent-fill) 80%, white);
}
.record-stop:active,
#record-done:active {
  transform: scale(0.96);
}
#record-export,
#record-saved {
  min-width: min(360px, calc(100vw - 40px));
  flex-wrap: wrap;
  padding: 14px 18px;
}
#record-export .export-progress-row {
  width: 100%;
}
#record-meter {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--menu-control-bg);
  accent-color: var(--accent);
}
#record-status,
#record-saved-detail {
  color: var(--menu-text-secondary);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

body.record-mode {
  overflow: hidden;
}
body.record-mode .studio {
  display: block;
  padding: 0;
  max-width: none;
  height: 100dvh;
}
body.record-mode .properties,
body.record-mode .canvas-top,
body.record-mode .canvas-bottom,
body.record-mode .snapshot-stack-wrap,
body.record-mode .snapshot-shutter,
body.record-mode .intro-splash {
  display: none !important;
}
body.record-mode .sound-toggle-button {
  display: grid;
}
body.record-mode .layers-wrap,
body.fullscreen-mode .layers-wrap {
  display: none;
}
body.record-mode .mobile-canvas-menu-wrap {
  display: none;
}
body.record-mode .canvas-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  z-index: 40;
  background: #000;
}

/* Layers reuse the floating glass language. The panel is anchored to the left
   canvas tools on larger screens, then becomes a native dialog bottom sheet. */
.canvas-left-tools {
  position: absolute;
  inset-inline-start: 26px;
  bottom: 26px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.canvas-left-tools .sound-toggle-button {
  position: static;
  left: auto;
  bottom: auto;
}
.layers-wrap { position: relative; display: grid; place-items: center; }
.mobile-canvas-menu-wrap { display: none; }
.mobile-canvas-menu .canvas-menu-action {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 7px;
}
.mobile-canvas-menu .canvas-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--menu-text-secondary);
  stroke-width: 2;
}
/* The speaker glyph fills only x 2–16 of its 24-unit box, so beside Layers and Reset it
   read small and off to the left. Scaled 1.2× and centred by transform, the 18px box stays
   put; the stroke is thinned by the same factor so it still draws 2px. Muted (volume-x)
   already fills its box. */
.mobile-canvas-menu #mobile-canvas-sound-toggle[aria-pressed="true"] .canvas-menu-icon {
  transform: translateX(2.7px) scale(1.2);
  stroke-width: 1.67;
}
.layers-button[aria-expanded="true"] {
  background:
    linear-gradient(142deg, var(--glass-sheen), transparent 26%),
    radial-gradient(125% 78% at 0% 0%, rgb(var(--glass-ambient-rgb) / calc(var(--glass-ambient-strength) * 1.35)), transparent 55%),
    var(--control-strong);
}
.layers-menu {
  --layer-action-size: 36px;
  --layer-quick-action-size: 30px;
  --layer-card-action-size: var(--layer-quick-action-size);
  --layer-action-gap: 6px;
  --layer-card-pad: 11px;
  --layer-quick-actions-width: calc(var(--layer-quick-action-size) * 2 + var(--layer-action-gap));
  --layer-icon-size: 16px;
  top: auto;
  right: auto;
  bottom: calc(100% + 12px);
  left: 0;
  width: min(344px, calc(100vw - 48px));
  max-height: min(80dvh, 680px);
  padding: 16px;
  overflow: visible;
}
.layers-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.layers-menu .menu-heading { margin-bottom: 3px; }
/* Scoped under .layers-menu to outrank the generic uppercase `.export-menu p`. */
.layers-menu .layers-section-label {
  margin: 0 0 8px;
  color: var(--menu-text-secondary);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  text-transform: none;
  letter-spacing: var(--tracking-text);
}
.layers-menu-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
/* Save and Load are one pill, each icon its own hit target inside it, so the
   two related preset actions read as a single control next to Close. */
.layers-menu .layers-header-group {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--layer-action-size);
  padding: 0 10px;
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.layers-menu .layers-header-group:hover,
.layers-menu .layers-header-group:has(.layers-header-action[aria-expanded="true"]) {
  background: var(--menu-control-hover);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}
.layers-menu .layers-header-group .layers-header-action {
  width: auto !important;
  min-width: 0;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
}
.layers-menu .layers-header-group .layers-header-action:hover,
.layers-menu .layers-header-group .layers-header-action:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none;
}
.layers-menu .layers-header-group .layers-header-action:focus-visible {
  outline: none;
  box-shadow: none !important;
}
.layers-menu .layers-close {
  width: var(--layer-action-size) !important;
  min-width: var(--layer-action-size);
  height: var(--layer-action-size);
  border-radius: 50% !important;
  background: var(--menu-control-bg) !important;
  border: 1px solid var(--menu-control-border) !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32) !important;
}
.layers-menu .layers-close:hover {
  background: var(--menu-control-hover) !important;
  border-color: rgba(255, 255, 255, 0.48) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
}
.layers-menu .layers-header-action,
.layers-menu .layers-close {
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  justify-content: center !important;
}
.layers-menu .layers-header-action svg,
.layers-menu .layers-close svg {
  width: var(--layer-icon-size);
  height: var(--layer-icon-size);
  stroke-width: 2;
}
.layers-list {
  display: grid;
  gap: 8px;
  max-height: calc(80dvh - 112px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-inline-end: 2px;
}
.layer-card {
  position: relative;
  padding: var(--layer-card-pad);
  border-radius: 15px;
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
}
.layer-card.is-base {
  background: color-mix(in srgb, var(--menu-control-bg) 80%, var(--glass-ambient, #7ab7d2));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--layer-action-gap);
}
.layer-card.is-hidden { opacity: 0.64; }
.layer-card-summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--layer-card-action-size);
  gap: var(--layer-action-gap);
  justify-content: stretch;
  padding-inline-end: 0;
}
.layer-card-summary::-webkit-details-marker { display: none; }
.layer-disclosure {
  width: var(--layer-card-action-size);
  height: var(--layer-card-action-size);
  justify-self: end;
  display: grid;
  place-items: center;
  color: var(--menu-text-secondary);
  border-radius: 50%;
  transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.layer-disclosure svg { width: var(--layer-icon-size); height: var(--layer-icon-size); fill: none; stroke: currentColor; stroke-width: 2; }
.layer-card[open] .layer-disclosure { color: var(--menu-text-primary); transform: rotate(180deg); }
.layer-card-summary:hover .layer-disclosure { background: var(--menu-control-hover); }
.layer-card-actions {
  position: absolute;
  top: 50%;
  right: calc(var(--layer-card-action-size) + var(--layer-action-gap));
  transform: translateY(-50%);
  display: flex;
  block-size: var(--layer-card-action-size);
  align-items: center;
  gap: var(--layer-action-gap);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.layer-card[open] .layer-card-actions,
.layer-card-summary:hover .layer-card-actions {
  opacity: 1;
  pointer-events: auto;
}
.layer-card[open] .layer-card-summary,
.layer-card-summary:hover {
  grid-template-columns: minmax(0, 1fr) calc(var(--layer-card-action-size) + var(--layer-action-gap) + var(--layer-quick-actions-width));
}
.layer-visibility-action,
.layers-menu .layer-delete-action,
.layers-menu .layer-reset-action {
  width: var(--layer-quick-action-size) !important;
  min-width: var(--layer-quick-action-size);
  height: var(--layer-quick-action-size);
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  justify-content: center !important;
  /* !important throughout: the generic `.export-menu button` / `.export-menu label`
     rules outrank these two-class selectors and would otherwise re-square the
     delete button and tint the two icons differently. */
  color: var(--menu-text-secondary) !important;
  background: var(--menu-control-bg) !important;
  border: 1px solid var(--menu-control-border) !important;
  border-radius: 50% !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.28) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  cursor: pointer;
  flex: 0 0 var(--layer-quick-action-size);
}
.layers-menu .layer-reset-action[hidden] { display: none !important; }
.layer-visibility-action { position: relative; }
.layer-visibility-action input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.layer-visibility-action svg,
.layers-menu .layer-delete-action svg,
.layers-menu .layer-reset-action svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.layer-visibility-action:has(input:focus-visible),
.layers-menu .layer-delete-action:focus-visible,
.layers-menu .layer-reset-action:focus-visible { outline: 2px solid var(--focus) !important; outline-offset: 2px !important; }
.layer-visibility-action:hover,
.layers-menu .layer-delete-action:hover,
.layers-menu .layer-reset-action:hover { background: var(--menu-control-hover) !important; }
.layer-visibility-action:active,
.layers-menu .layer-delete-action:active,
.layers-menu .layer-reset-action:active { transform: scale(0.96) !important; background: var(--menu-control-hover) !important; }
.layer-options {
  display: grid;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--menu-control-border) 75%, transparent);
}
.layer-card-title { padding-inline-end: 0; display: grid; gap: 2px; min-width: 0; }
.layer-card-title strong { font-size: var(--text-body); font-weight: var(--weight-semibold); color: var(--menu-text-primary); }
.layer-card-title span { color: var(--menu-text-secondary); font-size: var(--text-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-card[open] .layer-change-summary { display: none; }
.layers-menu .layer-change-full {
  margin: 0;
  color: var(--menu-text-secondary);
  font-size: var(--text-meta);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-text);
  line-height: 1.45;
  text-transform: none;
  overflow-wrap: anywhere;
}
.layer-opacity-control { margin: 0; }
.layer-blend-control { display: grid; gap: 8px; }
.layer-blend-control label {
  margin: 0;
  color: var(--menu-text-secondary);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}
.layer-blend-control select { margin: 0; min-width: 0; padding: 10px 32px 10px 12px; font-size: var(--text-caption); }
.layers-menu button.layer-action {
  display: inline-flex;
  width: auto !important;
  min-height: 30px;
  margin: 0;
  padding: 6px 9px;
  justify-content: center;
  font-size: var(--text-caption);
  white-space: nowrap;
}
.layer-preset-save-row .layer-save-action,
.layer-preset-load-row .layer-action { flex: 0 0 auto; }
.layers-menu .layer-danger { color: var(--danger-ink); }
.layer-preset-menu {
  position: absolute;
  inset: 0 auto auto calc(100% + 12px);
  width: min(280px, calc(100vw - 48px));
  margin: 0;
  padding: 16px;
  color: var(--menu-text-primary);
  background: var(--menu-frost-bg);
  border: 0.5px solid var(--menu-frost-border);
  border-radius: 22px;
  box-shadow:
    inset 0 0.75px 0.5px var(--menu-frost-rim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.09),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.05),
    0 12px 32px rgb(0 0 0 / 0.18);
  -webkit-backdrop-filter: var(--menu-frost-filter);
  backdrop-filter: var(--menu-frost-filter);
  isolation: isolate;
  --layer-preset-control-height: 40px;
}
.layer-preset-menu[open] {
  display: grid;
  gap: 10px;
  z-index: 2;
}
.layer-preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 4px;
}
.layer-preset-menu .layer-preset-header .menu-heading { margin: 0; }
.layer-preset-menu .menu-heading {
  margin: 0 0 4px;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  color: var(--menu-text-muted);
}
.layer-preset-menu label {
  margin: 0 0 6px;
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  color: var(--menu-text-secondary);
  text-transform: none;
  letter-spacing: var(--tracking-text);
}
.layer-preset-menu form { display: grid; gap: 0; }
.layer-preset-save-row,
.layer-preset-load-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.layer-preset-save-row input,
.layer-preset-menu select {
  box-sizing: border-box;
  min-width: 0;
  flex: 1;
  width: auto;
  height: var(--layer-preset-control-height);
  margin: 0;
  padding: 0 14px;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  font-family: inherit;
  color: var(--menu-text-primary);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
}
.layer-preset-save-row input {
  border-radius: 999px;
}
.layer-preset-menu select {
  padding-right: 32px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  cursor: pointer;
}
.layer-preset-menu .layer-action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 64px;
  height: var(--layer-preset-control-height);
  margin: 0;
  padding: 0 14px;
  color: var(--menu-text-primary);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
  font: inherit;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.layer-preset-menu .layer-action:hover {
  background: var(--menu-control-hover);
  border-color: rgba(255, 255, 255, 0.48);
}
.layer-preset-divider {
  width: 100%;
  margin: 8px 0;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--menu-control-border) 75%, transparent);
}
.layer-preset-menu .layer-text-delete {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 8px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  color: var(--danger-ink);
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  font: inherit;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.layer-preset-menu .layer-text-delete svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.layer-preset-menu .layer-text-delete:hover {
  text-decoration: underline;
}
/* Export / import of saved presets: compact glass icon actions. */
.layer-preset-file-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--layer-action-gap, 6px);
  flex: 0 0 auto;
}
.layer-preset-menu .layer-preset-icon-action {
  display: grid;
  place-items: center;
  flex: 0 0 var(--layer-quick-action-size, 30px);
  width: var(--layer-quick-action-size, 30px);
  height: var(--layer-quick-action-size, 30px);
  margin: 0;
  padding: 0;
  color: var(--menu-text-secondary);
  background: var(--menu-control-bg);
  border: 1px solid var(--menu-control-border);
  border-radius: 50%;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.layer-preset-menu .layer-preset-icon-action:hover {
  background: var(--menu-control-hover);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}
.layer-preset-menu .layer-preset-icon-action:active {
  transform: scale(0.96);
}
.layer-preset-menu .layer-preset-icon-action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.layer-preset-menu .layer-preset-icon-action svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.layer-preset-menu .layer-preset-icon-import svg {
  transform: rotate(180deg);
}

@media (max-width: 700px) {
  .canvas-left-tools {
    inset-inline-start: 16px;
    bottom: 16px;
    gap: 0;
  }
  .canvas-left-tools > .sound-toggle-button,
  .canvas-left-tools > .layers-wrap > .layers-button {
    display: none;
  }
  /* ASMR hides the mobile options menu, so mute stays on the canvas. */
  .canvas-panel.asmr-active .canvas-left-tools > .sound-toggle-button {
    display: grid;
  }
  .mobile-canvas-menu-wrap {
    display: grid;
    place-items: center;
  }
  .mobile-canvas-menu-button {
    margin-left: 0;
  }
  .mobile-canvas-menu {
    position: fixed;
    inset: 0;
    width: min(300px, 100vw - 40px);
    height: fit-content;
    max-height: calc(100dvh - 80px);
    margin: auto;
    transform: none;
  }
  .mobile-canvas-menu::backdrop {
    background: rgb(0 0 0 / 0.55);
  }
  .layers-menu {
    --layer-action-size: 40px;
    --layer-icon-size: 18px;
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 80dvh;
    margin: 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    transform: none;
    /* .layers-list is the single scroll region (see its own max-height below);
       hidden here just clips the rounded corners instead of double-scrolling. */
    overflow: hidden;
  }
  .layers-menu::backdrop { background: rgb(0 0 0 / 0.55); }
  .layers-list { max-height: calc(80dvh - 118px); }
  .layer-preset-menu {
    position: fixed;
    inset: 0;
    width: min(300px, calc(100vw - 40px));
    height: fit-content;
    max-height: calc(100dvh - 80px);
    margin: auto;
    padding: 16px;
    border-radius: 22px;
  }
  .layer-preset-menu::backdrop { background: rgb(0 0 0 / 0.55); }
}
body.record-mode #sky-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .record-hud {
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: none;
  }
  .record-hud-panel {
    width: 100%;
    justify-content: space-between;
  }
  .record-hud-panel .record-volume-control {
    display: none;
  }
  .record-sound-toggle {
    display: grid;
  }
  body.snapshot-mode #toast {
    top: 25px;
    bottom: auto;
    animation: toast-fade-in 0.42s ease-out;
  }
  .snapshot-stack-wrap {
    display: none !important;
  }
  .sound-toggle-button {
    left: 16px;
    bottom: 16px;
  }
  .snapshot-shutter {
    bottom: calc(16px + 52px + 20px);
  }
  .canvas-panel :is(.export-button, .tool, .fullscreen-button, .sound-toggle-button, .snapshot-shutter, .snapshot-clear) {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .canvas-panel :is(.export-button, .tool, .fullscreen-button, .sound-toggle-button, .snapshot-shutter, .snapshot-clear):focus,
  .canvas-panel :is(.export-button, .tool, .fullscreen-button, .sound-toggle-button, .snapshot-shutter, .snapshot-clear):focus-visible {
    outline: none !important;
  }
  .canvas-panel .tool:focus,
  .canvas-panel .tool:focus-visible {
    box-shadow: none;
  }
  .canvas-panel .tool.active:focus,
  .canvas-panel .tool.active:focus-visible {
    box-shadow:
      inset 0 0.5px 0 var(--glass-rim),
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.22),
      inset 0 -0.5px 0 var(--glass-low-rim);
  }
  .canvas-panel .fullscreen-button:focus,
  .canvas-panel .fullscreen-button:focus-visible,
  .canvas-panel .sound-toggle-button:focus,
  .canvas-panel .sound-toggle-button:focus-visible,
  .canvas-panel .snapshot-shutter:focus,
  .canvas-panel .snapshot-shutter:focus-visible,
  .canvas-panel .export-button:focus,
  .canvas-panel .export-button:focus-visible {
    box-shadow:
      inset 0 0.5px 0 var(--glass-rim),
      inset 0 0 0 0.5px var(--glass-inner-line),
      inset 0 -0.5px 0 var(--glass-low-rim);
  }
}

/* Touch text fields retain the 16px iOS floor after all component overrides. */
@media (pointer: coarse) {
  .control-section .text-field,
  .search-field input,
  .location-popover .search-field input { font-size: var(--text-label); }
}

/* Full screen: every canvas button hides after 3 s idle (TOOLBAR_IDLE_MS in app.js); a pointer
   move, tap or key brings them back. Keyboard focus keeps its button shown; a clicked button
   keeps focus too, so plain :focus-within held the whole set up for good on desktop. */
:is(body.fullscreen-mode, html.embed-fullscreen body) :is(.canvas-bottom, .canvas-left-tools, .mobile-canvas-menu-wrap) {
  transition: opacity 300ms ease-out;
}
:is(body.fullscreen-mode, html.embed-fullscreen body).toolbar-idle :is(.canvas-bottom, .canvas-left-tools, .mobile-canvas-menu-wrap):not(:has(:focus-visible)) {
  opacity: 0;
  pointer-events: none;
}
:is(body.fullscreen-mode, html.embed-fullscreen body).toolbar-idle .canvas-panel {
  cursor: none;
}
/* A phone held upright in full screen, where the screen cannot be locked to landscape: the
   panel is laid out landscape and turned a quarter left, so the toolbar runs up the right
   edge and sunrise to sunset spans the long side (syncFullscreenRotation in app.js). */
.canvas-panel.fs-rotated {
  position: fixed;
  inset: auto;
  top: 0;
  left: 0;
  width: 100dvh;
  height: 100dvw;
  transform-origin: 0 0;
  transform: translate(0, 100dvh) rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
  #toast { animation-name: toast-fade-only !important; }
}
@keyframes toast-fade-only { from { opacity: 0; } to { opacity: 1; } }

/* Selected cards draw their stroke as a gradient ring (masked to the border), so the fill
   stays translucent beneath it. */
.celestial.active,
.atmos-item.active,
.atmos-item.triggered,
#section-style .style.active {
  position: relative;
  border-color: transparent;
}
.celestial.active::before,
.atmos-item.active::before,
.atmos-item.triggered::before,
#section-style .style.active::before {
  content: "";
  position: absolute;
  inset: -0.5px;
  padding: 1px;
  border-radius: inherit;
  background: var(--selection-card-stroke);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* Headphone hint (earphone-hint.js): a small glass card, shown twice per browser. */
/* Desktop: over Export, its top-right corner on the button's. */
#earphone-hint {
  position: absolute;
  top: 25px;
  right: 22px;
  z-index: 7;
  /* Denser than the button glass: it covers Export and must hide it. */
  background-color: rgb(12 16 22 / 0.74);
  width: 148px;
  padding: 12px 12px 10px;
  border-radius: 16px;
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  animation: earphone-hint-in 0.42s ease-out;
}
@keyframes earphone-hint-in {
  from { opacity: 0; transform: translateY(-6px); }
}
#earphone-hint.leaving {
  animation: earphone-hint-out 0.3s ease-in forwards;
}
@keyframes earphone-hint-out {
  to { opacity: 0; transform: translateY(-6px); }
}
.earphone-hint-stage {
  height: 72px;
}
.earphone-hint-art {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  background: url("assets/icons/headphones-spin.webp") 0 0 / 2592px 72px no-repeat;
  animation: earphone-hint-spin 3s steps(36) infinite;
}
@keyframes earphone-hint-spin {
  to { background-position: -2592px 0; }
}
.earphone-hint-text {
  margin: 16px 0 0;
  color: var(--secondary);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-text);
  line-height: 1.3;
}
.canvas-panel.canvas-ui-light #earphone-hint {
  background-color: rgb(255 255 255 / 0.56);
}
.canvas-panel.canvas-ui-light .earphone-hint-text {
  color: var(--light-secondary);
}
/* Phone: a centred modal over a scrim (opened from the ASMR tab). */
#earphone-hint.earphone-hint-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 180px;
  height: fit-content;
  padding: 18px 16px 14px;
  border-radius: 20px;
  pointer-events: auto;
}
#earphone-hint.earphone-hint-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .earphone-hint-art { animation: none; }
}

/* Sky details (sky-details.js): the status button's card. Desktop: grown out of the status,
   its header on the status, on hover or pinned by a click. Phone (≤700px), or a canvas too
   short to show it whole: a centred modal over a 50% scrim, like the hint. */
/* Opened by touch, focus rests on the card itself (sky-details.js); it is not a control, so no
   ring. Its header keeps the --focus ring for keyboard users. */
#sky-details:focus,
#sky-details[data-tapped] .sky-details-head:focus-visible {
  outline: none;
}
#sky-details {
  position: absolute;
  top: -16px;
  left: -16px;
  right: auto;
  z-index: 7;
  width: 300px;
  margin: 0;
  padding: 12px;
  border-radius: 22px;
  /* The liquid glass of the Export menu: the same frost, rim and blur over the sky. */
  color: var(--menu-text-primary);
  background: var(--menu-frost-bg);
  border: 0.5px solid var(--menu-frost-border);
  box-shadow:
    inset 0 0.75px 0.5px var(--menu-frost-rim),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.09),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: var(--menu-frost-filter);
  backdrop-filter: var(--menu-frost-filter);
  isolation: isolate;
  pointer-events: auto;
  /* Grows out of the status like the toast's liquid-glass entrance, milder: it stretches a
     touch past full size, settles back, and its header stays anchored on the status. */
  transform-origin: 16px 16px;
  animation: sky-details-in 420ms ease-out;
}
@keyframes sky-details-in {
  0% { opacity: 0; transform: scale(0.86, 0.72); }
  40% { opacity: 1; transform: scale(1.02, 1.03); }
  65% { transform: scale(0.995, 0.99); }
  85% { transform: scale(1.002, 1.003); }
  100% { opacity: 1; transform: scale(1); }
}
#sky-details:modal {
  transform-origin: 50% 0;
  position: fixed;
  inset: 0;
  width: min(320px, calc(100vw - 32px));
  height: fit-content;
  margin: auto;
}
#sky-details::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.sky-details-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sky-status-gap);
  width: 100%;
  margin: 0;
  padding: 4px 4px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}
.sky-details-head:hover {
  background: none;
}
.sky-details-head:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
}
.sky-details-head-detail {
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.8;
}
.sky-details-tile {
  min-width: 0;
  padding: 12px;
  border: 0.5px solid var(--menu-control-border);
  border-radius: 14px;
  background: var(--menu-control-bg);
}
/* Air quality: the dial on the left, the band name and note beside it. */
.sky-details-reading {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sky-details-reading-text {
  min-width: 0;
}
.sky-details-reading-text .sky-details-note {
  margin-top: 4px;
}
.sky-details-gauge {
  display: block;
  flex: 0 0 auto;
  /* The 100 × 56 drawing at 0.8 scale: 80 × 44.8px. */
  width: 80px;
  height: 44.8px;
  overflow: visible;
  /* No inherited icon stroke: only the sweep's own arcs (their stroke attributes) draw. */
  stroke: none;
}
.sky-details-gauge path {
  fill: none;
  stroke-width: 7;
}
.sky-details-gauge-dot {
  fill: #fff;
  stroke: rgb(12 16 22);
  stroke-width: 2;
}
.sky-details-gauge-value {
  fill: var(--menu-text-primary);
  stroke: none;
  /* In drawing units: 0.8 scale renders it at 18px, the Sun tile's time size. */
  font-size: calc(var(--text-heading) / 0.8);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.sky-details-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--control-grid-gap);
  margin-top: var(--control-grid-gap);
}
.sky-details-label {
  margin: 0 0 8px;
  color: var(--menu-text-muted);
  font-size: var(--text-meta);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  line-height: 1.25;
  text-transform: uppercase;
}
.sky-details-tile p {
  margin: 0;
}
.sky-details-band {
  min-width: 0;
  color: var(--menu-text-primary);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.25;
}
.sky-details-time {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
/* The health note reads like the tiles' footer lines (Moonrise, Sunrise): 10px, muted. */
.sky-details-note {
  color: var(--menu-text-muted);
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.sky-details-tile .sky-details-foot {
  margin-top: 8px;
  /* The Moon's footer is two lines, "Lit: 3%" then "Moonrise: 07:51". */
  white-space: pre-line;
  color: var(--menu-text-muted);
  font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
}
/* The Sun tile's day curve runs edge to edge across the tile (out through its 12px padding). */
.sky-details-sunpath {
  display: block;
  width: calc(100% + 24px);
  height: auto;
  margin: 8px -12px 0;
  overflow: visible;
  fill: none;
  stroke: none;
}
.sky-details-sunpath-day {
  stroke: rgb(255 255 255 / 0.5);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.sky-details-sunpath-night {
  stroke: rgb(0 0 0 / 0.28);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.sky-details-horizon {
  stroke: rgb(255 255 255 / 0.6);
  stroke-width: 0.75;
}
.sky-details-sun {
  fill: rgb(18 24 30 / 0.9);
  stroke: rgb(255 255 255 / 0.85);
  stroke-width: 1;
}
.sky-details-moon {
  display: block;
  width: 54px;
  height: 54px;
  /* 16px above and below (they collapse with the label's and footer's 8px). */
  margin: 16px 0;
  /* The global icon stroke (1.6) would cover this 2-unit viewBox. */
  stroke: none;
}
.sky-details-moon-dark { fill: rgb(255 255 255 / 0.12); }
.sky-details-moon-shadow { opacity: 0.16; }
.sky-details-moon-lit { fill: rgb(255 255 255 / 0.86); }
/* Bright skies (daylight chrome, or a pale sky behind the status): the frost turns pale and
   every text role takes the light-UI ink, as the record HUD does. Light text on a pale frost
   all but vanished. */
.canvas-panel:is(.canvas-ui-light, .sky-status-dark) #sky-details {
  --ink: var(--light-ink);
  --secondary: var(--light-secondary);
  --muted: var(--light-muted);
  --subtext: var(--light-subtext);
  --menu-text-primary: var(--ink);
  --menu-text-secondary: var(--secondary);
  --menu-text-muted: var(--muted);
  --menu-control-bg: rgba(255, 255, 255, 0.42);
  --menu-control-border: rgba(14, 22, 28, 0.1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.36) 45%, rgba(255, 255, 255, 0.5) 100%),
    rgba(236, 242, 246, 0.5);
  border-color: rgba(14, 22, 28, 0.1);
  box-shadow:
    0 4px 14px rgba(12, 20, 28, 0.07),
    inset 0 0.75px 0.5px rgba(255, 255, 255, 0.8),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.4);
}
.canvas-panel:is(.canvas-ui-light, .sky-status-dark) #sky-details .sky-details-sunpath-day {
  stroke: rgba(18, 28, 34, 0.42);
}
.canvas-panel:is(.canvas-ui-light, .sky-status-dark) #sky-details .sky-details-sunpath-night {
  stroke: rgba(18, 28, 34, 0.16);
}
.canvas-panel:is(.canvas-ui-light, .sky-status-dark) #sky-details .sky-details-horizon {
  stroke: rgba(18, 28, 34, 0.4);
}
.canvas-panel:is(.canvas-ui-light, .sky-status-dark) #sky-details .sky-details-sun {
  fill: #fff;
  stroke: rgba(18, 28, 34, 0.7);
}
@media (prefers-reduced-motion: reduce) {
  #sky-details { animation: none; }
}

/* Without JavaScript the studio never starts: this covers the empty page with what it is and
   links to the topic pages (index.html <noscript>). */
.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: auto;
  padding: 32px 16px;
  background: #000;
  color: var(--secondary);
  font-size: var(--text-body);
  line-height: 1.45;
}
.noscript > * { max-width: 640px; margin: 0 auto 16px; }
.noscript h1 { color: var(--ink); font-size: var(--text-title); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-heading); }
.noscript a { color: var(--accent); }

/* HDR highlights (hdr-highlights.js): a display-only copy of the sky over its canvas, with the
   Moon, bright stars and lightning past paper white. Never takes a tap; hidden where unused. */
.hdr-highlights {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hdr-highlights[hidden] { display: none; }

/* Star twinkle (star-twinkle.js): a few low bright stars, each a tiny copy of its own pixels
   whose opacity the browser animates. Never takes a tap; hidden where unused. */
.star-twinkle {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.star-twinkle[hidden] { display: none; }
.star-twinkle > * {
  position: absolute;
  opacity: 0;
}
.star-twinkle-up { mix-blend-mode: plus-lighter; }
