/* Reset, page frame, navigation. Nothing screen-specific lives here. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }
.small { font-size: 0.8rem; }
.empty { color: var(--muted); padding: 1.2rem 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---- frame ---- */
.topbar { max-width: 760px; margin: 0 auto; padding: 18px var(--gutter) 4px; }
.brand-mark { font-family: var(--display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark .dot { color: var(--primary); }
.brand-sub { display: block; color: var(--muted); font-size: 0.85rem; margin-top: -2px; }

main { max-width: 760px; margin: 0 auto; padding: 8px var(--gutter) calc(var(--tabbar-h) + 48px); }
.view { display: none; }
.view.active { display: block; animation: rise 0.3s ease both; }

.page-head { margin: 14px 0 16px; }
.page-head h1 { font-family: var(--display); font-size: 1.9rem; line-height: 1.15; letter-spacing: -0.01em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.sec { font-size: 1.1rem; margin: 26px 0 10px; }

/* ---- tab bar: bottom on phone, left rail on desktop ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--tabbar-h);
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(60, 40, 20, .06); padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; color: var(--muted); font-size: 0.72rem; font-weight: 500; cursor: pointer;
  min-height: 48px; position: relative;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--primary); font-weight: 600; }
.tab.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
body.in-trip .tabbar { display: none; }
body.in-trip main { padding-bottom: 130px; }

@media (min-width: 900px) {
  .tabbar { top: 0; bottom: 0; right: auto; width: 200px; height: auto; flex-direction: column; justify-content: flex-start;
    padding: 124px 12px 0; gap: 4px; border-top: none; border-right: 1px solid var(--line); box-shadow: none; }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 0.95rem; padding: 10px 14px; border-radius: var(--r-pill); }
  .tab.active { background: var(--tint-red); }
  .tab.active::before { display: none; }
  .topbar { position: fixed; left: 0; top: 0; width: 200px; margin: 0; padding: 24px 20px; z-index: 51; pointer-events: none; }
  main { margin-left: max(200px, calc((100vw - 760px) / 2 + 100px)); margin-right: auto; }
  main { padding-bottom: 80px; }
  body.in-trip .topbar { position: static; width: auto; max-width: 760px; margin: 0 auto; padding: 18px var(--gutter) 4px; }
  body.in-trip main { margin-left: auto; margin-right: auto; }
}
