/* Burgi Shopping — mobile-first, Luxury Neon Dark (paleta jako budget) */
:root {
  --bg: #080C14; --bg-card: #111827; --bg-el: #1A2332; --bg-input: #0D1520;
  --line: rgba(255, 255, 255, .06);
  --text: #F1F5F9; --text-2: #94A3B8; --muted: #64748B;
  --teal: #03CEA4; --purple: #9046CF; --pink: #FF2D95;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100dvh; color: var(--text);
  background: linear-gradient(160deg, #080C14 0%, #0A1628 55%, #0D1F2D 100%) fixed;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(24px + var(--safe-bottom));
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(8, 12, 20, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.page-home .topbar h1 {
  background: linear-gradient(90deg, var(--teal), var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .back { font-size: 34px; line-height: 1; padding: 0 10px 4px 0; color: var(--c, var(--teal)); }
.topbar-link { font-size: 22px; padding: 6px; }
.topbar-count { font: 600 15px/1 ui-monospace, "JetBrains Mono", monospace; color: var(--c, var(--teal)); }

/* ── Add bar ── */
.addbar { position: sticky; top: calc(55px + var(--safe-top)); z-index: 9; display: flex; gap: 8px; padding: 12px 16px; }
.addbar input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px; border-radius: 14px;
  background: var(--bg-input); color: var(--text); font-size: 17px;
  border: 1px solid rgba(255, 255, 255, .09); outline: none;
}
.addbar input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(3, 206, 164, .18); }
.addbar button {
  width: 50px; height: 50px; border-radius: 14px; font-size: 26px; font-weight: 300;
  background: var(--teal); color: #04241d;
}
.suggest {
  position: absolute; left: 16px; right: 74px; top: 64px; margin: 0; padding: 6px; list-style: none;
  background: var(--bg-el); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); max-height: 50vh; overflow: auto;
}
.suggest li { display: flex; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 10px; }
.suggest li:active, .suggest li.active { background: rgba(3, 206, 164, .12); }
.suggest .tag { color: var(--muted); font-size: 13px; white-space: nowrap; }
.added-note { margin: -4px 16px 6px; color: var(--teal); font-size: 14px; }

/* ── Hub grid ── */
.hub { padding: 4px 16px 0; }
.hub h2 { margin: 18px 2px 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.grid-wide { grid-template-columns: 1fr 1fr; margin-top: 18px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  aspect-ratio: 1 / .92; padding: 12px; border-radius: var(--radius);
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 26%, var(--bg-card)) 0%, var(--bg-card) 75%);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .08s ease;
}
.tile:active { transform: scale(.96); }
.tile-emoji { position: absolute; top: 10px; left: 12px; font-size: 30px; }
.tile-name { font-weight: 650; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.tile-count {
  position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  display: grid; place-items: center; font: 700 14px/1 ui-monospace, "JetBrains Mono", monospace;
  background: var(--c); color: #0b1120;
}
.tile-count:empty { display: none; }
.tile.empty { background: var(--bg-card); border-color: var(--line); }
.tile.empty .tile-emoji { filter: grayscale(.6); opacity: .7; }
.tile.empty .tile-name { color: var(--text-2); }
.tile-wide { aspect-ratio: auto; min-height: 64px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.tile-wide .tile-emoji { position: static; font-size: 24px; }
.tile-wide .tile-count { top: 50%; transform: translateY(-50%); }
.foot { margin: 28px 16px 0; text-align: center; color: var(--muted); font-size: 13px; }
.foot a { text-decoration: underline; }

/* ── Items ── */
main#list { padding: 0 12px; }
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 6px 8px 10px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  user-select: none; -webkit-user-select: none;
}
.item .check {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--c, var(--teal)); display: grid; place-items: center;
}
.item .body { flex: 1; min-width: 0; padding: 4px 0; }
.item .name { font-size: 17px; overflow-wrap: anywhere; }
.item .note { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.item .cats { flex: none; font-size: 15px; letter-spacing: 2px; opacity: .85; }
.item .edit { flex: none; width: 40px; height: 44px; font-size: 20px; color: var(--muted); }
.item.leaving { opacity: 0; transform: translateX(30px); transition: all .22s ease; }
.items.done .item { background: transparent; }
.items.done .name { color: var(--muted); text-decoration: line-through; }
.items.done .check { border-color: var(--muted); background: var(--muted); }
.items.done .check::after { content: "✓"; color: var(--bg); font-weight: 800; font-size: 15px; }
.empty-state { text-align: center; color: var(--muted); padding: 28px 0 10px; }
.aisle-head {
  margin: 16px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--c, var(--teal));
}
.aisle-head:first-child { margin-top: 4px; }
.route-hint { margin: 0 6px 4px; font-size: 12px; color: var(--muted); }
.done-box { margin-top: 18px; }
.done-box summary { list-style: none; padding: 12px 8px; color: var(--text-2); font-weight: 600; cursor: pointer; }
.done-box summary::-webkit-details-marker { display: none; }
.done-box summary::before { content: "▸ "; }
.done-box[open] summary::before { content: "▾ "; }

/* ── Bottom sheet ── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88dvh; overflow: auto;
  padding: 10px 16px calc(16px + var(--safe-bottom)); background: var(--bg-el);
  border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(60px); } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--muted); margin: 0 auto 12px; }
.sheet input {
  width: 100%; height: 48px; padding: 0 14px; margin-bottom: 10px; border-radius: 12px;
  background: var(--bg-input); color: var(--text); font-size: 17px; border: 1px solid var(--line);
}
.sheet .sheet-name { font-weight: 650; }
.sheet h3 { margin: 12px 2px 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 12px; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--line); font-size: 15px; }
.chip.on { background: color-mix(in srgb, var(--c) 28%, var(--bg-card)); border-color: var(--c); }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.btn-primary { padding: 13px 26px; border-radius: 14px; background: var(--teal); color: #04241d; font-weight: 700; }
.btn-danger { padding: 13px 18px; border-radius: 14px; color: var(--pink); border: 1px solid rgba(255, 45, 149, .35); }

/* ── Toast ── */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(18px + var(--safe-bottom)); z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; background: #0f2a26; border: 1px solid rgba(3, 206, 164, .4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.toast button { color: var(--teal); font-weight: 700; }

/* ── Login ── */
.login { min-height: 90dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.login-emoji { font-size: 64px; }
.login h1 { margin: 0; font-size: 32px; }
.login p { color: var(--text-2); margin: 0 0 18px; }
.login-error { color: var(--pink) !important; }
.btn-big { padding: 16px 30px; font-size: 17px; }
.dev-link { margin-top: 18px; color: var(--muted); text-decoration: underline; }
