/* ==========================================================================
   FIBC Lanka Hub — "Liquid Glass" design system
   After Apple's current design language and Human Interface Guidelines:
   - Translucent glass surfaces with a specular rim, floating over an
     ambient, slowly moving light field that takes colour from the artwork
     of the song playing (like Apple Music's ambient mode).
   - Floating capsule navigation, a lock-screen clock and apple.com-style
     statement headlines.
   - System colours with Light / Dark / Auto appearance, the SF type ramp
     (Inter as the stand-in where SF isn't installed), 8-pt grid, 44-pt
     targets, continuous corners, spring motion.
   - Honours Reduce Motion, Reduce Transparency and Increase Contrast.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* System colours (light) — apple.com / iOS light palette */
  --blue: #0071e3;
  --green: #34c759;
  --indigo: #5856d6;
  --orange: #ff9500;
  --pink: #ff2d55;
  --purple: #af52de;
  --red: #ff3b30;
  --teal: #30b0c7;

  --page: #f5f5f7;
  --label: #1d1d1f;
  --label-2: rgba(29, 29, 31, 0.58);
  --label-3: rgba(29, 29, 31, 0.32);
  --fill: rgba(0, 0, 0, 0.1);
  --fill-2: rgba(0, 0, 0, 0.07);
  --fill-3: rgba(0, 0, 0, 0.05);
  --fill-4: rgba(0, 0, 0, 0.03);
  --separator: rgba(0, 0, 0, 0.08);

  /* Liquid glass (light): bright, clean frosted white */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-edge: rgba(255, 255, 255, 1);
  --glass-edge-soft: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px -12px rgba(0, 0, 0, 0.12);
  --glass-blur: blur(28px) saturate(180%);
  --float-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.05);

  /* Ambient light field (light): cool, airy pastels */
  --orb-1: #cfe2ff;
  --orb-2: #ddd9ff;
  --orb-3: #d3f0f5;
  --orb-opacity: 0.9;
  --art-opacity: 0.06;

  --tint: var(--blue);
  --bubble-mine: linear-gradient(180deg, #1a8cff, #0071e3);
  --surface-solid: #ffffff;
  --gradient-ai: linear-gradient(100deg, #0071e3 0%, #4f5bff 50%, #8e4dff 100%);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans Sinhala", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans Sinhala", system-ui, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;

  /* Geometry */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --r-card: 26px;
  --r-row: 14px;
  --hit: 44px;

  /* Motion */
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121 24.3%, 1.139 27.3%, 1.13 30.7%, 1.083 37.1%, 1.012 45.2%, 0.985 52.6%, 0.988 64.4%, 1.001 76.8%, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 340ms;

  font-family: var(--font);
  font-size: 17px;
  line-height: 1.29;
  font-feature-settings: "cv11", "ss01";
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Appearance: Auto follows the system; Light/Dark are forced with
   <html data-appearance> (see app.js). */
:root[data-appearance="light"] {
  color-scheme: light;
}

:root[data-appearance="dark"] {
  color-scheme: dark;
  --blue: #2997ff;
  --green: #30d158;
  --indigo: #5e5ce6;
  --orange: #ff9f0a;
  --pink: #ff375f;
  --purple: #bf5af2;
  --red: #ff453a;
  --teal: #40c8e0;
  --page: #000000;
  --label: #f5f5f7;
  --label-2: rgba(245, 245, 247, 0.6);
  --label-3: rgba(245, 245, 247, 0.3);
  --fill: rgba(255, 255, 255, 0.16);
  --fill-2: rgba(255, 255, 255, 0.11);
  --fill-3: rgba(255, 255, 255, 0.08);
  --fill-4: rgba(255, 255, 255, 0.05);
  --separator: rgba(255, 255, 255, 0.09);
  --glass: rgba(28, 28, 30, 0.6);
  --glass-strong: rgba(32, 32, 35, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --glass-edge-soft: rgba(255, 255, 255, 0.03);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -14px rgba(0, 0, 0, 0.8);
  --float-shadow: 0 30px 80px -16px rgba(0, 0, 0, 0.85), 0 2px 10px rgba(0, 0, 0, 0.5);
  --orb-1: #0b3b8c;
  --orb-2: #23206b;
  --orb-3: #083f4d;
  --orb-opacity: 0.55;
  --art-opacity: 0.1;
  --bubble-mine: linear-gradient(180deg, #3aa0ff, #0a84ff);
  --surface-solid: #1c1c1e;
  --gradient-ai: linear-gradient(100deg, #2997ff 0%, #6e6cff 50%, #b36bff 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) {
    color-scheme: dark;
    --blue: #2997ff;
    --green: #30d158;
    --indigo: #5e5ce6;
    --orange: #ff9f0a;
    --pink: #ff375f;
    --purple: #bf5af2;
    --red: #ff453a;
    --teal: #40c8e0;
    --page: #000000;
    --label: #f5f5f7;
    --label-2: rgba(245, 245, 247, 0.6);
    --label-3: rgba(245, 245, 247, 0.3);
    --fill: rgba(255, 255, 255, 0.16);
    --fill-2: rgba(255, 255, 255, 0.11);
    --fill-3: rgba(255, 255, 255, 0.08);
    --fill-4: rgba(255, 255, 255, 0.05);
    --separator: rgba(255, 255, 255, 0.09);
    --glass: rgba(28, 28, 30, 0.6);
    --glass-strong: rgba(32, 32, 35, 0.86);
    --glass-edge: rgba(255, 255, 255, 0.22);
    --glass-edge-soft: rgba(255, 255, 255, 0.03);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -14px rgba(0, 0, 0, 0.8);
    --float-shadow: 0 30px 80px -16px rgba(0, 0, 0, 0.85), 0 2px 10px rgba(0, 0, 0, 0.5);
    --orb-1: #0b3b8c;
    --orb-2: #23206b;
    --orb-3: #083f4d;
    --orb-opacity: 0.55;
    --art-opacity: 0.1;
    --bubble-mine: linear-gradient(180deg, #3aa0ff, #0a84ff);
    --surface-solid: #1c1c1e;
    --gradient-ai: linear-gradient(100deg, #2997ff 0%, #6e6cff 50%, #b36bff 100%);
  }
}

/* ---- Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--label);
  /* Transparent so the fixed ambient layer (z-index -1) shows through;
     the page colour comes from <html>. */
  background: transparent;
  overflow-x: hidden;
}

h1, h2, h3, p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

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

button:disabled {
  cursor: default;
  opacity: 0.4;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--tint);
}

::selection {
  background: color-mix(in srgb, var(--tint) 30%, transparent);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 60%, transparent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.lucide {
  width: 20px;
  height: 20px;
  flex: none;
  stroke-width: 1.8;
}

/* Letter-spacing follows SF Pro's tracking table for non-Apple fonts; on
   Apple platforms the system font tracks itself, so it is switched off. */
@supports (font: -apple-system-body) {
  *:not(.eyebrow):not(.info-kicker):not(.news-item span):not(.lock-time):not(.hero-title) {
    letter-spacing: normal !important;
  }
}

/* ---- Ambient light field -------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  opacity: var(--orb-opacity);
  filter: blur(60px);
  will-change: transform;
}

.orb-1 { top: -26vmax; left: -18vmax; background: radial-gradient(circle, var(--orb-1), transparent 66%); animation: drift-1 34s ease-in-out infinite alternate; }
.orb-2 { top: -10vmax; right: -24vmax; background: radial-gradient(circle, var(--orb-2), transparent 66%); animation: drift-2 40s ease-in-out infinite alternate; }
.orb-3 { bottom: -34vmax; left: 18vw; background: radial-gradient(circle, var(--orb-3), transparent 66%); animation: drift-3 46s ease-in-out infinite alternate; }

@keyframes drift-1 { to { transform: translate3d(14vw, 10vh, 0) scale(1.15); } }
@keyframes drift-2 { to { transform: translate3d(-12vw, 16vh, 0) scale(0.9); } }
@keyframes drift-3 { to { transform: translate3d(10vw, -14vh, 0) scale(1.1); } }

/* Artwork of the current song, blown up and blurred into light */
.ambient-art {
  position: absolute;
  inset: -20%;
  background: var(--now-art, none) center / cover no-repeat;
  filter: blur(110px) saturate(1.8);
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.2s var(--ease-out);
}

.has-art .ambient-art {
  opacity: var(--art-opacity);
}

/* A whisper of grain keeps large gradients from banding */
.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ---- Liquid glass ---------------------------------------------------------- */

.glass,
.topbar,
.dialog-body,
.toast,
.vote-banner {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}

/* Specular rim: bright where light hits the top-left edge, fading around */
.glass::before,
.topbar::before,
.dialog-body::before,
.toast::before,
.vote-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  corner-shape: inherit;
  background: linear-gradient(150deg, var(--glass-edge) 0%, var(--glass-edge-soft) 32%, transparent 55%, var(--glass-edge-soft) 80%, var(--glass-edge) 100%);
  -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;
}

/* Soft inner light from above, as on a curved glass surface */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  corner-shape: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 38%);
  pointer-events: none;
}

/* ---- Navigation capsule ------------------------------------------------------ */

.topbar {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  width: min(1200px, calc(100% - 24px));
  height: 58px;
  padding: 0 var(--s2) 0 var(--s5);
  border-radius: 999px;
  transform: translateX(-50%);
  background: var(--glass-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo img {
  width: auto;
  height: 22px;
}

/* The FIBC wordmark is dark ink on transparent; in Dark appearance turn the
   ink white while keeping the coloured squares' hues. */
:root[data-appearance="dark"] .brand-logo img {
  filter: invert(1) hue-rotate(180deg) brightness(1.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) .brand-logo img {
    filter: invert(1) hue-rotate(180deg) brightness(1.15);
  }
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--separator);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--gradient-ai);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.name-chip,
.verified-admin {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 40px;
  max-width: 230px;
  margin-left: var(--s1);
  padding: 0 var(--s4) 0 4px;
  border-radius: 999px;
  background: var(--fill-3);
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), transform var(--t-med) var(--spring);
}

.name-chip > span:last-child,
.verified-admin > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.name-chip:hover { background: var(--fill-2); }
.name-chip:active { transform: scale(0.96); }

/* ---- Avatars ------------------------------------------------------------------- */

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(160deg, #a1a1aa, #71717a);
  color: #fff;
  font-family: var(--font-rounded);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar-admin {
  background: var(--gradient-ai) !important;
}

/* ---- Layout ---------------------------------------------------------------- */

.shell {
  width: min(1200px, 100% - 2 * var(--s6));
  margin: 0 auto;
  padding: 120px 0 var(--s10);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: var(--s5);
  align-items: start;
  margin-top: var(--s5);
}

.main-column {
  display: grid;
  gap: var(--s5);
  min-width: 0;
}

.sidebar-wrapper {
  display: grid;
  gap: var(--s5);
  position: sticky;
  top: 86px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
  margin-top: var(--s5);
}

/* ---- Hero ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--s8);
  padding: var(--s6) var(--s1) var(--s8);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--label-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero .eyebrow {
  margin-bottom: var(--s3);
  font-size: 15px;
  letter-spacing: 0.01em;
  text-transform: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* Each sentence stays on its own line where it fits */
.hero-title .phrase {
  display: inline-block;
}

.gradient-text {
  background: var(--gradient-ai);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 14s ease-in-out infinite alternate;
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.hero-sub {
  max-width: 560px;
  margin-top: var(--s4);
  color: var(--label-2);
  font-size: 19px;
  line-height: 1.42;
  letter-spacing: -0.02em;
}

/* Lock Screen–style clock */
.lock-clock {
  display: grid;
  justify-items: end;
  text-align: right;
}

.lock-date {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--label-2);
}

.lock-time {
  margin: -4px 0 -6px;
  font-family: var(--font-display);
  font-size: clamp(72px, 9vw, 118px);
  line-height: 1;
  font-weight: 250;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--label) 30%, color-mix(in srgb, var(--label) 55%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lock-zone {
  color: var(--label-3);
  font-size: 13px;
  font-weight: 500;
}

/* ---- Widgets -------------------------------------------------------------- */

.widgets {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: var(--s5);
}

.widget,
.panel,
.info-section,
.login-box {
  border-radius: var(--r-card);
}

.widget {
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: var(--s5);
  overflow: hidden;
  transition: transform var(--t-med) var(--spring);
}

.widget:hover {
  transform: translateY(-2px);
}

.widget-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.widget-head h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.widget-sub {
  color: var(--label-2);
  font-size: 13px;
  line-height: 18px;
}

.widget-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px -6px rgba(0, 0, 0, 0.35);
}

.widget-icon .lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.tint-orange { background: linear-gradient(160deg, #ffb340, #ff8a00); }
.tint-green  { background: linear-gradient(160deg, #4ade80, #16a34a); }
.tint-indigo { background: linear-gradient(160deg, #8b8bff, #5856d6); }
.tint-blue   { background: linear-gradient(160deg, #5ac8fa, #007aff); }

.widget-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.widget-placeholder {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 80px;
  color: var(--label-2);
  font-size: 15px;
  text-align: center;
}

.fuel-row,
.fx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 38px;
  padding: 6px 0;
  box-shadow: inset 0 -1px 0 var(--separator);
}

.fuel-row:last-child,
.fx-row:last-child {
  box-shadow: none;
}

.fuel-row span {
  font-size: 15px;
  letter-spacing: -0.015em;
}

.fuel-row b,
.fx-price b {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.fuel-row b small {
  color: var(--label-2);
  font-size: 13px;
  font-weight: 500;
}

.fx-id,
.fx-price {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fx-price {
  flex-direction: row;
  align-items: center;
  gap: var(--s2);
}

.fx-id b {
  font-size: 15px;
  font-weight: 600;
}

.fx-id small,
.fx-price small {
  overflow: hidden;
  color: var(--label-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chg {
  min-width: 60px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chg.up   { background: var(--green); }
.chg.down { background: var(--red); }
.chg.flat { background: var(--fill); color: var(--label-2); }

/* Weather widget: sky gradients after the system Weather app */
.weather-widget {
  --sky: linear-gradient(165deg, #3f8ae6 0%, #82bdf0 100%);
  color: #fff;
  background: var(--sky);
}

.weather-widget::after {
  background: radial-gradient(120% 80% at 85% 0%, rgba(255, 255, 255, 0.28), transparent 60%);
}

.weather-widget[data-scene="clear"]   { --sky: linear-gradient(165deg, #2a7de9 0%, #73b6f7 100%); }
.weather-widget[data-scene="partly"]  { --sky: linear-gradient(165deg, #4482cf 0%, #92bde6 100%); }
.weather-widget[data-scene="cloudy"]  { --sky: linear-gradient(165deg, #5f7590 0%, #9eaebf 100%); }
.weather-widget[data-scene="fog"]     { --sky: linear-gradient(165deg, #7a8a9e 0%, #b7c2cd 100%); }
.weather-widget[data-scene="drizzle"] { --sky: linear-gradient(165deg, #4a6283 0%, #8698b0 100%); }
.weather-widget[data-scene="rain"]    { --sky: linear-gradient(165deg, #34465f 0%, #6b7d95 100%); }
.weather-widget[data-scene="storm"]   { --sky: linear-gradient(165deg, #232a3a 0%, #4f5a70 100%); }
.weather-widget.is-night              { --sky: linear-gradient(165deg, #070f2a 0%, #27386a 100%); }
.weather-widget.is-night[data-scene="rain"],
.weather-widget.is-night[data-scene="storm"],
.weather-widget.is-night[data-scene="drizzle"] { --sky: linear-gradient(165deg, #0e1422 0%, #313b52 100%); }

.weather-widget .widget-placeholder {
  color: rgba(255, 255, 255, 0.82);
}

.wx-top {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
}

.wx-place {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
}

.wx-place .lucide {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.wx-temp {
  margin-top: -2px;
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 66px;
  font-weight: 250;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.wx-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.wx-glyph .lucide {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.wx-cond,
.wx-range {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.wx-range {
  font-weight: 500;
  opacity: 0.85;
}

.wx-hours {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  margin: auto 0 0;
  padding: var(--s3) 0 0;
  list-style: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.wx-hours li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.wx-hours li span {
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.wx-hours b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wx-meta {
  margin-top: var(--s3);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}

/* ---- Panels ------------------------------------------------------------------- */

.panel {
  padding: var(--s6);
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.panel-title.compact {
  align-items: center;
  margin-bottom: var(--s2);
}

.panel-title > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.panel-title h2 {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 31px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.panel-title h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tiny {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--label-2);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
}

.tiny .lucide {
  width: 14px;
  height: 14px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 60%, transparent); }
  80%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.empty {
  padding: var(--s5) var(--s4);
  border-radius: var(--r-row);
  background: var(--fill-4);
  color: var(--label-2);
  font-size: 15px;
  text-align: center;
}

.compact-empty {
  padding: var(--s4);
}

/* Content-unavailable view */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: var(--s6) var(--s4);
  color: var(--label-2);
  font-size: 14px;
  text-align: center;
}

.empty-state .lucide {
  width: 30px;
  height: 30px;
  margin-bottom: var(--s2);
  color: var(--label-3);
  stroke-width: 1.5;
}

.empty-state b {
  color: var(--label);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---- Fields & search --------------------------------------------------------- */

.field {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s4);
  border: 0;
  border-radius: 14px;
  background: var(--fill-3);
  color: var(--label);
  font-size: 17px;
  letter-spacing: -0.02em;
  outline: none;
  box-shadow: inset 0 0 0 1px var(--separator);
  transition: box-shadow var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.field::placeholder {
  color: var(--label-2);
}

.field:focus {
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 60%, transparent), 0 0 0 4px color-mix(in srgb, var(--tint) 22%, transparent);
}

.field[type="date"] {
  min-height: 36px;
  font-size: 15px;
}

.search-box {
  position: relative;
}

.search-glyph {
  position: absolute;
  top: 0;
  left: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 52px;
  color: var(--label-2);
  pointer-events: none;
}

.search-glyph .lucide {
  width: 20px;
  height: 20px;
}

.search-field {
  min-height: 52px;
  padding-left: 46px;
  border-radius: 999px;
  font-size: 18px;
}

.search-field::-webkit-search-cancel-button {
  filter: grayscale(1);
  opacity: 0.5;
}

.suggestions {
  display: grid;
  gap: 0;
  margin-top: var(--s3);
  transition: opacity var(--t-fast) var(--ease-out);
}

.suggestions:empty {
  display: none;
}

.suggestions.is-loading {
  opacity: 0.55;
}

/* ---- Song rows ------------------------------------------------------------------ */

.queue-list,
.history-list,
.trending-list {
  display: grid;
}

.song-row,
.history-row,
.current-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 66px;
  padding: var(--s2);
  border-radius: var(--r-row);
  transition: background var(--t-fast) var(--ease-out);
}

.song-row:hover,
.history-row:hover {
  background: var(--fill-4);
}

.queue-list .song-row + .song-row::before,
.suggestions .song-row + .song-row::before,
.history-list .history-row + .history-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 92px;
  right: var(--s2);
  height: 1px;
  background: var(--separator);
}

.song-row img,
.history-row img,
.current-strip img {
  width: 72px;
  height: 48px;
  flex: none;
  object-fit: cover;
  border-radius: 10px;
  background: var(--fill-3);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.3);
}

.song-copy {
  flex: 1;
  min-width: 0;
}

.song-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.song-meta,
.song-meta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-top: 2px;
  color: var(--label-2);
  font-size: 13px;
  line-height: 18px;
}

.song-channel {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-requester {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.private-meta {
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
}

.admin-name {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--tint);
  font-weight: 600;
}

.admin-name .lucide {
  width: 13px;
  height: 13px;
}

.marquee-container {
  overflow: hidden;
  max-width: 160px;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}

.marquee-text {
  display: inline-block;
  padding-left: 8px;
  animation: marquee 9s linear infinite;
}

@keyframes marquee {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(-60%); }
}

.queue-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fill-3);
  color: var(--label-2);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Now-playing strip */
.current-strip {
  overflow: hidden;
  margin-bottom: var(--s3);
  padding: var(--s3);
  background: color-mix(in srgb, var(--tint) 10%, var(--fill-4));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 22%, transparent);
}

.current-strip img {
  width: 64px;
  height: 64px;
}

.strip-label {
  color: var(--tint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.now-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--tint);
}

.now-badge .eq i {
  background: #fff;
}

/* ---- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--s5);
  border-radius: 999px;
  background: var(--tint);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px -6px color-mix(in srgb, var(--tint) 70%, transparent);
  transition: transform var(--t-med) var(--spring), filter var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.btn .lucide {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: scale(0.96); filter: brightness(0.94); }

.btn.secondary,
.btn.danger {
  background: var(--fill-3);
  color: var(--tint);
  box-shadow: inset 0 0 0 1px var(--separator);
}

.btn.danger {
  color: var(--red);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 999px;
  background: var(--tint);
  color: #fff;
  transition: transform var(--t-med) var(--spring), background var(--t-fast) var(--ease-out);
}

.icon-btn .lucide {
  width: 18px;
  height: 18px;
}

.icon-btn:active:not(:disabled) { transform: scale(0.9); }

.icon-btn.secondary,
.icon-btn.round {
  background: var(--fill-3);
  color: var(--label-2);
}

.icon-btn.danger {
  background: var(--fill-3);
  color: var(--red);
}

.icon-btn.plain {
  width: var(--hit);
  height: var(--hit);
  background: transparent;
  color: var(--label);
}

.icon-btn.plain .lucide {
  width: 21px;
  height: 21px;
}

.icon-btn.plain:hover {
  background: var(--fill-3);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s4);
}

.queue-controls {
  margin: 0 0 var(--s4);
}

.song-row .controls {
  flex-wrap: nowrap;
  margin: 0;
}

.pick-btn {
  min-height: 32px;
  padding: 0 var(--s4);
  background: var(--fill-3);
  color: var(--tint);
  font-size: 14px;
  box-shadow: none;
}

.pick-btn .lucide {
  width: 15px;
  height: 15px;
}

/* Appearance segmented control */
.appearance {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  margin-right: var(--s1);
  padding: 3px;
  border-radius: 999px;
  background: var(--fill-3);
}

.appearance button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 999px;
  color: var(--label-2);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.appearance button .lucide {
  width: 16px;
  height: 16px;
}

.appearance button:hover {
  color: var(--label);
}

.appearance button[aria-checked="true"] {
  background: var(--glass-strong);
  color: var(--label);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14), inset 0 0 0 1px var(--separator);
}

/* ---- Player ------------------------------------------------------------------ */

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.55);
}

.player-frame iframe,
.player-frame > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  text-align: center;
  background:
    radial-gradient(60% 80% at 20% 10%, rgba(41, 151, 255, 0.3), transparent 60%),
    radial-gradient(60% 80% at 85% 90%, rgba(94, 92, 230, 0.3), transparent 60%),
    linear-gradient(180deg, #111218, #050507);
}

.player-empty b {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.player-empty-icon .lucide {
  width: 44px;
  height: 44px;
  margin-bottom: var(--s2);
  color: rgba(255, 255, 255, 0.85);
  stroke-width: 1.3;
  animation: spin 12s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.player-unlock {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--hit);
  padding: 0 var(--s5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #000;
  font-size: 15px;
  font-weight: 600;
  transform: translate(-50%, -50%);
  box-shadow: var(--float-shadow);
}

.guest-playback-controls {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
}

.now-details {
  margin-top: var(--s4);
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
}

.eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--pink);
  transform-origin: bottom;
  transform: scaleY(0.3);
}

.is-playing .eq,
.eq.is-on { opacity: 1; }
.is-playing .eq i,
.eq.is-on i { animation: eq 0.9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.eq i:nth-child(4) { animation-delay: -0.15s; }

@keyframes eq {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

/* ---- Lyrics (Apple Music style) ------------------------------------------------ */

.lyrics-pane {
  margin-top: var(--s6);
  padding-top: var(--s5);
  box-shadow: inset 0 1px 0 var(--separator);
}

.lyrics-lines {
  display: grid;
  gap: var(--s2);
  min-height: 110px;
  padding: var(--s2) 0;
}

.lyric-line {
  color: var(--label-3);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  filter: blur(0.6px);
  transition: color var(--t-med) var(--ease-out), transform var(--t-med) var(--spring), filter var(--t-med) var(--ease-out);
  transform-origin: left center;
}

.lyric-line.is-active {
  color: var(--label);
  filter: none;
  transform: scale(1.03);
}

.lyrics-loading,
.lyrics-idle {
  padding: var(--s2) 0;
  color: var(--label-3);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Top songs ------------------------------------------------------------------- */

.trending-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--s4);
}

.trending-song {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-row);
  text-align: left;
  transition: background var(--t-fast) var(--ease-out), transform var(--t-med) var(--spring);
}

.trending-song:hover { background: var(--fill-4); }
.trending-song:active { transform: scale(0.98); }

.trend-rank {
  width: 26px;
  flex: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: var(--gradient-ai);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.trend-copy {
  display: grid;
  flex: 1;
  min-width: 0;
}

.trend-copy b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-copy small {
  color: var(--label-2);
  font-size: 13px;
}

.trending-song .lucide {
  width: 16px;
  height: 16px;
  color: var(--label-3);
}

/* ---- Chat (Messages) ------------------------------------------------------------ */

.chat-panel {
  display: flex;
  flex-direction: column;
}

.chat-panel.drag-active {
  box-shadow: var(--glass-shadow), 0 0 0 2px var(--tint);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  height: 420px;
  margin: 0 calc(-1 * var(--s2));
  padding: var(--s2) var(--s2) var(--s3);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--fill) transparent;
  mask-image: linear-gradient(180deg, transparent, #000 18px, #000 calc(100% - 8px), transparent);
}

.chat-messages > .empty-state {
  margin: auto;
}

.chat-stamp {
  margin: var(--s4) 0 var(--s2);
  color: var(--label-2);
  font-size: 11px;
  text-align: center;
}

.chat-stamp b {
  font-weight: 600;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 2px;
  animation: msg-in var(--t-med) var(--spring);
}

.msg.first {
  margin-top: var(--s3);
}

.chat-stamp + .msg.first {
  margin-top: 0;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.msg.mine {
  justify-content: flex-end;
}

.msg .avatar,
.avatar-spacer {
  width: 28px;
  height: 28px;
  flex: none;
  font-size: 11px;
}

.msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 78%;
  min-width: 0;
}

.msg.mine .msg-body {
  align-items: flex-end;
}

.msg-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 3px 12px;
  color: var(--label-2);
  font-size: 12px;
  font-weight: 500;
}

.msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
}

.msg-meta .lucide {
  width: 11px;
  height: 11px;
}

.bubble {
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--fill-2);
  color: var(--label);
  font-size: 16px;
  line-height: 21px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* Grouped bubbles tuck their corners together; the last one gets the tail */
.msg.theirs:not(.first) .bubble { border-top-left-radius: 6px; }
.msg.theirs .bubble { border-bottom-left-radius: 6px; }
.msg.theirs.last .bubble { border-bottom-left-radius: 6px; }
.msg.mine:not(.first) .bubble { border-top-right-radius: 6px; }
.msg.mine .bubble { border-bottom-right-radius: 6px; }

.msg.theirs.first:not(.last) .bubble { border-bottom-left-radius: 6px; }

.msg.mine .bubble {
  background: var(--bubble-mine);
  color: #fff;
}

.msg.theirs.from-admin .bubble {
  background: color-mix(in srgb, var(--indigo) 14%, var(--fill-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--indigo) 28%, transparent);
}

.bubble-image {
  max-width: 220px;
  max-height: 240px;
  margin-top: 3px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.4);
}

/* Composer: + button and a capsule field with the send arrow inside */
.composer {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s2);
}

.composer-add {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--fill-3);
  color: var(--label-2);
  transition: transform var(--t-med) var(--spring), background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.composer-add .lucide {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.composer-add:hover { background: var(--fill-2); color: var(--label); }
.composer-add:active { transform: scale(0.9); }
.composer-add.has-image { background: var(--green); color: #fff; }

.composer-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 4px 4px 4px 4px;
  border-radius: 999px;
  background: var(--fill-4);
  box-shadow: inset 0 0 0 1px var(--separator);
  transition: box-shadow var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.composer-field:focus-within {
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 55%, transparent);
}

.composer-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--label);
  font-size: 16px;
  letter-spacing: -0.02em;
  outline: none;
}

.composer-field input::placeholder {
  color: var(--label-3);
}

.send-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--fill);
  color: #fff;
  transform: scale(0.85);
  transition: transform var(--t-med) var(--spring), background var(--t-fast) var(--ease-out);
}

.send-btn .lucide {
  width: 17px;
  height: 17px;
  stroke-width: 2.6;
}

.composer.is-ready .send-btn {
  background: var(--blue);
  transform: scale(1);
}

/* Emoji picker */
.emoji-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  margin-right: 4px;
  border-radius: 50%;
  color: var(--label-2);
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), transform var(--t-med) var(--spring);
}

.emoji-toggle:hover,
.emoji-toggle.is-active {
  background: var(--fill-3);
  color: var(--tint);
}

.emoji-toggle:active {
  transform: scale(0.9);
}

.emoji-picker {
  position: absolute;
  left: var(--s4);
  right: var(--s4);
  bottom: 76px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  height: 340px;
  overflow: hidden;
  border-radius: 24px;
  /* Solid, like the Messages emoji keyboard: a nested backdrop blur can't
     frost the chat behind it, so translucency would only show ghosting. */
  background: var(--surface-solid);
  box-shadow: var(--float-shadow), inset 0 0 0 1px var(--separator);
  transform-origin: bottom left;
  animation: picker-in 320ms var(--spring);
}

.emoji-picker[hidden] {
  display: none;
}

@keyframes picker-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.emoji-search {
  position: relative;
  margin: var(--s3) var(--s3) var(--s1);
}

.emoji-search span {
  position: absolute;
  top: 0;
  left: 11px;
  display: grid;
  place-items: center;
  height: 34px;
  color: var(--label-2);
  pointer-events: none;
}

.emoji-search .lucide {
  width: 15px;
  height: 15px;
}

.emoji-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 0;
  border-radius: 10px;
  background: var(--fill-3);
  color: var(--label);
  font-size: 15px;
  outline: none;
}

.emoji-search input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 25%, transparent);
}

.emoji-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--s2) var(--s2);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--fill) transparent;
}

.emoji-body h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: var(--s2) 6px 4px;
  background: linear-gradient(180deg, var(--surface-solid) 70%, transparent);
  color: var(--label-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 2px;
}

.emoji {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  font-size: 26px;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: background var(--t-fast) var(--ease-out), transform var(--t-med) var(--spring);
}

.emoji:hover {
  background: var(--fill-3);
  transform: scale(1.12);
}

.emoji:active {
  transform: scale(0.9);
}

.emoji-none {
  padding: var(--s8) 0;
  color: var(--label-2);
  font-size: 15px;
  text-align: center;
}

.emoji-tabs {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 6px var(--s2);
  box-shadow: inset 0 1px 0 var(--separator);
}

.emoji-tabs button {
  display: grid;
  place-items: center;
  flex: 1;
  height: 32px;
  border-radius: 8px;
  font-size: 17px;
  filter: grayscale(1);
  opacity: 0.55;
  transition: opacity var(--t-fast) var(--ease-out), filter var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.emoji-tabs button:hover,
.emoji-tabs button[aria-current="true"] {
  background: var(--fill-3);
  filter: none;
  opacity: 1;
}

/* Emoji-only messages: big, no bubble */
.bubble.jumbo {
  padding: 2px 2px 0;
  background: none !important;
  box-shadow: none !important;
  font-size: 44px;
  line-height: 52px;
  letter-spacing: 0.04em;
}

/* ---- Admin ------------------------------------------------------------------------ */

.radio-voice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-row);
  background: var(--fill-4);
  box-shadow: inset 0 0 0 1px var(--separator);
}

.radio-voice-bar .tiny {
  flex: 1;
  white-space: normal;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  font-size: 15px;
  cursor: pointer;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-label span {
  position: relative;
  width: 51px;
  height: 31px;
  flex: none;
  border-radius: 999px;
  background: var(--fill);
  transition: background var(--t-med) var(--ease-out);
}

.switch-label span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform var(--t-med) var(--spring);
}

.switch-label input:checked + span { background: var(--green); }
.switch-label input:checked + span::after { transform: translateX(20px); }
.switch-label input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }

.user-management,
.activity-management {
  margin-top: var(--s5);
}

.activity-tools,
.panel-title > .activity-tools {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.profile-list,
.audit-list {
  display: grid;
  gap: var(--s3);
}

.profile-row {
  display: grid;
  gap: var(--s3);
  padding: var(--s4);
  border-radius: 18px;
  background: var(--fill-4);
  box-shadow: inset 0 0 0 1px var(--separator);
}

.profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  font-size: 17px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--label-2);
  font-size: 13px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-dot.is-banned::before { background: var(--red); box-shadow: 0 0 8px var(--red); }

.profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: var(--s2);
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px var(--s4);
  color: var(--label-2);
  font-size: 13px;
}

.profile-facts b {
  color: var(--label);
  font-weight: 600;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  font-size: 15px;
}

.profile-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-actions .btn {
  margin-left: auto;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--tint);
}

.audit-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: var(--s3);
  align-items: center;
  padding: var(--s3) var(--s2);
  font-size: 13px;
  box-shadow: inset 0 -1px 0 var(--separator);
}

.audit-row time {
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

.audit-row div {
  display: grid;
  min-width: 0;
}

.audit-row strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-row span {
  color: var(--label-2);
}

/* Login */
.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--s5);
}

.login-box {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  width: min(400px, 100%);
  padding: var(--s8) var(--s6) var(--s6);
  text-align: center;
}

.login-logo {
  margin-bottom: var(--s5);
}

.login-logo img {
  height: 22px;
}

.login-box h2 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-form {
  display: grid;
  gap: var(--s3);
  width: 100%;
  margin-top: var(--s4);
}

.login-form .btn,
.dialog-body .btn {
  min-height: 52px;
  border-radius: 16px;
  font-size: 17px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--s2);
  border-radius: 18px;
  background: var(--gradient-ai);
  color: #fff;
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--tint) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dialog-icon .lucide {
  width: 26px;
  height: 26px;
}

/* ---- Sheets, dialogs, toast ---------------------------------------------------- */

dialog {
  color: var(--label);
}

dialog::backdrop {
  background: rgba(5, 6, 12, 0.36);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
}

.dialog,
.info-dialog,
.calculator-dialog {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.dialog[open],
.info-dialog[open],
.calculator-dialog[open] {
  animation: sheet-in 420ms var(--spring);
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.dialog-body {
  width: min(420px, calc(100vw - 32px));
  padding: var(--s8) var(--s6) var(--s6);
  border-radius: 32px;
  background: var(--glass-strong);
  box-shadow: var(--float-shadow);
  text-align: center;
}

.dialog-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 31px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dialog-body > .tiny {
  display: block;
  margin: var(--s2) 0 var(--s5);
  white-space: normal;
}

.dialog-body form {
  display: grid;
  gap: var(--s3);
}

.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}

/* Markets sheet */
.info-window {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0 var(--s6) var(--s6);
  border-radius: 32px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--float-shadow), inset 0 0 0 1px var(--separator);
  overscroll-behavior: contain;
}

.info-titlebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 calc(-1 * var(--s6));
  padding: var(--s6) var(--s6) var(--s3);
  background: linear-gradient(180deg, var(--glass-strong) 70%, transparent);
}

.info-titlebar h2 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 46px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.info-kicker {
  color: var(--label-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-refresh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
  color: var(--label-2);
  font-size: 13px;
}

.info-refresh .icon-btn.plain {
  color: var(--tint);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

.info-section {
  min-width: 0;
  padding: var(--s5);
  border-radius: 22px;
  background: var(--fill-4);
  box-shadow: inset 0 0 0 1px var(--separator);
}

.info-wide {
  grid-column: 1 / -1;
}

.crude-rows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--s6);
}

.crude-rows .fx-row:nth-last-child(2):nth-child(odd) {
  box-shadow: none;
}

.news-sections {
  display: grid;
  gap: var(--s4);
}

.news-list {
  display: grid;
}

.news-item {
  position: relative;
  display: grid;
  gap: 3px;
  padding: var(--s3) var(--s2);
  border-radius: var(--r-row);
  color: inherit;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-out);
}

.news-item + .news-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--s2);
  right: var(--s2);
  height: 1px;
  background: var(--separator);
}

.news-item:hover { background: var(--fill-4); }

.news-item span {
  color: var(--label-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-item span em {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--gradient-ai);
  color: #fff;
  font-style: normal;
  text-transform: none;
}

.news-item b {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.news-item time {
  color: var(--label-2);
  font-size: 13px;
}

.info-loading {
  padding: var(--s4);
  color: var(--label-2);
  font-size: 15px;
  text-align: center;
}

/* Calculator — after the system Calculator */
.calculator-window {
  width: 300px;
  padding: 0 var(--s4) var(--s4);
  border-radius: 30px;
  background: rgba(10, 10, 12, 0.88);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), var(--float-shadow);
  font-family: var(--font-rounded);
}

.calculator-titlebar {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  height: 44px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots > * {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  background: #3a3a3c;
}

.window-dots button {
  background: #ff5f57;
}

.calculator-display {
  display: block;
  overflow: hidden;
  padding: var(--s6) var(--s2) var(--s3);
  font-size: 64px;
  line-height: 1;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.calculator-grid button {
  aspect-ratio: 1;
  border-radius: 50%;
  background: #333336;
  color: #fff;
  font-size: 28px;
  font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: filter var(--t-fast) var(--ease-out);
}

.calculator-grid button:active { filter: brightness(1.45); }

.calculator-grid .calc-function {
  background: #a5a5a5;
  color: #000;
  font-size: 22px;
  font-weight: 500;
}

.calculator-grid .calc-operator {
  background: #ff9f0a;
  font-size: 32px;
}

.calculator-grid .calc-zero {
  grid-column: span 2;
  aspect-ratio: auto;
  padding-left: 26px;
  border-radius: 999px;
  text-align: left;
}

/* Toast: a floating capsule like a system HUD */
.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 100;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--float-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px) scale(0.94);
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-med) var(--spring);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* Community vote banner */
.vote-banner {
  position: fixed;
  bottom: var(--s5);
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: min(580px, calc(100vw - 32px));
  padding: var(--s3);
  border-radius: 26px;
  background: var(--glass-strong);
  box-shadow: var(--float-shadow);
  transform: translateX(-50%);
  animation: banner-in var(--t-med) var(--spring);
}

@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.vote-banner img {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: cover;
  border-radius: 14px;
}

.vote-banner > div:not(.vote-actions) {
  display: grid;
  flex: 1;
  min-width: 0;
}

.vote-banner b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vote-banner small {
  color: var(--label-2);
  font-size: 13px;
}

.vote-actions {
  display: flex;
  gap: var(--s2);
}

/* ---- Continuous corners ------------------------------------------------------ */
@supports (corner-shape: squircle) {
  .widget,
  .panel,
  .info-section,
  .login-box,
  .dialog-body,
  .info-window,
  .calculator-window,
  .player-frame,
  .widget-icon,
  .dialog-icon,
  .song-row img,
  .history-row img,
  .current-strip img,
  .vote-banner img,
  .song-row,
  .history-row,
  .current-strip,
  .trending-song,
  .news-item,
  .profile-row,
  .radio-voice-bar,
  .empty,
  .chg {
    corner-shape: squircle;
  }

  .widget, .panel, .login-box { border-radius: calc(var(--r-card) * 1.6); }
  .dialog-body, .info-window { border-radius: 50px; }
  .calculator-window { border-radius: 48px; }
  .info-section { border-radius: 34px; }
  .player-frame { border-radius: 32px; }
  .widget-icon { border-radius: 16px; }
  .dialog-icon { border-radius: 28px; }
  .song-row img, .history-row img { border-radius: 16px; }
  .current-strip img, .vote-banner img { border-radius: 22px; }
  .song-row, .history-row, .current-strip, .trending-song, .news-item, .profile-row, .radio-voice-bar, .empty { border-radius: 22px; }
  .chg { border-radius: 12px; }
}

/* ---- Responsive -------------------------------------------------------------- */

@media (max-width: 1080px) {
  .widgets {
    grid-template-columns: 1fr 1fr;
  }

  .weather-widget {
    grid-column: 1 / -1;
    min-height: 0;
  }
}

@media (max-width: 920px) {
  .grid,
  .split,
  .hero {
    grid-template-columns: 1fr;
  }

  .lock-clock {
    justify-items: start;
    text-align: left;
    order: -1;
  }

  .sidebar-wrapper {
    position: static;
  }

  .profile-fields {
    grid-template-columns: 1fr 1fr;
  }

  .profile-fields .field:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 2 * var(--s4));
    padding-top: 92px;
  }

  .topbar {
    top: 8px;
    width: calc(100% - 16px);
    height: 54px;
    padding: 0 var(--s1) 0 var(--s4);
  }

  .brand {
    flex: 1 1 auto;
    gap: var(--s2);
  }

  .brand-logo img {
    height: 15px;
  }

  .brand-divider,
  .brand-name {
    display: none;
  }

  .header-actions {
    flex: none;
    gap: 0;
  }

  .icon-btn.plain {
    width: 38px;
    height: 38px;
  }

  .appearance {
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .appearance button:not([aria-checked="true"]) {
    display: none;
  }

  .appearance button[aria-checked="true"] {
    width: 38px;
    height: 38px;
    background: transparent;
    box-shadow: none;
    color: var(--label);
  }

  .hero {
    gap: var(--s4);
    padding: var(--s3) 0 var(--s5);
  }

  .hero-title {
    font-size: 38px;
  }

  .hero-sub {
    font-size: 17px;
    text-wrap: pretty;
  }

  .lock-time {
    font-size: 76px;
  }

  .widgets {
    grid-template-columns: 1fr;
    gap: var(--s3);
  }

  .widget {
    min-height: 0;
  }

  .grid,
  .main-column,
  .sidebar-wrapper {
    gap: var(--s3);
  }

  .grid {
    margin-top: var(--s3);
  }

  .panel {
    padding: var(--s5) var(--s4);
  }

  .panel-title h2 {
    font-size: 24px;
    line-height: 29px;
  }

  .trending-list,
  .info-grid,
  .crude-rows {
    grid-template-columns: 1fr;
  }

  .crude-rows .fx-row:nth-last-child(2):nth-child(odd) {
    box-shadow: inset 0 -1px 0 var(--separator);
  }

  .pick-btn span {
    display: none;
  }

  .pick-btn {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .song-row img,
  .history-row img {
    width: 64px;
    height: 42px;
  }

  .queue-list .song-row + .song-row::before,
  .suggestions .song-row + .song-row::before,
  .history-list .history-row + .history-row::before {
    left: 84px;
  }

  .chat-messages {
    height: 380px;
  }

  .info-window {
    padding: 0 var(--s4) var(--s4);
  }

  .info-titlebar {
    margin: 0 calc(-1 * var(--s4));
    padding: var(--s5) var(--s4) var(--s3);
  }

  .info-titlebar h2 {
    font-size: 32px;
    line-height: 38px;
  }

  .audit-row {
    grid-template-columns: 70px 1fr;
  }

  .audit-row div:last-child {
    grid-column: 2;
  }

  .profile-fields {
    grid-template-columns: 1fr;
  }

  .lyric-line {
    font-size: 22px;
    line-height: 28px;
  }

  .vote-banner {
    flex-wrap: wrap;
  }

  .vote-actions {
    width: 100%;
  }

  .vote-actions .btn {
    flex: 1;
  }
}

@media (max-width: 430px) {
  .name-chip > span:last-child,
  .verified-admin > span:last-child {
    display: none;
  }

  .name-chip,
  .verified-admin {
    padding: 4px;
  }
}

/* ---- Accessibility preferences ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass,
  .topbar,
  .dialog-body,
  .toast,
  .vote-banner,
  .info-window {
    background: var(--glass-strong);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .ambient {
    display: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --separator: rgba(0, 0, 0, 0.4);
    --label-2: rgba(29, 29, 31, 0.86);
    --glass: rgba(255, 255, 255, 0.86);
  }

  :root[data-appearance="dark"] {
    --separator: rgba(255, 255, 255, 0.35);
    --label-2: rgba(235, 235, 245, 0.86);
    --glass: rgba(20, 20, 26, 0.9);
  }

  .glass {
    box-shadow: 0 0 0 1px var(--separator);
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) {
    --separator: rgba(255, 255, 255, 0.35);
    --label-2: rgba(235, 235, 245, 0.86);
    --glass: rgba(20, 20, 26, 0.9);
  }
}
