:root {
  --bg: #0a0d13;
  --bg-elev: #121723;
  --bg-card: #151c29;
  --border: #232c3b;
  --border-strong: #324054;
  --text: #e8eef5;
  --text-dim: #93a2b4;
  --accent: #6ea8fe;
  --accent-2: #9b8cff;
  --good: #6cc070;
  --mid: #e0c453;
  --bad: #e07a5f;
  --nogo: #ff5d5d;
  --steam: #66c0f4;
  --playstation: #4f7df9;
  --xbox: #3ab54a;
  --epic: #c8ced8;
  --person-1: var(--accent);
  --person-2: var(--accent-2);
  --person-3: var(--good);
  --person-4: var(--mid);
  --person-5: var(--bad);
  --person-6: #f28cb1;
  --person-7: #4fd1c5;
  --person-8: #f6ad55;
  --person-9: #a0aec0;
  --person-10: #ff6b6b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 6px 24px rgba(110, 168, 254, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
body.modal-open { overflow: hidden; }
.sync-conflict { margin: 8px 0; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.sync-conflict p { white-space: pre-wrap; }
.sync-alert { padding: 10px 16px; background: var(--bg-elev); color: var(--text); border-bottom: 1px solid var(--border); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
::selection { background: rgba(110, 168, 254, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-dim); }
.small { font-size: 0.8rem; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.linklike.small { font-size: 0.78rem; }

/* ---- Header ---- */
.site-header {
  background:
    radial-gradient(1200px 220px at 18% -40%, rgba(110, 168, 254, 0.16), transparent 65%),
    radial-gradient(900px 200px at 85% -60%, rgba(155, 140, 255, 0.12), transparent 65%),
    linear-gradient(180deg, #10151f, var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-header h1 { margin: 0; font-size: 1.2rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.site-header h1 .grad {
  background: linear-gradient(92deg, var(--text) 30%, var(--accent) 75%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { display: none; margin: 4px 0 0; color: var(--text-dim); font-size: 0.92rem; }

/* ---- Controls (sticky) ---- */
.controls {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 13, 19, 0.92);
  backdrop-filter: blur(10px);
  padding-top: 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ---- Squad bar ---- */
.squad-bar {
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.08), rgba(155, 140, 255, 0.04));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.squad-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.squad-row-2 { justify-content: space-between; }
.squad-label { font-weight: 700; font-size: 0.9rem; margin-right: 4px; }
.squad-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.person-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 4px;
  font: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.person-chip:hover { border-color: var(--accent); }
.person-chip.is-active { color: var(--text); background: rgba(110, 168, 254, 0.18); border-color: var(--accent); }
.person-chip:active { transform: translateY(1px); }
.chip-people { border-style: dashed; }
.free-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px rgba(108, 192, 112, 0.25); margin-left: 2px; }
.squad-scope { display: flex; align-items: center; gap: 8px; }
.vt-short { display: none; }

/* Avatars */
.avatar {
  --pc: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 0.95rem; line-height: 1;
  background: var(--bg-card);
  border: 2px solid var(--pc);
  box-shadow: 0 0 0 2px var(--bg);
  flex: 0 0 auto;
}
.av-lg { width: 40px; height: 40px; font-size: 1.4rem; }
.av-good { border-color: var(--good); background: rgba(108, 192, 112, 0.22); }
.av-bad { border-color: var(--mid); background: rgba(224, 196, 83, 0.22); }
.av-nogo { border-color: var(--nogo); background: rgba(255, 93, 93, 0.28); }
.av-neutral { border-color: var(--border-strong); opacity: 0.8; }

/* ---- Toolbar ---- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.search-input {
  flex: 1; min-width: 200px;
  padding: 9px 14px; font-size: 0.96rem;
  color: var(--text); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.15); }
.search-input::placeholder { color: var(--text-dim); }
.select {
  padding: 9px 12px; font-size: 0.9rem; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; outline: none; transition: border-color 0.15s;
}
.select:focus { border-color: var(--accent); }
.select-sm { padding: 6px 9px; font-size: 0.84rem; max-width: 220px; border-radius: var(--radius-sm); }
.btn {
  padding: 9px 13px; font-size: 0.9rem; font-weight: 600; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-sm { padding: 6px 10px; font-size: 0.82rem; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #0b0f16; }
.btn-accent:hover { background: #86b8ff; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-elev); }
.vt-btn {
  padding: 9px 12px; font-size: 0.9rem; line-height: 1.2; color: var(--text-dim);
  background: transparent; border: none; cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.vt-btn:hover { color: var(--text); }
.vt-btn.is-active { background: var(--accent); color: #0b0f16; font-weight: 600; }

/* ---- Data menu ---- */
.data-wrap { position: relative; }
#data-btn { position: relative; }
.data-dot {
  position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.6; } }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 320px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px;
}
.menu-section { padding: 8px 10px; }
.menu-section + .menu-section { border-top: 1px solid var(--border); }
.menu-section h3 { margin: 0 0 7px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.menu-row { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-status { margin: 7px 0 0; font-size: 0.78rem; color: var(--text-dim); }
.menu-status:empty { display: none; }

/* ---- Filter bar ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.filter-row, .filter-bar-right, .chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.subfilter-label { color: var(--text-dim); font-size: 0.84rem; margin-right: 2px; }
.chip {
  padding: 7px 13px; font-size: 0.88rem; font-weight: 500; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); }
.chip:disabled { opacity: 0.55; cursor: default; }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #0b0f16; font-weight: 600; }
.chip.is-static { cursor: default; }
.chip-sm { padding: 5px 11px; font-size: 0.82rem; }
.chip-xs { padding: 2px 9px; font-size: 0.76rem; }
.chip-steam.is-active { background: var(--steam); border-color: var(--steam); }
.chip-playstation.is-active { background: var(--playstation); border-color: var(--playstation); color: #0b0f16; }
.chip-xbox.is-active { background: var(--xbox); border-color: var(--xbox); color: #0b0f16; }
.chip-epic.is-active { background: var(--epic); border-color: var(--epic); color: #0b0f16; }
.chip-count { font-size: 0.72rem; font-weight: 600; opacity: 0.7; margin-left: 3px; }
.chip-blocked { border-color: rgba(255, 93, 93, 0.5); color: #ff9c9c; }
.chip-blocked.is-active { background: rgba(255, 93, 93, 0.25); color: #ffb3b3; }
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-left: 4px;
  font-size: 0.7rem; font-weight: 700; border-radius: 999px; background: var(--accent); color: #0b0f16;
}
.filters-panel {
  margin-top: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  animation: panelIn 0.16s ease;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.subfilter { margin: 0; }
#tag-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* Tag chips, coloured by category */
.tag-chip { border-style: dashed; }
.tag-chip.is-active { border-style: solid; }
.tag-chip.is-excluded { background: rgba(224, 90, 90, 0.16); color: #e88; border-color: rgba(224, 90, 90, 0.4); text-decoration: line-through; border-style: solid; }
.tag-cat-style { color: #f4a8ff; }
.tag-cat-perspective { color: #a5d8ff; }
.tag-cat-genre { color: var(--accent-2); }
.tag-cat-subgenre { color: #9be7c4; }
.tag-cat-theme { color: #ffd59e; }
.tag-cat-tone { color: #ffb4a2; }
.tag-cat-content { color: #ff8a8a; }
.tag-cat-coop { color: #7fe3ff; }
.tag-cat-derived { color: var(--text-dim); }
.tag-chip.is-active[class*="tag-cat-"] { color: #0b0f16; }
.tag-more { color: var(--text-dim); border-style: dotted; }

/* ---- Degraded-source hint ---- */
.health {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 14px 0 0; padding: 8px 12px; font-size: 0.85rem;
  color: #f0c98a; background: rgba(230, 126, 34, 0.12); border: 1px solid rgba(230, 126, 34, 0.35); border-radius: 10px;
}
.health .linklike { color: #f0c98a; flex: 0 0 auto; }

/* ---- Results ---- */
.result-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 12px; }
.result-count { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding-bottom: 24px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-glow); }
.card.is-blocked { opacity: 0.6; }
.card.is-blocked:hover { opacity: 1; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cover { position: relative; aspect-ratio: 460 / 215; background: linear-gradient(135deg, #1d2632, #28323f); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.88);
  text-align: center; padding: 8px;
  background-image: repeating-linear-gradient(-35deg, rgba(255, 255, 255, 0.04) 0 14px, transparent 14px 28px);
}
.cover-fallback.ps { background-color: #1d3f97; }
.cover-fallback.xbox { background-color: #14641d; }
.cover-fallback.epic { background-color: #3a4150; }
.card-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.card:hover .card-actions, .card-actions:focus-within, .card-actions:has(.is-on) { opacity: 1; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem; line-height: 1; color: #fff;
  background: rgba(10, 14, 22, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius-sm);
  cursor: pointer; backdrop-filter: blur(3px);
}
.icon-btn:hover { background: rgba(10, 14, 22, 0.92); border-color: var(--accent); }
.fav-btn.is-on { color: #ffd45e; border-color: rgba(255, 212, 94, 0.5); }
.list-btn.is-on { color: var(--accent); border-color: rgba(110, 168, 254, 0.5); }
.card-body { position: relative; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title { font-size: 0.97rem; font-weight: 600; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-why { margin: 0; font-size: 0.75rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-why.blocked { color: #ff9c9c; }

/* Fit strip (overlay on covers, inline in rows) */
.fit-strip { display: inline-flex; align-items: center; gap: 4px; }
/* The strip leads .card-body and is lifted 6px above its top edge, onto the cover's foot. */
.card-body > .fit-strip {
  position: absolute; left: 6px; bottom: calc(100% + 6px);
  padding: 3px 6px 3px 3px; border-radius: 999px;
  background: rgba(10, 14, 22, 0.78); backdrop-filter: blur(3px);
}
.card-body > .fit-strip .avatar { width: 22px; height: 22px; font-size: 0.8rem; box-shadow: none; margin-left: -6px; }
.card-body > .fit-strip .avatar:first-of-type { margin-left: 2px; }
.fit-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 26px; padding: 0 7px; border-radius: 999px; white-space: nowrap; flex: none;
  font-size: 0.85rem; font-weight: 800; color: #0b0f16; font-variant-numeric: tabular-nums;
}
.fit-hi { background: var(--good); }
.fit-mid { background: var(--mid); }
.fit-lo { background: var(--bad); }
.fit-blocked { background: var(--nogo); color: #0b0f16; }
.fit-big { min-width: 48px; height: 44px; font-size: 1.3rem; }
.fit-modes { font-size: 0.85rem; margin-left: 4px; }
.ready-flag { font-size: 0.85rem; margin-left: 2px; cursor: help; }
.ready-line { margin-top: 3px; }
.ready-line.is-ready { color: var(--good); }
.ready-line.is-check { color: #f0a35e; }
.card-why.check { color: #f0a35e; }
.plan-scope { margin: 6px 0 2px; }
.plan-tight { margin: 8px 0 0; }
.fit-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 8px; }

/* ---- Badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.badge { font-size: 0.72rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.badge-steam { background: rgba(102, 192, 244, 0.16); color: var(--steam); }
.badge-playstation { background: rgba(79, 125, 249, 0.18); color: #8cabff; }
.badge-xbox { background: rgba(58, 181, 74, 0.16); color: #6fdc7c; }
.badge-epic { background: rgba(200, 206, 216, 0.16); color: #dfe4ec; }
.badge-meta { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.badge-mode { background: rgba(127, 227, 255, 0.12); color: #7fe3ff; }
.badge-seats { background: rgba(155, 140, 255, 0.14); color: #c4b8ff; white-space: normal; }
.badge-play { background: rgba(110, 168, 254, 0.14); color: var(--accent); }
.badge-mc, .badge-userscore, .badge-oc { color: #0b0f16; }
.badge-mc.mc-hi, .badge-userscore.mc-hi, .badge-oc.mc-hi { background: var(--good); }
.badge-mc.mc-mid, .badge-userscore.mc-mid, .badge-oc.mc-mid { background: var(--mid); }
.badge-mc.mc-lo, .badge-userscore.mc-lo, .badge-oc.mc-lo { background: var(--bad); }
.badge-userscore { box-shadow: inset 0 0 0 1px rgba(11, 15, 22, 0.35); }
.badge-oc { box-shadow: inset 0 0 0 1px rgba(255, 126, 38, 0.85); }
.badge-review { background: rgba(102, 192, 244, 0.16); color: var(--steam); }
.badge-year { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }
.badge-ach { background: rgba(155, 140, 255, 0.16); color: var(--accent-2); }
.badge-leaving { background: rgba(230, 126, 34, 0.2); color: #f0a35e; }
.badge-new { background: rgba(108, 192, 112, 0.16); color: var(--good); }
.badge-gfn { background: rgba(118, 185, 0, 0.16); color: #a9e34b; }
.badge-status { border: none; cursor: pointer; font: inherit; font-size: 0.72rem; font-weight: 600; }
.badge-status.status-backlog { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.badge-status.status-playing { background: rgba(110, 168, 254, 0.2); color: var(--accent); }
.badge-status.status-completed { background: rgba(108, 192, 112, 0.2); color: var(--good); }
.badge-status.status-shelved { background: rgba(224, 196, 83, 0.16); color: var(--mid); }
.badge-status:not(.is-manual) { opacity: 0.75; }
.badge-status:hover { opacity: 1; box-shadow: inset 0 0 0 1px var(--border-strong); }
/* Small controls reach the 24px minimum target without changing their look. */
.badge-status, #health-dismiss, button.chip-xs, .linklike.small { position: relative; }
.badge-status::after, #health-dismiss::after { content: ""; position: absolute; inset: -3px -2px; }
.linklike.small::after { content: ""; position: absolute; inset: -2px 0; }
/* Measured from inside the 1px border, so -3px reaches 2px past the chip's edge. */
button.chip-xs::after { content: ""; position: absolute; inset: -3px 0; }

/* ---- List view ---- */
.list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 24px; }
.row {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px;
  padding: 7px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  animation: fadeUp 0.18s ease both; transition: border-color 0.13s, box-shadow 0.13s;
}
.row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-glow); }
.row.is-blocked { opacity: 0.6; }
.row-cover { position: relative; width: 86px; height: 40px; border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, #1d2632, #28323f); }
.row-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-cover .cover-fallback { font-size: 0.85rem; padding: 2px; }
.row-main { min-width: 0; }
.row-title { display: block; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title:hover { color: var(--accent); }
.row-sub { color: var(--text-dim); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .badges { margin: 0; justify-content: flex-end; }
.row .card-actions { position: static; opacity: 1; }

/* ---- Popovers ---- */
.list-menu, .tag-menu {
  position: fixed; z-index: 50; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 8px;
}
.list-menu { min-width: 200px; max-width: 260px; }
.list-menu-title { font-size: 0.78rem; color: var(--text-dim); padding: 2px 6px 6px; }
.list-menu-items { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; }
.list-menu-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 0.88rem; }
.list-menu-row:hover { background: rgba(255, 255, 255, 0.05); }
.list-menu-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-menu-del { background: none; border: none; cursor: pointer; font-size: 0.85rem; opacity: 0.6; padding: 2px; }
.list-menu-del:hover { opacity: 1; }
.list-menu-empty, .tag-menu-empty { font-size: 0.82rem; color: var(--text-dim); padding: 4px 6px; font-style: italic; }
.list-menu-new {
  width: 100%; margin-top: 6px; padding: 7px; font-size: 0.85rem; font-weight: 600; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.list-menu-new:hover { border-color: var(--accent); }
.tag-menu { width: min(440px, calc(100vw - 16px)); }
.tag-menu-search {
  width: 100%; padding: 7px 10px; margin-bottom: 8px; font-size: 0.88rem; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
}
.tag-menu-search:focus { border-color: var(--accent); }
.tag-menu-items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; max-height: min(40vh, 320px); overflow-y: auto; }

/* ---- Modals ---- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(6, 9, 14, 0.72); backdrop-filter: blur(4px);
}
.modal-card {
  width: min(380px, 94vw); max-height: 90vh; overflow-y: auto; position: relative;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px; animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-title { margin: 0 0 10px; font-size: 1rem; font-weight: 700; padding-right: 30px; }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 30px; height: 30px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pick-slot .card { animation: none; }
.pick-slot .card:hover { transform: none; }
.pick-opts { display: flex; gap: 14px; margin-bottom: 10px; }
.pick-opt { font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 5px; align-items: center; cursor: pointer; }
.pick-empty { color: var(--text-dim); font-size: 0.85rem; margin: 12px 0; }

/* Detail */
.detail-card { width: min(760px, 94vw); }
.detail-head { display: flex; gap: 16px; }
.detail-cover { flex: 0 0 200px; align-self: flex-start; border-radius: 10px; overflow: hidden; background: var(--bg-card); position: relative; }
.detail-cover img { width: 100%; display: block; }
.detail-cover .cover-fallback { position: static; height: 94px; }
.detail-info { flex: 1; min-width: 0; }
.detail-title { margin: 0 0 8px; font-size: 1.15rem; padding-right: 28px; }
.detail-row { display: flex; gap: 10px; margin-top: 8px; font-size: 0.85rem; align-items: baseline; }
.detail-label { flex: 0 0 84px; color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-value { flex: 1; min-width: 0; }
.detail-scores, .detail-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.detail-bar { display: inline-block; width: 120px; height: 6px; margin-left: 8px; border-radius: 3px; background: var(--bg-card); overflow: hidden; vertical-align: middle; }
.detail-bar-fill { display: block; height: 100%; background: var(--good); }
.detail-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.detail-actions .card-actions { position: static; opacity: 1; }
.detail-note, .sync-input {
  flex: 1; min-width: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 6px 8px; font: inherit; font-size: 0.82rem;
}
.detail-note { resize: vertical; }
.detail-note:focus, .sync-input:focus { outline: none; border-color: var(--accent); }
.tag-input { background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; color: var(--text); padding: 3px 10px; font-size: 0.75rem; width: 190px; }
.tag-input:focus { outline: none; border-color: var(--accent); }
.detail-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.detail-h { margin: 0 0 6px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.person-rows { display: flex; flex-direction: column; gap: 8px; }
.person-row { display: flex; gap: 10px; align-items: flex-start; }
.person-row-main { flex: 1; min-width: 0; }
.person-row-head { font-size: 0.88rem; }
.person-row-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; align-items: center; }
.pref-love { color: #ff8fa3; border-color: rgba(255, 143, 163, 0.5); }
.pref-like { color: #9be7c4; border-color: rgba(155, 231, 196, 0.5); }
.pref-dislike { color: var(--mid); border-color: rgba(224, 196, 83, 0.5); }
.pref-nogo { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.6); }
.chip.pref-love.is-active { background: rgba(255, 143, 163, 0.22); color: #ffb3c1; }
.chip.pref-like.is-active { background: rgba(155, 231, 196, 0.2); color: #b8f0d7; }
.chip.pref-dislike.is-active { background: rgba(224, 196, 83, 0.2); color: #f0d97a; }
.chip-pair { display: inline-flex; }
.chip-pair .chip:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip-pair .chip-x { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; padding: 2px 6px; }
.chip.pref-nogo.is-active { background: rgba(255, 138, 138, 0.22); color: #ffb3b3; }

/* Sessions */
.plays { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.play { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; padding: 6px 8px; background: var(--bg-card); border-radius: var(--radius-sm); }
.play-people { display: inline-flex; gap: 6px; }
.play-person { display: inline-flex; align-items: center; gap: 2px; font-size: 0.8rem; }
.play-note { flex: 1; color: var(--text-dim); }
.play-form { display: flex; flex-direction: column; gap: 6px; }
.play-who { display: flex; flex-wrap: wrap; gap: 6px; }
.play-pick { display: inline-flex; align-items: center; gap: 2px; }
.play-pick .chip { display: inline-flex; align-items: center; gap: 4px; }
.play-pick .avatar { width: 20px; height: 20px; font-size: 0.75rem; box-shadow: none; }
.verdict { background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; cursor: pointer; font-size: 0.8rem; opacity: 0.55; }
.verdict.is-active { opacity: 1; border-color: var(--accent); background: rgba(110, 168, 254, 0.2); }
.play-form-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.play-date { flex: 0 0 auto; }

/* People manager */
.people-card { width: min(820px, 94vw); }
.person-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.person-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.person-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.person-card-title { flex: 1 1 160px; min-width: 0; }
.person-card-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.person-card-prefs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.person-notes { margin-top: 6px; font-style: italic; }
.empty-small { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 20px 0 6px; }
.person-editor { display: flex; flex-direction: column; gap: 14px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.editor-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.editor-check { flex-direction: row; align-items: center; align-self: end; gap: 6px; min-height: 24px; }
.editor-wide { grid-column: 1 / -1; }
.editor-label { color: var(--text-dim); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-btn { width: 30px; height: 30px; font-size: 1.05rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.emoji-btn.is-active { border-color: var(--accent); background: rgba(110, 168, 254, 0.2); }
.color-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-btn.is-active { border-color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.floor-input { max-width: 110px; }
.editor-actions.is-sticky { position: sticky; bottom: -16px; background: var(--bg-elev); padding: 10px 0; margin-top: 4px; border-top: 1px solid var(--border); z-index: 1; }
body.guest .editor-actions.is-sticky { bottom: 0; background: var(--bg); }
.editor-actions .linklike { margin-right: auto; }
.editor-more { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.editor-more summary { cursor: pointer; color: var(--text-dim); font-size: 0.88rem; }
.editor-more[open] summary { margin-bottom: 8px; }
.editor-quick .picker.is-open .picker-sugg { max-height: 220px; }
.picker { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.picker-head { font-size: 0.88rem; }
.picker-selected { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.picker-search { max-width: 320px; }
.picker-sugg { display: flex; flex-direction: column; gap: 4px; max-height: 0; overflow: hidden; transition: max-height 0.2s; }
.picker.is-open .picker-sugg { max-height: 320px; overflow-y: auto; }
.picker-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.picker-cat { font-size: 0.72rem; color: var(--text-dim); margin-right: 4px; flex: 0 0 100%; }
.picker-sugg .chip { padding: 1px 8px; font-size: 0.74rem; }

/* Guest (friend) preference page */
.guest-panel { padding-top: 20px; padding-bottom: 40px; }
.guest-title { margin: 0 0 6px; font-size: 1.3rem; }
.guest-status { min-height: 1.2em; }
body.guest .site-header { padding-bottom: 22px; }

/* Tonight planner */
.plan-card { width: min(640px, 94vw); }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.plan-picks { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.plan-pick { display: flex; gap: 12px; align-items: center; padding: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.plan-pick:hover { border-color: var(--accent); }
.plan-cover { position: relative; flex: 0 0 120px; height: 56px; border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, #1d2632, #28323f); }
.plan-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plan-cover .cover-fallback { font-size: 1rem; }
.plan-pick-main { min-width: 0; flex: 1; }
.plan-pick-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Stats */
.stats-card { width: min(600px, 94vw); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.stat-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stat-num { font-size: 1.25rem; font-weight: 700; }
.stat-label { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }
.stats-section { margin: 16px 0 6px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.stat-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.82rem; }
.stat-bar-label { flex: 0 0 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar { flex: 1; width: auto; margin-left: 0; }
.stat-bar-value { flex: 0 0 auto; min-width: 48px; text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 0.76rem; }

/* Empty / footer */
.empty { text-align: center; color: var(--text-dim); padding: 48px 20px; font-size: 1.02rem; }
#sentinel { height: 1px; }
.site-footer { border-top: 1px solid var(--border); margin-top: 24px; padding: 20px 0 40px; }
.site-footer p { margin: 0; color: var(--text-dim); font-size: 0.82rem; }
#footer-meta.stale { color: var(--mid); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-sm); border: 2px solid var(--bg); }

/* ---- Compact browsing controls ---- */
.finder-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 12px; padding-bottom: 8px; }
.squad-setup { flex: 1; min-width: 220px; scroll-margin-top: 70px; }
.squad-setup[open] { flex-basis: 100%; }
.squad-setup summary { display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); }
.squad-setup summary::before { content: "▸"; color: var(--accent); }
.squad-setup[open] summary::before { content: "▾"; }
#squad-summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.squad-setup .squad-bar { margin: 6px 0 0; }
.controls .toolbar { margin-bottom: 0; flex-wrap: nowrap; }
.controls .search-wrap { min-width: 0; }
.controls .search-input { min-width: 0; }
.browse-filters { padding-top: 8px; scroll-margin-top: 70px; }
.tools-toggle { display: inline-block; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .tools-toggle { display: inline-block; }
  .squad-row-2 { flex-wrap: nowrap; }
  #squad-modes, #platform-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  #squad-modes::-webkit-scrollbar, #platform-filters::-webkit-scrollbar { display: none; }
  #squad-modes .chip, #platform-filters .chip { flex: 0 0 auto; }
  .vt-long { display: none; }
  .vt-short { display: inline; }
  .squad-row-2 { gap: 6px; }
  #squad-modes { flex: 1 1 auto; min-width: 0; }
  .squad-scope { flex: 0 0 auto; }
  .filter-bar { flex-wrap: nowrap; }
  .filter-bar-right { flex-wrap: nowrap; flex: 0 0 auto; }
  .scope-tab { padding: 7px 10px; font-size: 0.86rem; }
  .squad-bar { padding: 8px 10px; gap: 6px; }
  .squad-row-plan .muted { display: none; }
  .result-row { flex-wrap: wrap; }
  .result-left { flex: 1; }
  .result-tools { justify-content: flex-end; }
  .legend { font-size: 0.8rem; }
  .legend button { flex-shrink: 0; white-space: nowrap; }
  .wrap { padding: 0 16px; }
  /* The results grid is one column of cards: the cover becomes a thumbnail beside the body,
     ★ and ＋ sit under it instead of over the art, and the fit strip leads the body. */
  .grid { grid-template-columns: 1fr; gap: 10px; }
  #grid .card { flex-direction: row; min-height: 108px; }
  #grid .cover { flex: 0 0 128px; align-self: flex-start; overflow: visible; }
  #grid .cover-fallback { font-size: 1.1rem; }
  #grid .card-actions { top: calc(100% + 6px); right: auto; left: 6px; }
  #grid .card-body { padding: 8px 10px 10px; gap: 5px; min-width: 0; }
  #grid .card-body > .fit-strip { position: static; align-self: flex-start; flex-wrap: wrap; padding: 0; background: none; backdrop-filter: none; }
  .site-header h1 { font-size: 1.4rem; }
  .header-row { gap: 8px; }
  .site-header .subtitle { display: none; }
  .site-header h1 { font-size: 1.1rem; }
  .header-actions .btn { font-size: 0.8rem; padding: 8px; }
  .controls.wrap { padding-top: 8px; padding-bottom: 8px; }
  .controls .toolbar { gap: 5px; }
  .controls .btn { padding: 9px 7px; font-size: 0.8rem; }
  .controls .search-input { padding: 9px; font-size: 0.86rem; }
  .controls .search-kbd, .controls .plan-label { display: none; }
  .finder-setup.wrap { padding-top: 8px; padding-bottom: 0; }
  .finder-setup .squad-setup { flex-basis: 100%; min-width: 0; }
  .browse-filters.wrap { padding-top: 8px; }
  .plan-cover { flex-basis: 72px; height: 34px; }
  #platform-filters { max-width: 100%; }

  .search-input { flex-basis: 100%; }
  .chip-count { display: none; }
  .card-actions { opacity: 1; }
  .row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .row-cover { width: 64px; height: 30px; }
  .row .badges, .row .card-actions { display: none; }
  .detail-head { flex-direction: column; }
  .detail-cover { flex-basis: auto; }
  .editor-grid { grid-template-columns: 1fr; }
  .person-chip-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .menu { width: min(320px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- Header actions, scope tabs, squad rows ---- */
.header-actions { display: flex; align-items: center; gap: 8px; }
.scope-tabs { display: inline-flex; gap: 0; margin-bottom: 10px; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--bg-elev); }
.scope-tab { background: none; border: none; color: var(--text-dim); font: inherit; font-size: 0.92rem; font-weight: 600; padding: 8px 14px; cursor: pointer; }
.scope-tab + .scope-tab { border-left: 1px solid var(--border); }
.scope-tab:hover { color: var(--text); }
.scope-tab.is-active { background: var(--accent); color: #0b0f16; }
.squad-row-plan { gap: 10px; }
.squad-label { min-width: 38px; }

/* Search with the shortcut as a key cap, not placeholder text */
.search-wrap { position: relative; display: flex; flex: 1; min-width: 200px; }
.search-wrap .search-input { width: 100%; padding-right: 40px; }
.search-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 0.72rem/1 inherit; color: var(--text-dim); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.search-input:focus + .search-kbd { display: none; }

/* ---- Result row: count on the left, display tools on the right ---- */
.result-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 14px; margin: 8px 0 12px; }
.result-row .scope-tabs { margin-bottom: 0; }
.result-count { flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin: 0; }
.result-count.needs-squad { white-space: normal; overflow: visible; }
.result-row #sort-note { flex-basis: 100%; font-size: 0.76rem; }
.result-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.result-tools { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.result-tools .toolbar-secondary { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: min(460px, calc(100vw - 32px)); flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 12px 32px #0008; }
.result-tools.show-secondary .toolbar-secondary { display: flex; }
.result-tools .collections-menu { left: auto; right: 0; }
.data-warning { display: inline-flex; align-items: center; justify-content: center; margin-left: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--mid); color: #111; font-size: 0.75rem; }
body.guest .subtitle { display: block; }
@media (max-width: 720px) {
  .result-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .result-left { grid-row: 2; grid-column: 1 / -1; }
  .result-tools { grid-row: 1; grid-column: 2; }
  .result-tools .collections-wrap { position: static; }
}
.select-sm { padding: 6px 10px; font-size: 0.82rem; }
.collections-wrap { position: relative; }
.collections-menu { right: auto; left: 0; width: min(320px, calc(100vw - 32px)); padding: 6px; }
.cm-lists, .cm-views { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 8px; }
.cm-views { border-top: 1px solid var(--border); padding-top: 8px; }
.cm-row { display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.cm-row:hover { background: rgba(255, 255, 255, 0.05); }
.cm-row.is-active .cm-pick { color: var(--accent); font-weight: 600; }
.cm-pick { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: none; border: none; color: var(--text); font: inherit; font-size: 0.88rem; text-align: left; padding: 6px 8px; cursor: pointer; border-radius: 6px; }
.ask-inline, .confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 6px; }
.ask-inline .ask-input { flex: 1; min-width: 140px; padding: 6px 9px; font-size: 0.85rem; }
.confirm-q { font-size: 0.8rem; color: var(--text-dim); }

/* ---- Fit legend ---- */
.legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 8px 12px; font-size: 0.84rem; color: var(--text-dim); background: var(--bg-elev); border: 1px dashed var(--border-strong); border-radius: 10px; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pc, var(--border-strong)); vertical-align: -2px; margin: 0 2px 0 4px; }
.legend-dot.av-good { border-color: var(--good); background: rgba(108, 192, 112, 0.35); }
.legend-dot.av-bad { border-color: var(--mid); background: rgba(224, 196, 83, 0.35); }
.legend-dot.av-nogo { border-color: var(--nogo); background: rgba(255, 93, 93, 0.4); }
.sort-note-x { color: var(--text-dim); }

/* ---- Detail: fit bar and signed reasons ---- */
.fit-head-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.fit-bar { width: min(260px, 100%); height: 6px; }
.fit-reasons { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.84rem; }
.fit-reasons li { display: inline-flex; align-items: center; gap: 5px; }
.fit-reasons .fit-sign { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; background: var(--bg-elev); border: 1px solid var(--border); }
.fit-reasons .is-pro .fit-sign { color: var(--good); border-color: var(--good); }
.fit-reasons .is-con .fit-sign { color: #ff9c9c; border-color: rgba(255, 93, 93, 0.5); }
.fit-reasons .is-neutral { color: var(--text-dim); }
.verdict { font-size: 0.74rem; padding: 2px 8px; }

/* ---- People: friends & devices ---- */
.sync-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; background: var(--bg-elev); display: flex; flex-direction: column; gap: 6px; }
.sync-box.is-connected { border-color: rgba(108, 192, 112, 0.45); }
.sync-head { display: flex; align-items: center; gap: 10px; }
.sync-box .muted { margin: 0; }
.sync-box .chip-row .sync-input { flex: 1; min-width: 160px; }
.invite-note:empty { display: none; }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- Planner without a squad ---- */
.plan-empty { display: flex; flex-direction: column; gap: 8px; padding: 12px; margin-top: 8px; border: 1px dashed var(--border-strong); border-radius: 10px; }

.edition-select { width:100%; max-width:100%; min-width:0; margin-top:8px; font:inherit; font-size:.78rem; padding:6px; color:var(--text); background:#202938; border:1px solid #465064; border-radius:6px; }

.vote-link { display:block; overflow-wrap:anywhere; margin-bottom:12px; }
.vote-link input { display:block; width:100%; min-width:0; }
.vote-game { min-width:0; margin:16px 0; border:1px solid #465064; border-radius: var(--radius-sm); padding:12px; }
.vote-game legend { max-width:100%; overflow-wrap:anywhere; font-weight:600; }
.vote-choice { display:inline-flex; align-items:center; min-height:44px; gap:4px; margin-right:12px; cursor:pointer; }
.vote-counts { font-weight:600; }
.group-vote .sync-input { max-width:100%; }

@media (max-width: 600px), (hover: none) { .card-actions { opacity: 1; } }
.group-vote > button { margin: 0 8px 8px 0; }
.group-vote + .btn { margin-top:12px; }
