/* ============================================================
   Bitebox styles
   Palette: Pitch Black #231c07 · Dark Coffee #392a16
            Peach Glow #f3b391 · Desert Sand #f6d4ba · Cornsilk #fefadc

   Appearance is set by data-theme on the page:
     light (default), dark, or auto (follows the phone)
   ============================================================ */

:root {
  --bg: #fefadc;
  --soft: rgba(57, 42, 22, 0.05);
  --soft-strong: rgba(57, 42, 22, 0.08);
  --text: #231c07;
  --text-2: #392a16;
  --accent: #f3b391;
  --on-accent: #231c07;
  --danger: #b3261e;
  --scrim: rgba(35, 28, 7, 0.4);
  --sheet-edge: rgba(57, 42, 22, 0.1);

  --radius: 14px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #231c07;
  --soft: rgba(254, 250, 220, 0.06);
  --soft-strong: rgba(254, 250, 220, 0.1);
  --text: #fefadc;
  --text-2: #f6d4ba;
  --danger: #ff9a8f;
  --scrim: rgba(0, 0, 0, 0.55);
  --sheet-edge: rgba(254, 250, 220, 0.1);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #231c07;
    --soft: rgba(254, 250, 220, 0.06);
    --soft-strong: rgba(254, 250, 220, 0.1);
    --text: #fefadc;
    --text-2: #f6d4ba;
    --danger: #ff9a8f;
    --scrim: rgba(0, 0, 0, 0.55);
    --sheet-edge: rgba(254, 250, 220, 0.1);
    color-scheme: dark;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Anything marked hidden must stay hidden, even if another rule sets its display */
[hidden] { display: none !important; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select, a { font-family: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { text-decoration: none; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }

.ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico-bold { stroke-width: 2.1; }
.ico-dim { opacity: 0.5; }

/* ---------- Screens and movement ---------- */

.screen { display: none; min-height: 100dvh; }
.screen.is-active { display: block; }

/* Each screen slides in the way iPhone apps do. The direction is chosen in app.js. */
.enter-fade    { animation: s-fade 0.32s var(--ease) backwards; }
.enter-forward { animation: s-forward 0.42s var(--ease) backwards; }
.enter-back    { animation: s-back 0.42s var(--ease) backwards; }
.enter-up      { animation: s-up 0.46s var(--ease) backwards; }

@keyframes s-fade    { from { opacity: 0; } }
@keyframes s-forward { from { opacity: 0; transform: translateX(28px); } }
@keyframes s-back    { from { opacity: 0; transform: translateX(-18px); } }
@keyframes s-up      { from { opacity: 0; transform: translateY(40px); } }

.pad {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.flow-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

/* ---------- Type ---------- */

.title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.subtitle { font-size: 14px; font-weight: 300; color: var(--text-2); opacity: 0.72; }
.subtitle-sm { font-size: 12.5px; font-weight: 300; color: var(--text-2); opacity: 0.72; margin-top: 2px; }

/* ---------- Inputs ---------- */

.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

.field {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--soft);
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text);
  transition: background 0.2s var(--ease);
}
.field::placeholder { color: var(--text-2); opacity: 0.45; }
.field:focus { background: var(--soft-strong); outline: none; }
.field:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* iPhone zooms into any text box smaller than 16px, so keep those at 16px there */
@supports (-webkit-touch-callout: none) {
  .field, .search input { font-size: 16px; }
}

.field-code {
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

/* Area dropdown */
.select-wrap { position: relative; }
.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  cursor: pointer;
}
.select.is-empty { color: var(--text-2); opacity: 0.55; }
.select-chev {
  position: absolute; right: 16px; top: 50%;
  margin-top: -9px;
  pointer-events: none; opacity: 0.55;
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 0 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary[disabled] { opacity: 0.5; pointer-events: none; }
/* A button inside the empty message sits in the middle, not at the left edge */
.btn-inline { width: auto; padding: 0 26px; margin: 18px auto 0; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 0 20px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  transition: transform 0.2s var(--ease);
}
.btn-secondary:active { transform: scale(0.98); }

.btn-danger {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 50px; margin-top: 18px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--danger);
  font-size: 14.5px; font-weight: 500;
  transition: transform 0.2s var(--ease);
}
.btn-danger:active { transform: scale(0.98); }

.btn-text {
  min-height: 44px;
  font-size: 13px; font-weight: 400;
  color: var(--text-2); opacity: 0.75;
}

.btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; margin-left: -4px;
  font-size: 14px; font-weight: 500;
  color: var(--text); opacity: 0.7;
}

.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 22px;
  color: var(--text); opacity: 0.6;
  transition: transform 0.2s var(--ease);
}
.btn-icon:active { transform: scale(0.92); }
.btn-icon-dim { opacity: 0.45; }

.btn-add {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 21px;
  background: var(--accent); color: var(--on-accent);
  transition: transform 0.2s var(--ease);
}
.btn-add:active { transform: scale(0.92); }

/* ---------- Brand mark ---------- */

.brand-mark { width: 40px; height: 40px; margin-bottom: 14px; color: var(--text-2); }
.brand-mark-sm { width: 28px; height: 28px; margin-bottom: 0; }
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* ---------- Home ---------- */

.home-top { display: flex; align-items: center; justify-content: space-between; }
.home-top-actions { display: flex; align-items: center; gap: 4px; }

.greeting { padding: 22px 0 16px; }

.search {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px;
  border-radius: var(--radius);
  background: var(--soft);
}
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  font-size: 14px; color: var(--text);
  -webkit-appearance: none;
}
.search input::placeholder { color: var(--text-2); opacity: 0.45; }
.search input::-webkit-search-cancel-button { display: none; }
.btn-clear { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; opacity: 0.45; }

.chips {
  display: flex; gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { flex-wrap: wrap; overflow: visible; margin-top: 8px; }

.chip {
  flex: none;
  min-height: 40px; padding: 0 15px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--text);
  font-size: 12.5px; font-weight: 400;
  white-space: nowrap;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.2s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip.is-on { background: var(--accent); color: var(--on-accent); font-weight: 500; }

/* ---------- Place list ---------- */

.list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.row {
  display: flex; align-items: center; gap: 13px;
  width: 100%;
  min-height: 64px; padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--soft);
  text-align: left;
  transition: transform 0.2s var(--ease);
}
.row:active { transform: scale(0.985); }

/* Rows glide in one after another when the list first appears */
.row-in { animation: row-in 0.55s var(--ease) backwards; }
@keyframes row-in { from { opacity: 0; transform: translateY(14px); } }

.row-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-sm);
  background: var(--soft-strong);
  color: var(--text-2);
}
.row-icon .ico { width: 17px; height: 17px; }

.row-text { flex: 1; min-width: 0; }
.row-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3;
}
.row-meta {
  display: block;
  font-size: 12px; font-weight: 400; margin-top: 2px;
  color: var(--text-2); opacity: 0.7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-chev { opacity: 0.3; }
.row-chev .ico { width: 15px; height: 15px; }

.list-empty { padding: 40px 0; text-align: center; font-size: 13px; font-weight: 300; opacity: 0.6; }

/* ---------- Empty state ---------- */

.empty { padding: 48px 0; text-align: center; }
.empty-title { font-size: 16px; font-weight: 500; }
.empty-note { font-size: 13px; font-weight: 300; color: var(--text-2); opacity: 0.72; margin-top: 6px; }

/* ---------- Detail ---------- */

.detail { display: flex; flex-direction: column; }
.detail-top { display: flex; align-items: center; justify-content: space-between; }
.detail-body { flex: 1; padding: 28px 0 24px; display: flex; flex-direction: column; gap: 26px; }

/* Icon tile above the name */
.detail-tile {
  width: 64px; height: 64px; margin-bottom: 18px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #231c07;
}
.detail-tile .ico { width: 28px; height: 28px; }

/* Facts sit in one soft card with thin lines between them */
.lines { display: flex; flex-direction: column; gap: 0; padding: 4px 18px; border-radius: var(--radius); background: var(--soft); }
.line { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 15px 0; }
.line + .line { border-top: 1px solid var(--soft-strong); }

/* Gentle entrance each time a place opens */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tile-pop {
  0%   { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  70%  { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: none; }
}
#screen-detail:not([hidden]) .rise { animation: rise 0.5s var(--ease) backwards; animation-delay: calc(var(--i) * 70ms + 100ms); }
#screen-detail:not([hidden]) .detail-tile { animation: tile-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; animation-delay: 0.15s; }
@media (prefers-reduced-motion: reduce) {
  #screen-detail .rise, #screen-detail .detail-tile { animation: none !important; }
}
.line dt { font-size: 13px; font-weight: 300; color: var(--text-2); opacity: 0.6; flex: none; }
.line dd { font-size: 14.5px; font-weight: 500; text-align: right; }

.detail-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Add form ---------- */

.add-form { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; }
.group-label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 8px; opacity: 0.85; }
.group-note { font-size: 12px; font-weight: 300; color: var(--text-2); opacity: 0.72; margin-top: 8px; }

/* ---------- Toasts: short notices inside the app ---------- */

.toasts {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 0; right: 0;
  z-index: 80;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: calc(100% - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
  box-shadow: 0 10px 30px rgba(35, 28, 7, 0.22);
  animation: toast-in 0.5s var(--ease) backwards;
}
.toast.is-leaving { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(-18px) scale(0.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(-10px) scale(0.97); } }

/* ---------- Confirmation sheet: slides up from the bottom ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
  background: transparent;
  transition: background 0.35s var(--ease);
}
.sheet-backdrop.is-open { background: var(--scrim); }

.sheet {
  width: 100%; max-width: 520px;
  padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--sheet-edge);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16);
  transform: translateY(100%);
  transition: transform 0.45s var(--ease);
}
.sheet-backdrop.is-open .sheet { transform: translateY(0); }
.sheet-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; text-align: center; }
.sheet-text { font-size: 13px; font-weight: 300; color: var(--text-2); opacity: 0.75; text-align: center; margin-top: 4px; }
.sheet .btn-secondary { margin-top: 8px; }


/* ---------- Sticky save bar on the add form ---------- */

.pad-flush-bottom { padding-bottom: 0; }

.sticky-bar {
  position: sticky; bottom: 0;
  margin: 0 -22px;
  padding: 18px 22px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: linear-gradient(to bottom, transparent, var(--bg) 18px);
}

/* ---------- Loading placeholders: soft rows that pulse until places arrive ---------- */

.skeleton { pointer-events: none; animation: sk-pulse 1.5s ease-in-out infinite; }
.sk-line { display: block; height: 10px; border-radius: 6px; background: var(--soft-strong); }
.sk-line + .sk-line { margin-top: 8px; }
.sk-w70 { width: 70%; }
.sk-w45 { width: 45%; }
@keyframes sk-pulse { 50% { opacity: 0.5; } }

/* ---------- Loading ---------- */

.loading {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}


/* ---------- Landing page and install steps ---------- */

.landing { display: flex; flex-direction: column; gap: 30px; padding-top: calc(env(safe-area-inset-top, 0px) + 40px); }
.brand-mark-lg { width: 54px; height: 54px; margin-bottom: 18px; }
.title-lg { font-size: 28px; }
.landing-hero .subtitle { margin-top: 10px; font-size: 14px; max-width: 36ch; }

.brand-mark-hero { width: 120px; height: 120px; margin-bottom: 20px; }
.brand-mark-hero svg { overflow: visible; }
.brand-mark-hero svg > circle { animation: crumb-drift 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.brand-mark-hero svg > circle:nth-of-type(3n)   { animation-delay: -0.8s; }
.brand-mark-hero svg > circle:nth-of-type(3n+1) { animation-delay: -1.6s; }
.brand-mark-hero svg > circle:nth-of-type(3n+2) { animation-delay: -2.4s; }
@keyframes crumb-drift {
  0%, 100% { transform: translate(0, 0); opacity: 1; }
  50%      { transform: translate(5px, -7px); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) { .brand-mark-hero svg > circle { animation: none; } }

.hero-line { margin-top: 14px; font-size: 14.5px; font-weight: 500; line-height: 1.5; max-width: 34ch; }
.landing-hero .btn-primary { margin-top: 22px; }
.landing-hero .fine { margin-top: 10px; text-align: center; }

.honest { padding: 18px; border-radius: var(--radius); background: var(--soft); display: flex; flex-direction: column; gap: 10px; }
.honest-text { font-size: 13.5px; font-weight: 300; line-height: 1.6; color: var(--text-2); }

.how { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.how li { display: flex; gap: 14px; align-items: flex-start; }
.how-n {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--soft-strong);
  font-size: 12.5px; font-weight: 500;
}
.how-t { font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.how-d { font-size: 13px; font-weight: 300; color: var(--text-2); opacity: 0.75; margin-top: 2px; }

.install { display: flex; flex-direction: column; gap: 14px; }
.section-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.install .chips { margin-top: 0; }

.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.55; }
.steps li::before {
  content: counter(step);
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--soft-strong);
  font-size: 12px; font-weight: 500;
}
.step-text { flex: 1; min-width: 0; padding-top: 2px; }
.step-text b { font-weight: 600; }
.landing-foot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 8px; }
.inline-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }

.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--soft); font-size: 12.5px; line-height: 1.5; }
.fine { font-size: 12px; font-weight: 300; color: var(--text-2); opacity: 0.72; line-height: 1.5; }
.strong { font-weight: 500; opacity: 1; }

/* ---------- Login code: one box per digit ---------- */

.otp { position: relative; margin: 8px 0 0; }
.otp-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; background: transparent;
  font-size: 16px; color: transparent; caret-color: transparent;
}
.otp-boxes { display: flex; gap: 6px; pointer-events: none; }
.otp-box {
  position: relative;
  flex: 1; max-width: 46px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--soft);
  font-size: 20px; font-weight: 500;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.otp-box:nth-child(4) { margin-right: 8px; }
.otp-box.is-filled { background: var(--soft-strong); }
.otp.is-focused .otp-box.is-active { background: var(--soft-strong); box-shadow: inset 0 0 0 1.5px var(--text); }
.otp.is-focused .otp-box.is-active:not(.is-filled)::after {
  content: ''; width: 2px; height: 22px; background: var(--text);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.otp.is-error { animation: shake 0.4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.otp-status { min-height: 20px; text-align: center; font-size: 12.5px; font-weight: 300; color: var(--text-2); opacity: 0.8; }
.btn-text[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- Paste button inside the link field ---------- */

.field-wrap { position: relative; }
.field-wrap .field { padding-right: 84px; }
.field-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 38px; padding: 0 14px;
  border-radius: 10px;
  background: var(--soft-strong);
  font-size: 12.5px; font-weight: 500;
}
.field-action:active { transform: translateY(-50%) scale(0.96); }

/* ---------- Selecting several places ---------- */

.greeting-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.btn-select { font-size: 13.5px; font-weight: 500; opacity: 0.85; padding: 0 2px; }

.row-check {
  display: none; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--text-2);
  opacity: 0.45;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.row-check .ico { width: 13px; height: 13px; stroke-width: 2.6; opacity: 0; }

.is-selecting .row-check { display: flex; }
.is-selecting .row-chev { display: none; }
.is-selecting .list { padding-bottom: 96px; }

.row.is-selected { background: var(--soft-strong); }
.row.is-selected .row-check { background: var(--accent); border-color: var(--accent); opacity: 1; color: var(--on-accent); }
.row.is-selected .row-check .ico { opacity: 1; }

.select-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px 22px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--bg);
  border-top: 1px solid var(--sheet-edge);
  animation: s-up 0.4s var(--ease) backwards;
}
.select-bar-inner { max-width: 520px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.btn-delete {
  min-height: 46px; padding: 0 24px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--danger);
  font-size: 14px; font-weight: 500;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn-delete:active { transform: scale(0.97); }
.btn-delete[disabled] { opacity: 0.4; pointer-events: none; }


/* ---------- Filter chips with a dropdown arrow, and the picker list ---------- */

.chip .chev { width: 12px; height: 12px; margin-left: 5px; vertical-align: -1px; opacity: 0.6; stroke-width: 2.2; }

.pick-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; margin: 10px 0 8px; }
.pick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; text-align: left;
  transition: background 0.2s var(--ease);
}
.pick-row:active { background: var(--soft); }
.pick-row.is-on { background: var(--soft-strong); font-weight: 600; }
.pick-count { font-size: 12.5px; font-weight: 400; opacity: 0.55; }

/* ---------- Share button in the select bar ---------- */

.select-bar-actions { display: flex; align-items: center; gap: 8px; }
.btn-share {
  min-height: 46px; padding: 0 20px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn-share:active { transform: scale(0.97); }
.btn-share[disabled] { opacity: 0.4; pointer-events: none; }


/* ---------- Maps and Waze buttons ---------- */

.nav-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nav-row .btn-primary, .nav-row .btn-secondary { min-height: 50px; padding: 0 14px; }

/* ---------- Toast with an Undo button ---------- */

.toast.has-action { display: flex; align-items: center; gap: 10px; padding-right: 8px; pointer-events: auto; }
.toast-action {
  min-height: 34px; padding: 0 12px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Pick for me: a single reel ---------- */

.greeting-actions { display: flex; align-items: center; gap: 14px; }

.sheet .btn-primary { margin-top: 18px; }

.reel { position: relative; height: 84px; margin: 18px 0 6px; border-radius: var(--radius); background: var(--soft); overflow: hidden; }
.reel-window {
  height: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 76%, transparent 100%);
}
.reel-strip { will-change: transform; }
.reel-item {
  height: 84px; padding: 0 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em; text-align: center;
  transition: filter 0.3s var(--ease);
}
.reel-item span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reel.is-spinning .reel-item { filter: blur(1.5px); }
.reel-meta { min-height: 20px; text-align: center; font-size: 12.5px; font-weight: 300; color: var(--text-2); opacity: 0.8; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- Filters sheet ---------- */

.chip .ico { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sheet-head .sheet-title { text-align: left; }
.sheet-head .btn-text { min-height: 44px; font-size: 13.5px; font-weight: 500; }

.filter-lines { margin: 4px 0 6px; }
.filter-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 54px;
  border-top: 1px solid var(--soft-strong);
  font-size: 14px; text-align: left;
}
.filter-line:first-child { border-top: 0; }
.filter-block { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 14px 0; }
.filter-block .chips { margin-top: 4px; }
.filter-value { display: flex; align-items: center; gap: 4px; font-size: 13.5px; opacity: 0.7; }

.switch {
  position: relative; flex: none;
  width: 46px; height: 28px; border-radius: 14px;
  background: var(--soft-strong);
  transition: background 0.25s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ---------- Area field and the full-screen area search ---------- */

.field-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.field-button .ico { opacity: 0.55; }
.field-button.is-empty span { opacity: 0.55; }

.fullpicker {
  position: fixed; inset: 0; z-index: 75;
  display: flex; justify-content: center;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 22px 0;
  transform: translateY(100%);
  transition: transform 0.45s var(--ease);
}
.fullpicker.is-open { transform: translateY(0); }
.fullpicker-inner { display: flex; flex-direction: column; width: 100%; max-width: 520px; min-height: 0; }
.fullpicker-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fullpicker-title { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.fullpicker-spacer { width: 64px; }

.area-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin-top: 8px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.area-group { padding: 16px 4px 6px; font-size: 12px; font-weight: 500; color: var(--text-2); opacity: 0.65; }
.area-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; text-align: left;
  transition: background 0.2s var(--ease);
}
.area-row:active { background: var(--soft); }
.area-row.is-on { background: var(--soft-strong); font-weight: 600; }
.area-custom { color: var(--text); font-weight: 500; background: var(--soft); margin-bottom: 4px; }
.area-count { font-size: 12.5px; opacity: 0.55; }
.area-empty { padding: 40px 0; text-align: center; font-size: 13px; font-weight: 300; opacity: 0.6; }


/* ---------- Welcome animation ----------
   About 2.4 seconds: the name appears, the B zooms in, a bite is taken, crumbs fly, then it fades away.
   Tapping skips it. It is not shown when switched off, after a share, or when the phone asks for less motion. */

.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  animation: splash-out 0.4s var(--ease) 2.05s forwards;
}
[data-splash="off"] .splash { display: none; }
@keyframes splash-out { to { opacity: 0; transform: scale(1.06); visibility: hidden; } }

.splash-inner { display: grid; place-items: center; }
.splash-inner > * { grid-area: 1 / 1; }

.splash-words { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: sp-words-out 0.32s var(--ease) 0.72s forwards; }
.splash-name { font-size: 34px; font-weight: 600; letter-spacing: -0.035em; animation: sp-name 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s backwards; }
.splash-tag { font-size: 13px; font-weight: 300; color: var(--text-2); opacity: 0.75; animation: sp-tag 0.55s var(--ease) 0.2s backwards; }
@keyframes sp-name { from { opacity: 0; transform: translateY(18px) scale(0.92); } }
@keyframes sp-tag { from { opacity: 0; transform: translateY(8px); } }
@keyframes sp-words-out { to { opacity: 0; transform: scale(1.18); } }

.splash-logo { width: 176px; height: 176px; overflow: visible; color: var(--text-2); }
.splash-logo * { transform-box: fill-box; transform-origin: center; }
.sp-b { fill: currentColor; }

/* The B zooms in from large and settles with a small bounce */
.sp-in { animation: sp-in 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) 0.78s backwards; }
@keyframes sp-in { from { opacity: 0; transform: scale(2.4); } }

/* A chunk is bitten out: round cut-outs pop in one after another, and the letter squashes slightly */
.sp-chomp { animation: sp-chomp 0.5s ease-in-out 1.22s backwards; }
@keyframes sp-chomp { 35% { transform: scale(0.93, 0.96); } 70% { transform: scale(1.03, 1.02); } }
.sp-bite { fill: var(--bg); animation: sp-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; animation-delay: calc(1.2s + var(--d)); }
@keyframes sp-pop { from { transform: scale(0); } }

/* Crumbs fly out from the bite */
.sp-crumb { fill: currentColor; animation: sp-fly 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15) backwards; }
@keyframes sp-fly { from { opacity: 0; transform: translate(calc(var(--fx) * 1px), calc(var(--fy) * 1px)) scale(0); } 25% { opacity: 1; } }
.sp-chip { fill: currentColor; }
.sp-chipdot { fill: #f3b391; }

/* ---------- Settings: a row with a switch ---------- */
.setting-line { min-height: 48px; }


/* ---------- Privacy page ---------- */

.prose { margin-top: 18px; }
.prose h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin: 22px 0 6px; }
.prose p { font-size: 13.5px; font-weight: 300; line-height: 1.65; color: var(--text-2); opacity: 0.9; }
.prose-link { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: var(--text); }

.btn-text-danger { color: var(--danger); opacity: 1; }
.otp-hint { text-align: center; }

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