/* Hati v2 "matte glass" (HATI_v2/web, owner 2026-11-12) in Sanzo Wada's plate No. 294 (cream #F5F5B8, amber #FFB852,
   green #328E13, sky #96BFE6): sky = water tint of the paper and glass, cream = warm half of the page, amber = primary
   actions only, green = "free" only. Contrast measured for every text pair, both themes (lowest 5.46:1).
   Material: calm two-tone paper, matte slabs with a
   lit top edge, soft shadow falling down and right, accent glass only on primary actions, real blur only on what floats
   (top bar, sheet, toast). Black Han Sans display + DM Sans body, self-hosted. Line icons, no emoji. */
@font-face { font-family: "Black Han Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/black-han-sans-latin.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/vendor/dm-sans-latin.woff2) format("woff2"); }

:root {
  --ink-l: #000; --paper-l: #fff; --muted-l: #6B7280;
  --cream: #F5F5B8; --acc-l: #FFB852; --acc-d: #FFB852; --green: #328E13; --b2: #96BFE6;
  --bg: var(--paper-l); --fg: var(--ink-l); --sub: var(--muted-l);
  --panel: var(--paper-l);
  --accent: var(--acc-l); --on-accent: var(--ink-l);
  --pos: color-mix(in srgb, var(--green) 72%, #000); --err: #B3261E;
  --page-a: color-mix(in srgb, var(--b2) 14%, color-mix(in srgb, var(--ink-l) 7%, var(--paper-l)));
  --page-b: color-mix(in srgb, var(--cream) 45%, color-mix(in srgb, var(--ink-l) 7%, var(--paper-l)));
  --g-top: var(--paper-l);
  --g-foot: color-mix(in srgb, var(--b2) 7%, var(--paper-l));
  --g-line: color-mix(in srgb, var(--ink-l) 14%, transparent);
  --g-lip: color-mix(in srgb, var(--paper-l) 85%, transparent);
  --g-rim: color-mix(in srgb, var(--paper-l) 70%, transparent);
  --g-seam: color-mix(in srgb, var(--ink-l) 12%, transparent);
  --g-grain: color-mix(in srgb, var(--ink-l) 7%, transparent);
  --b-top: color-mix(in srgb, var(--accent) 70%, var(--paper-l)); --b-foot: var(--accent);
  --g-bar: color-mix(in srgb, color-mix(in srgb, var(--b2) 10%, var(--paper-l)) 80%, transparent);
  --g-field-line: color-mix(in srgb, var(--ink-l) 58%, var(--paper-l));
  --g-shadow: color-mix(in srgb, var(--ink-l) 38%, transparent); --g-contact: color-mix(in srgb, var(--ink-l) 22%, transparent);
  --sub-f: color-mix(in srgb, var(--sub) 80%, var(--fg));
  --sel-bg: var(--fg); --sel-fg: var(--bg);
  --grain: radial-gradient(var(--g-grain) .6px, transparent .9px) 0 0 / 3px 3px, radial-gradient(var(--g-grain) .6px, transparent .9px) 1px 2px / 5px 5px, radial-gradient(var(--g-grain) .6px, transparent .9px) 2px 1px / 7px 7px;
  --lip: linear-gradient(var(--g-lip), var(--g-lip)) 0 0 / 100% 1px no-repeat;
  --font-disp: "Black Han Sans", "Arial Black", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: color-mix(in srgb, var(--ink-l) 5%, #0E0D12); --fg: #EDEBE4; --sub: #A8A6B0;
    --panel: color-mix(in srgb, var(--fg) 11%, var(--bg));
    --accent: var(--acc-d); --on-accent: #131217; --pos: color-mix(in srgb, var(--green) 50%, #fff); --err: #F2B8B5;
    --page-a: color-mix(in srgb, var(--b2) 16%, var(--bg)); --page-b: color-mix(in srgb, var(--cream) 7%, var(--bg));
    --g-top: color-mix(in srgb, var(--b2) 5%, var(--panel)); --g-foot: color-mix(in srgb, var(--b2) 10%, var(--panel));
    --g-lip: color-mix(in srgb, var(--fg) 24%, transparent); --g-rim: color-mix(in srgb, var(--fg) 10%, transparent);
    --g-seam: color-mix(in srgb, #000 40%, transparent); --g-grain: color-mix(in srgb, var(--fg) 5%, transparent);
    --b-top: color-mix(in srgb, var(--accent) 88%, var(--fg));
    --g-bar: color-mix(in srgb, color-mix(in srgb, var(--b2) 6%, var(--panel)) 82%, transparent);
    --g-field-line: color-mix(in srgb, var(--fg) 58%, var(--bg));
    --g-shadow: color-mix(in srgb, #000 62%, transparent); --g-contact: color-mix(in srgb, #000 40%, transparent);
    --g-line: color-mix(in srgb, var(--fg) 16%, transparent);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--page-a); }
body {
  margin: 0; height: 100%; display: flex; flex-direction: column; color: var(--fg);
  font: 16px/1.45 var(--font-body); -webkit-tap-highlight-color: transparent;
  background: linear-gradient(170deg, var(--page-a) 0 52%, var(--page-b) 52%) var(--bg);
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; box-shadow: 0 0 0 6px var(--accent); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { font-family: var(--font-disp); font-weight: 400; letter-spacing: .02em; text-wrap: balance; }

/* Floating layers: real frosted glass */
header {
  position: relative; z-index: 1001; display: flex; align-items: center; gap: 8px; min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  background: var(--lip), var(--grain), var(--g-bar); box-shadow: 0 1px 0 var(--g-seam);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
}
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--on-accent);
  background: var(--lip), linear-gradient(180deg, var(--b-top), var(--b-foot)); box-shadow: inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line); }
h1 { flex: 1; min-width: 0; margin: 0; font-size: 1.35rem; line-height: 1.1; white-space: nowrap; }
@media (max-width: 380px) { .logo { display: none; } } /* 360 px phones: the name needs the room more than the mark */
.actions { display: flex; gap: 8px; }

/* Controls: the same matte glass, 12px corners; the shadow is the press distance */
button, a.btn {
  --t: 4px; min-height: 44px; min-width: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--fg); font-weight: 700; font-size: 1rem; /* body size: 3 type sizes per screen (PIX-8) */
  background: var(--lip), var(--grain), linear-gradient(180deg, var(--g-top), var(--g-foot)) var(--g-foot);
  box-shadow: inset 0 1px 0 var(--g-lip), inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line),
    var(--t) calc(1.4 * var(--t)) calc(2.6 * var(--t)) calc(-.5 * var(--t)) var(--g-shadow), 1px 2px 3px var(--g-contact);
  transition: box-shadow 90ms cubic-bezier(.2, .8, .2, 1), transform 90ms cubic-bezier(.2, .8, .2, 1);
}
button:active:not(:disabled), a.btn:active { --t: 0px; transform: translateY(1px); }
button.primary { color: var(--on-accent); background: var(--lip), var(--grain), linear-gradient(180deg, var(--b-top), var(--b-foot)) var(--b-foot); }
button:disabled { opacity: .55; cursor: progress; box-shadow: inset 0 0 0 1px var(--g-rim); }
button.icon { padding: 0; width: 44px; }
button.link { --t: 0px; min-height: 44px; padding: 0; background: none; box-shadow: none; color: var(--fg); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible:is(button, a) { box-shadow: 0 0 0 6px var(--accent); }

/* Filter chips: shape carries meaning (on/off), chosen = inverted */
#filters { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; position: relative; z-index: 1000; }
#filters::-webkit-scrollbar { display: none; }
#filters button { --t: 2px; flex: none; min-height: 44px; min-width: 0; padding: 0 12px; border-radius: 10px; font-size: .9rem; }
/* more chips to the right: fade the edge so the cut-off one reads as "swipe", not as a broken label */
#filters { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
#filters button[aria-pressed="true"] { --t: 0px; background: var(--sel-bg); color: var(--sel-fg); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--sel-bg) 80%, var(--sel-fg)); }

#map { flex: 1; min-height: 0; margin: 0 12px 12px; border-radius: 16px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line), 8px 11px 21px -4px var(--g-shadow); }
.leaflet-container { font: inherit; background: var(--g-foot); }
@media (prefers-color-scheme: dark) { .leaflet-tile-pane { filter: brightness(.72) contrast(1.08) saturate(.85); } }
/* OSM credit must stay readable: top-right (the sheet never covers it), themed so dark mode has no white patch */
.leaflet-container .leaflet-control-attribution { margin: 8px 8px 0 0; padding: 1px 6px; border-radius: 8px; color: var(--sub-f);
  background: color-mix(in srgb, var(--panel) 88%, transparent); }
.leaflet-container .leaflet-control-attribution a { color: var(--fg); }
.noscript { padding: 16px; }

#hint {
  position: fixed; top: calc(166px + env(safe-area-inset-top)); /* below the OSM credit, inside the map (PIX-2) */ left: 50%; transform: translateX(-50%); z-index: 1002; margin: 0;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; text-align: center; font-size: .9rem;
  background: var(--lip), var(--grain), color-mix(in srgb, var(--fg) 88%, transparent); color: var(--bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 4px 6px 12px -2px var(--g-shadow);
}

#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003; max-height: 60vh; /* leaves a map strip above it on phones */ overflow: auto;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; /* card radius (PIX-12) */
  background: var(--lip), var(--grain), color-mix(in srgb, var(--page-a) 96%, transparent);
  box-shadow: inset 0 0 0 1px var(--g-rim), 0 -1px 0 var(--g-seam), 0 -10px 30px -8px var(--g-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2);
}
#sheet:focus { outline: none; }
@media (min-width: 720px) { #sheet { left: auto; right: 24px; bottom: 24px; width: 400px; max-height: 72vh; border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line), 8px 11px 21px -4px var(--g-shadow); } } /* inside the map by 12 px, light from top-left (PIX-7, PIX-12) */
@media (prefers-reduced-transparency: reduce) {
  header, #sheet, #hint { -webkit-backdrop-filter: none; backdrop-filter: none; }
  header { background: var(--panel); } #sheet { background: var(--page-a); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } button:active { transform: none; } }

#sheet h2 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.15; }
#sheet h2 + *, #sheet form h2 + * { margin-top: 0; } /* heading → first line is always 6 px (PIX-11) */
h3 { margin: 18px 0 8px; font-size: 1rem; }
p { margin: 0 0 8px; }
.meta { color: var(--sub-f); font-size: .9rem; margin: 0 0 8px; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row + .row { margin-top: 10px; } /* 2x2 button grids: same gutter both ways (PIX-3) */
.row > * { flex: 1; }
/* a lone secondary action (Cancel, Back, Close): still a button (R2-LZY-2), but half width and centred, so it never
   outweighs the primary pair (PIX-4) */
.row > button:only-child:not(.primary) { flex: 0 1 auto; margin: 0 auto; min-width: calc(50% - 5px); } /* = one button of a pair (PIX near-miss) */
/* help text never sits flush under a control or card (PIX-1) */
#sheet :is(.row, .card, select, input, textarea, label.check) + :is(.meta, p), #reviews > .meta:first-child { margin-top: 12px; }

/* Cards: matte slab, 16px corners, 8px shadow */
.card {
  --t: 8px; border-radius: 16px; padding: 4px 14px;
  background: var(--lip), var(--grain), linear-gradient(180deg, var(--g-top), var(--g-foot)) var(--g-foot);
  box-shadow: inset 0 1px 0 var(--g-lip), inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line),
    var(--t) calc(1.4 * var(--t)) calc(2.6 * var(--t)) calc(-.5 * var(--t)) var(--g-shadow), 1px 2px 3px var(--g-contact);
  margin-bottom: 10px;
}
/* Ruled ledger rows inside a card */
.card > * + * { border-top: 1px solid color-mix(in srgb, var(--g-seam) 70%, transparent); }

/* Money-like status: the fee line. Free reads green (the good direction), paid stays ink. */
.fee { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 700; font-size: 1rem; }
.free { color: var(--pos); } .paid { color: var(--fg); }
.fee.free::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pos); }
.award { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 0 0 6px; }
.award svg.i { width: 18px; height: 18px; }
.sulit { color: var(--pos); font-weight: 700; margin: 0 0 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; padding: 0; list-style: none; }
.tags li { padding: 3px 10px; border-radius: 10px; font-size: .9rem; background: linear-gradient(180deg, var(--g-top), var(--g-foot));
  box-shadow: inset 0 1px 0 var(--g-lip), inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line); }

/* Nearest list: one card, ruled rows, each row a full-width tap target */
.list { list-style: none; margin: 0; padding: 0 4px; } /* equal inner space top and bottom (PIX-6) */
.list li + li { border-top: 1px solid color-mix(in srgb, var(--g-seam) 70%, transparent); }
.item { --t: 0px; width: 100%; min-height: 60px; padding: 10px 6px; white-space: normal; text-align: left;
  display: grid; grid-template-columns: 1fr 4.2em; /* fixed distance column: every name gets the same width (PIX-6) */ align-items: center; gap: 2px 10px; background: none; box-shadow: none; border-radius: 10px; font-weight: 400; }
.item strong { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
#sheet h2 { overflow-wrap: anywhere; }
.item .meta { margin: 0; grid-column: 1; }
.item .d { grid-row: 1 / span 2; grid-column: 2; text-align: right; font: 400 1rem var(--font-disp); font-variant-numeric: tabular-nums; }
.item b.free, .item b.paid { font-weight: 700; }

/* Score breakdown */
.avg { margin: 0 0 10px; padding: 6px 14px; } /* the card's own gap, so its shadow doesn't fall on the line below (PIX-1) */
.avg div { display: grid; grid-template-columns: 1fr 96px 2.2em; align-items: center; gap: 10px; padding: 7px 0; }
.avg dt { color: var(--sub-f); font-size: .9rem; } .avg dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--g-seam); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--fg); }
.w0{width:0}.w1{width:10%}.w2{width:20%}.w3{width:30%}.w4{width:40%}.w5{width:50%}.w6{width:60%}.w7{width:70%}.w8{width:80%}.w9{width:90%}.w10{width:100%}

/* Reviews: ruled ledger */
.review { padding: 12px 0 2px; } /* even space around each rule (PIX-5) */
.review .top .meta { margin: 0; }
.review .top { display: flex; align-items: baseline; gap: 8px; }
.review .s { font: 400 1rem var(--font-disp); }
.review p { margin: 6px 0 0; overflow-wrap: anywhere; }
.review img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin-top: 8px; }
.plain { padding-left: 18px; margin: 4px 0 8px; } .plain li { margin: 6px 0; }

/* Forms: fields keep a visible edge */
form label { display: block; margin: 12px 0 6px; font-weight: 700; }
input[type=text], input[type=number], textarea, select {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--g-field-line); color: var(--fg);
  background: linear-gradient(180deg, var(--g-top), var(--g-foot)) var(--g-top); box-shadow: inset 0 1px 0 var(--g-lip);
}
input:focus, textarea:focus, select:focus { border-color: var(--fg); }
input[type=file] { width: 100%; font-size: .9rem; }
input[type=file]::file-selector-button { /* a real control, not the browser's 22 px grey chip (PIX-10) */
  min-height: 44px; margin-right: 10px; padding: 0 14px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; color: var(--fg); cursor: pointer;
  background: linear-gradient(180deg, var(--g-top), var(--g-foot)); box-shadow: inset 0 1px 0 var(--g-lip), inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line); }
textarea { display: block; } /* no inline baseline gap under it (PIX-9) */
fieldset { border: 0; padding: 0; margin: 12px 0; min-width: 0; } /* same 12 px as every field group (PIX-9) */
legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.stars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stars label { position: relative; margin: 0; min-height: 44px; display: grid; place-items: center; border-radius: 10px; font-weight: 700;
  background: linear-gradient(180deg, var(--g-top), var(--g-foot)); box-shadow: inset 0 1px 0 var(--g-lip), inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line), 2px 3px 5px -1px var(--g-shadow); }
.stars input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.stars label:has(input:checked) { background: var(--sel-bg); color: var(--sel-fg); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--sel-bg) 80%, var(--sel-fg)); }
.stars label:has(input:focus-visible) { outline: 3px solid var(--fg); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 0; padding: 0 12px 0 10px; border-radius: 10px; font-weight: 400;
  background: linear-gradient(180deg, var(--g-top), var(--g-foot)); box-shadow: inset 0 1px 0 var(--g-lip), inset 0 0 0 1px var(--g-rim), 0 0 0 1px var(--g-line); }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--fg); }
.err { color: var(--err); font-weight: 700; }
.err:empty { display: none; }

/* Map pins: small matte coins. Free = green, awarded = accent ring. */
.pin {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--font-body); color: var(--fg);
  background: var(--lip), linear-gradient(180deg, var(--g-top), var(--g-foot)) var(--g-foot);
  box-shadow: inset 0 0 0 1px var(--g-rim), 0 0 0 2px var(--fg), 3px 5px 8px -2px var(--g-shadow);
}
.pin.free { background: color-mix(in srgb, var(--green) 45%, var(--cream)); color: #000; } /* 10.8:1 in both themes */
.pin.a1, .pin.a2, .pin.a3 { box-shadow: inset 0 0 0 1px var(--g-rim), 0 0 0 2px var(--fg), 0 0 0 5px var(--acc-l), 3px 5px 8px -2px var(--g-shadow); }
.pin.a3 { background: linear-gradient(180deg, var(--b-top), var(--b-foot)); color: var(--on-accent); }
