/* =====================================================================
   app.css
   Dreamy / pastel / dreamcore overlay on top of 98.css.
   Keeps 98.css's chiselled 3D look intact, swaps the accent colours
   for soft pinks and lavenders, and adds a few cute touches.
   ===================================================================== */

:root {
  --bg-cloud-1: #f4d4ff;
  --bg-cloud-2: #c8b6ff;
  --bg-cloud-3: #ffd6e7;
  --accent:     #c79ce6;
  --accent-2:   #ffb3d1;
  --accent-dk:  #8a5bb1;
  --titlebar-1: #b07ad6;
  --titlebar-2: #ec90c8;
  --highlight-bg: #f0a8d8;
  --highlight-fg: #4a1a3a;
  --hint-fg:    #6b3e7e;
  --text-base:      15px;
  --text-ui:        14px;
  --text-sm:        13px;
  --text-lg:        17px;
  --text-xl:        20px;
  --text-hero-desc: 16px;
  --line-body:      1.55;
  /* Win98 bitmap UI vs readable copy (Tahoma = MS Sans successor on WinXP) */
  --font-chrome: "Pixelated MS Sans Serif", "Microsoft Sans Serif", sans-serif;
  --font-read:   Tahoma, "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

/* ---- Cursor (32x32 arrow + a small pink heart) -------------------- */
/* Default cursor for the whole document */
html, body {
  cursor:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><polygon points='2,2 2,22 8,18 12,27 15,26 11,17 19,17' fill='white' stroke='%23222' stroke-width='1.5' stroke-linejoin='round'/><path d='M22 18 c0,-2 3,-3 4.5,-1 c1.5,-2 4.5,-1 4.5,1 c0,3 -4.5,6 -4.5,6 c0,0 -4.5,-3 -4.5,-6 z' fill='%23ff9ec7' stroke='%23a14a85' stroke-width='1.2'/></svg>")
    2 2,
    default;
}
/* "Pointer" cursor for interactive surfaces — same shape but a brighter heart */
button,
a,
.file-icon,
.menubar li,
.tree-view li,
[data-act],
.title-icon,
.title-bar-controls > button,
input[type=range],
input[type=checkbox],
.led-block.item {
  cursor:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><polygon points='2,2 2,22 8,18 12,27 15,26 11,17 19,17' fill='white' stroke='%23222' stroke-width='1.5' stroke-linejoin='round'/><path d='M22 17 c0,-2.5 3.2,-3.5 5,-1.5 c1.8,-2 5,-1 5,1.5 c0,3.3 -5,6.5 -5,6.5 c0,0 -5,-3.2 -5,-6.5 z' fill='%23ff6ea8' stroke='%23a14a85' stroke-width='1.2'/></svg>")
    2 2,
    pointer;
}
/* Text fields use a normal I-beam */
input[type=text],
input[type=number],
textarea,
select,
.doc-body { cursor: text; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,214,231,.55), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(200,182,255,.55), transparent 55%),
    radial-gradient(circle at 50% 90%, rgba(244,212,255,.55), transparent 60%),
    linear-gradient(135deg, #f4d4ff 0%, #c8b6ff 50%, #ffd6e7 100%);
  font-family: var(--font-read);
  font-size: var(--text-base);
  line-height: var(--line-body);
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography: Tahoma for readable text, MS Sans for Win98 chrome ---- */
#explorer,
#explorer .status-bar-field,
.win-window .window-body,
.admin-window .admin-main,
.admin-window .admin-sidebar {
  font-family: var(--font-read);
  -webkit-font-smoothing: antialiased;
}

#explorer > .title-bar,
#explorer > .title-bar .title-bar-text,
.win-window > .title-bar,
.win-window > .title-bar .title-bar-text,
.admin-window > .title-bar,
.admin-window > .title-bar .title-bar-text,
#explorer .menubar,
#explorer .menubar li,
#explorer button:not(.topbar-text-btn),
.admin-window button,
.win-window .title-bar-controls button {
  font-family: var(--font-chrome);
  -webkit-font-smoothing: none;
}

#explorer .title-bar-controls .topbar-text-btn {
  font-family: var(--font-read);
  -webkit-font-smoothing: antialiased;
}

#explorer input,
#explorer select,
#explorer textarea,
#explorer label,
#explorer .addr-input,
#explorer .tree-view li,
.admin-window input,
.admin-window select,
.admin-window textarea,
.admin-window label,
.admin-window .field-row,
.admin-window .nm-edit,
.admin-window .led-mini {
  font-family: var(--font-read);
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-ui);
}

#explorer,
#explorer .status-bar-field,
.win-window .window-body {
  font-size: var(--text-base);
  line-height: var(--line-body);
}

#sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
#sparkles::before, #sparkles::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffffff 0 1px, transparent 2px),
    radial-gradient(circle, #ffe7f3 0 1px, transparent 2px),
    radial-gradient(circle, #d6c0ff 0 1px, transparent 2px);
  background-size: 130px 130px, 170px 170px, 220px 220px;
  background-position: 0 0, 40px 60px, 90px 20px;
  opacity: .5;
  animation: drift 60s linear infinite;
}
#sparkles::after {
  animation-duration: 90s;
  animation-direction: reverse;
  opacity: .35;
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(-130px, -130px); }
}

/* ---- Main explorer window ---------------------------------------- */
#explorer {
  position: fixed;
  top: 24px;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px grey,
    inset 2px 2px #dfdfdf,
    0 0 0 1px rgba(199,156,230,.6),
    0 12px 50px -10px rgba(138,91,177,.55);
  transition: top .2s, left .2s, right .2s, bottom .2s, box-shadow .2s;
}
body.is-fs #explorer {
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px grey,
    inset 2px 2px #dfdfdf;
}
body.is-fs #sparkles { opacity: .6; }
body.is-fs-locked #btn-fullscreen { display: none; }

#explorer > .title-bar,
.win-window > .title-bar {
  background: linear-gradient(90deg, var(--titlebar-1) 0%, var(--titlebar-2) 100%);
}
#explorer > .title-bar:not(:focus-within),
.win-window:not(.focused) > .title-bar {
  background: linear-gradient(90deg, #998cae 0%, #c2a8c2 100%);
}

.title-icon {
  display: inline-block;
  margin-right: 4px;
  color: #fff;
  text-shadow: 0 0 4px rgba(255,255,255,.7);
}
.title-icon:hover { color: #ffe7f3; }

/* Topbar text buttons (language + fullscreen) */
.title-bar-controls .topbar-text-btn {
  width: auto;
  height: 18px;
  min-width: 36px;
  padding: 0 8px;
  font-size: var(--text-ui);
  margin-right: 6px;
  background: silver;
  color: #000;
}
.title-bar-controls .topbar-text-btn::after { content: none; }

/* ---- Menubar ----------------------------------------------------- */
.menubar {
  list-style: none;
  margin: 0;
  padding: 2px 4px;
  background: silver;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #fff;
  box-shadow: inset 0 -1px grey;
}
.menubar li { padding: 2px 8px; font-size: var(--text-ui); }
.menubar li:hover {
  background: var(--titlebar-1);
  color: #fff;
}

/* ---- Address bar ------------------------------------------------- */
.addressbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: silver;
  border-bottom: 1px solid #fff;
  box-shadow: inset 0 -1px grey;
}
.addr-label { font-size: var(--text-ui); }
.addr-input {
  flex: 1;
  background: #fff;
  border: 1px solid grey;
  box-shadow: inset 1px 1px #0a0a0a;
  padding: 2px 6px;
  font-size: var(--text-ui);
  color: #222;
}

/* ---- Body layout ------------------------------------------------- */
.explorer-body {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4px;
  padding: 4px;
  min-height: 0;
  background: #d8c9e0;
}
.sidebar {
  overflow: auto;
  background: #fff;
}

/* "Precious Collection" sticky header */
.sidebar-title {
  position: sticky;
  top: 0;
  z-index: 2;
  font-family: var(--font-read);
  font-size: 18px;
  font-weight: bold;
  color: #8a5bb1;
  text-shadow: 1px 1px 0 #ffd6e7, 0 0 8px rgba(255,200,230,.6);
  background: linear-gradient(180deg, #fff0f7 0%, #ffe2f0 100%);
  padding: 10px 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px dashed #c79ce6;
  letter-spacing: 0.5px;
}
.sidebar-title .deco {
  font-size: 18px;
  filter: drop-shadow(0 0 3px rgba(255,200,230,.7));
}

.sidebar .tree-view { margin: 6px; padding-left: 4px; }
.sidebar .tree-view li {
  padding: 10px 12px;
  margin: 4px 2px;
  user-select: none;
  border-radius: 4px;
  font-size: var(--text-lg);
}
.sidebar .tree-view li.empty-hint {
  color: #777;
  font-style: italic;
}
.sidebar .tree-view li.selected {
  background: var(--highlight-bg);
  color: var(--highlight-fg);
}
.sidebar .item-num {
  display: inline-block;
  min-width: 42px;
  color: #8a5bb1;
  font-weight: bold;
  font-size: var(--text-lg);
}
.sidebar .tree-view li.selected .item-num { color: #fff; }

/* ---- Hero (cover + name + description) --------------------------- */
.hero {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  background: linear-gradient(180deg, #fff0f7 0%, transparent 100%);
  border-bottom: 1px dashed #c79ce6;
  align-items: stretch;
}
.hero.empty {
  display: none;
}
.hero-cover {
  width: 240px;
  height: 240px;
  background: #fff;
  border: 2px solid #c79ce6;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(138, 91, 177, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.hero-cover img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.hero-cover.placeholder {
  color: #c79ce6;
}
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding-top: 4px;
}
.hero-name {
  margin: 0;
  font-size: var(--text-xl);
  color: #8a5bb1;
  font-weight: bold;
  text-shadow: 0 1px 0 #fff;
}
.hero-desc {
  margin: 0;
  font-size: var(--text-hero-desc);
  line-height: var(--line-body);
  color: #5b3e7a;
  white-space: pre-wrap;
  word-break: break-word;
}
.hero-desc.muted {
  color: #a896b8;
  font-style: italic;
}
@media (max-width: 720px) {
  .hero {
    flex-direction: column;
  }
  .hero-cover {
    width: 100%;
    height: 200px;
  }
}

/* ---- File grid --------------------------------------------------- */
.filegrid-wrap {
  overflow: auto;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><g font-family='Apple Color Emoji, Segoe UI Emoji, sans-serif' opacity='0.08' style='filter:saturate(0.35) brightness(1.12)'><text x='22' y='46' font-size='30'>%F0%9F%8C%B8</text><text x='132' y='64' font-size='18'>%F0%9F%A5%BA</text><text x='218' y='42' font-size='26'>%F0%9F%8D%AC</text><text x='282' y='108' font-size='22'>%F0%9F%8C%99</text><text x='60' y='124' font-size='34'>%F0%9F%90%B0</text><text x='170' y='156' font-size='22'>%F0%9F%90%B1</text><text x='24' y='200' font-size='26'>%F0%9F%A6%8B</text><text x='108' y='220' font-size='18'>%F0%9F%8C%B7</text><text x='224' y='208' font-size='30'>%F0%9F%8D%93</text><text x='158' y='92' font-size='18'>%E2%98%81%EF%B8%8F</text><text x='266' y='268' font-size='22'>%E2%9D%A4</text><text x='48' y='282' font-size='22'>%F0%9F%8D%B0</text><text x='188' y='280' font-size='18'>%F0%9F%8C%B8</text></g></svg>");
  background-repeat: repeat;
  background-size: 320px 320px;
}
.filegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 24px;
  padding: 24px;
}
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #8a5bb1;
  padding: 60px 8px;
  font-style: italic;
  font-size: var(--text-base);
  text-shadow: 0 0 4px #fff;
}
.file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 8px;
  text-align: center;
  user-select: none;
  border: 1px dotted transparent;
  border-radius: 4px;
  transition: background .12s;
}
.file-icon:hover {
  border-color: #c79ce6;
  background: rgba(255,255,255,.6);
}
.file-icon.selected {
  background: rgba(240,168,216,.55);
  border: 1px dotted #8a5bb1;
}
.file-icon .ico {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 3px rgba(138,91,177,.25));
}
.file-icon .ico svg { width: 100%; height: 100%; }
.file-icon .label {
  font-size: 16px;
  overflow-wrap: break-word;
  word-break: normal;
  max-width: 100%;
  padding: 1px 3px;
  line-height: 1.35;
}
.file-icon.selected .label {
  background: var(--highlight-bg);
  color: var(--highlight-fg);
}

/* ---- Floating windows -------------------------------------------- */
.win-window {
  position: absolute;
  min-width: 240px;
  min-height: 120px;
  z-index: 100;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px grey,
    inset 2px 2px #dfdfdf,
    0 10px 35px -5px rgba(138,91,177,.5);
}
.win-window .title-bar { user-select: none; cursor: move; }
.win-window .window-body {
  margin: 4px;
  background: #fff;
  border: 1px solid #fff;
  box-shadow: inset 1px 1px grey, inset -1px -1px #fff;
  padding: 8px;
  overflow: auto;
}

/* Document viewer */
.doc-body {
  background: #fff;
  font-family: var(--font-read);
  font-size: var(--text-base);
  line-height: var(--line-body);
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 8px 10px;
  color: #2a1a35;
  max-width: 540px;
  min-width: 320px;
  min-height: 240px;
  height: 420px;
  overflow: auto;
}
.doc-body h1, .doc-body h2, .doc-body h3 { color: #8a5bb1; margin: 12px 0 6px; }
.doc-body strong { color: #b14a85; }
.doc-body code { background: #fceaf6; padding: 0 3px; }
.doc-body blockquote {
  border-left: 3px solid var(--accent-2);
  margin: 6px 0;
  padding-left: 8px;
  color: #6b3e7e;
}

/* Image viewer */
.img-window-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.img-viewer {
  display: flex;
  flex-direction: column;
  min-width: 420px;
  min-height: 300px;
  max-width: 80vw;
  max-height: 70vh;
}
.img-toolbar {
  flex-shrink: 0;
  padding: 6px 8px;
  background: silver;
  border-bottom: 1px solid #fff;
  box-shadow: inset 0 -1px grey;
  justify-content: center;
  gap: 8px;
}
.img-toolbar .img-zoom-level {
  min-width: 44px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #4a1a3a;
}
.img-body {
  background: #1a0e1f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 240px;
  overflow: auto;
  padding: 8px;
  touch-action: none;
}
.img-body.is-pannable {
  align-items: flex-start;
  justify-content: flex-start;
  cursor: grab;
}
.img-body.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.img-body.is-pannable img {
  cursor: grab;
}
.img-body.is-dragging img {
  cursor: grabbing;
}
.img-body img {
  display: block;
  image-rendering: auto;
  box-shadow: 0 0 30px rgba(255,180,220,.35);
  transition: width .12s ease, height .12s ease;
}

/* PDF viewer */
.pdf-viewer .pdf-page-count {
  margin-left: 8px;
  font-size: 11px;
  color: #4a1a3a;
}
.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: min-content;
}
.pdf-page canvas {
  display: block;
  background: #fff;
  box-shadow: 0 0 30px rgba(255,180,220,.35);
}
.pdf-status {
  color: #f5d0e8;
  padding: 24px 16px;
  font-size: 12px;
  text-align: center;
}
.img-body.is-pannable .pdf-pages {
  cursor: grab;
}
.img-body.is-dragging .pdf-pages {
  cursor: grabbing;
}

/* Video / audio viewer */
.media-body {
  background: #0e0716;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  min-width: 480px;
  min-height: 320px;
}
.media-body video {
  max-width: 80vw;
  max-height: 70vh;
  background: #000;
  display: block;
}
.audio-body {
  background: linear-gradient(135deg, #ffd6e7, #c8b6ff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  min-width: 360px;
}
.audio-body .audio-art {
  width: 96px;
  height: 96px;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: inset -1px -1px grey, inset 1px 1px #fff, 0 4px 12px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  color: var(--accent-dk);
}
.audio-body audio { width: 100%; }
.audio-body .audio-title {
  font-size: var(--text-base);
  color: #4a1a3a;
  text-align: center;
}

/* ---- Chat viewer ------------------------------------------------- */
.chat-body-wrap {
  background: #fff0f7;
  padding: 8px 8px 12px;
  min-width: 380px;
  height: 520px;
  overflow: auto;
  font-family: var(--font-read);
}
.chat-msg {
  display: flex;
  margin: 4px 0;
}
.chat-msg.left  { justify-content: flex-start; }
.chat-msg.right { justify-content: flex-end; }
.chat-bubble {
  max-width: 78%;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: var(--line-body);
  font-size: var(--text-base);
  box-shadow: 1px 1px 0 rgba(138, 91, 177, .18);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.left  .chat-bubble {
  background: #fff;
  border: 1px solid #c79ce6;
  border-top-left-radius: 2px;
}
.chat-msg.right .chat-bubble {
  background: #cdebd8;
  border: 1px solid #79c79c;
  border-top-right-radius: 2px;
}
.chat-speaker {
  font-size: var(--text-sm);
  color: #8a5bb1;
  margin-bottom: 2px;
}
.chat-msg.right .chat-speaker {
  color: #2a7a4a;
  text-align: right;
}
.chat-stamp {
  text-align: center;
  color: #888;
  font-size: var(--text-sm);
  margin: 8px 0;
}

/* ---- Admin panel ------------------------------------------------- */
.admin-window.win-window {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
.admin-window {
  width: min(980px, 96vw);
  height: min(740px, 92vh);
}
.admin-window > .window-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 4px;
}
.admin-window .admin-grid {
  flex: 1;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(280px, 32%) 1fr;
  grid-template-rows: 1fr;
  gap: 6px;
}
.admin-window .admin-sidebar {
  min-height: 0;
  overflow-y: auto;
}
.admin-sidebar {
  background: #fff;
  border: 1px solid grey;
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.admin-sidebar-head {
  padding: 6px;
  border-bottom: 1px solid #ddd;
  display: flex;
  gap: 4px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.admin-sidebar ul { list-style: none; margin: 0; padding: 4px; }
.admin-sidebar li {
  padding: 6px 4px;
  user-select: none;
  font-size: var(--text-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-sidebar li .li-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.admin-sidebar li .li-num {
  flex-shrink: 0;
  font-weight: bold;
  color: #8a5bb1;
}
.admin-sidebar li.selected .li-num { color: #fff; }
.admin-sidebar li .nm-edit {
  background: transparent;
  border: 1px solid transparent;
  padding: 1px 3px;
  font-size: var(--text-ui);
  flex: 1;
  min-width: 0;
  color: inherit;
}
.admin-sidebar li .nm-edit:hover {
  border-color: #c79ce6;
  background: #fff;
}
.admin-sidebar li .nm-edit:focus {
  border-color: #8a5bb1;
  background: #fff;
  outline: none;
  color: #2a1a3a;
}
.admin-sidebar li.selected .nm-edit:not(:focus) {
  color: #fff;
}
.admin-sidebar li:hover { background: #fff0f7; }
.admin-sidebar li.selected { background: var(--highlight-bg); color: var(--highlight-fg); }
.admin-sidebar li .led-tag {
  font-size: var(--text-sm);
  color: #888;
}
.admin-sidebar li.selected .led-tag { color: #fff; }

/* Inline LED-range editor (right side of each sidebar row). */
.admin-sidebar li .led-mini {
  width: 34px;
  height: 20px;
  padding: 0 2px;
  font-size: var(--text-sm);
  text-align: right;
  /* Hide the spinner arrows so the row stays compact. */
  -moz-appearance: textfield;
}
.admin-sidebar li .led-mini::-webkit-outer-spin-button,
.admin-sidebar li .led-mini::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.admin-sidebar li .led-mini.invalid {
  outline: 1px solid #c33;
  background: #ffeaea;
}
.admin-sidebar li .led-mini-sep {
  color: #888;
  font-size: var(--text-sm);
  margin: 0 -1px;
}
.admin-sidebar li.selected .led-mini-sep { color: #f1e3ff; }
/* Keep the inputs readable when the row is highlighted (purple background). */
.admin-sidebar li.selected .led-mini {
  color: #2a1a3a;
  background: #fff;
}
.admin-sidebar li .li-preview {
  min-width: 0;
  width: 20px;
  height: 18px;
  padding: 0;
  font-size: var(--text-ui);
  line-height: 1;
}
.admin-sidebar li .li-preview:hover { background: #fff0c8; }
.admin-sidebar li.selected .li-preview { color: #fff; }
.admin-sidebar li .li-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.admin-sidebar li .li-del {
  min-width: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: var(--text-ui);
  line-height: 1;
  color: #a13a3a;
}
.admin-sidebar li .li-del:hover {
  background: #ffd1d1;
  color: #800;
}
.admin-sidebar li.selected .li-del { color: #fff; }
.admin-sidebar li.selected .li-del:hover { background: #ffd1d1; color: #800; }
.admin-sidebar li .li-move {
  min-width: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: var(--text-ui);
  line-height: 1;
  color: #5b3e7a;
}
.admin-sidebar li .li-move:hover:not(:disabled) {
  background: #ead6ff;
}
.admin-sidebar li .li-move:disabled {
  color: #c8b6dd;
  cursor: default;
}
.admin-sidebar li.selected .li-move { color: #fff; }
.admin-sidebar li.selected .li-move:disabled { color: #d4c2e8; }

.admin-window .admin-main {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.admin-window .admin-main::-webkit-scrollbar {
  width: 14px;
}
.admin-window .admin-main::-webkit-scrollbar-track {
  background: #d8c9e0;
  box-shadow: inset 1px 1px #0a0a0a40;
}
.admin-window .admin-main::-webkit-scrollbar-thumb {
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff;
}
.admin-main {
  background: #d8c9e0;
  padding: 8px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-section {
  background: #fff;
  border: 1px solid grey;
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff;
  padding: 10px;
}
.admin-section h4 {
  margin: 0 0 6px;
  font-size: var(--text-base);
  font-weight: bold;
  color: #8a5bb1;
}
.cover-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
  margin: 6px 0 8px;
}
.cover-thumb {
  width: 120px;
  height: 120px;
  background: #fff;
  border: 1px solid grey;
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.cover-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.cover-thumb.empty {
  color: #aaa;
  font-size: var(--text-sm);
  text-align: center;
  padding: 6px;
}
.cover-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  flex-wrap: wrap;
  font-size: var(--text-ui);
}
.field-row label { min-width: 70px; font-size: var(--text-ui); }
.admin-window #adm-desc {
  font-size: var(--text-base);
  line-height: var(--line-body);
}

/* ---- LED wizard -------------------------------------------------- */
.led-wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.conn-badge {
  font-size: var(--text-ui);
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid;
  font-weight: bold;
}
.conn-badge.connected {
  background: #d6f5d6;
  color: #176617;
  border-color: #2a9c2a;
}
.conn-badge.disconnected {
  background: #f1ecf3;
  color: #6f5b78;
  border-color: #b29ec0;
}
.led-step {
  border-left: 3px solid var(--accent-2);
  padding: 6px 10px 8px;
  margin: 8px 0;
  background: linear-gradient(90deg, rgba(255,230,242,.4), transparent 60%);
}
.led-step-title {
  font-weight: bold;
  color: #8a5bb1;
  font-size: var(--text-base);
  margin-bottom: 4px;
}
.led-hint {
  font-size: var(--text-sm);
  color: var(--hint-fg);
  line-height: var(--line-body);
  margin: 4px 0 2px;
  padding-left: 2px;
}

/* Brightness slider styling (mostly stock) */
input[type=range] { height: 18px; }

/* ---- Strip layout overview --------------------------------------- */
.led-map {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #c79ce6;
}
.led-map-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-ui);
  font-weight: bold;
  color: #8a5bb1;
  margin-bottom: 4px;
}
.led-map-bar {
  height: 26px;
  background: #f3eef6;
  border: 1px solid #b29ec0;
  box-shadow: inset 1px 1px #0a0a0a40;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  font-size: var(--text-sm);
  color: #2a1a35;
}
.led-block {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(0,0,0,.15);
  overflow: hidden;
  white-space: nowrap;
}
.led-block:last-child { border-right: none; }
.led-block.unassigned {
  background: repeating-linear-gradient(
    45deg,
    rgba(178,158,192,.15) 0 6px,
    rgba(178,158,192,.30) 6px 12px
  );
  color: #6f5b78;
  font-style: italic;
}
.led-block.item:hover {
  filter: brightness(1.1) saturate(1.2);
  outline: 1px solid #fff;
  outline-offset: -2px;
}
.led-block-label {
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 0 4px;
  text-shadow: 0 1px 1px rgba(255,255,255,.6);
}
.led-map-empty {
  width: 100%;
  text-align: center;
  font-style: italic;
  color: #888;
  line-height: 26px;
}

/* ---- Media list -------------------------------------------------- */
.media-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 180px;
  overflow: auto;
  background: #fff;
  border: 1px solid grey;
  box-shadow: inset 1px 1px #0a0a0a, inset -1px -1px #fff;
}
.media-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  font-size: var(--text-ui);
  border-bottom: 1px solid #eee;
}
.media-list li:last-child { border-bottom: none; }
.media-list .ftype {
  font-size: var(--text-sm);
  color: #8a5bb1;
  text-transform: uppercase;
  margin-right: 6px;
}

/* ---- Status & misc ---------------------------------------------- */
.serial-on  { color: #176617; font-weight: bold; }
.serial-off { color: #a13a3a; }
.muted   { color: #888; font-size: var(--text-sm); }
.spacer  { flex: 1; }

/* ---- Floating hearts (replaces .starburst) ----------------------- */
.float-heart {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  font-size: 18px;
  color: #ff8fc0;
  text-shadow: 0 0 6px rgba(255,255,255,.7);
  animation: floatHeart 1.8s ease-out forwards;
  user-select: none;
  will-change: transform, opacity;
}
@keyframes floatHeart {
  0%   { transform: translate(0, 4px) scale(0.35) rotate(-6deg); opacity: 0; }
  20%  { transform: translate(2px, -8px) scale(1.0) rotate(-2deg); opacity: 0.95; }
  60%  { transform: translate(calc(var(--sway, 12px) * 0.6), calc(var(--rise, 50px) * -0.6)) scale(1.05) rotate(4deg); opacity: 0.85; }
  100% { transform: translate(var(--sway, 12px), calc(var(--rise, 50px) * -1)) scale(0.7) rotate(8deg); opacity: 0; }
}

/* Helper: keep 98.css buttons selectable with default cursor */
button { cursor: pointer; }
