:root {
  --bg: #f6f6f4; --fg: #1c1c1e; --muted: #6b6b70; --card: #fff; --line: #ddd;
  --accent: #3b5bdb; --danger: #c92a2a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151517; --fg: #ececee; --muted: #9a9aa0; --card: #222226; --line: #333;
          --accent: #7b93ff; --danger: #ff6b6b; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.4 system-ui, -apple-system, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 8px 0 16px; }
a { color: var(--accent); }
.muted { color: var(--muted); }

nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px;
      border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 1; }
nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--fg); white-space: nowrap; }
nav a.active { background: var(--accent); color: #fff; }

button, .button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px;
                  background: var(--card); color: var(--fg); cursor: pointer; display: inline-block; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); border-color: var(--danger); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 520px; margin: 0 auto; }
.side { display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 8px; text-align: left; height: 100%; }
.card:hover { border-color: var(--accent); outline: 2px solid var(--accent); }
.card img, .card .nocover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.nocover { display: grid; place-items: center; text-align: center; padding: 8px;
           background: linear-gradient(135deg, var(--accent), #8e44ad); color: #fff; font-weight: 600; }
.skip { font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.skip button { font-size: .85rem; padding: 4px 8px; }
.controls { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

.plats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-bottom: 16px; }
.plats label { display: flex; gap: 6px; align-items: center; }

.rows { padding: 0; list-style: none; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
ol.rows { list-style: none; }
.num { min-width: 3ch; text-align: right; }
.thumb img, .thumb .nocover { width: 36px; height: 48px; object-fit: cover; border-radius: 3px; display: block; }
.thumb .nocover { font-size: 0; }
.name { flex: 1; min-width: 0; }
.acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.acts button { font-size: .8rem; padding: 3px 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.filters select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
                  background: var(--card); color: var(--fg); max-width: 100%; }
.list-foot { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 8px 16px;
         border-radius: 20px; background: var(--fg); color: var(--bg); opacity: 0; transition: opacity .2s;
         pointer-events: none; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; }

@media (max-width: 520px) {
  .pair { gap: 8px; }
  .rows li { flex-wrap: wrap; }
  .acts { width: 100%; }
}

.search { display: flex; gap: 8px; margin: 16px 0 0; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 6px 10px; border: 1px solid var(--line);
                border-radius: 6px; background: var(--card); color: var(--fg); }
