/* Balu TrailBook V2.3.0 — gleiche Designsprache wie TrailPlaner V5.
   Lokale, eigenständige Darstellungsschicht. Keine Kopplung an dessen App,
   keine Fachlogik, kein Verbergen von Lizenz-/Archiv-Hinweisen. */
.legal-links { display:flex;flex-wrap:wrap;gap:8px;margin:8px 0; }
.legal-links a { display:inline-flex;align-items:center;min-height:44px;padding:10px 12px;color:#2f4633;background:#dfe8df;border-radius:12px;text-decoration:underline;font-weight:700;font-size:14px; }
.legal-card { margin-top:16px; }
.license-legal { margin:16px 0;padding:14px;border:1px solid var(--border);border-radius:16px;background:var(--surface); }
.license-legal h3,.license-legal h4 { margin:8px 0;font-size:16px; }
#license-pay-info,#help-license-order,#license-request-envelope { white-space:pre-line; }
#license-request-envelope { overflow-wrap:anywhere; }
#license-request-text { width:100%;font-size:16px;min-height:180px;resize:vertical; }
#license-request-status,#legal-gate-status { font-size:14px;line-height:1.5;color:#8b351d; }
#license-request-preview[hidden] { display:none; }
#license-request-preview .btn { margin-top:8px;white-space:normal; }
.license-pay-btn { white-space:normal; }
.dog-delete { color:var(--danger, #b84235); }
:root {
  --forest-950: #16241b;
  --forest-900: #203126;
  --forest-800: #2f4633;
  --forest-700: #3f6047;
  --forest-100: #dfe8df;
  --amber-600: #bd741b;
  --amber-500: #d28e2e;
  --amber-100: #f4e4ca;
  --cream-50: #fcfaf6;
  --cream-100: #faf6ef;
  --cream-200: #f1eadf;
  --cream-300: #e2d8c8;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 23px;
  --shadow-sm: 0 2px 10px rgba(22,36,27,.06);
  --shadow-md: 0 12px 32px rgba(22,36,27,.12);
  --content-width: 720px;
  --header-height: 62px;
  --nav-height: 72px;
  --bg: var(--cream-100);
  --surface: var(--cream-200);
  --border: var(--cream-300);
  --accent: var(--forest-800);
  --cream: var(--cream-50);
  --text: #223028;
  --muted: #6e766f;
  --amber-text: #8a5917;
  --red: #b84235;
}

html { background: var(--cream-100); }
#dog-modal, #backup-confirm-modal { display:none;position:fixed;inset:0;top:var(--visual-offset-top);height:var(--visual-height);background:rgba(22,36,27,.5);z-index:100010;padding:16px;align-items:center;justify-content:center; }
#dog-modal.open, #backup-confirm-modal.open { display:flex; }
#dog-modal .decision-box, #backup-confirm-modal .decision-box { position:relative;max-height:calc(var(--visual-height) - 32px);overflow-y:auto; }
#dog-name-error { color:var(--red);font-size:13px;margin-top:10px; }
.dog-profile-picker { display:grid;gap:12px;margin-bottom:24px; }
.dog-profile-picker label,.dog-filter { font-size:13px;font-weight:700;color:var(--forest-900); }
.dog-profile-picker select,.dog-filter select { width:100%;min-height:48px;font-size:16px;border:1px solid var(--cream-300);border-radius:10px;background:var(--cream-50);padding:10px 30px 10px 12px;color:var(--text); }
.dog-filter { display:grid;gap:6px;margin:12px 0 18px; }
.tag-manage-shortcut { width:100%;margin-bottom:10px; }
.tag-delete { color:var(--red); }
.settings-releases summary { min-height:48px;display:flex;align-items:center;justify-content:space-between;font-size:16px;font-weight:750;cursor:pointer;list-style:none; }
.settings-releases summary::after { content:'+';font-size:22px; }
.settings-releases[open] summary::after { content:'−'; }
.settings-releases summary::-webkit-details-marker { display:none; }
.release-entry { border-top:1px solid var(--cream-300);margin-top:16px;padding-top:16px; }
.release-entry h3 { font-size:16px; }.release-entry time { color:var(--muted);font-size:12px; }
.release-entry ul { padding-left:20px;margin-top:10px;font-size:14px;line-height:1.6; }
.backup-reminder { padding:12px 16px;background:var(--amber-100);font-size:13px;flex-shrink:0;max-height:35dvh;overflow-y:auto; }
.backup-reminder[hidden] { display:none; }.backup-reminder>div { display:flex;gap:8px;margin-top:8px; }
.app-header #version-badge { min-height:44px;cursor:pointer; }
body {
  min-width: 320px;
  min-height: 0;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 90% 2%, rgba(210,142,46,.12), transparent 240px), var(--cream-100);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, [role=button]:focus-visible {
  outline: 3px solid rgba(189,116,27,.65);
  outline-offset: 3px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--forest-700);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; }

/* Heller, am oberen Viewportrand verankerter Kopf wie im Planer.
   Bewusst vollflächig: kein eigener Glasfilter auf Logo oder Titel. Die äußere
   Statusleistenfarbe passt zu html/body; Safe Area bleibt echte Gerätegröße. */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: calc(var(--header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(18px,env(safe-area-inset-right)) 0 max(18px,env(safe-area-inset-left));
  background: var(--cream-100);
  border-bottom: 1px solid rgba(47,70,51,.08);
  color: var(--forest-900);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.app-header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
.app-header .brand span { display: grid; gap: 3px; line-height: 1.05; }
.app-header .brand strong { font-size: 17px; font-weight: 800; }
.app-header .brand small { font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--muted); }
.app-header .hdr-logo { width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; border: 1px solid rgba(47,70,51,.12); box-shadow: var(--shadow-sm); }
.app-header h1 { margin: 0; display: block; color: var(--forest-900); font-size: 18px; font-weight: 750; line-height: 1.25; letter-spacing: 0; text-transform: none; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.app-header #version-badge {
  justify-self: end; padding: 5px 9px; border-radius: 999px;
  border: 1px solid rgba(189,116,27,.2); background: rgba(210,142,46,.09);
  color: var(--amber-text); font-size: 10px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
}

/* Alle sechs bestehenden Ziele bleiben direkt erreichbar; keine neue
   Navigationsebene, keine Änderung der data-view-Selektoren der Ersttour. */
nav.bottom-nav {
  position: fixed;
  z-index: 1000;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 2px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 5px max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left));
  background: var(--cream-50);
  border-top: 1px solid var(--cream-300);
  border-bottom: 0;
}
nav.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-width: 0; min-height: 44px; padding: 5px 1px;
  border: 0; border-radius: 12px; color: var(--muted); opacity: 1;
  font-size: 9px; font-weight: 750; letter-spacing: 0;
  white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.1;
}
nav.bottom-nav button > .ico { width: 22px; height: 22px; flex: 0 0 22px; stroke-width: 1.8; }
nav.bottom-nav button > span { display: block; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
nav.bottom-nav button.active { color: var(--forest-800); background: var(--forest-100); border: 0; }

#app { width: 100%; }
.view { overscroll-behavior-y: contain; scroll-padding-bottom: 20px; }
.pad { width: min(100%,var(--content-width)); margin: 0 auto; padding: 22px 16px 26px; }
h2.section { margin: 0 0 20px; color: var(--forest-900); font-size: clamp(27px,7vw,36px); line-height: 1.12; letter-spacing: -.035em; text-transform: none; }
h3.sub { margin: 26px 2px 12px; font-size: 16px; font-weight: 750; letter-spacing: 0; text-transform: none; color: var(--forest-900); }
.hint, .locked-note { font-size: 12px; line-height: 1.55; }

/* Gleiche Primär-/Sekundärhierarchie, Radien und Schatten wie im Planer. */
.btn { gap: 8px; padding: 11px 14px; min-height: 46px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 800; line-height: 1.25; letter-spacing: 0; text-align: center; }
.btn-primary, .btn-amber { color: var(--cream-50); background: var(--forest-800); border-color: transparent; box-shadow: 0 7px 18px rgba(47,70,51,.15); }
.btn-primary:hover, .btn-amber:hover { background: var(--forest-700); }
.btn-outline { color: var(--forest-800); background: var(--forest-100); border-color: rgba(47,70,51,.12); box-shadow: none; }
.btn-sm { min-height: 44px; font-size: 12px; padding: 10px 12px; }
.btn-block { min-height: 48px; }
.btn[style*="color:var(--red)"] { background: #fcf0ee; }
.locked-feature { opacity: .45; pointer-events: none; filter: grayscale(.4); }
.modal-x { top: 10px; right: 10px; color: var(--forest-800); background: var(--cream-200); border: 0; font-size: 18px; }

.card, .sys-card, .stat-box, .pf-stat, .meta-edit, .jrnl-edit {
  border: 1px solid rgba(47,70,51,.1); border-radius: var(--radius-md);
  background: rgba(255,255,255,.85); box-shadow: var(--shadow-sm);
}
.card { padding: 18px; margin-bottom: 14px; }
.card:active { background: var(--cream-50); }
.card-top { gap: 12px; }
.card-top > div:first-child { min-width: 0; }
.card-name { font-size: 17px; font-weight: 750; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.card-date { margin-top: 7px; font-size: 12px; }
.card-meta { flex-wrap: wrap; gap: 9px 16px; margin-top: 14px; font-size: 12px; line-height: 1.4; }
.card-badges { max-width: 35%; gap: 6px; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .035em; white-space: normal; overflow-wrap: anywhere; }
.badge.level { color: var(--forest-800); background: var(--forest-100); border: 1px solid rgba(47,70,51,.08); }
.stars { font-size: 15px; }
.assess { margin-top: 14px; border-top: 1px solid var(--cream-300); }
.assess-toggle { font-size: 12px; letter-spacing: 0; }
.assess-body, .jrnl-excerpt, .notes-box { padding: 14px; border-radius: var(--radius-sm); background: var(--cream-50); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.jrnl-line { font-size: 14px; line-height: 1.6; margin-top: 9px; overflow-wrap: anywhere; }
.jrnl-paws { font-size: 14px; }

.trails-top { gap: 10px; align-items: stretch; margin-bottom: 18px; }
.trails-import { min-height: 48px; border-radius: 13px; }
.seg { gap: 3px; background: var(--cream-200); padding: 4px; border-radius: 13px; }
.seg-btn { min-height: 44px; border: 0; border-radius: 10px; font-size: 12px; padding: 8px 6px; letter-spacing: 0; background: transparent; }
.seg-btn.active { background: white; color: var(--forest-800); box-shadow: var(--shadow-sm); }
.trail-filter-box { padding: 14px; margin-bottom: 18px; border-color: rgba(47,70,51,.1); border-radius: var(--radius-md); background: rgba(255,255,255,.78); box-shadow: var(--shadow-sm); }
.trail-filter-box input { min-height: 48px; border-radius: var(--radius-sm); padding: 12px 14px; background: var(--cream-50); font-size: 16px; }
.filter-disclosure { margin-top: 6px; }
.filter-disclosure > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--forest-800); font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.filter-disclosure > summary::-webkit-details-marker { display: none; }
.filter-disclosure > summary::after { content: '+'; font-size: 21px; font-weight: 500; }
.filter-disclosure[open] > summary::after { content: '−'; }
.filter-count { margin-left: auto; color: var(--amber-text); font-size: 11px; }
.filter-disclosure-body { padding-bottom: 10px; }
.filter-disclosure-body > .btn { width: 100%; }
.tag-filter-list, .tag-edit-list { gap: 8px; }
.tag-filter-chip, .tag-edit-chip { min-height: 44px; padding: 9px 13px; font-size: 12px; font-weight: 650; background: var(--cream-50); }
.tag-filter-chip.active, .tag-edit-chip.active { background: var(--forest-100); border-color: var(--forest-700); color: var(--forest-900); }
.tip, .draft-note, .tour-inline-tip { padding: 14px; border-radius: 13px; font-size: 13px; line-height: 1.55; }
.empty { padding: 40px 20px; border: 1px solid rgba(47,70,51,.1); border-radius: var(--radius-md); background: rgba(255,255,255,.7); }
.empty p { font-size: 14px; line-height: 1.65; }
.empty .big { font-size: 44px; margin-bottom: 18px; }

/* Statistik, Lexikon, Steckbrief und Einstellungen. */
.stat-grid { gap: 12px; margin: 20px 0; }
.stat-box, .pf-stat { padding: 20px 12px; }
.stat-num, .pf-stat .n { font-family: inherit; color: var(--forest-900); font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.stat-lbl, .pf-stat .l { font-size: 10px; font-weight: 700; line-height: 1.4; margin-top: 8px; }
.bar-row { gap: 10px; min-height: 32px; font-size: 12px; }
.bar-lbl { width: 100px; overflow-wrap: anywhere; }
.bar-track { height: 10px; border-radius: 999px; background: var(--cream-200); }
.bar-fill { background: var(--forest-700); border-radius: inherit; }
.bar-val { font-family: inherit; }
.lex-item { padding: 0 16px; margin: 10px 0; background: rgba(255,255,255,.85); border: 1px solid rgba(47,70,51,.1); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.lex-q { padding: 18px 0; min-height: 54px; font-size: 15px; line-height: 1.4; letter-spacing: 0; }
.lex-a { font-size: 14px; line-height: 1.65; }
.sys-card { padding: 20px; margin-bottom: 16px; }
.sys-label { font-size: 10px; font-weight: 850; letter-spacing: .12em; color: var(--amber-text); margin-bottom: 14px; }
.sys-card > div[style*="font-size:10px"], .sys-card > div[style*="font-size:11px"] { font-size: 12px !important; line-height: 1.6 !important; }
.sys-card > div[style*="font-size:16px"] { font-size: 18px !important; }
.pf-photo { gap: 18px; align-items: center; }
.pf-photo-box { width: 96px; height: 96px; border-radius: var(--radius-lg); }
.pf-photo-actions { flex: 1; }
.pf-field { margin-bottom: 17px; }
.pf-field label, .meta-edit label, .jrnl-edit label, .jrnl-edit-label, .fld-label {
  margin-bottom: 7px; color: var(--forest-900); font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: 0; text-transform: none;
}
.pf-field input[type=text], .pf-field input[type=date], .pf-field select, .pf-field textarea,
.meta-edit input[type=text], .meta-edit select, .meta-edit textarea,
.jrnl-edit input[type=text], .jrnl-edit textarea, input[type=text] {
  min-height: 48px; padding: 12px 14px; background: var(--cream-50); border-radius: var(--radius-sm); font-size: 16px; line-height: 1.4;
}
.pf-field select { padding-right: 32px; }
.pf-field textarea, .meta-edit textarea, .jrnl-edit textarea { min-height: 100px; }
.pf-auto { display: inline-block; font-size: 10px; padding: 2px 6px; }
.pf-check input { flex-shrink: 0; width: 22px; height: 22px; accent-color: var(--forest-800); }
.pf-check { min-height: 44px; }
.pf-check label { margin-bottom: 0; }
.char-count { font-size: 11px; line-height: 1.5; }
.meta-edit, .jrnl-edit { padding: 18px; }
.jrnl-mood { gap: 4px; }
.jrnl-mood .paw { background: var(--forest-100); }
.jrnl-mood-clear { font-size: 12px; }
.filter-add-row { grid-template-columns: minmax(0,1fr) auto; }
.filter-add-row .btn { padding-inline: 10px; font-size: 11px; }

/* Kopf-/Fußleisten behalten bestehende Status- und Ablauftexte unverändert. */
#trial-banner { min-height: 48px; padding: 13px 18px; text-align: left; background: var(--amber-100); color: var(--forest-900); font-size: 12px; letter-spacing: 0; border-bottom: 1px solid rgba(189,116,27,.2); }
#trial-banner.archive { color: var(--cream-50); background: var(--forest-800); }
#guide-strip { padding: 8px 12px; background: var(--forest-100); border-bottom: 1px solid rgba(47,70,51,.1); }
.gs-title { font-size: 11px; letter-spacing: 0; }
.gs-resume, .gs-stop { min-height: 44px; padding: 8px 10px; font-size: 10px; border-radius: 10px; }
#storage-alert { font-size: 12px; }
#toast { bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 12px); border-radius: 13px; font-size: 13px; letter-spacing: 0; box-shadow: var(--shadow-md); }
#update-banner { bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 12px) !important; border-radius: 16px !important; font-size: 13px !important; letter-spacing: 0 !important; }

/* Detaildarstellung behält bewusst den bestehenden eigenen Scrollbereich:
   kein Neuaufbau des Journals, keine Änderung an Dirty-Guards oder Entwürfen. */
#detail { background: var(--cream-100); }
.detail-head {
  position: sticky; top: 0; z-index: 1000;
  min-height: calc(var(--header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left));
  color: var(--forest-900); background: var(--cream-100); border-bottom: 1px solid var(--cream-300);
}
.detail-head .t { flex: 1; min-width: 0; padding: 12px 0; font-size: 16px; font-weight: 750; line-height: 1.35; letter-spacing: -.01em; overflow-wrap: anywhere; }
.detail-head button { flex-shrink: 0; color: var(--forest-800); }
.detail-head .detail-x { background: var(--cream-200); }
.detail-body { width: min(100%,var(--content-width)); margin-left: auto; margin-right: auto; padding: 20px 16px max(24px,env(safe-area-inset-bottom)); }
.kv { gap: 14px; padding: 13px 0; font-size: 14px; line-height: 1.45; }
.kv > span { min-width: 0; overflow-wrap: anywhere; }
.kv > span:first-child { flex: 0 1 42%; }
.kv > span:last-child { flex: 1; }
.kv .badge { margin: 2px 0; }
.info-line { font-size: 14px; }
.provider-source { font-size: 11px; }
#detail-map { height: 240px; border-radius: var(--radius-md); }
.map-legend { flex-wrap: wrap; gap: 10px 16px; font-size: 11px; line-height: 1.4; }
.map-veil-hint { padding: 9px 14px; font-size: 12px; letter-spacing: 0; }
.leaflet-popup-content { font-size: 14px; line-height: 1.5; }

/* Sämtliche bestehenden Dialoge und die Einführung im gleichen Kartendesign. */
.help-box, .choose-box, .paste-box, .license-box, .decision-box, .ob-card, .busy-card {
  width: 100%; max-width: 480px; padding: 24px;
  border: 1px solid rgba(47,70,51,.12); border-radius: var(--radius-lg);
  background: var(--cream-100); box-shadow: var(--shadow-md);
}
.help-box h2, .choose-box h2, .paste-box h2, .license-box h2, .decision-box h2 {
  padding-right: 34px; margin-bottom: 14px; font-size: 22px; font-weight: 750; line-height: 1.2; letter-spacing: -.02em; text-transform: none; text-align: left;
}
.help-scroll, .decision-copy { font-size: 14px; line-height: 1.65; }
.help-scroll h3 { font-size: 15px; letter-spacing: 0; text-transform: none; margin-top: 22px; }
.paste-box p, .choose-box p, .busy-card p { font-size: 13px; line-height: 1.55; }
.paste-box textarea, .license-box textarea { font-size: 16px; background: var(--cream-50); border-radius: var(--radius-sm); }
.paste-actions { bottom: -24px; padding: 12px 0 24px; }
.decision-actions { bottom: -24px; padding-bottom: 24px; }
.restore-option { padding: 14px; border-radius: 13px; background: var(--cream-50); }
.restore-option strong { font-size: 14px; }
.restore-option small { font-size: 12px; }
.restore-option input { accent-color: var(--forest-800); }
.license-scroll p, .license-scroll > div[style*="font-size"] { font-size: 13px !important; line-height: 1.55 !important; }
.license-pay-card { padding: 15px; background: rgba(255,255,255,.78); border-radius: var(--radius-md); }
.license-pay-card > strong { font-size: 15px; }
.license-pay-card > p, .license-detail-item > span { font-size: 12px; }
.license-detail-item code { font-size: 12px; }
.license-bank-extra summary { font-size: 12px; letter-spacing: 0; }
.license-ref-row { flex-wrap: wrap; }
.license-ref-row code { flex-basis: 150px; font-size: 13px; }
.license-ref-row .btn { min-height: 44px; }
.fld-label { margin-top: 18px; }
.tag-manager-name { font-size: 15px; }
.tag-manager-row { flex-wrap: wrap; padding: 14px 0; }
.tag-manager-name { flex-basis: 120px; }

#onboarding { background: radial-gradient(circle at top right, var(--amber-100), transparent 55%),var(--cream-100); }
.ob-stage { min-height: 240px; }
.ob-title { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; text-transform: none; }
.ob-text { font-size: 15px; line-height: 1.65; }
.ob-footer { bottom: -24px; padding-bottom: 24px; }
.ob-skip { min-height: 44px; font-size: 12px; letter-spacing: 0; }
.ob-icon-img { box-shadow: var(--shadow-md); }
.ob-tour-icon { background: var(--forest-100); border-color: var(--forest-700); box-shadow: var(--shadow-sm); }
.tour-card { max-width: 480px; border: 1px solid var(--cream-300); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-md); }
.tour-card h3 { font-size: 20px; letter-spacing: -.02em; line-height: 1.25; }
.tour-copy { font-size: 14px; line-height: 1.55; }
.tour-progress { font-size: 10px; color: var(--amber-text); }
.tour-do { font-size: 13px; padding: 12px; background: var(--forest-100); }
.tour-actions { bottom: -20px; padding-bottom: 20px; }
.tour-inline-tip .tour-actions { bottom: 0; padding-bottom: 0; background: transparent; }
.tour-card.tour-card-top { top: calc(var(--header-height) + env(safe-area-inset-top) + 12px); }
#install-gate { background: var(--cream-100); padding: max(18px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
.gate-card { width: 100%; max-width: 480px; max-height: calc(var(--visual-height) - max(18px,env(safe-area-inset-top)) - max(18px,env(safe-area-inset-bottom))); overflow-y: auto; overscroll-behavior: contain; padding: 26px; background: white; border: 1px solid var(--cream-300); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.gate-card h2 { color: var(--forest-900); font-size: 25px; letter-spacing: -.025em; text-transform: none; }
.gate-card p, .gate-steps { color: var(--text); font-size: 14px; opacity: 1; }
.gate-ico { color: var(--forest-800); filter: none; }
.busy-card strong { font-size: 18px; }

@media (max-width: 560px) {
  .app-header .brand span { display: none; }
  .app-header #version-badge { padding-inline: 6px; font-size: 9px; }
}
@media (min-width: 760px) {
  header.app-header { padding-left: max(24px,calc((100vw - var(--content-width)) / 2)); padding-right: max(24px,calc((100vw - var(--content-width)) / 2)); }
  nav.bottom-nav { left: calc((100vw - var(--content-width)) / 2); right: calc((100vw - var(--content-width)) / 2); border: 1px solid var(--cream-300); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-md); }
  nav.bottom-nav button { font-size: 11px; }
  #trial-banner, #guide-strip { padding-left: max(18px,calc((100vw - var(--content-width)) / 2 + 16px)); padding-right: max(18px,calc((100vw - var(--content-width)) / 2 + 16px)); }
}
@media (max-width: 359px) {
  .trails-top { flex-wrap: wrap; }
  .trails-top .seg { flex-basis: 100%; }
  .trails-import { flex: 1; }
  .card-top { flex-wrap: wrap; }
  .card-badges { flex-direction: row; flex-wrap: wrap; max-width: 100%; }
  .filter-add-row { grid-template-columns: 1fr; }
  nav.bottom-nav { gap: 0; padding-inline: 4px; }
  nav.bottom-nav button { font-size: 8.5px; }
}
@media (max-height: 500px) {
  :root { --header-height: 48px; --nav-height: 60px; }
  .pad { padding-top: 14px; }
  .help-box, .choose-box, .paste-box, .license-box, .decision-box, .ob-card { padding: 14px; }
  .help-box h2, .choose-box h2, .paste-box h2, .license-box h2, .decision-box h2 { font-size: 18px; margin-bottom: 10px; }
  .paste-actions, .decision-actions, .ob-footer { bottom: -14px; padding-bottom: 14px; }
  .ob-stage { min-height: 0; }
  .ob-title { font-size: 20px; }
  .ob-text { font-size: 13px; line-height: 1.5; }
  .tour-card, .tour-card.tour-card-top { top: auto; bottom: max(4px,env(safe-area-inset-bottom)); padding: 12px; }
  .tour-card h3 { font-size: 17px; }
  .tour-copy, .tour-do { font-size: 12px; }
  .tour-actions { bottom: -12px; padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
