:root {
  --bg: #0d1014; --card: #151a21; --card2: #1b222b; --text: #eaeef3; --muted: #8a95a4;
  --line: #242c37; --accent: #4f8cff; --accent-text: #ffffff; --good: #2fcf75; --good-bg: rgba(47,207,117,.14);
  --warn: #f2a93b; --bad: #ef5b5b; --radius: 16px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}
[data-theme="light"] {
  --bg: #f2f4f8; --card: #ffffff; --card2: #eef1f6; --text: #0f141b; --muted: #667284;
  --line: #e2e7ef; --accent: #2563eb; --good: #16a34a; --good-bg: rgba(22,163,74,.11); --shadow: 0 1px 2px rgba(16,24,40,.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.app { min-height: 100vh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #7a5cff); position: relative; }
.logo::after { content: ""; position: absolute; inset: 9px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; }
.title { font-weight: 700; font-size: 17px; letter-spacing: .1px; }
.subtitle { color: var(--muted); font-size: 12px; margin-top: 1px; }
.chip { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--card2); color: var(--muted); white-space: nowrap; }
.chip-status.on { background: var(--good-bg); color: var(--good); }
.chip-status.off { background: rgba(239,91,91,.14); color: var(--bad); }
.view { flex: 1; padding: 14px 16px 96px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; z-index: 6; }
.tab { border: 0; background: transparent; color: var(--muted); font: 600 14px inherit; padding: 10px 0; border-radius: 12px; cursor: pointer; }
.tab.active { background: var(--card2); color: var(--text); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 8px 13px; border-radius: 999px;
  font: 600 13px inherit; cursor: pointer; }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.deal { display: grid; grid-template-columns: 88px 1fr; gap: 12px; }
.photo { width: 88px; height: 88px; border-radius: 12px; background: var(--card2); object-fit: cover; display: block; }
.photo.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.dname { font-weight: 700; font-size: 15px; }
.dtitle { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prices { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.price { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.median { color: var(--muted); font-size: 12.5px; }
.badge { background: var(--good-bg); color: var(--good); font-weight: 800; font-size: 12.5px; padding: 3px 8px; border-radius: 8px; }
.meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--muted); font-size: 12.5px; gap: 8px; }
.gain { color: var(--good); font-weight: 700; }
.btn { appearance: none; border: 0; background: var(--accent); color: var(--accent-text); font: 700 14px inherit; padding: 11px 16px; border-radius: 12px; cursor: pointer; width: 100%; }
.btn.secondary { background: var(--card2); color: var(--text); }
.btn:disabled { opacity: .55; }
.deal .btn { margin-top: 10px; padding: 9px 12px; font-size: 13.5px; }
.h { font-weight: 800; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin: 18px 2px 10px; }
.h:first-child { margin-top: 2px; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.row:last-child { border-bottom: 0; }
.switch { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--card2); position: relative; border: 1px solid var(--line); cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { left: 20px; background: #fff; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan .top-line { display: flex; justify-content: space-between; align-items: baseline; }
.plan .days { font-weight: 800; font-size: 17px; }
.plan .save { color: var(--good); font-weight: 700; font-size: 12.5px; }
.plan .cost { color: var(--muted); font-size: 13px; }
.status-card .big { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.empty-state { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty-state .big { color: var(--text); font-weight: 800; font-size: 17px; margin-bottom: 6px; }
.skeleton { height: 128px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: sh 1.2s infinite; margin-bottom: 12px; }
@keyframes sh { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; z-index: 20; max-width: 90%; text-align: center; }
a { color: var(--accent); text-decoration: none; }
.gap { height: 10px; }
.cityinput { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--text); font: 15px inherit; outline: none; }
.cityinput:focus { border-color: var(--accent); }
