:root {
  --paper: #e8dcc8;
  --paper-2: #f3ead8;
  --ink: #2a241c;
  --muted: #6b5e4e;
  --stroke: rgba(42, 36, 28, 0.12);
  --card: rgba(255, 250, 240, 0.78);
  --pro: #8b4513;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}
.paper {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(800px 400px at 10% -10%, rgba(255,255,255,0.45), transparent 55%),
    radial-gradient(600px 380px at 100% 0%, rgba(180,140,90,0.12), transparent 50%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(42,36,28,0.015) 3px, rgba(42,36,28,0.015) 4px);
}
.shell {
  position: relative; z-index: 1;
  width: min(560px, 100%);
  margin: 0 auto;
  padding:
    max(18px, calc(env(safe-area-inset-top, 0px) + 12px))
    max(14px, env(safe-area-inset-right, 0px))
    max(40px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
}
.top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 6px;
}
.mark {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sub { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.refresh {
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--ink);
  font: 650 0.85rem var(--sans);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.updated {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.status {
  background: #fff4e0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}
.block { margin-bottom: 22px; }
.block h2 {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 650;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.list { display: flex; flex-direction: column; gap: 10px; }
.empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 12px 14px;
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  background: rgba(255,250,240,0.4);
}
.card {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 12px 12px 14px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.card:active { transform: scale(0.99); }
.card.is-static { cursor: default; }
.meta { min-width: 0; }
.eta {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 4px;
}
.name {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.25;
}
.lines {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
  line-height: 1.3;
}
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.55);
}
.chip.carrier-ups { background: #5b4637; color: #fff; border-color: transparent; }
.chip.carrier-fedex { background: #4d148c; color: #fff; border-color: transparent; }
.chip.carrier-usps { background: #004b87; color: #fff; border-color: transparent; }
.chip.carrier-amazon { background: #232f3e; color: #ff9900; border-color: transparent; }
.chip.pro {
  background: #fff;
  color: var(--pro);
  border-color: rgba(139,69,19,0.35);
}
.thumb {
  width: 88px; height: 88px;
  border-radius: 12px;
  background: rgba(42,36,28,0.06);
  border: 1px solid var(--stroke);
  object-fit: cover;
  display: grid; place-items: center;
  font-size: 1.8rem;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 11px;
}
.foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}
@media (min-width: 700px) {
  .shell { width: min(720px, 100%); padding-top: 28px; }
  .eta { font-size: 1.55rem; }
  .card { grid-template-columns: 1fr 104px; padding: 14px 14px 14px 16px; }
  .thumb { width: 104px; height: 104px; }
}

/* Auth / login */
.top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.signout {
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--muted);
  font: 600 0.8rem var(--sans);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.userline {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  /* svh = visible phone screen; 100vh on iOS is taller than the fold */
  min-height: 100svh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding:
    max(48px, calc(env(safe-area-inset-top, 0px) + 56px))
    max(16px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.login-screen[hidden],
.shell[hidden] {
  display: none !important;
}
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(42, 36, 28, 0.08);
}
.login-mark {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.login-sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
  line-height: 1.35;
}
.google-btn-host {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-bottom: 12px;
}
.login-hint, .login-status {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 8px;
}
.login-status {
  background: #fff4e0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
}
.btn-google-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  font: 650 0.92rem var(--sans);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  width: 100%;
}
.btn-google-fallback[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
