/* MSO Ai look for Info Monitor (/info/): the same dark night background with drifting aurora and
   bright floating cards as https://www.yahahospital.com/mso. Loaded last, so it only re-skins:
   layout, data colours (bands, bars, rulers) and behaviour stay as they are. */
:root {
  --mso-night: #0b0620;
  --mso-night-2: #160a3a;
  --mso-ink: #1e0b47;
  --mso-violet: #6d28d9;
  --mso-lilac: #c4b5fd;
  --mso-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mso-card-bg: linear-gradient(165deg, #fff 0%, #f8f4ff 100%);
  --mso-card-shadow: 0 50px 90px -40px rgb(0 0 0 / 85%), 0 0 0 1px rgb(196 181 253 / 18%), 0 0 60px -20px rgb(139 92 246 / 35%);
  --mso-bar: rgb(11 6 32 / 92%);
  --mso-bar-line: rgb(196 181 253 / 14%);
  color-scheme: dark;
}

/* ---- background: night gradient, drifting aurora, soft vignette ---- */
html:root {
  background-color: var(--mso-night);
  background-image: radial-gradient(120% 90% at 70% 30%, var(--mso-night-2) 0%, var(--mso-night) 62%);
  background-size: auto; background-position: center; background-repeat: no-repeat; background-attachment: fixed;
}
html:root body { background: transparent; }
body::before, body::after {
  content: ""; position: fixed; z-index: -2; pointer-events: none;
}
/* Two aurora blobs drift slowly (transform only). */
body::before {
  width: 62vmax; height: 62vmax; left: -14vmax; top: -18vmax;
  background: radial-gradient(circle, rgb(91 33 182 / 55%), transparent 64%);
  animation: mso-drift 26s ease-in-out infinite alternate;
}
body::after {
  width: 56vmax; height: 56vmax; right: -16vmax; bottom: -20vmax;
  background: radial-gradient(circle, rgb(162 28 175 / 32%), transparent 64%);
  animation: mso-drift 34s ease-in-out -12s infinite alternate-reverse;
}
@keyframes mso-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6%, -4%, 0) scale(1.08); }
  100% { transform: translate3d(-5%, 5%, 0) scale(0.96); }
}

/* ---- YahaLinks portal header: dark glass like the MSO app bar ---- */
.portal-header {
  background-color: var(--mso-bar); background-image: none;
  border-bottom-color: var(--mso-bar-line); box-shadow: none; color: #fff;
}
.portal-header .portal-brand { color: #fff; }
.portal-header .portal-brand-mark, .portal-header .portal-brand-word > span { color: var(--mso-lilac); }
.portal-header .portal-navigation a { color: #ddd6fe; }
.portal-header .portal-navigation a:hover { color: #fff; }
.portal-header .portal-navigation a[aria-current="page"] { color: #fff; border-bottom-color: var(--mso-lilac); }
.portal-header :focus-visible { outline-color: var(--mso-lilac); }

/* ---- Info Monitor bar: same dark glass, light controls ---- */
.topbar { background: var(--mso-bar); border-color: var(--mso-bar-line); }
.topbar .brand { color: #fff; }
.topbar .brand > svg { color: var(--mso-lilac); }
.topbar .brand small { color: #b8acf0; }
.topics a { color: #cfc7f5; }
.topics a:hover { color: #fff; }
.topics a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / 12%); border-color: var(--mso-lilac); }
.topbar .topic-count { background: rgb(255 255 255 / 10%); color: #ddd6fe; }
.provinces { border-color: rgb(255 255 255 / 22%); border-radius: 999px; }
.provinces a { color: #cfc7f5; }
.provinces a:hover { color: #fff; background: rgb(255 255 255 / 9%); }
.provinces a[aria-current="page"] { background: #ede9fe; color: #2b145a; border-color: transparent; }
#refresh-button { border-radius: 999px; }
.topbar #refresh-button { color: #ddd6fe; background: transparent; border-color: rgb(255 255 255 / 22%); }
.topbar #refresh-button:hover { color: #fff; background: rgb(255 255 255 / 9%); border-color: rgb(255 255 255 / 40%); }
.topbar :focus-visible { outline-color: var(--mso-lilac); }

/* ---- page heading on the dark background ---- */
.page-head h1 { color: #fff; letter-spacing: -0.02em; }
.page-head h1 span, .page-head .description, .page-head p { color: #cfc7f5; }

/* ---- bright floating cards ---- */
.watch-panel, .chart, .ledger-group, .system-banner, .view-dam .dam-row {
  border-color: rgb(255 255 255 / 70%);
  box-shadow: var(--mso-card-shadow);
}
.watch-panel, .chart, .view-dam .dam-row { background: var(--mso-card-bg); }
.watch-panel, .chart, .ledger-group { border-radius: 22px; }
.ledger-group { overflow: clip; }
.group-head { background: linear-gradient(135deg, #f5f0ff 0%, #fbf3ff 100%); }
/* Reservoirs are cards of their own, so their group is only a heading strip, not a frame. */
.view-dam .ledger-group { border-color: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
.view-dam .group-head { border: 1px solid rgb(255 255 255 / 70%); border-radius: 14px; margin-bottom: 12px; }
.view-dam .dam-row { border-radius: 20px; }
/* The sticky tool and scale bars become light strips that read as part of the cards. */
.toolbar { background: #f7f3ff; border: 1px solid rgb(255 255 255 / 70%); border-radius: 18px; padding-inline: 12px; margin-bottom: 10px; box-shadow: 0 18px 40px -24px rgb(0 0 0 / 80%); }
.scale-head { background: #f3eeff; border: 1px solid rgb(255 255 255 / 70%); border-radius: 14px; margin-bottom: 10px; color: #533e85; }

/* ---- entrance: blocks slide up in a short cascade (movement only, never faded) ---- */
@keyframes mso-slide { from { transform: translate3d(0, 22px, 0); } to { transform: none; } }
.page-head, .watch-panel, .chart-panel, .ledger-group, .toolbar, .system-banner { animation: mso-slide 0.8s var(--mso-ease) both; }
.watch-panel, .toolbar { animation-delay: 90ms; }
.chart-panel { animation-delay: 180ms; }
.ledger-group { animation-delay: 260ms; }

/* ---- mobile bottom navigation: dark glass ---- */
.mobile-nav { background: var(--mso-bar); border-color: var(--mso-bar-line); }
.mobile-nav a { color: #cfc7f5; }
.mobile-nav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / 10%); border-color: var(--mso-lilac); }
.mobile-nav :focus-visible { outline-color: var(--mso-lilac); }
.mobile-refresh #refresh-button { color: #ddd6fe; background: rgb(255 255 255 / 6%); border-color: rgb(255 255 255 / 22%); }

/* Skip link and focus outlines stay visible on the dark background. */
.skip-link { background: #ede9fe; color: #2b145a; }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .page-head, .watch-panel, .chart-panel, .ledger-group, .toolbar, .system-banner { animation: none; }
}
@media (forced-colors: active) {
  html:root { background-image: none; }
  body::before, body::after { display: none; }
  .portal-header, .topbar, .mobile-nav { background: Canvas; }
}

/* ---- speed: station groups below the screen are not laid out or painted until scrolled near ---- */
.ledger-group { content-visibility: auto; contain-intrinsic-size: auto 640px; }
/* Reservoir cards carry their own shadows, which containment would clip. */
.view-dam .ledger-group { content-visibility: visible; }
