/* Family Travel dashboard — single stylesheet, no framework. */
:root {
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #1f2a30;
  --muted: #6b7680;
  --line: #e2e0d8;
  --accent: #1d6fa5;
  --accent-soft: #e4f0f8;
  --warn: #b7791f;
  --warn-soft: #fff4dc;
  --err: #b02a2a;
  --err-soft: #fde8e8;
  --ok: #2e7d4f;
  --ok-soft: #e3f3ea;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #eeede8; padding: 1px 4px; border-radius: 3px; }
button { font: inherit; }
[hidden] { display: none !important; }

/* header */
#header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 24px 8px; }
#header h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
#header .sub { color: var(--muted); margin-left: 8px; }
.build-info { color: var(--muted); font-size: 12px; text-align: right; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); cursor: pointer; }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.muted { background: #ecebe5; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button .count { color: var(--muted); font-weight: 400; margin-left: 4px; }
.subtabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-right: 12px; }
.subtabs button { background: var(--panel); border: none; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.subtabs button.active { background: var(--accent); color: #fff; }

/* main */
#main { padding: 16px 24px 40px; }
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel); }
.banner.err { background: var(--err-soft); border-color: #f1c4c4; color: var(--err); }
.banner.warn { background: var(--warn-soft); border-color: #f0dcae; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner code { background: rgba(0,0,0,.06); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.toolbar select, .toolbar input[type=search] { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); max-width: 180px; }
.toolbar input[type=search] { width: 200px; }
.toolbar .active-filter { border-color: var(--accent); background: var(--accent-soft); }
.toolbar .link-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 4px 6px; }
.toolbar .result-count { color: var(--muted); font-size: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }

/* table */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; min-width: 760px; }
table.grid th, table.grid td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.grid th { position: sticky; top: 0; background: #faf9f6; font-weight: 600; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
table.grid th:hover { color: var(--ink); }
table.grid th.sorted { color: var(--accent); }
table.grid th .arrow { font-size: 10px; margin-left: 3px; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--accent-soft); }
table.grid tbody tr.selected { background: #d6e8f5; }
table.grid td.name { font-weight: 600; white-space: nowrap; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.muted, .muted { color: var(--muted); }
table.grid tr.past td { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 3px; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #eeede8; font-size: 11px; white-space: nowrap; }
.chip.status-idea { background: #ecebe5; }
.chip.status-shortlist { background: #fff1c7; }
.chip.status-planned, .chip.status-planning { background: var(--accent-soft); color: var(--accent); }
.chip.status-booked { background: var(--ok-soft); color: var(--ok); }
.chip.status-done, .chip.status-archived { background: #e6e6e6; color: var(--muted); }
.chip.status-confirmed { background: var(--ok-soft); color: var(--ok); }
.chip.status-tentative { background: #fff1c7; }
.chip.hazel-coming { background: #e8f1e4; }
.chip.hazel-kenneled { background: #f3e8e8; }
.chip.hazel-home { background: #eeede8; }
.chip.hazel-undecided { background: var(--warn-soft); color: var(--warn); }
.chip.type-leisure { background: #e4f0f8; }
.chip.type-visitor { background: #efe4f8; }
.chip.type-work { background: #f8efe4; }
.chip.gate { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 100vw); background: var(--panel); box-shadow: -8px 0 24px rgba(0,0,0,.12); z-index: 20; display: flex; flex-direction: column; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.15); z-index: 19; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; }
.icon-btn { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.drawer-body { padding: 12px 18px 24px; overflow-y: auto; }
.drawer-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 6px; }
dl.fields { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; margin: 0; }
dl.fields dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
dl.fields dd { margin: 0; }
.drawer-body .linked a { display: block; padding: 4px 0; }
.drawer-body .notes { white-space: pre-wrap; }
.gatelist { list-style: none; padding: 0; margin: 0; }
.gatelist li::before { content: "☐ "; color: var(--warn); }
.gatelist li.met::before { content: "☑ "; color: var(--ok); }

/* buttons */
.btn { padding: 5px 12px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent-soft); color: var(--accent); cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--accent); color: #fff; }
.btn:disabled { border-color: var(--line); background: var(--panel); color: var(--muted); cursor: default; }

/* timeline */
.legend { display: inline-flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-left: 8px; }
.legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; border: 1px solid rgba(0,0,0,.12); }
.legend .lg-visitor { background: repeating-linear-gradient(135deg, #8e6bb8 0 2px, rgba(142,107,184,.25) 2px 5px); }
.legend .lg-break { background: rgba(46,125,79,.25); }
.legend .lg-today { width: 0; height: 12px; border: none; border-left: 2px dashed var(--err); border-radius: 0; }
.tl-layout { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
.tl-chart-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 12px 12px; overflow-x: auto; }
.tl-canvas { position: relative; min-width: 640px; }
.tl-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 14px; font-size: 13px; }
.tl-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.tl-break { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.tl-break span:last-child { white-space: nowrap; }
@media (max-width: 900px) { .tl-layout { grid-template-columns: 1fr; } }

/* timeline CSS fallback (no Chart.js) */
.fb { min-width: 640px; font-size: 12px; }
.fb-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; height: 24px; }
.fb-row.fb-head { height: 20px; }
.fb-row.fb-group { background: rgba(0,0,0,.04); font-weight: 600; color: var(--muted); }
.fb-label { padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-track { position: relative; height: 100%; border-left: 1px solid var(--line); }
.fb-month { position: absolute; top: 0; font-size: 11px; color: var(--muted); padding-left: 3px; border-left: 1px solid var(--line); height: 100%; }
.fb-break { position: absolute; top: 0; bottom: 0; background: var(--ok); pointer-events: none; }
.fb-today { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--err); }
.fb-bar { position: absolute; top: 5px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.fb-bar.visitor { opacity: .55; height: 10px; top: 7px; }

/* placeholder views */
.placeholder { padding: 40px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

#footer { padding: 12px 24px 24px; color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  #header { flex-direction: column; align-items: flex-start; }
  .build-info { justify-content: flex-start; }
  #main, .tabs, #header, #footer { padding-left: 12px; padding-right: 12px; }
}
@media print {
  .tabs, .toolbar, #footer, .drawer, .drawer-backdrop { display: none !important; }
  .table-wrap { box-shadow: none; }
}

/* timeline controls */
.btn.sm { padding: 2px 9px; font-size: 14px; line-height: 18px; }
.zoom { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.zoom .hint { font-size: 11px; margin-left: 6px; }
.tl-side .small { font-size: 12px; margin: 12px 0 0; }
.tl-canvas canvas { cursor: grab; }

/* heat view */
.heat-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .heat-layout { grid-template-columns: 1fr; } }
table.heat { min-width: 0; }
table.heat th.corner, table.heat th.rowhead { position: sticky; left: 0; background: #faf9f6; z-index: 1; }
table.heat th.rowhead { font-weight: 600; color: var(--ink); cursor: default; }
table.heat th a, table.heat th.rowhead a { color: inherit; text-decoration: none; }
table.heat th a:hover { text-decoration: underline; color: var(--accent); }
table.heat td.cell { text-align: center; font-variant-numeric: tabular-nums; min-width: 56px; cursor: default; }
table.heat td.cell[data-heat-cell] { cursor: pointer; }
table.heat td.cell[data-heat-cell]:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
table.heat td.cell sup { font-size: 9px; opacity: .8; margin-left: 1px; }
table.heat tr.totals td, table.heat tr.totals th { border-top: 2px solid var(--line); color: var(--muted); font-weight: 600; }
table.grid tbody tr:has(td.cell):hover { background: transparent; }
.heat-chart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 12px; }
.heat-chart h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 8px; }
.heat-canvas { position: relative; }
.small { font-size: 12px; }

/* visitors view */
.soon { margin-bottom: 16px; }
.soon h3, .kcol h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.soon-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.soon-item { flex: 0 0 auto; min-width: 180px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 8px 12px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.soon-item:hover { border-color: var(--accent); }
.soon-name { font-weight: 600; }
.soon-when { font-size: 12px; color: var(--muted); }
.soon-count { font-size: 12px; }
.now { color: var(--ok); }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }
.kcol { background: rgba(0,0,0,.03); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kempty { color: var(--muted); font-size: 13px; padding: 14px 6px; text-align: center; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 10px; cursor: pointer; }
.vcard:hover { border-color: var(--accent); }
.vcard-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.vname { font-weight: 700; font-size: 15px; margin-right: 2px; }
.chip.kind-spain-visit { background: #e8f1e4; }
.chip.kind-europe-meetup { background: #efe4f8; }
.chip.kind-either { background: #eeede8; }
.vwhen { font-size: 13px; margin-bottom: 6px; }
dl.vmeta { display: grid; grid-template-columns: 70px 1fr; gap: 2px 8px; margin: 0; font-size: 12px; }
dl.vmeta dt { color: var(--muted); }
dl.vmeta dd { margin: 0; }
.dots { display: inline-flex; gap: 2px; vertical-align: middle; }
.dots .dot { width: 9px; height: 9px; border-radius: 50%; background: #e2e0d8; display: inline-block; }
.dots .dot.on { background: var(--accent); }
.vlinks { margin-top: 8px; font-size: 13px; }
.vonly { margin-top: 6px; font-size: 12px; }

/* feedback view */
.banner.ok-note { background: var(--ok-soft); border-color: #bfe0cc; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.who-opt { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--panel); }
.who-opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.who-opt input { display: none; }
.fb-pending { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.fb-pending h3, .fb-form h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 4px 0 8px; }
.fb-pending ul { margin: 0 0 10px; padding-left: 18px; }
.fb-pending li { margin: 3px 0; }
.fb-pending .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.fb-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fb-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.fb-form input, .fb-form select, .fb-form textarea { font: inherit; font-size: 14px; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.fb-form textarea { resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: -4px; }
.checks label { flex-direction: row; align-items: center; gap: 4px; font-size: 13px; color: var(--ink); }
.fb-form button[type=submit] { align-self: flex-start; margin-top: 4px; }
.fb-result { font-size: 13px; min-height: 1em; }
.fb-result.ok, .ok-text { color: var(--ok); }
.fb-result.err { color: var(--err); }

/* deals + links */
.chip.alert { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.chip.found-scan { background: #efe4f8; }
.chip.found-bruce, .chip.found-katie { background: #e4f0f8; }
table.deals tr.alert-row td { background: #eef8f1; }
table.deals tr.alert-row td.name::before { content: "● "; color: var(--ok); }
table.deals td.notes-cell { max-width: 320px; font-size: 12px; color: var(--muted); }
table.deals tbody tr { cursor: default; }
table.deals tbody tr:hover { background: transparent; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.link-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.link-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 4px 0 8px; display: flex; gap: 8px; align-items: center; }
.link-group ul { margin: 0; padding-left: 18px; max-height: 420px; overflow-y: auto; }
.link-group li { margin: 3px 0; font-size: 13px; }

/* events */
.timebar { margin-top: -6px; }
.chip.kind-festival { background: #fde8d0; } .chip.kind-market, .chip.kind-christmas-market, .chip.kind-fair { background: #fff1c7; }
.chip.kind-exhibition, .chip.kind-concert { background: #efe4f8; } .chip.kind-sport { background: #e4f0f8; } .chip.kind-kids, .chip.kind-food { background: #e8f1e4; }
.chip.estatus-found { background: #ecebe5; } .chip.estatus-interested { background: #fff1c7; } .chip.estatus-going { background: var(--ok-soft); color: var(--ok); }
.chip.estatus-skip, .chip.estatus-past { background: #e6e6e6; color: var(--muted); }
.ev-links { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.ev-links h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 4px 0 8px; }
.ev-links p { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.ev-links .btn { text-decoration: none; }
.ev-linklist { columns: 2; margin: 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 800px) { .ev-linklist { columns: 1; } }

/* map */
.map { height: 70vh; min-height: 420px; background: #dfe8ee; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.layers { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.layers .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink); cursor: pointer; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.emoji-pin { font-size: 18px; line-height: 22px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.emoji-pin.tentative { opacity: .6; }
.diamond-pin i { display: block; width: 10px; height: 10px; transform: rotate(45deg); border: 1.5px solid #fff; box-shadow: 0 0 2px rgba(0,0,0,.4); }
.legend .lg-ring { width: 12px; height: 12px; border: 3px solid #5b9bd5; border-radius: 50%; background: transparent; }
.legend .lg-diamond { width: 9px; height: 9px; background: #e07a2f; transform: rotate(45deg); border-radius: 1px; }
.leaflet-container { font: inherit; }
.leaflet-tooltip { font-size: 12px; }
@media (max-width: 800px) { .map { height: 60vh; } }

/* map v1.1 */
.dot-pin i { display: block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 2px rgba(0,0,0,.45); }
.ev-badge b { display: block; width: 22px; height: 22px; border-radius: 50%; background: #e07a2f; color: #fff; font-size: 12px; line-height: 22px; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.legend .lg-evbadge { width: 16px; height: 16px; border-radius: 50%; background: #e07a2f; color: #fff; font-style: normal; font-size: 10px; line-height: 16px; text-align: center; border: none; }
.evbox-tip { max-width: 360px; white-space: normal; }
.evbox ul { margin: 4px 0 0; padding-left: 0; list-style: none; }
.evbox li { display: flex; gap: 6px; align-items: baseline; margin: 2px 0; font-size: 12px; }
.evbox li i { flex: 0 0 8px; width: 8px; height: 8px; transform: rotate(45deg); display: inline-block; }
.geo-results { display: flex; flex-direction: column; gap: 4px; background: #faf9f6; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.geo-opt { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; cursor: pointer; font-size: 12px; }
.geo-opt:hover { border-color: var(--accent); }
.geo-conflict { background: var(--warn-soft); border: 1px solid #f0dcae; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.fb-form .row { display: flex; gap: 8px; align-items: center; }

/* drawer above the map, edit form, legs, stays, priority */
.drawer { z-index: 2000; }
.drawer-backdrop { z-index: 1999; }
.chip.prio-must-do { background: #fde8d0; color: #9a4b0a; font-weight: 600; }
.chip.prio-top { background: #fff1c7; color: #7a5a00; }
.chip.prio-low { background: #ecebe5; color: var(--muted); }
.legs, .stays { margin: 0; padding-left: 18px; }
.legs li, .stays li { margin: 4px 0; }
.legmode { font-size: 15px; }
.edit-form { display: flex; flex-direction: column; gap: 8px; }
.efield { display: flex; flex-direction: column; gap: 3px; }
.efield > label { font-size: 12px; color: var(--muted); }
.efield input, .efield select, .efield textarea { font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.efield .checks label { font-size: 12px; }
.efield .checks.ids { max-height: 140px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.legline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.legline input { flex: 1 1 90px; min-width: 70px; }
.legline input.wide { flex: 3 1 200px; }
.legline select { flex: 0 0 auto; }
.legrow, .stayrow { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin-bottom: 6px; background: #fbfaf7; }
.legrow input[name=leg_notes], .stayrow input[name=stay_notes] { font-size: 12px; }
.edit-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.edit-actions .fb-result { font-size: 12px; }
.drawer-head .btn.sm { margin-right: 6px; }

/* trip itinerary + trip map */
.acts { margin: 0 0 8px; padding-left: 18px; }
.acts li { margin: 3px 0; }
.acts li.skip { opacity: .5; text-decoration: line-through; }
.act-ic { font-size: 14px; }
.drawer-body h4 { font-size: 13px; margin: 12px 0 4px; padding-left: 8px; }
.actrow { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin-bottom: 6px; background: #fbfaf7; }
.tm-layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .tm-layout { grid-template-columns: 1fr; } }
.tm-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px 12px; max-height: 70vh; overflow-y: auto; }
.tm-side h4 { font-size: 13px; margin: 12px 0 4px; padding-left: 8px; }
.tm-side h4 a { color: inherit; text-decoration: none; }
.tm-list { margin: 0; padding-left: 0; list-style: none; }
.tm-list li { display: flex; gap: 8px; align-items: baseline; padding: 3px 4px; border-radius: 4px; font-size: 13px; }
.tm-list li.pin { cursor: pointer; }
.tm-list li.pin:hover { background: var(--accent-soft); }
.tm-list li.nopin { color: var(--muted); }
.tm-n { flex: 0 0 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.act-pin span { display: block; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #fff; border: 3px solid #1d6fa5; box-shadow: 0 1px 3px rgba(0,0,0,.4); font-size: 14px; line-height: 22px; text-align: center; }
.act-pin span { display: flex; align-items: center; justify-content: center; }
.leaflet-popup-content { font-size: 13px; }

/* Session 18: notes formatting, docked drawer on the Trip map */
.notes.md p { margin: 0 0 8px; }
.notes.md ul, .notes.md ol { margin: 0 0 8px; padding-left: 20px; }
.notes.md h4, .notes.md h5, .notes.md h6 { margin: 10px 0 4px; padding: 0; font-size: 14px; }
.notes.md h5 { font-size: 13px; } .notes.md h6 { font-size: 13px; color: var(--muted); }
.notes.md code { font-size: 12px; background: #f1efe8; padding: 0 4px; border-radius: 4px; }
body.docked #main { margin-right: min(460px, 100vw); }
body.docked .drawer { box-shadow: none; border-left: 1px solid var(--line); }
body.docked .tm-layout { grid-template-columns: 280px 1fr; }
.edit-form > .edit-actions:first-child { position: sticky; top: 0; background: var(--panel); padding: 6px 0; margin: -12px 0 0; z-index: 1; border-bottom: 1px solid var(--line); }
