/**
 * MatchLetter dashboard layer — builds on matchletter-trakt.css tokens.
 */

body.dash {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --dash-display: "Bricolage Grotesque", "Inter", -apple-system, sans-serif;
  --dash-green: #00e054;
  --dash-pink: #ff4fa3;
  --dash-violet: #7b5cff;
}

.dash code {
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
}

.dash-muted { color: var(--ml-text-muted); font-size: 13.5px; line-height: 1.55; }
.dash-muted.small { font-size: 12.5px; }
.dash-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dash-green); }
.dash-display { font-family: var(--dash-display); font-weight: 800; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.02em; }
.dash-display.sm { font-size: clamp(24px, 3vw, 32px); }
.dash-h2 { font-family: var(--dash-display); font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.dash-h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.dash-page-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.hide-xs { display: inline; }

/* Sidebar polish */
.sidebar-brand .brand-icon,
.sidebar-brand .brand-title {
  color: #0084ff;
  transition: color 0.15s ease;
}
.sidebar-brand:hover .brand-icon,
.sidebar-brand:hover .brand-title {
  color: #38a0ff;
}

/* Sign out button in Settings: bold red and prominent */
.dash-settings-actions [data-action="logout"],
.btn-logout {
  background: #ff3b30 !important;
  color: #ffffff !important;
  border: 1px solid #ff3b30 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 11px 24px !important;
  border-radius: 9px !important;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35) !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
}

.dash-settings-actions [data-action="logout"]:hover,
.btn-logout:hover {
  background: #e0281c !important;
  border-color: #e0281c !important;
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.5) !important;
  transform: translateY(-1px) !important;
}

.dash-settings-actions [data-action="logout"]:active,
.btn-logout:active {
  transform: translateY(0) !important;
}
.dash .nav-item { width: 100%; }
.dash .nav-item.active { background: var(--ml-accent-soft); color: var(--ml-text); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ml-text-dim); font-variant-numeric: tabular-nums; }
.dash .user-mini-card { width: 100%; background: none; border: 1px solid var(--ml-border); color: inherit; text-align: left; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--ml-radius); }
.dash .user-mini-card:hover { border-color: var(--ml-border-hover); }
.dash .user-info { display: flex; flex-direction: column; min-width: 0; }
.dash .user-name, .dash .user-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 90; }
.dash-scrim[hidden] { display: none; }

.dash .app-header { gap: 12px; }
.dash .header-actions { display: flex; gap: 8px; align-items: center; }
.dash .header-actions .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* Avatars */
.dash-avatar {
  --av: #7b5cff;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--av); color: #0b0b0b;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--dash-display); font-weight: 800; font-size: 15px;
  flex-shrink: 0; border: 2px solid var(--ml-bg);
}
.dash-avatar.xs { width: 22px; height: 22px; font-size: 11px; border-width: 1px; }
.dash-avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.dash-avatar.lg { width: 56px; height: 56px; font-size: 24px; }
.dash-avatar.xl { width: 84px; height: 84px; font-size: 38px; border-width: 3px; box-shadow: 0 0 0 1px var(--ml-border); }
.dash-avatar-stack { display: flex; }
.dash-avatar-stack .dash-avatar + .dash-avatar { margin-left: -10px; }
.dash-avatar-stack.lg .dash-avatar { width: 48px; height: 48px; font-size: 20px; }
.dash-avatar-stack.lg .dash-avatar + .dash-avatar { margin-left: -14px; }

/* Chips */
.dash-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--ml-border); background: rgba(255, 255, 255, 0.04); color: var(--ml-text); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.dash-chip b { color: var(--ml-text-dim); font-weight: 700; }
.dash-chip.lb { border-color: rgba(0, 224, 84, 0.35); color: #6dffa6; }
.dash-chip.imdb { border-color: rgba(245, 197, 24, 0.4); color: #f5c518; }
.dash-chip.ghost { border-style: dashed; color: var(--ml-text-muted); }
.dash-chip:hover { border-color: var(--ml-border-hover); }
.dash-tag { padding: 2px 8px; border-radius: 999px; background: rgba(0, 224, 84, 0.12); color: #6dffa6; font-size: 11.5px; font-weight: 700; }

/* Hero (guest) */
.dash-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; padding: 36px; border-radius: 20px; border: 1px solid var(--ml-border); background: radial-gradient(90% 120% at 0% 0%, rgba(123, 92, 255, 0.22), transparent 60%), radial-gradient(70% 90% at 100% 100%, rgba(255, 79, 163, 0.18), transparent 60%), var(--ml-card-bg); }
.dash-hero-copy { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.dash-hero-actions.center { justify-content: center; }
.dash-hero-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.dash-hero-art { position: relative; height: 220px; }
.dash-hero-art span { position: absolute; width: 120px; height: 210px; border-radius: 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.dash-hero-art .c1 { left: 10%; top: 6px; background: #c9ff3b; transform: rotate(-12deg); }
.dash-hero-art .c2 { left: 34%; top: 0; background: #ff5a36; transform: rotate(-2deg); }
.dash-hero-art .c3 { left: 58%; top: 10px; background: #2c55ff; transform: rotate(9deg); }
.dash-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 16px; }
.dash-feature { padding: 18px; border-radius: 14px; border: 1px solid var(--ml-border); background: var(--ml-card-bg); }
.dash-feature h3 { font-size: 15px; margin: 8px 0 4px; }
.dash-feature-icon { font-size: 22px; }

/* Profile header */
.dash-profile { display: flex; gap: 20px; align-items: center; padding: 24px; border-radius: 18px; border: 1px solid var(--ml-border); background: radial-gradient(100% 140% at 0% 0%, rgba(0, 224, 84, 0.12), transparent 55%), var(--ml-card-bg); }
.dash-profile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-profile-meta { color: var(--ml-text-muted); font-size: 13.5px; display: flex; gap: 6px; flex-wrap: wrap; }
.dash-bio { color: var(--ml-text); font-size: 14px; max-width: 620px; }
.dash-profile-actions { display: flex; flex-direction: column; gap: 8px; }
.dash-profile-actions .btn { text-decoration: none; justify-content: center; display: inline-flex; }

/* Stats */
.dash-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.dash-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 14px; border: 1px solid var(--ml-border); background: var(--ml-card-bg); color: inherit; text-decoration: none; transition: var(--ml-transition); }
.dash-stat:hover { border-color: var(--ml-border-hover); transform: translateY(-1px); }
.dash-stat-value { font-family: var(--dash-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dash-stat-label { font-size: 12.5px; color: var(--ml-text-muted); font-weight: 600; }
.dash-stat-sub { font-size: 11.5px; color: var(--ml-text-dim); }

.dash-empty-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; margin-top: 12px; border-radius: 14px; border: 1px dashed rgba(0, 224, 84, 0.4); background: rgba(0, 224, 84, 0.05); }
.dash-empty-cta h3 { font-size: 15px; margin-bottom: 2px; }
.dash-empty-cta .btn { text-decoration: none; flex-shrink: 0; }

/* Shelves */
.dash-shelf { margin-top: 28px; }
.dash-shelf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.dash-shelf-head a { color: var(--ml-text-muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.dash-shelf-head a:hover { color: var(--ml-text); }
.dash-shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.dash-shelf-row > .movie-card { scroll-snap-align: start; }
.dash-empty-inline { padding: 18px; border-radius: 12px; border: 1px dashed var(--ml-border); color: var(--ml-text-muted); font-size: 13.5px; }
.dash-empty-inline a { color: var(--dash-green); }

/* Taste panels */
.dash-taste-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dash-panel { padding: 16px; border-radius: 14px; border: 1px solid var(--ml-border); background: var(--ml-card-bg); }
.dash-panel-title { font-size: 12px; font-weight: 700; color: var(--ml-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.dash-histogram { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 90px; align-items: end; }
.dash-hbar { height: 100%; display: flex; align-items: flex-end; }
.dash-hbar span { width: 100%; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--dash-green), #00a33d); }
.dash-histogram-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dash-green); margin-top: 6px; }
.dash-decades { display: flex; flex-direction: column; gap: 6px; }
.dash-decade { display: grid; grid-template-columns: 34px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; }
.dash-decade-label { color: var(--ml-text-muted); font-weight: 600; }
.dash-decade-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.dash-decade-bar i { display: block; height: 100%; background: var(--dash-violet); border-radius: 4px; }
.dash-decade-count { text-align: right; color: var(--ml-text-dim); font-variant-numeric: tabular-nums; }

/* Movie cards: actions, stars, links */
.dash .movie-card .card-actions { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s ease; }
.dash .movie-card:hover .card-actions, .dash .movie-card:focus-within .card-actions { opacity: 1; }
.card-action { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(7, 9, 14, 0.82); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(6px); }
.card-action:hover { background: rgba(7, 9, 14, 0.95); border-color: rgba(255, 255, 255, 0.4); }
.card-action.fav.on { color: var(--dash-pink); border-color: rgba(255, 79, 163, 0.6); }
.dash .movie-card .card-actions:has(.fav.on) { opacity: 1; }
.dash .movie-card .card-actions .card-action:not(.fav) { display: none; }
.dash .movie-card:hover .card-actions .card-action:not(.fav), .dash .movie-card:focus-within .card-actions .card-action:not(.fav) { display: inline-flex; }
.dash .rating-badge.stars { color: var(--dash-green); letter-spacing: 1px; }
.dash .movie-sub { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.movie-links { display: inline-flex; gap: 6px; }
.movie-links a { font-size: 10px; font-weight: 700; text-decoration: none; }
.movie-links a.lb { color: #00e054; }
.movie-links a.imdb { color: #f5c518; }
.dash .movie-card.removing { opacity: 0.4; pointer-events: none; }
.dash .movie-card.skeleton .poster-box, .sk-line, .dash-skeleton-hero, .dash-skeleton-row, .dash-match.skeleton { background: linear-gradient(90deg, #10141d 0%, #171c28 50%, #10141d 100%); background-size: 200% 100%; animation: dash-shimmer 1.2s linear infinite; }
.sk-line { height: 10px; border-radius: 4px; margin-bottom: 6px; }
.sk-line.short { width: 40%; }
.dash-skeleton-hero { height: 132px; border-radius: 18px; }
.dash-skeleton-row { height: 220px; border-radius: 14px; margin-top: 20px; }
@keyframes dash-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Library toolbar */
.dash-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.dash-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ml-card-bg); border: 1px solid var(--ml-border); }
.dash-tab { border: 0; background: none; color: var(--ml-text-muted); font: 600 13px inherit; font-family: inherit; padding: 8px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.dash-tab span { font-size: 11px; color: var(--ml-text-dim); font-variant-numeric: tabular-nums; }
.dash-tab.active { background: #fff; color: #0b0b0b; }
.dash-tab.active span { color: #555; }
.dash-toolbar-right { display: flex; gap: 8px; flex: 1; justify-content: flex-end; min-width: 260px; }
.dash-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 10px; border: 1px solid var(--ml-border); background: var(--ml-input-bg); color: var(--ml-text-dim); flex: 1; max-width: 300px; }
.dash-search:focus-within { border-color: var(--ml-border-focus); }
.dash-search input { flex: 1; background: none; border: 0; outline: none; color: var(--ml-text); font: inherit; font-size: 13.5px; min-width: 0; }
.dash-select, .dash-input { height: 38px; border-radius: 10px; border: 1px solid var(--ml-border); background: var(--ml-input-bg); color: var(--ml-text); font: inherit; font-size: 13.5px; padding: 0 12px; }
.dash-select:focus, .dash-input:focus { outline: none; border-color: var(--ml-border-focus); }
textarea.dash-input { height: auto; padding: 10px 12px; resize: vertical; }
.dash-count-line { margin: 6px 0 14px; min-height: 20px; }
.dash-pagination { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 28px 0 8px; }
.dash-pagination[hidden] { display: none; }

/* Empty states */
.dash-empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; border-radius: 16px; border: 1px dashed var(--ml-border); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dash-empty h3 { font-size: 17px; }
.dash-empty .btn { text-decoration: none; margin-top: 6px; }

/* Section heads */
.dash-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }

/* Compare */
.dash .compare-box { margin-bottom: 20px; }
.dash-seg { display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--ml-border); background: var(--ml-input-bg); margin-bottom: 14px; }
.dash-seg button { border: 0; background: none; color: var(--ml-text-muted); font: 600 13px inherit; font-family: inherit; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.dash-seg button.active { background: #fff; color: #0b0b0b; }
.dash .form-aux-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.dash .form-aux-actions .btn-primary { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }

.dash-result { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; margin-bottom: 18px; border-radius: 16px; border: 1px solid var(--ml-border); background: radial-gradient(100% 160% at 0% 0%, rgba(123, 92, 255, 0.2), transparent 60%), var(--ml-card-bg); animation: viewFadeIn 0.25s ease; }
.dash-result-head { display: flex; gap: 16px; align-items: center; min-width: 0; }
.dash-result-copy { min-width: 0; }
.dash-result-names { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-result-score { font-size: 15px; color: var(--ml-text-muted); }
.dash-result-score b { font-family: var(--dash-display); font-size: 26px; color: #fff; margin-right: 2px; }
.dash-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Matches */
.dash-match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dash-match { display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--ml-border); background: var(--ml-card-bg); overflow: hidden; transition: var(--ml-transition); }
.dash-match.skeleton { min-height: 220px; }
.dash-match:hover { border-color: var(--ml-border-hover); }
.dash-match-main { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 12px; }
.dash-match-main:focus-visible { outline: 2px solid var(--dash-green); outline-offset: -2px; }
.dash-match-top { display: flex; justify-content: space-between; align-items: center; }
.dash-match-score { --p: 0; width: 58px; height: 58px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--dash-display); font-weight: 800; font-size: 19px; background: radial-gradient(closest-side, var(--ml-card-bg) 79%, transparent 80% 100%), conic-gradient(var(--dash-green) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0); }
.dash-match-score small { font-size: 11px; margin-left: 1px; color: var(--ml-text-muted); }
.dash-match-score.wl { width: auto; height: auto; border-radius: 10px; background: rgba(0, 224, 84, 0.1); padding: 6px 10px; font-size: 18px; flex-direction: column; line-height: 1.1; }
.dash-match-score.wl small { font-family: "Inter", sans-serif; font-weight: 600; }
.dash-match-names { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-match-names span { color: var(--ml-text-dim); font-weight: 500; }
.dash-match-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ml-text-muted); }
.dash-match-posters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dash-match-posters img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #0d1017; }
.dash-match-actions { display: flex; gap: 6px; padding: 10px 16px 14px; align-items: center; border-top: 1px solid var(--ml-border-subtle); }
.btn-icon { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ml-text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { color: var(--ml-danger); border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }

/* Import */
.dash .importer-card h2 { margin-bottom: 6px; }
.dash-import-ids { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-import-ids label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ml-text-muted); }
.dash-import-ids.signed-in::before { content: "Importing into your account. Handles below just label the source."; grid-column: 1 / -1; font-size: 12.5px; color: var(--ml-text-dim); }
.dash .drop-zone h3 { font-size: 15px; margin: 8px 0 2px; }
.dash .drop-zone:focus-visible { outline: 2px solid var(--dash-green); outline-offset: 2px; }
.dash-import-status { margin-top: 14px; font-size: 13.5px; font-weight: 600; }
.dash-help { margin-top: 18px; font-size: 13px; color: var(--ml-text-muted); }
.dash-help summary { cursor: pointer; font-weight: 600; color: var(--ml-text); }
.dash-help ul { margin: 10px 0 0 18px; display: flex; flex-direction: column; gap: 6px; }

/* Settings */
#view-settings.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#dash-settings {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-settings {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--ml-border);
  background: var(--ml-card-bg);
  box-sizing: border-box;
}
.dash-settings-head { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.dash-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ml-text-muted); flex: 1; }
.dash-field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-settings-actions { display: flex; gap: 8px; justify-content: space-between; }

/* Danger Zone */
.dash-danger-zone {
  border: 1px solid rgba(255, 59, 48, 0.4) !important;
  background: radial-gradient(120% 120% at 0% 0%, rgba(255, 59, 48, 0.12) 0%, rgba(255, 59, 48, 0.02) 65%, var(--ml-card-bg) 100%) !important;
  box-shadow: 0 4px 20px rgba(255, 59, 48, 0.08);
}
.danger-zone-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.danger-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 8px;
  background: rgba(255, 59, 48, 0.16);
  border: 1px solid rgba(255, 59, 48, 0.35);
  color: #ff3b30;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.text-danger {
  color: #ff3b30 !important;
  font-weight: 800 !important;
  margin: 0;
}
.danger-text {
  color: rgba(255, 255, 255, 0.72) !important;
  line-height: 1.5;
}
.dash-danger-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 4px;
}
.btn-danger-delete {
  background: #ff3b30 !important;
  color: #ffffff !important;
  border: 1px solid #ff3b30 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 10px 22px !important;
  border-radius: 9px !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35) !important;
}
.btn-danger-delete:hover {
  background: #e0281c !important;
  border-color: #e0281c !important;
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.55) !important;
  transform: translateY(-1px) !important;
}
.btn-danger-delete:active {
  transform: translateY(0) !important;
}

/* Roulette */
.dash-roulette { display: flex; gap: 16px; align-items: center; justify-content: center; text-align: left; max-width: 520px; margin: 0 auto; }
.dash-roulette img { width: 80px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--ml-border); }
.dash-roulette-title { font-size: 18px; font-weight: 800; margin: 2px 0; }
.dash .filter-chip-row { margin-bottom: 16px; }

/* Toast */
.dash-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 2000; padding: 11px 16px; border-radius: 12px; background: #f8fafc; color: #0b0b0b; font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); transition: all 0.2s ease; max-width: calc(100vw - 32px); }
.dash-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.dash-toast.error { background: #ef4444; color: #fff; }

/* Mobile tab bar */
.dash-tabbar { display: none; }

@media (max-width: 1100px) {
  .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dash-hero { grid-template-columns: 1fr; padding: 24px; }
  .dash-hero-art { display: none; }
  .dash-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(7, 9, 14, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--ml-border);
  }
  .dash-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--ml-text-dim); text-decoration: none; font-size: 10.5px; font-weight: 600; border-radius: 10px; }
  .dash-tabbar a svg { width: 21px; height: 21px; }
  .dash-tabbar a.active { color: #fff; }
  .dash-tabbar a.dash-tabbar-main svg { color: #0b0b0b; background: var(--dash-green); border-radius: 50%; padding: 6px; width: 34px; height: 34px; margin-top: -6px; }
  body.dash .app-main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .dash .movie-card .card-actions { opacity: 1; }
  .dash .movie-card .card-actions .card-action:not(.fav) { display: none !important; }
}

@media (max-width: 640px) {
  .hide-xs { display: none; }
  .dash-profile { flex-direction: column; align-items: flex-start; padding: 18px; }
  .dash-profile-actions { flex-direction: row; }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stats .dash-stat:last-child { grid-column: 1 / -1; }
  .dash-stat-value { font-size: 24px; }
  .dash-toolbar-right { min-width: 0; width: 100%; }
  .dash-search { max-width: none; }
  .dash-tabs { width: 100%; }
  .dash-tab { flex: 1; justify-content: center; padding: 8px 6px; }
  .dash-shelf-row { grid-auto-columns: 112px; }
  .dash-result-actions { width: 100%; }
  .dash-result-actions .btn { flex: 1; justify-content: center; }
  .dash-empty-cta { flex-direction: column; align-items: flex-start; }
  .dash .movies-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .dash .form-aux-actions .btn-primary { width: 100%; justify-content: center; margin-left: 0; }
}

/* Flex children must be allowed to shrink below their content on narrow screens */
.dash .app-main { min-width: 0; }
.dash-tab, .dash-select { min-width: 0; }
@media (max-width: 640px) {
  .dash-select { max-width: 44%; }
  .dash-tab { font-size: 12.5px; }
}

/* perf-optimizer.js gives cards content-visibility:auto with a 380px placeholder, which
   stretches horizontal shelves; shelves are short so render them normally */
.dash-shelf-row { align-items: start; }
.dash-shelf-row > .movie-card { content-visibility: visible; contain: none; }

/* Room for the wider "IMDb" prefix */
.compare-input-wrap.is-imdb input { padding-left: 54px; }
.compare-input-wrap.is-imdb .input-icon-prefix { color: #f5c518; font-size: 12px; font-weight: 800; }
.dash-result-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dash-partial { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; margin: -6px 0 18px; border-radius: 12px; border: 1px solid rgba(245, 197, 24, 0.35); background: rgba(245, 197, 24, 0.07); font-size: 13.5px; }
.dash-partial strong { color: #f5c518; }
.dash-partial .btn { text-decoration: none; flex-shrink: 0; }

/* ---------- Discovery: recommendations ---------- */
.dash-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-head-actions .dash-seg { margin-bottom: 0; }
.dash-seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.dash-chip-scroll { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: none; }
.dash-chip-scroll::-webkit-scrollbar { display: none; }
.dash-chip-scroll .filter-chip { flex-shrink: 0; }
.dash .rating-badge.imdb { color: #f5c518; }
.dash .movie-reason-tag { font-size: 11px; color: var(--ml-text-muted); margin-top: 6px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-shelf-head .dash-muted.small { margin-top: 2px; }

.dash-cta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.dash-cta { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--ml-border); color: var(--ml-text); text-decoration: none; transition: var(--ml-transition); }
.dash-cta:hover { border-color: var(--ml-border-hover); transform: translateY(-1px); }
.dash-cta.night { background: radial-gradient(120% 160% at 0% 0%, rgba(255, 90, 54, 0.22), transparent 60%), var(--ml-card-bg); }
.dash-cta.match { background: radial-gradient(120% 160% at 0% 0%, rgba(123, 92, 255, 0.24), transparent 60%), var(--ml-card-bg); }
.dash-cta-emoji { font-size: 28px; }
.dash-cta b { display: block; font-size: 15px; }
.dash-cta small { display: block; color: var(--ml-text-muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }

/* ---------- Movie night ---------- */
.night-hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; padding: 24px; border-radius: 18px; border: 1px solid var(--ml-border); background: radial-gradient(90% 140% at 0% 0%, rgba(255, 90, 54, 0.2), transparent 55%), radial-gradient(80% 120% at 100% 100%, rgba(0, 224, 84, 0.12), transparent 60%), var(--ml-card-bg); }
.night-hero-copy { display: flex; flex-direction: column; gap: 10px; }
.night-people-box { display: flex; flex-direction: column; gap: 10px; }
.night-people { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; align-items: center; }
.night-person { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 6px; border-radius: 999px; border: 1px solid var(--ml-border); background: rgba(255, 255, 255, 0.05); font-size: 13px; font-weight: 600; }
.night-person small { color: var(--ml-text-dim); font-weight: 500; }
.night-person.error { border-color: rgba(239, 68, 68, 0.5); }
.night-person-err { width: 16px; height: 16px; border-radius: 50%; background: var(--ml-danger); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.night-person button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--ml-text-muted); cursor: pointer; font-size: 15px; line-height: 1; }
.night-person button:hover { background: rgba(239, 68, 68, 0.25); color: #fff; }
.night-add { display: flex; gap: 8px; }
.night-add .dash-input { flex: 1; min-width: 0; }
.night-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.night-suggest .dash-chip { cursor: pointer; font-family: inherit; }

.night-filters { margin: 16px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.night-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.night-selects .dash-select { flex: 1; min-width: 140px; }

.night-spin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--ml-border); background: var(--ml-card-bg); }
.night-spin-bar b { margin-right: 8px; }
.night-spin-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
#ml-roulette-result { margin-top: 12px; }
#ml-roulette-result[hidden] { display: none; }
.night-spin { display: flex; gap: 22px; align-items: center; padding: 20px; border-radius: 18px; border: 1px solid var(--ml-border); background: radial-gradient(100% 160% at 0% 0%, rgba(0, 224, 84, 0.16), transparent 60%), var(--ml-card-bg); animation: viewFadeIn 0.25s ease; }
.night-reel { width: 150px; flex-shrink: 0; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: #0d1017; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.night-reel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.night-spin.landed .night-reel { animation: night-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); outline: 3px solid var(--dash-green); outline-offset: 3px; }
@keyframes night-pop { from { transform: scale(0.92); } to { transform: scale(1); } }
.night-spin-copy { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.night-title { font-family: var(--dash-display); font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.01em; }
.night-overview { color: var(--ml-text-muted); font-size: 13.5px; line-height: 1.55; max-width: 640px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.night-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.night-actions .btn { text-decoration: none; }
.dash-tag { align-self: flex-start; }

@media (max-width: 900px) {
  .night-hero { grid-template-columns: 1fr; padding: 18px; }
  .dash-cta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .night-spin { flex-direction: column; align-items: flex-start; }
  .night-reel { width: 120px; }
  .night-spin-buttons { width: 100%; }
  .night-spin-buttons .btn { flex: 1; justify-content: center; }
  .night-selects .dash-select { min-width: calc(50% - 4px); }
  .dash-head-actions { width: 100%; }
}

/* Per-person ratings on match result cards */
.cmp-ratings { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ml-border-subtle); }
.cmp-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11.5px; }
.cmp-user { color: var(--ml-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cmp-stars { color: var(--dash-green); letter-spacing: 0.5px; white-space: nowrap; flex-shrink: 0; }
.cmp-imdb { color: #f5c518; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.cmp-none { color: var(--ml-text-dim); white-space: nowrap; flex-shrink: 0; }
.cmp-num { display: none; font-weight: 700; }
@media (max-width: 640px) {
  .cmp-full { display: none; }
  .cmp-num { display: inline; }
}

/* LB / IMDb links as real tap targets (were 10px text links) */
.dash .movie-sub { flex-wrap: wrap; row-gap: 0; }
.dash .movie-links { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.dash .movie-links a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 0 8px; border-radius: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid currentColor; background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease;
}
.dash .movie-links a.lb { color: #00e054; border-color: rgba(0, 224, 84, 0.45); }
.dash .movie-links a.imdb { color: #f5c518; border-color: rgba(245, 197, 24, 0.45); }
.dash .movie-links a.lb:hover { background: rgba(0, 224, 84, 0.12); }
.dash .movie-links a.imdb:hover { background: rgba(245, 197, 24, 0.12); }
.dash .movie-links a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 640px) {
  .dash .movie-links a { min-height: 36px; font-size: 12.5px; }
}
.dash-section-head { flex-wrap: wrap; }
.dash-seg button { white-space: nowrap; }

/* Letterboxd button shows the three-dot mark instead of "LB" */
.dash .movie-links a.lb { border-color: rgba(255, 255, 255, 0.16); }
.dash .movie-links a.lb:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); }
.lb-icon { display: block; width: 26px; height: auto; }
@media (max-width: 640px) {
  .lb-icon { width: 24px; }
}

/* Auto-scroll anchor for match results */
#ml-compare-results {
  scroll-margin-top: 72px;
}
