/* ═══════════════════════════════════════════════
   Songs.TNNET  –  Design System
   ═══════════════════════════════════════════════ */

:root {
  /* Brand colors (B-biz defaults = existing look) */
  --blue:        #0055c8;
  --blue-dark:   #003d94;
  --blue-light:  #e8f0fb;
  --blue-mid:    #5588d0;
  /* Sidebar */
  --sidebar-bg:  #1a2540;
  --sidebar-w:   210px;
  /* Neutral */
  --bg:          #eef2f7;
  --white:       #ffffff;
  --border:      #c9d3e0;
  --border-dark: #98aac0;
  /* Text */
  --text:        #18202e;
  --text-sub:    #4a5568;
  --text-muted:  #8a9daf;
  /* Status */
  --green:       #1a7048;
  --green-bg:    #e8f6ee;
  --red:         #c0001e;
  --red-bg:      #fde8ec;
  --orange:      #b05a00;
  /* Layout */
  --nav-h:       58px;
  --bar-h:       48px;

  /* ── Semantic design tokens (new components) ── */
  --accent:      #0055c8;
  --accent-dk:   #003d94;
  --accent-lt:   #e8f0fb;
  --accent-2:    #e8a000;
  --surface:     #ffffff;
  --surface-2:   #f6f9fc;
  --sub:         #4a5568;
  --muted:       #8a9daf;
  --header:      #dce6f4;
  --font-mono:   ui-monospace, "SF Mono", Menlo, monospace;

  /* Density defaults (cozy) */
  --dens-row:    56px;
  --dens-pad:    14px;
  --dens-font:   14px;
  --dens-radius: 14px;
}

/* ── Theme: A-dark (デンモク ダーク) ── */
html[data-theme="A-dark"] {
  --blue: #ff5722; --blue-dark: #d84315; --blue-light: #2a1f18; --blue-mid: #ff8a65;
  --bg: #0f1520; --white: #1a2130; --border: #2a3345; --border-dark: #3d4e68;
  --text: #f5f7fb; --text-sub: #98a2b8; --text-muted: #5d6780;
  --accent: #ff5722; --accent-dk: #d84315; --accent-lt: #2a1f18; --accent-2: #ffc857;
  --surface: #1a2130; --surface-2: #242d3f; --sub: #98a2b8; --muted: #5d6780;
  --sidebar-bg: #0a0e18; --header: #131c2a;
}

/* ── Theme: A-light (デンモク ライト) ── */
html[data-theme="A-light"] {
  --blue: #ff5722; --blue-dark: #d84315; --blue-light: #fff0eb; --blue-mid: #ff8a65;
  --bg: #f7f5f2; --white: #ffffff; --border: #e2dcd1; --border-dark: #c8bfb3;
  --text: #1d160f; --text-sub: #5a4d3c; --text-muted: #8c8173;
  --accent: #ff5722; --accent-dk: #d84315; --accent-lt: #fff0eb; --accent-2: #ffa000;
  --surface: #ffffff; --surface-2: #ece7df; --sub: #5a4d3c; --muted: #8c8173;
  --header: #ede8e1;
}

/* ── Theme: C-light (モダン ライト) ── */
html[data-theme="C-light"] {
  --blue: #2b5ce0; --blue-dark: #1e46b3; --blue-light: #e9eefd; --blue-mid: #5580e8;
  --bg: #f7f8fb; --white: #ffffff; --border: #e3e7ef; --border-dark: #c5ccd8;
  --text: #0f1728; --text-sub: #4a5367; --text-muted: #8791a3;
  --accent: #2b5ce0; --accent-dk: #1e46b3; --accent-lt: #e9eefd; --accent-2: #d84d6f;
  --surface: #ffffff; --surface-2: #eef1f7; --sub: #4a5367; --muted: #8791a3;
  --header: #e5e9f3;
}

/* ── Theme: C-dark (モダン ダーク) ── */
html[data-theme="C-dark"] {
  --blue: #5599ff; --blue-dark: #3377dd; --blue-light: #152238; --blue-mid: #7aaaff;
  --bg: #0d1117; --white: #161b22; --border: #2a3240; --border-dark: #3c4758;
  --text: #e6edf3; --text-sub: #9ba7b4; --text-muted: #6e7681;
  --accent: #5599ff; --accent-dk: #3377dd; --accent-lt: #152238; --accent-2: #ff7aa0;
  --surface: #161b22; --surface-2: #1f2833; --sub: #9ba7b4; --muted: #6e7681;
  --sidebar-bg: #0a0d14; --header: #161b22;
}

/* ── Theme: B-biz (青色申告風) — explicit (same as default) ── */
html[data-theme="B-biz"] {
  --blue: #0055c8; --blue-dark: #003d94; --blue-light: #e8f0fb; --blue-mid: #5588d0;
  --bg: #eef2f7; --white: #ffffff; --border: #c9d3e0; --border-dark: #98aac0;
  --text: #18202e; --text-sub: #4a5568; --text-muted: #8a9daf;
  --accent: #0055c8; --accent-dk: #003d94; --accent-lt: #e8f0fb; --accent-2: #e8a000;
  --surface: #ffffff; --surface-2: #f6f9fc; --sub: #4a5568; --muted: #8a9daf;
  --header: #dce6f4;
}

/* ── Density ── */
html[data-density="compact"] {
  --dens-row: 44px; --dens-pad: 10px; --dens-font: 13px; --dens-radius: 10px;
}
html[data-density="cozy"] {
  --dens-row: 56px; --dens-pad: 14px; --dens-font: 14px; --dens-radius: 14px;
}
html[data-density="roomy"] {
  --dens-row: 72px; --dens-pad: 18px; --dens-font: 15px; --dens-radius: 18px;
}

/* ═══════════════════════════════════════════════
   PC HEADER  –  topbar + aoiro-tabs (desktop only)
   ═══════════════════════════════════════════════ */

.pc-header { display: none; flex-direction: column; flex-shrink: 0; }

.topbar {
  height: 36px;
  background: var(--accent-dk);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.topbar svg { width: 16px; height: 16px; display: block; flex-shrink: 0; }
.topbar-user {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-user a        { color: rgba(255,255,255,0.75); font-size: 11px; }
.topbar-user a:hover  { color: #fff; text-decoration: none; }

.aoiro-tabs {
  background: var(--header);
  border-bottom: 2px solid var(--accent);
  display: flex;
  padding: 6px 20px 0;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.aoiro-tabs::-webkit-scrollbar { display: none; }

.aoiro-tab {
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--text-sub);
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  margin-bottom: -2px;
  margin-right: 2px;
  white-space: nowrap;
  transition: background 0.1s;
  font-family: inherit;
}
.aoiro-tab:hover      { background: rgba(0,0,0,0.05); text-decoration: none; }
.aoiro-tab.is-active  {
  background: var(--white);
  color: var(--blue-dark);
  font-weight: 800;
  border-color: var(--blue);
  border-bottom-color: var(--white);
}

/* ════════════════════════════════════════════
   DESK HOME  –  2カラムダッシュボード (desktop)
   ════════════════════════════════════════════ */

.desk-home { display: none; }
.mob-home  { display: block; }

.desk-home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: start;
}

/* Card */
.dh-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
}
.dh-card-head {
  padding: 7px 14px;
  background: var(--header);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-dark);
  display: flex;
  align-items: center;
}
.dh-card-body { padding: 14px 16px; }

/* Table */
.dh-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dh-table thead tr { background: var(--header); }
.dh-table th { text-align: left; padding: 7px 10px; font-weight: 700; color: var(--blue-dark); border-bottom: 1px solid var(--border); }
.dh-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.dh-table tbody tr:nth-child(even) { background: var(--surface-2); }
.dh-table tbody tr:hover           { background: var(--blue-light); }
.dh-table tbody tr:last-child td   { border-bottom: none; }

/* Stat tile */
.dh-stat-tile {
  padding: 11px 13px;
  background: var(--surface-2);
  border-radius: 3px;
  border-left: 3px solid var(--accent);
}
.dh-stat-num   { font-size: 20px; font-weight: 800; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.dh-stat-label { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* Quick action button */
.dh-quick-btn {
  padding: 9px 11px;
  border: 1px solid var(--border-dark);
  background: var(--white);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-dark);
  text-align: left;
  text-decoration: none;
  display: block;
  transition: background 0.1s;
}
.dh-quick-btn:hover { background: var(--blue-light); text-decoration: none; }

/* Primary button (active list) */
.dh-btn-primary {
  padding: 7px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.dh-btn-primary:hover { background: var(--blue-dark); text-decoration: none; }

/* ── Section label ── */
.sect {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  margin: 20px 4px 10px;
  text-transform: uppercase;
}

/* ── Density-aware song row ── */
.song-row-d {
  padding: var(--dens-pad);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-height: var(--dens-row);
  text-decoration: none;
  color: var(--text);
  transition: background 0.08s;
}
.song-row-d:hover        { background: var(--blue-light); text-decoration: none; }
.song-row-d .sr-idx      { width: 32px; text-align: center; color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.song-row-d .sr-body     { flex: 1; min-width: 0; }
.song-row-d .sr-title    { font-weight: 700; font-size: calc(var(--dens-font) + 1px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row-d .sr-artist   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.song-row-d .sr-dam      { font-family: var(--font-mono); font-size: 11px; color: var(--accent-2); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ── Theme switcher ── */
.theme-switcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  background: rgba(20,26,40,0.92);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 14px;
  font-family: inherit;
  font-size: 12px;
  color: #e0e6f0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 200px;
}
.theme-switcher summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.theme-switcher summary::-webkit-details-marker { display: none; }
.theme-switcher-body  { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.theme-switcher-row   { display: flex; flex-direction: column; gap: 4px; }
.theme-switcher-label { font-size: 10px; font-weight: 700; color: #8899bb; letter-spacing: 0.1em; text-transform: uppercase; }
.theme-switcher-opts  { display: flex; gap: 4px; flex-wrap: wrap; }
.theme-switcher-opts button {
  padding: 5px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.06); color: #c4cbd5; border: 1px solid transparent;
  cursor: pointer; font-size: 11px; font-weight: 600; font-family: inherit;
}
.theme-switcher-opts button.ts-on { background: var(--accent, #0055c8); color: #fff; }

/* ─── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo",
               -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }

/* ═══════════════════════════════════════════════
   APP SHELL  –  PC: sidebar+main  /  Mobile: stack
   ═══════════════════════════════════════════════ */

.app-shell {
  display: flex;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
}

/* ─── Sidebar (PC) ───────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sidebar-brand {
  padding: 18px 16px 16px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar-logo { width: 18px; height: 18px; }
.sidebar-logo svg { width: 18px; height: 18px; display: block; }

.sidebar-nav { flex: 1; padding: 10px 0; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 18px;
  color: #9ab0cc;
  text-decoration: none;
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.sidebar-item:hover       { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.sidebar-item.is-active   { background: rgba(0,120,255,0.22); color: #fff; border-left-color: #5599ff; font-weight: 700; }

.sidebar-icon     { width: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-icon svg { width: 17px; height: 17px; display: block; }
.sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 6px 0; }
.sidebar-footer  { border-top: 1px solid rgba(255,255,255,0.07); padding: 6px 0 10px; }

.sidebar-user {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px;
  font-size: 12px;
}
.sidebar-user-name { color: rgba(255,255,255,0.75); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout    { color: rgba(255,255,255,0.4); font-size: 11px; flex-shrink: 0; margin-left: 8px; }
.sidebar-logout:hover { color: rgba(255,255,255,0.75); text-decoration: none; }

/* ─── Main wrapper ───────────────────────────── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* songs-mode: fixed-height app (no page scroll) */
.main-wrap.songs-mode {
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

/* ─── Page header bar ────────────────────────── */
.page-header {
  flex-shrink: 0;
  height: var(--bar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header-brand {
  display: none;  /* shown only on mobile */
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-dark);
  letter-spacing: 0.04em;
}

.page-title { font-size: 15px; font-weight: 700; color: var(--text); }
.page-back  { font-size: 13px; color: var(--blue); margin-right: 2px; }
.page-header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.result-badge {
  font-size: 12px;
  color: var(--text-sub);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 9px;
  white-space: nowrap;
}

/* ─── Page body ──────────────────────────────── */
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}

/* ─── Bottom nav (mobile only) ───────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.is-active     { color: var(--blue); }
.bottom-nav-item:hover         { text-decoration: none; }
.bottom-nav-item svg           { width: 22px; height: 22px; display: block; }
.nav-label                     { font-size: 10px; }

/* ═══════════════════════════════════════════════
   DASHBOARD  (index.php)
   ═══════════════════════════════════════════════ */

/* Active list card */
.active-list-card {
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.1s;
}
.active-list-card:hover { text-decoration: none; }
.active-list-card:active { transform: scale(0.99); }

.active-list-card.has-list {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 65%, var(--accent-2)) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,85,200,0.28);
}
.active-list-card.has-list:hover { box-shadow: 0 6px 22px rgba(0,85,200,0.40); }

.active-list-card.no-list {
  background: var(--surface);
  border: 2px dashed var(--border-dark);
  color: var(--text-muted);
}

.active-list-card-icon  { font-size: 30px; flex-shrink: 0; line-height: 1; }
.active-list-card-body  { flex: 1; min-width: 0; }
.active-list-card-name  { font-size: 17px; font-weight: 700; }
.active-list-card-meta  { font-size: 12px; margin-top: 3px; opacity: 0.82; }
.active-list-card-arrow { font-size: 22px; flex-shrink: 0; opacity: 0.6; }

/* Action grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.action-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 12px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  min-height: 118px;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.action-tile:hover  { border-color: var(--blue); box-shadow: 0 4px 14px rgba(0,85,200,0.13); transform: translateY(-2px); text-decoration: none; }
.action-tile:active { transform: scale(0.97); box-shadow: none; }

.action-tile-empty  { opacity: 0.38; border-style: dashed; pointer-events: none; }

/* アイコンボックス */
.aicon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.aicon svg { width: 24px; height: 24px; }

.aicon-blue   { background: #dbe8f8; color: #0055c8; }
.aicon-purple { background: #ece5f6; color: #6633bb; }
.aicon-green  { background: #d8f0e4; color: #1a7048; }
.aicon-orange { background: #fdecd6; color: #b85500; }
.aicon-teal   { background: #d6eff4; color: #0e7a8a; }
.aicon-muted  { background: #edf0f4; color: #99aabb; }

.action-label { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.action-sub   { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

/* Stats bar */
.stats-bar {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 22px;
  overflow: hidden;
}
.stat-item    { flex: 1; padding: 14px 10px; text-align: center; }
.stat-num     { display: block; font-size: 22px; font-weight: 800; color: var(--blue-dark); line-height: 1; }
.stat-label   { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-divider { width: 1px; background: var(--border); flex-shrink: 0; }

/* Section title */
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

/* Recent list */
.recent-list { background: var(--surface); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.recent-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  color: var(--text);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover      { background: var(--blue-light); text-decoration: none; }
.recent-item-icon       { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
.recent-item-title      { font-size: 14px; font-weight: 600; }
.recent-item-meta       { font-size: 12px; color: var(--text-sub); margin-top: 1px; }

/* ═══════════════════════════════════════════════
   SONG BROWSER  (songs.php)
   ═══════════════════════════════════════════════ */

/* Search bar */
.search-bar {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 8px;
}

.search-input-row { display: flex; gap: 8px; align-items: center; }

.search-input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border-dark);
  border-radius: 19px;
  padding: 0 18px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
}
.search-input:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0,85,200,0.11);
}

.search-clear {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%; border: none;
  background: var(--border); color: var(--text-sub);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* Tag scroll */
.tag-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 8px -16px 0;
  padding: 0 16px;
}
.tag-scroll-wrap::-webkit-scrollbar { display: none; }
.tag-scroll { display: flex; gap: 5px; width: max-content; padding-bottom: 3px; }

.tag-pill {
  height: 28px; padding: 0 13px;
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 12px; white-space: nowrap;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.tag-pill.is-active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.tag-pill:not(.is-active):hover { background: var(--blue-light); }

/* Active bar */
.active-bar {
  flex-shrink: 0;
  background: var(--blue-light);
  border-bottom: 1px solid #a8c4e8;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.active-bar[hidden] { display: none !important; }
.active-bar-icon    { font-size: 15px; flex-shrink: 0; }
.active-bar-name    { flex: 1; font-weight: 700; color: var(--blue-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-bar-count   { color: var(--text-sub); font-size: 12px; white-space: nowrap; }
.active-bar-link    { color: var(--blue); font-size: 12px; white-space: nowrap; font-weight: 600; }

/* Song list scroll area */
.song-list-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* Song card */
.song-card {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  min-height: 58px;
  transition: background 0.08s;
}
.song-card:hover { background: var(--blue-light); }

.song-card-num  { font-size: 11px; color: var(--text-muted); width: 26px; text-align: right; flex-shrink: 0; }
.song-card-body { flex: 1; min-width: 0; }
.song-title     { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.song-meta      { font-size: 12px; color: var(--text-sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.yt-btn {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%; background: #dd2222;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; text-decoration: none; flex-shrink: 0;
}
.yt-btn:hover { background: #bb1111; text-decoration: none; }

.add-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%; border: none;
  background: var(--blue); color: #fff;
  font-size: 24px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.add-btn:active    { transform: scale(0.88); }
.add-btn.is-added  { background: var(--green); font-size: 15px; }

.list-msg {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Pagination */
.paging {
  display: flex; justify-content: center; align-items: center;
  gap: 14px; padding: 18px 16px; font-size: 13px; color: var(--text-sub);
}
.paging button {
  border: 1px solid var(--border-dark); border-radius: 5px;
  background: var(--surface); color: var(--blue);
  padding: 7px 16px; font-size: 13px; font-weight: 600;
}
.paging button:hover { background: var(--blue-light); }

/* ═══════════════════════════════════════════════
   SONGLISTS  (songlists.php)
   ═══════════════════════════════════════════════ */

.list-card-wrap { margin-bottom: 20px; background: var(--surface); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }

.list-card {
  display: flex; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px; color: var(--text);
  transition: background 0.08s;
}
.list-card:last-child { border-bottom: none; }
.list-card:hover      { background: var(--blue-light); text-decoration: none; }

.list-card-icon  { font-size: 22px; color: var(--blue); flex-shrink: 0; }
.list-card-body  { flex: 1; min-width: 0; }
.list-card-name  { font-size: 15px; font-weight: 700; }
.list-card-meta  { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.list-card-count { font-size: 20px; font-weight: 800; color: var(--blue); min-width: 36px; text-align: right; flex-shrink: 0; }
.list-card-arrow { font-size: 20px; color: var(--border-dark); flex-shrink: 0; }

.detail-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-header-body { flex: 1; min-width: 0; }
.detail-title { font-size: 18px; font-weight: 800; }
.detail-meta  { font-size: 12px; color: var(--text-sub); margin-top: 3px; }

.set-active-btn {
  flex-shrink: 0;
  height: 34px; padding: 0 14px;
  background: var(--surface); color: var(--blue);
  border: 1.5px solid var(--blue); border-radius: 6px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.set-active-btn:hover { background: var(--blue-light); }

.add-songs-link {
  display: block;
  padding: 12px 16px;
  background: var(--blue-light);
  border: 1px solid #a8c4e8;
  border-radius: 8px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
}
.add-songs-link:hover { background: #d4e8f8; text-decoration: none; }

.remove-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.remove-btn:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.danger-zone {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.btn-danger {
  height: 36px; padding: 0 16px;
  background: var(--surface); color: var(--red);
  border: 1px solid var(--red); border-radius: 5px;
  font-size: 13px;
}

/* ─── Buttons ────────────────────────────────── */
.btn-primary {
  height: 38px; padding: 0 18px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 14px;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary {
  height: 38px; padding: 0 16px;
  background: var(--surface); color: var(--blue);
  border: 1px solid var(--border-dark); border-radius: 6px; font-size: 13px;
}
.new-list-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  margin-bottom: 14px;
}
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-sub); }
.form-label input {
  display: block; width: 100%; margin-top: 5px;
  height: 38px; border: 1px solid var(--border-dark); border-radius: 5px;
  padding: 0 12px; font-size: 14px; outline: none;
}
.form-label input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,85,200,0.1); }
.form-row { display: flex; gap: 8px; }

/* ─── List picker dialog ─────────────────────── */
.list-picker-dialog {
  border: none; background: transparent; padding: 0;
  width: min(420px, calc(100vw - 20px));
  max-height: 90vh;
}
.list-picker-dialog::backdrop { background: rgba(0,0,0,0.55); }

.dialog-card {
  background: var(--surface); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.dialog-title { padding: 15px 18px 12px; font-size: 15px; font-weight: 700; margin: 0; border-bottom: 1px solid var(--border); color: var(--text); }

.picker-list { overflow-y: auto; max-height: 220px; }
.picker-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 14px 18px; border: none; border-bottom: 1px solid var(--border);
  background: var(--surface); text-align: left; gap: 10px; cursor: pointer;
}
.picker-item:hover { background: var(--blue-light); }
.picker-name  { flex: 1; font-size: 14px; font-weight: 700; }
.picker-count { font-size: 12px; color: var(--text-sub); }
.picker-empty { padding: 18px; text-align: center; color: var(--text-muted); font-size: 13px; }

.picker-new {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.picker-new input {
  flex: 1; height: 36px; border: 1px solid var(--border-dark);
  border-radius: 5px; padding: 0 10px; font-size: 13px; outline: none;
}
.picker-new input:focus { border-color: var(--blue); }
.picker-new button { height: 36px; padding: 0 16px; background: var(--blue); color: #fff; border: none; border-radius: 5px; font-weight: 700; font-size: 13px; }

.dialog-cancel {
  width: 100%; padding: 13px; border: none;
  border-top: 1px solid var(--border); background: var(--surface);
  color: var(--text-sub); font-size: 14px;
}
.dialog-cancel:hover { background: var(--bg); }

/* ═══════════════════════════════════════════════
   ARTISTS  (artists.php)
   ═══════════════════════════════════════════════ */

/* artists-mode: fixed-height app (same pattern as songs-mode) */
.main-wrap.artists-mode {
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

.artist-search-bar { padding-bottom: 10px; }

/* アーティストリスト全体スクロール */
.artist-list-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* 邦楽/洋楽フィルタータブ */
.artist-filter-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.artist-filter-tab {
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.artist-filter-tab.is-active {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--blue);
}
.artist-filter-tab.tag-jpop.is-active   { color: #b84000; background: var(--surface)0e6; border-color: #f5b07a; }
.artist-filter-tab.tag-western.is-active { color: #1555a0; background: #e6f0ff; border-color: #7aaaf5; }

/* 50音ジャンプバー */
.kana-jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.kana-jump-btn {
  min-width: 32px;
  padding: 3px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-sub);
  text-decoration: none;
  transition: background 0.1s;
}
.kana-jump-btn:hover   { background: var(--blue-light); color: var(--blue); }
.kana-jump-btn.is-current { background: var(--blue); color: #fff; border-color: var(--blue); }
.kana-jump-btn.is-empty { color: var(--border); border-color: var(--border); pointer-events: none; }

/* 頭文字グループ */
.artist-group-head {
  padding: 6px 16px 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

/* アーティストカード（デンモク風：大きなタップ領域） */
.artist-card {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 13px;
  text-decoration: none;
  color: var(--text);
  min-height: 66px;
  transition: background 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.artist-card:hover { background: var(--blue-light); text-decoration: none; }
.artist-card:active { background: #d6e6f8; }
.artist-card.is-focus { background: var(--blue-light); box-shadow: inset 3px 0 0 var(--blue); }

/* アバター円 */
.artist-card-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light) 0%, #c8d8f4 100%);
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

.artist-card-body { flex: 1; min-width: 0; }
.artist-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.artist-song-count {
  font-size: 12px;
  color: var(--blue-dark);
  font-weight: 700;
  background: var(--blue-light);
  border-radius: 8px;
  padding: 1px 7px;
  white-space: nowrap;
}

.artist-tag-chip {
  font-size: 11px;
  color: var(--text-sub);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
.artist-tag-chip[data-tag="邦楽"] { color: #b84000; background: var(--surface)0e6; border-color: #f5b07a; }
.artist-tag-chip[data-tag="洋楽"] { color: #1555a0; background: #e6f0ff; border-color: #7aaaf5; }

.artist-card-arrow {
  font-size: 20px;
  color: var(--border-dark);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   SONGS – 追加スタイル
   ═══════════════════════════════════════════════ */

/* アーティスト絞込バー（artist_id フィルター時） */
.artist-filter-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ece5f6;
  border-bottom: 1px solid #c4a8e8;
  font-size: 13px;
}
.artist-filter-icon { color: #6633bb; flex-shrink: 0; display: flex; align-items: center; }
.artist-filter-name { flex: 1; font-weight: 700; color: #4422aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-filter-clear { color: #6633bb; font-size: 12px; white-space: nowrap; font-weight: 600; }
.artist-filter-clear:hover { text-decoration: underline; }

/* DAM番号バッジ */
.dam-num {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 曲メタ内アーティストリンク */
.song-artist-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.song-artist-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   ADMIN / LEGACY PAGES
   ═══════════════════════════════════════════════ */
.container { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }

/* admin pages use a simple top header instead of sidebar */
.hero-card {
  background: var(--blue); color: #fff;
  border: none; border-radius: 0;
  padding: 11px 24px;
  display: flex; align-items: center; gap: 12px;
}
.hero-card h1    { color: #fff; font-size: 1.05rem; margin: 0; font-weight: 800; }
.hero-kicker     { display: none; }
.hero-lead       { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin: 0; flex: 1; }
.hero-actions    { margin-left: auto; }
.launch-button   { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.5); border-radius: 4px; font-weight: 700; font-size: 13px; }
.launch-button:hover { background: rgba(255,255,255,0.28); text-decoration: none; }

.top-nav {
  display: flex; flex-wrap: wrap;
  border-bottom: 2px solid var(--blue);
  margin: 0 -16px 16px; padding: 8px 16px 0;
  background: var(--surface); border-top: 1px solid var(--border);
}
.top-nav a {
  display: inline-block; color: var(--blue);
  background: var(--bg); border: 1px solid var(--border); border-bottom: none;
  border-radius: 3px 3px 0 0; padding: 7px 16px; font-size: 13px;
  margin-right: 3px; margin-bottom: -2px;
}
.top-nav a:hover      { background: var(--blue-light); text-decoration: none; }
.top-nav a.is-active  { background: var(--surface); font-weight: 700; border-bottom: 2px solid #fff; }

.search-form         { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.search-form label   { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; }
.search-form input   { height: 30px; border: 1px solid var(--border-dark); border-radius: 3px; padding: 0 8px; background: var(--surface); color: var(--text); font-size: 13px; outline: none; }
.search-form input:focus { border-color: var(--blue); }
.search-form button  { height: 30px; border: 1px solid var(--blue-dark); border-radius: 3px; padding: 0 14px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; }
.link-button         { display: inline-block; height: 30px; line-height: 28px; border: 1px solid var(--border-dark); border-radius: 3px; padding: 0 12px; background: var(--surface); color: var(--blue); font-size: 13px; }
.link-button:hover   { background: var(--bg); text-decoration: none; }

h1 { font-size: 1.25rem; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 1.05rem; margin: 0 0 10px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--blue-dark); }

.data-table          { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.data-table th,
.data-table td       { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.data-table thead th { background: #dce6f4; color: var(--blue-dark); font-weight: 700; font-size: 12px; }
.data-table tbody tr:nth-child(even) td { background: #f6f9fc; }
.data-table tbody tr:hover td { background: var(--blue-light); }
.table-wrap          { overflow-x: auto; }

.result-meta  { color: var(--text-sub); margin: 8px 0; font-size: 13px; }
.error-text   { color: var(--red); margin: 3px 0; font-size: 13px; }
.error-box    { background: var(--red-bg); border: 1px solid #f0a0b0; border-radius: 4px; padding: 10px 12px; margin-bottom: 10px; }
.success-box  { background: var(--green-bg); border: 1px solid #7fcca4; border-radius: 4px; padding: 10px 12px; margin-bottom: 10px; }
.chip         { display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 4px; background: var(--blue-light); border: 1px solid var(--blue-mid); font-size: 12px; color: var(--blue-dark); }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.artist-list  { margin: 0; padding-left: 20px; font-size: 13px; }
.artist-list li { margin: 7px 0; }
.panel-card   { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; }
.panel-note   { margin: 10px 0 5px; color: var(--text-sub); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.home-grid    { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.feature-tiles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.feature-tile { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 12px 14px; text-decoration: none; color: var(--text); min-height: 68px; display: flex; flex-direction: column; justify-content: center; }
.feature-tile strong { display: block; margin-bottom: 3px; font-size: 13px; color: var(--blue-dark); }
.feature-tile span   { color: var(--text-sub); font-size: 12px; }
.feature-tile-placeholder { opacity: 0.65; border-style: dashed; }
.quick-chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.action-chip  { color: var(--blue-dark); }
.jelly-chip   { border-radius: 4px; padding: 4px 9px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.08); border: 1px solid var(--border); }

.admin-list   { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; padding: 6px; background: var(--surface); }
.admin-matrix { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 8px; }
.admin-card   { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--border); border-radius: 4px; padding: 10px; background: var(--surface); cursor: pointer; }
.admin-card.is-selected { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 2px rgba(0,85,200,0.18); }
.admin-card-body  { display: flex; flex-direction: column; gap: 3px; }
.admin-card small { color: var(--text-sub); display: block; }
.admin-item   { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-item:last-child { border-bottom: none; }
.admin-item small { display: block; color: var(--text-sub); }
.select-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.select-tools button { border: 1px solid var(--border-dark); border-radius: 3px; background: var(--surface); color: var(--blue); padding: 5px 10px; cursor: pointer; }
.admin-side-tools { margin: 8px 0 12px; margin-left: auto; }
.admin-side-tools button { border: 1px solid var(--border-dark); border-radius: 3px; background: var(--surface); color: var(--blue); padding: 7px 12px; cursor: pointer; }
.fetch-badge         { font-size: 11px; border: 1px solid var(--green); color: var(--green); border-radius: 2px; padding: 1px 6px; }
.fetch-badge-pending { border-color: var(--orange); color: var(--orange); white-space: nowrap; }
.meta-row    { display: flex; gap: 12px; align-items: center; }
.inline-check { display: block; margin: 6px 0 12px; }
.tag-groups-grid  { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.tag-group        { margin-bottom: 6px; border: 1px solid var(--border); border-radius: 4px; padding: 8px; background: var(--bg); }
.tag-group-title  { margin: 4px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-sub); }
.add-artist-dialog { border: none; background: transparent; padding: 0; width: min(520px,calc(100vw - 20px)); color: var(--text); }
.add-artist-dialog::backdrop { background: rgba(0,0,0,0.45); }
.add-artist-dialog .panel-card { margin: 0; }
.add-artist-dialog label { display: block; margin-bottom: 10px; font-size: 13px; }
.add-artist-dialog input[type="text"] { width: 100%; box-sizing: border-box; height: 30px; border: 1px solid var(--border-dark); border-radius: 3px; padding: 0 8px; font-size: 13px; background: var(--surface); color: var(--text); }
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 1200; }
.loading-overlay[hidden] { display: none !important; }
.loading-box { background: var(--surface); border-radius: 6px; border: 1px solid var(--border); padding: 22px 30px; min-width: 220px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,0.16); }
.spinner { width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 10px; border: 3px solid var(--border); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag-filter { cursor: pointer; font-size: 12px; color: var(--blue-dark); }
.tag-filter.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

/* Mobile */
@media (max-width: 767px) {
  .sidebar              { display: none; }
  .pc-header            { display: none !important; }
  .bottom-nav           { display: flex; }
  .main-wrap            { padding-bottom: var(--nav-h); }
  .main-wrap.songs-mode   { height: calc(100dvh - var(--nav-h)); height: calc(100vh - var(--nav-h)); }
  .main-wrap.artists-mode { height: calc(100dvh - var(--nav-h)); height: calc(100vh - var(--nav-h)); }
  .page-header-brand    { display: block; }
  .page-body            { padding: 14px; }
  .action-grid          { gap: 10px; }
  .action-tile          { min-height: 110px; padding: 18px 12px 14px; }
  .action-icon          { font-size: 28px; }
  .action-label         { font-size: 14px; }
  .search-form label    { width: 100%; }
  .home-grid            { grid-template-columns: 1fr; }
  .feature-tiles        { grid-template-columns: 1fr; }
  .meta-row             { flex-direction: column; align-items: flex-start; }
  .admin-side-tools     { margin-left: 0; }
  .theme-switcher       { right: 10px; bottom: calc(var(--nav-h) + 10px); }
}

/* ═══════════════════════════════════════════════
   song_detail.php
   ═══════════════════════════════════════════════ */
.song-detail-wrap { padding: 0 0 80px; }

/* ① ヒーロー：曲名が主役 */
.sd-hero {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.sd-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
}
.sd-hero-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sd-artist {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.sd-artist:hover { text-decoration: underline; }
.sd-year {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
}

/* セクション共通 */
.sd-section {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sd-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ② カラオケ番号ブロック（最重要・目立たせる） */
.sd-karaoke-block {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface, #fff);
}
.sd-karaoke-nums { display: flex; flex-direction: column; gap: 10px; }
.sd-num-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface, #fff);
  border: 2px solid var(--accent, var(--blue));
  border-radius: 16px;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.sd-num-card:active { transform: scale(0.98); }
.sd-num-card-left  { flex: 1; }
.sd-num-service    { font-size: 10px; font-weight: 800; color: var(--accent, var(--blue)); letter-spacing: 0.2em; display: block; }
.sd-num-value      { font-size: 34px; font-weight: 900; color: var(--accent, var(--blue)); font-family: var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; display: block; margin-top: 2px; line-height: 1; }
.sd-num-copy-hint  { font-size: 11px; color: var(--text-muted); display: block; margin-top: 4px; }
.sd-num-copy-icon  { color: var(--accent, var(--blue)); flex-shrink: 0; opacity: 0.7; }
.sd-num-card.is-joy .sd-num-value { font-size: 22px; color: var(--text); }
.sd-num-card.is-joy .sd-num-service { color: var(--text-sub); }
.sd-num-card.is-joy { border-color: var(--border); box-shadow: none; }
.sd-num-card.copied {
  border-color: var(--green);
  background: var(--green-bg);
}
.sd-num-card.copied::after {
  content: "コピーしました ✓";
  position: absolute;
  inset: 0;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  border-radius: 14px;
}
.sd-num-card.copied .sd-num-copy-hint { color: var(--green); font-weight: 700; }

/* ③ マイタグ */
.sd-tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sd-tag-btn {
  padding: 12px 22px;
  border-radius: 28px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.sd-tag-btn:hover     { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.sd-tag-btn.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.sd-tag-btn:disabled  { opacity: 0.5; }

/* 歌い出し・コード難易度 */
.sd-lyrics { font-size: 15px; color: var(--text); line-height: 1.6; padding: 4px 0; }
.sd-chord-badge { display: inline-block; padding: 3px 14px; border-radius: 20px; font-weight: 700; font-size: 14px; margin-right: 12px; }
.sd-chord-A { background: #d4edda; color: #155724; }
.sd-chord-B { background: var(--surface)3cd; color: #856404; }
.sd-chord-C { background: #f8d7da; color: #721c24; }
.sd-chord-link { font-size: 13px; color: var(--blue); text-decoration: none; }
.sd-chord-link:hover { text-decoration: underline; }

/* ④ YouTube */
.sd-yt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: #ff0000;
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.sd-yt-btn:hover { background: #cc0000; }

/* ⑤ ソングリスト追加 */
.sd-list-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.sd-list-btn:hover    { background: var(--blue-light); border-color: var(--blue); }
.sd-list-btn.is-added { background: #e6f6ee; border-color: #7fcca4; pointer-events: none; }
.sd-list-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.sd-list-count { font-size: 12px; color: var(--text-sub); }

/* テーマリスト */
.theme-section-head {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 4px 6px;
}
.list-card-theme { border-left: 3px solid #e8a000; }
.theme-list-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--surface)8e6;
  border-left: 3px solid #e8a000;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 0 6px 6px 0;
}
.btn-copy-theme {
  padding: 7px 14px;
  background: #e8a000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-copy-theme:hover { background: #c48800; }
.theme-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.theme-admin-name { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.theme-admin-name:hover { color: var(--blue); }

/* 動的リストバッジ・説明 */
.list-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #1555a0;
  background: #e6f0ff;
  border: 1px solid #7aaaf5;
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.dynamic-list-note {
  font-size: 13px;
  color: var(--text-sub);
  background: #e6f0ff;
  border-left: 3px solid var(--blue);
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 0 6px 6px 0;
}

/* songs.php: カード本体をリンク化 */
.song-card-body { text-decoration: none; color: inherit; display: block; flex: 1; min-width: 0; }
.song-card-body:hover .song-title { color: var(--blue); }

/* ── Desktop songs table (songs.php) ── */
.songs-desk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.songs-desk-table thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--header); color: var(--sub);
  font-weight: 700; text-align: left;
  padding: 8px 12px; border-bottom: 2px solid var(--border);
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
}
.songs-desk-table tbody tr:nth-child(even) { background: var(--surface-2); }
.songs-desk-table tbody tr:hover { background: var(--blue-light); }
.songs-desk-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.songs-desk-title { font-weight: 600; color: var(--text); text-decoration: none; }
.songs-desk-title:hover { color: var(--blue); }
.songs-desk-num-cell { color: var(--text-muted); font-size: 12px; width: 40px; text-align: right; }
.songs-desk-year-cell { color: var(--text-sub); font-size: 12px; white-space: nowrap; }
.songs-desk-dam-cell { font-family: var(--font-mono); font-size: 11px; color: var(--accent-2); white-space: nowrap; }
.songs-desk-add { width: 44px; text-align: center; }
.songs-desk-table .add-btn { width: 32px; height: 32px; font-size: 18px; }

/* Tablet+ / Desktop */
@media (min-width: 768px) {
  /* Switch from sidebar layout to topbar+tabs layout */
  .app-shell    { flex-direction: column; }
  .pc-header    { display: flex; }
  .sidebar      { display: none; }
  .bottom-nav   { display: none; }
  .main-wrap    { padding-bottom: 0; }
  /* tabs show which page we're on — page-header is redundant on desktop */
  .page-header  { display: none; }

  /* home: show desk layout, hide mobile layout */
  .desk-home    { display: block; }
  .mob-home     { display: none; }

  .action-grid  { grid-template-columns: repeat(3, 1fr); }
  .home-grid    { grid-template-columns: 1.1fr 0.9fr; }

  /* songlists / builder: constrain content width on desktop */
  .sl-wrap, .builder-wrap { max-width: 820px; margin: 0 auto; }
}

/* Large desktop */
@media (min-width: 1100px) {
  .page-body { padding: 28px 36px; }
}
