/* =========================================================
   UI — every control in the room in the same glass style (ui.js draws the popovers).
   ========================================================= */

/* ---------- shared glass surface ---------- */
.ui-pop, .ui-tip, .ui-cf-c {
  background: rgba(16, 18, 26, .9);
  backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: 0 22px 56px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: var(--pm-ink, #f4f5f8);
}

/* ---------- popover ---------- */
.ui-pop { position: fixed; z-index: 80; border-radius: 16px; padding: 6px; animation: uiPop .16s cubic-bezier(.2, .9, .3, 1.2); transform-origin: top left; }
.ui-pop[data-up] { transform-origin: bottom left; }
.ui-pop.out { opacity: 0; transform: scale(.97); transition: opacity .12s, transform .12s; pointer-events: none; }
@keyframes uiPop { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.ui-pop svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* dropdown menu */
.ui-menu { display: flex; flex-direction: column; gap: 1px; max-height: min(320px, 60vh); overflow-y: auto; }
.ui-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 8px 10px 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 550; color: var(--pm-ink2); text-align: left; transition: background .12s, color .12s; }
.ui-opt:hover, .ui-opt:focus-visible { background: rgba(255, 255, 255, .08); color: #fff; outline: none; }
.ui-opt svg { opacity: 0; color: var(--pm-acc); }
.ui-opt.on { color: #fff; }
.ui-opt.on svg { opacity: 1; }
.ui-opt[disabled] { opacity: .4; pointer-events: none; }

/* calendar */
.ui-cal { width: 268px; padding: 10px; }
.ui-cal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ui-cal-hd b { font-size: 14px; font-weight: 650; }
.ui-nav { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--pm-ink2); }
.ui-nav:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.ui-wk, .ui-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ui-wk span { text-align: center; font-size: 11px; font-weight: 700; color: var(--pm-ink3); padding: 4px 0; }
.ui-day { aspect-ratio: 1; border-radius: 50%; font-size: 13px; font-weight: 550; color: var(--pm-ink); font-variant-numeric: tabular-nums; transition: background .12s; }
.ui-day:hover, .ui-day:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.ui-day.out { color: var(--pm-ink3); opacity: .55; }
.ui-day.today { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pm-acc) 70%, transparent); }
.ui-day.on { background: var(--pm-acc); color: #0b0d12; font-weight: 700; }
.ui-cal-ft { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--pm-line); }
.ui-chip { padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 650; background: rgba(255, 255, 255, .08); color: var(--pm-ink); }
.ui-chip:hover { background: rgba(255, 255, 255, .16); }
.ui-chip.ghost { margin-left: auto; background: none; color: var(--pm-ink3); }
.ui-chip.ghost:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* colour palette */
.ui-colour { width: 268px; padding: 10px; }
.ui-sw { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.ui-sw button { aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); transition: transform .12s; }
.ui-sw button:hover, .ui-sw button:focus-visible { transform: scale(1.15); outline: none; }
.ui-sw button.on { box-shadow: 0 0 0 2px rgba(16, 18, 26, .9), 0 0 0 4px var(--pm-acc); }
.ui-hex { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pm-line); }
.ui-hex span { width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.pm .ui-hex input { flex: 1; padding: 6px 10px; font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 13px; text-transform: lowercase; }
.pm .ui-hex input.bad { border-color: rgba(251, 113, 133, .6); }

/* ---------- confirm dialog ---------- */
.ui-cf { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 20px; background: rgba(4, 6, 10, .45); animation: uiFade .18s; }
.ui-cf.out { opacity: 0; transition: opacity .16s; }
@keyframes uiFade { from { opacity: 0; } }
.ui-cf-c { width: min(380px, 100%); border-radius: 22px; padding: 22px 20px 18px; animation: uiPop .2s cubic-bezier(.2, .9, .3, 1.2); }
.ui-cf-c p { margin: 0 0 18px; font-size: 15.5px; font-weight: 550; line-height: 1.45; }
.ui-cf-b { display: flex; justify-content: flex-end; gap: 8px; }
.pm-btn.danger { background: #fb7185; color: #1a0b10; }
.pm-btn.danger:hover { background: #fda4af; }

/* ---------- tooltip ---------- */
.ui-tip { position: fixed; z-index: 90; max-width: 240px; padding: 6px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 1.35; pointer-events: none; animation: uiTip .14s ease-out; }
@keyframes uiTip { from { opacity: 0; transform: translateY(3px); } }
.ui-tip.below { animation-name: uiTipB; }
@keyframes uiTipB { from { opacity: 0; transform: translateY(-3px); } }

/* ---------- the controls themselves ---------- */
/* dropdowns: our chevron, no native arrow */
.pm select { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(244,245,248,.6)' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.pm select.ui-open, .pm input.ui-open { border-color: color-mix(in srgb, var(--pm-acc) 60%, transparent); background-color: rgba(255, 255, 255, .1); }
/* dates: our calendar icon */
.pm input[type="date"] { cursor: pointer; padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(244,245,248,.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important; background-size: 15px !important; }
.pm input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.pm input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
.pm input[type="date"]:invalid::-webkit-datetime-edit, .pm input[type="date"][value=""]::-webkit-datetime-edit { color: var(--pm-ink3); }
/* numbers: no spinner arrows */
.pm input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.pm input[type="number"]::-webkit-inner-spin-button, .pm input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* search: our clear button */
.pm input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; width: 16px; height: 16px; cursor: pointer; opacity: .6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f5f8' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 12px no-repeat; }
.pm input[type="search"]::-webkit-search-cancel-button:hover { opacity: 1; }
/* colour: the "any colour" swatch shows a soft rainbow, the browser's picker never opens */
.pm label.pick input[type="color"] { pointer-events: none; }
.pm label.pick.ui-open i { box-shadow: 0 0 0 2px rgba(16, 18, 26, .9), 0 0 0 4px var(--pm-acc); }
/* text inputs: accent caret and selection */
.pm input, .pm textarea { caret-color: var(--pm-acc); }
.pm ::selection { background: color-mix(in srgb, var(--pm-acc) 38%, transparent); color: #fff; }
.pm input::placeholder, .pm textarea::placeholder { color: var(--pm-ink3); }

/* range sliders: a thin track filled with the accent, a white thumb */
.pm input[type="range"] { -webkit-appearance: none; appearance: none; height: 18px; background: none; cursor: pointer; accent-color: initial; --p: 50%; }
.pm input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--pm-acc) var(--p), rgba(255, 255, 255, .16) var(--p)); }
.pm input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); transition: box-shadow .15s, transform .15s; }
.pm input[type="range"]:hover::-webkit-slider-thumb, .pm input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 1px 4px rgba(0, 0, 0, .45), 0 0 0 5px color-mix(in srgb, var(--pm-acc) 28%, transparent); }
.pm input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.pm input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.pm input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--pm-acc); }
.pm input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.pm input[type="range"]:focus-visible { outline: none; }

/* scrollbars: thin and glassy (zero specificity, so "scrollbar-width: none" rows keep hiding theirs) */
:where(.pm, .pm *) { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
:where(.pm) ::-webkit-scrollbar { width: 8px; height: 8px; }
:where(.pm) ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
:where(.pm) ::-webkit-scrollbar-track { background: transparent; }

/* ---------- toasts and the wellbeing cards, in the room's glass ---------- */
body.route-focus .toast { background: rgba(16, 18, 26, .88); color: #f4f5f8; border: 1px solid rgba(255, 255, 255, .11); border-radius: 16px; backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); box-shadow: 0 18px 44px rgba(0, 0, 0, .45); }
body.route-focus .toast button { color: var(--acc2); border-radius: 99px; padding: 5px 11px; background: rgba(255, 255, 255, .08); }
body.route-focus .toast button:hover { background: rgba(255, 255, 255, .16); }
.eye-card, body.route-focus .well-card { background: rgba(16, 18, 26, .9); border: 1px solid rgba(255, 255, 255, .11); backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); }
.eye-ring circle.v { stroke: var(--acc2); }
.eye-card .btn, .well-card .btn { border-radius: 99px; font-weight: 650; }
.eye-card .btn.ghost, .well-card .btn.ghost { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #f4f5f8; }
.eye-card .btn.ghost:hover, .well-card .btn.ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.eye-card .btn.primary, .well-card .btn.primary { background: #fff; color: #0b0d12; box-shadow: none; }
.eye-card .btn.primary:hover, .well-card .btn.primary:hover { background: color-mix(in srgb, var(--acc2) 25%, #fff); transform: none; }
.wc-dots i { border-color: color-mix(in srgb, var(--acc2) 55%, rgba(255, 255, 255, .2)); }
.wc-dots i.on { background: linear-gradient(color-mix(in srgb, var(--acc2) 60%, #fff), var(--acc2)); border-color: var(--acc2); }
body.route-focus .wc-x { color: rgba(244, 246, 250, .55); }
body.route-focus .wc-x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
body.route-focus .note-card textarea:focus { border-color: color-mix(in srgb, var(--acc2) 60%, transparent); }

/* ---------- music: Spotify's player framed like the rest of the room ---------- */
.mu-frame { position: relative; height: var(--mu-h, 152px); border-radius: 16px; overflow: hidden; background: #121212; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); transition: height .3s cubic-bezier(.2, .9, .3, 1); }
.mu-frame iframe { display: block; width: 100%; border: 0; border-radius: 16px; opacity: 0; transition: opacity .4s; }
.mu-frame.ready iframe { opacity: 1; }
.mu-skel { position: absolute; inset: 0; display: flex; gap: 14px; padding: 16px; }
.mu-frame.ready .mu-skel { display: none; }
.mu-skel i { width: 120px; max-width: 32%; aspect-ratio: 1; align-self: flex-start; border-radius: 10px; }
.mu-skel span { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.mu-skel b { height: 14px; width: 70%; border-radius: 6px; }
.mu-skel small { height: 11px; width: 45%; border-radius: 6px; }
.mu-skel i, .mu-skel b, .mu-skel small { background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .11), rgba(255, 255, 255, .05)); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
.mu-err { margin: 0; padding: 20px 16px; font-size: 13px; color: var(--pm-ink2); line-height: 1.5; }
.mu-opts { margin: 10px 0 12px; }
.mu-add { margin-bottom: 4px; }
.mu-row { cursor: pointer; }
.mu-row .eq { color: var(--pm-acc); margin-right: 6px; }
.mu-row:focus-visible { outline: 2px solid var(--pm-acc); outline-offset: -2px; }
.mu-note { margin: 14px 4px 4px; font-size: 11.5px; line-height: 1.5; color: var(--pm-ink3); }

/* ---------- sideways rows: faded edges where there's more, arrows on the category row ---------- */
.pm .ui-more-r:not(.ui-hs-wrap) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.pm .ui-more-l:not(.ui-hs-wrap) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); mask-image: linear-gradient(90deg, transparent, #000 48px); }
.pm .ui-more-l.ui-more-r:not(.ui-hs-wrap) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.pm .ui-dragging { cursor: grabbing; scroll-snap-type: none; }
.pm .ui-dragging * { pointer-events: none; }
.ui-hs-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.ui-hs-wrap > .ps-cats { flex: 1; }
.ui-hs-btn { position: absolute; top: 50%; z-index: 1; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(16, 18, 26, .85); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .2s, background .15s; }
.ui-hs-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ui-hs-btn:hover { background: rgba(40, 44, 56, .95); }
.ui-hs-btn.l { left: 0; }
.ui-hs-btn.r { right: 0; }
.ui-hs-wrap.ui-more-l .ui-hs-btn.l, .ui-hs-wrap.ui-more-r .ui-hs-btn.r { opacity: 1; pointer-events: auto; }
@media (pointer: coarse) { .ui-hs-btn { display: none; } }
