:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17231f;
  background: #eef3ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --forest-950: #071c17;
  --forest-900: #102a22;
  --forest-800: #173c31;
  --forest-700: #245744;
  --forest-600: #33755a;
  --forest-500: #4a9572;
  --mint-100: #dcefe7;
  --mint-50: #eff8f3;
  --gold: #e8b64d;
  --red: #bd2c2c;
  --red-soft: #fff0ef;
  --ink-muted: #617068;
  --line: #d7e1db;
  --card: rgba(255,255,255,.96);
  --shadow: 0 18px 50px rgba(24, 58, 45, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #eef3ef; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at top right, rgba(111,191,115,.12), transparent 30%), #eef3ef; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; color: white; background: linear-gradient(180deg, var(--forest-950), var(--forest-900)); display: flex; flex-direction: column; gap: 26px; z-index: 20; }
.brand { border: 0; color: white; background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; padding: 6px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--forest-950); background: linear-gradient(145deg, #cbe9d7, #73b586); font-size: 18px; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand small { display: block; color: #aac6ba; margin-top: 2px; }
.side-nav { display: grid; gap: 5px; }
.side-nav button { border: 0; color: #bed1c8; background: transparent; display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 12px 13px; text-align: left; transition: .2s ease; }
.side-nav button:hover { color: white; background: rgba(255,255,255,.06); }
.side-nav button.active { color: white; background: linear-gradient(90deg, rgba(111,191,115,.24), rgba(255,255,255,.04)); box-shadow: inset 3px 0 #8fd49c; }

.legal-nav {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.legal-nav a {
  display: block;
  padding: 5px 8px;
  border-radius: 8px;
  color: #aac6ba;
  font-size: 11px;
  line-height: 1.35;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
  color: white;
  background: rgba(255,255,255,.06);
}

.sidebar-note { margin-top: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px; color: #b9cdc4; background: rgba(255,255,255,.04); }
.sidebar-note p { margin: 8px 0 0; font-size: 11px; line-height: 1.5; }
.main-content { min-width: 0; }
.bottom-nav { display: none; }
.page { width: min(1460px, 100%); margin: 0 auto; padding: 34px 38px 70px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.page-header h1 { margin: 4px 0 5px; font-size: clamp(30px, 4vw, 52px); line-height: 1; letter-spacing: -.045em; color: var(--forest-950); }
.page-header p { max-width: 820px; margin: 0; color: var(--ink-muted); line-height: 1.55; }
.eyebrow { color: var(--forest-600); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.page-actions { display: flex; gap: 10px; align-items: center; }
.card { background: var(--card); border: 1px solid rgba(215,225,219,.9); border-radius: 20px; box-shadow: var(--shadow); }
.primary, .secondary, .ghost, .button-like { min-height: 44px; border-radius: 12px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary { color: white; background: linear-gradient(135deg, var(--forest-700), var(--forest-500)); box-shadow: 0 9px 22px rgba(51,117,90,.22); }
.primary:hover, .secondary:hover, .button-like:hover { transform: translateY(-1px); }
.primary:disabled { opacity: .65; cursor: wait; transform: none; }
.secondary, .button-like { color: var(--forest-800); background: white; border-color: var(--line); }
.ghost { color: var(--forest-700); background: transparent; border: 0; padding-inline: 8px; }
.wide { width: 100%; }
.button-row { display: flex; gap: 10px; }
.button-stack, .button-column { display: grid; gap: 10px; }
.button-like input, .photo-picker input { display: none; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: #edf0ee; color: #59655f; }
.status-pill.good { background: #e1f5e7; color: #257344; }
.status-pill.warn { background: #fff3d7; color: #91651e; }
.status-pill.danger { background: #ffe1df; color: #a42f2f; }

.hero-panel { min-height: 360px; overflow: hidden; position: relative; color: white; border-radius: 28px; padding: clamp(28px, 5vw, 62px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; background: linear-gradient(120deg, rgba(7,28,23,.98), rgba(23,60,49,.92)), radial-gradient(circle at 72% 0%, #769d82, transparent 38%); box-shadow: 0 25px 65px rgba(7,28,23,.24); }
.hero-panel h2 { max-width: 760px; font-size: clamp(34px, 5vw, 66px); line-height: .98; letter-spacing: -.055em; margin: 12px 0 18px; }
.hero-panel p { max-width: 690px; color: #c5d8cf; line-height: 1.65; font-size: 16px; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #9fd1ac; font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-panel .secondary { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.18); }
.summit-card { position: relative; height: 290px; align-self: end; }
.summit-sun { position: absolute; width: 78px; height: 78px; right: 15%; top: 8%; border-radius: 50%; background: var(--gold); box-shadow: 0 0 80px rgba(232,182,77,.38); }
.summit-line { position: absolute; left: 2%; right: -15%; bottom: -4%; height: 84%; clip-path: polygon(0 100%, 26% 36%, 39% 65%, 58% 12%, 100% 100%); }
.summit-back { background: #315247; transform: translateY(-18px); opacity: .72; }
.summit-front { background: linear-gradient(135deg, #24483a 0 51%, #4f7a63 52% 100%); }
.route-dots { position: absolute; left: 27%; bottom: 20%; width: 55%; height: 47%; border-bottom: 3px dashed #e8f5ed; transform: rotate(-22deg); }
.route-dots i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #f4fbf7; box-shadow: 0 0 0 4px rgba(255,255,255,.16); }
.route-dots i:nth-child(1){left:0;bottom:-6px}.route-dots i:nth-child(2){left:34%;bottom:15px}.route-dots i:nth-child(3){left:67%;bottom:38px}.route-dots i:nth-child(4){right:0;bottom:62px}
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 20px 0; }
.metric-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.84); }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--forest-700); background: var(--mint-100); }
.metric-card span { display: block; font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }
.metric-card strong { display: block; margin-top: 3px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature-card { width: 100%; border: 1px solid var(--line); background: white; border-radius: 18px; padding: 21px; display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; text-align: left; box-shadow: 0 8px 25px rgba(24,58,45,.05); }
.feature-card > svg:first-child { color: var(--forest-600); padding: 10px; width: 46px; height: 46px; border-radius: 12px; background: var(--mint-50); }
.feature-card strong, .feature-card span { display: block; }
.feature-card span { color: var(--ink-muted); margin-top: 4px; line-height: 1.45; }
.feature-card.danger > svg:first-child { color: var(--red); background: var(--red-soft); }
.warning-banner, .danger-banner { display: flex; align-items: flex-start; gap: 12px; border-radius: 14px; padding: 14px 16px; margin-top: 18px; }
.warning-banner { color: #775c22; background: #fff7df; border: 1px solid #f2dfaa; }
.danger-banner { color: #902c2c; background: var(--red-soft); border: 1px solid #efc1bd; }
.warning-banner p, .danger-banner p { margin: 0; line-height: 1.5; }

.segmented-control { display: inline-flex; border: 1px solid var(--line); background: #fff; padding: 5px; border-radius: 14px; gap: 5px; margin-bottom: 18px; }
.segmented-control button { border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; font-weight: 750; }
.segmented-control button.active { background: var(--forest-900); color: white; }
.two-column { display: grid; grid-template-columns: minmax(340px, .78fr) minmax(0, 1.22fr); gap: 18px; }
.upload-card { padding: 20px; display: grid; gap: 14px; align-content: start; }
.image-dropzone { min-height: 330px; border: 2px dashed #b9cdc3; background: var(--mint-50); border-radius: 17px; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--forest-700); cursor: pointer; text-align: center; }
.image-dropzone img { width: 100%; height: 100%; min-height: 330px; max-height: 520px; object-fit: cover; }
.image-dropzone input { display: none; }
.image-dropzone span { color: var(--ink-muted); font-size: 12px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12px; font-weight: 800; color: #526159; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field textarea, .field select, .route-select { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--forest-950); background: #fbfdfc; outline: none; }
.field input:focus, .field textarea:focus, .field select:focus, .route-select:focus { border-color: var(--forest-500); box-shadow: 0 0 0 3px rgba(74,149,114,.12); }
.field textarea { min-height: 100px; resize: vertical; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.inline-error { display: flex; align-items: flex-start; gap: 8px; color: #9d3030; background: var(--red-soft); border: 1px solid #efc1bd; border-radius: 11px; padding: 10px 12px; font-size: 13px; }

.inline-info { display:flex; align-items:flex-start; gap:8px; color:#315e4e; background:#eef7f2; border:1px solid #c9dfd3; border-radius:11px; padding:10px 12px; font-size:13px; line-height:1.45; }
.routing-safety-note { display:flex; align-items:flex-start; gap:10px; margin:14px 0; padding:13px 14px; border-radius:13px; color:#7d5720; background:#fff7df; border:1px solid #f2dfaa; }
.routing-safety-note > span { flex:0 0 auto; }
.routing-safety-note p { margin:0; line-height:1.45; }
.routing-safety-note small { display:block; margin-top:6px; color:#7d6a48; line-height:1.4; overflow-wrap:anywhere; }
.custom-map.fallback-preview { outline:2px dashed #c98a5a; outline-offset:-2px; }
button:disabled { opacity:.52; cursor:not-allowed; box-shadow:none; }
.analysis-output { min-height: 640px; padding: clamp(20px, 4vw, 38px); }
.analysis-placeholder { min-height: 500px; height: 100%; color: var(--ink-muted); display: flex; align-items: center; justify-content: center; text-align: center; flex-direction: column; padding: 40px; }
.analysis-placeholder svg { color: #8fb5a4; }
.analysis-placeholder h3, .analysis-placeholder h2 { color: var(--forest-900); margin: 18px 0 7px; }
.analysis-placeholder p { max-width: 520px; line-height: 1.6; }
.analysis-placeholder.tall { min-height: 580px; }
.result-title { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.result-title span { color: var(--forest-600); text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.result-title h2 { margin: 5px 0 0; font-size: clamp(25px, 3vw, 40px); letter-spacing: -.04em; }
.confidence { border-radius: 999px; padding: 7px 10px; white-space: nowrap; background: #edf0ee; }
.confidence.high { background: #e1f5e7; color: #257344; }.confidence.medium { background:#fff3d7;color:#91651e}.confidence.low{background:#ffe1df;color:#a42f2f}
.lead { font-size: 17px; line-height: 1.7; color: #46544d; }
.identity-card { display: flex; align-items: center; gap: 13px; border-radius: 15px; background: var(--mint-50); padding: 16px; margin: 16px 0; }
.identity-card > svg { color: var(--forest-600); }
.identity-card span, .identity-card strong, .identity-card em { display: block; }
.identity-card span { color: var(--ink-muted); font-size: 11px; text-transform: uppercase; }.identity-card strong{font-size:20px}.identity-card em{color:var(--forest-600);margin-top:2px}
.result-section { margin-top: 21px; }
.result-section h3 { margin: 0 0 8px; }
.result-section ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.result-section li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.5; }
.result-section li svg { width: 18px; color: var(--forest-500); margin-top: 2px; }
.danger-text, .result-section.danger-text li svg { color: var(--red) !important; }
.fine-print { color: #718078; font-size: 11px; line-height: 1.55; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

.route-planner-grid { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 18px; align-items: start; }
.planner-form { padding: 20px; display: grid; gap: 14px; position: sticky; top: 24px; }
.route-result-column { min-width: 0; }
.route-report { background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(22px, 4vw, 40px); }
.route-report-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.route-report-head > div:first-child { max-width: 820px; }
.route-report-head span { color: var(--forest-600); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.route-report-head h2 { margin: 6px 0 9px; font-size: clamp(29px, 4vw, 48px); letter-spacing: -.045em; }
.route-report-head p { color: var(--ink-muted); line-height: 1.6; }
.route-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 18px 0; }
.route-stats > div { border-radius: 14px; padding: 14px; background: var(--mint-50); }
.route-stats span { display: flex; align-items: center; gap: 6px; color: var(--forest-600); font-size: 11px; text-transform: uppercase; font-weight: 800; }
.route-stats strong { display: block; margin-top: 7px; font-size: 21px; }
.report-section { border-top: 1px solid var(--line); padding: 21px 0; }
.report-section h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; color: var(--forest-900); }
.report-section p { color: #4d5b54; line-height: 1.7; margin: 0; white-space: pre-line; }
.report-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.report-list { border-radius: 14px; padding: 16px; background: #f6faf7; }
.report-list.danger { background: #fff4f3; }
.report-list h3 { margin: 0 0 10px; }
.report-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.report-list li { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; line-height: 1.45; }
.source-list { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.source-list a { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.source-list a:hover span { color: var(--forest-600); }
.source-list small { color: var(--ink-muted); }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; min-height: 690px; }
.map-panel, .navigation-panel { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.route-map { width: 100%; height: 690px; background: #dce5df; }
.navigation-panel { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.nav-route-title span { color: var(--forest-600); text-transform: uppercase; font-size: 11px; font-weight: 800; }
.nav-route-title h2 { margin: 4px 0 3px; line-height: 1.08; }
.nav-route-title p { margin: 0; color: var(--ink-muted); }
.route-provider-badge { display:grid; grid-template-columns:auto 1fr; gap:3px 8px; align-items:center; padding:10px 12px; border:1px solid #cde0d4; border-radius:12px; background:#f1f8f4; color:var(--forest-700); }
.route-provider-badge > span:first-child { grid-row:1 / span 2; font-size:20px; }
.route-provider-badge > span:nth-child(2) { color:var(--ink-muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.055em; }
.route-provider-badge strong { font-size:13px; overflow-wrap:anywhere; }
.navigation-status-row { display:flex; flex-wrap:wrap; gap:7px; margin-top:-8px; }
.nav-status-pill { display:inline-flex; align-items:center; min-height:28px; padding:5px 9px; border-radius:999px; border:1px solid #d5dfda; background:#f7faf8; color:#526159; font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.045em; }
.nav-status-pill.online, .nav-status-pill.active { border-color:#a9d0b9; background:#eef8f2; color:#245744; }
.nav-status-pill.offline { border-color:#c9d5cf; background:#eef1ef; color:#40534a; }
.nav-status-pill.waiting { border-color:#e7d59a; background:#fff9e9; color:#7d5720; }
.nav-status-pill.error { border-color:#e8b7b7; background:#fff0f0; color:#9b2f2f; }
.gpx-share-status { display:grid; gap:5px; padding:11px 12px; border-radius:12px; border:1px solid #cde0d4; background:#f1f8f4; color:#315e4c; font-size:12px; line-height:1.45; }
.gpx-share-status.warn { border-color:#ecd79a; background:#fff9e9; color:#7d5720; }
.gpx-share-status strong { overflow-wrap:anywhere; }
.gpx-share-download-action { margin-top:4px; width:100%; min-height:42px; }

.nav-compass { min-height: 135px; display: flex; align-items: center; justify-content: center; gap: 20px; border-radius: 18px; color: var(--forest-700); background: radial-gradient(circle, #eff8f3, #dbeadf); }
.nav-compass span, .nav-compass strong { display: block; }.nav-compass span{font-size:11px;text-transform:uppercase}.nav-compass strong{font-size:30px}
.nav-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nav-metrics > div { padding: 13px; border-radius: 13px; background: #f5f8f6; }
.nav-metrics span, .nav-metrics strong { display: block; }.nav-metrics span{font-size:11px;color:var(--ink-muted);margin-top:7px}.nav-metrics strong{font-size:19px}
.danger-value { color: var(--red); }
.cache-status { padding: 10px; border-radius: 10px; background: var(--mint-50); color: var(--forest-700); font-size: 12px; }
.empty-state { min-height: 450px; border: 1px dashed #bdcbc4; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--ink-muted); background: rgba(255,255,255,.62); }
.empty-state h3 { color: var(--forest-900); margin: 15px 0 6px; }.empty-state p{max-width:500px}.empty-state.compact{min-height:240px}.empty-state > svg{color:#8fb5a4}

.sos-page { background: radial-gradient(circle at top right, rgba(189,44,44,.08), transparent 28%); }
.sos-hero { border-radius: 24px; padding: clamp(28px, 6vw, 64px); text-align: center; color: white; background: linear-gradient(135deg, #6d1515, #b42727); box-shadow: 0 24px 55px rgba(124,22,22,.25); }
.sos-pulse { width: 120px; height: 120px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); box-shadow: 0 0 0 18px rgba(255,255,255,.05); }
.sos-hero h2 { max-width: 800px; margin: 0 auto 10px; font-size: clamp(29px, 5vw, 52px); letter-spacing: -.04em; }
.sos-hero p { color: #ffd9d9; }
.sos-button { margin-top: 16px; border: 0; min-height: 58px; padding: 14px 24px; border-radius: 999px; color: #8a1c1c; background: white; display: inline-flex; align-items: center; gap: 10px; font-weight: 900; box-shadow: 0 10px 25px rgba(67,0,0,.22); }
.sos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.coordinate-card, .emergency-actions { padding: 24px; }
.coordinate-card { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.coordinate-card > svg { color: var(--red); }.coordinate-card span{color:var(--ink-muted);text-transform:uppercase;font-size:11px;font-weight:800}.coordinate-card strong{font-size:clamp(22px,3vw,36px)}.coordinate-card small{color:var(--ink-muted)}
.emergency-actions { display: grid; gap: 12px; align-content: center; }
.danger-action { background: linear-gradient(135deg, #8e1f1f, #c53333); }

.journal-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 18px; align-items: start; }
.journal-form { padding: 20px; display: grid; gap: 13px; position: sticky; top: 24px; }
.journal-form h2, .journal-entries > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; }
.journal-entries > h2 span { font-size: 12px; background: var(--mint-100); color: var(--forest-700); padding: 4px 8px; border-radius: 999px; }
.photo-picker { border: 1px dashed #aabfb4; border-radius: 12px; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--forest-700); font-weight: 750; cursor: pointer; }
.photo-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.photo-strip > div { position: relative; aspect-ratio: 1; }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.photo-strip button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(7,28,23,.75); color: white; display: grid; place-items: center; }.photo-strip button svg{width:14px}
.journal-entries { display: grid; gap: 13px; }
.journal-card { display: grid; grid-template-columns: 210px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 9px 28px rgba(24,58,45,.06); }
.journal-card > img, .journal-placeholder { width: 100%; height: 100%; min-height: 210px; object-fit: cover; }
.journal-placeholder { display: grid; place-items: center; color: #7aa48f; background: var(--mint-100); }.journal-placeholder svg{width:48px;height:48px}
.journal-content { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; }
.journal-content span { color: var(--forest-600); font-size: 11px; text-transform: uppercase; font-weight: 800; }.journal-content h3{font-size:24px;margin:4px 0}.journal-content p{color:var(--ink-muted);line-height:1.55}.journal-stats{display:flex;gap:7px;flex-wrap:wrap}.journal-stats span{background:#eef5f1;padding:6px 9px;border-radius:999px;color:var(--forest-700)}
.journal-content .ghost { margin-top: auto; }

.guides-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-index { padding: 20px; position: sticky; top: 24px; }
.guide-index > svg { color: var(--forest-600); }.guide-index h2{margin:10px 0 6px}.guide-index p{color:var(--ink-muted);font-size:13px;line-height:1.55}
.guide-index button { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 13px 5px; text-align: left; color: var(--ink-muted); }
.guide-index button.active { color: var(--forest-700); font-weight: 800; }
.guide-content { display: grid; gap: 12px; }
.guide-card { border: 1px solid var(--line); border-radius: 18px; background: white; overflow: hidden; }
.guide-card.open { box-shadow: var(--shadow); }
.guide-toggle { width: 100%; border: 0; background: white; padding: 22px; display: flex; justify-content: space-between; align-items: flex-start; text-align: left; }
.guide-toggle span { display: flex; align-items: center; gap: 6px; color: var(--forest-600); font-size: 11px; text-transform: uppercase; font-weight: 800; }.guide-toggle h2{margin:5px 0}.guide-toggle p{margin:0;color:var(--ink-muted);line-height:1.5}
.guide-sections { padding: 0 22px 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.guide-sections section { padding: 16px; border-radius: 14px; background: var(--mint-50); }.guide-sections h3{margin:0 0 6px}.guide-sections p{margin:0;color:#506058;line-height:1.6}

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.settings-section { padding: 22px; display: grid; gap: 14px; align-content: start; }
.settings-section h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 5px; }.settings-section h2 svg{color:var(--forest-600)}
.emergency-settings { grid-column: 1 / -1; }
.language-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.language-grid button { border: 1px solid var(--line); background: #fbfdfc; color: var(--forest-800); border-radius: 11px; padding: 10px; text-align: left; }
.language-grid button span { display: inline-grid; place-items: center; width: 34px; height: 25px; margin-right: 8px; border-radius: 6px; background: #e8f2ec; font-size: 10px; font-weight: 900; }
.language-grid button.active { border-color: var(--forest-500); background: var(--mint-50); box-shadow: inset 0 0 0 1px var(--forest-500); }
.settings-save { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }.settings-save span{display:flex;align-items:center;gap:7px;color:#267345;font-weight:750}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .route-planner-grid, .journal-layout { grid-template-columns: 350px minmax(0, 1fr); }
  .route-stats, .report-columns { grid-template-columns: repeat(2, 1fr); }
  .hero-panel { grid-template-columns: 1fr; }
  .summit-card { display: none; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .bottom-nav { position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr); padding: 7px max(5px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); background: rgba(7,28,23,.96); backdrop-filter: blur(16px); }
  .bottom-nav button { min-width: 0; border: 0; border-radius: 9px; padding: 6px 2px; background: transparent; color: #b8cdc4; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9px; }
  .bottom-nav button.active { color: white; background: rgba(111,191,115,.15); }
  .page { padding: 24px 18px 105px; }
  .page-header { flex-direction: column; }
  .two-column, .route-planner-grid, .map-layout, .journal-layout, .guides-grid { grid-template-columns: 1fr; }
  .planner-form, .journal-form, .guide-index { position: static; }
  .status-grid { grid-template-columns: 1fr; }
  .map-layout { min-height: 0; }.route-map{height:58vh;min-height:420px}
  .guide-index { display: none; }
  .settings-grid { grid-template-columns: 1fr; }.emergency-settings,.settings-save{grid-column:auto}
}
@media (max-width: 620px) {
  .page { padding-inline: 13px; }
  .page-header h1 { font-size: 36px; }
  .hero-panel { min-height: 420px; padding: 26px 20px; border-radius: 21px; }
  .hero-panel h2 { font-size: 40px; }
  .quick-grid, .sos-grid, .settings-grid { grid-template-columns: 1fr; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .segmented-control { display: grid; width: 100%; }
  .route-report-head { flex-direction: column; }.button-column{grid-template-columns:1fr 1fr}
  .route-stats, .report-columns { grid-template-columns: 1fr 1fr; }
  .journal-card { grid-template-columns: 1fr; }.journal-card > img,.journal-placeholder{height:190px;min-height:190px}
  .guide-sections { grid-template-columns: 1fr; }
  .metric-card { grid-template-columns: auto 1fr; }.metric-card .status-pill{grid-column:2}
  .source-list a { grid-template-columns: 1fr auto; }.source-list small{display:none}
}
@media (max-width: 410px) {
  .route-stats, .report-columns, .nav-metrics, .language-grid { grid-template-columns: 1fr; }
  .button-column { grid-template-columns: 1fr; }
  .bottom-nav .nav-label { display: none; }.bottom-nav .nav-symbol { display: inline-block; width: auto; font-size: 22px; line-height: 1; }.bottom-nav button{padding-block:9px}
}
.toast { position: fixed; z-index: 2000; right: 18px; bottom: 22px; max-width: min(420px, calc(100vw - 36px)); padding: 13px 16px; color: white; background: #102a22; border-radius: 12px; box-shadow: 0 15px 40px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.nav-symbol { width: 24px; text-align: center; font-size: 18px; }

.offline-readiness-card { display:grid; gap:10px; padding:14px; border:1px solid #d5dfda; border-radius:14px; background:#f7faf8; }
.offline-readiness-card.ready { border-color:#a9d0b9; background:#eef8f2; }
.offline-readiness-head { display:flex; align-items:center; gap:10px; color:var(--forest-700); }
.offline-readiness-head > span { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#deeee4; font-size:20px; }
.offline-readiness-head small, .offline-readiness-head strong { display:block; }
.offline-readiness-head small { color:var(--ink-muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.offline-readiness-head strong { margin-top:2px; font-size:15px; }
.offline-readiness-card p { margin:0; color:#526159; font-size:12px; line-height:1.5; }
.offline-actions { display:grid; gap:7px; }
.offline-actions button { width:100%; min-height:42px; }
.offline-prepare-button { min-height:50px !important; font-size:14px; font-weight:850; border-color:#8fbda6 !important; background:#f4fbf7 !important; }
.map-tiles { position:absolute; inset:0; overflow:hidden; }
.offline-map-backdrop { position:absolute; inset:0; display:grid; place-items:end center; padding:18px; background-color:#e8efea; background-image:linear-gradient(rgba(36,87,68,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(36,87,68,.08) 1px,transparent 1px),radial-gradient(circle at 30% 35%,rgba(90,135,111,.14),transparent 27%),radial-gradient(circle at 70% 65%,rgba(90,135,111,.10),transparent 30%); background-size:48px 48px,48px 48px,100% 100%,100% 100%; }
.offline-map-backdrop span { padding:6px 9px; border-radius:999px; background:rgba(255,255,255,.9); border:1px solid #cad7d0; color:#436052; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.055em; }
.custom-map.offline-route-only { background:#e8efea; }
.custom-map.offline-route-only .map-overlay { filter:drop-shadow(0 2px 1px rgba(255,255,255,.9)); }
.custom-map { position: relative; width: 100%; height: 690px; overflow: hidden; touch-action: none; background: #dce5df; cursor: grab; }
.custom-map.dragging { cursor: grabbing; }
.map-tile { position: absolute; width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; }
.map-overlay { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.map-marker { position: absolute; transform: translate(-50%, -100%); width: 24px; height: 31px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: #245744; border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,.28); pointer-events: auto; }
.map-marker::after { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: white; left: 6px; top: 6px; }
.map-marker.current { background: #2f75d6; }
.map-marker span { position: absolute; left: 23px; top: -7px; rotate: 45deg; width: max-content; max-width: 180px; padding: 5px 7px; border-radius: 7px; color: #17231f; background: rgba(255,255,255,.92); border: 1px solid #d7e1db; font-size: 10px; font-weight: 800; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.map-controls { position: absolute; z-index: 8; top: 12px; left: 12px; display: grid; gap: 6px; }
.map-controls button { width: 40px; height: 40px; border: 1px solid #cbd7d0; border-radius: 10px; background: rgba(255,255,255,.94); color: #102a22; font-size: 21px; font-weight: 900; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.map-attribution { position: absolute; z-index: 7; right: 5px; bottom: 4px; padding: 3px 5px; border-radius: 4px; background: rgba(255,255,255,.82); color: #46544d; font-size: 9px; }
.route-select { min-width: 230px; }
.loading-panel { display:flex; align-items:center; justify-content:center; gap:12px; min-height:130px; color:#617068; }
.file-name { color:#617068; font-size:12px; overflow-wrap:anywhere; }
.source-list p { color:#617068; }
.install-card { display:flex; align-items:center; gap:12px; margin-top:14px; padding:14px; border-radius:14px; color:#173c31; background:#eff8f3; border:1px solid #d7e1db; }
.install-card button { margin-left:auto; }
.image-dropzone.has-image { padding:0; }
.analysis-output img.result-thumb { width:100%; max-height:250px; object-fit:cover; border-radius:14px; margin-bottom:15px; }
.route-loading-steps { display:grid; gap:10px; margin-top:15px; }
.route-loading-steps span { padding:10px 12px; border-radius:10px; background:#eff8f3; color:#33755a; }
.offline-badge { display:inline-flex; gap:6px; align-items:center; font-weight:800; color:#33755a; }
@media (max-width:860px){ .custom-map{height:58vh;min-height:420px}.toast{bottom:88px} }
.guide-card:not(.open) .guide-sections { display: none !important; }
.guide-card.open .guide-sections { display: grid !important; }


/* Mobile More menu — journal, guides and settings must remain reachable on phones. */
.mobile-more-overlay { display: none; }
@media (max-width: 860px) {
  body.mobile-menu-open { overflow: hidden; }
  .mobile-more-overlay { position: fixed; inset: 0; z-index: 2400; display: block; }
  .mobile-more-backdrop { position: absolute; inset: 0; background: rgba(2, 16, 13, .52); backdrop-filter: blur(3px); }
  .mobile-more-sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--ink); background: #f8fbf9; border-radius: 24px 24px 0 0; box-shadow: 0 -18px 55px rgba(0,0,0,.24); animation: mobileSheetIn .18s ease-out; }
  .mobile-more-handle { width: 48px; height: 5px; margin: 0 auto 12px; border-radius: 10px; background: #c7d5cd; }
  .mobile-more-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 4px 14px; }
  .mobile-more-head strong, .mobile-more-head small { display: block; }
  .mobile-more-head strong { font-size: 18px; color: var(--forest-900); }
  .mobile-more-head small { margin-top: 2px; color: var(--ink-muted); }
  .mobile-more-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--forest-900); background: white; font-size: 26px; line-height: 1; }
  .mobile-more-links { display: grid; gap: 10px; }
  .mobile-more-links > button { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 14px; color: var(--forest-900); background: white; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; text-align: left; box-shadow: 0 6px 20px rgba(16,42,34,.05); }
  .mobile-more-links > button:active { transform: translateY(1px); background: #f0f7f3; }
  .mobile-more-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #e7f3eb; font-size: 22px; }
  .mobile-more-links strong, .mobile-more-links small { display: block; }
  .mobile-more-links strong { font-size: 16px; }
  .mobile-more-links small { margin-top: 3px; color: var(--ink-muted); font-size: 12px; line-height: 1.35; }
  .mobile-more-arrow { color: var(--forest-500); font-size: 28px; }
  .mobile-settings-link { border-color: #a7cfb1 !important; background: #f2faf5 !important; }
  @keyframes mobileSheetIn { from { transform: translateY(24px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
}

/* Route Planner 2.0 */
.route-bundle { display: grid; gap: 16px; }
.route-decision { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.85fr); gap: 18px; border-radius: 18px; padding: 18px 20px; border: 1px solid var(--line); background: white; box-shadow: 0 8px 25px rgba(24,58,45,.05); }
.route-decision > div > span { display:block; font-size:11px; font-weight:900; letter-spacing:.12em; color:var(--ink-muted); }
.route-decision strong { display:block; margin:5px 0 6px; font-size:23px; }
.route-decision p { margin:0; color:var(--ink-muted); line-height:1.5; }
.route-decision ul { margin:0; padding-left:18px; display:grid; gap:6px; color:#4d5b54; line-height:1.45; }
.route-decision.good { border-color:#b9ddc5; background:#f2faf5; }
.route-decision.warn { border-color:#ecd79a; background:#fff9e9; }
.route-decision.danger { border-color:#e7b2ae; background:#fff1f0; }
.route-options-wrap { padding:18px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.86); }
.section-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.section-title-row > div > span { color:var(--forest-600); font-size:10px; font-weight:900; letter-spacing:.12em; }
.section-title-row h3 { margin:2px 0 0; }
.route-option-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.route-option-card { min-width:0; border:1px solid var(--line); border-radius:15px; padding:14px; background:white; text-align:left; color:var(--forest-950); box-shadow:0 6px 18px rgba(24,58,45,.04); }
.route-option-card:hover { border-color:#9ec4ad; }
.route-option-card.active { border-color:var(--forest-500); box-shadow:inset 0 0 0 1px var(--forest-500), 0 8px 20px rgba(51,117,90,.12); background:#f3faf6; }
.route-option-card.not-advised { background:#fff7f6; border-color:#ebc8c4; }
.route-option-card strong { display:block; margin:10px 0 6px; font-size:15px; line-height:1.25; }
.route-option-card p { margin:0; min-height:44px; color:var(--ink-muted); font-size:12px; line-height:1.4; }
.route-option-top { display:flex; justify-content:space-between; gap:7px; align-items:flex-start; }
.route-rec,.risk-chip,.source-quality,.source-badge { display:inline-flex; align-items:center; width:max-content; border-radius:999px; font-size:9px; line-height:1; font-weight:900; letter-spacing:.045em; text-transform:uppercase; }
.route-rec { padding:6px 8px; background:#eef2ef; color:#5d6963; }
.route-rec.recommended { background:#def2e5; color:#226b42; }
.route-rec.not-advised { background:#ffe2df; color:#9d2b2b; }
.risk-chip { padding:6px 8px; background:#eef2ef; color:#5d6963; white-space:nowrap; }
.exposure-high,.exposure-very-high { background:#ffe7e4; color:#9b3030; }
.exposure-moderate { background:#fff1d3; color:#8d641d; }
.route-option-stats { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.route-option-stats span { padding:5px 7px; border-radius:8px; background:#edf5f0; color:#315e4c; font-size:10px; font-weight:800; }
.source-quality { padding:7px 9px; background:#eef2ef; color:#5d6963; }
.source-quality.strong { background:#def2e5; color:#226b42; }
.source-quality.moderate { background:#fff1d3; color:#8d641d; }
.source-quality.limited { background:#ffe7e4; color:#9b3030; }
.technical-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:0 0 20px; }
.technical-strip > div { padding:12px; border:1px solid var(--line); border-radius:12px; background:#fbfdfc; }
.technical-strip span { display:block; color:var(--ink-muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.055em; }
.technical-strip strong { display:block; margin-top:5px; font-size:13px; text-transform:capitalize; }
.support-columns { margin-top:20px; }
.verification-section { margin-top:20px; }
.routing-metrics { margin-top:20px; padding:15px; border:1px solid #cde0d4; border-radius:14px; background:#f1f8f4; }
.routing-metrics > div { display:flex; align-items:flex-start; gap:12px; }
.routing-metrics > div > span { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:11px; background:#dcefe7; color:var(--forest-700); font-size:20px; }
.routing-metrics h3 { margin:0 0 4px; }
.routing-metrics p { margin:0; color:var(--ink-muted); line-height:1.5; }
.routing-metrics ul { margin:9px 0 0 50px; color:#7d5720; }
.source-badge { padding:5px 7px; margin-right:7px; vertical-align:middle; background:#edf1ef; color:#5d6963; }
.source-badge.official { background:#dff2e6; color:#256b43; }
.source-badge.specialist { background:#e8edf8; color:#365f9d; }

@media (max-width: 1120px) {
  .route-option-grid { grid-template-columns:1fr; }
  .technical-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .route-decision { grid-template-columns:1fr; }
  .section-title-row { align-items:flex-start; flex-direction:column; }
  .technical-strip { grid-template-columns:1fr 1fr; }
  .route-option-grid { grid-template-columns:1fr; }
}
@media (max-width: 410px) {
  .technical-strip { grid-template-columns:1fr; }
}

.compact-routing-retry{margin-top:12px;width:100%;justify-content:center}
.routing-safety-note .compact-routing-retry{background:#fff;border-color:#d6b56d;color:#5f4814}

/* Patch 12.3: clear offline-only affordances */
.offline-action-note{margin:12px 0;padding:12px 14px;border:1px solid #e7cf88;border-radius:14px;background:#fff8df;color:#735315;font-weight:700;line-height:1.45}
.hero-actions button:disabled,.feature-card:disabled{opacity:.48;filter:saturate(.65);cursor:not-allowed;transform:none}

/* Patch 13 – Commercial beta account foundation */
.settings-subgrid{display:contents}
.account-section{grid-column:1/-1}
.account-auth-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:end}
.account-auth-form .fine-print,.account-auth-form #account-auth-error,.account-auth-form .button-row{grid-column:1/-1}
.account-plans{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.account-plan{border:1px solid var(--line,#d9e1dc);border-radius:16px;padding:14px;display:grid;gap:5px;background:#f8faf9}
.account-plan.active{border-color:#77ad91;background:#eef8f2;box-shadow:inset 0 0 0 1px #77ad91}
.account-plan strong{font-size:15px}.account-plan span{font-weight:800;color:var(--forest-700,#205d46)}.account-plan small{color:#66756d;line-height:1.45}
.account-signed-in,.account-current-plan{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:12px 14px;border-radius:14px;background:#f5f8f6}
.account-signed-in span,.account-current-plan span{color:#68766f}.account-signed-in strong,.account-current-plan strong{font-size:16px}
.account-usage{display:grid;gap:8px;padding:14px;border:1px solid #dce6e1;border-radius:14px}.account-usage>div{display:flex;justify-content:space-between;gap:16px}
.subscription-lifecycle-note{display:grid;gap:4px;padding:12px 14px;border:1px solid #d8e7df;border-radius:14px;background:#f1f8f4;color:#2f5f4a}.subscription-lifecycle-note span{color:#5f7469}.subscription-history-note{padding:10px 14px;border-radius:12px;background:#f6f8f7;color:#68766f;font-size:13px}
@media(max-width:760px){.account-auth-form,.account-plans{grid-template-columns:1fr}.account-section{grid-column:auto}.settings-subgrid{display:contents}}

/* Patch 15 — subscription enforcement + upgrade flow */
.quota-hint{margin:2px 0 0;color:#6a776f;font-size:13px;line-height:1.4}.quota-hint strong{color:var(--forest-800,#123d2f)}
.commercial-gate{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid #e8d7a0;border-radius:14px;background:#fff8dd;color:#5d4810}.commercial-gate-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#fff0b7;font-weight:900;flex:0 0 auto}.commercial-gate strong{display:block;font-size:15px;color:#4c3907}.commercial-gate p{margin:5px 0 10px;line-height:1.5}.commercial-gate button{width:auto}
.account-plan.selectable{appearance:none;text-align:left;width:100%;font:inherit;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}.account-plan.selectable:hover{transform:translateY(-1px);border-color:#77ad91;box-shadow:0 8px 20px rgba(26,74,55,.08)}.account-plan.selectable:disabled{cursor:wait;opacity:.65}.account-plan em{font-style:normal;font-size:12px;font-weight:800;color:#376b55}.account-plan.active em{color:#2a7b57}

/* Patch 16 billing */
.account-plan.selectable em{display:inline-flex;align-items:center;gap:5px}.account-section .button-row{flex-wrap:wrap}.account-section #account-manage-billing{border-color:#77ad91}
