/* ============ Evis — lilac design system ============ */
:root {
  --bg: #f8f5fc;
  --surface: #ffffff;
  --surface-2: #f2ecfa;
  --text: #2a2135;
  --muted: #7d7290;
  --border: #ece4f5;
  --lilac: #b79ce0;
  --accent: #7c5cc4;          /* buttons, links (AA on white) */
  --accent-ink: #ffffff;
  --accent-soft: #f1eafc;
  --hero-1: #cdb6f4;
  --hero-2: #9d80dc;
  --danger: #c2456a;
  --shadow: 0 10px 30px -12px rgba(124, 92, 196, .28);
  --shadow-sm: 0 4px 14px -6px rgba(124, 92, 196, .22);
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  /* pastel spaces */
  --sky: #dfe9fd;  --sky-ink: #3e5f9e;
  --mint: #dcf1e6; --mint-ink: #2f7a55;
  --peach: #fde6d8; --peach-ink: #a65a2b;
  --rose: #f9e0ee; --rose-ink: #a1416f;
  --butter: #fcf1cf; --butter-ink: #8a6a12;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16111e;
    --surface: #211a2c;
    --surface-2: #2b2338;
    --text: #f3eefa;
    --muted: #a99dbc;
    --border: #352c44;
    --lilac: #b79ce0;
    --accent: #d2bdf6;
    --accent-ink: #1f1530;
    --accent-soft: #3d3157;
    --hero-1: #a48ade;
    --hero-2: #7a5fc2;
    --danger: #f08aa8;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-sm: 0 4px 14px -6px rgba(0, 0, 0, .5);
    --sky: #23304a;  --sky-ink: #a9c4f5;
    --mint: #1f3a2f; --mint-ink: #9fdcbc;
    --peach: #3d2a20; --peach-ink: #f3b994;
    --rose: #3b2232; --rose-ink: #f0a9cb;
    --butter: #3a321b; --butter-ink: #f1d98a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.view { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }

/* icons */
.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============ Home ============ */
.home-header { display: flex; align-items: flex-start; justify-content: space-between; margin: 8px 2px 22px; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 14px; font-weight: 500; }
h1 { margin: 0; font-size: clamp(22px, 6.6vw, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  color: #fff; font-weight: 700; font-size: 20px;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}

.hero {
  display: block; text-decoration: none; color: #fff;
  border-radius: var(--r-lg); padding: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.28), transparent 55%),
    linear-gradient(140deg, var(--hero-1), var(--hero-2));
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.hero:active { transform: scale(.98); }
.hero-top { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.hero-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: grid; place-items: center;
}
.hero-kicker { font-weight: 600; font-size: 15px; opacity: .95; }
.hero-chev { margin-left: auto; opacity: .85; }
.hero-title { text-shadow: 0 1px 8px rgba(70,40,130,.25); font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.hero-meta { margin-top: 4px; font-size: 14px; opacity: .9; }

.section-title { margin: 28px 4px 12px; font-size: 18px; font-weight: 700; }

/* Pinterest-like staggered grid */
.spaces {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  grid-auto-rows: 76px;
}
.space {
  position: relative; border-radius: var(--r-md); padding: 16px;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--ink); background: var(--tint);
  text-decoration: none; overflow: hidden;
}
.space-icon {
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: auto;
  background: var(--surface); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.space-name { font-weight: 700; font-size: 17px; color: var(--text); }
.space-sub { font-size: 13px; color: var(--muted); }
.pill {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface); color: var(--ink);
}
.space-news   { --tint: var(--sky);   --ink: var(--sky-ink);   grid-row: span 3; }
.space-mind   { --tint: var(--mint);  --ink: var(--mint-ink);  grid-row: span 2; }
.space-wisdom { --tint: var(--peach); --ink: var(--peach-ink); grid-row: span 3; }
.space-recipes { --tint: var(--rose); --ink: var(--rose-ink); grid-row: span 2; }
.space-gratitude { --tint: var(--butter); --ink: var(--butter-ink); grid-row: span 2; }
.space-more   { --tint: var(--accent-soft); --ink: var(--accent); grid-row: span 2; }

/* ============ Parking ============ */
.bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.bar h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); color: var(--text);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.content, .stack { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 16px;
}
.card-label { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

/* map hero */
.map-card { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); isolation: isolate; }
.map { height: 290px; background: var(--surface-2); }
.map-chip {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: var(--r-sm); padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.spot-address { font-weight: 600; font-size: 17px; line-height: 1.3; }
.spot-meta { color: var(--muted); font-size: 13px; margin-top: 1px; }
.map-hint { font-size: 12.5px; color: var(--muted); margin: -6px 6px 0; }
.map-card .leaflet-bottom.leaflet-right { top: 0; bottom: auto; }
.leaflet-control-attribution { font-size: 9px !important; opacity: .75; }

.evis-pin { filter: drop-shadow(0 6px 8px rgba(80, 50, 140, .35)); }

.distance-row { display: flex; }
.distance {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--text);
  font-weight: 600; font-size: 15px;
  padding: 8px 14px; border-radius: 999px;
}
.distance .i { width: 18px; height: 18px; color: var(--accent); }

/* quick actions — story-style circles */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px 0; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none;
}
.quick-circle {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.quick-circle.primary { background: linear-gradient(140deg, var(--hero-1), var(--hero-2)); color: #fff; border: 0; }
.quick-btn:active .quick-circle { transform: scale(.92); }

/* buttons */
.btn {
  font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 0; border-radius: var(--r-sm);
  padding: 12px 16px; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(140deg, var(--hero-1), var(--hero-2)); color: #fff; box-shadow: var(--shadow-sm); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.big { width: 100%; padding: 17px; font-size: 17px; border-radius: var(--r-md); }
.btn:disabled { opacity: .65; }
.btn.pango { width: 100%; background: var(--text); color: var(--bg); padding: 14px; border-radius: var(--r-md); }

.text-btn {
  background: none; border: 0; cursor: pointer; padding: 10px;
  font-weight: 600; font-size: 15px; color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.text-btn.danger { color: var(--danger); }
.text-btn.center { align-self: center; }
.text-btn .i { width: 18px; height: 18px; }

/* note */
.note { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.note input[type="text"] { border: 0; background: none; padding: 4px 0; border-radius: 0; }
.note input[type="text"]:focus { outline: none; }
.card:has(.note input:focus) { outline: 2px solid var(--lilac); outline-offset: -1px; }

input[type="text"], input[type="search"] {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 12px 14px;
}
input::placeholder { color: var(--muted); opacity: .85; }
input:focus { outline: 2px solid var(--lilac); outline-offset: 0; }
input[type="search"]::-webkit-search-cancel-button { display: none; }

/* media */
.photo { display: flex; flex-direction: column; gap: 10px; }
.photo-img {
  display: block; width: 100%; max-height: 260px; object-fit: cover;
  border-radius: var(--r-sm); cursor: zoom-in;
}
video.photo-img { cursor: default; background: #000; }
.media-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.photo-actions { display: flex; gap: 8px; }
.chip {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 14px;
}
.chip .i { width: 18px; height: 18px; }
.chip:active { transform: scale(.96); }

/* empty state */
.empty { text-align: center; padding: 24px 16px 8px; }
.empty-art {
  width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent);
  background: radial-gradient(circle at 30% 30%, var(--surface), var(--accent-soft));
  box-shadow: var(--shadow-sm);
}
.empty-art .i { width: 44px; height: 44px; stroke-width: 1.6; }
.empty h3 { margin: 0 0 4px; font-size: 19px; }
.empty p { margin: 0 auto; color: var(--muted); max-width: 260px; }

/* save card */
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.search { position: relative; display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; padding-left: 42px; border-radius: 999px; }
.search .search-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search .btn { border-radius: 999px; }
.results { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results:empty { display: none; }
.results li {
  padding: 12px 14px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--surface-2); font-size: 15px;
}
.results li:active { background: var(--accent-soft); }
.results li.info { cursor: default; color: var(--muted); background: none; border: 1px dashed var(--border); }
.r-main { font-weight: 600; }
.r-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.r-sub:empty { display: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 3000;
  transform: translateX(-50%) translateY(20px);
  background: #2a2135; color: #fff;
  padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 14px;
  opacity: 0; pointer-events: none; transition: .22s ease; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-action { font-weight: 700; color: #d6c3f7; background: none; border: 0; padding: 2px; cursor: pointer; }

/* full-screen photo viewer */
.viewer {
  position: fixed; inset: 0; z-index: 2000; background: rgba(10, 6, 16, .94);
  display: grid; place-items: center; padding: 16px; cursor: zoom-out;
}
.viewer img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ============ Find my car ============ */
.finder {
  position: fixed; inset: 0; z-index: 1500;
  background:
    radial-gradient(90% 60% at 50% 35%, rgba(183,156,224,.35), transparent 70%),
    linear-gradient(180deg, #2a1f3d, #140f1c);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center; gap: 18px;
}
.finder-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center;
}
.finder-title { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: #cbbbe8; font-weight: 600; }
.finder-arrow-wrap {
  width: min(72vw, 320px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: radial-gradient(circle, rgba(183,156,224,.18), rgba(183,156,224,.03) 70%);
  display: grid; place-items: center;
}
.finder-arrow { width: 60%; height: 60%; transition: transform .25s ease-out; filter: drop-shadow(0 10px 24px rgba(183,156,224,.55)); }
.finder-here .i { width: 110px; height: 110px; stroke-width: 1.4; color: #e3d3fb; }
.finder-dist { font-size: 60px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.finder-hint { font-size: 15px; color: #d9cdee; max-width: 320px; min-height: 2.6em; }

/* Claude usage shortcut */
.usage {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 12px 16px; margin: -6px 0 16px;
}
.usage:active { transform: scale(.98); }
.usage-spark { width: 18px; height: 18px; fill: var(--accent); flex: none; }
.usage-text { display: flex; flex-direction: column; }
.usage-name { font-weight: 600; font-size: 15px; }
.usage-sub { font-size: 13px; color: var(--muted); }
.usage-chev { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }
