:root {
  color-scheme: light;
  --primary: #075985;
  --primary-strong: #0c4a6e;
  --primary-soft: #e0f2fe;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --surface: #ffffff;
  --background: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #cbd5e1;
  --focus: #0284c7;
  --shadow: 0 10px 28px rgb(15 23 42 / 0.09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background: var(--background); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
.skip-link { position: fixed; left: 16px; top: -64px; z-index: 1000; padding: 12px 16px; color: #fff; background: var(--primary-strong); border-radius: 10px; }
.skip-link:focus { top: 16px; }
.app-shell { min-height: 100vh; }
.app-main { width: min(100%, 1120px); min-height: 100vh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
.boot-state, .state-card { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.state-card { min-height: auto; margin: 12vh auto 0; padding: 32px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.state-card h1 { max-width: 20ch; margin: 0; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.15; }
.state-card p { max-width: 34ch; margin: 0; color: var(--text-muted); line-height: 1.55; }
.brand-mark { display: grid; width: 64px; height: 64px; place-items: center; color: #fff; background: var(--primary); border-radius: 18px; font-size: 1.25rem; font-weight: 800; letter-spacing: .08em; }
.spinner { width: 32px; height: 32px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.app-header { position: sticky; top: 0; z-index: 20; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: rgb(255 255 255 / .95); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.bottom-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--surface); border-top: 1px solid var(--border); }
.toast-root { position: fixed; z-index: 80; inset: auto 16px calc(88px + env(safe-area-inset-bottom)); pointer-events: none; }
.header-inner { width: min(100%, 1088px); margin: auto; display: flex; align-items: center; gap: 12px; }
.header-inner strong, .header-inner small { display: block; }
.header-inner small { margin-top: 2px; color: var(--text-muted); font-size: .8rem; }
.brand-mini { display: grid; width: 40px; height: 40px; place-items: center; flex: 0 0 auto; color: #fff; background: var(--primary); border-radius: 12px; font-size: .8rem; font-weight: 800; }
.login-page { min-height: calc(100vh - 64px); display: grid; place-items: center; }
.login-card { width: min(100%, 430px); display: grid; gap: 24px; padding: 28px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.login-card h1, .welcome h1, .content-page h1 { margin: 4px 0 8px; line-height: 1.15; }
.eyebrow { margin: 0; color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .1em; }
.muted, .welcome p, .profile-card p { margin: 0; color: var(--text-muted); }
form { display: grid; gap: 8px; }
form label { margin-top: 8px; font-weight: 700; }
form textarea { width: 100%; padding: 14px 15px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 13px; resize: vertical; }
form input { width: 100%; min-height: 54px; padding: 0 15px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 13px; }
form select { width: 100%; min-height: 54px; padding: 0 15px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 13px; }
form input:focus { border-color: var(--focus); }
.form-error { min-height: 24px; margin: 4px 0; color: var(--danger); font-weight: 650; }
.primary-button, .secondary-button { min-height: 56px; display: inline-grid; place-items: center; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 800; text-decoration: none; cursor: pointer; transition: background-color .18s ease, opacity .18s ease; }
.primary-button { color: #fff; background: var(--primary); }
.primary-button:hover { background: var(--primary-strong); }
.primary-button:disabled { opacity: .58; cursor: wait; }
.secondary-button { color: var(--danger); background: #fff; border: 1px solid #fecaca; }
.work-form { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.secondary-link, .outline-button { min-height: 52px; display: grid; place-items: center; color: var(--primary); background: #fff; border: 1px solid var(--primary); border-radius: 14px; font-weight: 800; text-decoration: none; cursor: pointer; }
.machine-badge { display: inline-block; margin: 10px 0 0; padding: 8px 12px; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; font-weight: 800; }
.photo-preview { width: 100%; max-height: 260px; object-fit: cover; margin-top: 8px; border-radius: 14px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.primary-button.compact { min-height: 46px; padding-inline: 14px; }
.trip-card { display: grid; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 14px rgb(15 23 42 / .06); }
.trip-card h2, .trip-card p { margin: 0; }.trip-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 0; }.trip-card dt { color: var(--text-muted); font-size: .8rem; }.trip-card dd { margin: 3px 0 0; font-weight: 800; }
.status-pill { width: fit-content; padding: 5px 9px; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; font-size: .78rem; font-weight: 800; }
.action-main { width: 100%; min-height: 68px; font-size: 1.08rem; }.quick-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }.quick-grid a { min-height: 64px; display: grid; place-items: center; padding: 8px; color: var(--primary); background: #fff; border: 1px solid var(--border); border-radius: 14px; text-align: center; font-size: .8rem; font-weight: 800; text-decoration: none; }
.trip-list { display: grid; gap: 12px; }.filter-row { display: flex; gap: 8px; overflow-x: auto; }.filter-row button { flex: 0 0 auto; min-height: 42px; padding: 0 12px; color: var(--primary); background: #fff; border: 1px solid var(--border); border-radius: 999px; }.two-cols { display:grid;grid-template-columns:1fr 1fr;gap:12px}.success-panel{padding:16px;color:var(--success);background:#dcfce7;border-radius:14px;font-weight:800}
.metric-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.metric-card{padding:18px;background:#fff;border:1px solid var(--border);border-radius:var(--radius)}.metric-card span,.metric-card strong{display:block}.metric-card span{color:var(--text-muted);font-size:.84rem}.metric-card strong{margin-top:8px;font-size:1.8rem}
.proof-field{display:grid;gap:8px;padding:16px;background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;font-weight:800}.proof-field input{padding:10px;background:#fff;border:1px solid var(--border);border-radius:10px}
.home-page, .content-page { display: grid; gap: 24px; }
.welcome { padding: 8px 2px; }
.action-list { display: grid; gap: 12px; }
.action-card { min-height: 76px; display: grid; grid-template-columns: 44px 1fr 24px; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 14px rgb(15 23 42 / .06); text-decoration: none; }
.action-card svg { width: 28px; height: 28px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action-card strong, .action-card small { display: block; }
.action-card small { margin-top: 4px; color: var(--text-muted); }
.action-card.is-disabled { opacity: .62; box-shadow: none; }
.chevron { color: var(--text-muted); font-size: 1.8rem; }
.bottom-nav a { min-height: 58px; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--text-muted); border-radius: 12px; font-size: .72rem; font-weight: 700; text-decoration: none; }
.bottom-nav a[aria-current] { color: var(--primary); background: var(--primary-soft); }
.bottom-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-card { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.avatar { display: grid; width: 56px; height: 56px; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-size: 1.4rem; font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (min-width: 768px) { .app-main { padding-inline: 32px; } .state-card, .login-card { padding: 40px; } .action-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
