/* Planet Sound — carbon ink on archive board.
   One ink colour carries text, pins and the printed spectrograms; red is
   reserved for things that are live (recording, playing, clipping). */

@font-face { font-family: 'Franklin'; font-weight: 400; font-display: swap; src: url(../fonts/libre-franklin-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Franklin'; font-weight: 500; font-display: swap; src: url(../fonts/libre-franklin-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Franklin'; font-weight: 600; font-display: swap; src: url(../fonts/libre-franklin-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Franklin'; font-weight: 700; font-display: swap; src: url(../fonts/libre-franklin-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Franklin'; font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; src: url(../fonts/libre-franklin-latin-ext-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Franklin'; font-weight: 500; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; src: url(../fonts/libre-franklin-latin-ext-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 400; font-display: swap; src: url(../fonts/newsreader-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 500; font-display: swap; src: url(../fonts/newsreader-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/newsreader-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 500; font-style: italic; font-display: swap; src: url(../fonts/newsreader-latin-500-italic.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; src: url(../fonts/newsreader-latin-ext-400-normal.woff2) format('woff2'); }

:root {
  --paper: #EEEFEA;        /* land, page */
  --sheet: #F7F7F4;        /* cards and dialogs */
  --board: #C3CCCF;        /* archive-box blue-grey: water, wells */
  --ink: #1E2B4D;          /* carbon-copy blue: text, pins, spectrograms */
  --graphite: #5C6570;
  --rule: #CDD0CA;
  --signal: #CF3A2C;       /* live: recording, playing, clipping */
  --signal-soft: #CF3A2C22;
  --focus: #2E5BD8;
  --shadow: 0 1px 0 #1E2B4D14, 0 12px 32px -12px #1E2B4D40;
  --sans: 'Franklin', 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --bar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10161D; --sheet: #161E27; --board: #1F2B36; --ink: #DCE3EA; --graphite: #8D99A6;
    --rule: #28333E; --signal: #FF5A49; --signal-soft: #FF5A4926; --focus: #8EB0FF;
    --shadow: 0 1px 0 #0006, 0 16px 40px -12px #000a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10161D; --sheet: #161E27; --board: #1F2B36; --ink: #DCE3EA; --graphite: #8D99A6;
  --rule: #28333E; --signal: #FF5A49; --signal-soft: #FF5A4926; --focus: #8EB0FF;
  --shadow: 0 1px 0 #0006, 0 16px 40px -12px #000a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 15px/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 4px; }
.skip:focus { top: 8px; }

/* ---------- bar ---------- */
/* The bar floats over the map: no background, so the map fills the whole screen.
   Only its controls catch clicks; the empty space stays draggable. */
.bar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: 30;
  display: flex; align-items: center; gap: 18px; padding: 0 16px 0 14px;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none;
  padding: 4px 4px 4px 2px; filter: drop-shadow(0 0 2px var(--paper)) drop-shadow(0 0 1px var(--paper));
}
.mark, .about-mark {
  display: block; width: 34px; height: 40px; background: var(--ink);
  -webkit-mask: url(../img/logo.png) center / contain no-repeat; mask: url(../img/logo.png) center / contain no-repeat;
}
.brand .name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.bar .halo, .bar .name, .views button, .you { text-shadow: 0 0 2px var(--paper), 0 0 4px var(--paper), 0 0 1px var(--paper); }
.views { display: flex; gap: 6px; margin-left: 14px; background: none; box-shadow: none; padding: 0; }
.views button, .you {
  border: 0; background: none; padding: 8px 10px; border-radius: 6px; color: var(--graphite); font-weight: 500;
}
.views button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.views button:hover, .you:hover { color: var(--ink); }
.search { margin-left: auto; position: relative; }
.search input {
  width: 240px; height: 36px; padding: 0 4px 0 34px; border: 0; border-radius: 0; background: none; color: var(--ink);
  border-bottom: 1px solid transparent; text-shadow: 0 0 2px var(--paper), 0 0 4px var(--paper);
}
.search input:focus { outline: none; border-bottom-color: var(--ink); }
.search::before {
  content: ''; position: absolute; left: 12px; top: 11px; width: 11px; height: 11px; border: 1.6px solid var(--ink); border-radius: 50%; box-shadow: 0 0 2px 1px var(--paper);
}
.search::after { content: ''; position: absolute; left: 22px; top: 22px; width: 6px; height: 1.6px; background: var(--ink); transform: rotate(45deg); box-shadow: 0 0 2px 1px var(--paper); }
.search input::placeholder { color: var(--ink); opacity: .75; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px 0 13px;
  border-radius: 19px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 600;
}
.rec-btn .lamp { width: 11px; height: 11px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--paper); }
.rec-btn:hover { filter: brightness(1.12); }
.menu-btn { display: none; }

/* ---------- views ---------- */
main { position: fixed; inset: 0; }
.view { position: absolute; inset: 0; }
/* the list and about pages sit below the floating bar; the map runs under it */
#index-view, #about-view { padding-top: var(--bar-h); }
#space { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #04060B; }
#map { position: absolute; inset: 0; background: transparent; }
.maplibregl-canvas:focus-visible { outline-offset: -3px; }
.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--paper) 85%, transparent) !important; color: var(--graphite); font: 11px/1.3 var(--sans); }
.maplibregl-ctrl-attrib a { color: var(--graphite); }
.maplibregl-ctrl-group { background: var(--sheet); border-radius: 8px; box-shadow: var(--shadow); }
.maplibregl-ctrl-group button + button { border-top-color: var(--rule); }
:root[data-theme="dark"] .maplibregl-ctrl-icon, .dark-ui .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-popup-content { background: var(--sheet); color: var(--ink); font: 500 13px/1.3 var(--sans); padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow); }
.maplibregl-popup-tip { border-top-color: var(--sheet) !important; border-bottom-color: var(--sheet) !important; }
.maplibregl-popup-content small { display: block; color: var(--graphite); font-weight: 400; }

body.card-open .maplibregl-ctrl-bottom-right { right: 464px; }
.map-tools { position: absolute; left: 14px; bottom: calc(18px + var(--safe-b)); display: flex; gap: 8px; z-index: 2; }
.seg { display: inline-flex; background: var(--sheet); border-radius: 8px; box-shadow: var(--shadow); padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 6px; font-weight: 500; color: var(--graphite); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tool { width: 38px; height: 38px; border: 0; border-radius: 8px; background: var(--sheet); box-shadow: var(--shadow); display: grid; place-items: center; }
.tool svg { width: 20px; height: 20px; fill: var(--ink); stroke: var(--ink); stroke-width: 1.5; }
.map-count { position: absolute; left: 16px; top: calc(var(--bar-h) + 10px); margin: 0; font-size: 13px; color: #B9C3CF; background: rgba(4,6,11,.45); padding: 3px 8px; border-radius: 4px; pointer-events: none; }

/* location picker */
.picker { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.cross { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.cross::before, .cross::after { content: ''; position: absolute; background: var(--signal); }
.cross::before { left: 21px; top: 0; width: 2px; height: 44px; }
.cross::after { top: 21px; left: 0; height: 2px; width: 44px; }
.picker-bar {
  pointer-events: auto; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--safe-b));
  width: min(440px, calc(100% - 24px)); background: var(--sheet); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px;
}
.picker-bar p { margin: 0 0 4px; }
.picker-bar .coords { color: var(--graphite); font-size: 13px; margin-bottom: 10px; }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); font-weight: 500; text-decoration: none;
}
.btn:hover { border-color: var(--graphite); }
.btn.solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.solid:hover { filter: brightness(1.12); }
.btn.ghost { background: none; border-color: transparent; color: var(--graphite); }
.btn.quiet { background: none; color: var(--graphite); }
.btn.danger { color: var(--signal); }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.two > * { flex: 1 1 160px; }
.row.end { justify-content: flex-end; }
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend, .field .lbl { display: block; font-size: 13px; color: var(--graphite); margin-bottom: 5px; font-weight: 500; }
.field legend small { font-weight: 400; margin-left: 6px; }
.field input, .field textarea, .sel select {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--rule); background: var(--sheet);
}
.field textarea { resize: vertical; font-family: var(--serif); font-size: 16px; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
.check.block { display: flex; margin: 4px 0 14px; }
.check input, .choice input { accent-color: var(--ink); width: 17px; height: 17px; }
.sel select { min-height: 36px; padding: 0 30px 0 10px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--graphite) 50%), linear-gradient(135deg, var(--graphite) 50%, transparent 50%); background-position: right 15px top 16px, right 10px top 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; position: relative; flex: none; }
.x::before, .x::after { content: ''; position: absolute; left: 10px; top: 16px; width: 14px; height: 1.6px; background: var(--ink); }
.x::before { transform: rotate(45deg); } .x::after { transform: rotate(-45deg); }
.x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  border: 1px solid var(--rule); background: none; border-radius: 14px; padding: 3px 10px; font-size: 13px; color: var(--ink);
}
.tag[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag:disabled { opacity: .4; cursor: default; }
span.tag { display: inline-block; }

/* ---------- entry card ---------- */
.card {
  position: fixed; z-index: 20; top: calc(var(--bar-h) + 12px); right: 12px; bottom: 12px; width: 440px;
  background: var(--sheet); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.card-grip { display: none; }
.card-scroll { overflow-y: auto; padding: 16px 22px 24px; overscroll-behavior: contain; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 0 0; }
.acc { margin: 0; font-weight: 600; font-size: 13px; letter-spacing: 0.02em; color: var(--graphite); }
.acc b { color: var(--ink); font-weight: 700; }
.card h2 { font: 500 30px/1.12 var(--serif); letter-spacing: -0.01em; margin: 6px 0 8px; text-wrap: balance; }
.c-place { margin: 0; font-weight: 500; }
.c-coords { margin: 2px 0 0; color: var(--graphite); font-size: 13px; }
.c-flag { margin: 10px 0 0; padding: 8px 10px; border-radius: 6px; background: var(--signal-soft); color: var(--ink); font-size: 13px; }

.sono { position: relative; margin: 18px -22px 0; padding: 0 22px; }
.sono-img {
  height: 170px; background: var(--ink); border-radius: 2px;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
html[data-spec="signal"] .sono-img:not(.empty) { background: var(--signal); }
html[data-spec="moss"] .sono-img:not(.empty) { background: #3F7D4E; }
.sono-img.empty { background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 6px); -webkit-mask: none; mask: none; opacity: .6; }
.sono-axis { position: absolute; top: 0; right: 22px; left: 22px; height: 170px; font-size: 10.5px; color: var(--graphite); pointer-events: none; }
.sono-axis span { position: absolute; right: 0; transform: translateY(-50%); background: color-mix(in srgb, var(--sheet) 80%, transparent); padding: 0 4px; border-radius: 2px; line-height: 1.5; }
.sono-axis span::after { content: ''; position: absolute; right: 100%; top: 50%; width: 6px; height: 1px; background: var(--graphite); opacity: .6; }
.wave { display: block; width: 100%; height: 44px; margin-top: 6px; }
.sono .head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--signal); left: 22px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.sono.playing .head, .sono.cued .head { opacity: 1; }
.seek { position: absolute; inset: 0 22px; width: calc(100% - 44px); height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seek:focus-visible + * { outline: none; }
.sono:has(.seek:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.transport { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); display: grid; place-items: center; flex: none; }
.play svg { width: 22px; height: 22px; fill: var(--paper); }
.play .i-pause { display: none; }
.play.on { background: var(--signal); }
.play.on .i-play { display: none; } .play.on .i-pause { display: inline; }
.play:disabled { opacity: .35; }
.time { margin: 0; font-weight: 500; font-size: 15px; min-width: 92px; }
.time .of { color: var(--graphite); }
.meter { width: 120px; height: 14px; }
.lm { margin-left: auto; font-size: 13px; color: var(--graphite); display: inline-flex; align-items: center; gap: 6px; }
.lm input { accent-color: var(--ink); }
.status { min-height: 1em; margin: 6px 0 0; font-size: 13px; color: var(--graphite); }

.c-notes { font: 400 17px/1.55 var(--serif); margin: 14px 0 0; white-space: pre-wrap; }
.c-notes:empty { display: none; }
.c-photo { display: block; width: 100%; margin-top: 16px; border-radius: 4px; filter: grayscale(.15); }
.facts { display: grid; grid-template-columns: 112px 1fr; gap: 7px 14px; margin: 20px 0 0; padding: 14px 0 0; border-top: 1px solid var(--rule); font-size: 14px; }
.facts dt { color: var(--graphite); }
.facts dd { margin: 0; }
.facts dd small { color: var(--graphite); }
.c-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.c-actions + .c-actions { margin-top: 8px; }
.c-owner { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.c-owner p { margin: 0 0 8px; color: var(--graphite); font-size: 13px; }

/* ---------- index ---------- */
#index-view { overflow-y: auto; background: var(--paper); }
.index-wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }
.index-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.index-head h1 { font: 500 34px/1.1 var(--serif); margin: 0; }
.index-sum { margin: 0; color: var(--graphite); }
.filters { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 18px 0 12px; flex-wrap: wrap; }
.filter-right { display: flex; gap: 16px; align-items: center; }
.table { border-top: 1.5px solid var(--ink); }
.tr { display: grid; grid-template-columns: 76px minmax(0, 2.2fr) minmax(0, 1.4fr) 128px 64px 160px; gap: 14px; align-items: baseline; padding: 11px 6px; border-bottom: 1px solid var(--rule); }
.th { font-size: 12.5px; color: var(--graphite); font-weight: 500; padding-top: 8px; padding-bottom: 8px; }
button.tr { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; border-radius: 0; }
button.tr:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.tr .no { font-weight: 600; color: var(--graphite); font-size: 13px; }
.tr .t { font: 500 18px/1.25 var(--serif); }
.tr .t small { display: block; font: 400 12.5px/1.4 var(--sans); color: var(--graphite); margin-top: 2px; }
.tr .p, .tr .d, .tr .f { font-size: 14px; }
.tr .f { color: var(--graphite); }
.num { text-align: right; }
.tr .priv { display: inline-block; font: 500 11.5px var(--sans); border: 1px solid var(--graphite); color: var(--graphite); border-radius: 3px; padding: 0 4px; margin-left: 6px; vertical-align: 2px; }
.empty { color: var(--graphite); padding: 30px 6px; font-size: 16px; }

/* ---------- about ---------- */
#about-view { overflow-y: auto; }
.about { max-width: 640px; margin: 0 auto; padding: 48px 24px 96px; }
.about-mark { width: 92px; height: 110px; margin-bottom: 28px; }
.about h1 { font: 500 40px/1.08 var(--serif); letter-spacing: -0.015em; margin: 0 0 18px; text-wrap: balance; }
.about h2 { font-size: 15px; font-weight: 600; margin: 34px 0 8px; }
.about p { font: 400 18px/1.6 var(--serif); margin: 0 0 14px; }
.about .lede { font-size: 21px; line-height: 1.5; }
.about .credit { font: 400 13px/1.5 var(--sans); color: var(--graphite); margin-top: 34px; }

/* ---------- studio (recorder) ---------- */
.studio {
  position: fixed; inset: 0; z-index: 40; background: var(--paper);
  display: flex; flex-direction: column; overflow-y: auto;
}
.studio-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.steps { display: flex; gap: 22px; margin: 0; padding: 0 0 0 4px; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; color: var(--graphite); font-weight: 500; font-size: 14px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--rule); font-size: 11.5px; margin-right: 7px; }
.steps li[aria-current="step"] { color: var(--ink); }
.steps li[aria-current="step"]::before { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.steps li.done::before { border-color: var(--ink); color: var(--ink); }
.pane { width: min(880px, 100%); margin: 0 auto; padding: 22px 20px calc(40px + var(--safe-b)); }
.pane.form { width: min(560px, 100%); }
.pane.form h2 { font: 500 30px/1.15 var(--serif); margin: 6px 0 6px; }
.hint { color: var(--graphite); margin: 0 0 18px; }
.loc { font-weight: 500; margin: 0 0 12px; font-size: 17px; }
.nav-row { display: flex; justify-content: space-between; margin-top: 24px; }

.input-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.input-sel { max-width: 320px; flex: 1 1 220px; }
.input-info { margin: 0; color: var(--graphite); font-size: 13.5px; }
.scope { position: relative; margin-top: 18px; height: 230px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.scope canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scope .sono-img.review { position: absolute; inset: 12px 0; height: auto; }
.meters { position: relative; margin-top: 10px; padding-top: 26px; }
.meters canvas { display: block; width: 100%; height: 58px; }
.clip { position: absolute; right: 0; top: 0; border: 1px solid var(--rule); background: none; color: var(--graphite); border-radius: 4px; font: 600 11.5px var(--sans); padding: 2px 7px; }
.clip.on { background: var(--signal); border-color: var(--signal); color: #fff; }
.deck { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 18px; }
.clock { margin: 0; font: 500 34px/1 var(--sans); letter-spacing: -0.01em; }
.clock small { font-size: 18px; color: var(--graphite); }
.size { margin: 0; text-align: right; color: var(--graphite); font-size: 13.5px; }
.big-rec { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--ink); background: var(--sheet); display: grid; place-items: center; padding: 0; }
.big-rec span { width: 58px; height: 58px; border-radius: 50%; background: var(--signal); transition: border-radius .18s, width .18s, height .18s; }
.big-rec.on span { width: 30px; height: 30px; border-radius: 5px; }
.big-rec.review span { width: 0; height: 0; border-radius: 0; background: none; border-left: 22px solid var(--ink); border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px; }
.big-rec:disabled { opacity: .4; }
.s-msg { min-height: 1.2em; margin: 12px 0 0; color: var(--graphite); }
.s-msg.err { color: var(--signal); }
.review-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.alt { text-align: center; margin-top: 18px; }
.link { color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--ink); }

.choice { display: grid; gap: 8px; margin: 8px 0 16px; }
.choice label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { margin-top: 3px; }
.choice strong { display: block; font-weight: 600; }
.choice span { color: var(--graphite); font-size: 14px; }
.choice strong { color: var(--ink); font-size: 15px; }
.photo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo { width: 72px; height: 72px; border-radius: 6px; border: 1px dashed var(--rule); display: grid; place-items: center; color: var(--graphite); font-size: 12px; background: center / cover no-repeat; }
.progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress div { height: 100%; width: 0; background: var(--ink); transition: width .2s; }

/* ---------- dialogs ---------- */
dialog.sheet {
  border: 0; padding: 0; border-radius: 14px; background: var(--sheet); color: var(--ink); box-shadow: var(--shadow);
  width: min(560px, calc(100% - 24px)); max-height: calc(100% - 48px);
}
dialog.sheet.small { width: min(420px, calc(100% - 24px)); padding: 20px 22px; }
dialog.sheet::backdrop { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 22px; margin: 0; }
dialog.small .sheet-head { padding: 0 0 8px; }
.sheet h2 { font: 500 24px/1.2 var(--serif); margin: 0; }
dialog.small h2 { margin-bottom: 8px; }
.sheet-body { padding: 4px 22px 22px; overflow-y: auto; max-height: calc(100vh - 140px); }
#ask-body { margin: 0 0 16px; color: var(--graphite); white-space: pre-line; }
.ask-extra:empty { display: none; }
.ask-extra { margin-bottom: 16px; }
.keybox { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--paper); border: 1px solid var(--rule); font: 600 15px var(--sans); letter-spacing: 0.04em; word-break: break-all; }
.keybox span { flex: 1; }
.you-sec { padding: 14px 0; border-top: 1px solid var(--rule); }
.you-sec:first-child { border-top: 0; padding-top: 4px; }
.you-sec h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.you-sec p { margin: 0 0 10px; color: var(--graphite); }
.you-stats { display: flex; gap: 26px; margin: 4px 0 4px; }
.you-stats div { font-size: 13px; color: var(--graphite); }
.you-stats b { display: block; font: 500 26px/1.1 var(--serif); color: var(--ink); }
.coll { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.coll:last-child { border-bottom: 0; }
.coll small { color: var(--graphite); margin-left: 6px; }
.spot-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.spot-list li button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: none; padding: 10px 0; }
.spot-list li button span { display: block; font: 500 17px/1.3 var(--serif); }
.spot-list li button small { color: var(--graphite); }
.pick-list { display: grid; gap: 6px; }
.pick-list button { text-align: left; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); z-index: 60;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .search input { width: 200px; }
}
@media (max-width: 860px) {
  :root { --bar-h: 52px; }
  .bar { gap: 8px; padding: 0 8px 0 10px; }
  .brand { padding: 4px 2px; }
  .brand .name { font-size: 16px; }
  .mark { width: 28px; height: 34px; }
  .views { display: none; }
  .search { margin-left: auto; }
  .search::before { left: 9px; }
  .search::after { left: 19px; }
  .search input { width: 34px; padding: 0; border: 0; background: none; box-shadow: none; color: transparent; }
  .search input:focus { position: fixed; left: 8px; right: 56px; top: 8px; width: auto; height: 40px; padding: 0 12px 0 34px; background: var(--sheet); border: 0; border-radius: 10px; box-shadow: var(--shadow); color: var(--ink); z-index: 2; text-shadow: none; }
  .search:focus-within::before, .search:focus-within::after { z-index: 3; position: fixed; }
  .search:focus-within::before { left: 20px; top: 20px; }
  .search:focus-within::after { left: 30px; top: 31px; }
  .search input::placeholder { color: transparent; }
  .search input:focus::placeholder { color: var(--graphite); }
  .search::before, .search::after { box-shadow: 0 0 2px 1px var(--paper); }
  .search input:focus::placeholder { text-shadow: none; }
  .rec-btn {
    position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b));
    height: 52px; padding: 0 22px 0 18px; border-radius: 26px; font-size: 16px; box-shadow: var(--shadow);
  }
  .rec-btn .lamp { width: 14px; height: 14px; }
  body.card-open .rec-btn { display: none; }
  .menu-btn { display: grid; place-items: center; gap: 6px; align-content: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; box-shadow: none; }
  .menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); box-shadow: 0 0 2px 1px var(--paper); }
  /* open menu: just the options, top right, over the map with no panel behind them */
  .bar.open .views {
    display: flex; position: fixed; top: calc(var(--bar-h) - 6px); right: 8px; left: auto; z-index: 31;
    background: none; box-shadow: none; border: 0; flex-direction: column; align-items: flex-end; gap: 2px; margin: 0; padding: 0;
  }
  .bar.open .views button { text-align: right; padding: 10px 8px; font-size: 17px; border-radius: 0; box-shadow: none; background: none; }
  .bar.open .views button[aria-pressed="true"] { color: var(--ink); font-weight: 600; box-shadow: none; }
  .map-tools { bottom: calc(84px + var(--safe-b)); left: 10px; }
  .map-count { left: 10px; top: calc(var(--bar-h) + 8px); }
  .maplibregl-ctrl-bottom-right { bottom: calc(76px + var(--safe-b)); }

  .card { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 62vh; max-height: calc(100% - var(--bar-h)); border-radius: 16px 16px 0 0; transition: height .25s ease; }
  .card.full { height: calc(100% - var(--bar-h) - 8px); }
  .card-grip { display: block; height: 22px; flex: none; cursor: grab; touch-action: none; position: relative; }
  .card-grip::before { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--rule); }
  .card-scroll { padding: 0 18px calc(24px + var(--safe-b)); }
  .card h2 { font-size: 26px; }
  .sono { margin: 14px -18px 0; padding: 0 18px; }
  .sono-img, .sono-axis { height: 130px; }
  .sono-axis { left: 18px; right: 18px; }
  body.card-open .maplibregl-ctrl-bottom-right { right: 0; }
  .seek { inset: 0 18px; width: calc(100% - 36px); }
  .meter { display: none; }
  .facts { grid-template-columns: 96px 1fr; }

  .tr { grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 2px; }
  .tr .no { grid-column: 1; grid-row: 1; }
  .tr .t { grid-column: 1; grid-row: 2; }
  .tr .p { grid-column: 1; grid-row: 3; color: var(--graphite); font-size: 13px; }
  .tr .du { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .tr .d, .tr .f { display: none; }
  .th { display: none; }
  .index-wrap { padding: 18px 14px 110px; }
  .filters { flex-direction: column; align-items: stretch; }
  .tagrow { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #tag-filter .tag, #d-tags .tag, #e-tags .tag { flex: none; }
  #d-tags, #e-tags { flex-wrap: wrap; }

  .about { padding: 28px 18px 110px; }
  .about h1 { font-size: 32px; }
  .about p { font-size: 17px; }

  .steps { gap: 12px; }
  .steps li { font-size: 0; }
  .steps li::before { font-size: 11.5px; margin: 0; }
  .steps li[aria-current="step"] { font-size: 14px; }
  .steps li[aria-current="step"]::before { margin-right: 6px; }
  .scope { height: 180px; }
  .clock { font-size: 28px; }
  .big-rec { width: 76px; height: 76px; }
  .big-rec span { width: 52px; height: 52px; }
  dialog.sheet { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog.sheet.small { width: 100%; padding-bottom: calc(20px + var(--safe-b)); }
}
@media (pointer: coarse) {
  .maplibregl-ctrl-group:has(.maplibregl-ctrl-zoom-in) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- your archive ---------- */
.y-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; }
.y-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 9px 2px; border-bottom: 1px solid var(--rule); color: var(--ink); }
.y-title { font-weight: 500; }
.y-item small { color: var(--graphite); font-size: 12px; }
.you-more { margin-top: 6px; border-top: 1px solid var(--rule); }
.you-more > summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14px; list-style: none; }
.you-more > summary::-webkit-details-marker { display: none; }
.you-more > summary::after { content: '+'; float: right; color: var(--graphite); font-weight: 400; }
.you-more[open] > summary::after { content: '\2212'; }


/* ---------- Your archive: a full-screen page ---------- */
#you {
  width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0;
  border: 0; border-radius: 0; padding: 0; display: flex; flex-direction: column; background: var(--paper);
}
/* a closed dialog must stay hidden: the flex rule above would otherwise show it */
#you:not([open]) { display: none; }
#you .sheet-head {
  flex: none; position: sticky; top: 0; z-index: 1; background: var(--sheet); border-bottom: 1px solid var(--rule);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px 18px; margin: 0;
}
#you .sheet-head h2 { font-size: 22px; }
#you .sheet-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 18px calc(32px + var(--safe-b)); max-width: 720px; width: 100%; margin: 0 auto; box-sizing: border-box; }
#you .sheet-body > * { max-width: none; }
#you .you-stats { flex-wrap: wrap; }
#you .keybox { flex-wrap: wrap; }
