/* Room Lights – trynewthings. Dark, lime, warm. Mobile first. */

:root {
  --bg: #0e0f0c;
  --surface: #171915;
  --surface-2: #20231d;
  --surface-3: #2a2e26;
  --line: #34382f;
  --text: #f4f2e9;
  --muted: #b5b7ab;
  --lime: #c6ff3d;
  --lime-dim: #9fd12a;
  --on-lime: #10120b;
  --danger: #ff8a7a;
  --warn: #ffcf5c;
  --radius: 20px;
  --radius-sm: 14px;
  --gutter: 16px;
  --tap: 44px;
  --font: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-ui: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --pulse: 0;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  min-height: 100vh;
  padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--lime); color: var(--on-lime); padding: 10px 14px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ------------------------------------------------------------ layout */
.topbar, main, .dock-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.smiley {
  width: 44px; height: 44px; color: var(--lime); flex: none;
  transform: rotate(-6deg) scale(calc(1 + var(--pulse) * 0.08));
  transition: transform 0.08s linear;
}
.brand h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; }
.tagline { margin: 0; color: var(--muted); font-size: 0.85rem; font-style: italic; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.conn {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 0.8rem; color: var(--muted); white-space: nowrap;
}
.conn-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: none;
  box-shadow: 0 0 0 3px rgb(255 207 92 / 0.18);
}
.conn[data-state="live"] .conn-dot { background: var(--lime); box-shadow: 0 0 0 3px rgb(198 255 61 / 0.18); }
.conn[data-state="down"] .conn-dot { background: transparent; border: 2px solid var(--danger); box-shadow: none; }
.conn[data-state="connecting"] .conn-dot,
.conn[data-state="polling"] .conn-dot { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

main { padding-top: 8px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 18px;
  border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 1rem; line-height: 1.1;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.btn-primary:hover { background: #d4ff6b; border-color: #d4ff6b; }
.btn-ghost { background: transparent; }
.btn-small { min-height: var(--tap); padding: 6px 12px; font-size: 0.9rem; }
.btn-wide { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 10px 4px; min-height: var(--tap);
  color: var(--lime); text-decoration: underline; text-underline-offset: 3px; font-size: inherit;
}

/* ------------------------------------------------------------ preview */
.preview { margin-bottom: 18px; }
.preview-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1a1c17 0%, #0a0b09 70%);
  border: 1px solid #22251f;
}
#preview { display: block; width: 100%; height: clamp(170px, 50vw, 280px); }

.now-line {
  margin: 12px 0 0; font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.now-line .now-mode { color: var(--lime); }
.last-change {
  margin: 2px 0 0; color: var(--muted); font-size: 0.95rem;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; min-height: var(--tap);
}
.banner {
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border-left: 4px solid var(--warn);
}

/* ------------------------------------------------------------ music */
.music { margin-bottom: 22px; }
.music-toggle, .toggle-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  text-align: left;
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: background 0.2s, border-color 0.2s;
}
.music-toggle { min-height: 92px; }
.music-toggle:hover, .toggle-row:hover { border-color: var(--muted); }
.music-icon { grid-row: 1 / 3; font-size: 2rem; line-height: 1; }
.music-text, .toggle-text { grid-row: 1 / 3; display: flex; flex-direction: column; min-width: 0; }
.music-label { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.music-hint, .hint { color: var(--muted); font-size: 0.92rem; }
.switch { grid-column: 3; grid-row: 1; justify-self: end; }
.switch-state { grid-column: 3; grid-row: 2; justify-self: center; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.switch {
  position: relative; display: inline-block; width: 60px; height: 34px; border-radius: 999px;
  background: var(--surface-3); border: 2px solid var(--line); transition: background 0.2s, border-color 0.2s;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--muted); transition: transform 0.2s, background 0.2s;
}
[aria-pressed="true"] .switch { background: var(--lime); border-color: var(--lime); }
[aria-pressed="true"] .switch-knob { transform: translateX(26px); background: var(--on-lime); }
[aria-pressed="true"] .switch-state { color: var(--lime); }
.music-toggle[aria-pressed="true"] { border-color: var(--lime); background: linear-gradient(135deg, #1f2a10, var(--surface) 70%); }

.toggle-row { padding: 12px 16px; min-height: 64px; }
.toggle-row .toggle-text { font-weight: 600; }
.toggle-row .hint { font-weight: 400; }

.now-playing {
  margin-top: 14px;
  display: grid; grid-template-columns: 112px 1fr; gap: 16px;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 0 calc(var(--pulse) * 34px) calc(var(--pulse) * 2px) var(--glow, rgb(198 255 61 / 0.25));
}
.cover-wrap {
  position: relative; width: 112px; height: 112px; border-radius: 14px; overflow: hidden;
  transform: scale(calc(1 + var(--pulse) * 0.035));
  background: linear-gradient(135deg, var(--c1, #2a2e26), var(--c2, #171915));
}
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; }
.cover:not([hidden]) + .cover-fallback { display: none; }
.np-body { min-width: 0; }
.eyebrow { margin: 0; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime); font-weight: 700; }
.np-title {
  margin: 2px 0 2px; font-size: 1.3rem; line-height: 1.15; font-weight: 800; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.np-sub { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }
.meter { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.78rem; color: var(--muted); }
.meter-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 3px; transition: width 0.1s linear; }

@media (max-width: 380px) {
  .now-playing { grid-template-columns: 84px 1fr; gap: 12px; padding: 14px; }
  .cover-wrap { width: 84px; height: 84px; }
}

/* ------------------------------------------------------------ swatches + facts */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25);
}
.swatches.small .swatch { width: 16px; height: 16px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.fact {
  display: inline-flex; gap: 5px; align-items: baseline;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.85rem;
}
.fact dt { color: var(--muted); }
.fact dd { margin: 0; font-weight: 700; }

/* ------------------------------------------------------------ choices */
.section-title { font-size: 1.35rem; margin: 0 0 10px; font-weight: 800; }
.sub-title { font-size: 1.12rem; margin: 0 0 10px; font-weight: 800; padding: 0; }
.mini-title { font-size: 0.95rem; margin: 16px 0 8px; color: var(--muted); font-weight: 600; }

.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  margin-bottom: 16px;
}
.tabs [role="tab"] {
  min-height: var(--tap); border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 0.95rem; padding: 6px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--lime); color: var(--on-lime); }
.tabs [role="tab"]:hover:not([aria-selected="true"]) { color: var(--text); }
@media (max-width: 360px) { .tabs [role="tab"] > span[aria-hidden] { display: none; } }

.panel:focus-visible { outline-offset: 6px; }
.panel-intro { margin: 0 0 12px; color: var(--muted); }
.empty { color: var(--muted); }

.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card-grid > li { position: relative; min-width: 0; }

.card {
  width: 100%; height: 100%; min-height: 110px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 2px solid var(--line);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.card:hover { border-color: var(--muted); }
.card:active { transform: scale(0.98); }
.card[aria-pressed="true"], .card[aria-current="true"] { border-color: var(--lime); background: #1b2112; }
.card-emoji { font-size: 1.8rem; line-height: 1; }
.card-name { font-weight: 800; font-size: 1.05rem; line-height: 1.15; overflow-wrap: anywhere; }
.card-meta { color: var(--muted); font-size: 0.85rem; }
.card-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.3; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--lime); color: var(--on-lime); padding: 2px 8px; border-radius: 999px;
}
.preset-grid .card { padding-right: 52px; }
.icon-btn {
  position: absolute; top: 4px; right: 4px;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 0; color: var(--muted); font-size: 1.1rem;
}
.icon-btn:hover { color: var(--danger); background: var(--surface-2); }

.scene-grid .card { min-height: 0; }
.scene-swatch {
  width: 100%; height: 16px; border-radius: 8px; margin: 2px 0 6px;
  image-rendering: pixelated; background: #000; display: block;
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* ------------------------------------------------------------ customise */
.group { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
.color-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.color-item {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.color-item input[type="color"] {
  width: 48px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: none; cursor: pointer;
}
.color-item input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-item input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 999px; }
.color-item input[type="color"]::-moz-color-swatch { border: 0; border-radius: 999px; }
.color-item .remove {
  width: 36px; height: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 999px; font-size: 1rem;
}
.color-item .remove:hover { color: var(--danger); }
.add-color {
  min-height: 52px; border-radius: 999px; border: 2px dashed var(--line); background: transparent;
  padding: 6px 16px; color: var(--text); font-weight: 700;
}
.add-color:hover { border-color: var(--lime); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
  padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 600; font-size: 0.95rem;
}
.chip:hover { border-color: var(--muted); }
.chip-dots { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.2); }
.chip.plain { padding-left: 14px; }

.sliders { display: grid; gap: 14px; }
.slider-row { display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 2px; }
.slider-row label, .dock-label label { font-weight: 700; }
.slider-row output { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.slider-row input { grid-column: 1 / 3; }

input[type="range"] {
  --val: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: var(--tap); background: transparent; margin: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right, var(--lime) 0 var(--val), var(--surface-3) var(--val) 100%);
}
input[type="range"]::-moz-range-track { height: 10px; border-radius: 5px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 10px; border-radius: 5px; background: var(--lime); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -9px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--text); border: 4px solid var(--lime);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--text); border: 4px solid var(--lime);
}
input[type="range"]:focus-visible { outline-offset: 0; }

.field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-weight: 600; min-width: 0; }
.field input, .field select {
  min-height: var(--tap); padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 400; width: 100%;
}
.field input:focus-visible, .field select:focus-visible { border-color: var(--lime); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: var(--danger); margin: 10px 0 0; }
.save-preset .btn, .settings .btn-primary { margin-top: 14px; }
.save-preset { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.save-preset .field input { background: var(--bg); }

.emoji-picker { border: 0; padding: 0; margin: 12px 0 0; }
.emoji-picker legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.emoji-opt { position: relative; }
.emoji-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.emoji-opt span {
  display: grid; place-items: center; height: 46px; border-radius: 12px; font-size: 1.45rem;
  border: 2px solid var(--line); background: var(--bg);
}
.emoji-opt input:checked + span { border-color: var(--lime); background: #1f2a10; box-shadow: inset 0 0 0 2px var(--lime); }
.emoji-opt input:focus-visible + span { outline: 3px solid var(--lime); outline-offset: 2px; }

/* ------------------------------------------------------------ fun modes */
.fun-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fun-item { display: flex; flex-direction: column; min-width: 0; }
.fun-item .card { height: auto; min-height: 0; flex-direction: row; align-items: center; gap: 14px; }
.fun-item .card[aria-pressed="true"] { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.fun-item .card-emoji { font-size: 2.1rem; }
.fun-item .card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fun-item .state-label { flex: none; font-size: 0.8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.fun-item .card[aria-pressed="true"] .state-label { color: var(--lime); }
.fun-status {
  margin: 0; padding: 4px 14px 14px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: #1b2112; border: 2px solid var(--lime); border-top: 0;
}
.fun-status .st-title { margin: 0; font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.fun-status .st-sub { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ more */
.more { margin-top: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.more summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 1.1rem;
  border-radius: var(--radius);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after {
  content: ""; width: 10px; height: 10px; margin-right: 4px;
  border-right: 3px solid var(--muted); border-bottom: 3px solid var(--muted);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.2s;
}
.more[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.more-body { padding: 0 18px 20px; }
.more-body > .group:first-child { margin-top: 0; }
.more .field input, .more .field select { background: var(--bg); }
.more .chip { background: var(--bg); }

.devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.devices .empty-row { color: var(--muted); padding: 4px 0; }
.lights:focus-visible { outline-offset: 6px; }
.lights .mini-title:first-of-type { margin-top: 4px; }
.device { flex-wrap: wrap; row-gap: 10px; }
.device-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.device-name { overflow-wrap: anywhere; }
.device-ip { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.device-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.device-actions .btn { flex: 1 1 auto; padding: 8px 14px; font-size: 0.95rem; }
.device-actions .btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn-danger-ghost { background: transparent; }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }
.device.found { border-style: dashed; }
.scan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.scan-status { margin: 0; }
.scan-icon { display: inline-block; font-size: 1.15rem; line-height: 1; }
#scanBtn[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
#scanBtn[aria-disabled="true"] .scan-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner-offline {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding-top: 8px; padding-bottom: 4px; border-left-color: var(--danger);
}
.banner-offline .link-btn { grid-column: 2; justify-self: start; padding: 4px 0; text-align: left; }
.device {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line);
}
.device-name { font-weight: 700; }
.device-meta { color: var(--muted); font-size: 0.85rem; }
.device-state { margin-left: auto; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.device-state.on { color: var(--lime); }
.device-state.off { color: var(--danger); }

/* ------------------------------------------------------------ dock */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgb(14 15 12 / 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
.dock-inner { display: flex; align-items: center; gap: 12px; }
.dock-bright { flex: 1; min-width: 0; }
.dock-label { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; }
.dock-label output { margin-left: auto; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.btn-power { flex: none; min-height: 56px; padding: 10px 18px; }
.btn-power .power-icon { font-size: 1.2rem; }
.btn-power.is-off { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 600; box-shadow: 0 8px 30px rgb(0 0 0 / 0.5);
}
.toast.error { background: #ffd8d2; color: #3a0d06; }

.noscript { padding: 20px; text-align: center; }

/* ------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  .smiley, .cover-wrap { transform: none !important; }
  .now-playing { box-shadow: none !important; }
}

@media (hover: none) {
  .btn:hover, .card:hover, .chip:hover, .music-toggle:hover, .toggle-row:hover { border-color: var(--line); }
  .card[aria-pressed="true"]:hover, .card[aria-current="true"]:hover, .music-toggle[aria-pressed="true"]:hover { border-color: var(--lime); }
  .btn-primary:hover, .btn-power.is-off:hover { border-color: var(--lime); }
}
