/* Reset, typography and app shell. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.icon { flex: none; display: block; }

/* Shell */
.app {
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  /* Cards thrown off-screen (swipe deck) must not widen the page: on Android that resets the scroll. */
  overflow-x: clip;
}
.screen {
  padding: 0 var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
  animation: screen-in .28s var(--ease);
}
.screen--bleed { padding-left: 0; padding-right: 0; }
.screen--plain { padding-bottom: 24px; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) var(--gutter) 14px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__mark { width: 32px; height: 20px; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 29px; letter-spacing: -.01em; color: var(--ink); line-height: 1; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--green-100);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Bottom tab bar */
.tabbar {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 100%; max-width: 520px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 10px 16px calc(10px + var(--safe-bottom));
  align-items: start;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.tabbar__item {
  justify-self: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 64px; height: 48px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 9.5px; font-weight: 500;
  transition: background .2s, color .2s;
}
.tabbar__item[aria-current="page"] { background: var(--primary); color: var(--primary-ink); font-weight: 700; }

/* Typography */
.display { font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-display); line-height: 1.06; letter-spacing: -.015em; color: var(--ink); }
.display--hero { font-size: 36px; line-height: 1.04; }
.title { font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-title); line-height: 1.15; color: var(--ink); }
.title--sm { font-size: 20px; }
.lead { margin-top: 10px; font-size: var(--fs-sm); color: var(--muted); }
.label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.label small, .optional { font-weight: 500; color: var(--muted); font-size: inherit; }
.hint { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); }
.serif { font-family: var(--font-serif); }

.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.section { margin-top: 28px; }
.section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); white-space: nowrap; margin-top: 8px; font-weight: 500; color: var(--ink-soft); }
.link--primary { color: var(--primary); font-weight: 600; }

/* Loading text that shimmers like AI assistants do while thinking. */
.shimmer-text {
  background: linear-gradient(100deg, var(--muted) 0%, var(--muted) 38%, var(--ink) 50%, var(--muted) 62%, var(--muted) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer-text 1.8s linear infinite;
}
@keyframes shimmer-text { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* Skeleton blocks */
.skeleton {
  background: linear-gradient(100deg, var(--surface-muted) 30%, var(--bg) 50%, var(--surface-muted) 70%);
  background-size: 300% 100%;
  animation: shimmer-text 1.6s linear infinite;
  border-radius: var(--radius);
}

.sync-note { display: flex; align-items: center; gap: 6px; margin-top: 24px; font-size: 10px; color: var(--muted); }
.sync-note::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

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

/* Breathing room between consecutive text blocks (zero specificity, so .stack and component rules still win). */
:where(p, .hint) + :where(p, .hint) { margin-top: 8px; }
:where(.field) > :where(.hint) { margin-top: 6px; }
:where(.select-row__body, .lodging-row__body) { gap: 4px; }
