/* Content sits on a stable surface; the floating controls carry the glass material. */
:root {
  --background: #09141d; --surface: #11232d; --ink: #f5f8f5;
  --muted: #b9cacd; --faint: #a2b6bb; --accent: #97e6d5;
  --control-border: #819da242; --glass-edge: #c5f4ed52;
  --selection: #7bd5c51c; --chrome-active: #366059;
  --chrome-fill: linear-gradient(150deg,#354951,#1c303b 55%,#293f47);
  --chrome-shadow: inset 0 1px 1px #ffffff5c,inset 0 -1px 1px #92c4ca36,0 8px 25px -14px #0009;
  --chrome-filter: none;
  --glass-top: #bddbdc20; --glass-bottom: #769aa00e;
  --nebula-one: #236f70; --nebula-two: #27577b; --halo: #142f3a;
  --panel-pad: clamp(16px, 2.6vw, 32px);
}
:root[data-theme="light"] {
  --background: #cdd8d6; --surface: #d2dbd9; --ink: #172f34;
  --muted: #384e52; --faint: #40595c; --accent: #005c52;
  --control-border: #365c613e; --glass-edge: #d3dfda9c;
  --selection: #355f5916; --chrome-active: #a8c0b9;
  --chrome-fill: linear-gradient(150deg,#d0d9d5,#bdcdca 70%,#b8c9c7);
  --chrome-shadow: inset 0 1px 1px #eff4ec6b,inset 0 -1px 1px #48666a45,0 8px 24px -14px #142f36a1;
  --glass-top: #d3dcd5b8; --glass-bottom: #aabcb8c7;
  --nebula-one: #75c1ad; --nebula-two: #9cbbcb; --halo: #cbdfd9;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (prefers-reduced-transparency: no-preference) {
    :root {
      --chrome-fill: linear-gradient(155deg,#799a9a65,#182e38bb 54%,#42616a99);
      --chrome-filter: blur(18px) saturate(145%);
    }
    :root[data-theme="light"] {
      --chrome-fill: linear-gradient(150deg,#d0d9d5f5,#bdcdcaf5 70%,#b8c9c7f5);
    }
  }
}
@media (prefers-contrast: more) {
  :root, :root[data-theme="light"] {
    --chrome-fill: var(--background); --chrome-filter: none;
    --glass-edge: var(--ink); --control-border: var(--muted); --chrome-shadow: none;
  }
}
.theme-switch, .globe-controls, .app-navigation, #open-explorer, #market-panel[data-visible="false"] .market-toggle {
  background: var(--chrome-fill); border: 1px solid var(--glass-edge);
  box-shadow: var(--chrome-shadow);
  -webkit-backdrop-filter: var(--chrome-filter); backdrop-filter: var(--chrome-filter);
}
.theme-switch, .theme-button { border-radius: 999px; }
.theme-switch { gap: 0; padding: 3px; }
.theme-button.is-active { background: var(--chrome-active); color: var(--ink); }
body > .header {
  width: min(100%, 1250px); margin-inline: auto;
  padding: max(12px,env(safe-area-inset-top)) var(--viewport-gutter) 0;
}
.sky .nebula-one { left: 20%; top: -26%; opacity: .4; }
.sky .nebula-two { opacity: .36; }
.sky canvas { opacity: .5; }
html, body, .sky { background-color: #09141d; }
.sky { --background: #09141d; --nebula-one: #236f70; --nebula-two: #27577b; --halo: #142f3a; }
.sky-window { color: #f5f8f5; }
.sky-window .dial { color: inherit; }
.weather-sky {
  position: absolute; inset: 0 0 auto; height: clamp(105px,23vh,235px); overflow: hidden;
  pointer-events: none; mask-image: linear-gradient(#000 35%,transparent);
}
.weather-sky:not([data-condition]), .weather-sky[data-condition=""] { display: none; }
.weather-sky[data-period="day"] { background: radial-gradient(ellipse at 22% 2%,#a6c6c048,transparent 65%); }
.weather-sky[data-period="night"] { background: radial-gradient(ellipse at 22% 2%,#758cc333,transparent 64%); }
.weather-sky[data-condition="cloudy"] { background: linear-gradient(165deg,#66768780,#32485766 60%,transparent); }
.weather-sky:is([data-condition="rain"],[data-condition="drizzle"],[data-condition="storm"]) { background: linear-gradient(165deg,#354459b0,#293d4a80 68%,transparent); }
.weather-sky[data-period="night"][data-condition="clear"] {
  background: radial-gradient(ellipse at 19% 32%,#827fa536,transparent 28%),linear-gradient(168deg,#141426eb,#252c5480 56%,transparent);
}
.weather-sky[data-period="night"][data-condition="clear"]::before {
  content: ''; position: absolute; inset: 0; opacity: .68;
  background: radial-gradient(1px 1px at 13% 22%,#e5e0ff,transparent),radial-gradient(1.5px 1.5px at 63% 68%,#bdbddd,transparent),radial-gradient(1px 1px at 82% 35%,#d4d9f6,transparent);
  background-size: 176px 93px,239px 117px,313px 103px;
}
.weather-orb {
  display: none; position: absolute; top: 30%; left: clamp(26px,17%,290px); width: clamp(27px,4vw,50px); aspect-ratio: 1; border-radius: 50%;
}
.weather-sky:is([data-condition="clear"],[data-condition="partly"])[data-period="day"] .weather-orb {
  display: block; width: clamp(24px,2.6vw,36px);
  background: radial-gradient(circle,#fff5c1 27%,#ffcf57 72%,#ffad3e);
  box-shadow: 0 0 14px 4px #ffc34d86,0 0 50px 18px #ffa62940;
}
.weather-sky[data-period="day"] .weather-orb::before {
  content: ''; position: absolute; inset: -48%; border-radius: 50%;
  background: repeating-conic-gradient(from -3deg,#ffce68 0deg 6deg,transparent 6deg 45deg);
  mask-image: radial-gradient(circle,transparent 41%,#000 43% 58%,transparent 62%);
}
.weather-sky:is([data-condition="clear"],[data-condition="partly"])[data-period="night"] .weather-orb {
  display: block;
  background: radial-gradient(ellipse at 32% 38%,#a3a8b7 1%,transparent 19%),radial-gradient(ellipse at 56% 66%,#8f98ab 3%,transparent 19%),radial-gradient(circle at 36% 34%,#e1e1e9,#bfc1d1 53%,#677085 96%);
  box-shadow: 0 0 15px 3px #bcc9ef36;
}
.weather-clouds, .weather-precip { display: none; position: absolute; inset: 0 -4%; }
.weather-sky:not([data-condition="clear"]) .weather-clouds {
  display: block; background: url("./data/header-clouds.webp") center top / max(100%,660px) auto no-repeat; opacity: .73;
}
.weather-sky[data-condition="partly"] .weather-clouds { opacity: .44; mask: linear-gradient(105deg,transparent 7%,#000 47%); }
.weather-sky[data-condition="fog"] .weather-clouds { filter: blur(11px); opacity: .65; }
.weather-sky[data-period="night"] .weather-clouds { filter: brightness(.67); }
.weather-sky[data-condition="storm"] .weather-clouds { filter: brightness(.53); }
.weather-sky[data-condition="drizzle"] .weather-clouds { opacity: .61; }
.weather-sky:is([data-condition="rain"],[data-condition="drizzle"],[data-condition="storm"]) .weather-precip {
  display: block; opacity: .36;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='101' height='72' viewBox='0 0 101 72'%3E%3Cpath d='m8 12-2 6m34 28-2 7m35-46-2 8m23 36-2 6' stroke='%23b6d8e3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.weather-sky[data-condition="drizzle"] .weather-precip { opacity: .19; background-size: 144px 72px; }
.weather-sky[data-condition="snow"] .weather-precip {
  display: block; opacity: .66;
  background: radial-gradient(circle at 12px 15px,#e2edf2 1.4px,transparent 2px),radial-gradient(circle at 54px 45px,#cbdbe2 1px,transparent 2px);
  background-size: 103px 72px;
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-sky-motion="moving"] .weather-clouds { animation: weather-drift 44s ease-in-out infinite alternate; }
  :root[data-sky-motion="moving"] .weather-precip { top: -72px; animation: weather-fall 1.35s linear infinite; }
  :root[data-sky-motion="moving"] [data-condition="snow"] .weather-precip { animation-duration: 5s; }
}
@keyframes weather-drift { from { transform: translateX(-1.2%); } to { transform: translateX(1.2%); } }
@keyframes weather-fall { to { transform: translateY(72px); } }
.brand-satellite { transform: translate(15px,0); }
@property --orbital-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@supports (transform: translateX(calc(15px * cos(0deg)))) {
  .brand-satellite {
    transform: translate(calc(15px * cos(var(--orbital-angle))),calc(5.5px * sin(var(--orbital-angle))));
  }
  @media (prefers-reduced-motion: no-preference) {
    .brand:focus-visible .brand-satellite { animation: logo-orbit 1.6s linear infinite; }
    @media (hover: hover) { .brand:hover .brand-satellite { animation: logo-orbit 1.6s linear infinite; } }
  }
}
@keyframes logo-orbit {
  0% { --orbital-angle: 0deg; }
  68%,83% { opacity: 1; }
  74%,77% { opacity: .12; }
  100% { --orbital-angle: 360deg; }
}
.app-navigation { width: min(520px, 100%); }
.app-navigation > .nav-button { color: var(--muted); }
.app-navigation > .nav-button[aria-current="page"] { color: var(--ink); }
:root[data-tool="clock"] .clock-scene { width: min(100%, 1000px); }
#clock-panel { align-items: stretch; }
.observatory {
  display: grid; justify-items: center; gap: clamp(8px,1.6cqh,16px);
  width: min(100%, 744px); margin-inline: auto; padding-block: clamp(8px, 2cqh, 20px);
  text-align: center;
}
#clock-pill { flex-direction: column; min-height: clamp(100px,22cqh,176px); padding: clamp(8px,1.6cqh,16px) 0 6px; background: var(--chrome-fill); box-shadow: var(--chrome-shadow); }
#clock-pill:has(details[open]) { border-radius: clamp(32px,8vw,80px); }
#clock-pill .glass-reflection { opacity: .23; }
.clock-place {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  color: var(--accent); font-size: .8125rem; letter-spacing: .04em;
}
#country-name { font-weight: 650; }
.clock-place #utc-offset { padding-left: 8px; border-left: 1px solid var(--control-border); color: var(--muted); }
#clock-heading {
  font-size: clamp(1.3rem, 3vw, 2.25rem); line-height: 1.15; font-weight: 530;
  letter-spacing: -.035em; margin: 0; overflow-wrap: anywhere;
}
#clock { width: 100%; justify-content: center; padding-block: 4px 8px; font-variant-numeric: tabular-nums; }
#clock .digits { color: var(--ink); text-shadow: none; letter-spacing: -.045em; }
#clock .unit-label { font-size: .625rem; letter-spacing: .12em; }
#clock .seconds .digits { color: var(--accent); }
#clock-panel .date { color: var(--muted); font-size: clamp(.875rem,1.5vw,1.05rem); line-height: 1.45; }
#open-explorer, #market-panel[data-visible="false"] .market-toggle { min-height: 44px; border-radius: 999px; padding: 8px 16px; margin-top: 0; font-size: .875rem; color: var(--ink); }
.dial {
  position: absolute; right: -3vmin; top: 14%; width: clamp(230px,40vmin,480px);
  aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%;
  color: var(--ink); opacity: .13; pointer-events: none; user-select: none;
}
.dial-ticks {
  position: absolute; inset: 5%; border-radius: 50%;
  background: repeating-conic-gradient(currentColor 0deg .7deg,transparent .7deg 6deg);
  mask: radial-gradient(circle,transparent 65.5%,black 66%);
}
.dial > span { position: absolute; font-size: clamp(.75rem,1.6vw,1.2rem); font-weight: 600; font-variant-numeric: tabular-nums; }
.dial-north,.dial-south { left: 50%; transform: translateX(-50%); }
.dial-north { top: 9%; } .dial-south { bottom: 9%; }
.dial-east,.dial-west { top: 50%; transform: translateY(-50%); }
.dial-east { right: 10%; } .dial-west { left: 10%; }
.hand { position: absolute; left: 50%; bottom: 50%; transform-origin: 50% 100%; background: currentColor; border-radius: 999px; }
.hand-hour { width: 1.5%; height: 23%; transform: translateX(-50%) rotate(var(--hour-angle)); }
.hand-minute { width: 1%; height: 34%; transform: translateX(-50%) rotate(var(--minute-angle)); }
.hand-second { width: max(1.5px,.5%); height: 41%; transform: translateX(-50%) rotate(var(--second-angle)); }
.dial-pin { position: absolute; inset: 49%; border-radius: 50%; background: currentColor; }
#clock-panel .guest-note { order: 2; text-align: center; margin: 10px var(--panel-pad) 0; color: var(--muted); font-size: .75rem; }
#market-panel[data-visible="true"] {
  margin: 8px 0 0; padding: 12px var(--panel-pad) 16px; border: 1px solid var(--control-border);
  border-radius: 22px; background: var(--surface); box-shadow: none;
}
#market-panel > .glass-edge, #market-panel > .glass-reflection { display: none; }
.market-toolbar h2 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.market-motion,.market-toggle { min-height: 44px; font-size: .8125rem; }
.market-exchange,.market-bottom #market-note { font-size: .75rem; color: var(--muted); line-height: 1.45; }

#agenda-panel, #news-panel, #tools-panel {
  padding: var(--panel-pad); border: 1px solid var(--control-border); border-radius: 24px;
  background: var(--surface); box-shadow: none;
}
.agenda-heading h1,.news-heading h1,.spotify-page-title h1,.world-intro h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.5rem); font-weight: 550; line-height: 1.1; letter-spacing: -.045em;
}
.agenda-heading,.news-heading { gap: 12px; flex-wrap: wrap; }
.agenda-layout { gap: clamp(16px,3vw,32px); }
.agenda-country, .news-topics button, .nav-tools-grid > .mode-button {
  border-radius: 16px; font-size: .875rem; min-height: 44px;
}
.agenda-country { padding: 6px 12px; background: var(--selection); }
.agenda-country-action,.agenda-day-count,.news-selects label,.news-feed-heading p,.nav-globe span,.nav-appearance > .text-button { font-size: .75rem; }
.news-description { margin-block: 12px 20px; font-size: .9375rem; line-height: 1.5; }
.news-topics { gap: 6px; margin-bottom: 16px; }
.news-controls { gap: 12px; }
.news-selects { gap: 8px; flex-wrap: wrap; }
.news-selects select { min-height: 40px; font-size: .875rem; }
.news-source-name,.news-card h2,.agenda-list { overflow-wrap: anywhere; }
.news-card { border-radius: 16px; background: var(--surface); }
.news-reading-action {
  display: inline-flex; align-items: center; min-height: 44px; padding: 4px 16px;
  color: var(--accent); font-size: .85rem; text-underline-offset: 3px;
}
#tools-panel { gap: 14px; padding: clamp(14px,2vw,24px); }
.nav-tools-heading h2 { font-size: clamp(1.25rem,2.4vw,1.625rem); font-weight: 550; letter-spacing: -.025em; line-height: 1.2; }
.time-tool-content .alarm-form { gap: 12px; }
.time-tool-content .alarm-form label, .alarm-saved .alarm-list-heading, .alarm-saved .alarm-empty { font-size: .8125rem; }
.time-tool-content .alarm-form-row :is(input,select), .time-tool-content #alarm-zone-query { font-size: 1rem; }
.time-tool-content .alarm-form :is(input:not([type="time"]),select) { min-height: 44px; }
.time-tool-content .alarm-note,.time-tool-content .alarm-preview,.stopwatch-note,.timer-status { font-size: .8125rem; line-height: 1.5; }
.world-shell { width: min(100%,1280px); margin-inline: auto; gap: 8px; }
.world-intro { margin-block: 12px; }
.world-layout { gap: clamp(12px,2.6vw,36px); }
.globe-controls { padding: 3px; border-radius: 20px; }
.location-panel { padding-inline: 3px; }
.location-results { min-height: 7rem; scroll-padding-block: 8px; }
.clock-weather { z-index: 1; max-width: 88%; color: var(--ink); font-size: .875rem; }
.clock-weather summary {
  display: flex; width: fit-content; max-width: 100%; margin-inline: auto; align-items: center;
  justify-content: center; gap: 9px; min-height: 44px; padding: 4px 12px; cursor: pointer; border-radius: 999px;
}
.clock-weather summary::-webkit-details-marker { display: none; }
.clock-weather summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover:hover) { .clock-weather summary:hover { background: var(--selection); } }
.weather-chevron { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.clock-weather[open] .weather-chevron { transform: translateY(1px) rotate(225deg); }
.weather-details { display: grid; justify-items: center; gap: 4px; padding: 4px 8px 12px; }
.weather-actions, .weather-query-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
#weather-search { width: min(100%, 24rem); padding-block: 8px; }
#weather-search label { display: block; margin-bottom: 6px; font-weight: 550; }
#weather-query { flex: 1 1 8rem; min-width: 0; width: 100%; min-height: 44px; padding: 4px 12px; font: inherit; font-size: 1rem; border-radius: 14px; }
#weather-query { background: var(--surface); color: var(--ink); border: 1px solid var(--control-border); }
#weather-query::placeholder { color: var(--muted); }
#weather-query:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#weather-results { display: grid; max-height: 9rem; overflow-y: auto; gap: 4px; margin-top: 6px; }
#weather-results button { border-radius: 12px; overflow-wrap: anywhere; text-align: start; }
.clock-weather { min-width: 0; overflow-wrap: anywhere; }
.weather-details button {
  min-height: 44px; padding: 6px 14px; background: var(--selection); color: var(--accent);
  border: 1px solid var(--control-border); border-radius: 999px; font: inherit; font-size: .85rem;
}
.weather-details button:disabled { opacity: .7; }
.weather-source, #weather-notice, .map-credit { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.weather-source { display: flex; flex-wrap: wrap; gap: 6px; }
#weather-notice { flex-basis: 100%; }
.weather-source a, .map-credit a { color: var(--accent); text-underline-offset: 3px; }
.map-credit { margin: 8px 0 0; }
.map-credit > span { display: block; }
:root[data-theme="light"] :is(.brand,#clock-heading,.world-wordmark,.world-intro h2) { color: #f5f8f5; }
:root[data-theme="light"] :is(.brand-icon,.brand-dot,.clock-place,.world-intro h2 span,.world-eyebrow) { color: #97e6d5; }
:root[data-theme="light"] :is(.clock-place #utc-offset,#clock-panel .date,#clock-panel .guest-note,.world-intro > p:last-child,.globe-instructions,.world-header-label,.globe-current) { color: #c1d1d4; }
:root[data-theme="light"] .world-header-actions .close-button { background: var(--surface); color: var(--ink); }
:root[data-theme="light"] :is(.globe-current strong,#current-location-time) { color: #97e6d5; }
:root[data-theme="light"] .location-panel { padding: 12px; border-radius: 18px; background: var(--surface); }
#alexa-dialog,#agenda-editor,#alarm-alert { background: var(--surface); color: var(--ink); border: 1px solid var(--control-border); border-radius: 24px; padding: var(--panel-pad); }
#alexa-dialog :is(p,li,label),#agenda-editor label { font-size: .875rem; line-height: 1.55; }
@media (min-width: 960px) and (min-height: 500px) {
  body > .header { min-height: 84px; }
  body > .footer { position: absolute; top: max(12px,env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 4; min-height: 0; padding: 0; }
  .app-navigation { width: auto; gap: 3px; }
  .app-navigation > .nav-button { flex: none; flex-direction: row; gap: 6px; min-width: 62px; padding-inline: 11px; }
  .app-navigation > .nav-button > .nav-label { font-size: .8125rem; }
}
@media (max-width: 600px) {
  :root { --panel-pad: 16px; }
  .weather-orb { left: 45%; }
  .dial { top: 8%; right: -9%; width: clamp(205px,58vw,290px); }
  #clock .digits { font-size: clamp(2.35rem,12vw,4rem); }
  #clock-panel .guest-note { margin-inline: 6px; }
  .news-topics button { flex: 1 1 auto; padding: 6px 10px; }
  .news-controls,.agenda-layout { gap: 14px; }
  .nav-tools-grid > .mode-button { font-size: .8125rem; }
  .world-shell { gap: 4px; }
}
@media (max-height: 540px) {
  #tools-panel { gap: 6px; padding: 10px; }
  .nav-tools-heading h2 { font-size: 1.25rem; }
  .world-intro { margin-block: 4px; }
  .observatory { padding-block: 8px; }
  #clock-pill { max-width: 540px; }
  #clock .digits { font-size: clamp(34px,12cqh,54px); }
  #clock { gap: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open]:not(.world-dialog) { animation: sheet-arrive 180ms cubic-bezier(.2,.8,.2,1); }
  .app-navigation > .nav-button:active, .theme-button:active { scale: .96; }
  .app-navigation > .nav-button,.theme-button { transition: scale 120ms ease-out, background-color 120ms ease-out; }
}
@keyframes sheet-arrive { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

/* Keep the hit rectangle still. Only the material and the artwork answer the pointer. */
@media (hover: hover) and (pointer: fine) {
  :is(button,[role="button"],input[type="submit"],.news-reading-action):not(:disabled,[aria-disabled="true"],:focus-visible):hover {
    outline: 1px solid color-mix(in srgb, currentColor 42%, transparent);
    outline-offset: -2px;
  }
  :is(button,[role="button"],input[type="submit"],.news-reading-action):focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
  }
  @media (prefers-reduced-motion: no-preference) {
    :is(button,[role="button"],input[type="submit"],.news-reading-action):not(:disabled,[aria-disabled="true"]) {
      outline-color: transparent;
      transition: outline-color 140ms ease-out, filter 140ms ease-out, background-color 140ms ease-out, color 140ms ease-out;
    }
    :is(button,[role="button"],input[type="submit"],.news-reading-action):focus-visible:not(:disabled,[aria-disabled="true"]) { outline-color: var(--accent); }
    :is(button,[role="button"],input[type="submit"],.news-reading-action):not(:disabled,[aria-disabled="true"]):hover {
      filter: brightness(1.09);
    }
    :where(button,[role="button"]) > :is(svg,img) { transition: translate 150ms ease-out; }
    :where(button,[role="button"]):not(:disabled,[aria-disabled="true"]):hover > :is(svg,img) { translate: 0 -1px; }
  }
}
