/* views.css — route and view-specific layouts and components */
/* ---------- Home Learning Hub & Quick Import ---------- */
.home-hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 14px);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.home-hero-greeting-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-hero-greeting {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--tx);
  margin: 0;
}
.home-hero-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.home-hero-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.home-hero-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--tx2);
  font-variant-numeric: tabular-nums;
}
.home-hero-pill.streak {
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  border-color: color-mix(in srgb, #f59e0b 35%, transparent);
  color: #f59e0b;
}
.home-hero-pill.focus {
  background: color-mix(in srgb, #0ea5e9 14%, transparent);
  border-color: color-mix(in srgb, #0ea5e9 35%, transparent);
  color: #38bdf8;
}

/* Quick import input */
.home-quick-import-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 6px 4px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.home-quick-import-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.home-quick-import-icon {
  color: var(--muted);
  flex: none;
}
.home-quick-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--tx);
  font-size: 13px;
  outline: none;
  padding: 6px 0;
}
.home-quick-input::placeholder { color: var(--muted); }
.home-quick-paste-btn, .home-quick-import-btn {
  flex: none;
  font-weight: 600;
}

/* Hero bottom: Goal meter & Resume banner */
.home-hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.home-goal-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 220px;
}
.home-goal-info {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  gap: 12px;
}
.home-goal-val {
  font-weight: 600;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
}
.home-goal-bar {
  width: 100%;
  height: 6px;
  background: var(--panel2);
  border-radius: 999px;
  overflow: hidden;
}
.home-goal-prog {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #22c55e));
  border-radius: 999px;
  transition: width .3s ease;
}

/* Resume banner in hero */
.home-resume-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 480px;
}
.home-resume-banner:hover {
  background: var(--panel3);
  border-color: var(--accent);
}
.home-resume-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  animation: pulseDot 1.5s infinite;
  flex: none;
}
.home-resume-thumb {
  width: 42px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
}
.home-resume-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home-resume-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-resume-pos {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.home-resume-btn {
  flex: none;
  font-size: 11px;
  padding: 3px 8px;
}

/* Rich Playlists & Channels Mini-Cards on Home */
.home-cards-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.home-pl-card {
  flex: 0 0 156px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-pl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.home-pl-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel2);
}
.home-pl-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-pl-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
}
.home-pl-count-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.home-pl-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #fff;
  opacity: 0;
  border: none;
  cursor: pointer;
  transition: opacity .15s ease;
}
.home-pl-card:hover .home-pl-play-overlay {
  opacity: 1;
}
.home-pl-meta {
  display: flex;
  flex-direction: column;
}
.home-pl-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rich Channel Cards on Home */
.home-ch-card {
  flex: 0 0 176px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.home-ch-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.home-ch-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--panel2), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex: none;
}
.home-ch-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home-ch-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-ch-count {
  font-size: 11px;
  color: var(--muted);
}
.home-ch-play-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color .15s ease;
}
.home-ch-card:hover .home-ch-play-btn {
  color: var(--accent);
}

/* Home Study Shelves Compact Cards */
.home-shelf-card {
  flex: 0 0 204px;
  background: #151a28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-shelf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c, #4f7cff);
}
.home-shelf-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 124, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.hsc-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hsc-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 16px;
  border: 1px solid;
  flex-shrink: 0;
}
.hsc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hsc-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hsc-meta {
  font-size: 11px;
  color: #94a3b8;
}
.hsc-prog-bar {
  width: 100%;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.hsc-prog-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Home Feed Release Cards */
.home-feed-card {
  flex: 0 0 220px;
  background: #151a28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-feed-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 124, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.hfc-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0e17;
  overflow: hidden;
}
.hfc-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hfc-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #4f7cff;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}
.hfc-time {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #cbd5e1;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
}
.hfc-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hfc-channel {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hfc-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Legacy strip fallback */
.nook-meta-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.nook-shelf-sec {
  margin-bottom: 22px;
}
.nook-shelf-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.nook-shelf-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.nook-shelf-title {
  font-family: var(--f);
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
}
.nook-shelf-container {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel);
}
.nook-shelf-plain {
  padding: 0;
}

.nook-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.nook-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tx);
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: opacity .14s ease, transform .14s ease;
  user-select: none;
}
.nook-chip:hover {
  opacity: .88;
  transform: translateY(-1px);
}
.nook-chip-count {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--f-mono);
}
.nook-chip-play {
  font-size: 10px;
  color: var(--tx);
  margin-left: 2px;
}
.vcard:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.36); border-color: var(--line2); }
.vcard.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.vcard.done .vcard-title { color: var(--muted); text-decoration: line-through; }
.vcard-thumb { position: relative; aspect-ratio: 16/9; background: var(--panel2); overflow: hidden; }
.vcard-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1;
  opacity: 1; transition: opacity .18s, transform .22s ease;
}
.vcard:hover .vcard-thumb img { transform: scale(1.03); }
.vcard-thumb img.img-fail { display: none !important; opacity: 0 !important; }
/* sits behind the image, so a missing/failed thumbnail still looks deliberate */
.vcard-fb {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 26px; color: var(--tx2); opacity: .45; pointer-events: none;
  background: radial-gradient(circle at center, rgba(255,255,255,0.06) 0%, transparent 70%);
}
.vcard-preview-wrap {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: hidden;
  animation: vcardPreviewFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1); background: #000;
}
.vcard-preview-iframe { width: 100%; height: 100%; border: 0; pointer-events: none; transform: scale(1.02); }
.vcard-preview-badge {
  position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.82); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; z-index: 5; pointer-events: none;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2);
}
@keyframes vcardPreviewFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
/* global broken-image guard (see setupImageFallbacks in app.js) */
img.img-fail { display: none !important; }
.now-thumb, .audio-thumb, .ph-thumb, .pb-thumb, .q-thumb, .plc-thumbs img { background: var(--panel2); }
.vcard-dur {
  position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.8); color: #fff;
  font-size: 10.5px; font-weight: 600; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums;
  z-index: 5;
}
.vcard-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.18); z-index: 5; }
.vcard-prog i { display: block; height: 100%; }
.vcard-play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: color-mix(in srgb, var(--accent) 92%, #fff); color: #fff; display: grid; place-items: center;
  font-size: 16px; opacity: 0; transform: scale(.8); transition: opacity .18s ease, transform .18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,.4); pointer-events: auto; cursor: pointer; z-index: 6;
}
.vcard:hover .vcard-play { opacity: 1; transform: scale(1); }
.vcard-sel {
  position: absolute; left: 5px; top: 5px; width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.45); color: #fff;
  font-size: 12px; cursor: pointer; display: grid; place-items: center; opacity: 0; padding: 0; z-index: 6;
}
.vcard:hover .vcard-sel, .vcard.selected .vcard-sel { opacity: 1; }
.vcard.selected .vcard-sel { background: var(--accent); border-color: #fff; }
.vcard-body { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.vcard-title {
  /* fixed 2-line box so every card in a row lines up, even for short titles */
  min-height: 2.6em;
  font-size: 12.8px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
body.cozy .vcard-title { -webkit-line-clamp: 3; line-clamp: 3; }
.vcard-meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--tx2); overflow: hidden; white-space: nowrap; }
.vcard-meta > span:not(.chip):not(.dot) { overflow: hidden; text-overflow: ellipsis; }
.vcard-resume { font-size: 10.5px; color: var(--accent); font-weight: 600; }
.vcard-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.vcard-actions {
  position: absolute;
  right: 6px;
  top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 6;
}
.vcard:hover .vcard-actions,
.vcard:focus-within .vcard-actions {
  opacity: 1;
  transform: translateY(0);
}
.vcard-quick-pl, .vcard-menu {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 13, 12, 0.78);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  display: grid;
  place-items: center;
  transition: all .15s ease;
}
.vcard-quick-pl:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.08);
}
.vcard-menu:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}
.sec.drop { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: var(--r); }


/* ---------- hero / kpi ---------- */
.hero { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-l { flex: 1 1 420px; min-width: 260px; }
.hero-r { flex: 1 1 300px; min-width: 250px; }
.hero-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
.kpi-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.kpi-v { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 1px 0; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 11px; color: var(--muted); }
.now {
  display: flex; align-items: center; gap: 11px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px; height: 100%;
}
.now.empty { color: var(--muted); font-size: 12.5px; justify-content: center; text-align: center; }
.now-thumb { width: 88px; aspect-ratio: 16/9; object-fit: cover; border-radius: 7px; flex: none; }
.now-meta { min-width: 0; flex: 1; }
.now-title { font-weight: 600; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.now-sub { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 11.5px; flex-wrap: wrap; }

/* ---------- stat cards / charts ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px;
  display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden;
}
.stat-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.stat-v { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-s { font-size: 11.5px; color: var(--tx2); }
.stat-spark { margin-top: 5px; height: 30px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; }
.card h3 { margin-bottom: 9px; color: var(--tx2); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin-bottom: 14px; }
.chart-card { min-width: 0; overflow: hidden; }
.chart { width: 100%; position: relative; }
.chart-tip {
  position: fixed; z-index: 300; background: #0b0f1a; color: #e8edf7; border: 1px solid #33405f;
  border-radius: 7px; padding: 5px 8px; font-size: 11.5px; pointer-events: none; opacity: 0;
  transition: opacity .1s; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.4); max-width: 240px;
}
.chart-tip.show { opacity: 1; }
.goal-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.goal-side { display: flex; flex-direction: column; gap: 8px; min-width: 190px; }
.mini-bar { height: 6px; border-radius: 4px; background: var(--panel2); overflow: hidden; min-width: 60px; }
.mini-bar i { display: block; height: 100%; border-radius: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 6px 8px; border-bottom: 1px solid var(--line); font-weight: 650;
}
.table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--panel2); }
.cell-title { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }

/* ---------- playlists ---------- */
.pl-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pl-chip {
  flex: none; width: 168px; text-align: left; padding: 10px 12px; border-radius: var(--r); cursor: pointer;
  border: 1px solid; color: var(--tx);
}
.plc-n { font-size: 19px; font-weight: 700; }
.plc-t { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plc-s { font-size: 11px; color: var(--muted); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 11px; }
.pl-card { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.plc-bar { height: 4px; }
.plc-head { padding: 10px 12px 7px; cursor: pointer; }
.plc-head h3 { font-size: 14px; }
.plc-head .muted { font-size: 11.5px; }
.plc-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 12px; }
.plc-thumbs img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.plc-a { display: flex; gap: 5px; padding: 9px 12px 11px; flex-wrap: wrap; }
.tag-card {
  display: flex; align-items: center; gap: 7px; padding: 9px 11px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 12px;
}
.tag-card:hover { border-color: var(--accent); }
.tag-card .muted { flex: 1; font-size: 11px; }

/* ---------- notes / links / trash ---------- */
.searchbar { margin-bottom: 12px; max-width: 420px; }
.note-list, .link-list, .trash-list { display: flex; flex-direction: column; gap: 8px; }
.note-card, .link-card, .trash-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
}
.note-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.time-chip {
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--tx); border: 0;
  border-radius: 6px; padding: 2px 7px; font-size: 11.5px; font-weight: 650; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.note-video { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-body, .note-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--tx);
  word-break: break-word;
}
.note-body p { margin: 0 0 6px 0; }
.note-body p:last-child { margin-bottom: 0; }
.note-body h4, .note-body h5, .note-body h6 {
  margin: 8px 0 4px 0;
  font-weight: 650;
  color: var(--tx);
  line-height: 1.3;
}
.note-body h4 { font-size: 14.5px; }
.note-body h5 { font-size: 13.5px; }
.note-body h6 { font-size: 12.5px; }
.note-body ul, .note-body ol {
  margin: 4px 0 6px 0;
  padding-left: 20px;
}
.note-body li { margin-bottom: 2px; }
.note-body blockquote {
  margin: 6px 0;
  padding: 4px 10px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--tx2);
  font-style: italic;
}
.note-body code.note-inline-code {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
}
.note-body pre.note-pre {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  overflow-x: auto;
  margin: 6px 0;
}
.note-body a.note-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.note-body a.note-link:hover {
  text-decoration: none;
}
.note-body .time-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 3px;
  padding: 1px 6px;
  font-size: 11px;
  cursor: pointer;
  vertical-align: baseline;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--tx);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 4px;
  transition: all 0.15s ease;
}
.note-body .time-chip:hover {
  background: var(--accent);
  color: #fff;
}
.note-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.note-tab-group {
  display: inline-flex;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.note-tab-btn {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 550;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.note-tab-btn:hover {
  color: var(--tx);
}
.note-tab-btn.active {
  background: var(--panel);
  color: var(--tx);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.note-fmt-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.note-fmt-btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--tx2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.note-fmt-btn:hover {
  background: var(--hover);
  color: var(--tx);
}
.note-preview-box {
  min-height: 110px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--panel2);
  border: 1px solid var(--line);
  font-size: 13px;
  word-break: break-word;
}
.note-row { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.note-row:last-child { border-bottom: 0; }
.note-text { flex: 1; }
.link-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 12px 14px;
  transition: all .18s ease;
}
.link-card:hover {
  border-color: rgba(212, 120, 74, 0.4);
  background: color-mix(in srgb, var(--accent) 3%, var(--panel));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.link-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.link-card-badge-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.link-prov-chip {
  font-weight: 600;
  font-size: 11px;
}
.link-domain-chip {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
}
.link-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.link-open-btn {
  font-weight: 600;
  font-size: 11.5px;
  color: var(--accent);
  text-decoration: none;
}
.link-t {
  font-weight: 600;
  font-size: 14px;
  color: var(--tx);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease;
}
.link-t:hover { color: var(--accent); }
.link-d { font-size: 12.5px; color: var(--tx2); line-height: 1.45; }
.link-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.link-tags .tag {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}
.link-tags .tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg2));
}
.trash-row { display: flex; align-items: center; gap: 9px; }
.trash-l { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- focus ---------- */
.focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 11px; margin-bottom: 14px; }
.pomo-card { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pomo-ring {
  width: 186px; height: 186px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) 0%, var(--panel2) 0); padding: 12px;
}
.pomo-in { width: 100%; height: 100%; border-radius: 50%; background: var(--panel); display: grid; place-items: center; }
.pomo-time { font-size: 2.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.pomo-phase { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
/* Settings: 2 comfortable columns, each card sized to its own content so the
   page never shows ragged half-empty boxes. */
/* Settings: multi-column masonry so a short card never leaves a tall gap
   underneath it (a grid would force every card in a row to the tallest height). */
/* Settings: Modern Dashboard & Horizontal Category Tab Architecture */
.settings-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 2px;
}
.settings-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px;
  box-shadow: var(--sh);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.settings-nav::-webkit-scrollbar { display: none; }

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r2);
  border: 1px solid transparent;
  background: transparent;
  color: var(--tx2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .16s ease;
  user-select: none;
  white-space: nowrap;
  flex: none;
}
.settings-tab-btn:hover {
  color: var(--tx);
  background: var(--panel2);
  border-color: var(--line2);
  transform: translateY(-1px);
}
.settings-tab-btn.active {
  color: var(--tx);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel2));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 18%, transparent);
}
.settings-tab-icon {
  font-size: 15px;
  flex: none;
  line-height: 1;
}
.settings-tab-label {
  flex: none;
  line-height: 1.2;
}
.settings-tab-badge {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel3);
  color: var(--tx3);
  font-weight: 700;
  letter-spacing: .02em;
}
.settings-tab-btn.active .settings-tab-badge {
  background: var(--accent);
  color: #fff;
}
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.settings-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-card-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line2);
}
.settings-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tx);
}
.settings-card-desc {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.35;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line2);
}
.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.setting-row:first-child {
  padding-top: 0;
}
.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.setting-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tx);
}
.setting-hint {
  font-size: 11.5px;
  color: var(--tx2);
  line-height: 1.35;
}
.setting-ctrl {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-ctrl .input {
  min-width: 140px;
  height: 34px;
  padding: 0 10px;
}
.setting-ctrl .input.num {
  width: 85px;
  min-width: 85px;
}
.setting-ctrl .input.wide {
  min-width: 240px;
}
@media (max-width: 640px) {
  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .setting-ctrl {
    width: 100%;
    justify-content: flex-end;
  }
  .setting-ctrl .input.wide {
    width: 100%;
  }
}

/* Modern Physical Toggle Switch */
.switch-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.switch-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  width: 44px;
  height: 24px;
  background: var(--panel3);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.switch-thumb {
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .22s cubic-bezier(0.34, 1.56, 0.64, 1), background .2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
.switch-toggle input:checked + .switch-track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
.switch-toggle input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
}
.switch-toggle input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Accent Preset Color Chips */
.accent-presets-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.accent-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s;
  position: relative;
  padding: 0;
}
.accent-chip:hover {
  transform: scale(1.15);
}
.accent-chip.active {
  border-color: #ffffff;
  box-shadow: 0 0 10px currentColor;
  transform: scale(1.12);
}
.accent-chip.active::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Cloud Sync Hero Banner */
.sync-hero-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--panel)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sync-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.sync-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
}
.sync-hero-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sync-hero-pill.ok { background: rgba(16, 185, 129, 0.16); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.sync-hero-pill.syncing { background: rgba(34, 211, 238, 0.16); color: #22d3ee; border: 1px solid rgba(34, 211, 238, 0.3); }
.sync-hero-pill.err { background: rgba(239, 68, 68, 0.16); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.sync-hero-pill.local { background: rgba(148, 163, 184, 0.16); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Storage & Telemetry Metrics */
.storage-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.storage-kpi {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.storage-kpi-val {
  font-size: 20px;
  font-weight: 750;
  color: var(--tx);
  font-family: var(--font-mono, monospace);
}
.storage-kpi-lbl {
  font-size: 11px;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.storage-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--panel2);
  border-radius: var(--r2);
  border: 1px solid var(--line);
}
.storage-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tx2);
}
.storage-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--panel3);
  overflow: hidden;
}
.storage-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}

/* Danger Zone Card */
.danger-zone-card {
  border-color: rgba(239, 68, 68, 0.35);
  background: color-mix(in srgb, #ef4444 3%, var(--panel));
}
.danger-zone-card .settings-card-title {
  color: #ef4444;
}

/* Legacy helper styles maintained */
.set-grid-cards { column-width: 380px; column-gap: 14px; }
.set-card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 14px; }
.set-card h3 { margin-bottom: 12px; }
.set-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.set-grid .field { min-width: 0; }
.set-grid .opt { width: 100%; }

/* ---------- Settings Theme Cards Grid ---------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--panel2);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s, background .15s;
  text-align: left;
}
.theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--line2);
  box-shadow: var(--sh2);
}
.theme-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel2));
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 25%, transparent);
}
.theme-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.theme-card-icon {
  font-size: 20px;
}
.theme-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.theme-card-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--tx);
}
.theme-card-desc {
  font-size: 11px;
  color: var(--tx2);
  line-height: 1.35;
  flex: 1;
}
.theme-preview-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.theme-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex: none;
}


/* ---------- empty states & view hero ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--tx2); }
.empty-box, .empty-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 28px; text-align: center; max-width: 520px; margin: 32px auto;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 16px;
  box-shadow: 0 16px 36px -12px rgba(0,0,0,.4), 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
  position: relative; overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.empty-box:hover, .empty-hero:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}
.empty-glow, .empty-hero-icon {
  position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); color: var(--accent);
  margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 20%, transparent);
}
.empty-hero-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 10px; border-radius: 20px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.empty-title, .empty-hero-title {
  font-size: 1.25rem; font-weight: 700; margin: 0 0 8px; color: var(--tx);
  letter-spacing: -.015em;
}
.empty-desc, .empty-hero-desc {
  font-size: 13.5px; line-height: 1.55; margin: 0 0 22px; color: var(--muted);
  max-width: 420px;
}
.empty-hero-actions {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}


/* ---------- history timeline ---------- */
.hist-group { margin-bottom: 24px; }
.hist-date-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.hist-date-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: 0.02em;
}
.hist-date-badge {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: all .18s ease;
}
.hist-card:hover {
  border-color: rgba(212, 120, 74, 0.35);
  background: color-mix(in srgb, var(--accent) 3%, var(--panel));
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.hist-thumb {
  position: relative;
  width: 108px;
  aspect-ratio: 16/9;
  border-radius: var(--r2);
  overflow: hidden;
  flex: none;
  cursor: pointer;
  background: var(--panel2);
}
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.hist-card:hover .hist-thumb img { transform: scale(1.05); }
.hist-thumb-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(14, 13, 12, 0.45);
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transition: opacity .15s ease;
}
.hist-card:hover .hist-thumb-overlay { opacity: 1; }
.hist-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(0,0,0,0.5); z-index: 2;
}
.hist-prog { height: 100%; background: var(--accent); }
.hist-dur {
  position: absolute; right: 4px; bottom: 6px;
  background: rgba(0,0,0,.78); color: #fff;
  font-size: 10px; font-weight: 650; padding: 1px 5px;
  border-radius: 4px; font-variant-numeric: tabular-nums;
  line-height: 1.3; pointer-events: none; z-index: 3;
}
.hist-info { flex: 1; min-width: 0; }
.hist-title {
  font-size: 13.5px; font-weight: 600; color: var(--tx);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.hist-title:hover { color: var(--accent); }
.hist-sub {
  font-size: 11.5px; color: var(--muted); margin-top: 4px;
  display: flex; align-items: center; gap: 6px; overflow: hidden;
  white-space: nowrap;
}
.hist-author-btn {
  background: none; border: none; padding: 0;
  color: var(--tx2); font-size: 11.5px; font-weight: 550;
  cursor: pointer; transition: color .15s ease;
}
.hist-author-btn:hover { color: var(--accent); }
.hist-progress-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
}
.hist-progress-chip.done {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ok);
}
.hist-ago { font-size: 11px; color: var(--muted); }
.hist-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.hist-resume-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
}


/* ---------- empty chart state ---------- */
.chart-empty {
  min-height: 168px; display: grid; place-content: center; justify-items: center;
  gap: 8px; text-align: center; padding: 18px 14px;
  border: 1px dashed var(--line); border-radius: 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
}
.chart-empty-mark { color: var(--muted); opacity: .45; font-size: 26px; line-height: 1; }
.chart-empty p { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 30ch; }


/* ---------- channels system ---------- */
.vcard-author-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--tx2);
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
  transition: color .15s ease, text-decoration .15s ease;
}
.vcard-author-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.channel-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
}
.channel-chip {
  flex: none;
  min-width: 175px;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.channel-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.channel-chip-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line2);
}
.channel-chip-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(212, 120, 74, 0.18);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  border: 1px solid rgba(212, 120, 74, 0.35);
}
.channel-chip-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.channel-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-chip-count {
  font-size: 11px;
  color: var(--muted);
}
.channel-chip-play {
  opacity: 0.6;
  width: 28px;
  height: 28px;
  font-size: 12px;
  border-radius: 50%;
  background: rgba(212, 120, 74, 0.12);
  color: var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.channel-chip:hover .channel-chip-play {
  opacity: 1;
  transform: scale(1.08);
  background: var(--accent);
  color: #fff;
}

/* Channels Page - Compact 1-Line Header & Grid */
.channels-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 44px;
  margin-bottom: 12px;
}
.channels-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.channels-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  margin: 0;
}
.channels-count-pill {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.channels-head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.channels-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.channel-card-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: all .15s ease;
  min-height: 48px;
}
.channel-card-compact:hover {
  border-color: rgba(212, 120, 74, 0.4);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.channel-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line2);
}
.channel-card-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 120, 74, 0.18);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(212, 120, 74, 0.35);
}
.channel-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.channel-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-card-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-card-prog-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok);
  flex-shrink: 0;
}
.channel-card-play-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s ease;
}
.channel-card-compact:hover .channel-card-play-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.06);
}

/* Channel Detail - 1-Line Compact Header & Toolbar */
.channel-detail-page.compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.channel-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 12px;
  min-height: 44px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.channel-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.channel-back-pill {
  padding: 0 9px;
  height: 26px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
  flex-shrink: 0;
}
.channel-back-pill:hover {
  color: var(--tx);
  border-color: var(--line2);
  background: var(--panel2);
}
.channel-head-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  flex-shrink: 0;
}
.channel-head-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(212, 120, 74, 0.4);
}
.channel-head-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 120, 74, 0.18);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid rgba(212, 120, 74, 0.35);
}
.channel-head-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex-shrink: 1;
}
.channel-head-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.channel-stat-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
  white-space: nowrap;
}
.channel-stat-badge.done {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ok);
  font-weight: 600;
}
.channel-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.channel-play-all-pill {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
}
.channel-act-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 7px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
}
.channel-act-btn:hover {
  background: var(--panel2);
  color: var(--tx);
  border-color: var(--line2);
}

/* 1-Line Compact Channel Toolbar */
.channel-toolbar-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  height: 32px;
  min-height: 32px;
}
.channel-tb-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
  flex-shrink: 0;
}
.channel-tb-search svg {
  position: absolute;
  left: 9px;
  color: var(--muted);
  pointer-events: none;
}
.channel-search-input {
  width: 100%;
  height: 28px;
  padding: 0 24px 0 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx);
  font-size: 12px;
  outline: none;
  transition: border-color .15s ease;
}
.channel-search-input:focus {
  border-color: var(--accent);
}
.channel-search-clear {
  position: absolute;
  right: 7px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
}
.channel-search-clear:hover {
  color: var(--tx);
}
.channel-tb-select {
  width: auto !important;
  min-width: 100px;
  max-width: 130px;
  height: 28px !important;
  font-size: 11.5px !important;
  padding: 0 22px 0 8px !important;
  border-radius: 7px !important;
  flex-shrink: 0;
}
.channel-tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.channel-tb-count {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  color: var(--muted);
  white-space: nowrap;
}

/* Global .toolbar Fallback & Layout */
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: var(--r);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.toolbar .tb-pills { flex-shrink: 0; }
.toolbar .tb-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 170px;
  max-width: 100%;
  flex-shrink: 0;
}
.toolbar .tb-search-wrap svg {
  position: absolute;
  left: 9px;
  color: var(--muted);
  pointer-events: none;
}
.toolbar .tb-search-input {
  width: 100%;
  height: 28px;
  padding: 0 24px 0 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--tx);
  font-size: 12px;
  outline: none;
}
.toolbar .tb-search-input:focus {
  border-color: var(--accent);
}
.toolbar .tb-search-clear {
  position: absolute;
  right: 7px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.toolbar .tb-control { flex-shrink: 0; }
.toolbar .tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.toolbar .tb-count-hint {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  color: var(--muted);
}

/* ========================================================
   LIBRARY & PLAYLISTS & STATS - NOOK POLISHED STYLES
   ======================================================== */

/* Library Compact Header */
.library-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 44px;
  margin-bottom: 12px;
}
.library-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.library-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  margin: 0;
}
.library-count-pill {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.library-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.library-play-all-pill {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
}

/* Shelf Compact Header */
.shelf-page {
  display: flex;
  flex-direction: column;
}
.shelf-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 25%, var(--line));
  border-radius: var(--r);
  min-height: 44px;
  margin-bottom: 12px;
}
.shelf-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.shelf-head-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.shelf-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-count-pill, .shelf-watch-pill {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--c, var(--accent));
  font-weight: 600;
  white-space: nowrap;
}
.shelf-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.shelf-play-all-pill {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
}

/* Playlists Page Compact Header */
.playlists-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 44px;
  margin-bottom: 12px;
}
.playlists-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.playlists-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  margin: 0;
}
.playlists-count-pill {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.playlists-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.playlist-new-pill {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
}

/* Playlist Detail Compact Header */
.playlist-detail-page.compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.playlist-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 12px;
  min-height: 44px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.playlist-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.playlist-back-pill {
  padding: 0 9px;
  height: 26px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
  flex-shrink: 0;
}
.playlist-back-pill:hover {
  color: var(--tx);
  border-color: var(--line2);
  background: var(--panel2);
}
.playlist-head-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  flex-shrink: 0;
}
.playlist-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.playlist-head-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex-shrink: 1;
}
.playlist-head-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.playlist-stat-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
  white-space: nowrap;
}
.playlist-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.playlist-play-btn {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
}
.playlist-act-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 7px;
}

/* Stats Page Compact Header & Segmented Controls */
.stats-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 44px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stats-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-title {
  font-size: 16px;
  font-weight: 600;
  font-family: "Literata", ui-serif, Georgia, serif;
  color: var(--tx);
  margin: 0;
}
.stats-sub-pill {
  font-size: 11px;
  font-family: var(--f-mono, monospace);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.stats-head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-range-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.stats-range-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .14s ease;
}
.stats-range-btn:hover {
  color: var(--tx);
}
.stats-range-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.stats-csv-btn {
  height: 26px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 7px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--tx2);
}
.stats-csv-btn:hover {
  color: var(--tx);
  border-color: var(--line2);
  background: var(--panel2);
}

/* Balanced 4-Column Stat Grid */
.stat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}
@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 540px) {
  .stat-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Polished Playlist Cards */
.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.pl-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all .16s ease;
}
.pl-card:hover {
  border-color: rgba(212, 120, 74, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.plc-bar {
  height: 3px;
  width: 100%;
}
.plc-head {
  padding: 10px 12px 6px;
  cursor: pointer;
}
.plc-head h3 {
  font-size: 14.5px;
  font-family: "Literata", ui-serif, Georgia, serif;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 2px;
}
.plc-head .muted {
  font-size: 11px;
  color: var(--muted);
}
.plc-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 2px 12px 8px;
}
.plc-thumbs img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.plc-a {
  display: flex;
  gap: 5px;
  padding: 6px 12px 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel2) 50%, var(--panel));
}

/* Nook Sidebar Goal Widget */
.nook-sidebar-goal {
  margin: 10px 8px 4px;
  padding: 9px 11px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar.collapsed .nook-sidebar-goal {
  display: none;
}
.nook-goal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}
.nook-goal-lbl {
  color: var(--muted);
  font-weight: 500;
}
.nook-goal-val {
  color: var(--tx);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
}
.nook-goal-bar {
  height: 4px;
  background: var(--line2);
  border-radius: 999px;
  overflow: hidden;
}
.nook-goal-prog {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}
.nook-goal-focus {
  font-size: 11px;
  color: var(--accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
}



/* ---------- Playlist Folder Cards ---------- */
.pl-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 14px;
}
.pl-folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  user-select: none;
}
.pl-folder-card:hover {
  transform: translateY(-4px);
}
.pl-folder-tab-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 28px;
  padding: 0 6px;
}
.pl-folder-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 14px 2px 12px;
  border-radius: 8px 12px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.pl-folder-tab-ico {
  font-size: 11px;
  opacity: 0.9;
}
.pl-folder-count-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #8a857f);
  background: var(--bg2, #181614);
  border: 1px solid var(--line2, #332f2a);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 2px;
}
.pl-folder-body {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg, #12100e);
  border: 1px solid var(--line2, #2c2824);
  border-top: 2px solid var(--c, #d4784a);
  border-radius: 0 14px 14px 14px;
  padding: 14px;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pl-folder-card:hover .pl-folder-body {
  border-color: var(--line, #443e37);
  border-top-color: var(--c, #d4784a);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.pl-folder-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pl-folder-title {
  font-family: var(--font-serif, "Literata", serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--tx, #f4efe6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.pl-folder-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted, #8a857f);
}
.pl-folder-pocket {
  position: relative;
  height: 104px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  overflow: hidden;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-folder-thumb-wrap {
  position: absolute;
  top: 8px;
  width: 135px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.pl-folder-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pl-stack-0 {
  left: 20px;
  z-index: 4;
  transform: rotate(-3deg);
}
.pl-stack-1 {
  left: 55px;
  z-index: 3;
  transform: rotate(2deg);
  opacity: 0.9;
}
.pl-stack-2 {
  left: 90px;
  z-index: 2;
  transform: rotate(-1deg);
  opacity: 0.75;
}
.pl-stack-3 {
  left: 120px;
  z-index: 1;
  transform: rotate(3deg);
  opacity: 0.6;
}
.pl-folder-card:hover .pl-stack-0 {
  transform: translateY(-4px) rotate(-4deg) scale(1.02);
}
.pl-folder-card:hover .pl-stack-1 {
  transform: translateY(-3px) rotate(3deg) scale(1.02);
}
.pl-folder-card:hover .pl-stack-2 {
  transform: translateY(-2px) rotate(-2deg);
}
.pl-folder-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.pl-folder-card:hover .pl-folder-play-overlay {
  opacity: 1;
}
.pl-folder-empty-pocket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted, #8a857f);
  font-size: 12px;
}
.pl-folder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.pl-play-btn {
  font-weight: 600;
  padding: 4px 12px;
}
.pl-tool-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- 1-Line Compact Headers: Focus, Notes, Links, Trash ---------- */
.focus-head-compact,
.notes-head-compact,
.links-head-compact,
.trash-head-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line2, #262320);
  flex-wrap: wrap;
}
.focus-head-meta,
.notes-head-meta,
.links-head-meta,
.trash-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.focus-title,
.notes-title,
.links-title,
.trash-title {
  font-family: var(--font-serif, "Literata", serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--tx, #f4efe6);
}
.focus-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg2, #1f1d1a);
  border: 1px solid var(--line2, #332f2a);
  color: var(--muted, #8a857f);
}
.focus-status-pill.running {
  background: rgba(212, 120, 74, 0.15);
  border-color: rgba(212, 120, 74, 0.35);
  color: var(--accent, #d4784a);
}
.focus-stat-pill,
.notes-count-pill,
.links-count-pill,
.trash-count-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg2, #1f1d1a);
  border: 1px solid var(--line2, #332f2a);
  color: var(--muted, #8a857f);
}
.notes-tags-hint {
  font-size: 11px;
  color: var(--muted, #8a857f);
}
.focus-head-actions,
.notes-head-actions,
.links-head-actions,
.trash-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   FOCUSTUBE HORIZONTAL TOPBAR & DROPDOWN NAVIGATION (NO SIDEBAR)
   ============================================================ */
body.focustube-nav .sidebar,
body.focustube-nav .nav-expand,
body.focustube-nav #scrim {
  display: none !important;
}

body.focustube-nav .content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

body.focustube-nav .main {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 18px calc(var(--player) + 24px);
}

.topbar.focustube-topbar {
  display: flex !important;
  flex-direction: column !important;
  min-height: auto !important;
  padding: 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background: rgba(11, 14, 23, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
  overflow: visible !important;
}

body.player-expanded .topbar.focustube-topbar,
body.player-expanded .topbar,
body.player-expanded .statusbar,
body.player-expanded .main {
  display: none !important;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: visible !important;
}

.topbar-row.main-row {
  padding: 5px 16px;
  gap: 10px;
  overflow: visible !important;
}

.topbar-row.sub-row {
  padding: 2px 16px 5px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  overflow: visible !important;
}

/* Brand */
.topbar.focustube-topbar .brand {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  height: auto;
  border-bottom: 0;
  flex-shrink: 0;
  transition: transform .14s ease, opacity .14s ease;
}

.topbar.focustube-topbar .brand:hover {
  transform: scale(1.02);
  opacity: .95;
}

.brand-dot {
  color: var(--accent, #4f7cff);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(79, 124, 255, 0.7);
}

.brand-name {
  font-weight: 750;
  font-size: 15.5px;
  color: var(--tx, #e8ecf5);
  letter-spacing: -0.02em;
}

/* Pastebar */
.topbar.focustube-topbar .pastebar {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #151a28 !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 999px !important;
  padding: 2px 4px 2px 12px;
  min-height: 33px;
  height: 33px;
  max-height: 33px;
  transition: all .16s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.topbar.focustube-topbar .pastebar:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.topbar.focustube-topbar .pastebar:focus-within {
  border-color: #4f7cff !important;
  box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.28), 0 4px 18px rgba(0, 0, 0, 0.45) !important;
}

.topbar.focustube-topbar .paste-ico {
  color: #4f7cff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.topbar.focustube-topbar .paste-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: #e8ecf5;
  padding: 4px 0;
}

.topbar.focustube-topbar .paste-input::placeholder {
  color: #7b849c;
}

.paste-add-btn {
  background: linear-gradient(135deg, #4f7cff, #3b6bef) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 0 13px !important;
  height: 25px !important;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(79, 124, 255, 0.45);
  transition: all .16s ease;
}

.paste-add-btn:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.6);
  transform: translateY(-1px);
}

/* Actions in row 1 */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.shelf-select-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  z-index: 120 !important;
}

.shelf-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 10px;
  border-radius: 7px;
  background: #151a28;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e8ecf5;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: all .14s ease;
  user-select: none;
}

.shelf-select-btn:hover {
  background: #1a2030;
  border-color: rgba(79, 124, 255, 0.4);
  color: #fff;
}

.shelf-select-wrap.open .shelf-select-btn {
  background: #151a28;
  border-color: #4f7cff;
  box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.25);
  color: #fff;
}

.shelf-btn-ico {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.shelf-btn-name {
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-btn-caret {
  font-size: 9.5px;
  color: #8b93a9;
  transition: transform .18s ease;
  margin-left: 2px;
}

.shelf-select-wrap.open .shelf-btn-caret {
  transform: rotate(180deg);
  color: #4f7cff;
}

.shelf-select-menu {
  position: absolute !important;
  top: calc(100% + 5px) !important;
  left: 0 !important;
  min-width: 220px !important;
  max-width: 280px !important;
  background: #151a28 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(79, 124, 255, 0.15) !important;
  padding: 6px !important;
  z-index: 1200 !important;
  display: none;
  flex-direction: column !important;
  gap: 2px !important;
  pointer-events: auto !important;
  animation: dropdownAnim .15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.shelf-select-wrap.open .shelf-select-menu {
  display: flex !important;
}

.custom-dropdown-header {
  font-size: 10px;
  font-weight: 700;
  color: #8b93a9;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 5px 8px 3px;
}

.custom-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 0;
  background: none;
  color: #e8ecf5;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all .12s ease;
}

.custom-dropdown-item:hover {
  background: #1a2030;
  color: #fff;
}

.custom-dropdown-item.selected {
  background: rgba(79, 124, 255, 0.14);
  color: #4f7cff;
  font-weight: 600;
}

.custom-dropdown-ico {
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.custom-dropdown-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-count {
  font-size: 10px;
  color: #8b93a9;
  background: #10141f;
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
  font-weight: 600;
}

.custom-dropdown-item.selected .custom-dropdown-count {
  background: rgba(79, 124, 255, 0.22);
  color: #4f7cff;
}

.custom-dropdown-check {
  font-size: 12px;
  color: #4f7cff;
  font-weight: 700;
  margin-left: 2px;
}

.custom-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 2px;
}

.custom-dropdown-act {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 0;
  background: none;
  color: #4f7cff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}

.custom-dropdown-act:hover {
  background: rgba(79, 124, 255, 0.12);
}

.custom-dropdown-act-ico {
  font-size: 11px;
  line-height: 1;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  background: none;
  border: 0;
  cursor: pointer;
  color: #8b93a9;
  font-size: 13px;
  border-radius: 7px;
  transition: background .14s, color .14s, transform .14s;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: #e8ecf5;
  background: #1a2030;
  transform: translateY(-1px);
}

/* Row 2: Sub Navigation tabs & dropdowns */
.topnav-links {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex: 1 !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid transparent;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  color: #8b93a9;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  transition: all .15s ease;
  user-select: none;
}

.nav-tab * {
  pointer-events: none;
}

.nav-tab:hover {
  color: #e8ecf5;
  background: #151a28;
}

.nav-tab.sel {
  background: #1a2030 !important;
  color: #e8ecf5 !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.nav-tab-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.22);
  color: #4f7cff;
}

/* Dropdown Container */
.nav-dropdown-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  z-index: 110 !important;
}

.nav-dropdown-wrap.open {
  z-index: 130 !important;
}

.nav-caret {
  font-size: 10px;
  color: #8b93a9;
  margin-left: 2px;
  transition: transform .18s ease;
}

.nav-dropdown-wrap.open .nav-caret,
.nav-dropdown-wrap:hover .nav-caret {
  transform: rotate(180deg);
  color: #4f7cff;
}

.nav-dropdown-wrap.open > .nav-tab,
.nav-dropdown-wrap:hover > .nav-tab {
  background: #151a28;
  color: #e8ecf5;
  border-color: rgba(79, 124, 255, 0.35);
}

.nav-dropdown-menu {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  min-width: 260px !important;
  max-width: min(340px, 90vw) !important;
  background: #151a28 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(79, 124, 255, 0.15) !important;
  padding: 6px !important;
  z-index: 1200 !important;
  display: none;
  flex-direction: column !important;
  gap: 2px !important;
  pointer-events: auto !important;
  animation: dropdownAnim .15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Invisible bridge so mouse hover doesn't drop between button and menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.nav-dropdown-wrap.open .nav-dropdown-menu,
.nav-dropdown-wrap:hover .nav-dropdown-menu {
  display: flex !important;
}

.nav-dropdown-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #8b93a9);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 8px 4px;
}

.nav-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 0;
  background: none;
  color: var(--tx, #e8ecf5);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}

.nav-dropdown-item:hover {
  background: var(--card2, #1a2030);
}

.nav-dropdown-ico {
  font-size: 13px;
  flex-shrink: 0;
}

.nav-dropdown-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.nav-dropdown-count {
  font-size: 10.5px;
  color: var(--muted, #8b93a9);
  background: var(--bg2, #10141f);
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.nav-dropdown-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-dropdown-initial {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card2, #1a2030);
  border: 1px solid var(--line, #232a3d);
  color: var(--accent, #4f7cff);
  font-weight: 700;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-dropdown-empty {
  padding: 12px 8px;
  font-size: 12px;
  color: var(--muted, #8b93a9);
  text-align: center;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--line, #232a3d);
  margin: 4px 0;
}

.nav-dropdown-act {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 0;
  background: none;
  color: var(--accent, #4f7cff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .12s;
}

.nav-dropdown-act:hover {
  background: color-mix(in srgb, var(--accent, #4f7cff) 12%, transparent);
}

.nav-dropdown-act.view-all {
  color: var(--muted, #8b93a9);
}

.nav-dropdown-act.view-all:hover {
  color: var(--tx, #e8ecf5);
  background: var(--card2, #1a2030);
}

/* Nav Search input on right of Row 2 */
.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-search-input {
  width: 155px;
  height: 27px;
  background: var(--card, #151a28);
  border: 1px solid var(--line, #232a3d);
  border-radius: 999px;
  color: var(--tx, #e8ecf5);
  padding: 0 24px 0 10px;
  font-size: 11.5px;
  outline: none;
  transition: width .2s ease, border-color .15s ease, box-shadow .15s ease;
}

.nav-search-input:focus {
  width: 215px;
  border-color: var(--accent, #4f7cff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #4f7cff) 22%, transparent);
}

.nav-search-wrap .search-clear-btn {
  position: absolute;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: var(--card2, #1a2030);
  color: var(--muted, #8b93a9);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}

/* Mobile responsive rules */
@media (max-width: 768px) {
  .topbar-row.main-row {
    padding: 6px 10px;
    gap: 8px;
  }
  .topbar-row.sub-row {
    padding: 2px 10px 6px;
    gap: 6px;
  }
  .brand-name {
    display: none;
  }
  .shelf-select {
    max-width: 110px;
  }
  .nav-search-input {
    width: 110px;
  }
  .nav-search-input:focus {
    width: 140px;
  }
  .nav-tab .nav-lbl {
    display: none;
  }
  .nav-tab {
    padding: 6px 8px;
  }
}

/* ---------- Compact 1-Line Home Hero Banner ---------- */
.home-hero-card.compact-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 14px !important;
  margin-bottom: 16px !important;
  background: linear-gradient(135deg, rgba(21, 26, 40, 0.95), rgba(16, 20, 31, 0.9)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-left: 3px solid #4f7cff !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  gap: 12px !important;
  overflow: hidden !important;
}

.home-hero-left {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 7px !important;
  flex-shrink: 0 !important;
  min-width: 0 !important;
}

.home-hero-greeting-ico {
  font-size: 16px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.home-hero-greeting {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: #e8ecf5 !important;
  margin: 0 !important;
  letter-spacing: -0.01em !important;
  white-space: nowrap !important;
}

.home-hero-dot {
  color: #4a5472 !important;
  font-size: 10px !important;
}

.home-hero-sub {
  font-size: 11.5px !important;
  color: #8b93a9 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.home-hero-pills {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.home-hero-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: #1a2030 !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #b4bdd4 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.home-hero-pill.streak {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #f59e0b !important;
}

.home-hero-pill.focus {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  color: #38bdf8 !important;
}

.home-hero-pill.library {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.25) !important;
  color: #4ade80 !important;
}

.home-hero-pill.lists {
  background: rgba(79, 124, 255, 0.12) !important;
  border-color: rgba(79, 124, 255, 0.3) !important;
  color: #4f7cff !important;
}

.home-hero-pill.goal {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #151a28 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.home-pill-goal-lbl {
  font-variant-numeric: tabular-nums !important;
  font-size: 11px !important;
}

.home-pill-bar-track {
  width: 40px !important;
  height: 4px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.home-pill-bar-fill {
  display: block !important;
  height: 100% !important;
  background: #22c55e !important;
  border-radius: 999px !important;
  transition: width .3s ease !important;
}

@media (max-width: 1080px) {
  .home-hero-sub {
    display: none !important;
  }
}
@media (max-width: 820px) {
  .home-hero-card.compact-line {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    flex-wrap: wrap !important;
    padding: 8px 12px !important;
    gap: 8px !important;
  }
}

