:root {
  --bg: #070d19;
  --panel: #0e1626;
  --panel-2: #131f33;
  --line: #22304a;
  --text: #e8eefb;
  --muted: #96a6c2;
  --accent: #34d399;
  --accent-2: #22c55e;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #12203a 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100%;
}

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 13, 25, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--accent) 0%, #0ea5e9 100%);
  color: #05202a; flex: 0 0 auto;
}
.brand h1 { font-size: 1.15rem; margin: 0; letter-spacing: 0.2px; }
.tagline { margin: 0; color: var(--muted); font-size: 0.8rem; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status[data-state="ok"] .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.status[data-state="warn"] .dot { background: var(--warn); }
.status[data-state="error"] .dot { background: var(--danger); }

main { padding: 18px 16px 8px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row-actions { margin-top: 14px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 200px; }
.label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.control {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem;
  min-height: 44px;
}
.range { padding: 0; background: transparent; border: 0; accent-color: var(--accent); min-height: 44px; }
select.control:focus-visible, .control:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 46px; height: 26px; border-radius: 999px;
  background: #24344f; border: 1px solid var(--line);
  position: relative; transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #cbd5e1; transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .switch-track { background: rgba(52, 211, 153, 0.35); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); background: var(--accent); }
.switch-label { font-size: 0.92rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-primary {
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #05202a; border-color: transparent;
  margin-left: auto;
}
.btn-ghost svg { opacity: 0.9; }

.banner {
  margin-top: 14px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 0.9rem;
}
.banner[data-kind="warn"] { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.08); }
.banner[data-kind="error"] { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.08); }
.banner code { background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 5px; }

.results { margin-top: 20px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.results-head h2 { font-size: 1rem; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 0.82rem; }

.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
}
.card.is-sushi { border-color: rgba(52, 211, 153, 0.35); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-store { font-weight: 700; font-size: 1rem; }
.card-city { color: var(--muted); font-size: 0.8rem; }
.card-name { font-size: 0.92rem; color: #cfe0ff; }
.card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 0.78rem;
}
.chip.good { border-color: rgba(52, 211, 153, 0.45); color: var(--accent); }
.chip.bad { border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.card-actions { display: flex; justify-content: flex-end; }
.card-link {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.card-link:hover { border-bottom-color: currentColor; }

.skeleton { height: 96px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(90deg, #101a2b 25%, #16233a 37%, #101a2b 63%); background-size: 400% 100%; animation: shine 1.2s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.footer { padding: 24px 16px 40px; color: var(--muted); font-size: 0.82rem; }
.footer p { margin: 4px 0; }

@media (min-width: 901px) {
  .cards { grid-template-columns: 1fr 1fr; }
  main { padding-top: 24px; }
}

@media (max-width: 560px) {
  .btn-primary { margin-left: 0; width: 100%; }
  .row-actions { gap: 10px; }
}
