:root {
  --bg: #000000;
  --card: rgba(0, 0, 0, 0.6);
  --border: #003300;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --orange: #ff8800;
  --orange-hover: #ffaa33;
  --green: #00ff41;
  --green-dim: rgba(0, 255, 65, 0.15);
  --border-green: rgba(0, 255, 65, 0.2);
  --red: #ef4444;
  --grey: #1a1a1a;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-blur: blur(8px);
  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-green);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 52px;
  gap: 8px;
}

nav .logo {
  font-size: 17px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
  flex: 1;
}

nav .logo span { color: var(--orange); }

.nav-tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); background: var(--glass); }
.tab-btn.active { color: var(--green); background: var(--green-dim); }

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-green);
  overflow-x: auto;
  scrollbar-width: none;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── VIEWS ── */
.view { display: none; padding: 12px 16px; }
.view.active { display: block; }

/* ── FILTERS ── */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  background: var(--glass);
  border: 1px solid var(--border-green);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover, .filter-btn.active {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-dim);
}

.search-input {
  background: var(--glass);
  border: 1px solid var(--border-green);
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  outline: none;
  width: 160px;
  transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--green); }
.search-input::placeholder { color: var(--muted); }

/* ── ENTRY CARDS ── */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.entry-card {
  background: var(--grey);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s;
  position: relative;
}

.entry-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}

.entry-card .poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: #111;
}

.poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.entry-card .card-body {
  padding: 8px;
}

.entry-card .card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-card .card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.entry-card .card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Status badge */
.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-to_watch { background: rgba(255,136,0,0.2); color: var(--orange); }
.badge-watching { background: rgba(6,182,212,0.2); color: #06b6d4; }
.badge-watched  { background: rgba(0,255,65,0.15); color: var(--green); }

/* Priority dots */
.priority-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.priority-1 { background: #374151; }
.priority-2 { background: #6b7280; }
.priority-3 { background: var(--orange); }
.priority-4 { background: #f43f5e; }
.priority-5 { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* On disk badge */
.disk-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  background: rgba(0,0,0,0.7);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 1px 4px;
}

/* ── PICK VIEW ── */
.pick-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  gap: 20px;
}

.pick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 480px;
}

.pick-result {
  width: 100%;
  max-width: 360px;
  background: var(--grey);
  border: 1px solid var(--border-green);
  border-radius: 14px;
  overflow: hidden;
  display: none;
}

.pick-result.visible { display: block; }

.pick-backdrop {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #111;
  display: block;
}

.pick-result-body {
  padding: 16px;
}

.pick-result-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.pick-result-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.pick-result-overview {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pick-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
}

.btn-green {
  background: var(--green);
  color: #000;
}
.btn-green:hover { background: #33ff66; }

.btn-orange {
  background: var(--orange);
  color: #000;
}
.btn-orange:hover { background: var(--orange-hover); }

.btn-ghost {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border-green);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.btn-red {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.pick-btn-main {
  padding: 16px 32px;
  font-size: 18px;
  border-radius: 12px;
  background: var(--green);
  color: #000;
  border: none;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: -0.3px;
  transition: all 0.15s var(--ease);
}
.pick-btn-main:hover {
  background: #33ff66;
  transform: scale(1.03);
}

/* ── CALENDAR VIEW ── */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cal-nav-btn {
  background: var(--glass);
  border: 1px solid var(--border-green);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav-btn:hover { border-color: var(--green); color: var(--green); }

.cal-month {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

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

.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
  text-transform: uppercase;
}

/* Every cell is a poster card — same 2:3 aspect ratio */
.cal-day {
  aspect-ratio: 2 / 3;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: var(--grey);
  border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cal-day:hover       { border-color: var(--green); }
.cal-day.today       { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.cal-day.has-planned { border-color: var(--border-green); }
.cal-day.checked-in  { border-color: var(--orange); opacity: 0.7; }
.cal-day.other-month { opacity: 0.2; pointer-events: none; }
.cal-day.empty       { background: none; border-color: transparent; cursor: default; pointer-events: none; }

/* Poster image fills the whole cell */
.cal-day-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Gradient overlay for text legibility */
.cal-day-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0)    40%,
    rgba(0,0,0,0.55) 65%,
    rgba(0,0,0,0.88) 100%
  );
  z-index: 1;
}

/* Day number — top-left */
.cal-day-num {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  z-index: 2;
}
.cal-day-num.dim { color: var(--muted); text-shadow: none; }
.cal-day.today .cal-day-num { color: var(--orange); }

/* Film title — bottom */
.cal-day-title {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  font-size: 8px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Watched checkmark — top-right */
.cal-day-check {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 12px;
  color: var(--orange);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  z-index: 2;
}

/* "+N more" badge — bottom-right */
.cal-day-more {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0,0,0,0.65);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 5px;
  z-index: 2;
}

/* Series episode label — bottom-right (when no extra) */
.cal-day-ep {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0,0,0,0.65);
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 4px;
  z-index: 2;
}

/* Shift bar in cal-day modal */
.cal-shift-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cal-shift-bar .btn { padding: 4px 10px; font-size: 12px; }

/* ── Calendar extras ── */
.cal-extras-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cal-extras-summary {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  background: var(--grey);
  list-style: none;
}
.cal-extras-summary::-webkit-details-marker { display: none; }
.cal-extras-summary::before { content: '▸ '; }
details[open] .cal-extras-summary::before { content: '▾ '; }
.cal-extras-list { padding: 8px 12px; }
.cal-extra-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.cal-extra-item:last-child { border-bottom: none; }
.cal-extra-date { color: var(--muted); min-width: 90px; flex-shrink: 0; }

/* ── SUIVI VIEW ── */
.suivi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.suivi-topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.suivi-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
#suivi-count {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.suivi-empty {
  text-align: center;
  color: var(--green);
  padding: 48px 0;
  font-size: 15px;
  font-weight: 600;
}
.suivi-card {
  background: var(--grey);
  border: 1px solid var(--border-green);
  border-radius: 12px;
  padding: 16px;
}
.suivi-date-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.suivi-card-body {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}
.suivi-poster {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.suivi-poster-blank {
  background: var(--bg2);
  border: 1px solid var(--border);
}
.suivi-info { flex: 1; min-width: 0; }
.suivi-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suivi-year { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.suivi-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border-radius: 4px;
  padding: 2px 7px;
}
.suivi-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.suivi-btn {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.suivi-btn:hover { border-color: var(--green); color: var(--green); }
.suivi-btn-green {
  background: var(--green-dim);
  border-color: var(--border-green);
  color: var(--green);
  font-weight: 600;
}
.suivi-btn-green:hover { background: rgba(0,255,65,0.15); }
.suivi-panel {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.suivi-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 6px;
}

/* ── ADD VIEW ── */
.add-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.add-search-input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--border-green);
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
}

.add-search-input:focus { border-color: var(--green); }
.add-search-input::placeholder { color: var(--muted); }

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-card {
  display: flex;
  gap: 12px;
  background: var(--grey);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  padding: 10px;
  align-items: flex-start;
}

.search-result-card img {
  width: 50px;
  height: 75px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: #111;
}

.search-result-info { flex: 1; min-width: 0; }

.search-result-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.search-result-overview {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #111;
  border: 1px solid var(--border-green);
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s var(--ease);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-green);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 16px; }

.modal-poster-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.modal-poster {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #1a1a1a;
}

.modal-info { flex: 1; min-width: 0; }
.modal-entry-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.modal-entry-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.modal-entry-overview {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Status row */
.modal-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.status-row, .priority-row, .plan-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.status-btn, .priority-btn {
  background: var(--glass);
  border: 1px solid var(--border-green);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  min-width: 70px;
  text-align: center;
}

.status-btn.active-to_watch { color: var(--orange); border-color: var(--orange); background: rgba(255,136,0,0.1); }
.status-btn.active-watching { color: #06b6d4; border-color: #06b6d4; background: rgba(6,182,212,0.1); }
.status-btn.active-watched  { color: var(--green); border-color: var(--green); background: var(--green-dim); }

.priority-btn.active {
  color: var(--orange);
  border-color: var(--orange);
  background: rgba(255,136,0,0.1);
}

.plan-date-input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--border-green);
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 7px;
  outline: none;
}
.plan-date-input:focus { border-color: var(--green); }

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-green);
  display: flex;
  gap: 8px;
}

/* ── CHECK-IN BANNER ── */
.checkin-banner {
  margin: 12px 16px;
  background: rgba(255,136,0,0.08);
  border: 1px solid rgba(255,136,0,0.35);
  border-radius: var(--radius);
  padding: 12px;
  display: none;
}

.checkin-banner.visible { display: block; }

.checkin-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 6px;
}

.checkin-banner-text {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.checkin-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── CHECK-IN MODAL ── */
.checkin-entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.checkin-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--grey);
  border: 1px solid var(--border-green);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.checkin-entry.checked {
  border-color: var(--green);
  background: var(--green-dim);
}

.checkin-entry img {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #111;
}

.checkin-entry-title {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.checkin-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-green);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.checkin-entry.checked .checkin-check {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  border: 1px solid var(--border-green);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 300;
  transition: transform 0.25s var(--ease);
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* ── LOADING ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-green);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── EDIT BUTTON on card ── */
.card-edit-btn,
.card-delete-btn {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--border-green);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  z-index: 2;
}
.card-edit-btn   { bottom: 6px; right: 6px; }
.card-delete-btn { bottom: 6px; right: 32px; }
.entry-card:hover .card-edit-btn,
.entry-card:hover .card-delete-btn { opacity: 1; }
.card-edit-btn:hover   { color: var(--orange); border-color: var(--orange); }
.card-delete-btn:hover { color: var(--red); border-color: var(--red); }

/* ── SERIES PLAN MODAL ── */
.day-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.day-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-green);
  background: var(--glass);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.day-btn.active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}
.series-plan-preview {
  background: #0a0a0a;
  border: 1px solid var(--border-green);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  min-height: 40px;
}
.series-plan-preview strong { color: var(--green); }

/* ── REASSIGN MODAL ── */
.reassign-local-name {
  font-size: 11px;
  color: var(--muted);
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 12px;
  word-break: break-all;
  font-family: monospace;
}

/* ── FAILED SCAN LIST ── */
.failed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.failed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
}

.failed-item-name {
  flex: 1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── GENRES CHIPS ── */
.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.genre-chip {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border-green);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── SCAN / IMPORT SECTION ── */
.tools-section {
  margin-top: 20px;
  border-top: 1px solid var(--border-green);
  padding-top: 16px;
}
.tools-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.tools-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .entry-grid { grid-template-columns: repeat(3, 1fr); }
  nav { padding: 0 10px; }
}
