/* Wai Sense — visual refresh (v4.19.0), loaded after sense-ui.css.
 * Idea: a trail app at night. Ridge-blue ground, contour lines in the background, trail-blaze orange from the logo for
 * the one thing to do next. Archivo (wide cut for headings and numbers, like trail signs), sentence case, readable sizes.
 * Wide screens get a side navigation and a centred page; phones keep the bottom tab bar. */

@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url('../fonts/archivo/archivo-latin-ext-wdth-normal.woff2') format('woff2-variations'), url('../fonts/archivo/archivo-latin-ext-wdth-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url('../fonts/archivo/archivo-latin-wdth-normal.woff2') format('woff2-variations'), url('../fonts/archivo/archivo-latin-wdth-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg-navy: #0b1422;          /* ground */
  --card-navy: #111d30;        /* page panel */
  --card-hover: #18273f;
  --raised: #16243a;           /* cards inside the page */
  --border-color: rgba(159, 195, 232, 0.12);
  --text-main: #eaf0f7;
  --text-muted: #93a3b8;       /* 7:1 on the ground — was #64748b */
  --accent-amber: #ff9a3c;     /* trail blaze */
  --accent-cyan: #8fd3f0;      /* glacier */
  --accent-emerald: #4cc38a;   /* moss */
  --accent-rose: #ff5d5d;
  --accent-indigo: #8b93ff;
  --accent: var(--accent-amber);
  --accent-rgb: 255, 154, 60;
  --on-accent: #1a0d00;
  --font-sans: 'Archivo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Archivo', 'Inter', system-ui, sans-serif;   /* numbers use tabular figures instead of a code font */
  --rail-w: 244px;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
}
body[data-page="sos"] { --accent: var(--accent-rose); --accent-rgb: 255, 93, 93; --on-accent: #fff; }
body[data-page="wearables"] { --accent: var(--accent-cyan); --accent-rgb: 143, 211, 240; --on-accent: #06202c; }
body[data-page="space"], body[data-page="report"] { --accent: var(--accent-indigo); --accent-rgb: 139, 147, 255; --on-accent: #0b0d2e; }
html[data-theme="midnight"] { --bg-navy: #060b14; --card-navy: #0c1524; --card-hover: #121e33; --raised: #101b2d; }
html[data-theme="forest"] { --bg-navy: #08170f; --card-navy: #0e2219; --card-hover: #143024; --raised: #122a1f; }
html[data-theme="ocean"] { --raised: #0b3552; }
html[data-theme="wht"], html[data-theme="apple"], html[data-theme="pearl"], html[data-theme="sky"], html[data-theme="ice"], html[data-theme="sand"] {
  --raised: #f4f7fb; --text-muted: #4f5f75; --accent-amber: #d96b00; --accent-rgb: 217, 107, 0; --on-accent: #fff;
}

/* ---- ground: contour lines ---- */
body.sd {
  font-size: 15px; line-height: 1.45; font-family: var(--font-sans);
  background-color: var(--bg-navy);
  background-image: url('../img/topo.svg');
  background-size: 1600px auto; background-position: 50% -120px; background-repeat: repeat;
  background-attachment: fixed;
  font-feature-settings: 'tnum' 1;
}
body.sd::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg-navy); opacity: 0.93; }
html[data-theme="wht"] body.sd::before, html[data-theme="apple"] body.sd::before, html[data-theme="pearl"] body.sd::before,
html[data-theme="sky"] body.sd::before, html[data-theme="ice"] body.sd::before, html[data-theme="sand"] body.sd::before { opacity: 0.88; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- page ---- */
.app-shell { align-self: center; border-radius: 26px; padding: 22px; gap: 18px; background: var(--card-navy); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6); }
@media (max-width: 480px) { .app-shell { border-radius: 0; padding: 18px 16px; } }
.header { padding-bottom: 14px; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; box-shadow: none; }
.brand-title { font-size: 1.2rem; font-weight: 750; font-stretch: 112%; letter-spacing: -0.01em; }
.brand-subtitle { font-family: var(--font-sans); font-size: 0.78rem; text-transform: none; letter-spacing: 0; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; padding: 4px 11px; }

/* ---- type sizes: was 9–12 px in many places ---- */
.label { font-size: 0.82rem; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-bottom: 8px; }
.head-title { font-size: 1rem; font-weight: 700; }
.head-sub { font-size: 0.82rem; line-height: 1.45; }
.src { font-family: var(--font-sans); font-size: 0.72rem; }
.link { font-size: 0.8rem; color: var(--accent-cyan); }
.notice { font-size: 0.86rem; line-height: 1.5; border-radius: var(--r-md); padding: 12px 14px; }
.insight-title { font-size: 0.86rem; }
.insight-text { font-size: 0.86rem; line-height: 1.5; }
.card-title { font-size: 0.95rem; }
.empty { font-family: var(--font-sans); font-size: 0.88rem; line-height: 1.5; padding: 18px 8px; }
.foot { font-size: 0.78rem; }

/* ---- cards: one level inside the page, quieter edges ---- */
.card, .form-card, .live-card, .plan, .state-banner, .stage { background: var(--raised); border-color: var(--border-color); border-radius: 18px; }
.card { padding: 16px; gap: 12px; }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 20px;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.16), rgba(143, 211, 240, 0.06) 70%), var(--raised);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.hero::after { content: ''; position: absolute; inset: 0; background: url('../img/topo.svg') 70% 30% / 900px auto; opacity: 0.09; pointer-events: none; -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 80%); mask-image: linear-gradient(100deg, transparent 35%, #000 80%); }
.hero > * { position: relative; z-index: 1; }
.hero-actions { grid-template-columns: 1fr auto; }
.hero-actions .btn { white-space: nowrap; }
.hero-tag { font-size: 0.8rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.hero-title { font-size: 1.45rem; font-weight: 750; font-stretch: 115%; line-height: 1.2; letter-spacing: -0.015em; }

/* ---- numbers ---- */
.stat { background: var(--raised); border-radius: var(--r-md); padding: 12px 10px; }
.stat .val { font-family: var(--font-sans); font-stretch: 110%; font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.15; }
@media (max-width: 480px) { .stat .val { font-size: 1.12rem; font-stretch: 104%; } }
.stat .val small { font-size: 0.75rem; }
.stat .lbl { font-size: 0.74rem; font-weight: 550; text-transform: none; }
.state-label { font-size: 0.74rem; text-transform: none; letter-spacing: 0; }
.plan-price { font-family: var(--font-sans); font-stretch: 115%; }
.kv { font-size: 0.86rem; background: var(--raised); }
.kv .v { font-family: var(--font-sans); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.item { background: var(--raised); border-radius: var(--r-md); padding: 12px 14px; }
.item-title { font-size: 0.9rem; }
.item-meta { font-family: var(--font-sans); font-size: 0.78rem; }
.badge, .live-badge, .ribbon { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }
.badge { font-size: 0.72rem; }
.live-badge { font-size: 0.8rem; }

/* ---- controls ---- */
.btn { font-size: 0.88rem; font-weight: 650; border-radius: 12px; min-height: 44px; padding: 10px 14px; background: rgba(159, 195, 232, 0.07); }
.btn svg { width: 16px; height: 16px; }
.btn.sm { font-size: 0.8rem; min-height: 36px; padding: 7px 12px; }
.btn.tall { font-size: 0.95rem; padding: 15px; }
.btn.primary, .btn.go { font-weight: 750; }
.btn.go { background: var(--accent-emerald); border-color: var(--accent-emerald); color: #04170d; }
.btn-sub { font-size: 0.78rem; }
.chip { font-size: 0.8rem; padding: 7px 13px; background: transparent; }
.chip.active { background: rgba(var(--accent-rgb), 0.16); border-color: rgba(var(--accent-rgb), 0.7); color: var(--text-main); }
.actsel .chip { font-size: 0.76rem; }
.field > span { font-size: 0.78rem; text-transform: none; }
.input, .select, .textarea { font-size: 0.92rem; padding: 10px 12px; background: var(--bg-navy); border-radius: var(--r-sm); }
@media (pointer: coarse) { .input, .select, .textarea, .search input { font-size: 16px; } } /* iPhone zooms into smaller inputs */
.search { background: var(--bg-navy); }
.search input { font-size: 0.92rem; }
.module { background: var(--raised); border-radius: var(--r-md); padding: 12px; }
.module-title { font-size: 0.9rem; }
.module-sub { font-size: 0.78rem; }
.legal { font-size: 0.75rem; background: var(--raised); }
.toast { font-size: 0.88rem; }
.modal h3 { font-size: 1.1rem; font-stretch: 112%; }
.modal p { font-size: 0.88rem; }

/* ---- bottom tab bar (phones, tablets) ---- */
.tab { font-size: 0.7rem; font-weight: 650; }
.tab.go .go-btn { background: var(--accent-amber); color: var(--on-accent); font-stretch: 120%; font-weight: 800; box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.38); }
.tab.active, .tab.go.active span.t { color: var(--accent-amber); }
.ai-fab { background: var(--card-hover); color: var(--accent-amber); border: 1px solid rgba(var(--accent-rgb), 0.45); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); font-stretch: 115%; }

/* ---- side navigation (wide screens) ---- */
.rail { display: none; }
@media (min-width: 1024px) {
  body.sd { padding-left: var(--rail-w); }
  .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); z-index: 70;
    padding: 18px 14px; background: color-mix(in srgb, var(--card-navy) 94%, transparent); border-right: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow-y: auto;
  }
  .rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 750; font-stretch: 115%; font-size: 1.08rem; color: var(--text-main); }
  .rail-brand img { border-radius: 10px; }
  .rail-go { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; background: var(--accent-amber); color: var(--on-accent) !important; font-weight: 750; font-size: 0.92rem; box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.3); }
  .rail-go:hover { filter: brightness(1.06); }
  .rail-go-dot { width: 30px; height: 30px; border-radius: 10px; background: rgba(0, 0, 0, 0.16); display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 850; font-stretch: 125%; }
  .rail-nav { display: flex; flex-direction: column; gap: 2px; }
  .rail-low { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-color); }
  .rail-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--text-muted); font-weight: 600; font-size: 0.92rem; }
  .rail-link svg { width: 18px; height: 18px; flex-shrink: 0; }
  .rail-link:hover { background: rgba(159, 195, 232, 0.07); color: var(--text-main); }
  .rail-link.on { background: rgba(var(--accent-rgb), 0.13); color: var(--text-main); box-shadow: inset 3px 0 0 var(--accent-amber); }
  .rail-link.on svg { color: var(--accent-amber); }
  .rail-link.sos { color: var(--accent-rose); }
  .rail-ver { font-size: 0.7rem; color: var(--text-muted); opacity: 0.7; padding: 10px 12px 0; }
  .sd-frame { padding: 36px 40px 56px; }
  .sd-frame > .mono:last-child { display: none; } /* version sits in the side navigation */
  .app-shell { max-width: 820px; padding: 28px 32px; }
  .ai-fab { right: 28px; bottom: 28px; }
  .toast { bottom: 32px; margin-left: calc(var(--rail-w) / 2); }
  .map-shell { left: var(--rail-w); }
  .sheet-back, .modal-back { left: var(--rail-w); }
}
@media (min-width: 481px) and (max-width: 1023px) { .app-shell { max-width: 640px; } }

/* ---- report a problem ---- */
.fb-modal { width: min(460px, 100%); }
.fb-kinds { gap: 6px; }
.fb-kinds .chip { flex: 1 1 auto; }

/* ---- first visit steps (Today) ---- */
.first-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: fs; display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; line-height: 1.45; }
.first-steps li { counter-increment: fs; display: flex; gap: 12px; align-items: flex-start; }
.first-steps li > span { flex: 1; padding-top: 2px; }
.first-steps li .btn { margin-left: 6px; vertical-align: middle; min-height: 32px; padding: 4px 12px; }
.first-steps li::before { content: counter(fs); flex: 0 0 26px; margin-top: 1px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 750; font-size: 0.8rem; background: rgba(var(--accent-rgb), .16); color: var(--accent-amber); }
.first-steps li.done { color: var(--text-muted); }
.first-steps li.done::before { content: '✓'; background: rgba(76, 195, 138, .18); color: var(--accent-emerald); }
.first-steps li.done .btn { display: none; }
body.sd .first-steps a { color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Today: two columns on wide screens ---- */
@media (min-width: 1024px) {
  #today { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  #today > * { grid-column: 1 / -1; }
  #today > .dash-wx { grid-column: 1; }
  #today > .dash-snap { grid-column: 2; }
  #today .dash-wx .card { min-height: calc(100% - 30px); }
  #today .hero { padding: 26px 28px; }
  #today .hero-title { font-size: 1.9rem; max-width: 22ch; }
  #today .hero-actions { max-width: 460px; }
}

/* ---- pages that came from the old site (about, privacy, terms) ---- */
.doc .content { max-width: none !important; display: flex; flex-direction: column; gap: 14px; font-size: 0.95rem; line-height: 1.6; }
.doc .content h1 { font-size: 1.6rem; font-stretch: 115%; font-weight: 750; line-height: 1.2; }
.doc .content h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.doc .content p, .doc .content li { max-width: 68ch; }
.doc .content ul, .doc .content ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
.doc .content .card { display: block; }
.doc .content .muted { color: var(--text-muted); }
.doc .content a:not(.btn) { color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 2px; }
.doc .content .btn-outline, .doc .content .btn-accent { font: inherit; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border-color); font-weight: 650; text-decoration: none; }
.doc .content .btn-accent { background: var(--accent-amber); border-color: var(--accent-amber); color: var(--on-accent); }
.doc .content img { max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .rail { display: none !important; } body.sd { padding-left: 0; background-image: none; } }

/* v4.29.0: completed trails on activity cards */
.cm-done{font-size:13px;font-weight:650;color:var(--accent-emerald);margin:2px 0 8px}
.cm-done span{text-decoration:underline;text-underline-offset:2px;cursor:pointer}

/* v4.31.0: route profile with where you are (Activity, following a route) */
.rtf-prof{display:block;width:100%;height:54px;margin:4px 0 8px;border-radius:8px;background:rgba(255,255,255,.02)}
