:root {
    --accent: #FFD600;
    --accent-ink: var(--accent);
    --accent-dim: #b39700;
    --bg: #1a1a1a;
    --bg2: #232323;
    --bg3: #2e2e2e;
    --border: #3a3a3a;
    --text: #e8e8e8;
    --text-muted: #888;
    --titlebar: #1a1a1a;
    --win-bg: #232323;
    --scanline-opacity: 0.03;
  }
  [data-theme="white"] {
    --bg: #dcd8ca;
    --bg2: #ece8dc;
    --bg3: #d5cebc;
    --border: #7f765f;
    --text: #13100b;
    --text-muted: #453d2f;
    --titlebar: #d0c8b6;
    --win-bg: #ebe4d5;
    --scanline-opacity: 0.025;
    --accent: #FFD600;
    --accent-ink: #000000;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'Space Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.3s, color 0.3s;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='10' cy='10' r='4' fill='%23FFD600'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%231a1a1a'/%3E%3C/svg%3E") 10 10, auto;
  }

  /* CRT scanlines overlay */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,var(--scanline-opacity)) 2px,
      rgba(0,0,0,var(--scanline-opacity)) 4px
    );
    pointer-events: none;
    z-index: 9999;
  }

  /* ===== DESKTOP ===== */
  .desktop {
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    flex-direction: column;
  }

  /* ===== TASKBAR ===== */
  .taskbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 36px;
    background: var(--bg);
    border-bottom: 1px solid var(--accent);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 1000;
    font-family: 'VT323', monospace;
    font-size: 18px;
  }
  .taskbar-logo {
    color: var(--accent-ink);
    font-size: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--accent);
  }
  [data-theme="white"] .taskbar-logo {
    text-shadow: none;
  }
  .taskbar-sep { color: var(--border); }
  .taskbar-clock {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 16px;
    font-family: 'VT323', monospace;
  }
  .theme-btns {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .theme-btn {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
  }
  .theme-btn:hover { transform: scale(1.2); border-color: var(--accent); }
  .theme-btn.dark { background: #1a1a1a; }
  .theme-btn.white { background: #f0ede6; }
  .theme-btn.active { border-color: var(--accent) !important; box-shadow: 0 0 6px var(--accent); }

  /* ===== WINDOWS ===== */
  .windows-grid {
    margin-top: 52px;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
  }

  .left-col { display: flex; flex-direction: column; gap: 1rem; }
  .right-col { display: flex; flex-direction: column; gap: 1rem; }

  .window {
    background: var(--win-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: background 0.3s, border-color 0.2s;
    position: relative;
    padding-bottom: 36px;
  }
  .window:hover { border-color: var(--accent); }
  .window.minimized .win-body { display: none; }
  .window.minimized { min-height: 0; height: auto !important; }
  .window.minimized .win-title { display: none; }
  .window.minimized .win-titlebar { border-bottom: none; }

  .win-titlebar {
    background: var(--titlebar);
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--text-muted);
    user-select: none;
  }
  .win-title {
    flex: 1;
    color: var(--accent-ink);
    letter-spacing: 1px;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 10px;
    background: var(--titlebar);
    border-top: 1px solid var(--border);
    z-index: 5;
  }
  .win-body {
    padding: 1rem;
    padding-bottom: 42px;
  }
  .win-controls { display: flex; gap: 5px; }
  .win-btn {
    width: 13px; height: 13px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-size: 8px;
    display: flex; align-items: center; justify-content: center;
  }
  .win-btn:hover { opacity: 0.8; transform: scale(1.15); }
  .win-btn.close { background: #ff5f57; }
  .win-btn.minimize { background: #febc2e; }
  .win-btn.expand { background: #28c840; }

  .win-body { padding: 1rem; }

  /* ===== PLAYER WINDOW ===== */
  .player-art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
  }
  .player-art-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1);
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: saturate(1.02) contrast(1.04);
  }
  .window.playing-window .player-art-cover {
    transform: scale(1.04);
    filter: saturate(1.12) contrast(1.1);
  }
  @keyframes float {
    0%,100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
  }
  .player-art-vinyl {
    position: absolute;
    right: -20px; bottom: -20px;
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    opacity: 0.15;
    animation: spin 8s linear infinite;
  }
  .player-art-vinyl.playing { opacity: 0.3; }
  @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

  .track-info { text-align: center; margin-bottom: 1rem; }
  .track-name {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .track-artist {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
  }
  .track-file {
    font-size: 10px;
    color: var(--accent-dim);
    font-family: 'VT323', monospace;
    font-size: 13px;
    margin-top: 2px;
  }

  /* progress */
  .progress-wrap {
    margin-bottom: 0.75rem;
  }
  .progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'VT323', monospace;
    font-size: 13px;
    margin-bottom: 4px;
  }
  .progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s linear;
  }

  /* controls */
  .controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
  }
  .ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    transition: color 0.2s, transform 0.1s;
    display: flex; align-items: center;
    padding: 6px;
    border-radius: 50%;
  }
  .ctrl-btn:hover { color: var(--accent-ink); transform: scale(1.1); }
  .ctrl-btn.play-btn {
    width: 44px; height: 44px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    font-size: 18px;
    justify-content: center;
  }
  .ctrl-btn.play-btn:hover { background: #fff; transform: scale(1.05); }
  .ctrl-btn.active-ctrl { color: var(--accent-ink); }

  .volume-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--text-muted);
  }
  .volume-row svg { width: 14px; height: 14px; }
  input[type=range].vol {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    background: var(--bg3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }
  input[type=range].vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
  }

  /* ===== PLAYLIST WINDOW ===== */
  .playlist-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg3);
  }
  .playlist-list li {
    padding: 7px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
  }
  .playlist-list li:hover { background: var(--bg3); color: var(--text); }
  .playlist-list li.active {
    background: rgba(255,214,0,0.08);
    color: var(--accent-ink);
    border-left: 2px solid var(--accent);
  }
  .pl-num { font-family: 'VT323', monospace; font-size: 14px; min-width: 20px; color: var(--border); }
  .pl-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pl-dur { font-family: 'VT323', monospace; font-size: 13px; }
  .pl-playing { font-size: 10px; color: var(--accent-ink); }

  .shuffle-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 15px;
    margin-top: 8px;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
  }
  .shuffle-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
  .shuffle-btn.on { border-color: var(--accent); color: var(--accent-ink); background: rgba(255,214,0,0.07); }

  /* ===== BIO WINDOW ===== */
  .bio-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
  }
  .bio-avatar {
    width: 72px; height: 72px;
    border-radius: 8px;
    background: var(--bg3);
    border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  .bio-avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,214,0,0.1), transparent);
  }
  .bio-name {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-ink);
    line-height: 1;
    margin-bottom: 4px;
  }
  [data-theme="white"] .bio-name {
    color: var(--text);
  }
  .bio-handle {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 6px;
  }
  .bio-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
  }
  .bio-tag {
    font-family: 'VT323', monospace;
    font-size: 13px;
    padding: 2px 8px;
    border: 1px solid var(--accent);
    border-radius: 3px;
    color: var(--accent-ink);
    background: rgba(255,214,0,0.06);
  }
  .bio-desc {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1rem;
    border-left: 2px solid var(--accent);
    padding-left: 10px;
  }

  .bio-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
  }
  .stat-box {
    background: var(--bg3);
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border);
  }
  .stat-val {
    font-family: 'VT323', monospace;
    font-size: 22px;
    color: var(--accent-ink);
    display: block;
  }
  .stat-label {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
  }

  .bio-links {
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .bio-link {
    font-family: 'VT323', monospace;
    font-size: 15px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
  }
  .bio-link:hover { border-color: var(--accent); color: var(--accent-ink); }

  .bio-profiles {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }
  .bio-profile-card {
    flex: 1;
    min-width: 240px;
    padding-right: 1rem;
    border-right: 1px solid var(--border);
  }
  .bio-profile-card:last-child {
    border-right: none;
    padding-right: 0;
  }
  @media (max-width: 560px) {
    .bio-profile-card {
      border-right: none;
      padding-right: 0;
      border-bottom: 1px solid var(--border);
      padding-bottom: 1rem;
    }
    .bio-profile-card:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }
  }
  .bio-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 2px solid var(--accent);
    object-fit: cover;
    display: block;
  }

  .bio-status {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.2;
  }



  .taskbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .taskbar-nav .bio-link {
    font-size: 15px;
    padding: 2px 8px;
  }
  .taskbar-nav .bio-link.active {
    color: var(--accent-ink);
    border-color: var(--accent);
  }

  /* ===== VIBE WINDOW ===== */
  .eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 50px;
    margin-bottom: 1rem;
  }
  .eq-bar {
    flex: 1;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    opacity: 0.7;
    min-height: 4px;
    transition: height 0.15s;
  }

  .vibe-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    font-size: 11px; color: var(--text-muted);
  }
  .vibe-label { width: 60px; font-family: 'VT323', monospace; font-size: 13px; }
  .vibe-bar { flex: 1; height: 4px; background: var(--bg3); border-radius: 2px; }
  .vibe-fill { height: 100%; border-radius: 2px; background: var(--accent); }
  .vibe-val { width: 28px; text-align: right; font-family: 'VT323', monospace; font-size: 13px; color: var(--accent-ink); }

  /* ===== FILES WINDOW ===== */
  .file-explorer {
    font-family: 'VT323', monospace;
    font-size: 15px;
  }
  .file-path {
    color: var(--accent-ink);
    margin-bottom: 8px;
    font-size: 13px;
    padding: 4px 6px;
    background: var(--bg3);
    border-radius: 3px;
    display: inline-block;
  }
  .file-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
  }
  .file-item:hover { background: var(--bg3); color: var(--text); }
  .file-item.folder { color: var(--accent-ink); }
  .file-icon { font-size: 14px; }
  .file-size { margin-left: auto; font-size: 12px; color: var(--border); }
  .file-add-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    padding: 6px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    text-align: center;
    font-family: 'Space Mono', monospace;
    line-height: 1.5;
  }

  /* ===== NOTE WINDOW ===== */
  .note-content {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.7;
  }
  .note-content span { color: var(--accent-ink); }

  /* ===== AUDIO ELEMENT ===== */
  audio { display: none; }

  /* ===== DESKTOP ICONS (sidebar) ===== */
  .desktop-icons {
    position: fixed;
    left: 0;
    top: 36px;
    bottom: 0;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 4px;
    z-index: 200;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transition: background 0.3s, border-color 0.3s;
  }
  .d-icon {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 8px;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    width: 60px;
    position: relative;
  }
  .d-icon:hover { background: rgba(255,214,0,0.1); transform: scale(1.05); }
  .d-icon:active { transform: scale(0.96); }
  .d-icon.win-open .d-icon-dot { opacity: 1; }
  .d-icon-img { font-size: 26px; line-height: 1; }
  .d-icon-label {
    font-family: 'VT323', monospace;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    word-break: break-all;
  }
  .d-icon-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 4px var(--accent);
  }
  .d-icon-sep {
    width: 36px;
    height: 1px;
    background: var(--border);
    margin: 4px 0;
    flex-shrink: 0;
  }

  /* ===== TASKBAR WINDOW BUTTONS ===== */
  .taskbar-wins {
    display: flex;
    gap: 4px;
    align-items: center;
  }
  .tb-win-btn {
    font-family: 'VT323', monospace;
    font-size: 13px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .tb-win-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
  .tb-win-btn.tb-active { border-color: var(--accent); color: var(--accent-ink); background: rgba(255,214,0,0.08); }

  /* Shift content right to make room for sidebar */
  .desktop { padding-left: 80px; }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 800px) {
    .windows-grid { grid-template-columns: 1fr; }
    .desktop-icons { display: none; }
    .desktop { padding-left: 1rem; }
  }

  /* ===== SCROLLBAR ===== */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent); }

  /* ===== RAIN CANVAS ===== */
  #rain { position: fixed; inset: 0; pointer-events: none; opacity: 0.07; z-index: 1; }

  /* pulse when playing */
  @keyframes pulse-border {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,214,0,0); }
    50% { box-shadow: 0 0 0 3px rgba(255,214,0,0.15); }
  }
  .window.playing-window { animation: pulse-border 3s ease-in-out infinite; }

  .poyo-pet {
    position: fixed;
    right: 12px;
    bottom: 108px;
    z-index: 1800;
    width: 90px;
    height: 90px;
  border: 0;
  background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  transition: transform 0.15s ease, filter 0.25s ease;
    overflow: hidden;
    padding: 0;
  appearance: none;
  -webkit-appearance: none;
  }
  .poyo-pet:hover {
    transform: translateY(-4px) scale(1.03);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
  }
  .poyo-pet img {
    width: 100%;
    height: 100%;
  object-fit: contain;
    display: block;
  }
  .poyo-pet.bounce {
    animation: poyo-bounce 0.65s cubic-bezier(.22,.61,.36,1) both;
  }
  @keyframes poyo-bounce {
    0% { transform: translateY(0) scale(1); }
    28% { transform: translateY(-15px) scale(1.08); }
    55% { transform: translateY(0) scale(0.96); }
    78% { transform: translateY(-6px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
  }

  body.device-phone .poyo-pet,
  body.device-tablet .poyo-pet {
    display: none;
}

body.device-pc .poyo-pet {
    display: flex;
  }

  .win-body-pad { padding: 0.75rem 1rem; }

  /* ===== BOTTOM DOCK ===== */
  .dock {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(20,20,20,0.75);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 14px;
    z-index: 900;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s, border-color 0.3s;
  }
  [data-theme="white"] .dock {
    background: rgba(230,226,218,0.82);
  }
  .dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s;
  }
  .dock-item:hover { transform: translateY(-8px) scale(1.18); }
  .dock-item:hover .dock-tooltip { opacity: 1; transform: translateY(0); pointer-events: none; }
  .dock-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
  }
  .dock-item:hover .dock-icon { border-color: var(--accent); background: rgba(255,214,0,0.1); }
  .dock-item.dock-open .dock-icon { border-color: var(--accent); }
  .dock-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 5px var(--accent);
  }
  .dock-item.dock-open .dock-dot { opacity: 1; }
  .dock-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg);
    border: 1px solid var(--accent);
    color: var(--accent-ink);
    font-family: 'VT323', monospace;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
  }
  .dock-sep {
    width: 1px;
    height: 40px;
    background: var(--border);
    margin: 0 2px;
    align-self: center;
  }
  /* push desktop content up so dock doesn't overlap */
  .desktop { padding-bottom: 90px; }


/* ========== Extensions: settings, tablets/phones, app switcher, extra apps ========== */
body.no-os-cursor {
  cursor: auto;
}

.hidden-menu-wrap {
  position: relative;
  z-index: 1100;
}

.hidden-apps-btn {
  font-family: inherit;
  font-size: 13px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--accent-ink);
  cursor: pointer;
}

.hidden-apps-btn:hover {
  border-color: var(--accent);
}

.hidden-dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  min-width: 216px;
  background: var(--win-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 6px;
}

.hidden-dropdown.open {
  display: block;
}

.hidden-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "VT323", monospace;
  font-size: 15px;
  color: var(--text-muted);
}

.hidden-item:hover {
  background: var(--bg3);
  color: var(--accent-ink);
}

.tb-apps {
  margin-left: 6px !important;
  font-size: 12px !important;
  padding: 2px 6px !important;
}

.settings-group {
  margin-bottom: 1rem;
}

.settings-group h4 {
  font-family: "VT323", monospace;
  font-size: 15px;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

.settings-row {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-row label {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-row select,
.settings-row input[type="text"] {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  max-width: 100%;
}

.small-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.folder-list .file-item.folder.active {
  background: rgba(255, 214, 0, 0.1);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

.folder-tracks-preview {
  max-height: 140px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 6px;
  border-radius: 4px;
  border: 1px dashed var(--border);
  font-family: "VT323", monospace;
  font-size: 14px;
  color: var(--text-muted);
}

.meta-grid {
  display: grid;
  gap: 8px;
}

.meta-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px;
  font-size: 12px;
  align-items: baseline;
}

.meta-row .mk {
  font-family: "VT323", monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-row .mv {
  font-family: "Space Mono", monospace;
  color: var(--text);
  word-break: break-word;
}

.meta-eq-mini {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  margin-bottom: 0.75rem;
}

.paint-wrap {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  align-items: start;
}

.paint-wrap #paint-stack {
  grid-column: 1;
  grid-row: 1 / span 30;
}

.paint-wrap .paint-toolbar,
.paint-wrap .paint-swatches,
.paint-wrap .paint-layers-col {
  grid-column: 2;
}

.paint-wrap .paint-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.paint-wrap .paint-layers-col {
  display: flex;
  max-height: 200px;
}

.paint-canvas-col {
  min-width: 0;
}

.paint-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
}

.paint-section-title {
  font-family: "VT323", monospace;
  font-size: 15px;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

.paint-tool-row,
.paint-actions-row,
.paint-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.paint-tool-btn.pick,
.paint-tool-btn.tb-active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(255, 214, 0, 0.08);
}

.paint-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paint-size-preview {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.paint-color-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg3);
  padding: 0;
}

.paint-layer-del {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.paint-layer-del:hover {
  color: #ff5f57;
}

.paint-layer-row.active {
  border-left: 3px solid var(--accent);
}

.paint-email-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.paint-email-backdrop.open {
  display: flex;
}

.paint-email-window {
  width: min(420px, 100%);
}

[data-theme="white"] .small-hint,
[data-theme="white"] .win-titlebar,
[data-theme="white"] .track-artist,
[data-theme="white"] .pl-name,
[data-theme="white"] .meta-row .mk {
  color: var(--text-muted);
}

[data-theme="white"] .track-name,
[data-theme="white"] .meta-row .mv,
[data-theme="white"] .win-body,
[data-theme="white"] .playlist-list li {
  color: var(--text);
}

[data-theme="white"] .win-title,
[data-theme="white"] .taskbar-logo,
[data-theme="white"] .settings-group h4,
[data-theme="white"] .switch-title,
[data-theme="white"] .file-path,
[data-theme="white"] .playlist-list li.active,
[data-theme="white"] .pl-playing,
[data-theme="white"] .dock-tooltip,
[data-theme="white"] .hidden-apps-btn,
[data-theme="white"] .hidden-item:hover,
[data-theme="white"] .bio-name,
[data-theme="white"] .bio-tag,
[data-theme="white"] .stat-val,
[data-theme="white"] .vibe-val,
[data-theme="white"] .note-content span,
[data-theme="white"] .file-item.folder,
[data-theme="white"] .taskbar-nav .bio-link.active,
[data-theme="white"] .taskbar-nav .bio-link:hover,
[data-theme="white"] .tb-win-btn:hover,
[data-theme="white"] .tb-win-btn.tb-active,
[data-theme="white"] .shuffle-btn:hover,
[data-theme="white"] .shuffle-btn.on,
[data-theme="white"] .bio-link:hover,
[data-theme="white"] .ctrl-btn:hover,
[data-theme="white"] .ctrl-btn.active-ctrl,
[data-theme="white"] .cal-header button,
[data-theme="white"] .cal-cell.today,
[data-theme="white"] .ac-badge.on,
[data-theme="white"] .paint-section-title,
[data-theme="white"] .paint-toolbar button:hover {
  color: #000000;
}

.paint-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.paint-toolbar button,
.paint-toolbar select {
  font-family: "VT323", monospace;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
}

.paint-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.paint-toolbar button.pick {
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 8px rgba(255, 214, 0, 0.2);
}

.paint-layers-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.paint-layer-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: grab;
  font-family: "VT323", monospace;
  font-size: 13px;
}

.paint-layer-row.active {
  border-color: var(--accent);
  background: rgba(255, 214, 0, 0.06);
}

.paint-layer-row input[type="checkbox"] {
  accent-color: var(--accent-ink);
}

.paint-canvas-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: auto;
  background: #111;
  touch-action: none;
}

.paint-canvas-box canvas {
  display: block;
}

.paint-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid var(--border);
  cursor: pointer;
}

.swatch.pick {
  outline: 2px solid var(--accent);
}

.calc-shell {
  font-family: "VT323", monospace;
}

.calc-display {
  width: 100%;
  text-align: right;
  font-size: 28px;
  padding: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 10px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-btn {
  font-size: 18px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
}

.calc-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.calc-btn.op {
  background: rgba(255, 214, 0, 0.08);
}

.cal-shell {
  font-family: "VT323", monospace;
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cal-header button {
  font-family: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--accent-ink);
  cursor: pointer;
  padding: 4px 10px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 13px;
}

.cal-dow {
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-cell {
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}

.cal-cell:hover {
  border-color: var(--border);
}

.cal-cell.muted {
  color: var(--border);
}

.cal-cell.today {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.ac-shell {
  font-family: "VT323", monospace;
}

.ac-row {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ac-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 15px;
}

.ac-badge.on {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.app-switch-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 4000;
  display: none;
}

.app-switch-backdrop.open {
  display: block;
}

.app-switch-sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  max-height: 72vh;
  background: var(--win-bg);
  border: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  padding: 10px;
  transform: translateY(-100%);
  transition: transform 0.22s ease;
}

.app-switch-backdrop.open .app-switch-sheet {
  transform: translateY(0);
}

.pull-bar {
  width: 42px;
  height: 5px;
  background: var(--border);
  border-radius: 4px;
  margin: 4px auto 10px;
}

.switch-title {
  font-family: "VT323", monospace;
  font-size: 16px;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

.switch-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
}

.switch-card {
  min-height: 56px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-family: "VT323", monospace;
  font-size: 14px;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.switch-card.dragging {
  opacity: 0.75;
}

.swipe-hint {
  position: fixed;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-muted);
  z-index: 250;
  font-family: "VT323", monospace;
  display: none;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

/* ===== ONBOARDING HINT ===== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.onboarding-content {
  width: min(420px, 100%);
  background: var(--win-bg);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.onboarding-header h2 {
  font-family: "Syne", sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-ink);
  margin-bottom: 16px;
}

.onboarding-body {
  margin-bottom: 20px;
}

.onboarding-body p {
  font-family: "Space Mono", monospace;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.onboarding-body p:first-child {
  font-weight: 700;
  color: var(--accent-ink);
}

.onboarding-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.onboarding-btn {
  font-family: "VT323", monospace;
  font-size: 15px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.onboarding-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: rgba(255, 214, 0, 0.08);
}

.onboarding-btn:active {
  transform: scale(0.96);
}

[data-theme="white"] .onboarding-content {
  background: var(--win-bg);
  border-color: #000000;
}

[data-theme="white"] .onboarding-body p:first-child {
  color: #000000;
}

.edge-pull-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  z-index: 3500;
  display: none;
}

body.device-phone .desktop-icons,
body.device-tablet:not(.tablet-show-sidebar) .desktop-icons {
  display: none;
}

body.device-phone .desktop {
  padding-left: 1rem;
}

body.device-phone .windows-grid,
body.device-tablet .windows-grid {
  grid-template-columns: 1fr;
}

body.device-phone .taskbar-wins {
  display: none;
}

body.device-phone .dock {
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
}

body.device-phone.mobile-switcher-available .edge-pull-zone,
body.device-phone.mobile-switcher-available .swipe-hint {
  display: block;
}

body.device-phone .window[data-expanded="1"] {
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
}

body.device-phone .win-expand-use {
}

/* ===== Desktop grid window layout (PC only) ===== */
body.device-pc .desktop-grid-stage {
  position: relative;
}

body.device-pc .desktop-grid-stage.grid-active {
  margin-top: 52px;
  min-height: calc(100vh - 52px - 90px);
  padding: 0 1rem 1rem;
}

body.device-pc .desktop-grid-stage.grid-active .windows-grid {
  display: block;
  position: relative;
  width: 100%;
  min-height: calc(100vh - 52px - 100px);
  margin-top: 0;
  padding-bottom: 0;
  grid-template-columns: unset;
  gap: 0;
}

body.device-pc .desktop-grid-stage.grid-active .left-col,
body.device-pc .desktop-grid-stage.grid-active .right-col {
  display: contents;
}

body.device-pc .window.win-grid-managed {
  position: absolute;
  margin: 0;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

body.device-pc .window.win-grid-managed .win-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

body.device-pc .window.win-grid-managed .win-titlebar {
  cursor: grab;
}

body.device-pc .desktop-grid-overlay {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

body.device-pc .desktop-grid-stage.grid-active .desktop-grid-overlay.visible {
  display: block;
}

body.device-pc .desktop-grid-overlay .grid-line {
  position: absolute;
  pointer-events: none;
}

body.device-pc .desktop-grid-overlay .grid-line-v {
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(255, 214, 0, 0.28);
}

body.device-pc .desktop-grid-overlay .grid-line-h {
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255, 214, 0, 0.2);
}

[data-theme="white"] body.device-pc .desktop-grid-overlay .grid-line-v {
  border-left-color: rgba(0, 0, 0, 0.14);
}

[data-theme="white"] body.device-pc .desktop-grid-overlay .grid-line-h {
  border-top-color: rgba(0, 0, 0, 0.12);
}

.win-grid-resize-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.win-resize-handle {
  position: absolute;
  pointer-events: auto;
  z-index: 21;
}

.win-resize-n,
.win-resize-s {
  left: 8px;
  right: 8px;
  height: 8px;
}

.win-resize-n {
  top: -3px;
  cursor: n-resize;
}

.win-resize-s {
  bottom: -3px;
  cursor: s-resize;
}

.win-resize-e,
.win-resize-w {
  top: 8px;
  bottom: 8px;
  width: 8px;
}

.win-resize-e {
  right: -3px;
  cursor: e-resize;
}

.win-resize-w {
  left: -3px;
  cursor: w-resize;
}

.win-resize-ne,
.win-resize-nw,
.win-resize-se,
.win-resize-sw {
  width: 12px;
  height: 12px;
}

.win-resize-ne {
  top: -2px;
  right: -2px;
  cursor: ne-resize;
}

.win-resize-nw {
  top: -2px;
  left: -2px;
  cursor: nw-resize;
}

.win-resize-se {
  bottom: -2px;
  right: -2px;
  cursor: se-resize;
}

.win-resize-sw {
  bottom: -2px;
  left: -2px;
  cursor: sw-resize;
}

body.device-phone .desktop-grid-overlay,
body.device-tablet .desktop-grid-overlay {
  display: none !important;
}

body.device-tablet .desktop-grid-stage.grid-active,
body.device-phone .desktop-grid-stage.grid-active {
  margin-top: 0;
  min-height: 0;
  padding: 0;
}

@media (max-width: 820px) {
  body.device-auto .windows-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body.device-auto .desktop-icons {
    display: none;
  }

  body.device-auto .desktop {
    padding-left: 1rem;
  }

  body.device-auto .taskbar-wins {
    display: none;
  }
}
