/* Fráboðanargongd. Fartelefon: kort fyrst (stig 1), síðani skjal á fullum skermi
   (stig 2). Desktop: kort og skjal síðu við síðu. Innlisið seinast, tí kort.css
   og shared.css hava eldri reglur við somu specificity. */

/* Knøttar beint á kortinum */
.map-overlay-button{position:absolute;z-index:950;display:flex;align-items:center;gap:8px;min-height:46px;border:2px solid #fff;border-radius:999px;background:#173b2b;color:#fff;padding:9px 16px;font:700 .95rem/1.2 system-ui,sans-serif;box-shadow:0 2px 12px #092f2055;cursor:pointer}
.map-overlay-button:hover,.map-overlay-button:focus-visible{background:#285f44}
.map-overlay-button:disabled{cursor:progress;opacity:.85}
.map-overlay-button svg{flex-shrink:0}
.map-geo-button{right:12px;bottom:30px}
/* Vegleiðingin tekur ikki ímóti trýstum: kortið undir henni virkar sum vanligt. */
.map-instruction{position:absolute;z-index:940;top:10px;left:62px;right:12px;width:fit-content;max-width:min(340px,calc(100% - 74px));margin-inline:auto;padding:7px 11px;border:1px solid #a3b99c;border-radius:12px;background:#fffdf8f2;color:#173b2b;box-shadow:0 2px 10px #173b2b33;pointer-events:none;font:13px/1.3 system-ui,sans-serif}
.map-instruction strong{display:block;font-size:15px;line-height:1.25}
.map-instruction span{display:block;margin-top:2px}
.map-filters-toggle{display:none;min-height:44px;padding:5px 0;border:0;background:none;color:#275b40;font:700 .88rem/1.3 system-ui,sans-serif;text-decoration:underline;cursor:pointer}
.map-filters-head{display:none}

/* Valda staðið */
.selected-pin{background:none;border:0;cursor:grab}
.selected-pin:active{cursor:grabbing}
.selected-pin svg{display:block;filter:drop-shadow(0 3px 4px #0a234166)}
#map{touch-action:none}

/* Stig 1: staður */
.location-card{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:8px;padding:10px 14px;background:#fff;border:1px solid #d8e5d6;border-radius:13px;font-size:.92rem;line-height:1.4}
.location-summary{flex:1 1 280px;min-width:0}
.location-card h3{margin:0;font-size:1.05rem;line-height:1.3;color:#173b2b}
.location-card p{margin:0}
.flow-step{margin:0;color:#275b40;font-size:.76rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.location-card>.location-summary>.flow-step{display:none}
.location-hint{color:#3f5548}
.location-feedback:not(:empty){margin-top:5px;padding:6px 9px;border-radius:8px;background:#fff4dd;color:#50350d}
.location-actions{display:flex;flex-wrap:wrap;gap:8px}
.flow-primary,.flow-secondary,.location-more button,#retry-tiles{min-height:44px;border-radius:10px;padding:9px 15px;font:700 1rem/1.2 system-ui,sans-serif;cursor:pointer}
.flow-primary{border:0;background:#275b40;color:#fff}
.flow-primary:hover,.flow-primary:focus-visible{background:#173b2b}
.flow-secondary,.location-more button,#retry-tiles{border:1px solid #a3b99c;background:#fffdf8;color:#173b2b}
#report-next{display:none}
.needs-confirm #report-next{display:inline-flex;align-items:center;justify-content:center;gap:8px}
#back-to-photo{display:none}
/* Tvey javngóð byrjanarstøð: mynd fyrst ella stað fyrst. */
.start-choice{flex:1 1 100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.start-choice .flow-primary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:68px;padding:8px 10px;line-height:1.2}
.start-choice svg{flex-shrink:0}
/* Á minstu telefonunum fær kortið plássið heldur enn ikonini. */
@media (max-width:340px){.start-choice svg{display:none}.start-choice .flow-primary{min-height:56px}}
#to-location{width:100%}
.photo-feedback-warning{color:#7a3d00;font-weight:700}
.photo-guidance{margin:0 0 6px;color:#3f5548;font-size:.86rem;line-height:1.3}
.card-gallery{display:none}
/* Uttan dátugrunn: lítil viðmerking við Send, ikki ávaring oman á kortinum. */
.map-card .feedback.is-note{margin:0 0 4px;padding:0;background:none;color:#5b6b60;font-size:.76rem;line-height:1.25;text-align:center}
/* Fráboðanir: bert at síggja, einki nýtt merki verður sett. */
.browse-reports #map-instruction,.browse-reports #geo-button,.browse-reports .location-actions,.browse-reports .location-more,.browse-reports .card-gallery,.browse-reports .start-choice{display:none!important}
.location-more{flex:1 1 100%;font-size:.88rem}
.location-more summary{cursor:pointer;color:#275b40;font-weight:700;padding:5px 0}
.location-more[open]{display:grid;gap:8px;padding-bottom:4px}
.manual-coordinates{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 10px;margin-top:8px}
.manual-coordinates input{width:100%;min-height:42px;padding:7px 9px;border:1px solid #b7caba;border-radius:8px;font:inherit;font-size:16px}
.manual-coordinates button{grid-column:1/-1}
.location-card .tile-message:empty{display:none}

/* Stig 2: skjalið */
.report-sheet-header{display:none}
.map-card button{font-family:inherit}
.report-location{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 6px;padding:8px 11px;border-radius:10px;background:#eef4ea}
.map-card .report-location .coordinate{margin:0;font-weight:650}
#change-location{display:none}
.map-card .field-label{display:block;font-weight:700}
.map-card h3:focus{outline:0}
.map-grid>.map-card{padding-bottom:0}
.report-sheet-footer{position:sticky;bottom:0;padding-block:8px 12px;background:#fff}
.map-grid>.map-card button[type="submit"]{width:100%;min-height:48px;font-size:1.02rem}
.map-card .feedback:empty{display:none}
.map-card .feedback{min-height:0;margin:0 0 8px;padding:8px 11px;border-radius:9px;background:#eef4ea;color:#173b2b}
.map-card .feedback.is-error{background:#fbe9e6;color:#7a1f16}
.map-card .flow-secondary{width:100%;background:#fffdf8;color:#173b2b;border:1px solid #a3b99c}
.photo-picker{position:relative}
.photo-picker .photo-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.map-card .photo-picker .photo-actions label{display:flex;align-items:center;justify-content:center;text-align:center;margin:0;line-height:1.2}
.photo-picker input[type="file"]:focus-visible+label{outline:3px solid #b45c13;outline-offset:2px}
.photo-picker .remove-photo{grid-column:1/-1}
.photo-picker input[type="file"]:disabled+label{opacity:.5;cursor:not-allowed}

/* Kvittan: bert boðini og leiðin aftur til kortið eru eftir. */
#report-form.is-success .report-sheet-body,#report-form.is-success #submit-button{display:none}
#report-form.is-success .report-sheet-header{display:none}
#report-form.is-success .report-sheet-footer{position:static;padding-top:0}
#report-form.is-success .feedback{padding:18px 16px;font-size:1.08rem;font-weight:650;line-height:1.4;background:#e4f1dc}
#report-form.is-success .feedback::before{content:"✓";display:block;margin-bottom:6px;font-size:2rem;line-height:1;color:#275b40}
.map-card #report-done{min-height:48px;border:0;background:#275b40;color:#fff;font-size:1.02rem}

@media (max-width:760px),(max-height:520px){
  .map-app-header{flex-basis:48px;padding:0 12px}
  .map-app-header .app-label{display:none}
  .map-app-header .app-brand .app-brand-leaf{width:26px;height:28px}

  /* Leitan er ein reglulig linja; keldan sæst, tá leitað verður. */
  .location-search{order:0;flex-shrink:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 8px;border-bottom:1px solid #c5d5c1}
  .location-search label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .location-search input{width:100%;max-width:none;min-height:42px;padding:7px 10px;font-size:16px}
  .location-search button{min-height:42px;padding:7px 13px;font-size:.95rem}
  .location-search p,.location-search #location-message,.location-search .location-results{grid-column:1/-1}
  .location-search .search-attribution{display:none;font-size:.72rem;line-height:1.3;margin:0}
  .location-search:focus-within .search-attribution,.location-search:has(.location-results:not(:empty)) .search-attribution{display:block}
  #location-message{font-size:.86rem;line-height:1.3}
  #location-message:empty{display:none}
  .location-results{max-height:112px}
  .location-results button{min-height:40px}

  /* Stig 1: kortið tekur alt plássið, kortið við staðnum er undir tí. */
  .map-grid{order:1;flex:1;min-height:0;display:flex}
  .map-grid>div.map-column:first-child{flex:1;min-width:0;min-height:0;max-height:none;padding:0;overflow:visible;display:flex;flex-direction:column}
  .map-shell{flex:1 1 0;min-height:0}
  #map{min-height:0;border:0;border-radius:0}
  .browse-reports .map-filters-toggle{display:block}
  .start-choice{display:none}
  .card-gallery{display:block;min-height:44px;padding:9px 0;color:#275b40;font-size:.92rem;cursor:pointer}
  .card-gallery strong{text-decoration:underline}
  #back-to-photo{display:inline-block}
  .location-card{flex:0 0 auto;display:block;margin:0;max-height:55%;overflow:auto;padding:10px 14px calc(10px + env(safe-area-inset-bottom));border:0;border-top:1px solid #c5d5c1;border-radius:0}
  .location-card>.location-summary>.flow-step{display:block}
  .location-actions{margin-top:9px}
  .location-actions:has(>button:not([hidden]))~.location-more{margin-top:6px}
  #report-next{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:1 1 110px;min-height:48px;font-size:1.05rem}
  .location-actions .flow-secondary{flex:0 1 auto;font-size:.92rem;padding-inline:12px}
  .location-actions:not(:has(>button:not([hidden]))){display:none}
  .location-more{margin-top:4px}

  /* Valið av, hvat kortið vísir, og frágreiðingin eru í einum panel, ikki altíð sjónlig. */
  .lifecycle-map-tools{order:2;display:none;position:fixed;inset:auto 0 0 0;z-index:1200;max-height:80%;overflow-y:auto;gap:8px 12px;padding:14px 16px calc(14px + env(safe-area-inset-bottom));background:#f7faf2;border-top:1px solid #a3b99c;border-radius:16px 16px 0 0;box-shadow:0 -6px 24px #173b2b33}
  .lifecycle-map-tools.is-open{display:flex}
  .lifecycle-map-tools label{position:static;width:auto;height:auto;overflow:visible;clip-path:none;flex:1 1 100%;font-size:.9rem}
  .lifecycle-map-tools select{flex:1 1 100%;min-height:46px;font-size:16px}
  .lifecycle-map-tools .lifecycle-legend{flex:1 1 100%;gap:6px 14px;font-size:.86rem}
  .map-filters-head{display:flex;flex:1 1 100%;align-items:center;justify-content:space-between;gap:12px}
  .map-filters-head h3{margin:0;font-size:1.08rem;color:#173b2b}
  .map-filters-head button{min-height:42px;padding:7px 13px;border:1px solid #a3b99c;border-radius:9px;background:#fffdf8;color:#173b2b;font:700 .92rem system-ui,sans-serif;cursor:pointer}
  .map-note{display:block;margin:0;font-size:.82rem;color:#516659}

  /* Stig 2: skjalið er ein egin skermur við føstum send-knøtti. */
  .map-grid>.map-card{display:none}
  .report-form-open .map-grid>.map-card{position:fixed;inset:0;z-index:1100;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:100%;height:100vh;height:100dvh;max-height:none;padding:0;overflow:hidden;border:0;border-radius:0;background:#fff}
  .report-form-open .map-app-header,.report-form-open .location-search,.report-form-open .map-column,.report-form-open .lifecycle-map-tools{visibility:hidden}
  .report-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:4px 12px 4px 4px;background:#173b2b;color:#fff}
  .report-sheet-header .flow-step{color:#d9ead9;white-space:nowrap}
  .map-grid>.map-card .back-to-map{min-height:44px;padding:8px 10px;background:none;color:#fff;font-size:1rem;text-align:left}
  .report-sheet-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px 16px 18px;scroll-padding-block:16px}
  .report-sheet-body>*,.report-sheet-footer>*{width:100%;max-width:620px;margin-inline:auto}
  .map-card h3{margin:0 0 8px;font-size:1.22rem;line-height:1.25}
  .map-card label,.map-card .field-label{margin:10px 0 4px;font-size:.96rem}
  .map-card select,.map-card input[type="text"],.map-card textarea{min-height:46px;margin:0;font-size:16px}
  .map-card .plant-guide-link{margin:7px auto 4px;padding:5px 9px;font-size:.9rem;line-height:1.35}
  .map-card .plant-guide-link small{margin-top:1px;font-size:.76rem}
  #change-location{display:block;flex-shrink:0;min-height:42px;padding:7px 11px;background:#fffdf8;color:#173b2b;border:1px solid #a3b99c;font-size:.9rem}
  .map-card .report-location .coordinate{font-size:.86rem;line-height:1.3}
  .photo-picker{margin:10px auto 0;gap:5px}
  .map-card .photo-picker .field-label{margin:0}
  .map-card .photo-picker .photo-actions{gap:8px}
  .map-card .photo-picker .photo-actions label{min-height:46px;padding:8px;font-size:.93rem}
  .map-card .photo-picker .remove-photo{min-height:42px}
  .photo-picker small{font-size:.78rem;line-height:1.3}
  .photo-preview{max-height:110px;justify-self:start}
  .map-card .consent{margin:12px auto 0;font-size:.86rem;line-height:1.35}
  .map-card .consent input{flex:0 0 22px;width:22px;height:22px;margin:1px 0 0}
  .report-sheet-footer{position:static;padding:8px 16px calc(10px + env(safe-area-inset-bottom));border-top:1px solid #d8e5d6;box-shadow:0 -3px 12px #173b2b14}
  .map-card .feedback{font-size:.92rem;line-height:1.35}
  .report-form-open #report-form.is-success{grid-template-rows:auto;align-content:center}
  #report-form.is-success .report-sheet-footer{border-top:0;box-shadow:none;padding-block:16px}
}

/* Telefon á tvørs: kort og staðarkort síðu við síðu. */
@media (max-height:520px) and (min-width:561px){
  .map-grid>div.map-column:first-child{flex-direction:row}
  .location-card{flex:0 0 min(44%,330px);max-height:none;border-top:0;border-left:1px solid #c5d5c1}
  .map-geo-button{bottom:26px}
}

@media (prefers-reduced-motion:reduce){.map-overlay-button{transition:none}}
