/* Unified field-note skin. Decorative layers stay behind content and never
   cover map tiles, form controls, click targets or route geometry. */
:root {
  color-scheme: light;
  --ink: #23362d;
  --muted: #738075;
  --soft: #879186;
  --line: #d8dfd4;
  --paper: #edf0ea;
  --panel: #fcfdf9;
  --field: #e7ece3;
  --forest: #22362c;
  --forest-2: #31483a;
  --moss: #667c54;
  --sage: #dfe8d7;
  --orange: #c55c2c;
  --gold: #b88138;
  --radius: 8px;
  --shadow: 0 3px 10px rgba(35, 54, 45, .07);
}

body,
body.android-webview {
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(180deg, rgba(34, 54, 44, .045), transparent 240px);
}

.app-shell,
body.android-webview .app-shell {
  color: var(--ink);
  background-color: var(--paper);
  background-image: none;
  border-color: var(--phone-frame);
}

.app-main {
  background-color: var(--paper);
  background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022");
  background-position: right top;
  background-size: 420px 540px;
  background-repeat: repeat;
}

.topbar,
body.android-webview .topbar {
  color: #fcfdf9;
  background: var(--forest);
  border-bottom: 3px solid #788960;
  backdrop-filter: none;
}

.topbar .brand-lockup { color: #fcfdf9; font-weight: 800; }
.topbar .brand-lockup small { color: #cbd5c4; letter-spacing: 1.2px; }
.topbar .brand-pin { color: #fff; background: var(--orange); border-radius: 7px 7px 7px 2px; }
.topbar .icon-button.subtle { color: #f2f5ec; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); border-radius: 6px; }

.tabbar,
body.android-webview .tabbar {
  color: #d8dfd3;
  background: var(--forest);
  border-color: rgba(255,255,255,.12);
  border-top: 1px solid #53654a;
  border-radius: 9px 9px 0 0;
  box-shadow: 0 -3px 14px rgba(34,54,44,.12);
}
.tab-item { color: #d8dfd3; border-radius: 6px; font-weight: 700; }
.tab-item.active:not(.upload-tab) { color: #fff; background: #425238; box-shadow: inset 0 -2px var(--orange); }
.upload-tab { color: #fff; background: var(--orange); border-radius: 7px; box-shadow: none; }
.tab-item.upload-tab.active { color: #fff; background: #ad4d27; }
.feature-tab-dot { position: absolute; top: 3px; right: calc(50% - 23px); width: 9px; height: 9px; background: #d94b3d; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(37,24,20,.28); }
.feature-tab-dot[hidden] { display: none; }

.primary-button { color: #fff; background: var(--orange); border-color: var(--orange); border-radius: 6px; box-shadow: none; }
.secondary-button { color: var(--forest); background: #e2e9dc; border-color: #c9d5c2; border-radius: 6px; box-shadow: none; }
.icon-text-button { color: var(--moss); }
.search-field,
.home-search { color: var(--muted); background: var(--panel); border-color: var(--line); border-radius: 6px; box-shadow: none; }

.home-sort { background: rgba(252,253,249,.88); border-color: var(--line); border-radius: 6px; }
.home-sort button { color: #65745e; border-radius: 5px; }
.home-sort button.active { color: #fff; background: var(--forest); }
.home-sort .today-recommendation-entry { color: #fff; background: var(--orange); }
.home-stats div { background: rgba(252,253,249,.94); border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.home-stats strong { color: var(--forest); font-variant-numeric: tabular-nums; }
.home-stats span { color: var(--muted); }
.filter-row button { color: #65745e; background: var(--panel); border-color: var(--line); border-radius: 5px; }
.filter-row button.active { color: #fff; background: var(--forest); border-color: var(--forest); }
.result-line { color: var(--muted); }
.feed-card { background: var(--panel); border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.feed-card h2 { color: var(--forest); }
.feed-card p { color: var(--muted); }
.card-route-meta span { color: #52644a; background: var(--field); border-radius: 4px; }
.card-actions .mini-action { color: #586b4f; background: #e7ece3; border-radius: 5px; }
.card-actions .mini-action.active { color: #fff; background: var(--moss); }
.card-actions .mini-action.edit-action { color: #83441e; background: #f5e8dc; }
.terrain-badge { background: rgba(34,54,44,.8); border-radius: 4px; }
.featured-badge,.review-badge { border-radius: 4px; }

.route-share,
.nav-panel,
.team-panel,
.chat-panel,
.management-block,
.publish-actions button,
.publish-helper-card,
.publish-media-panel,
.publish-auto-summary,
.notification-list article,
.route-vehicle-profile,
.route-vehicle-card,
.route-cloud-activity,
.profile-card,
.profile-collapsible,
.profile-full-page-list article {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.publish-head {
  background-color: var(--forest);
  background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022"), linear-gradient(130deg, #22362c, #496047);
  background-position: right center, center;
  background-size: 420px 540px, cover;
  border: 1px solid #53644c;
  border-radius: 8px;
}
.publish-actions button { background: var(--panel); }
.publish-actions button > [data-icon] { color: var(--moss); }
.publish-helper-card { background: #f3f6ef; }
.publish-helper-steps span { border-radius: 6px; }
.publish-form input,
.publish-form textarea,
.publish-form select,
.feedback-form input,
.feedback-form select,
.feedback-form textarea { border-color: var(--line); border-radius: 6px; background-color: var(--panel); }

.profile-view { color: var(--ink); }
.profile-view > .profile-card {
  color: #fcfdf9;
  background-color: var(--forest);
  background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022");
  background-position: right center;
  background-size: 420px 540px;
  background-repeat: repeat;
  border-color: #50644b;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.profile-view > .profile-card .profile-account-action { position: absolute; top: 59px; right: 14px; }
.profile-view > .profile-card .profile-info h2 { color: #fcfdf9; }
.profile-view > .profile-card .profile-info p { color: #cbd5c4; }
.profile-view > .profile-card .profile-avatar { color: #fff; background: #43583d; border-radius: 7px; box-shadow: none; }
.profile-account-action { color: #f2f5ec; background: rgba(255,255,255,.08); border-color: #879779; border-radius: 6px; }
.profile-stats div { background: rgba(252,253,249,.95); border-color: var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.profile-stats strong { color: var(--forest); font-variant-numeric: tabular-nums; }
.profile-stats span { color: var(--muted); }
.profile-settings-entries .map-option { background: var(--panel); border-color: var(--line); border-radius: 6px; }
.profile-field-heading { color: var(--forest); }
.profile-field-heading small { color: var(--orange); }
.profile-field-heading > [data-icon] { color: var(--moss); }
.profile-field-grid .profile-page-entry { background: var(--panel); border-color: var(--line); border-top-color: var(--moss); border-radius: 8px; box-shadow: var(--shadow); }
.profile-field-grid .profile-section-toggle { color: var(--forest); }
.profile-field-grid .profile-section-icon { color: var(--moss); background: #e8eee2; border-color: #d6dfd1; }
.profile-field-grid .profile-section-copy small,
.profile-entry-metric > span { color: var(--muted); }
.profile-entry-metric b { color: var(--forest); font-variant-numeric: tabular-nums; }
.profile-field-grid .profile-section-chevron { color: var(--moss); }
.profile-field-grid .profile-section-title .profile-section-action { color: var(--forest); background: #e8eee2; border-color: #d6dfd1; border-radius: 6px; }
.profile-field-grid [data-profile-section="recorded"] { color: #fcfdf9; background-color: var(--forest); background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022"); background-position: right center; background-size: 420px 540px; border-color: #52644b; border-top-color: var(--orange); }
.profile-field-grid [data-profile-section="recorded"] .profile-section-toggle { color: #fcfdf9; }
.profile-field-grid [data-profile-section="recorded"] .profile-section-icon { color: #dce6d1; background: #42553a; border-color: #5b6a4d; }
.profile-field-grid [data-profile-section="recorded"] .profile-section-copy small,
.profile-field-grid [data-profile-section="recorded"] .profile-entry-metric > span,
.profile-field-grid [data-profile-section="recorded"] .profile-section-chevron { color: #d1dac7; }
.profile-field-grid [data-profile-section="recorded"] .profile-entry-metric b { color: #fff; }
.profile-field-grid [data-profile-section="recorded"] .profile-section-action { color: #fff; background: var(--orange); border-color: #d37a52; }

.detail-view { background: transparent; }
.detail-content { margin: 12px; padding-bottom: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.detail-view { padding-bottom: 88px; }
.detail-action-dock { background: var(--forest); border-color: #53654a; backdrop-filter: none; }
.detail-action-dock button { color: #f2f5ec; background: #425238; border-radius: 6px; }
.detail-action-dock button.active { color: #fff; background: var(--orange); }
.content-policy-row span,.content-policy-row button,.topic-cloud button { border-radius: 5px; }
.bottom-sheet { background-color: var(--paper); background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022"); background-size: 420px 540px; }
.account-sync-row,.account-sheet-status,.account-release-notes,.point-detail-card,.point-detail-section,.route-feedback-detail-item,.release-notice-sheet ul { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.release-notice-sheet ul { padding: 12px 14px 12px 30px; }
.sheet-close-button { background: var(--field); border-color: var(--line); border-radius: 6px; }
.account-sheet .map-option,.account-sheet .auth-session-row { border-radius: 6px; }
.route-detail-page,
.route-weather-full-page,
.profile-full-page {
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022");
  background-size: 420px 540px;
}
.route-detail-body { background: transparent !important; }
.route-detail-body > .route-detail-stats,
.route-detail-body > .route-detail-map-section,
.route-detail-body > .route-detail-section:not(.route-detail-risks),
.route-detail-body > .route-live-intelligence.route-info-compact,
.route-detail-body > .route-cloud-activity {
  background-color: var(--panel);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.route-detail-body > .route-detail-stats b,
.route-detail-body > .route-detail-section h2,
.route-detail-body > .route-detail-map-section h2 { color: var(--forest); }
.route-detail-body > .route-live-intelligence.route-info-compact { border-left-color: var(--moss); }
.route-cloud-activity-head { background: var(--forest); }
.route-cloud-activity-grid { background: #e8eee3; border-color: var(--line); }
.route-cloud-activity-grid span { border-color: var(--line); }
.route-cloud-activity-grid b { color: var(--forest); }
.route-cloud-activity .route-feedback-item { background: var(--panel); border-color: var(--line); border-left-color: var(--orange); border-radius: 7px; box-shadow: var(--shadow); }
.route-cloud-activity .route-feedback-item:first-child { border-top-color: var(--line); }
.route-cloud-activity .route-feedback-item strong { color: var(--forest); }
.route-cloud-activity .route-feedback-item time { color: var(--muted); }
.route-cloud-activity .route-feedback-item p { color: #536257; }
.route-feedback-item .feedback-run-metrics > span { background: #eef2e9; }
.route-feedback-item .feedback-run-metrics b { color: var(--forest); }

.profile-full-page { min-height: 100dvh; }
.profile-full-page-header { background: var(--forest); }
.profile-full-page-list article { background: var(--panel); border-color: var(--line); }
.notification-list article { background: var(--panel); border: 1px solid var(--line); }
.notification-list .route-event.unread { background: #edf3e8; box-shadow: inset 3px 0 var(--moss); }
.notification-list .app-update-message { border-left-color: var(--orange); }

.team-rally {
  --team-ink: var(--ink);
  --team-muted: var(--muted);
  --team-line: var(--line);
  --team-panel: var(--panel);
  --team-field: var(--field);
  --team-forest: var(--forest);
  --team-moss: var(--moss);
  --team-orange: var(--orange);
}
.team-rally h1,.team-rally h2,.team-rally h3 { color: var(--forest); }
.team-rally .team-heading h1 { color: #fcfdf9; }
.team-rally button,.team-dialog button { border-radius: 6px; }
.team-rally .primary-button,.team-dialog .primary-button { color: #fff; background: var(--orange); border-color: var(--orange); }
.team-rally .secondary-button,.team-dialog .secondary-button { color: var(--forest); background: var(--panel); border-color: var(--line); }
.team-card,.team-overview,.team-member,.team-communication-section { background: var(--panel); border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.team-empty { background: var(--field); }
.team-tabs button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); }
.team-driving-mode { --team-nav-deep: #22362c; --team-nav-mid: #526744; --team-nav-soft: #dfe8d7; --team-nav-pale: #edf0ea; }
.team-dialog { background: var(--panel) !important; background-color: var(--panel) !important; border-color: var(--line); }
.team-dialog > header { background: rgba(252,253,249,.96); border-color: var(--line); }
.team-form input,.team-form select,.team-form textarea,.team-input,.team-composer textarea { background: var(--panel) !important; background-color: var(--panel) !important; border-color: var(--line); }

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

/* Match the approved off-road profile composition: one dark identity card,
   a flat metric rail, then vehicle and two-column trail cards. */
.profile-view {
  gap: 14px;
  padding: 0 3px 18px;
}
.profile-view > .profile-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 10px 14px;
  min-height: 214px;
  margin: 0;
  padding: 18px 14px 13px;
  color: #fcfdf9;
  background-color: var(--forest);
  background-image: url("./offroad-pattern.svg?v=v375-unified-offroad-cards-20261022");
  background-position: right center;
  background-size: 420px 540px;
  border: 1px solid #50644b;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.profile-view > .profile-card .profile-avatar {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  width: 86px;
  height: 86px;
  color: #fff;
  background: #43583d;
  border-radius: 9px;
  box-shadow: none;
  font-size: 31px;
}
.profile-view > .profile-card .profile-info {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  min-width: 0;
  padding-bottom: 5px;
}
.profile-view > .profile-card .profile-info h2 {
  margin: 0 0 7px;
  color: #fcfdf9;
  font-size: 22px;
  line-height: 1.2;
}
.profile-view > .profile-card .profile-info p {
  color: #cbd5c4;
  font-size: 12px;
  line-height: 1.45;
}
.profile-view > .profile-card .profile-account-action {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  color: #f2f5ec;
  background: rgba(255,255,255,.06);
  border-color: #879779;
  border-radius: 6px;
}
.profile-view > .profile-card .profile-account-action svg { display: none; }
.profile-view > .profile-card .profile-bio {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding-top: 11px;
  color: #cbd5c4;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: 11px;
}
.profile-inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 8px;
  color: #dce6d1;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
.profile-inline-edit svg { width: 17px; height: 17px; }
.profile-view > .profile-stats {
  display: flex;
  gap: 0;
  padding: 8px 0 4px;
  margin: 0;
}
.profile-view > .profile-stats div {
  flex: 1;
  min-height: 72px;
  padding: 4px 12px 7px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  text-align: center;
}
.profile-view > .profile-stats div:last-child { border-right: 0; }
.profile-view > .profile-stats div::after { display: none; }
.profile-view > .profile-stats strong {
  color: var(--forest);
  font-size: 30px;
  line-height: 1.1;
}
.profile-view > .profile-stats span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}
.profile-settings-entries { display: none; }
.profile-view > .route-vehicle-profile {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.profile-view .route-vehicle-heading {
  margin: 0 0 8px;
  padding: 0 2px;
}
.profile-view .route-vehicle-heading strong {
  color: var(--forest);
  font-size: 21px;
}
.profile-view .route-vehicle-heading small {
  color: var(--muted);
  font-size: 11px;
}
.profile-view .route-vehicle-heading .route-vehicle-button {
  width: 28px;
  min-width: 28px;
  padding: 0;
  overflow: hidden;
  color: var(--forest);
  background: transparent;
  border: 0;
  font-size: 0;
}
.profile-view .route-vehicle-heading .route-vehicle-button svg { width: 20px; height: 20px; }
.profile-view .route-vehicle-cards { margin-top: 0; padding: 0 0 7px; }
.profile-view .route-vehicle-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--moss);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.profile-view .route-vehicle-card-head { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.profile-view .route-vehicle-card-icon { color: var(--moss); background: var(--sage); border-radius: 7px; }
.profile-view .route-vehicle-card-head h3 { color: var(--forest); font-size: 21px; }
.profile-view .route-vehicle-card-head small { font-size: 11px; }
.profile-view .route-vehicle-card-grid { margin-top: 13px; gap: 8px; }
.profile-view .route-vehicle-card-grid > div { padding: 0; background: transparent; }
.profile-view .route-vehicle-card-grid dt { color: var(--muted); font-size: 10px; }
.profile-view .route-vehicle-card-grid dd { color: var(--forest); font-size: 12px; }
.profile-view .route-vehicle-card-actions { margin-top: 6px; }
.profile-view .route-vehicle-card-actions > span { color: var(--muted); }
.profile-view .route-vehicle-card-actions .route-vehicle-button { min-height: 30px; }
.profile-view .profile-field-heading { padding: 5px 2px 0; }
.profile-view .profile-field-heading > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; }
.profile-view .profile-field-heading small { color: var(--forest); font-size: 20px; letter-spacing: 0; white-space: nowrap; }
.profile-view .profile-field-heading h2 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.profile-view .profile-field-heading > [data-icon] { display: none; }
.profile-view .profile-field-grid { gap: 10px; }
.profile-view .profile-field-grid [data-profile-section="subscriptions"] { grid-column: 1 / -1; }
.profile-view .profile-field-grid .profile-section-action { display: none; }
.profile-view .profile-field-grid .profile-page-entry { min-height: 0; }
.profile-view .profile-field-grid .profile-section-toggle { min-height: 107px; }
.profile-view .profile-field-grid [data-profile-section="subscriptions"] .profile-section-toggle,
.profile-view .profile-field-grid [data-profile-section="articles"] .profile-section-toggle { min-height: 78px; }

/* Home screen follows the approved preview order: eyebrow/title, search,
   compact sort tabs, categories and the large route card. */
.home-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 12px;
}
.home-hero .eyebrow { color: var(--moss); }
.home-hero h1 { margin: 5px 0 0; color: var(--forest); font-size: 28px; line-height: 1.1; }
.home-city {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--orange);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}
.home-city svg { width: 16px; height: 16px; }
.home-toolbar { margin-top: 0; gap: 10px; }
.home-search { min-height: 42px; border-radius: 6px; }
.home-sort {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  background: transparent;
  border: 0;
}
.home-sort button { min-height: 30px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.home-sort button.active { color: #fff; background: var(--forest); border-color: var(--forest); }
.home-sort .today-recommendation-entry { grid-column: 1 / -1; color: #fff; background: var(--orange); border-color: var(--orange); }
.home-stats { display: none; }
.filter-row { margin-top: 4px; }
.filter-row button { min-height: 31px; padding: 0 12px; border-radius: 5px; }
.result-line { min-height: 26px; margin: 2px 0 7px; }
.masonry-feed { gap: 10px; }
.feed-card { border-radius: 8px; box-shadow: var(--shadow); }
.feed-card .media-box { aspect-ratio: 16 / 9; }
.feed-card-body { padding: 12px; }
.feed-card h2 { font-size: 20px; }
.feed-card p { font-size: 12px; }
.home-today-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  color: var(--forest);
  text-align: left;
  background: #e4e9db;
  border: 0;
  border-top: 2px solid var(--moss);
}
.home-today-card strong,.home-today-card small { display: block; }
.home-today-card strong { font-size: 16px; }
.home-today-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.home-today-card > svg { width: 22px; height: 22px; }
.home-feedback-heading { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 9px; color: var(--forest); }
.home-feedback-heading strong { font-size: 20px; }
.home-feedback-heading button { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); background: transparent; border: 0; font: inherit; font-size: 11px; }
.home-feedback-heading svg { width: 14px; height: 14px; }
