  :root {
    --bg: #0f0f0f;
    --surface: #1c1c1e;
    --surface2: #2a2a2d;
    --text: #f2f2f2;
    --muted: #9a9a9a;
    --accent: #ff2d55;
    --radius: 8px;
    --radius-sm: 4px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
  }
  .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
  }
  h1 {
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .load-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
  }
  .load-row input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--surface2);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
  }
  .load-row input:focus { border-color: var(--accent); }
  button {
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--surface2);
    padding: 10px 16px;
  }
  button:hover { filter: brightness(1.2); }
  #player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
  }
  #player { width: 100%; height: 100%; }
  #seekbar {
    position: relative;
    height: 32px;
    margin: -6px 0 10px;
    cursor: pointer;
  }
  #seekbar .track, #seekbar .progress {
    position: absolute;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    border-radius: var(--radius-sm);
    pointer-events: none;
  }
  #seekbar .track { left: 0; right: 0; background: var(--surface2); }
  #seekbar .progress { left: 0; width: 0; background: #5a5a5e; }
  #seekbar .playhead {
    position: absolute;
    top: 50%;
    left: 0;
    width: 3px;
    height: 16px;
    transform: translate(-50%, -50%);
    background: var(--accent);
    border-radius: var(--radius-sm);
    pointer-events: none;
  }
  #seekbar .dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -55%);
    font-size: 13px;
    line-height: 1;
    transition: transform 0.08s ease;
  }
  #seekbar .dot:hover { transform: translate(-50%, -55%) scale(1.5); }
  .heart-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
  }
  .hint { text-align: center; }
  #heart-btn {
    background: var(--accent);
    font-size: 28px;
    padding: 14px 48px;
    border-radius: 999px;
    line-height: 1;
    transition: transform 0.08s ease;
    user-select: none;
  }
  #heart-btn:active { transform: scale(0.92); }
  .hint { color: var(--muted); font-size: 13px; }
  kbd {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 12px;
  }
  h2 {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  #hearts-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
  #hearts-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px 14px;
  }
  .ts-btn {
    background: none;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-size: 15px;
    font-weight: 600;
    padding: 2px 6px;
  }
  .ts-btn:hover { text-decoration: underline; }
  .heart-icon { font-size: 16px; }
  .note {
    flex: 1;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: text;
    min-width: 60px;
    overflow-wrap: anywhere;
  }
  .note.empty { color: var(--muted); font-style: italic; opacity: 0; }
  #hearts-list li:hover .note.empty { opacity: 1; }
  .note:hover, .note[contenteditable]:not([contenteditable="false"]) {
    background: var(--surface2);
  }
  .heart-num {
    color: var(--muted);
    font-size: 13px;
    min-width: 16px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .spacer { flex: 1; }
  .del-btn {
    background: none;
    color: var(--muted);
    font-size: 16px;
    padding: 2px 8px;
  }
  .del-btn:hover { color: var(--text); }
  #empty-msg { color: var(--muted); font-size: 14px; padding: 8px 0; }
  section { margin-bottom: 28px; }
  #library-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
  #library-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px 14px;
    cursor: pointer;
    border: 1px solid transparent;
  }
  #library-list li:hover { background: var(--surface2); }
  #library-list li.active { border-color: var(--accent); }
  .lib-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }
  .lib-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
  #lib-empty-msg { color: var(--muted); font-size: 14px; padding: 8px 0; }
  .backup-row { display: flex; gap: 8px; margin-top: 14px; }
  .backup-row button { font-size: 13px; color: var(--muted); }
  .backup-row button:hover { color: var(--text); }
  .flash {
    position: fixed;
    pointer-events: none;
    font-size: 64px;
    animation: pop 0.7s ease-out forwards;
    z-index: 10;
  }
  @keyframes pop {
    0%   { transform: scale(0.3); opacity: 0; }
    25%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1) translateY(-60px); opacity: 0; }
  }

/* ---- Skin selector ---- */
#skin-select {
  margin-left: auto;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--surface2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}
#skin-select:hover { color: var(--text); }
#skin-select:focus { border-color: var(--accent); }
