/* Aarnituli application tokens. Provider tiles and persisted badges stay independent. */
:root{font-family:system-ui,-apple-system,sans-serif;font-size:18px;color:var(--text);background:var(--background);color-scheme:light;
--aarnituli-blue:#00B4FF;--night-blue:#0A1A2B;--forest-teal:#0F3D3A;--frost:#C7D2DB;--status-ok:#22C55E;--status-warning:#F59E0B;--status-triggered:#EF4444;--status-offline:#64748B;
--background:#E7E8E2;--surface:#F1F1EC;--surface-raised:#DCE4E1;--text:#0A1A2B;--text-muted:#405B65;--border:#B1C3CB;--border-strong:#607B86;--primary:#0F3D3A;--primary-text:#F1F6F8;--accent:#00B4FF;--accent-text:#0A1A2B;--success:#176A3B;--warning-surface:#F8E8C8;--warning-text:#674000;--danger:#A12223;--danger-surface:#FFF0ED;--header:#0A1A2B;--header-text:#E6EEF3;--shadow:#0A1A2B33;--shadow-strong:#0A1A2B66;--scrim:#0A1A2B55;--auth-shade:#0A1A2B33;--auth-surface:#0A1A2BEF;--auth-text:#E6EEF3;--auth-muted:#C7D2DB;--control:#0F3D3A;--control-text:#F1F6F8;--brand-edge:#397487;--focus:#00658F;--edge-light:#FFFFFF80;--edge-dark:#0A1A2B30;--surface-light:#FFFFFF14;--surface-shade:#0F3D3A06;--radius:8px;--panel-radius:10px;--map-ground:#1C4A3E;--map-ink:#143e2d;--map-paper:#fffdf7}
:root[data-theme=dark]{color-scheme:dark;--background:#0A1A2B;--surface:#102735;--surface-raised:#173B42;--text:#E6EEF3;--text-muted:#C7D2DB;--border:#365862;--border-strong:#698791;--primary:#C7D2DB;--primary-text:#0A1A2B;--accent:#00B4FF;--accent-text:#0A1A2B;--success:#22C55E;--warning-surface:#40331C;--warning-text:#F5C775;--danger:#FFB4AD;--danger-surface:#422B32;--header:#0A1A2B;--header-text:#E6EEF3;--shadow:#0A1A2B33;--shadow-strong:#0A1A2B66;--scrim:#0A1A2B55;--auth-shade:#0A1A2B33;--auth-surface:#0A1A2BEF;--auth-text:#E6EEF3;--auth-muted:#C7D2DB;--control:#0F3D3A;--control-text:#E6EEF3;--brand-edge:#397487;--focus:#00B4FF;--edge-light:#C7D2DB24;--edge-dark:#0A1A2B99;--surface-light:#C7D2DB0D;--surface-shade:#0A1A2B22;}
@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--background:#0A1A2B;--surface:#102735;--surface-raised:#173B42;--text:#E6EEF3;--text-muted:#C7D2DB;--border:#365862;--border-strong:#698791;--primary:#C7D2DB;--primary-text:#0A1A2B;--accent:#00B4FF;--accent-text:#0A1A2B;--success:#22C55E;--warning-surface:#40331C;--warning-text:#F5C775;--danger:#FFB4AD;--danger-surface:#422B32;--header:#0A1A2B;--header-text:#E6EEF3;--shadow:#0A1A2B33;--shadow-strong:#0A1A2B66;--scrim:#0A1A2B55;--auth-shade:#0A1A2B33;--auth-surface:#0A1A2BEF;--auth-text:#E6EEF3;--auth-muted:#C7D2DB;--control:#0F3D3A;--control-text:#E6EEF3;--brand-edge:#397487;--focus:#00B4FF;--edge-light:#C7D2DB24;--edge-dark:#0A1A2B99;--surface-light:#C7D2DB0D;--surface-shade:#0A1A2B22;}}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}button,input,select{font:inherit}button{min-height:52px;padding:12px 20px;border:1px solid var(--edge-dark);border-radius:var(--radius);background:var(--control);color:var(--control-text);cursor:pointer;font-weight:650}button:disabled{opacity:.55;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.secondary{background:var(--surface-raised);color:var(--text)}.text-button{background:transparent;color:inherit;text-decoration:underline}input,select{width:100%;padding:14px;border:1px solid var(--border-strong);border-radius:var(--radius);min-height:52px;background:var(--surface);color:var(--text)}h1{font-size:28px}h2{font-size:24px;margin:0 0 16px}p{line-height:1.5}small,.secondary-text{font-size:16px;color:var(--text-muted)}
.app{height:100dvh;display:flex;flex-direction:column;overflow:hidden}header{display:flex;align-items:center;background:var(--header);color:var(--header-text);padding:10px 16px;padding-top:max(10px,env(safe-area-inset-top));min-height:48px;border-bottom:1px solid var(--border);flex:none}header strong{font-size:22px}main{flex:1;min-height:0;position:relative}#map-view,#map{height:100%;width:100%}#map{background:var(--map-ground)}.page{height:100%;overflow:auto;padding:24px 20px 100px;max-width:840px;margin:auto}.notice{margin:0;padding:10px 16px;background:var(--warning-surface);font-size:16px;color:var(--warning-text)}.map-notice{position:absolute;top:12px;left:12px;right:72px;z-index:650;margin:0;background:var(--warning-surface);padding:12px;border-radius:var(--radius);font-size:16px;box-shadow:0 2px 8px var(--shadow);pointer-events:none}.empty{position:absolute;left:16px;right:16px;top:25%;max-width:380px;margin:auto;background:var(--surface);padding:24px;border:1px solid var(--border);border-radius:var(--panel-radius);z-index:650;text-align:center}
#navigation{position:relative;background:var(--surface);border-top:1px solid var(--border);padding:12px 8px max(8px,env(safe-area-inset-bottom));z-index:700}nav{display:flex;justify-content:space-around}nav button{flex:1;background:transparent;color:var(--text-muted);max-width:200px}nav button[aria-current=page]{color:var(--primary);background:var(--surface-raised)}.add-button{position:absolute;bottom:calc(100% + 16px);left:50%;transform:translateX(-50%);border:3px solid var(--surface);border-radius:var(--panel-radius);min-height:60px;padding:12px 24px;box-shadow:0 4px 14px var(--shadow)}
.trap-row{display:flex;align-items:center;gap:16px;width:100%;text-align:left;margin-bottom:12px;background:var(--surface);color:var(--text);border:1px solid var(--border);padding:16px}.trap-row strong{display:block;font-size:20px}.trap-row .secondary-text{display:block;margin-top:6px}.trap-pin{width:44px;height:44px;border:3px solid var(--text);border-radius:50%;display:grid;place-items:center;background:var(--surface);font-weight:800;font-size:25px;box-shadow:0 0 0 3px var(--surface),0 2px 8px var(--shadow-strong);flex:none}.trap-pin.idle{border-style:dashed}.condition-ok{color:var(--success)}.condition-check{color:var(--warning-text);background:var(--warning-surface)}.condition-triggered{color:var(--danger);background:var(--danger-surface)}.condition-unknown{color:var(--text-muted)}.trap-marker{display:grid;place-items:center}.selecting .trap-marker{pointer-events:none}
dialog{padding:24px;border:1px solid var(--border);border-radius:12px 12px 0 0;background:var(--surface);color:var(--text);width:min(100%,520px);max-height:85dvh;margin:auto auto 0;box-shadow:0 -8px 40px var(--shadow);overflow:auto}dialog::backdrop{background:var(--scrim)}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.sheet-head h2{margin:0}.sheet-head button{padding:12px}.sheet-body,#sheet-body{display:grid;gap:16px;margin-top:20px}#sheet-body p{margin:0}#sheet-body form{display:grid;gap:16px}.condition-line{font-size:22px;font-weight:650}.status-line{font-weight:650}.location-bar{position:absolute;bottom:16px;left:16px;right:16px;z-index:700;background:var(--surface);padding:16px;border-radius:var(--panel-radius);display:grid;gap:8px;max-width:480px;margin:auto}.location-bar p{margin:0;font-size:16px}#location-crosshair{position:absolute;top:50%;left:50%;width:28px;height:28px;transform:translate(-50%,-50%);z-index:650;pointer-events:none}#location-crosshair i{position:absolute;display:block;background:#0A1A2B;box-shadow:0 0 0 1px #fff; border-radius:1px}#location-crosshair i:nth-child(1),#location-crosshair i:nth-child(2){width:2px;height:8px;left:13px}#location-crosshair i:nth-child(1){top:0}#location-crosshair i:nth-child(2){bottom:0}#location-crosshair i:nth-child(3),#location-crosshair i:nth-child(4){height:2px;width:8px;top:13px}#location-crosshair i:nth-child(3){left:0}#location-crosshair i:nth-child(4){right:0}.leaflet-control-zoom a{min-width:48px;min-height:48px;line-height:48px!important}.leaflet-control-attribution{max-width:100%;font-size:12px!important}.leaflet-bottom{bottom:90px}.leaflet-control-attribution a{color:var(--map-ink)}.location-mode .leaflet-bottom{bottom:auto;top:72px;left:12px;right:72px;pointer-events:none}.location-mode .leaflet-control-attribution{pointer-events:auto;max-width:100%;margin:0}

fieldset{min-width:0;border:0;padding:0;margin:0}legend{font-weight:650;margin-bottom:12px}
.condition-choices{display:grid;gap:8px}.condition-choices label,.theme-options label{position:relative;cursor:pointer;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border:2px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.condition-choices input,.theme-options input{width:22px;height:22px;min-height:0;padding:0;flex:none;accent-color:var(--primary)}
.condition-choices label:has(:checked),.theme-options label:has(:checked){border-color:var(--primary);background:var(--surface-raised);font-weight:750}
.condition-choices label:focus-within,.theme-options label:focus-within{outline:3px solid var(--focus);outline-offset:2px}
.theme-control{margin:28px 0}.theme-options{display:flex;gap:6px}.theme-options label{flex:1;justify-content:center;padding:10px 5px;font-size:16px;gap:5px}.theme-options input{width:16px;height:16px}
.load-retry{align-self:flex-start;margin:6px 16px;font-size:16px}
.toast{position:fixed;top:max(60px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:1000;max-width:calc(100vw - 32px);width:max-content;padding:10px 16px;border:1px solid var(--border);border-radius:var(--panel-radius);background:var(--surface);color:var(--text);box-shadow:0 4px 16px var(--shadow);font-size:16px;pointer-events:none}
dialog .toast{position:static;transform:none;margin:16px 0 0;max-width:100%;width:fit-content}
/* Map overlays use a fixed contrast palette, independent of application surfaces. */
.trap-marker{--marker-edge:#10291e;--marker-paper:#fffdf5;--marker-halo:0 0 0 1.5px var(--marker-paper),0 0 0 3px var(--marker-edge),0 2px 2px 3px #07191080,0 6px 10px 2px #07191055}
/* The marker is a 44 px tap target; the visible pin inside it is about half the size of the old one. */
.trap-marker .trap-pin{position:relative;width:26px;height:26px;border-width:3px;border-color:var(--marker-edge);background:var(--marker-paper);box-shadow:var(--marker-halo);font-size:15px;font-weight:900;color:#35463c}
.trap-marker .trap-pin::before{content:"";position:absolute;inset:-3px;border-radius:50%;background:var(--marker-paper);z-index:-1}
.trap-marker .trap-pin{background-clip:padding-box;font-family:Arial,"Apple Symbols","Segoe UI Symbol",sans-serif;font-variant-emoji:text}
.trap-marker .condition-ok{color:#fffdf5;background-color:#31583c}.trap-marker .condition-check{color:#201d13;background-color:#cf9c47}.trap-marker .condition-triggered{color:#fffdf5;background-color:#a33f28}.trap-marker .condition-unknown{color:#fffdf5;background-color:#50514a}
/* Observations (H) and catches (S) on the map: small round badges in their own colours, under the trap pins.
   A numbered cluster stands for several records close together. */
.record-marker{display:grid;place-items:center}.selecting .record-marker{pointer-events:none}
.record-pin{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;border:2px solid #fffdf5;font:900 12px/1 Arial,"Apple Symbols","Segoe UI Symbol",sans-serif;color:#fffdf5;background:#50514a;box-shadow:0 0 0 1.5px #10291e,0 2px 3px #07191080}
.record-pin.kind-observations{background:#2f6f8f}.record-pin.kind-catches{background:#8a4b1f}
.record-pin.cluster{width:30px;height:30px;font-size:14px;background:#1c4a3e;color:#fffdf5}
.legend-pin{flex:none}
/* Generic selected location: all motion is above the stationary artwork base. */
.pending-marker{pointer-events:none;background:none;border:0}
.selected-location{display:block;width:40px;height:50px;color:#00B4FF}
.selected-location svg{display:block;width:100%;height:100%;overflow:visible;fill:#00B4FF;filter:drop-shadow(0 0 1px #EDF2F4) drop-shadow(0 2px 1px #0A1A2BCC) drop-shadow(0 4px 4px #0A1A2B99)}
.selected-location use{stroke:#0A1A2B;stroke-width:12;stroke-linejoin:round;paint-order:stroke fill;transform-box:view-box;transform-origin:141px 296px}
.location-flame-main{animation:location-fire-main 2.1s ease-in-out infinite}
.location-flame-side{animation:location-fire-side 2.7s ease-in-out -.8s infinite}
@keyframes location-fire-main{0%,100%{transform:skewX(0deg) scaleY(1);opacity:1}28%{transform:skewX(-1.5deg) scaleY(1.035);opacity:.92}63%{transform:skewX(1deg) scaleY(.985);opacity:.98}82%{transform:skewX(-.5deg) scaleY(1.015);opacity:.95}}
@keyframes location-fire-side{0%,100%{transform:skewX(.5deg) scaleY(1);opacity:.92}36%{transform:skewX(2deg) scaleY(.975);opacity:1}72%{transform:skewX(-1deg) scaleY(1.025);opacity:.88}}

/* Quiet relief and precise, substantial controls. */
button{background-image:linear-gradient(var(--surface-light),var(--surface-shade));box-shadow:inset 0 1px var(--edge-light),0 2px 3px var(--shadow);line-height:1.35}
button:not(:disabled):active{box-shadow:inset 0 2px 4px var(--edge-dark);background-image:linear-gradient(var(--surface-shade),transparent)}
.secondary{border-color:var(--border-strong)}
.text-button{border-color:transparent;background-image:none;box-shadow:none}
input,select{box-shadow:inset 0 2px 3px var(--edge-dark);line-height:1.35}
input[type=radio]{box-shadow:none}
h1,h2{font-weight:750;letter-spacing:-.025em;line-height:1.2}
header{box-shadow:inset 0 1px var(--edge-light);border-bottom-color:var(--brand-edge);background-image:linear-gradient(var(--surface-light),transparent)}
header strong{font-weight:750;letter-spacing:-.03em}
.empty,.location-bar,dialog{background-image:linear-gradient(160deg,var(--surface-light),transparent 45%,var(--surface-shade));box-shadow:inset 0 1px var(--edge-light),0 8px 28px var(--shadow);border:1px solid var(--border-strong)}
dialog{box-shadow:inset 0 1px var(--edge-light),0 -6px 32px var(--shadow);border-top-color:var(--brand-edge)}
.sheet-head{padding-bottom:16px;border-bottom:1px solid var(--border)}
.sheet-head h2{min-width:0;overflow-wrap:anywhere}.sheet-head button{flex:none}
#navigation{background-image:linear-gradient(var(--surface-light),transparent);box-shadow:inset 0 1px var(--edge-light),0 -3px 12px var(--shadow)}
nav button{box-shadow:none;background-image:none;border-color:transparent}
nav button[aria-current=page]{border:1px solid var(--border);border-bottom:3px solid var(--brand-edge);box-shadow:inset 0 1px 3px var(--edge-dark)}
.add-button{border:1px solid var(--brand-edge);box-shadow:inset 0 1px var(--edge-light),0 0 0 3px var(--surface),0 4px 12px var(--shadow-strong);font-size:20px;font-weight:750}
.trap-row{background-image:linear-gradient(var(--surface-light),transparent);box-shadow:inset 0 1px var(--edge-light),0 2px 4px var(--shadow)}
.condition-choices label,.theme-options label{box-shadow:inset 0 1px var(--edge-light),0 1px 2px var(--shadow)}
.condition-choices label:has(:checked),.theme-options label:has(:checked){box-shadow:inset 0 2px 4px var(--edge-dark);border-bottom-color:var(--brand-edge)}
.toast{border-left:3px solid var(--brand-edge);background-image:linear-gradient(var(--surface-light),transparent);box-shadow:inset 0 1px var(--edge-light),0 4px 16px var(--shadow)}
/* Enamel-like light catch stays inside the existing high-contrast map badges. */
.trap-marker .trap-pin{background-image:linear-gradient(165deg,#ffffff12,transparent 40%,#10291e0a)}

@media(min-width:800px){header{min-height:64px;padding-inline:24px}dialog{margin:auto 24px auto auto;max-height:calc(100dvh - 48px);border-radius:var(--panel-radius);width:400px}.page{padding:32px}.auth h1{font-size:48px}.map-notice{max-width:500px}.empty{right:auto;left:32px}.location-bar{bottom:24px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.selected-location use{animation:none!important;opacity:1;transform:none}}

/* Map Step 2: reference layers and temporary tools, independent of domain sheets. */
.map-layers-button{position:absolute;top:12px;left:12px;z-index:700;min-height:48px;font-size:16px;background:var(--surface);color:var(--text);border:1px solid var(--border-strong)}
#map-message{top:76px}.location-mode .map-layers-button{display:none}
/* Karttatasot: segments side by side (the chosen one filled) and on/off switches, so the sheet stays short. */
.layer-group{display:grid;gap:8px;margin-bottom:6px}.layer-group legend{margin-bottom:8px}
.layer-segments{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px}
.layer-segments label{position:relative;display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:48px;padding:6px 4px;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface-raised);font-size:15px;line-height:1.2;text-align:center;cursor:pointer;box-shadow:inset 0 1px var(--edge-light)}
.layer-segments input{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:0;opacity:0;cursor:pointer}
.layer-segments label:has(:checked){background:var(--primary);border-color:var(--primary);color:var(--primary-text);font-weight:750;box-shadow:inset 0 2px 4px var(--edge-dark)}
.layer-segments label:has(:disabled){opacity:.5;cursor:default}
.layer-segments label:focus-within,.layer-switches label:focus-within{outline:3px solid var(--focus);outline-offset:2px}
.layer-segments .legend-pin{transform:scale(.8);margin:-4px -2px}
/* On the narrowest phones a marker symbol sits above its name so that Havainnot still fits. */
@media(max-width:360px){.layer-segments label{flex-direction:column;gap:0;font-size:14px}}
.layer-switches label{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:4px 0}
.layer-switches input{appearance:none;-webkit-appearance:none;position:relative;flex:none;width:52px;height:32px;min-height:0;margin:0;padding:0;border:1px solid var(--border-strong);border-radius:16px;background:var(--surface-raised);box-shadow:inset 0 1px 3px var(--edge-dark);cursor:pointer;transition:background .15s}
.layer-switches input::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:var(--text-muted);transition:transform .15s,background .15s}
.layer-switches input:checked{background:var(--primary);border-color:var(--primary)}.layer-switches input:checked::after{transform:translateX(20px);background:var(--primary-text)}
.layer-switches input:disabled{opacity:.5;cursor:default}
.layer-switches .secondary-text{margin:0;font-size:14px}.layer-switches .secondary-text:empty{display:none}
@media(prefers-reduced-motion:reduce){.layer-switches input,.layer-switches input::after{transition:none}}
.period-choices #records-hint{margin:0;font-size:14px}.period-choices #records-hint:empty{display:none}
.layer-errors{position:absolute;top:76px;left:12px;right:72px;z-index:700;max-height:45%;overflow:auto}
.layer-error{background:var(--warning-surface);color:var(--warning-text);padding:12px;margin-bottom:8px;border:1px solid var(--border-strong);border-radius:var(--radius);font-size:16px}
.layer-error p{margin:0 0 8px}.layer-error button{font-size:16px;margin:4px 4px 0 0;min-height:48px;padding:8px}
dialog .layer-errors{position:static;max-height:none;overflow:visible}
.measurement-bar{position:absolute;bottom:12px;left:12px;right:12px;max-width:520px;margin:auto;z-index:700;padding:16px;background:var(--surface);color:var(--text);border:1px solid var(--border-strong);border-radius:var(--panel-radius);box-shadow:0 4px 16px var(--shadow)}
.measurement-bar p{font-size:16px;margin:8px 0}.measurement-bar output{display:block;font-weight:750;margin:12px 0;font-size:22px}
.measurement-actions{display:flex;gap:8px;flex-wrap:wrap}.measurement-actions button{flex:1;padding:12px 8px;font-size:16px;min-height:52px}
.measurement-mode .empty,body:has(#sheet[open]) .empty{display:none}.empty .text-button{margin:12px auto 0}.measurement-mode .leaflet-bottom{bottom:auto;top:72px;left:12px;right:72px;pointer-events:none}.measurement-mode .leaflet-control-attribution{pointer-events:auto;max-width:100%;margin:0}

/* Central replaceable brand assets; preserve their native aspect ratio. */
.brand-flame{display:block;object-fit:contain;flex:none}header{gap:10px}
.page a{color:var(--focus)}
.leaflet-control-zoom a{background:var(--surface);color:var(--text)}.leaflet-control-zoom a:hover{background:var(--surface-raised);color:var(--text)}.leaflet-control-zoom a.leaflet-disabled{background:var(--surface-raised);color:var(--text-muted)}

/* Portrait keeps the form in the first viewport; short screens scroll naturally. */
header .brand-flame{width:21px;height:26px}
/* Panels open centered over the map: one large main action, smaller secondary actions side by side below it. */
dialog.centered{margin:auto;width:min(calc(100% - 32px),440px);max-height:min(85dvh,calc(100dvh - 32px));border-radius:var(--panel-radius);padding:20px}
dialog.centered{background-color:color-mix(in srgb,var(--surface) 82%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
dialog.centered{font-size:16px}dialog.centered .sheet-head h2{font-size:20px}dialog.centered .condition-line{font-size:18px}dialog.centered .secondary-text{font-size:14px}dialog.centered #sheet-body p{margin:0}
dialog.centered .panel-primary{min-height:56px;font-size:18px;font-weight:750}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}#species-selection:empty{margin:0}
.archive-trap,.archive-record{margin:0 auto;min-height:44px;font-size:15px}
.panel-actions{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:8px}.panel-actions button{min-height:48px;padding:8px;font-size:15px}

/* Mobile sheets: retain map context and allow for the home indicator. */
@media(max-width:799px){
 dialog{padding:16px 16px max(16px,env(safe-area-inset-bottom));max-height:min(85dvh,calc(100dvh - max(64px,env(safe-area-inset-top))))}
 .sheet-head{padding-bottom:10px;gap:12px}
 #sheet-body{margin-top:12px;gap:12px}#sheet-body form{gap:12px}
 .location-bar{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));padding:12px;gap:8px}
}

/* Recording controls reuse the existing surfaces, relief and touch sizing. */
.record-species select,.record-notes textarea{width:100%;font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px;min-height:48px;box-sizing:border-box}
.quantity-control{display:grid;grid-template-columns:52px minmax(80px,1fr) 52px;gap:12px;align-items:center}
.quantity-control button{min-height:48px;margin:0;font-size:1.4rem}
.quantity-control input{text-align:center;min-width:0}
.record-notes{display:grid;gap:8px}.record-notes[hidden]{display:none}

.record-notes textarea{resize:vertical}

/* Shared picker: compact typical choices; the complete catalog is searchable. */
.species-results{max-height:12rem;overflow-y:auto;overscroll-behavior:contain;padding:.2rem}
.species-choice-group{display:flex;flex-wrap:wrap;gap:.3rem}
.species-heading{flex-basis:100%;margin:.2rem 0;font-size:.85rem;font-weight:650}
.species-results button{min-height:44px;min-width:44px;padding:6px 10px;font-size:.85rem;text-align:left;overflow-wrap:anywhere;box-shadow:none;background-image:none}
.species-results button[aria-pressed="true"]{outline:2px solid var(--text);outline-offset:-3px;font-weight:800}
#species-selection{margin:.3rem 0;font-size:.85rem;font-weight:600}

/* Map targeting stays centered; only the reticle's visual footprint changes. */
#location-crosshair{width:40px;height:40px}
#location-crosshair i{background:#F1F6F8;box-shadow:0 0 0 1.5px #0A1A2B,0 2px 3px #0A1A2B80}
#location-crosshair i:nth-child(1),#location-crosshair i:nth-child(2){width:3px;height:13px;left:18.5px}
#location-crosshair i:nth-child(3),#location-crosshair i:nth-child(4){height:3px;width:13px;top:18.5px}
.leaflet-container .leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 90%,transparent);color:var(--text);border:1px solid var(--border);border-radius:4px;padding:3px 6px;font-size:11px!important;line-height:1.4;box-shadow:0 1px 4px var(--shadow);max-width:calc(100vw - 24px);margin-right:max(8px,env(safe-area-inset-right));margin-bottom:max(4px,env(safe-area-inset-bottom))}
.leaflet-container .leaflet-control-attribution a{color:var(--text);text-decoration:underline}
nav .profile-icon{display:block;margin:auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#list-view h1,#account-view h1{margin-bottom:12px}
#list-view h2{font-size:1rem;margin:0 0 12px}
#list-view .trap-row{gap:12px;padding:10px 12px;margin-bottom:6px;box-shadow:none;background-image:none}
#list-view .trap-row strong{font-size:1rem}
#list-view .trap-row .secondary-text{font-size:.85rem;margin-top:3px}
#list-view .trap-pin{width:36px;height:36px;font-size:21px}
#account-view .theme-control{padding:12px;margin-block:12px}
#account-view .theme-options label{min-height:44px}
#account-view #logout{min-height:44px;padding:8px 14px;box-shadow:none;background-image:none;border-color:var(--border-strong)}
.record-row{padding:10px 12px;margin-bottom:6px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}.record-row strong{display:block;font-size:1rem}.record-row .secondary-text{display:block;font-size:.85rem;margin-top:3px}.record-pending{border-style:dashed}
#list-view #trap-list+h2{margin-top:24px}
.outbox{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}.outbox span{flex:1 1 12rem}.outbox button{min-height:44px;padding:8px 14px;font-size:16px}

/* Kartta: the map fills the screen; identity, notices and navigation float over it.
   --map-top/--map-bottom are measured by app.js so map controls never sit under them. */
:root{--map-top:0px;--map-bottom:0px;--map-zoom-top:0px}
.app.map-full{display:grid;grid-template-columns:100%;grid-template-rows:auto auto auto auto auto 1fr auto}
.map-full>main{grid-area:1/1/-1/2;z-index:0}
.map-full>header,.map-full>.notice,.map-full>.load-retry{position:relative;z-index:1;align-self:start}
.map-full>header{grid-area:1/1;justify-self:start;min-height:44px;margin:max(8px,env(safe-area-inset-top)) 0 0 max(12px,env(safe-area-inset-left));padding:6px 14px;border:1px solid var(--border-strong);border-radius:var(--panel-radius);background-color:color-mix(in srgb,var(--header) 88%,transparent);box-shadow:inset 0 1px var(--edge-light),0 2px 10px var(--shadow)}
.map-full>header strong{font-size:20px}
.map-full>#message{grid-area:3/1}.map-full>#outbox{grid-area:4/1}
.map-full>.notice{margin:8px max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));border-radius:var(--radius);box-shadow:0 2px 8px var(--shadow)}
.map-full>.load-retry{grid-area:5/1;justify-self:start;margin:8px 0 0 max(12px,env(safe-area-inset-left))}
.map-full>#navigation{grid-area:7/1;margin:0 max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));padding:8px;border:1px solid var(--border-strong);border-radius:var(--panel-radius)}
.map-full .map-layers-button{top:calc(var(--map-top) + 12px);left:max(12px,env(safe-area-inset-left))}
.map-full .layer-errors{top:calc(var(--map-top) + 76px)}
.map-full .map-notice{top:calc(var(--map-top) + 12px)}
.map-full .empty{top:max(25%,calc(var(--map-top) + 72px),calc(var(--map-zoom-top) + 120px))}
@media(max-height:700px){.map-full .empty{padding:16px}.map-full .empty h2{margin-bottom:8px}.map-full .empty p{margin:0 0 12px}}
.map-full .leaflet-top{top:var(--map-zoom-top)}
.map-full .leaflet-right{right:env(safe-area-inset-right)}
.map-full .leaflet-left{left:env(safe-area-inset-left)}
.map-full .leaflet-bottom{bottom:calc(var(--map-bottom) + 90px)}
.map-full.app .location-mode .leaflet-bottom,.map-full.app .measurement-mode .leaflet-bottom{bottom:auto;top:calc(var(--map-top) + 72px);left:max(12px,env(safe-area-inset-left));right:72px;pointer-events:none}
.map-full.app .location-mode .leaflet-bottom{top:calc(var(--map-top) + 12px)}
.map-full .location-mode .leaflet-control-attribution,.map-full .measurement-mode .leaflet-control-attribution{pointer-events:auto;max-width:100%;margin:0}
.map-full .measurement-bar{bottom:calc(var(--map-bottom) + max(12px,env(safe-area-inset-bottom)))}
.map-full .location-bar{bottom:calc(var(--map-bottom) + max(12px,env(safe-area-inset-bottom)))}
.toast{top:max(60px,env(safe-area-inset-top),calc(var(--map-top) + 8px))}
/* Floating map controls let the map show through; blur keeps their text readable on busy terrain.
   All floating controls share the identity tile's and navigation's corner radius. */
.map-full>header{background-color:color-mix(in srgb,var(--header) 60%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.map-full>#navigation,.map-full .map-layers-button,.map-full .leaflet-control-zoom a{background-color:color-mix(in srgb,var(--surface) 60%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.map-full nav button[aria-current=page]{background-color:color-mix(in srgb,var(--surface-raised) 70%,transparent)}
.map-full .map-layers-button,.map-full .add-button{border-radius:var(--panel-radius)}
.map-full .leaflet-control-zoom{border-radius:var(--panel-radius);overflow:hidden;border:1px solid var(--border-strong)!important;box-shadow:0 2px 8px var(--shadow)}
.map-full .leaflet-control-zoom a{border-radius:0!important;border-color:var(--border)}
.map-full .add-button{min-height:48px;padding:8px 18px;font-size:17px;box-shadow:inset 0 1px var(--edge-light),0 2px 8px var(--shadow-strong);background-color:color-mix(in srgb,var(--control) 65%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
/* Map credits sit at the very bottom edge, under the floating navigation. */
.map-full>#navigation{margin-bottom:calc(max(4px,env(safe-area-inset-bottom)) + 24px)}
.map-full .leaflet-bottom{bottom:max(2px,env(safe-area-inset-bottom))}
.map-full .leaflet-bottom.leaflet-right .leaflet-control-attribution{margin:0 max(8px,env(safe-area-inset-right)) 0 0;font-size:10px!important;padding:1px 6px}
.map-full .map-layers-button{min-height:44px;padding:6px 12px;font-size:15px}

/* Background tiles are white outside Finland. The area outside the outline is painted with the same
   ground colour the map loads over, on the zoomed-out map (see MASK_MAX_ZOOM in map.js). */
.outside-finland{fill:var(--map-ground);fill-opacity:1}
/* The aerial image is shown as Maanmittauslaitos delivers it: nothing is painted over it, so it stays white
   outside Finland. It loads over its sea colour, picked from the zoomed-out aerial image. */
#map[data-background=orthophoto]{background:#030530}#map[data-background=orthophoto] .outside-finland{display:none}
/* Kenttä rows open the record's details. */
button.record-row{display:block;width:100%;min-height:0;text-align:left;font-weight:400;color:var(--text);background-image:none;box-shadow:none;cursor:pointer}
.record-point{stroke:#fff;stroke-width:3;fill:var(--aarnituli-blue);fill-opacity:1}
/* No double-tap page zoom on controls; the map handles its own gestures. */
button,input,select,textarea,dialog,nav,header,.notice,.empty,.location-bar{touch-action:manipulation}
/* Map gestures: floating controls fade out slowly while the map moves and return quickly once it stops.
   The identity and attribution stay; the identity glows softly while the rest is away. */
.map-full #navigation,.map-full>.notice,.map-full>.load-retry,.map-full .map-layers-button,.map-full .leaflet-control-zoom,.map-full .map-locate,.map-full .add-button{transition:opacity .4s ease}
.map-moving.map-full #navigation,.map-moving.map-full>.notice,.map-moving.map-full>.load-retry,.map-moving.map-full .map-layers-button,.map-moving.map-full .leaflet-control-zoom,.map-moving.map-full .map-locate{opacity:0;pointer-events:none;transition-duration:.9s}
.map-full>header{transition:border-color .4s ease,box-shadow .4s ease}.map-full>header .brand-flame{transition:filter .4s ease}.map-full>header strong{transition:text-shadow .4s ease}
.map-moving.map-full>header{border-color:#00B4FF99;box-shadow:inset 0 1px var(--edge-light),0 2px 10px var(--shadow),0 0 18px #00B4FF40;transition-duration:.9s}
.map-moving.map-full>header .brand-flame{filter:drop-shadow(0 0 3px #00B4FFE6) drop-shadow(0 0 9px #00B4FF99);transition-duration:.9s}
.map-moving.map-full>header strong{text-shadow:0 0 10px #00B4FF80;transition-duration:.9s}
@media(prefers-reduced-motion:reduce){.map-full #navigation,.map-full>.notice,.map-full>.load-retry,.map-full .map-layers-button,.map-full .leaflet-control-zoom,.map-full .map-locate,.map-full .add-button,.map-full>header,.map-full>header .brand-flame,.map-full>header strong{transition:none}}
/* Passkeys in the Minä view: one row per key, its delete button at the end. */
.passkeys{margin:20px 0}.passkeys h2{font-size:20px;margin-bottom:8px}#passkey-list{list-style:none;margin:0 0 12px;padding:0}#passkey-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;margin-bottom:6px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}#passkey-list button{min-height:44px;padding:8px 14px}
/* The phone's own position: a button under the zoom buttons, a dot and a circle showing how accurate it is. */
.map-locate-button{display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:0;border:0;border-radius:inherit;background:var(--surface);color:var(--text)}.map-locate-button svg{width:24px;height:24px}
.map-locate-button:hover{background:var(--surface-raised)}.map-locate-button.tracking,.map-full .map-locate-button.tracking{color:#1a73e8}.map-locate-button.locating svg{animation:locate-pulse 1s ease-in-out infinite alternate}
@keyframes locate-pulse{to{opacity:.35}}
.map-full .map-locate{border-radius:var(--panel-radius);overflow:hidden;border:1px solid var(--border-strong)!important;box-shadow:0 2px 8px var(--shadow)}
.map-full .map-locate-button{background-color:color-mix(in srgb,var(--surface) 60%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.own-position{fill:#1a73e8;fill-opacity:1;stroke:#fff;stroke-width:3}.own-accuracy{fill:#1a73e8;fill-opacity:.12;stroke:#1a73e8;stroke-opacity:.5;stroke-width:1}
/* Riistanhoitoyhdistys borders: a dashed line that reads on both the terrain map and the aerial photo. */
.rhy-area{fill:none;stroke:#8a2be2;stroke-width:2.5;stroke-dasharray:8 5;stroke-opacity:.85}#map[data-background=orthophoto] .rhy-area{stroke:#ffd166}
/* Boat launch places: a small blue dot with a light rim, readable on both backgrounds. */
.slipway{fill:#1f6fb2;fill-opacity:.95;stroke:#fffdf5;stroke-width:2}#map[data-background=orthophoto] .slipway{fill:#4fb3ff;stroke:#10291e}
@media(prefers-reduced-motion:reduce){.map-locate-button.locating svg{animation:none;opacity:.5}}
/* Loukun jako ja oma käyttäjätunnus (kortti A1 d). */
.own-id{margin:16px 0}
.own-id h2{font-size:1rem;margin:0 0 6px}
.own-id-value,.share-id{display:block;font-family:ui-monospace,Menlo,monospace;font-size:14px;word-break:break-all;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:8px;user-select:all}
.share-row{display:grid;gap:6px;margin-bottom:12px;padding:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.share-form{display:grid;gap:8px;margin-top:16px}
.share-form input[type=date],.share-form #share-recipient{font-size:16px;padding:8px}
.share-notice{margin:8px 0;padding:12px 12px 12px 28px;background:var(--warning-surface);color:var(--warning-text);border-radius:var(--radius);font-size:15px}
.share-notice li{margin:4px 0}
.share-info{margin:8px 0 12px}
.kirjautumaton{max-width:32rem;margin:3rem auto;padding:0 16px}
