/* Bellatrix 2.0 – grafica "carta nautica"
 * Inchiostro su carta, azzurro dei bassi fondali per ciò che è scelto,
 * magenta delle carte solo per "sei qui". Testo: Atkinson Hyperlegible
 * (si legge bene al sole); titoli di sezione in corsivo, come i nomi dei mari. */
@font-face { font-family: "Atkinson"; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Carta"; src: url(fonts/source-serif-4-latin-600-italic.woff2) format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }

:root {
  --navy: #0F2B40;        /* inchiostro: barra in alto */
  --navy-2: #1A4260;
  --teal: #1D5C86;
  --bg: #F3F6F7;          /* carta */
  --card: #FFFFFF;
  --text: #13293B;
  --muted: #5A6B78;
  --line: #D9E2E7;
  --label: #2D4D66;
  --input: #FBFCFD;
  --input-line: #C4D3DC;
  --accent: #1D5C86;      /* blu carta */
  --fondale: #D4E8F1;     /* bassi fondali: ciò che è scelto */
  --isobata: #8FBBD0;
  --magenta: #A3146F;     /* magenta delle carte: "sei qui" */
  --ok: #17784C;          /* fanale verde */
  --warn: #A35F00;
  --err: #BF3326;         /* fanale rosso */
  --calc: #EAF3F7;
  --chip: #E8EFF3;
  --shadow: none;
  --radius: 12px;
  --tabbar: 0px;
  --top-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="night"]) {
    --navy: #071724; --navy-2: #12324A; --bg: #0B1A26; --card: #112736; --text: #DCE8EF; --muted: #93A8B6;
    --line: #213B4E; --label: #A9C7DA; --input: #0E2231; --input-line: #2C4B61; --accent: #6FB3DA;
    --fondale: #1B4A64; --isobata: #3D7895; --magenta: #E46AB8; --calc: #15324A; --chip: #18344A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #071724; --navy-2: #12324A; --bg: #0B1A26; --card: #112736; --text: #DCE8EF; --muted: #93A8B6;
  --line: #213B4E; --label: #A9C7DA; --input: #0E2231; --input-line: #2C4B61; --accent: #6FB3DA;
  --fondale: #1B4A64; --isobata: #3D7895; --magenta: #E46AB8; --calc: #15324A; --chip: #18344A; color-scheme: dark;
}
/* modalità notte (rosso, non abbaglia in navigazione notturna) */
:root[data-theme="night"] {
  --bg: #000; --card: #0d0000; --text: #ff5a4a; --muted: #b8342a; --line: #3a0b08;
  --label: #e0483b; --input: #140200; --input-line: #4a0f0a; --accent: #ff5a4a;
  --calc: #1d0402; --chip: #220503; --navy: #000; --navy-2: #2a0402; --ok: #ff5a4a;
  --warn: #ff5a4a; --err: #ff5a4a; --fondale: #2a0402; --isobata: #5a120c; --magenta: #ff5a4a; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 "Atkinson", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; }

/* barra in alto con il menu a tendina */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0 6px;
  background: var(--navy); color: #fff;
  border-bottom: 2px solid var(--isobata);
}
/* seconda isobata, sottile, staccata dalla prima */
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 5px; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0 3px, var(--isobata) 3px 4px, var(--bg) 4px 5px); }
.menubtn {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto;
  border: 0; background: transparent; color: inherit; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left;
}
.menubtn:hover { background: rgba(255, 255, 255, .07); }
.menubtn .anchor { width: 24px; height: 24px; fill: currentColor; flex: none; opacity: .9; }
.menubtn .tit { font: italic 600 22px/1.1 "Carta", Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .1px; }
.menubtn .giu { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; transition: transform .18s; opacity: .8; }
.menubtn[aria-expanded="true"] .giu { transform: rotate(180deg); }
:root[data-theme="night"] .top { color: var(--text); }
:root[data-theme="night"] .pill, :root[data-theme="night"] .pill.ok, :root[data-theme="night"] .pill.warn, :root[data-theme="night"] .pill.err { border-color: var(--line); background: transparent; }
:root[data-theme="night"] .pill.warn, :root[data-theme="night"] .pill.err { border-color: var(--text); }
.pills { display: flex; gap: 6px; flex: none; }
.pill {
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06);
  color: inherit; border-radius: 999px; padding: 5px 11px; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.pill.ok { border-color: #5fc596; }
.pill.warn { border-color: #f0b65a; }
.pill.err { border-color: #ff8f86; }
@media (max-width: 400px) { .pill { padding: 5px 8px; font-size: 12px; } .menubtn .tit { font-size: 20px; } }

/* il menu */
#velo { position: fixed; inset: 0; z-index: 30; background: rgba(8, 24, 36, .35); }
#velo[hidden], #menu[hidden] { display: none; }
#menu {
  position: fixed; z-index: 35; left: 0; right: 0; top: calc(var(--top-h) + env(safe-area-inset-top) + 2px);
  max-height: calc(100dvh - var(--top-h) - env(safe-area-inset-top) - 2px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  border-bottom: 1px solid var(--line); box-shadow: 0 12px 28px rgba(8, 24, 36, .18);
}
@media (min-width: 700px) {
  #menu { left: 8px; right: auto; width: 440px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
}
.mgr { margin: 4px 0 10px; }
.mgr > h4 { margin: 8px 8px 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.mgr.due { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; }
.mgr.due > h4 { grid-column: 1 / -1; }
.mvoce {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px;
  border: 0; background: transparent; color: var(--text); padding: 8px 10px 8px 14px; border-radius: 10px;
  font-size: 16px; text-align: left; cursor: pointer;
}
.mvoce:hover { background: var(--chip); }
.mvoce .mi { width: 24px; text-align: center; font-size: 18px; flex: none; }
.mvoce small { display: block; color: var(--muted); font-size: 12.5px; }
.mvoce.on { background: var(--fondale); font-weight: 700; }
.mvoce.on::before { content: ""; position: absolute; left: 3px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--magenta); }
.mgr.due .mvoce { font-size: 15px; padding-right: 6px; gap: 8px; }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 32px; }

/* barra della data */
.datebar {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top) + 7px); z-index: 10;
  display: flex; align-items: center; gap: 8px; margin: -18px -16px 14px; padding: 12px 16px 10px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.datebar .d { flex: 1; text-align: center; position: relative; }
.datebar .d strong { display: block; font: italic 600 20px/1.2 "Carta", Georgia, serif; color: var(--text); }
.datebar .d small { color: var(--muted); font-size: 12.5px; }
.datebar .d input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; font-size: 18px; cursor: pointer; flex: none;
}
.iconbtn:disabled { opacity: .35; cursor: default; }

/* schede */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 14px 14px 16px; margin-bottom: 12px; }
.card > h2 {
  margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--label);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card h3 { margin: 0; font-size: 15px; }
.sub { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid .half { grid-column: span 2; }
}
label.f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
label.f > span { font-size: 13px; font-weight: 700; color: var(--label); }
input, select, textarea {
  font: inherit; font-size: 16px; /* evita lo zoom automatico su iPhone */
  width: 100%; min-width: 0; padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--input-line); background: var(--input); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button:focus-visible, .chip:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
input.up { text-transform: uppercase; }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
textarea.giornale { min-height: 180px; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 15px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="night"] .btn.primary { color: #000; }
.btn.small { padding: 6px 10px; font-size: 13.5px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.pos {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
  border: 1px dashed var(--input-line); font-variant-numeric: tabular-nums; font-size: 14px; min-height: 42px;
}
.pos .t { flex: 1; }
.pos .muted { color: var(--muted); }

.calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.calc div { background: var(--calc); border-radius: 10px; padding: 8px 10px; text-align: center; }
.calc b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.calc small { color: var(--muted); font-size: 12.5px; }

/* rilevamenti */
.met { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.met-sum {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.met-sum .ora { font-weight: 700; min-width: 48px; }
.met-sum .det { flex: 1; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.met-body { padding: 0 12px 12px; border-top: 1px solid var(--line); padding-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 4px 10px; font-size: 13.5px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="night"] .chip.on, :root[data-theme="dark"] .chip.on { color: #001018; }

/* archivio */
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search input { flex: 1; }
.search select { width: auto; }
.totali { color: var(--muted); font-size: 13.5px; margin: 0 2px 10px; }
.day {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer; background: var(--card);
  border-radius: var(--radius); border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 8px; color: var(--text);
}
.day .l1 { display: flex; gap: 8px; align-items: baseline; }
.day .l1 b { font-size: 15.5px; }
.day .l1 .rt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .l1 .nm { color: var(--muted); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.day .l2 { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #FFF1D6; color: #7A4B00; font-weight: 600; }
mark { background: #FFE58A; color: inherit; border-radius: 3px; }

/* GPS */
.gpsbig { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gpsbig div { background: var(--calc); border-radius: 12px; padding: 12px; }
.gpsbig .k { font-size: 13px; color: var(--muted); }
.gpsbig .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gpsbig .wide { grid-column: 1 / -1; }
.nmea { font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 8px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.note { color: var(--muted); font-size: 13.5px; }
.ok-t { color: var(--ok); } .err-t { color: var(--err); } .warn-t { color: var(--warn); }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--navy); border: 1px solid var(--isobata); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
details > summary { cursor: pointer; color: var(--label); font-weight: 600; }

/* registri */
.segbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; margin-bottom: 12px; }
.seg { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(8, 24, 36, .12); }
.btn.block + .search, .btn.block + .card { margin-top: 12px; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; border: 0; background: transparent; padding: 3px 0; cursor: pointer; text-align: left; font-size: 14px; }
.bar .bt { height: 10px; background: var(--chip); border-radius: 6px; overflow: hidden; }
.bar .bt i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar .bv { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 72px; text-align: right; }
.bar.on .bl { color: var(--accent); font-weight: 700; }
.lista { margin-bottom: 16px; }
.mese { display: flex; justify-content: space-between; padding: 16px 4px 6px; color: var(--label); font-size: 14px; font-weight: 700; }
.voce { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.voce .vd { min-width: 44px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.voce .vt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voce .vt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voce .vt small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voce .vv { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge.warnb { background: #FDE2E1; color: #8A1C14; }
.lab { display: block; font-size: 13px; font-weight: 700; color: var(--label); margin-bottom: 2px; }
.tog { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.tog input { width: 22px; height: 22px; accent-color: var(--accent); }
.scad { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; border-left-width: 5px; }
.scad.rosso { border-left-color: var(--err); }
.scad.giallo { border-left-color: #E0A100; }
.scad .st { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scad .st small { color: var(--muted); font-size: 12.5px; }
.scad .sq { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scad.rosso .sq { color: var(--err); font-weight: 700; }

/* bordo */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--line); cursor: pointer; color: var(--text);
  background: var(--card); border-radius: var(--radius); padding: 14px; min-height: 104px; }
.tile .ti { font-size: 24px; line-height: 1; margin-bottom: 6px; color: var(--accent); }
.tile b { font-size: 15px; }
.tile small { color: var(--muted); font-size: 12.5px; }
.voce small.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.pos-tag { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .cb { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--input-line); background: var(--input);
  display: grid; place-items: center; font-weight: 800; color: #fff; cursor: pointer; font-size: 16px; }
.check.done .cb { background: var(--ok); border-color: var(--ok); }
.check .ct { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 4px 0; display: flex; flex-direction: column; }
.check .ct small { color: var(--muted); font-size: 12.5px; }
.check.done .ct span { color: var(--muted); text-decoration: line-through; }
.prog { text-align: center; min-width: 70px; } .prog b { display: block; font-size: 22px; } .prog small { color: var(--muted); font-size: 12px; }
.pbar { height: 8px; background: var(--chip); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.pbar i { display: block; height: 100%; background: var(--ok); }
.mmsi { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--calc); margin-bottom: 6px; }
.mmsi b { font-size: 18px; } .mmsi small { color: var(--muted); }

/* luoghi e ancoraggio */
.rip { color: var(--accent); font-weight: 600; }
.tab { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; font-size: 14px; }
.tab th, .tab td { padding: 5px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.tab th:first-child, .tab td:first-child { text-align: left; }
.tab th { color: var(--label); font-size: 13px; }
.tab tr.sel td { background: var(--calc); font-weight: 700; }
.ancbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 600px) { .ancbox { grid-template-columns: 260px 1fr; align-items: center; } }
#aSvg { width: 100%; max-width: 300px; aspect-ratio: 1; margin: 0 auto; display: block; background: var(--input); border-radius: 50%; border: 1px solid var(--line); }
#aSvg .cerchio { fill: rgba(30, 123, 85, .08); stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
#aSvg .anc { stroke: var(--text); stroke-width: 2; }
#aSvg .scia { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .7; }
#aSvg .barca { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
#aSvg .barca.fuori { fill: var(--err); }
.ancdati { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.ancdati div { background: var(--calc); border-radius: 10px; padding: 8px 10px; }
.ancdati small { display: block; color: var(--muted); font-size: 12.5px; }
.ancdati b { font-size: 19px; font-variant-numeric: tabular-nums; }
#allarme { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #B3261E; color: #fff; text-align: center; padding: 24px; animation: lampeggio 1s infinite; }
#allarme.on { display: flex; }
#allarme b { font-size: 30px; } #allarme span { font-size: 20px; }
#allarme .btn { font-size: 20px; padding: 16px 24px; background: #fff; color: #B3261E; border: 0; }
@keyframes lampeggio { 50% { background: #7A110B; } }
.stima { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--chip); font-size: 14px; }
.stima span { flex: 1; }
.frecce { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 330px; margin: 6px auto 10px; }
.frecce .btn { width: 100%; }
#aSvg .orig line { stroke: var(--muted); stroke-width: 1.5; }
#aSvg .arco { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
#aSvg .stimapt { fill: none; stroke: #E0A100; stroke-width: 2; }
#aSvg .anc-hit { fill: transparent; cursor: grab; }
#aSvg .ancg { touch-action: none; cursor: grab; }
.vv.dist { display: flex; flex-direction: column; align-items: flex-end; }
.vv.dist small { font-weight: 600; color: var(--accent); font-size: 12.5px; }
.btn.salpa { margin-top: 12px; border-color: var(--accent); color: var(--accent); }
#salpaBanner { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
#salpaBanner span { flex: 1 1 200px; }
#allarme .btn.ghost { background: transparent; color: #fff; border: 2px solid #fff; font-size: 17px; padding: 10px 18px; }
svg.anc-pass { width: 100%; max-width: 300px; aspect-ratio: 1; margin: 0 auto; display: block; background: var(--input); border-radius: 50%; border: 1px solid var(--line); }
svg.anc-pass .cerchio { fill: rgba(30, 123, 85, .08); stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
svg.anc-pass .scia { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .8; }
svg.anc-pass .anc { stroke: var(--text); stroke-width: 2; }
svg.anc-pass .barca { fill: var(--accent); }
/* giornale a avvenimenti */
.h2note { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.ev-new, .ev { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.ev { grid-template-columns: 70px minmax(0, 1fr) auto; }
.ev-new { margin-bottom: 10px; }
.ev { padding: 3px 0; }
.ev input[data-evk=ora] { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); padding-left: 4px; padding-right: 4px; }
.ev input { background: transparent; border-color: transparent; }
.ev input:focus { background: var(--input); }
.evdel { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 6px 8px; cursor: pointer; }

/* 1.9 – sotto-schede di Bordo, scheda luogo nelle tappe, MMSI */
.segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; margin-bottom: 12px; }
.lbox { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--calc); }
.lbox > span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.lbox small { color: var(--muted); font-size: 12.5px; }
.lbox.nuovo { background: transparent; border: 1px dashed var(--input-line); }
.lbox.nuovo > span { color: var(--muted); font-size: 13px; }
.mmsi-card .mmsi { margin-bottom: 10px; }
.mmsi .mn { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); letter-spacing: .5px; }
.mmsi .mmsi-all { color: var(--err); }
.datebar #btnArch { font-size: 17px; }

/* suggerimenti alla prima apertura */
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--fondale); border-left: 4px solid var(--accent); }
.tip p { margin: 0; flex: 1; font-size: 15px; line-height: 1.45; }
.tip p b { display: block; margin-bottom: 2px; }
.tip .btn { flex: none; }
