/* Erdőfigyelő — EQUORA Institute arculat (forest / mint / gold) */
:root {
  --mint: #E4F8E7; --mint-dark: #d0f0d5; --forest: #173C2A; --forest-mid: #2F6C4A; --forest-light: #3d8a5e;
  --ink: #0d141a; --ink-soft: #56585E; --gold: #D8B750; --gold-dim: #C9A84C; --border: #dadce0;
  --water: #1f6fa8; --water-light: #e3f0fa; --alert: #c2410c; --bg: #fbfcfb; --white: #fff;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --top: 56px; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--forest-mid); }
a:hover { color: var(--forest); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; color: var(--forest); }
h2 { font-size: 1.35rem; margin: .2rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.small { font-size: .85rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.pre { white-space: pre-wrap; }

/* ─── Fejléc ─── */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
  height: calc(var(--top) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--white); color: var(--ink); border-bottom: 1px solid var(--border);
}
/* Az equora.institute fejlécének mintájára: az Intézet jele és neve, mellette az Erdőfigyelő */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand a { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand a:hover { color: var(--forest-mid); }
.brand-mark { height: 30px; width: auto; display: block; }
.brand-inst { font-family: var(--serif); font-size: 15px; letter-spacing: .02em; }
.brand-sep { width: 1px; height: 24px; background: var(--border); flex: 0 0 auto; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--forest); }
.brand-sub { font-size: .7rem; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 16px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .92rem; }
.nav a:not(.btn):hover { color: var(--forest-mid); }

/* ─── Gombok ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--white);
  color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 600; font-size: .92rem; line-height: 1.2;
}
.btn:hover { border-color: var(--forest-light); color: var(--forest); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--forest-mid); border-color: var(--forest-mid); color: var(--white); }
.btn-primary:hover { background: var(--forest); color: var(--white); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--forest); }
.btn-gold:hover { background: var(--gold-dim); color: var(--forest); }
.btn-danger { border-color: #e7b2a0; color: var(--alert); }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--forest-mid); cursor: pointer; text-decoration: underline; font-weight: 500; }

/* ─── Térképoldal elrendezése ─── */
.map-page .app {
  position: fixed; top: calc(var(--top) + env(safe-area-inset-top)); left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: 1fr minmax(360px, 440px);
}
.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: #e8ece9; }
.panel { position: relative; background: var(--white); border-left: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; }
.panel-body { overflow-y: auto; padding: 18px 20px 28px; flex: 1; -webkit-overflow-scrolling: touch; }
.panel-handle { display: none; }
.loading { color: var(--ink-soft); }

.filters {
  position: absolute; top: 10px; left: 56px; right: 60px; z-index: 800;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; pointer-events: none;
}
.filters > * { pointer-events: auto; }
.chip-f {
  border: 1px solid var(--border); background: var(--white); border-radius: 999px; padding: 6px 12px;
  font-size: .85rem; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.12); display: inline-flex; gap: 6px; align-items: center;
}
.chip-f svg { width: 14px; height: 14px; }
.chip-f.on { background: var(--forest); color: var(--white); border-color: var(--forest); }
.filters select { border: 1px solid var(--border); background: var(--white); border-radius: 999px; padding: 6px 10px; font-size: .85rem; box-shadow: 0 1px 3px rgba(0,0,0,.12); max-width: 200px; }

@media (max-width: 820px) {
  .brand-sub, .brand-inst { display: none; }
  .nav a:not(.btn) { display: none; }
  .map-page .app { grid-template-columns: 1fr; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1000; height: 46%;
    border-left: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(0,0,0,.14); transition: height .22s ease;
  }
  .panel.full { height: calc(100% - 10px); }
  .panel.mini { height: 92px; }
  .panel.pick { height: 38%; }
  .panel-handle { display: block; width: 100%; height: 22px; border: 0; background: none; cursor: pointer; flex: 0 0 auto; position: relative; }
  .panel-handle::after { content: ''; position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #c9cfcb; }
  .panel-body { padding-top: 4px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .filters { left: 52px; right: 52px; flex-wrap: nowrap; overflow-x: auto; }
  .filters select { max-width: 150px; }
}

/* ─── Beágyazott mód (?embed=1) ─── */
body.embed .top { display: none; }
body.embed .app { top: 0 !important; }
.embed-link { display: none; }
body.embed .embed-link { display: inline-block; margin-top: 12px; }

/* ─── Térképjelölők ─── */
.pin {
  display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--white);
  box-shadow: 0 1px 5px rgba(0,0,0,.35); color: var(--white);
}
.pin svg { width: 15px; height: 15px; }
.pin-erdo { background: var(--forest-mid); }
.pin-viz { background: var(--water); }
.pin.st-uj, .pin.st-ellenorzes { border-color: var(--gold); }
.pin.st-megerositett, .pin.st-hatosagnal { border-color: var(--alert); }
.pin.st-engedelyezett, .pin.st-megoldva { border-color: #c9d3cd; opacity: .8; }
.pin.approx { outline: 2px dashed rgba(13,20,26,.45); outline-offset: 2px; }
.pin.sel { transform: scale(1.25); z-index: 1000 !important; }
.pick-pin { display: grid; place-items: center; }
.pick-pin span { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--gold); border: 3px solid var(--forest); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(216,183,80,.45); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: rgba(23,60,42,.88); color: var(--white); font-weight: 700; }
.leaflet-container { font-family: var(--sans); }
.leaflet-control-layers-expanded { font-size: .85rem; line-height: 1.6; }
.legend { background: var(--white); padding: 8px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.2); font-size: .78rem; min-width: 170px; }
.legend-bar { height: 10px; border-radius: 3px; background: linear-gradient(90deg, #f0f000, #f07800, #f00000); margin: 4px 0 2px; }
.legend-row { display: flex; justify-content: space-between; color: var(--ink-soft); }
.legend-dots { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; color: var(--ink-soft); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); }
.dot.d25 { background: #e4412e; }
.dot.d24 { background: #f5a524; margin-left: 8px; }
.sig p { margin: 6px 0; }
.sig .row { margin-top: 10px; }
.sig .forest { margin: 8px 0; }
.leaflet-popup-content { margin: 12px 14px; min-width: 240px; max-width: 320px; }
.leaflet-popup-content .forest { margin: 0; border: 0; padding: 0; background: none; }

/* ─── Panel: kezdőnézet ─── */
.lead { font-size: .98rem; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stats div { background: var(--mint); border-radius: 10px; padding: 10px; text-align: center; font-size: .82rem; color: var(--forest); }
.stats b { display: block; font-family: var(--serif); font-size: 1.4rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card {
  display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 8px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; background: var(--white); text-align: left; width: 100%;
}
.card:hover { border-color: var(--forest-light); }
.card-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--mint); display: grid; place-items: center; color: var(--forest-mid); }
.card-img svg { width: 24px; height: 24px; }
.card-t { font-weight: 600; font-size: .92rem; }
.card-m { font-size: .8rem; color: var(--ink-soft); }
.layer-help { margin-top: 18px; padding: 12px; background: #f4f7f5; border-radius: 10px; font-size: .85rem; }
.layer-help ul { margin: 6px 0 0; padding-left: 18px; }

/* ─── Állapotcímke ─── */
.status { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef1ef; color: var(--ink-soft); }
.st-uj, .st-ellenorzes { background: #fbf3d9; color: #6b5310; }
.st-megerositett, .st-hatosagnal { background: #fde7dc; color: #8a2d0c; }
.st-engedelyezett { background: #e9eef8; color: #2c4a7a; }
.st-megoldva { background: var(--mint); color: var(--forest); }
.st-archivalt { background: #eee; color: #666; }

/* ─── Részletek ─── */
.back { margin-bottom: 10px; }
.d-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.d-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--white); }
.d-icon svg { width: 20px; height: 20px; }
.d-icon.erdo { background: var(--forest-mid); }
.d-icon.viz { background: var(--water); }
.d-cat { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--forest); line-height: 1.2; }
.d-meta { font-size: .82rem; color: var(--ink-soft); }
.d-text { white-space: pre-wrap; }
.note { font-size: .85rem; background: #f4f7f5; padding: 8px 10px; border-radius: 8px; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 10px 0; }
.tags li { font-size: .8rem; background: var(--mint); color: var(--forest); border-radius: 999px; padding: 3px 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .88rem; margin: 10px 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }
.d-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--mint-dark); }
.timeline li { position: relative; padding: 0 0 12px 10px; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--forest-light); border: 2px solid var(--white); }
.timeline .t-at { color: var(--ink-soft); font-size: .78rem; }

/* ─── Erdőrészlet-kártya ─── */
.forest { border: 1px solid var(--mint-dark); background: #f6fbf7; border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: .86rem; }
.forest-muted { background: #f5f6f5; border-color: var(--border); color: var(--ink-soft); }
.forest-h { font-size: .95rem; }
.forest-h span { color: var(--ink-soft); }
.forest-h b { font-family: var(--serif); color: var(--forest); }
.flags { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; padding: 0; }
.flag { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fde7dc; color: #8a2d0c; }
.flag-terv_tarvagas, .flag-terv_felujito { background: #e9eef8; color: #2c4a7a; }
.forest-dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0; }
.forest-dl dt { color: var(--ink-soft); }
.forest-dl dd { margin: 0; }
.forest-plan { border-top: 1px dashed var(--mint-dark); margin-top: 8px; padding-top: 8px; }
.forest-sub { font-weight: 700; color: var(--forest); font-size: .85rem; }
.fah { margin: 4px 0; padding-left: 18px; }
.forest details { margin-top: 6px; }
.forest .src { font-size: .72rem; color: var(--ink-soft); margin: 8px 0 0; }

/* ─── Űrlap ─── */
.steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: s; }
.steps li { flex: 1; font-size: .72rem; color: var(--ink-soft); border-top: 3px solid var(--border); padding-top: 4px; }
.steps li.on { color: var(--forest); border-color: var(--gold); font-weight: 700; }
.steps li.done { border-color: var(--forest-light); }
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tp { display: grid; gap: 4px; justify-items: start; padding: 12px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--white); cursor: pointer; text-align: left; }
.tp b { display: flex; gap: 8px; align-items: center; font-size: 1.05rem; }
.tp svg { width: 20px; height: 20px; }
.tp small { color: var(--ink-soft); font-size: .78rem; }
.tp.on.tp-erdo { border-color: var(--forest-mid); background: var(--mint); }
.tp.on.tp-viz { border-color: var(--water); background: var(--water-light); }
.cats { display: grid; gap: 6px; }
.cat { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.cat:hover { border-color: var(--forest-light); }
.cat input { margin-top: 3px; accent-color: var(--forest-mid); }
.cat b { font-size: .92rem; }
.cat small { display: block; color: var(--ink-soft); font-size: .8rem; }
.cat.on { border-color: var(--forest-mid); background: #f6fbf7; }
.field { display: grid; gap: 4px; margin: 12px 0; font-size: .9rem; }
.field > span { font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--white);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-dim); }
.field textarea { resize: vertical; min-height: 110px; }
.field .small { font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 12px 0; }
.chips legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.chip { border: 1px solid var(--border); background: var(--white); border-radius: 999px; padding: 5px 11px; font-size: .82rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--forest-mid); border-color: var(--forest-mid); color: var(--white); }
.upload { display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--forest-light); border-radius: var(--radius); padding: 16px; cursor: pointer; color: var(--forest); font-weight: 600; background: #f6fbf7; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid var(--gold); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 10px 0; }
.thumb { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #eef1ef; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(13,20,26,.7); color: var(--white); cursor: pointer; line-height: 1; }
.thumb .gps { position: absolute; left: 4px; bottom: 4px; font-size: .65rem; font-weight: 700; background: var(--gold); color: var(--forest); padding: 1px 6px; border-radius: 999px; }
.thumb.busy { display: grid; place-items: center; font-size: .75rem; color: var(--ink-soft); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.loc { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: #f4f7f5; font-size: .88rem; }
.loc b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin: 10px 0; font-size: .88rem; align-items: start; }
.check input { margin-top: 3px; accent-color: var(--forest-mid); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; position: sticky; bottom: -28px; background: var(--white); padding: 10px 0 12px; border-top: 1px solid var(--border); }
.err { color: var(--alert); font-size: .88rem; font-weight: 600; margin: 8px 0; }
.ok { color: var(--forest-mid); font-weight: 600; }
.progress { height: 8px; background: #eef1ef; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress div { height: 100%; width: 0; background: var(--forest-mid); transition: width .2s; }
.summary { font-size: .88rem; background: #f4f7f5; border-radius: 10px; padding: 10px 12px; }
.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; }
.summary dt { color: var(--ink-soft); }
.summary dd { margin: 0; }
.code-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.4rem; font-weight: 700; color: var(--forest); letter-spacing: .04em; }
.copy { display: flex; gap: 6px; margin: 10px 0; }
.copy input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .8rem; background: #f7f8f7; }

/* ─── Fotónéző ─── */
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(8,14,11,.92); display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 6px; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: var(--white); font-size: 2rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lb-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 12px; top: 50%; }
.lb-next { right: 12px; top: 50%; }

/* ─── Statikus oldalak ─── */
.doc main { max-width: 780px; margin: 0 auto; padding: calc(var(--top) + 32px) 22px 64px; }
.doc h1 { font-size: 2rem; margin: 0 0 .6rem; }
.doc h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.doc p, .doc li { font-size: 1rem; }
.doc table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: 10px 0; }
.doc th, .doc td { border-bottom: 1px solid var(--border); text-align: left; padding: 6px 8px; vertical-align: top; }
.doc code, .doc pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; background: #f1f4f2; border-radius: 6px; }
.doc code { padding: 1px 5px; }
.doc pre { padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.doc .box { background: var(--mint); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.doc footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--ink-soft); }
.noscript { position: fixed; top: 80px; left: 20px; right: 20px; z-index: 3000; background: var(--white); padding: 16px; border-radius: 10px; }
