/* ═══════════════════════════════════════════════
   Aura — Design System v3
   Monochromatic Apple-style · Draggable Windows
   ═══════════════════════════════════════════════ */

/* ── THEMES ── */
:root {
  --blur: 28px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --text: rgba(255, 255, 255, 0.92);
  --text-2: rgba(255, 255, 255, 0.50);
  --text-3: rgba(255, 255, 255, 0.28);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-h: rgba(255, 255, 255, 0.11);
  --glass-b: rgba(255, 255, 255, 0.13);
  --glass-b2: rgba(255, 255, 255, 0.20);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, 0.40);
  --tr: 0.20s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 258px;
  --sidebar-bg: rgba(8, 8, 14, 0.75);
  --win-bg: rgba(9, 9, 16, 0.82);
  --overlay: linear-gradient(135deg, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.32) 50%, rgba(0, 0, 0, 0.58) 100%);
}

/* ── LIGHT MODE ── */
[data-mode="light"] {
  --text: rgba(0, 0, 0, 0.88);
  --text-2: rgba(0, 0, 0, 0.48);
  --text-3: rgba(0, 0, 0, 0.26);
  --text-4: rgba(0, 0, 0, 0.15);
  --glass: rgba(255, 255, 255, 0.52);
  --glass-h: rgba(255, 255, 255, 0.68);
  --glass-b: rgba(0, 0, 0, 0.09);
  --glass-b2: rgba(0, 0, 0, 0.15);
  --win-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.16);
  --sidebar-bg: rgba(255, 255, 255, 0.62);
  --win-bg: rgba(255, 255, 255, 0.72);
  --overlay: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.18) 100%);
}

[data-mode="light"] select option {
  background: #f0f0f5;
  color: #000;
}

[data-mode="light"] .vol-slider {
  background: rgba(0, 0, 0, 0.14);
}

[data-mode="light"] #note-content:empty::before {
  color: rgba(0, 0, 0, 0.28);
}

[data-mode="light"] .kcard-del:hover,
.tdel:hover {
  color: rgba(200, 30, 30, 0.9);
}

[data-mode="light"] [data-theme="kanso"] {
  --accent: rgba(0, 0, 0, 0.82);
  --accent-dim: rgba(0, 0, 0, 0.55);
  --accent-glow: rgba(0, 0, 0, 0.08);
  --accent-solid: rgba(0, 0, 0, 0.10);
  --acc-text: white;
  --bg: #f5f5f7;
  --glass: rgba(255, 255, 255, 0.85);
  --glass-h: rgba(255, 255, 255, 0.95);
}

[data-mode="light"] #coin-count {
  color: var(--accent);
}

/* Kanso (default): pure monochromatic white */
[data-theme="kanso"] {
  --accent: #fff;
  --accent-dim: rgba(255, 255, 255, 0.60);
  --accent-glow: rgba(255, 255, 255, 0.10);
  --accent-solid: rgba(255, 255, 255, 0.16);
  --acc-text: rgba(0, 0, 0, 0.85);
}

[data-theme="aurora"] {
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.65);
  --accent-glow: rgba(94, 234, 212, 0.18);
  --accent-solid: rgba(94, 234, 212, 0.16);
  --acc-text: rgba(0, 0, 0, 0.85);
}

[data-theme="rose"] {
  --accent: #fda4af;
  --accent-dim: rgba(253, 164, 175, 0.65);
  --accent-glow: rgba(253, 164, 175, 0.18);
  --accent-solid: rgba(253, 164, 175, 0.14);
  --acc-text: rgba(0, 0, 0, 0.85);
}

[data-theme="gold"] {
  --accent: #fcd34d;
  --accent-dim: rgba(252, 211, 77, 0.65);
  --accent-glow: rgba(252, 211, 77, 0.18);
  --accent-solid: rgba(252, 211, 77, 0.13);
  --acc-text: rgba(0, 0, 0, 0.85);
}

[data-theme="slate"] {
  --accent: rgba(255, 255, 255, 0.65);
  --accent-dim: rgba(255, 255, 255, 0.40);
  --accent-glow: rgba(255, 255, 255, 0.07);
  --accent-solid: rgba(255, 255, 255, 0.10);
  --acc-text: rgba(0, 0, 0, 0.85);
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
}

button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  background: none;
  color: var(--text);
}

input,
select,
textarea {
  font-family: var(--font);
}

template {
  display: none;
}

/* Custom Macintosh-style Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-4);
  border-radius: 4px;
  opacity: 0.5;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ── BACKGROUND ── */
body {
  background: #05050a;
  color: var(--text);
}

#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#yt-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 177.78vh;
  height: 100vh;
  min-width: 100vw;
  min-height: 56.25vw;
  pointer-events: none;
}

#yt-bg iframe,
#yt-bg>div {
  width: 100% !important;
  height: 100% !important;
}

#bg-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  transition: background 0.5s ease;
}

/* ── WINDOWS LAYER ── */
#windows-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

/* ── SIDEBAR ── */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  z-index: 200;
  transition: transform var(--tr);
}

#sidebar.collapsed {
  transform: translateX(-100%);
}

#sidebar-inner {
  width: 100%;
  height: 100%;
  background: var(--sidebar-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--glass-b);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 120, 120, 0.3) transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}

#sidebar-inner::-webkit-scrollbar {
  width: 4px;
}

#sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.3);
  border-radius: 4px;
}

/* Logo */
#logo-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

#logo-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

#logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

#logo-text {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

#logo-subtext {
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 2px;
}

#collapse-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--glass);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  flex-shrink: 0;
}

#collapse-btn:hover {
  background: var(--glass-h);
  color: var(--text);
}

/* Section */
.sb-section {
  flex-shrink: 0;
  border-top: 1px solid var(--glass-b);
}

.sb-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 13px 16px 5px;
}

.sb-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0;
}

.coll-icon {
  font-size: 0.55rem;
  color: var(--text-3);
  transition: transform var(--tr);
}

.collapsable.closed .coll-icon {
  transform: rotate(-90deg);
}

.collapsable.closed .coll-content {
  display: none !important;
}

/* Scenes */
#scene-list {
  padding: 2px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scene-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 0.81rem;
  font-weight: 450;
  transition: all var(--tr);
  text-align: left;
  width: 100%;
  letter-spacing: -0.01em;
}

.scene-btn:hover {
  background: var(--glass);
  color: var(--text);
}

.scene-btn.active {
  background: var(--glass-h);
  color: var(--text);
}

.scene-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.scene-name {
  flex: 1;
}

/* Sounds */
#sound-list {
  padding: 2px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.snd-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border-radius: var(--radius-xs);
  transition: background var(--tr);
}

.snd-row:hover {
  background: var(--glass);
}

.snd-row.on {
  background: rgba(255, 255, 255, 0.06);
}

.snd-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: all var(--tr);
}

.snd-btn:hover {
  background: var(--glass-h);
}

.snd-btn.on {
  background: var(--accent-solid);
  border-color: var(--accent-dim);
  box-shadow: 0 0 10px var(--accent-glow);
}

.snd-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.snd-name {
  font-size: 0.75rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snd-row.on .snd-name {
  color: var(--text);
}

/* Volume slider */
.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform var(--tr);
}

.vol-slider:active::-webkit-slider-thumb {
  transform: scale(1.4);
}

.mbtn:active,
.mod-btn:active,
.scene-btn:active,
.wb-btn:active {
  transform: scale(0.96);
}

/* Module nav */
#module-nav {
  padding: 2px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mod-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 0.81rem;
  font-weight: 450;
  transition: all var(--tr);
  width: 100%;
  letter-spacing: -0.01em;
}

.mod-btn svg {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity var(--tr);
}

.mod-btn:hover {
  background: var(--glass);
  color: var(--text);
}

.mod-btn:hover svg {
  opacity: 0.8;
}

.mod-btn.active {
  background: var(--glass-h);
  color: var(--text);
}

.mod-btn.active svg {
  opacity: 1;
}

/* Bottom bar */
#bottom-bar {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#theme-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tdot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  transition: all var(--tr);
  cursor: pointer;
}

.tdot:hover {
  transform: scale(1.2);
}

.tdot.active {
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

[data-mode="light"] .tdot.active {
  border-color: rgba(0, 0, 0, 0.5);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px var(--accent-glow);
  outline: none;
}

#coins-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

/* Buy Me a Coffee Button */
#buy-coffee-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  text-decoration: none;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 12px;
  font-size: 1.1rem;
  color: var(--text);
  transition: all var(--tr);
}

#buy-coffee-btn:hover {
  background: var(--glass-h);
  transform: scale(1.05);
  border-color: var(--glass-b2);
}

/* Lang Selector */
#lang-select {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: color var(--tr);
  padding: 2px;
  padding-right: 6px;
  color-scheme: dark;
}

#lang-select:hover {
  color: var(--text);
}

[data-mode="light"] #lang-select {
  color-scheme: light;
}

/* Mode toggle & Fullscreen button */
#mode-toggle,
#fullscreen-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 0.88rem;
  transition: all var(--tr);
  flex-shrink: 0;
  cursor: pointer;
}

#mode-toggle:hover,
#fullscreen-toggle:hover {
  background: var(--glass-h);
  color: var(--text);
}

/* Top Fullscreen Button */
#top-fullscreen-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  cursor: pointer;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: all var(--tr);
  box-shadow: var(--shadow-sm);
}

#top-fullscreen-btn:hover {
  background: var(--glass-h);
  transform: scale(1.05);
}

/* Expand tab */
#expand-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 201;
  display: none;
  width: 18px;
  height: 46px;
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: none;
  border-radius: 0 10px 10px 0;
  color: var(--text-2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  padding: 0;
}

#expand-tab:hover {
  color: var(--text);
  background: rgba(18, 18, 28, 0.92);
}

#expand-tab.vis {
  display: flex;
}

/* ── DRAGGABLE WINDOWS ── */
.win {
  position: absolute;
  background: var(--win-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-b);
  border-radius: var(--radius);
  box-shadow: var(--win-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: all;
  min-width: 320px;
  animation: winOpen 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: box-shadow var(--tr), background 0.4s ease;
}

.win:focus-within {
  box-shadow: var(--win-shadow), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@keyframes winOpen {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Title bar (drag handle) */
.win-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.win-bar:active {
  cursor: grabbing;
}

.win-bar-btns {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.wb-btn {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: filter var(--tr);
}

.wb-close {
  background: #ff5f57;
}

.wb-min {
  background: #febc2e;
}

.wb-max {
  background: #28c840;
}

.wb-btn:hover {
  filter: brightness(1.15);
}

.win-title {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}

.win-meta {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: -0.01em;
}

/* new-in buttons (per-window controls) */
.win-action {
  padding: 4px 11px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all var(--tr);
}

.win-action:hover {
  color: var(--text);
  background: var(--glass-h);
}

/* Window body */
.win-body {
  flex: 1;
  overflow: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Resize handle */
.win-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  opacity: 0;
  transition: opacity var(--tr);
}

.win:hover .win-resize {
  opacity: 0.4;
}

.win-resize::after {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  border-radius: 1px;
}

/* ── TASKS WINDOW ── */
#task-compose {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

#new-task-input {
  width: 100%;
  padding: 9px 13px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
  letter-spacing: -0.01em;
}

#new-task-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2.5px var(--accent-glow);
}

#new-task-input::placeholder {
  color: var(--text-3);
}

#task-compose-row {
  display: flex;
  gap: 7px;
}

select,
input[type="date"] {
  padding: 7px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.78rem;
  outline: none;
  transition: border-color var(--tr);
  flex: 1;
  color-scheme: dark;
}

select option {
  background: #0e0e1a;
}

#add-task-btn {
  padding: 7px 15px;
  border-radius: var(--radius-xs);
  background: var(--accent-solid);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid var(--glass-b2);
  transition: all var(--tr);
  white-space: nowrap;
}

#add-task-btn:hover {
  background: var(--glass-h);
}

#task-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.fchip {
  padding: 4px 11px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 500;
  transition: all var(--tr);
}

.fchip:hover {
  color: var(--text);
}

.fchip.active {
  background: var(--accent-solid);
  color: var(--text);
  border-color: var(--glass-b2);
}

#task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.trow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  transition: all var(--tr);
  animation: fadeUp 0.19s ease;
}

.trow:hover {
  background: var(--glass-h);
  border-color: var(--glass-b2);
}

.trow.tdone {
  opacity: 0.4;
}

.trow.tdone .ttext {
  text-decoration: line-through;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(5px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.tchk {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--glass-b2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 0.55rem;
  transition: all var(--tr);
}

.tchk.done {
  background: var(--accent-solid);
  border-color: var(--accent-dim);
  color: var(--text);
}

.ttext {
  flex: 1;
  font-size: 0.83rem;
  letter-spacing: -0.01em;
}

.tpriority {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tp-low {
  background: rgba(255, 255, 255, 0.3);
}

.tp-medium {
  background: rgba(255, 255, 255, 0.55);
}

.tp-high {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.tdel {
  color: var(--text-3);
  font-size: 0.78rem;
  transition: color var(--tr);
}

.tdel:hover {
  color: rgba(255, 120, 120, 0.9);
}

/* ── KANBAN WINDOW ── */
.kanban-body {
  padding: 10px 12px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  min-width: 700px;
}

.kboard {
  display: flex;
  gap: 10px;
  height: calc(100% - 0px);
}

.kcol {
  min-width: 200px;
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color var(--tr), box-shadow var(--tr);
}

.kcol.drag-over {
  border-color: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-glow);
}

.kcol-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--glass-b);
}

.kdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.kblue {
  background: #60a5fa;
}

.kamber {
  background: #fbbf24;
}

.kpurple {
  background: #c084fc;
}

.kgreen {
  background: #4ade80;
}

.kcards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  min-height: 34px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.07) transparent;
}

.kcard {
  padding: 9px 11px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  cursor: grab;
  transition: all var(--tr);
  animation: fadeUp 0.18s ease;
}

.kcard:hover {
  background: var(--glass-h);
  border-color: var(--glass-b2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.kcard.dragging {
  opacity: 0.3;
  transform: rotate(2deg);
}

.kcard-title {
  font-size: 0.81rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.kcard-desc {
  font-size: 0.71rem;
  color: var(--text-2);
}

.kcard-del {
  float: right;
  color: var(--text-3);
  font-size: 0.75rem;
  transition: color var(--tr);
}

.kcard-del:hover {
  color: rgba(255, 110, 110, 0.9);
}

.kadd {
  padding: 6px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xs);
  color: var(--text-3);
  font-size: 0.75rem;
  transition: all var(--tr);
  width: 100%;
}

.kadd:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-solid);
}

/* ── NOTES WINDOW ── */
.notes-body {
  display: flex;
  gap: 12px;
  overflow: hidden !important;
  padding: 10px 12px !important;
}

.notes-side {
  width: 170px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.notes-search-inp {
  width: 100%;
  padding: 7px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.78rem;
  outline: none;
}

.notes-search-inp::placeholder {
  color: var(--text-3);
}

#notes-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.07) transparent;
}

.nitem {
  padding: 8px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--tr);
}

.nitem:hover {
  background: var(--glass-h);
}

.nitem.active {
  background: var(--glass-h);
  border-color: var(--glass-b2);
}

.nitem-title {
  font-size: 0.79rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nitem-preview {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.notes-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.note-title-inp {
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-b);
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  outline: none;
  transition: border-color var(--tr);
}

.note-title-inp:focus {
  border-color: var(--glass-b2);
}

.note-title-inp::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

#note-toolbar {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

#note-toolbar button {
  padding: 4px 8px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 5px;
  color: var(--text-2);
  font-size: 0.75rem;
  transition: all var(--tr);
}

#note-toolbar button:hover {
  background: var(--glass-h);
  color: var(--text);
}

#note-content {
  flex: 1;
  padding: 10px 11px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.65;
  outline: none;
  overflow-y: auto;
  transition: border-color var(--tr);
  min-height: 100px;
}

#note-content:focus {
  border-color: var(--glass-b2);
}

#note-content:empty::before {
  content: attr(data-ph);
  color: var(--text-3);
  pointer-events: none;
}

.note-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#note-tag-input {
  padding: 5px 9px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.76rem;
  outline: none;
  width: 100px;
}

#add-tag-btn {
  padding: 5px 9px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 0.76rem;
  transition: all var(--tr);
}

#add-tag-btn:hover {
  color: var(--text);
  background: var(--glass-h);
}

#save-note-btn {
  padding: 5px 12px;
  background: var(--accent-solid);
  border: 1px solid var(--glass-b2);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  transition: all var(--tr);
  margin-left: auto;
}

#save-note-btn:hover {
  background: var(--glass-h);
}

#note-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ntag {
  padding: 2px 8px;
  background: var(--glass-h);
  border: 1px solid var(--glass-b);
  border-radius: 10px;
  font-size: 0.68rem;
  color: var(--accent-dim);
  display: flex;
  align-items: center;
  gap: 3px;
}

.ntag-rm {
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.62rem;
}

.ntag-rm:hover {
  opacity: 1;
}

/* ── POMODORO WINDOW ── */
.pomo-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px !important;
  overflow-y: auto;
}

.pomo-tabs {
  display: flex;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.ptab {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--tr);
  letter-spacing: -0.01em;
}

.ptab.active {
  background: var(--accent-solid);
  color: var(--text);
  border: 1px solid var(--glass-b2);
}

.pomo-ring-wrap {
  position: relative;
  width: 190px;
  height: 190px;
}

.pomo-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 7;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 490;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.4s;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.pomo-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.pomo-time {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1;
}

.pomo-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-dim);
  text-transform: uppercase;
}

.pomo-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pctrl {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  font-size: 0.95rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
}

.pctrl:hover {
  background: var(--glass-h);
  color: var(--text);
}

.pplay {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.25rem;
  background: var(--accent-solid);
  border: 1px solid var(--glass-b2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  transition: all var(--tr);
  box-shadow: 0 4px 20px var(--accent-glow), 0 0 0 7px rgba(255, 255, 255, 0.03);
}

.pplay:hover {
  background: var(--glass-h);
  transform: scale(1.05);
}

.pomo-cfg {
  display: flex;
  gap: 10px;
  width: 100%;
}

.pcfg-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pcfg-item label {
  font-size: 0.67rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.step {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  color: var(--text-2);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  line-height: 1;
  padding-bottom: 1px;
}

.step:hover {
  background: var(--glass-h);
  color: var(--text);
}

.sval {
  font-size: 1rem;
  font-weight: 600;
  min-width: 26px;
  text-align: center;
  letter-spacing: -0.02em;
}

.pomo-stats {
  display: flex;
  gap: 8px;
  width: 100%;
}

.pstat {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pstat-val {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.pstat small {
  font-size: 0.64rem;
  color: var(--text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── MARKETPLACE WINDOW ── */
.mkt-body {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.mkt-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.mtab {
  padding: 5px 15px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all var(--tr);
}

.mtab:hover {
  color: var(--text);
}

.mtab.active {
  background: var(--accent-solid);
  color: var(--text);
  border-color: var(--glass-b2);
}

.mpane {
  display: none;
}

.mpane.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.mcard {
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  padding: 14px 12px;
  text-align: center;
  transition: all var(--tr);
  position: relative;
}

.mcard:hover {
  background: var(--glass-h);
  border-color: var(--glass-b2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.mcard.owned {
  border-color: rgba(74, 222, 128, 0.25);
}

.mcard-icon {
  font-size: 2.1rem;
  display: block;
  margin-bottom: 7px;
}

.mcard-name {
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.mcard-desc {
  font-size: 0.69rem;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.3;
}

.mcard-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-dim);
  margin-bottom: 7px;
}

.mbtn {
  width: 100%;
  padding: 6px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all var(--tr);
}

.mbtn-buy {
  background: var(--accent-solid);
  color: var(--text);
  border: 1px solid var(--glass-b2);
}

.mbtn-buy:hover {
  background: var(--glass-h);
}

.mbtn-buy:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.mbtn-use {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.mbtn-use:hover {
  background: rgba(74, 222, 128, 0.22);
}

.mcard-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 7px;
}

/* ── TOASTS ── */
#toast-wrap {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
}

.toast {
  padding: 10px 16px;
  background: rgba(12, 12, 20, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.80rem;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
  max-width: 270px;
  line-height: 1.4;
  animation: toastIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.ok {
  border-color: rgba(74, 222, 128, 0.3);
}

.toast.err {
  border-color: rgba(255, 100, 100, 0.3);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(12px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

/* ── MODAL ── */
#modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-mask.hidden {
  display: none !important;
}

#modal-card {
  background: rgba(12, 12, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  width: min(90vw, 400px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#modal-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

#modal-x {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--text-2);
  transition: all var(--tr);
}

#modal-x:hover {
  background: rgba(239, 68, 68, 0.25);
  color: white;
}

#modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mfield {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mfield label {
  font-size: 0.72rem;
  color: var(--text-2);
}

.minput {
  padding: 8px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.84rem;
  outline: none;
  width: 100%;
  transition: border-color var(--tr);
  letter-spacing: -0.01em;
}

.minput:focus {
  border-color: var(--glass-b2);
}

.minput::placeholder {
  color: var(--text-3);
}

.mconfirm {
  padding: 9px;
  background: var(--accent-solid);
  border: 1px solid var(--glass-b2);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
  transition: all var(--tr);
  margin-top: 3px;
}

.mconfirm:hover {
  background: var(--glass-h);
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── ANIMATIONS ── */
@keyframes coinBounce {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.3)
  }
}

.cbounce {
  animation: coinBounce 0.32s ease;
}

@keyframes pulseLogo {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

@keyframes winOpen {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.win {
  animation: winOpen 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── ACCESSIBILITY (A11Y) ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Estilos de Select Desplegable */
.ui-select {
  width: 100%;
  cursor: pointer;
}

.ui-select option {
  padding: 8px;
}

/* ── STATS WINDOW ENHANCEMENTS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: transform var(--tr), background var(--tr);
}

.stat-card:hover {
  background: var(--glass-h);
  transform: translateY(-2px);
}

.stat-val {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}


/* ── MÓDULO LIBROS ── */
.books-body {
  padding: 14px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.book-card {
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--tr);
  position: relative;
}

.book-card:hover {
  background: var(--glass-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.book-cover-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-b);
}

.book-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-title {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  letter-spacing: -0.01em;
}

.book-author {
  font-size: 0.65rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-progress {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.bp-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.bp-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

[data-theme="kanso"] .bp-fill {
  background: rgba(255, 255, 255, 0.9);
}

[data-mode="light"] .bp-fill {
  background: var(--accent);
}

[data-mode="light"] [data-theme="kanso"] .bp-fill {
  background: rgba(0, 0, 0, 0.8);
}

.bp-text {
  font-size: 0.62rem;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
}

.book-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.b-btn {
  flex: 1;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--tr);
}

.b-btn:hover {
  background: var(--glass-h);
  color: var(--text);
}

.b-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #ff6b6b;
  opacity: 0;
  transition: opacity var(--tr);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.book-card:hover .b-del {
  opacity: 1;
}

.b-del:hover {
  background: rgba(220, 53, 69, 0.9);
  color: white;
  transform: scale(1.1);
}

.bk-cover-lb {
  display: block;
  text-align: center;
  padding: 8px;
  background: var(--glass);
  border: 1px dashed var(--glass-b2);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--tr);
}

.bk-cover-lb:hover {
  background: var(--glass-h);
  color: var(--text);
  border-color: var(--accent-dim);
}

/* ── MÓVIL ESTILO iOS NATIVO ── */

@media (max-width: 768px) {

  /* Ocultar el botón expand de la barra en escritorio si asoma */
  #expand-tab {
    display: none !important;
  }

  /* Modificar el Sidebar para que sea un Tab Bar Inferior */
  #sidebar {
    width: 100%;
    height: calc(56px + env(safe-area-inset-bottom, 20px));
    top: auto;
    bottom: 0;
    transform: none !important;
    border-right: none;
    border-top: 1px solid var(--glass-b);
    background: rgba(10, 10, 15, 0.85);
    /* Un poco más oscuro * glass */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 300;
  }

  #sidebar.collapsed {
    transform: translateY(100%);
  }

  #sidebar-inner {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    border: none;
  }

  /* Ocultar elementos lógicos de barra lateral que no aplican a TabBar */
  #logo-area,
  .sb-label-wrap {
    display: none !important;
  }

  /* Alinear Módulos horizontalmente */
  .sb-section {
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 4px;
  }

  .sb-section:last-child {
    border-right: none;
  }

  /* Los contenedores colapsables ahora son siempre visibles y en fila */
  .coll-content {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
    padding: 0 8px;
    align-items: center;
  }

  #scene-list,
  #sound-list,
  #module-nav {
    flex-direction: row;
    padding: 6px 8px;
  }

  /* Ajustar botones de la TabBar (solo Iconos) */
  .mod-btn,
  .scene-btn {
    flex-direction: column;
    justify-content: center;
    width: auto;
    min-width: 64px;
    height: 48px;
    padding: 4px 8px;
    gap: 2px;
    flex-shrink: 0;
  }

  .mod-btn span,
  .scene-btn .scene-name {
    font-size: 0.6rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.8;
  }

  .mod-btn svg,
  .scene-icon {
    margin: 0;
    width: 20px;
    height: 20px;
  }

  .snd-row {
    flex-direction: column;
  }

  .snd-info {
    display: none;
  }

  /* Ocultar controles de volumen individuales en barra */

  /* El bottom bar de arriba: Idioma, Monedas, etc. Ponerlo al inicio, flex-row */
  #bottom-bar {
    border-top: none;
    padding: 6px 12px;
    gap: 10px;
    flex-shrink: 0;
  }

  #lang-select,
  #buy-coffee-btn {
    display: none;
  }

  /* Simplificar UI principal */
  #mode-toggle,
  #fullscreen-toggle {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    display: flex !important;
    /* Force visibility */
  }

  /* Más grandes para móvil */


  /* Ventanas como Bottom Sheets iOS completas */
  .win {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 20px) + 20px) !important;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 64px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes winOpenSheet {
    from {
      opacity: 0;
      transform: translateY(100%);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .win {
    animation: winOpenSheet 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes winCloseSheet {
    to {
      opacity: 0;
      transform: translateY(100%);
    }
  }

  /* Cabecera iOS nativa (eliminar botones Mac) */
  .win-bar {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: center;
    position: relative;
    cursor: default;
  }

  .win-bar-btns {
    display: none;
  }

  /* Ocultar botones de color de macOS */

  .win-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
  }

  .win-meta {
    position: absolute;
    left: 16px;
    top: 18px;
  }

  /* Nuevo botón "Cerrar" texto estilo iOS o simplemente 'x' en esquina derecha */
  .win-action.close-mb {
    display: flex;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 6px 12px;
    color: var(--text);
    font-weight: 600;
  }

  /* Ocultar resizable en móvil */
  .win-resize {
    display: none !important;
  }

  /* Ajustes en los cuerpos para mejorar áreas táctiles */
  .win-body {
    padding: 12px !important;
  }

  /* Kanban adapt mobile vertical logic over horizontal scrolling, well horiz is fine */
  .kboard {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .kcol {
    min-width: 85vw;
    scroll-snap-align: center;
  }

  /* Notes */
  .notes-body {
    flex-direction: column;
  }

  .notes-side {
    width: 100%;
    height: 35%;
    flex-shrink: 0;
  }

  .notes-main {
    height: 65%;
  }

  /* Modal de Toasts */
  .toast {
    width: 90vw;
    max-width: none;
    right: 5vw;
    bottom: 80px;
  }

  #modal-card {
    width: 90vw;
    bottom: 80px;
  }
}

/* ── BOOKMARKS MODULE ── */
.bm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius-xs);
  transition: all var(--tr);
  animation: fadeUp 0.18s ease;
}

.bm-item:hover {
  background: var(--glass-h);
  border-color: var(--glass-b2);
  transform: translateY(-1px);
}

.bm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bm-name {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-url {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* ── LOOT BOX GLOW (rarity borders) ── */
.mcard[style*="border-color"] {
  transition: all var(--tr), border-color 0s;
}

.mcard[style*="border-color"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}