/* Minhas Coleções — design system compartilhado */
:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-solid: #161a23;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --text-2: #a7adbd;
  --text-3: #8890a3;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-ink: #fff;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --star: #fbbf24;
  --accent-text: color-mix(in srgb, var(--accent) 72%, var(--text));
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 64px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f9;
  --bg-2: #ffffff;
  --surface: rgba(15, 23, 42, 0.035);
  --surface-2: rgba(15, 23, 42, 0.06);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-2: #475069;
  --text-3: #5f6880;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 80px -20px rgba(15, 23, 42, 0.35);
  --star: #d97706;
  --good: #047857;
  --warn: #92400e;
  --bad: #b91c1c;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%);
}
:root[data-theme="light"] body::before { opacity: 0.55; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(12px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 20px -6px var(--accent);
}
.brand-mark .icon { width: 18px; height: 18px; }
.brand small { display: block; font-weight: 500; color: var(--text-3); font-size: 12px; line-height: 1.1; }
.brand span { line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.search {
  position: relative; flex: 1 1 420px; max-width: 560px; margin: 0 auto;
}
.search input {
  width: 100%; height: 42px; padding: 0 70px 0 42px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--surface-solid); }
.search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
  text-decoration: none; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: color-mix(in srgb, var(--text) 10%, transparent); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
  border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 8px 24px -10px var(--accent);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon-only { width: 40px; padding: 0; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.sm.icon-only { width: 32px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px clamp(12px, 3vw, 28px) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.03em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%);
}

/* charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; margin-bottom: 20px; }
.chart { padding: 16px 18px 12px; min-width: 0; }
.chart h3 { margin: 0 0 10px; font-size: 14px; font-weight: 650; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { fill: var(--text-3); font-size: 11px; }
.chart .val { fill: var(--text-2); font-size: 10.5px; font-weight: 600; }
.chart .bar { fill: var(--accent); transition: opacity .15s; }
.chart .bar:hover { opacity: .8; }
.chart .grid-line { stroke: var(--border); }
.chart .line { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.chart .area { fill: url(#areaGrad); }
.chart .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .target { stroke: var(--good); stroke-dasharray: 5 5; stroke-width: 1.5; }
.chart-toggle { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 2px; border-radius: 8px; }
.chart-toggle button { border: 0; background: transparent; font-size: 12px; padding: 2px 8px; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.chart-toggle button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 140px) 1fr 10ch; align-items: center; gap: 10px; font-size: 13px; }
.hbar .name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hbar .num { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; min-width: 3ch; text-align: right; }

/* toolbar */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px;
  position: sticky; top: var(--topbar-h); z-index: 20; padding: 10px 0;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.tabs button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-2);
}
.tabs button[aria-selected="true"] { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.select, .input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); min-width: 0;
}
.select { padding-right: 30px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238890a3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.select option { background: var(--surface-solid); color: var(--text); }
.select.active { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background-color: color-mix(in srgb, var(--accent) 12%, transparent); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; width: 100%; }
.count { color: var(--text-3); font-size: 13px; margin-left: auto; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface-2); height: 38px; width: 40px; display: grid; place-items: center; cursor: pointer; color: var(--text-3); }
.seg button[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.chip.accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); border-color: transparent; }
.chip.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: color-mix(in srgb, var(--good) 70%, var(--text)); border-color: transparent; }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--text)); border-color: transparent; }
.chip.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: color-mix(in srgb, var(--bad) 70%, var(--text)); border-color: transparent; }
.clear-filters { color: var(--accent-text); background: none; border: 0; cursor: pointer; font-weight: 600; font-size: 13px; }

/* ---------- cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border); padding: 0; display: flex; flex-direction: column;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .18s;
  content-visibility: auto; contain-intrinsic-size: 300px;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card .cover { position: relative; aspect-ratio: 2 / 3; background: var(--surface-2); overflow: hidden; }
.card .cover.landscape { aspect-ratio: 16 / 10; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .cover img { transform: scale(1.04); }
.card .cover .badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.card .cover .badges .chip { background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(6px); border-color: rgba(255,255,255,.12); }
.card .cover .score {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.65); color: #fff; backdrop-filter: blur(6px);
  border-radius: 8px; padding: 2px 7px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 3px;
}
.card .cover .score .icon { width: 12px; height: 12px; fill: var(--star); stroke: var(--star); }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .title { font-weight: 650; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--text-3); font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card .meta .dot::before { content: "•"; margin-right: 6px; }
.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; padding: 14px; text-align: center;
  font-weight: 750; font-size: 18px; letter-spacing: -0.02em; color: rgba(255,255,255,.92);
  text-shadow: 0 2px 10px rgba(0,0,0,.3); line-height: 1.2; word-break: break-word;
}
.placeholder.small { font-size: 14px; padding: 6px; }

/* row card (listas sem imagem) */
.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, background .15s;
}
.row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.row .thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .thumb.tall { width: 40px; height: 56px; border-radius: 6px; }
.row .main { min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--text-3); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row .big { font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; width: 100%; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }

/* stars */
.stars { position: relative; display: inline-block; font-size: 14px; line-height: 1; letter-spacing: 1px; color: var(--surface-2); white-space: nowrap; }
.stars::before { content: "★★★★★"; color: color-mix(in srgb, var(--text) 18%, transparent); }
.stars > span { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--star); }
.stars > span::before { content: "★★★★★"; }
.star-input { display: inline-flex; align-items: center; gap: 2px; }
.star-input button { border: 0; background: none; padding: 2px; cursor: pointer; font-size: 26px; line-height: 1; color: color-mix(in srgb, var(--text) 20%, transparent); position: relative; width: 30px; }
.star-input button.full { color: var(--star); }
.star-input button.half { background: linear-gradient(90deg, var(--star) 50%, color-mix(in srgb, var(--text) 20%, transparent) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.star-input .val { margin-left: 8px; font-weight: 700; min-width: 3ch; color: var(--text-2); }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty .icon { width: 44px; height: 44px; color: var(--text-3); margin: 0 auto 12px; stroke-width: 1.5; }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modal ---------- */
dialog.modal {
  padding: 0; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--surface-solid); color: var(--text);
  width: min(880px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.8,.2,1); }
dialog.modal.narrow { width: min(520px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(5, 7, 12, 0.62); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 20px; overflow: auto; flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

.detail { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.detail.noimg { grid-template-columns: 1fr; }
.detail .poster { border-radius: 14px; overflow: hidden; aspect-ratio: 2/3; background: var(--surface-2); box-shadow: var(--shadow); }
.detail .poster.landscape { aspect-ratio: 4/3; }
.detail .poster img { width: 100%; height: 100%; object-fit: cover; }
.detail h3 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; line-height: 1.2; }
.detail .facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.detail .fact { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.detail .fact .k { font-size: 12px; color: var(--text-3); }
.detail .fact .v { font-weight: 600; margin-top: 2px; word-break: break-word; }
.detail .notes { white-space: pre-wrap; color: var(--text-2); background: var(--surface); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border); }

/* form */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .input, .field .select { width: 100%; height: 42px; }
.field .err { color: var(--bad); font-size: 12.5px; min-height: 0; }
.field.invalid .input, .field.invalid .select { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: 10px; height: 42px; cursor: pointer; font-weight: 500; }
.switch { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch:checked { background: var(--accent); border-color: transparent; }
.switch:checked::after { transform: translateX(18px); background: #fff; }

/* lookup */
.lookup { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.lookup-head { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; margin-bottom: 10px; }
.lookup-head .icon { color: var(--accent); }
.lookup-head small { font-weight: 500; color: var(--text-3); }
.lookup-bar { display: flex; gap: 8px; }
.lookup-bar .input { flex: 1; height: 42px; }
.lookup-results { list-style: none; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; padding: 2px; }
.lookup-results.wide { grid-template-columns: 1fr; }
.lr {
  border: 1px solid var(--border); background: var(--surface-solid); border-radius: 12px; overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  display: flex; flex-direction: column; transition: border-color .15s, transform .12s;
}
.lr:hover, .lr:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.lr .img { aspect-ratio: 2/3; background: var(--surface-2); overflow: hidden; }
.lr .img img { width: 100%; height: 100%; object-fit: cover; }
.lr .t { font-size: 12.5px; font-weight: 650; padding: 6px 8px 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lr .s { font-size: 11.5px; color: var(--text-3); padding: 2px 8px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lookup-results.wide .lr { flex-direction: row; align-items: center; }
.lookup-results.wide .lr .img { width: 72px; aspect-ratio: 1; flex: none; }
.lookup-results.wide .lr .txt { min-width: 0; padding: 4px 6px; }
.lookup-results.wide .lr .s { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lookup .status { color: var(--text-3); font-size: 13px; margin-top: 10px; display: flex; gap: 8px; align-items: center; }

/* toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  padding: 10px 16px; border-radius: 12px; font-weight: 550; font-size: 14px; display: flex; gap: 10px; align-items: center;
  animation: pop .2s; max-width: calc(100vw - 32px);
}
.toast.error { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.toast.error .icon { color: var(--bad); }
.toast.success .icon { color: var(--good); }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; }

/* FAB mobile */
.fab { display: none; }

/* ---------- responsivo ---------- */
@media (max-width: 760px) {
  :root { --topbar-h: 112px; }
  .topbar { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .topbar .search { order: 10; flex-basis: 100%; max-width: none; }
  .topbar .hide-sm { display: none; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .detail { grid-template-columns: 1fr; }
  .detail .poster { max-width: 200px; margin: 0 auto; }
  .detail .poster.landscape { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: 18px; z-index: 40;
    width: 56px; height: 56px; border-radius: 18px; border: 0; color: var(--accent-ink); cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 30px -8px var(--accent);
  }
  .fab .icon { width: 24px; height: 24px; }
  .toolbar { position: static; }
  .kpi .value { font-size: 22px; }
  .count { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) { .hide-sm { display: none !important; } }

/* ---------- utilitários e ajustes ---------- */
[hidden] { display: none !important; }
html.modal-open { overflow: hidden; }
dialog.modal .modal-body { overscroll-behavior: contain; }
.topbar .actions { margin-left: auto; }
.search input:not(:placeholder-shown) ~ kbd { display: none; }
.placeholder .ph-icon { width: 46px; height: 46px; stroke-width: 1.4; opacity: .55; color: #fff; }
.placeholder.small .ph-icon { width: 20px; height: 20px; opacity: .8; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.charts-toggle { display: none; }
.filters { display: contents; }
.filters-toggle { display: none; }
.sentinel { height: 1px; }
.chart h3 > span:first-child { min-width: 0; }
.detail .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.detail .detail-sub { color: var(--text-2); margin-top: 4px; }
.detail .long { margin-top: 12px; }
.detail .long .k { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.img-preview { display: flex; gap: 12px; align-items: center; margin: -6px 0 16px; color: var(--text-3); font-size: 13px; }
.img-preview .pv { width: 64px; height: 92px; border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; }
.img-preview .pv.landscape { height: 48px; }
.img-preview .pv img { width: 100%; height: 100%; object-fit: cover; }
.kbd-hint { color: var(--text-3); font-size: 12.5px; align-self: center; }
@media (max-width: 760px) {
  .charts-toggle { display: inline-flex; }
  .charts:not(.show) { display: none; }
  .filters-toggle { display: inline-flex; }
  .filters { display: none; width: 100%; gap: 8px; flex-wrap: wrap; }
  .filters.open { display: flex; }
  .filters .select { flex: 1 1 calc(50% - 8px); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .count { width: auto; margin-left: auto; }
}

/* rodada 3 */
.lookup-results li { display: flex; }
.lookup-results li > .lr { width: 100%; }
.lookup .status { margin: 0 0 4px; }
.picked { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px; border-radius: 12px; background: var(--surface-solid); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.picked .pk-img { width: 40px; height: 56px; border-radius: 6px; overflow: hidden; flex: none; background: var(--surface-2); }
.picked .pk-img img { width: 100%; height: 100%; object-fit: cover; }
.picked .pk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.picked .pk-txt .icon { color: var(--good); width: 16px; height: 16px; }
.picked .pk-txt span { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .cover, .row .thumb, .lr .img, .res .th, .detail .poster {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s infinite;
}
.back-sm { display: none; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.6); }
.leaflet-container { background: var(--surface-2); font: inherit; }
@media (max-width: 760px) {
  .back-sm { display: grid; place-items: center; width: 36px; height: 36px; margin-right: -4px; border-radius: 10px; color: var(--text-2); }
  main.container { padding-bottom: 110px; }
}

/* rodada 5 */
.hbars { grid-template-columns: 1fr; }
@media (max-width: 760px) {
  .btn.sm, .tabs button, .seg button, .select { min-height: 44px; }
  .filters-toggle { min-height: 44px; }
}
