    @font-face{
      font-family:"NEBULAR";
      src:
      url("/static/fonts/Nebula-Regular.woff") format("woff"),
      url("/static/fonts/Nebula-Regular.otf") format("opentype");
      font-weight:400; font-style:normal; font-display:swap;
    }
    @font-face{
      font-family:"LED";
      src:
      url("/static/fonts/led.woff") format("woff"),
      url("/static/fonts/led.ttf") format("truetype");
      font-weight:400; font-style:normal; font-display:swap;
    }
    @font-face{
      font-family:"MYO";
      src:
      url("/static/fonts/myo.woff") format("woff"),
      url("/static/fonts/myo.ttf") format("truetype");
      font-weight:400; font-style:normal; font-display:swap;
    }
    @font-face{
      font-family:"CALC";
      src:
      url("/static/fonts/calc.woff") format("woff"),
      url("/static/fonts/clac.ttf") format("truetype");
      font-weight:400; font-style:normal; font-display:swap;
    }
    @font-face{
      font-family:"NEBULA";
      src: url("/static/fonts/Nebula-Hollow.woff") format("woff2");
      font-weight:400; font-style:normal; font-display:swap;
    }




/* Theme: Light (default) */
:root{
  /* control sizing */
  --ctl-fs: 1rem;
  --ctl-fs-sm: 0.85rem;
  --ctl-fs-na: 0.65rem;

  --ctl-lh: 1.1;
  --ctl-py: 0.45rem;
  --ctl-px: 0.70rem;
  --ctl-radius: 8px;

  /* palette */
  --bg: #ffffff;
  --fg: #111111;


  --fg-muted: #444444;

  --ui-bg: rgba(0,0,0,0.06);
  --ui-border: yellow;

  --ctl-bg: rgba(0,0,0,0.06);
  --ctl-bg-hover: rgba(0,0,0,0.12);
  --ctl-border: rgba(0,0,0,0.28);

  --panel-bg: rgba(255,255,255,0.96);
  --panel-border: rgba(0,0,0,0.12);

  --kbd-bg: rgba(0,0,0,0.06);
  --kbd-border: rgba(0,0,0,0.22);

  --overlay: rgba(0,0,0,0.40);

  /* legacy aliases (kept) */
  --clr-text: var(--fg);
  --clr-ui-bg: var(--ui-bg);
  --clr-ui-border: var(--ui-border);
  --clr-ctl-bg: var(--ctl-bg);
  --clr-ctl-bg-hover: var(--ctl-bg-hover);
  --clr-ctl-border: var(--ctl-border);

  /* icon filter for external SVG <img> */
  --icon-filter: none; /* black icon for light theme */

  --f-error: red;


  --toast-font-color : white;
  --toast-bg: black;
  --toast-border: rgba(255,255,255,0.12);  



}



/* Theme: Dark */
:root[data-theme="dark"]{

  --bg: #000000;
  --fg: #ffffff;

  --fg-muted: #cccccc;

  --ui-bg: rgba(255,255,255,0.06);
  --ui-border: rgba(255,255,255,0.12);

  --ctl-bg: rgba(255,255,255,0.08);
  --ctl-bg-hover: rgba(255,255,255,0.14);
  --ctl-border: rgba(255,255,255,0.28);

  --panel-bg: rgba(12,12,14,0.96);
  --panel-border: rgba(255,255,255,0.12);

  --kbd-bg: rgba(255,255,255,0.08);
  --kbd-border: rgba(255,255,255,0.22);

  --overlay: rgba(0,0,0,0.45);

  --clr-text: var(--fg);
  --clr-ui-bg: var(--ui-bg);
  --clr-ui-border: var(--ui-border);
  --clr-ctl-bg: var(--ctl-bg);
  --clr-ctl-bg-hover: var(--ctl-bg-hover);
  --clr-ctl-border: var(--ctl-border);

  --icon-filter: invert(1) brightness(100%); /* make black SVG appear white */

  --gui-titles: #88ccff; /* customize as needed */

  --toast-font-color : black;
  --toast-bg: white;
  --toast-border: rgba(255,255,255,0.12);  


}

/* Theme: follow system when no explicit data-theme */
@media (prefers-color-scheme: dark){
  :root:not([data-theme]){
    --bg: #000000; --fg:#ffffff; --fg-muted:#cccccc;
    --ui-bg: rgba(255,255,255,0.06); --ui-border: rgba(255,255,255,0.12);
    --ctl-bg: rgba(255,255,255,0.08); --ctl-bg-hover: rgba(255,255,255,0.14); --ctl-border: rgba(255,255,255,0.28);
    --panel-bg: rgba(12,12,14,0.96); --panel-border: rgba(255,255,255,0.12);
    --kbd-bg: rgba(255,255,255,0.08); --kbd-border: rgba(255,255,255,0.22);
    --overlay: rgba(0,0,0,0.45);
    --clr-text: var(--fg);
    --clr-ui-bg: var(--ui-bg);
    --clr-ui-border: var(--ui-border);
    --clr-ctl-bg: var(--ctl-bg);
    --clr-ctl-bg-hover: var(--ctl-bg-hover);
    --clr-ctl-border: var(--ctl-border);
    --icon-filter: invert(1) brightness(100%);
  }
}

/* Base */
*{ box-sizing: border-box; }


/* Replace this one rule in your stylesheet */
html, body{
  height:100%;
  margin:0;
  background: var(--bg);
  color: var(--fg); /* was var(--fg-muted); ensures light text in dark mode */
  font-family: "CALC", system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0px;
}

#app{ position:fixed; inset:0; }

/* UI container */
#ui{
  position: fixed;
  left: 12px;
  bottom: 12px;
  display:none;
  flex-wrap:wrap;
  gap:8px;
  z-index:30;
  background: var(--clr-ui-bg);
  border:1px solid var(--clr-ui-border);
  border-radius:10px;
  padding: 8px 10px;
  backdrop-filter: blur(6px);
  align-items:center;
  max-width: 75%;
}

/* Form controls */
button,
label.btn,
select,
input[type="checkbox"]+label{
  appearance: none;
  border: 1px solid var(--clr-ctl-border);
  background: var(--clr-ctl-bg);
  color: var(--clr-text);
  border-radius: var(--ctl-radius);
  padding: var(--ctl-py) var(--ctl-px);
  cursor: pointer;
  font-weight:600;
  font-size: var(--ctl-fs-sm);
  line-height: var(--ctl-lh);
  font-family: CALC, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}
button:hover,
label.btn:hover,
select:hover{ background: var(--clr-ctl-bg-hover); }

input[type="file"]{ display:none; }
input[type="checkbox"]{ display:none; }
input[type="checkbox"]+label{ user-select:none; }
input[type="checkbox"]:checked+label{
  background: rgba(100,255,160,0.18);
  border-color: rgba(100,255,160,0.5);
}

/* Selects */
select{
  width:auto;
  display:inline-block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin:0.1rem;
  height: calc(var(--ctl-lh) * 1em + (var(--ctl-py) * 2));
}

/* Playlist select position */
#playlistSelect{
  max-width:25%;
  position:absolute;
  top: 0.5rem;
  left: 2.75rem;
}

/* Search toggle/button */
#searchToggle{
  position:absolute;
  top:0.25rem;
  left:0.1rem;
  z-index:31;
  border:0;
  background:transparent;
  color:var(--clr-text);
  border-radius:var(--ctl-radius);
  padding: var(--ctl-py) var(--ctl-px);
  cursor:pointer;
  font-weight:600;
  font-size: var(--ctl-fs);
  line-height: var(--ctl-lh);
}
#searchToggle:hover{ background: var(--clr-ctl-bg-hover); }

/* Search panel */
#searchPanel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 32;
  width: min(720px, calc(100vw - 2rem));
  max-height: 74vh;
  padding: 40px 16px 12px 16px;
  display: flex;
  flex-direction: column-reverse;
  gap: 0px;
  overflow: hidden;
  backdrop-filter: blur(24px);
}

/* Search input */
#searchInput{
  width:100%; box-sizing:border-box;
  border:1px solid var(--clr-ui-border);
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  color: var(--fg);
  border-radius:999px; padding:14px 18px; margin:0;
  font-weight:600; font-size:1.05rem;
  outline:none;
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--fg) 6%, transparent), 0 8px 26px rgba(0,0,0,.45);
  font-family: LED, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
}
#searchInput::placeholder{
  color: color-mix(in srgb, var(--fg) 70%, transparent);
  font-family: LED, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
}

/* Search results */
#searchResults{
  list-style:none; margin:6px 0 0 0; padding:0 6px 6px 6px;
  flex:1 1 auto; min-height:0; overflow:auto; scrollbar-width:none;
  display:flex; flex-direction:column; align-items:center; gap:6px;
}
#searchResults::-webkit-scrollbar{ display:none; }

#searchResults li{
  display:flex; align-items:center; gap:.6rem; padding:10px 12px; border-radius:10px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer;
  border:1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  width:100%; max-width:680px;
  background: color-mix(in srgb, var(--bg) 4%, transparent);
  color: var(--fg-muted);
}
#searchResults li:hover{
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  border-color: color-mix(in srgb, var(--fg) 18%, transparent);
  color: #FFEB3B;
}
#searchResults .badge{
  flex:0 0 auto; font-size:.75rem; opacity:.85; padding:2px 6px; border-radius:6px;
  border:1px solid var(--clr-ui-border);
  background: var(--clr-ui-bg);
  color: var(--fg);
}
#searchResults .label{
  flex:1 1 auto; overflow:hidden; text-overflow:ellipsis;
}

/* Overlay */
.ui-overlay{
  position: fixed; inset: 0;
  display: grid; place-items: center;
  z-index: 9999; pointer-events: none; padding: 24px;
}
.rb-btn{
  pointer-events: auto;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--clr-ui-border);
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  color: var(--clr-text);
  background: transparent;
}
.rb-btn > span{
  background: linear-gradient(90deg,#ff6b6b,#ffd93d,#6bff95,#59d1ff,#b18cff,#ff6bda,#ff6b6b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: .2px; font-family: 'NEBULAR'; font-size: 1.5rem;
}
.rb-btn:hover{ border-color: color-mix(in srgb, var(--fg) 35%, transparent); }
.rb-btn:active{ transform: translateY(1px); }
.rb-btn:focus-visible{ outline: 2px solid var(--fg); outline-offset: 3px; }
@media (max-width: 480px){
  .rb-btn{ padding: 11px 16px; border-radius: 10px; }
  .rb-btn > span{ font-size: 16px; }
}

/* lil-gui palette */
.lil-gui.root{
  --background-color: color-mix(in srgb, var(--bg) 75%, rgba(0,0,0,0.75));
  --text-color: var(--fg);
  --title-background-color: color-mix(in srgb, var(--bg) 85%, rgba(0,0,0,0.85));
  --widget-color: color-mix(in srgb, var(--bg) 90%, rgba(0,0,0,0.90));
  --hover-color: color-mix(in srgb, var(--bg) 80%, rgba(0,0,0,0.80));
  --number-color:#9fe2ff;
  z-index:20;
}

/* lil-gui sizing */
.lil-gui{
  --font-size: 0.7rem;
  --input-font-size: 9px;
  --padding: 2px;
  --spacing: 1px;
  --widget-height: 18px;
  --name-width: 50%;
  --slider-knob-width: 3px;
  --slider-input-width: 28%;
  --color-input-width: 28%;
  --slider-input-min-width: 46px;
  --color-input-min-width: 46px;
  --folder-indent: 8px;
  --widget-border-radius: 1px;
  --scrollbar-width: 4px;
  letter-spacing: 0px;
  font-family: "CALC", system-ui, -apple-system, Segoe UI, Avenir, sans-serif;

  --widget-height: 20px;
  --padding: 3px;
  --spacing: 1px;
  --font-size: 13px;
  --input-font-size: 16px;
  --folder-indent: 10px;
  --scrollbar-width: 7px;
  --slider-input-min-width: 50px;
  --color-input-min-width: 65px;
}

/* lil-gui custom title color: Deformation */
:root{
  --gui-title-deformation: #88ccff; /* customize as needed */
}
.lil-gui .folder-deformation > .title{
  color: var(--gui-title-deformation);
}

@media (pointer:coarse){
  .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {
    --widget-height: 20px!important;
    --padding: 2px;
    --spacing: 2px;
    --font-size:0.75rem;
    --input-font-size: 16px;
    --folder-indent: 10px;
    --scrollbar-width: 7px;
    --slider-input-min-width: 50px;
    --color-input-min-width: 65px;
  }
}

.hidden{ display:none !important; }







/* Mobile UI Toggle Button */
#uiToggleBtn{
  position: fixed;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border: none; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  backdrop-filter: blur(6px);
  color: var(--fg);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 9999; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid #8bc34a61;
}
#uiToggleBtn svg circle{ fill: none; stroke: currentColor; opacity: .35; }
#uiToggleBtn svg path{ stroke: currentColor; }
#uiToggleBtn:active{ transform: translateY(1px) scale(0.98); }
@media (hover: hover) and (pointer: fine){ #uiToggleBtn{ display: none; } }

/* Shortcuts UI */
#helpBtn{
  position: fixed;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(80px + env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border: 1px solid var(--clr-ui-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  color: var(--fg); font-weight: 800; font-size: 20px; line-height: 1;
  display: grid; place-items: center; z-index: 9999; cursor: pointer;
  backdrop-filter: blur(6px);
}
#helpBtn:active{ transform: translateY(1px) scale(.98); }
@media (hover:hover) and (pointer:fine){ #helpBtn{ opacity:.9; } #helpBtn:hover{ opacity:1; } }

.help-modal{
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}
.help-panel{
  width: min(620px, calc(100vw - 2rem));
  max-height: 80vh; overflow: auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  color: var(--fg);
  padding: 16px 16px 16px 16px;
  font-family: CALC, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
}
.help-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 6px; }
.help-head h2{ margin:0; font-size: 1.1rem; letter-spacing: 1px; }

#helpClose{
  border: 1px solid var(--clr-ui-border);
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  color: var(--fg);
  border-radius: 8px; width: 36px; height: 32px; cursor:pointer;
  display:grid; place-items:center;
}
#helpClose:hover{ background: color-mix(in srgb, var(--bg) 16%, transparent); }

/* External SVG file in <img>: follow theme via filter */
#helpClose img{
  display:block; width:20px; height:20px;
  filter: var(--icon-filter);
}

/* Shortcut list */
.help-list{
  list-style: none; margin: 8px 2px 6px 2px; padding: 0; display:grid; gap:8px;
  font-size: clamp(13px, 2.9vw, 15px);
}
.help-list li{ display:flex; align-items:center; gap:10px; }
.help-list kbd{
  display:inline-block; min-width: 26px; text-align:center;
  padding: 4px 8px; border-radius: 6px;
  border:1px solid var(--kbd-border);
  background: var(--kbd-bg); color: var(--fg);
  font-weight:700; letter-spacing:.5px;
}


/* UI toggles: mobile-only round button + stack order */
#uiToggleBtn{
  position: fixed;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  backdrop-filter: blur(6px);
  color: var(--fg);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 9999; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#uiToggleBtn svg circle{ fill: none; stroke: currentColor; opacity: .35; }
#uiToggleBtn svg path{ stroke: currentColor; }
#uiToggleBtn:active{ transform: translateY(1px) scale(.98); }
@media (hover:hover) and (pointer:fine){ #uiToggleBtn{ display:none; } }

/* Shortcuts button */
#helpBtn{
  position: fixed;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border: 1px solid var(--clr-ui-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  color: var(--fg); font-weight: 800; font-size: 20px; line-height: 1;
  display: grid; place-items: center; z-index: 9999; cursor: pointer;
  backdrop-filter: blur(6px);
}
#helpBtn:active{ transform: translateY(1px) scale(.98); }
@media (hover:hover) and (pointer:fine){ #helpBtn{ opacity:.9; } #helpBtn:hover{ opacity:1; } }

/* Theme toggle */
#themeToggle{
  position: fixed;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(140px + env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border: 1px solid var(--clr-ui-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  color: var(--fg);
  display:grid; place-items:center;
  z-index: 9999; cursor:pointer; -webkit-tap-highlight-color:transparent;
  backdrop-filter: blur(6px);
}
#themeToggle:active{ transform: translateY(1px) scale(.98); }
@media (hover:hover) and (pointer:fine){ #themeToggle{ opacity:.9; } #themeToggle:hover{ opacity:1; } }
#themeToggle img{ display:block; width:18px; height:18px; filter: var(--icon-filter); }

/* Login button */
#loginBtn{
  position: fixed;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(188px + env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border: 1px solid var(--clr-ui-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  color: var(--fg);
  display:grid; place-items:center;
  z-index: 9999; cursor:pointer; -webkit-tap-highlight-color:transparent;
  backdrop-filter: blur(6px);
}
#loginBtn:active{ transform: translateY(1px) scale(.98); }
@media (hover:hover) and (pointer:fine){ #loginBtn{ opacity:.9; } #loginBtn:hover{ opacity:1; } }
#loginBtn img{ display:block; width:18px; height:18px; filter: var(--icon-filter); pointer-events:none; }

/* Overlays */
.help-modal{ position:fixed; inset:0; z-index:10000; display:grid; place-items:center; background:var(--overlay); backdrop-filter:blur(4px); }
.help-panel{
  width:min(620px, calc(100vw - 2rem));
  max-height:80vh; overflow:auto;
  background:var(--panel-bg);
  border:1px solid var(--panel-border);
  border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.55);
  color:var(--fg);
  padding: 16px;
  font-family: CALC, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
}
.help-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.help-head h2{ margin:0; font-size:1.1rem; letter-spacing:1px; }

/* Close buttons (help/login/account) */
#helpClose,#loginClose,#accountClose{
  box-sizing:border-box; display:grid; place-items:center;
  width:36px; height:36px; padding:0; line-height:0;
  border:1px solid var(--clr-ui-border); border-radius:10px;
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  color:var(--fg); cursor:pointer; backdrop-filter:blur(6px);
}
#helpClose:hover,#loginClose:hover,#accountClose:hover{ background: color-mix(in srgb, var(--bg) 16%, transparent); }
#helpClose img,#loginClose img,#accountClose img{ display:block; width:20px; height:20px; filter:var(--icon-filter); pointer-events:none; }

/* Shortcuts list */
.help-list{ list-style:none; margin:8px 2px 6px; padding:0; display:grid; gap:8px; font-size:clamp(13px,2.9vw,15px); }
.help-list li{ display:flex; align-items:center; gap:10px; }
.help-list kbd{
  display:inline-block; min-width:26px; text-align:center; padding:4px 8px; border-radius:6px;
  border:1px solid var(--kbd-border); background:var(--kbd-bg); color:var(--fg); font-weight:700; letter-spacing:.5px;
}

/* Login modal form */
#loginModal .help-panel{ max-width:360px; }
#loginModal .form-row{ display:flex; flex-direction:column; gap:6px; margin:10px 0; }
#loginModal label{ font-size:.9rem; opacity:.9; color:var(--fg); }
#loginModal input{
  height:34px; padding:6px 8px; border:1px solid var(--clr-ui-border); background:var(--panel-bg); color:var(--fg); border-radius:6px;
}
#loginModal input::placeholder{ color: color-mix(in srgb, var(--fg) 55%, transparent); }
#loginModal input:focus{ outline:0; border-color: var(--accent,#ff0245); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent,#ff0245) 30%, transparent); }
#loginModal .form-actions{ margin-top:14px; }
#loginModal .form-actions button{ height:34px; }
.form-error{
  margin:4px 0 8px; padding:6px 8px; border-radius:6px;
  border:1px solid color-mix(in srgb, var(--fg) 22%, transparent);
  background: color-mix(in srgb, var(--bg) 16%, transparent);
  color: var(--f-error); font-weight:700; letter-spacing:.5px;
}
@media (pointer:coarse){ #loginModal input{ height:40px; } #loginModal .form-actions button{ height:40px; } }

/* Account overlay */
.acct-head{ display:flex; align-items:center; gap:12px; margin:8px 0 12px; }
.acct-avatar{ width:48px; height:48px; border-radius:50%; object-fit:cover; border:1px solid var(--clr-ui-border); }
.acct-meta{ display:flex; flex-direction:column; gap:2px; }
.acct-name{ font-weight:700; }
.acct-email{ opacity:.8; font-size:.9rem; }
.acct-tabs{ display:flex; gap:6px; margin:6px 0 10px; }
.acct-tab{ appearance:none; border:1px solid var(--clr-ui-border); background: color-mix(in srgb, var(--bg) 12%, transparent); color:var(--fg); border-radius:8px; padding:6px 10px; cursor:pointer; font-weight:600; }
.acct-tab.is-active{ background: color-mix(in srgb, var(--bg) 22%, transparent); }
.acct-panels{ display:block; }
.acct-panel{ display:none; }
.acct-panel.is-active{ display:block; }
.acct-kv{ display:flex; flex-direction: column; gap:16px; margin:0; }
.acct-kv dt{ opacity:.5; }
.acct-kv dd{ margin:0; }
.acct-list{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.acct-item{ padding:8px 10px; border:1px solid var(--clr-ui-border); border-radius:8px; background: color-mix(in srgb, var(--bg) 10%, transparent); }

/* Albums grid: square covers + title overlay + responsive columns */
.albums-grid{
  display:grid; gap:16px;
  grid-template-columns:repeat(3,1fr);
}
@media (min-width:920px){ .albums-grid{ grid-template-columns:repeat(4,1fr); } }
@media (min-width:1280px){ .albums-grid{ grid-template-columns:repeat(5,1fr); } }










.albums-grid .album-card{
  position:relative; border-radius:12px; overflow:hidden;
  background:#0c0c0c; box-shadow:0 0 0 1px rgba(255,255,255,.06) inset;
  cursor:pointer;
}
.albums-grid .album-card .album-cover{ width:100%; aspect-ratio:1/1; overflow:hidden; background:#111; }
.albums-grid .album-card .album-cover img{ display:block; width:100%; height:100%; object-fit:cover; }
.albums-grid .album-card .album-title{
  position:absolute; left:0; right:0; bottom:0; padding:10px 12px;
  background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.65) 70%, rgba(0,0,0,.8) 100%);
  color:#fff; font-family:NEBULA, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
  font-size:16px; line-height:1.15; letter-spacing:.02em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none; z-index:1;
}

/* Create and ghost tiles */
.albums-grid .album-card.create{ background: color-mix(in srgb, var(--bg) 4%, transparent); }
.albums-grid .album-card.create .album-cover{ display:flex; align-items:center; justify-content:center; background:#0f0f0f; border:2px dashed var(--clr-ui-border); }
.albums-grid .album-card.create .plus{ font-size:28px; line-height:1; color:#eaeaea; opacity:.9; }
.albums-grid .album-card.ghost{ pointer-events:none; background:transparent; }
.albums-grid .album-card.ghost .album-cover{ background:#0e0e0e; border:1px dashed color-mix(in srgb, var(--fg) 20%, transparent); }
.albums-grid .album-card.ghost .album-title{ display:none; }





/* Album editor layout + square cover */
.album-editor{
  width:min(960px, calc(100vw - 1rem));
  max-height:95vh;
  overflow:auto;
}

.ae-row{
  display:grid;
  grid-template-columns:minmax(0,280px) minmax(0,1fr);
  gap:16px;
}
@media (max-width:840px){
  .ae-row{ grid-template-columns:1fr; }
}

.ae-left{ display:grid; gap:10px; align-content:start; min-width:0; }
.ae-right{ display:grid; gap:12px; align-content:start; min-width:0; }

.ae-cover{
  width:100%;
  aspect-ratio:1/1;
  border:1px solid var(--panel-border);
  border-radius:12px;
  overflow:hidden;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  display:grid; place-items:center;
}
.ae-cover img{
  display:block; width:100%; height:100%; object-fit:cover;
}

.ae-cover-ctrls{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:8px; align-items:center;
}
#aeCoverUrl{
  width:100%;
  min-width:0;            /* prevents overflow on narrow screens */
  height:34px; padding:6px 8px;
  border:1px solid var(--widget-color);
  background:var(--panel-bg); color:var(--text-color);
  border-radius:6px;
}
#aeCoverFile{ display:none; }

.ae-vis{ display:grid; gap:6px; }

.ae-field{ display:grid; gap:6px; min-width:0; }
.ae-field label{ font-weight:700; color: var(--fg-muted); }
.ae-field input[type="text"], .ae-field textarea{
  border:1px solid #2c2c2c; background:var(--panel-bg);
  color:var(--text-color); padding:8px; min-width:0;
}
.ae-field-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.ae-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.ae-actions > *{ flex:0 0 auto; }

#aeTracks{
  display:grid; gap:6px;
  border:1px dashed var(--clr-ui-border);
  border-radius:10px; padding:8px; min-height:56px;
  background: color-mix(in srgb, var(--bg) 6%, transparent);
  overflow-x:hidden;
}

/* track row: allow middle column to shrink so buttons remain visible */
.ae-track{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) auto;
  gap:10px; align-items:center;
  border:1px solid var(--clr-ui-border);
  border-radius:8px;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  padding:8px;
}
.ae-track .grip{ cursor:grab; user-select:none; }
.ae-track .title{
  min-width:0;                 /* enables ellipsis */
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ae-row-actions{ display:inline-grid; grid-auto-flow:column; gap:8px; }
.ae-track .rm{
  appearance:none; border:1px solid var(--clr-ui-border);
  background:transparent; color:var(--fg);
  border-radius:8px; padding:6px 10px; cursor:pointer;
}

/* compact tweaks for very small screens */
@media (max-width:420px){
  .album-editor{ width:calc(100vw - 1rem); }
  .ae-row{ gap:12px; }
  .ae-cover-ctrls{ grid-template-columns:1fr auto auto; }
  .ae-actions{ gap:6px; }
}









/* Picker */
.ae-picker{ position:fixed; inset:0; z-index:10001; display:grid; place-items:center; align-content: center; background:var(--overlay); backdrop-filter:blur(4px); }
.ae-picker .ae-picker-head{ display:flex; align-items:center; justify-content:space-between; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:12px; padding:8px 10px; width:min(920px, calc(100vw - 2rem)); }
.ae-picker .ae-picker-actions{ display:flex; gap:8px; align-items:center; }
#aeSearch{
  width:min(680px,100%); height:34px; padding:14px 18px;
  border:1px solid yellow; border-radius:999px;
  background: color-mix(in srgb, var(--bg) 10%, transparent); color:var(--fg);
  font-weight:600; font-size:1.05rem; outline:none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 6%, transparent), 0 8px 26px rgba(0,0,0,.45);
  font-family: LED, system-ui, -apple-system, Segoe UI, Avenir, sans-serif;
}
#aeSearch::placeholder{ color: color-mix(in srgb, var(--fg) 70%, transparent); font-family: LED, system-ui, -apple-system, Segoe UI, Avenir, sans-serif; }

.ae-results{ list-style:none; margin:8px auto 0; padding:0; max-height:75vh; overflow:auto; width:min(920px, calc(100vw - 2rem)); display:grid; gap:8px; }
.ae-results li{ display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; border:1px solid var(--clr-ui-border); border-radius:10px; background: color-mix(in srgb, var(--bg) 8%, transparent); padding:10px 12px; cursor:pointer; }
.ae-results .title{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ae-row-actions{ display:inline-grid; grid-auto-flow:column; gap:8px; }
.ae-results .add, .ae-results .play{ appearance:none; border:1px solid var(--clr-ui-border); background:transparent; color:var(--fg); border-radius:8px; padding:6px 10px; cursor:pointer; }
.ae-results .add[disabled], .ae-results .play[disabled]{ opacity:.45; pointer-events:none; filter:grayscale(.3); }
.ae-results li.is-playing{ border-color: yellow; background: color-mix(in srgb, var(--bg) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--fg) 18%, transparent) inset; }
.ae-results li.is-playing .play{ opacity:.85; }

.hidden{ display:none !important; }


/* Close buttons (help/login/account/album editor) */
#helpClose,#loginClose,#accountClose,#albumEditorClose{
  box-sizing:border-box; display:grid; place-items:center;
  width:36px; height:36px; padding:0; line-height:0;
  border:1px solid var(--clr-ui-border); border-radius:10px;
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  color:var(--fg); cursor:pointer; backdrop-filter:blur(6px);
}
#helpClose:hover,#loginClose:hover,#accountClose:hover,#albumEditorClose:hover{
  background: color-mix(in srgb, var(--bg) 16%, transparent);
}
/* External SVG in <img> follows theme via filter */
#helpClose img,#loginClose img,#accountClose img,#albumEditorClose img{
  display:block; width:20px; height:20px; pointer-events:none;
  filter: var(--icon-filter);
}



/* static/css/player.css — iOS input zoom prevention (keep computed font-size ≥16px) */
@supports (-webkit-touch-callout: none) {
  input, select, textarea {
    font-size: 16px !important;
  }
  /* scope to app overlays to avoid global typography shifts */
  #loginModal input, #loginModal select, #loginModal textarea,
  #accountModal input, #accountModal select, #accountModal textarea,
  #albumEditor input, #albumEditor select, #albumEditor textarea,
  #searchPanel input {
    font-size: 16px !important;
  }
}

/* Fallback for other touch devices */
@media (pointer: coarse) {
  input, select, textarea {
    font-size: 16px;
  }
}


/* iOS zoom prevention: keep text-size adjustments off and inputs ≥16px everywhere we use them */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }

@supports (-webkit-touch-callout: none) {
  #loginModal input, #loginModal select, #loginModal textarea,
  #accountModal input, #accountModal select, #accountModal textarea,
  #albumEditor input, #albumEditor select, #albumEditor textarea,
  #searchPanel input {
    font-size: 16px !important;
  }
}

/* Ensure our common small controls don’t trigger zoom by accident */
#searchInput, #aeSearch, #aeTitle, #aeBand, #aeDesc, #aeCoverUrl {
  font-size: 16px;
}





/* Album editor — SortableJS states (mobile-friendly, no text selection/magnifier) */
.ae-track { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ae-track .grip { cursor: grab; -webkit-user-select: none; user-select: none; touch-action: none; }
.ae-track .grip:active { cursor: grabbing; }

/* Sortable visual states */
.ae-track.sortable-chosen { outline: 2px solid color-mix(in srgb, var(--fg) 35%, transparent); }
.ae-track.sortable-ghost  { opacity: .55; background: color-mix(in srgb, var(--bg) 24%, transparent); }
.ae-track.sortable-fallback { opacity: .75; }
.ae-track.sortable-swap-highlight { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #ff0245) 55%, transparent) inset; }

#aePickerClose {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
}



/* Album editor — micro toast (center flash for ~1s) */
#aeToastHost{
  position: fixed;
  inset: 0;
  z-index: 10002;
  pointer-events: none;
}

.ae-toast{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--toast-border);
  background: var(--toast-bg);
  color: var(--toast-font-color);
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  user-select: none;
  will-change: opacity, transform;
}

.ae-toast.is-shown{
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (prefers-reduced-motion: reduce){
  .ae-toast, .ae-toast.is-shown{ transition: none; }
}


.ae-left{ display:grid; gap:10px; align-content:start; }
.ae-right{ display:grid; gap:12px; align-content:start; }




/* Albums grid: square covers + title overlay + responsive columns */
.albums-grid{
  display:grid;
  gap:16px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  width:100%;
  min-width:0;
  list-style:none;
  margin:0;           /* remove UL default margin */
  padding:0;          /* remove UL default left padding causing the gap */
  box-sizing:border-box;
}

/* Force at least two columns on very small screens */
@media (max-width:480px){
  .albums-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:12px;
  }
}

@media (min-width:920px){
  .albums-grid{
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
@media (min-width:1280px){
  .albums-grid{
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* Ensure grid never forces horizontal scroll inside overlays */
.help-panel .albums-grid,
.account-panel .albums-grid{
  width:100%;
  min-width:0;
  overflow:hidden;
}

