:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #1c1c1a;
  --muted: #6e6d68;
  --line: #e3e1da;
  --line-soft: #ecebe5;
  --accent: #2e6f4e;
  --accent-soft: #e2efe7;
  --accent-text: #ffffff;
  --web: #3a5a8c;
  --star: #c98a00;
  --error: #b3261e;
  --error-soft: #fbeae9;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 18px 50px rgba(20, 20, 15, .22);
  --shadow-card: 0 1px 2px rgba(20, 20, 15, .05);
  --shadow-lift: 0 6px 18px rgba(20, 20, 15, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #1e1d1b;
    --surface-2: #292826;
    --text: #eceae6;
    --muted: #a3a19a;
    --line: #333230;
    --line-soft: #2a2927;
    --accent: #63b68d;
    --accent-soft: #20352a;
    --accent-text: #0e1a13;
    --web: #8eb0e6;
    --star: #e9bc4f;
    --error: #f2b8b5;
    --error-soft: #3a2422;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lift: 0 6px 18px rgba(0, 0, 0, .40);
  }
}
:root[data-theme="dark"] {
  --bg: #141413;
  --surface: #1e1d1b;
  --surface-2: #292826;
  --text: #eceae6;
  --muted: #a3a19a;
  --line: #333230;
  --line-soft: #2a2927;
  --accent: #63b68d;
  --accent-soft: #20352a;
  --accent-text: #0e1a13;
  --web: #8eb0e6;
  --star: #e9bc4f;
  --error: #f2b8b5;
  --error-soft: #3a2422;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lift: 0 6px 18px rgba(0, 0, 0, .40);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--error); }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }

button, select, input, textarea {
  font: inherit; color: inherit; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface); padding: 7px 12px; min-height: 36px;
}
textarea { width: 100%; resize: vertical; }
button { cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.ghost { background: transparent; }
.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5; min-height: 56px;
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--accent); text-decoration: none; }
.spacer { flex: 1; }
.pill { border-radius: 999px; padding: 4px 12px; min-height: 30px; font-size: 12.5px; background: var(--surface-2); border: 1px solid transparent; }
#processing::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-btn { border: 0; border-radius: 0; min-height: 28px; padding: 3px 11px; font-size: 12.5px; background: transparent; }
.lang-btn.active { background: var(--accent); color: var(--accent-text); }
.version { color: var(--muted); font-size: 11.5px; }
#nav-toggle { display: none; }
.icon-btn { min-height: 34px; min-width: 34px; padding: 4px 8px; border-radius: 999px; background: transparent; }

/* ---------- App shell ---------- */
.layout { display: flex; align-items: stretch; }
#sidenav {
  width: 236px; flex: none; align-self: flex-start;
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  padding: 14px 10px 28px; border-right: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; gap: 1px;
}
main { flex: 1; min-width: 0; padding: 20px 26px 48px; }
main > .view, #login { max-width: 1120px; margin: 0 auto; }
.panel { max-width: 340px; margin: 56px auto; }
.panel form { display: flex; flex-direction: column; gap: 10px; }
.panel h1 { font-size: 22px; margin: 0 0 6px; }
.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 26px 0 12px; }

/* ---------- Left navigation ---------- */
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: none; border-radius: var(--radius-s); padding: 6px 10px; min-height: 33px;
  font-size: 13.5px; color: var(--text);
}
.nav-item:hover { background: var(--surface-2); border: 0; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item.sub { padding-left: 13px; }
.nav-icon { width: 19px; flex: none; text-align: center; font-size: 13.5px; color: var(--muted); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border-radius: 999px; padding: 1px 7px; line-height: 16px;
}
.nav-item.active .nav-count { background: transparent; color: var(--accent); }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin: 0 auto; }
.nav-head {
  margin: 18px 10px 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); display: flex; justify-content: space-between; align-items: center;
}
button.nav-head {
  border: 0; background: none; width: calc(100% - 0px); padding: 3px 10px; min-height: 0;
  margin: 18px 0 5px; border-radius: var(--radius-s); cursor: pointer;
}
button.nav-head:hover { color: var(--text); background: none; }
.nav-head .caret { font-size: 9px; opacity: .8; }

/* ---------- Overview ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 2px 0 8px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 14px 16px 12px; text-align: left; display: block;
}
button.tile:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.tile-num { font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
.insights {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 2px 18px 12px; margin-bottom: 16px;
}
.insights .section-title { margin: 14px 0 8px; }
.insights ul { margin: 0; padding-left: 20px; }
.insights li { margin: 5px 0; }

/* ---------- Ask ---------- */
.searchbar {
  display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: 56px; z-index: 4;
  background: var(--bg); padding: 2px 0 14px;
}
.searchbar input { flex: 1 1 280px; min-width: 0; min-height: 42px; border-radius: var(--radius); padding: 8px 16px; }
.searchbar input:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { border-radius: 999px; min-height: 32px; padding: 4px 13px; font-size: 13px; }
.chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip .count { opacity: .7; margin-left: 4px; }
.turn { margin-bottom: 30px; }
.turn + .turn { border-top: 1px solid var(--line); padding-top: 22px; }
.question { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.understood { font-size: 13px; margin: 0 0 10px; }
.answer {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px 18px; margin-bottom: 14px;
}
.answer.web { border-left-color: var(--web); }
.answer h2 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.answer p { margin: 0 0 8px; }
.answer ul, .answer ol { margin: 0 0 8px; padding-left: 22px; }
.answer li { margin: 2px 0; }
.answer h4 { margin: 10px 0 4px; }
.answer .links { font-size: 13.5px; }
.cite {
  display: inline-block; min-height: 0; padding: 0 6px; margin: 0 1px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border: 0; vertical-align: 1px;
}
.more-related { margin-top: 10px; font-size: 13.5px; }
.thinking { color: var(--muted); }
.thinking::after { content: "…"; animation: pulse 1s infinite; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-card);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card.cited { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.flash { animation: flash 1.2s; }
@keyframes flash { 30% { box-shadow: 0 0 0 4px var(--accent); } }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.thumb img + .placeholder { display: none; }
.thumb .state {
  position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, .72); color: #fff; display: none;
}
.card.busy .state, .card.failed .state { display: block; }
.card.failed .state { background: var(--error); color: #fff; }
.thumb .dur {
  position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .72); color: #fff;
}
.card.busy .dur, .card.failed .dur { display: none; }
.star-quick {
  position: absolute; right: 5px; top: 4px; min-height: 0; padding: 2px 7px; font-size: 17px;
  border: 0; background: none; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
  opacity: 0; transition: opacity .15s;
}
.star-quick:hover { border: 0; transform: scale(1.12); }
.star-quick.on { opacity: 1; color: var(--star); }
.card:hover .star-quick, .card:focus-within .star-quick { opacity: 1; }
.hide-btn {
  position: absolute; right: 8px; bottom: 8px; min-height: 0; font-size: 12px; padding: 3px 11px;
  border-radius: 999px; background: rgba(0, 0, 0, .72); color: #fff; border: 0; opacity: 0; transition: opacity .15s;
}
.card:hover .hide-btn, .card:focus-within .hide-btn { opacity: 1; }
@media (hover: none) { .hide-btn, .star-quick { opacity: 1; } }
.top-badge {
  position: absolute; left: 8px; top: 7px; font-size: 11px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; background: var(--star); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.body { padding: 10px 13px 13px; display: flex; flex-direction: column; gap: 3px; }
.meta { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; row-gap: 3px; }
.meta .stats { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; line-height: 17px; }
.badge.dup { color: var(--star); border-color: var(--star); }
.badge.trend { color: var(--accent); border-color: var(--accent); }
.badge.gone { color: var(--error); border-color: var(--error); }
.num { font-weight: 800; color: var(--accent); }
.title { margin: 2px 0 0; font-size: 14.5px; font-weight: 650; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.original { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary { margin: 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 32px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1; }

.card.skeleton { pointer-events: none; border-color: var(--line-soft); }
.card.skeleton .thumb { background: var(--surface-2); }
.card.skeleton .body { height: 74px; }
.card.skeleton .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Library ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.toolbar input { flex: 1; min-height: 40px; border-radius: var(--radius); padding: 8px 14px; }
.toolbar input:focus { border-color: var(--accent); }
#more { display: block; margin: 18px auto; }
.bulk-bar { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-bottom: 4px; }
.sem-hint {
  grid-column: 1 / -1; font-size: 13px; color: var(--accent); font-weight: 600;
  background: var(--accent-soft); border-radius: var(--radius-s); padding: 9px 14px;
}
.ask-cta { grid-column: 1 / -1; display: flex; justify-content: center; padding: 10px 0; }

/* Groups */
.group { margin-bottom: 26px; }
.group-head-row { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.group-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.compare-btn { min-height: 27px; padding: 2px 12px; font-size: 12.5px; border-radius: 999px; background: transparent; }
#items.as-groups { display: block; }
.best-pick { background: var(--accent-soft); border-radius: var(--radius-s); padding: 9px 13px; font-weight: 600; }

/* Duplicate pairs */
.dup-pair {
  display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  gap: 14px; align-items: center; max-width: 880px; margin-bottom: 18px;
}
.dup-pair + .dup-pair { border-top: 1px solid var(--line); padding-top: 18px; }
.pair-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pair-glyph { font-size: 22px; color: var(--muted); }
.pair-sim { font-size: 12px; font-weight: 700; color: var(--accent); }
.pair-mid button { width: 100%; font-size: 12.5px; min-height: 32px; padding: 4px 10px; }
.pair-tag {
  position: absolute; left: 8px; top: 7px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; color: #fff;
}
.pair-tag.orig { background: var(--accent); }
.pair-tag.dup { background: var(--star); }

/* ---------- Drawer (detail panel) ---------- */
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--line); padding: 0; }
dialog::backdrop { background: rgba(10, 10, 8, .5); }
.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); max-width: 100vw;
  border-radius: 0; border-width: 0 0 0 1px; box-shadow: var(--shadow);
}
#drawer-body { padding: 14px 22px 36px; }
.drawer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.drawer-head .spacer { flex: 1; }
.star-btn.on { color: var(--star); border-color: var(--star); }
.hero { position: relative; display: block; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.hero img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.hero .play {
  position: absolute; inset: auto 12px 12px auto; background: rgba(0, 0, 0, .78); color: #fff;
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; text-decoration: none;
}
.hero .play:hover { background: rgba(0, 0, 0, .92); }
.d-title { font-size: 21px; line-height: 1.25; letter-spacing: -.01em; margin: 0; }
.d-title-edit { width: 100%; font-size: 18px; font-weight: 700; }
.d-original { color: var(--muted); margin: 2px 0 0; }
.d-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.d-meta select { min-height: 30px; padding: 2px 8px; font-size: 12.5px; }
.d-stats { font-weight: 600; font-variant-numeric: tabular-nums; }
.notice { background: var(--surface-2); border-radius: var(--radius-s); padding: 9px 13px; font-size: 13.5px; margin: 0 0 12px; }
.notice.error { color: var(--error); background: var(--error-soft); }
.field-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  margin: 18px 0 7px; display: flex; justify-content: space-between;
}
.saved-hint { text-transform: none; letter-spacing: 0; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 4px 2px 10px; background: var(--surface-2); font-size: 12.5px; }
.tag button { min-height: 0; padding: 0 6px; border: 0; background: none; color: var(--muted); }
.tag-input { min-height: 28px; padding: 2px 10px; font-size: 12.5px; width: 110px; border-radius: 999px; }
.details h4 { margin: 14px 0 4px; font-size: 13.5px; }
.details ul, .details ol { margin: 0 0 6px; padding-left: 22px; }
.details li { margin-bottom: 3px; }
.details li a { margin-left: 6px; font-size: 12.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.actions button, .actions a { min-height: 31px; padding: 4px 12px; font-size: 12.5px; }
.related { display: flex; flex-direction: column; gap: 8px; }
.related button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px; }
.related img, .related .ph { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger { color: var(--error); }

/* ---------- Modals ---------- */
.modal { width: min(520px, calc(100vw - 32px)); border-radius: var(--radius); box-shadow: var(--shadow); }
.modal form, #basket-body, #compare-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.modal h2 { margin: 0 0 4px; font-size: 17px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.shop h4 { margin: 10px 0 4px; font-size: 13.5px; }
.shop label { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.shop input[type=checkbox] { min-height: 0; }
.shop label:has(input:checked) span { text-decoration: line-through; color: var(--muted); }

/* ---------- Toast, offline, to-top ---------- */
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 20; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lift);
}
#toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.toast-action {
  min-height: 0; padding: 2px 11px; margin-left: 6px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: none; border: 1px solid var(--bg); color: var(--bg);
}
#offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; text-align: center;
  background: var(--error); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 16px;
}
#to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 8; width: 42px; height: 42px;
  border-radius: 50%; font-size: 17px; background: var(--surface); box-shadow: var(--shadow-lift);
}

/* ---------- Responsive ---------- */
#tabbar { display: none; }
@media (max-width: 820px) {
  #nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  #sidenav {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 11; width: min(280px, 85vw);
    height: auto; box-shadow: var(--shadow);
    transform: translateX(-105%); transition: transform .2s ease;
  }
  #sidenav.open { transform: none; }
  main { padding: 16px 16px 92px; }
  #tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9; display: flex;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }
  .tab-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    border: 0; background: none; min-height: 48px; padding: 4px 2px; font-size: 10.5px; color: var(--muted);
    border-radius: var(--radius-s);
  }
  .tab-btn:hover { border: 0; }
  .tab-btn .t-ico { font-size: 18px; line-height: 1.2; }
  .tab-btn.active { color: var(--accent); font-weight: 600; }
  #to-top { bottom: 92px; }
  #toast { bottom: 96px; }
}
@media (max-width: 640px) {
  .top { gap: 6px; padding: 8px 12px; }
  .version, #processing { display: none; }
  .searchbar { position: static; }
  .searchbar select, .searchbar button { flex: 1 1 auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .summary { display: none; }
  .drawer { width: 100vw; border-width: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dup-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pair-mid { grid-column: 1 / -1; order: 3; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pair-mid button { width: auto; }
}
