/* MachineParts mobile app */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-text="s"] { font-size: 14px; }
html[data-text="l"] { font-size: 18px; }

:root {
  --navy: #0b1524;
  --navy-2: #101f36;
  --accent: #f5a524;
  --accent-ink: #241a05;
  --accent-soft: rgba(245, 165, 36, .16);
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --text: #0b1524;
  --muted: #5b6b80;
  --line: #e3e9f1;
  --good: #1a8a4c;
  --good-bg: #e7f6ee;
  --low: #a16207;
  --low-bg: #fdf2dc;
  --bad: #c0392b;
  --bad-bg: #fdeceb;
  --star: #f5a524;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(11, 21, 36, .09);
  --tabbar-h: 68px;
  --max: 760px;
}

html[data-theme="dark"] {
  --bg: #0a1220;
  --surface: #101c2f;
  --surface-2: #16243a;
  --text: #e9eff8;
  --muted: #93a4bb;
  --line: #22334d;
  --good: #58d68d;
  --good-bg: #12301f;
  --low: #f3c76a;
  --low-bg: #32260f;
  --bad: #f08a7f;
  --bad-bg: #3a1a18;
  --accent-soft: rgba(245, 165, 36, .18);
  --shadow: 0 12px 32px rgba(0, 0, 0, .4);
}

html[data-accent="blue"] {
  --accent: #2b6ef2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(43, 110, 242, .16);
}

html[data-accent="green"] {
  --accent: #1f9d55;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 157, 85, .16);
}

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; }

button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }

.muted { color: var(--muted); }
.section-note { color: var(--muted); font-size: .8rem; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.03); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-ghost { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.small { padding: 8px 12px; font-size: .82rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
}

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  width: 100%;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= AUTH ================= */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.auth-download {
  margin: 0 22px 26px;
  text-align: center;
  font-size: .86rem;
  color: var(--muted);
}
.auth-download a { color: var(--accent); font-weight: 700; text-decoration: none; }

.auth-hero {
  background:
    radial-gradient(90% 120% at 8% 0%, #1c3150 0%, transparent 55%),
    radial-gradient(70% 90% at 100% 10%, #1a2a45 0%, transparent 60%),
    var(--navy);
  color: #eef3fb;
  padding: 26px 22px 54px;
  border-radius: 0 0 30px 30px;
}

.brand-mark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-mark svg { width: 34px; height: 34px; display: block; }

.auth-hero h1 {
  margin: 28px 0 10px;
  font-size: 1.9rem;
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 800;
}
.auth-hero h1 span { color: var(--accent); }
.hero-copy { color: #b9c6d8; font-size: .95rem; max-width: 42ch; }
.hero-points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.hero-points li { color: #cbd6e6; font-size: .86rem; position: relative; padding-left: 22px; }
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .4em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, .18);
}

.auth-card {
  width: min(calc(100% - 32px), 460px);
  margin: -34px auto 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 18px;
}
.auth-tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 8px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 5px rgba(11, 21, 36, .12); }

.auth-form { display: grid; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field > span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
}
.form-error {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: .82rem;
  margin-bottom: 12px;
}
.form-hint { margin-top: 12px; color: var(--muted); font-size: .76rem; text-align: center; line-height: 1.5; }

@media (min-width: 960px) {
  .auth-shell { display: grid; grid-template-columns: 1.05fr .95fr; background: var(--navy); }
  .auth-hero {
    border-radius: 0;
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .auth-hero h1 { font-size: 2.6rem; max-width: 12ch; }
  .hero-copy { font-size: 1.02rem; }
  .auth-card { margin: 48px auto; width: min(440px, 84%); justify-self: center; align-self: center; }
}

/* ================= APP ================= */
.app {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 58px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand-line { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.01em; font-size: 1rem; }
.brand-dot {
  width: 13px;
  height: 13px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: 0 0 12px var(--accent-soft);
}

.header-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 190px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 21, 36, .05);
}
.area-chip svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.8; flex: none; }
.area-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px var(--good-bg); }
.conn-dot.off { background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }

.app-main { padding: 12px 16px 20px; }
.tab { animation: fade .18s ease; }

/* search bar */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 3px 10px;
  box-shadow: var(--shadow);
  margin: 4px 0 16px;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ico { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.9; stroke-linecap: round; flex: none; }
#search-input {
  border: 0;
  background: transparent;
  padding: 11px 0;
  font-size: .98rem;
  box-shadow: none;
}
#search-input:focus { box-shadow: none; border: 0; }
#search-input::-webkit-search-cancel-button { display: none; }
.clear-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* sections */
.home-section { margin-bottom: 6px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 9px;
}
.section-head h2 {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar, .shop-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.chip .chip-count {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 7px;
}
html[data-accent="amber"] .chip .chip-count { color: #8a5c05; }
html[data-theme="dark"] .chip .chip-count { color: var(--accent); }

.recent-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 11px 13px;
  cursor: pointer;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: var(--surface-2); }
.recent-ico { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; flex: none; }
.recent-main { min-width: 0; flex: 1; }
.recent-query { display: block; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { display: block; color: var(--muted); font-size: .74rem; }
.row-del {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  border-radius: 8px;
  cursor: pointer;
}
.row-del:hover { background: var(--bad-bg); color: var(--bad); }

/* shop cards */
.shop-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scrollbar-width: none;
}
.shop-card {
  flex: none;
  width: 246px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(11, 21, 36, .05);
}
.shop-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.shop-name { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.shop-loc { color: var(--muted); font-size: .76rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.stars { color: var(--star); font-size: .82rem; letter-spacing: .5px; white-space: nowrap; font-weight: 700; }
.stars .rating-count { color: var(--muted); font-weight: 500; font-size: .72rem; letter-spacing: 0; }
.shop-parts { color: var(--muted); font-size: .72rem; }

.home-footnote { color: var(--muted); font-size: .74rem; line-height: 1.5; margin: 20px 2px 0; }

/* results */
.results-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 10px; gap: 10px; }
.result-list { display: grid; gap: 10px; }
.result {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  box-shadow: 0 4px 14px rgba(11, 21, 36, .05);
  cursor: pointer;
  transition: border-color .15s ease;
}
.result:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.result h3 { font-size: .98rem; font-weight: 700; line-height: 1.28; padding-right: 34px; }
.result-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.mono-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
  white-space: nowrap;
}
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fav-btn:hover { background: var(--surface-2); }
.fav-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav-btn.on { color: #e11d48; }
.fav-btn.on svg { fill: currentColor; }
.result-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 11px; }
.result-shop { min-width: 0; }
.result-shop-name { display: block; font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-shop .stars { font-size: .74rem; }
.result-price { display: flex; align-items: center; gap: 8px; flex: none; }
.price { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; white-space: nowrap; }
.stock { font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.stock.ok { color: var(--good); background: var(--good-bg); }
.stock.low { color: var(--low); background: var(--low-bg); }
.stock.out { color: var(--bad); background: var(--bad-bg); }

/* empty */
.empty { text-align: center; padding: 42px 20px 30px; color: var(--muted); }
.empty-ico { font-size: 2rem; color: var(--accent); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 1.02rem; margin-bottom: 4px; }
.empty p { font-size: .84rem; max-width: 30ch; margin: 0 auto; line-height: 1.5; }

.page-head { padding: 8px 2px 6px; }
.page-head h1 { font-size: 1.55rem; letter-spacing: -.02em; font-weight: 800; }
.page-head p { color: var(--muted); font-size: .84rem; margin-top: 2px; }

/* history top */
.history-top { display: grid; gap: 8px; }
.history-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.history-bar:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.history-bar-main { min-width: 0; }
.history-bar-query { font-weight: 600; font-size: .88rem; display: block; }
.history-bar-track { height: 5px; background: var(--surface-2); border-radius: 99px; margin-top: 7px; overflow: hidden; }
.history-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.history-bar-count { color: var(--muted); font-size: .74rem; font-weight: 600; white-space: nowrap; }

/* settings */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  box-shadow: 0 4px 16px rgba(11, 21, 36, .04);
}
.card-head { display: flex; gap: 11px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}
.card-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-head h2 { font-size: .98rem; font-weight: 700; }
.card-head p { color: var(--muted); font-size: .76rem; margin-top: 1px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-of-type { border-bottom: 0; }
.setting-row.column { flex-direction: column; align-items: stretch; gap: 7px; }
.setting-label { font-size: .88rem; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.setting-label small { color: var(--muted); font-size: .72rem; font-weight: 400; }
.card .btn.ghost.wide { margin-top: 10px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; flex: none; }
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(11, 21, 36, .14); }
html[data-theme="dark"] .seg button.active { background: var(--line); }

.swatches { display: flex; gap: 10px; }
.swatches button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--sw);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
.swatches button.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent), 0 0 0 6px var(--accent-soft); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; pointer-events: none; transition: background .18s ease; }
.switch span::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}
.avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy-2);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
}
.account-info { min-width: 0; flex: 1; display: grid; }
.account-info strong { font-size: .92rem; }
.account-info span { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-note { text-align: center; color: var(--muted); font-size: .72rem; margin: 18px 0 4px; }

/* tab bar */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
}
.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 5px 0;
  border-radius: 12px;
  font-size: .66rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .01em;
}
.tab-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn.active { color: var(--accent); }
html[data-accent="amber"] .tab-btn.active { color: #b26f00; }
html[data-theme="dark"] .tab-btn.active,
html[data-theme="dark"][data-accent="amber"] .tab-btn.active { color: var(--accent); }

/* ================= SHEET ================= */
.sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 10, 20, .55); backdrop-filter: blur(2px); animation: fade .16s ease; }
.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
}
.sheet-grip { width: 42px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 8px; }
.sheet-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
@media (min-width: 680px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 24px; padding-bottom: 22px; max-height: 85dvh; }
  .sheet-grip { display: none; }
}

.detail-head { padding: 8px 34px 4px 0; }
.detail-title { font-size: 1.22rem; font-weight: 800; line-height: 1.25; letter-spacing: -.015em; }
.detail-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 7px; color: var(--muted); font-size: .78rem; }
.detail-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; }
.detail-price { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.detail-cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.detail-cell span { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 2px; }
.detail-cell strong { font-size: .86rem; font-weight: 600; word-break: break-word; }
.detail-shop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.detail-shop-name { font-weight: 700; font-size: .9rem; }
.detail-shop-loc { color: var(--muted); font-size: .74rem; margin-top: 1px; }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; }
.detail-actions .btn { flex: 1; }
.detail-actions .fav-action.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.rate-head { text-align: center; padding: 10px 0 0; }
.rate-head h3 { font-size: 1.15rem; font-weight: 800; }
.rate-head p { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.rate-stars { display: flex; justify-content: center; gap: 8px; margin: 16px 0 6px; }
.rate-stars button {
  border: 0;
  background: transparent;
  color: var(--line);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  transition: transform .1s ease, color .1s ease;
}
.rate-stars button.on { color: var(--star); }
.rate-stars button:active { transform: scale(1.15); }
.rate-label { text-align: center; color: var(--muted); font-size: .78rem; min-height: 1.2em; margin-bottom: 12px; }
.rate-comment { margin-bottom: 12px; }
.rate-error { color: var(--bad); font-size: .8rem; text-align: center; margin-bottom: 8px; }

.area-list { display: grid; gap: 6px; margin-top: 8px; }
.area-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.area-option.active { border-color: var(--accent); background: var(--accent-soft); }
.area-option .tick { color: var(--accent); font-weight: 800; }
.sheet-title { font-size: 1.1rem; font-weight: 800; padding: 6px 34px 2px 0; }
.sheet-sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.sheet-actions .btn { flex: 1; }

/* ================= TOUR ================= */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-spot {
  position: fixed;
  border-radius: 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(5, 10, 20, .63);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
  pointer-events: none;
  z-index: 1;
}
.tour-card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), 430px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  z-index: 2;
}
.tour-card.top { bottom: auto; top: calc(16px + env(safe-area-inset-top)); }
.tour-step-label { color: var(--accent); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.tour-card h3 { margin-top: 4px; font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; }
.tour-card p { color: var(--muted); font-size: .85rem; margin-top: 4px; line-height: 1.5; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.tour-right { display: flex; gap: 8px; }
.tour-dots { display: flex; gap: 5px; justify-content: center; margin-top: 12px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); }
.tour-dots i.on { background: var(--accent); width: 18px; }

/* toasts */
.toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(calc(100% - 32px), 400px);
  pointer-events: none;
}
.toast {
  background: var(--navy);
  color: #eef3fb;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: .82rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: toastIn .2s ease;
  text-align: center;
}
.toast.error { background: #7f1d1d; }
.toast.success { background: #14532d; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(30px); opacity: .6 } to { transform: translateY(0); opacity: 1 } }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 380px) {
  .auth-hero h1 { font-size: 1.65rem; }
  .seg button { padding: 6px 7px; font-size: .72rem; }
  .setting-row { gap: 8px; }
  .area-chip { max-width: 150px; }
}
