/* trips.css — the Trips tab (js/trips/): the panel, drop zone, trip cards, the day-by-day
   timeline, the check-before-saving dialog and the travel calendar. Phone sizes: mobile.css. */

/* ---------- Panel (sits where the map's "Live flights" panel is) ---------- */
.trips-panel {
  left: 12px; width: min(440px, calc(100vw - 90px)); box-sizing: border-box; padding: 14px 16px 16px;
  max-height: calc(100vh - var(--topbar-h, 56px) - 110px - env(safe-area-inset-top, 0px)); overflow-y: auto;
}
.trips-panel[hidden] { display: none; }
.trips-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.trips-head h2 { margin: 0; font-size: 19px; }
.trips-head button { padding: 6px 12px; font-size: 12.5px; }
.trips-signedout p { margin: 0 0 12px; color: var(--muted); line-height: 1.5; }
.trips-sub { margin: 16px 0 8px; font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
:is(.trips-panel, .trips-page, .trip-review, .trip-cal) .dim { color: var(--muted); }
:is(.trips-panel, .trips-page, .trip-review, .trip-cal) .small { font-size: 12px; }
:is(.trips-panel, .trips-page, .trip-review, .trip-cal) .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em; }
:is(.trips-panel, .trips-page, .trip-review, .trip-cal) button.danger { color: var(--bad); }

/* Drop zone */
.trip-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 18px 14px; border: 2px dashed rgba(150, 175, 210, 0.38); border-radius: 12px; background: rgba(255, 255, 255, 0.03);
}
.trip-drop svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trip-drop b { font-size: 15px; }
.trip-drop .dim { font-size: 12.5px; line-height: 1.45; }
.trip-drop-acts { display: flex; gap: 8px; margin: 4px 0 2px; }
.trip-drop.over { border-color: var(--accent); background: rgba(124, 199, 255, 0.1); }
.trip-drop.busy { opacity: 0.6; pointer-events: none; }
.trip-msg { margin-top: 8px; font-size: 13px; line-height: 1.45; }
.trip-msg:empty { display: none; }
.trip-msg[data-kind="bad"] { color: var(--bad); }
.trip-msg[data-kind="warn"] { color: var(--warn); }
.spin { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid var(--edge); border-top-color: var(--accent); border-radius: 50%; animation: trip-spin 0.8s linear infinite; }
@keyframes trip-spin { to { transform: rotate(360deg); } }

/* Trip cards */
.trips-list { display: flex; flex-direction: column; gap: 10px; }
.trips-list > p { margin: 0; font-size: 13px; }
.trip-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); color: var(--text); font-weight: 400;
}
.trip-card:hover { border-color: var(--accent); }
.trip-card-top { display: flex; flex-direction: column; gap: 2px; }
.trip-card-top b { font-size: 15px; }
.trip-card-top .dim { font-size: 12.5px; }
.trip-route { font-size: 13px; font-weight: 700; }
.trip-next { font-size: 12.5px; }
.trips-past summary { cursor: pointer; margin: 14px 0 8px; color: var(--muted); font-size: 13px; }
.trip-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 1px 9px; border-radius: 11px; background: rgba(150, 175, 210, 0.16); font-size: 12px; white-space: normal; }
.trip-chip.good { background: rgba(127, 224, 181, 0.15); color: var(--good); }
.trip-chip.warn { background: rgba(242, 193, 78, 0.15); color: var(--warn); }
.trip-chip.bad { background: rgba(255, 138, 148, 0.15); color: var(--bad); }

/* ---------- One trip: day-by-day timeline ---------- */
.trip-back { font-size: 13px; margin-bottom: 6px; }
.trip-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trip-title-row h2 { margin: 0; font-size: 20px; }
.small-btn { padding: 5px 10px; font-size: 12px; }
.trip-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.trip-acts button { padding: 6px 10px; font-size: 12.5px; }
.trip-day { margin: 16px 0 8px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.leg { display: flex; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); }
.leg-badge { flex: none; width: 34px; height: 34px; border-radius: 8px; background: rgba(150, 175, 210, 0.18); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.leg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.leg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.leg-times { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.leg-times > div { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.leg-times .leg-arr { align-items: flex-end; text-align: right; }
.leg-t { font-size: 19px; font-weight: 700; color: var(--text); }
.leg-t sup { font-size: 10px; color: var(--warn); }
.leg-dur { align-items: center; gap: 3px; }
.leg-dur i { display: block; width: 48px; height: 2px; background: var(--edge); }
.leg-line { font-size: 12.5px; }
.leg-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.leg-acts button { padding: 5px 10px; font-size: 12px; }
.trip-conn, .trip-stay { margin: 0 0 0 16px; padding: 8px 0 8px 18px; border-left: 2px dashed var(--edge); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 12.5px; line-height: 1.5; }
.trip-conn[data-level="warn"] { border-left-color: var(--warn); }
.trip-conn[data-level="bad"] { border-left-color: var(--bad); }
.trip-conn[data-level="good"] { border-left-color: var(--good); }
.trip-stay { border-left-style: solid; color: var(--muted); }

/* Airport labels on the map */
.leaflet-tooltip.trip-ap-tip { background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 6px; padding: 1px 6px; font: 700 11.5px/1.4 var(--font); box-shadow: none; }
.leaflet-tooltip.trip-ap-tip::before { display: none; }

/* Updates list in a trip */
.trip-updates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trip-updates li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-size: 13px; }
.trip-updates li.new { border-left: 3px solid var(--warn); }
.trip-chip.accent { background: rgba(124, 199, 255, 0.16); color: var(--accent); }
.leg-t s { font-size: 12px; font-weight: 400; }

/* In-app alert banner (below the top bar, every tab) */
.trip-alert {
  position: fixed; z-index: 1047; top: calc(var(--topbar-h, 56px) + 10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px)); box-sizing: border-box; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; border-color: rgba(242, 193, 78, 0.55); font-size: 13.5px; line-height: 1.4;
}
.trip-alert[hidden] { display: none; }
.ta-icon { flex: none; width: 24px; height: 24px; border-radius: 12px; background: var(--warn); color: var(--night); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ta-text { flex: 1; min-width: 0; }
.ta-text .dim { color: var(--muted); font-size: 12px; }
.ta-acts { display: flex; gap: 6px; flex: none; }
.ta-acts button { padding: 6px 10px; font-size: 12.5px; }
body.meet-mode .trip-alert, body.wv-open .trip-alert { display: none; }

/* ---------- Check before saving ---------- */
.trip-review { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.tr-from { margin: 0 0 10px; font-size: 13px; }
.tr-top { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.trip-review label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
/* Trips close to an upload (or to a trip being combined): pick one, or a new trip */
.tr-near { margin: 12px 0 0; padding: 8px 12px 10px; border: 1px solid rgba(242, 193, 78, 0.55); border-radius: 10px; background: rgba(242, 193, 78, 0.08); }
.tr-near legend { padding: 0 6px; font-size: 13px; font-weight: 700; }
.tr-near-opt { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 13px; }
.tr-near-opt input { margin-top: 3px; flex: none; }
.tr-near-opt > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tr-near-opt .dim { font-size: 12px; }
.tr-near-opt:hover { border-color: var(--edge); }
.tr-near-opt.on { border-color: var(--accent); background: rgba(124, 199, 255, 0.1); }
.tr-who { border-color: rgba(150, 175, 210, 0.5); background: rgba(150, 175, 210, 0.1); }
/* Several trips in one upload: a strip of every trip found, checked and saved one at a time */
.tr-batch { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: rgba(124, 199, 255, 0.1); border: 1px solid rgba(124, 199, 255, 0.4); font-size: 13px; }
.tr-batch p { margin: 0 0 8px; }
.tr-bchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tr-bchip { padding: 3px 10px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); font-size: 12px; color: var(--muted); }
.tr-bchip.on { border-color: var(--accent); color: var(--text); font-weight: 700; }
.tr-bchip.saved { color: var(--good); border-color: rgba(127, 224, 181, 0.5); }
.tr-bchip.skipped { text-decoration: line-through; opacity: 0.7; }
.tr-msg .linkish { font-weight: 700; }
.tr-msg .linkish.danger { color: var(--bad); }
.tr-merge { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: rgba(124, 199, 255, 0.1); border: 1px solid rgba(124, 199, 255, 0.4); font-size: 13px; }
.tr-problems { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: rgba(242, 193, 78, 0.1); border: 1px solid rgba(242, 193, 78, 0.4); font-size: 13px; }
.tr-problems b { color: var(--warn); }
.tr-problems ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.tr-h { margin: 16px 0 8px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tr-flight {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end;
  margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 10px;
}
.tr-flight legend { padding: 0 6px; font-size: 12px; color: var(--muted); }
.tr-flight .text-in { padding: 7px 8px; font-size: 13px; }
.tr-flight .code { text-transform: uppercase; }
.tr-remove { padding: 8px 10px; font-size: 12px; justify-self: end; }
.tr-flight .c1 { grid-column: span 1; } .tr-flight .c2 { grid-column: span 2; } .tr-flight .c3 { grid-column: span 3; } .tr-flight .c4 { grid-column: span 4; } .tr-flight .c12 { grid-column: 1 / -1; }
.tr-booking { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 10px; }
.tr-wide, .tr-same, .tr-booking .tr-warn { grid-column: 1 / -1; }
.trip-review label.tr-same { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.tr-same input { width: 18px; height: 18px; accent-color: var(--accent); }
.tr-warn { color: var(--warn); font-size: 12px; }
.text-in.needs { border-color: var(--warn); }
.text-in.bad-in { border-color: var(--bad); }
.tr-foot { position: sticky; bottom: -18px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 14px -18px -18px; padding: 12px 18px; background: #101C30; border-top: 1px solid var(--edge); }
.tr-msg { margin-right: auto; font-size: 13px; color: var(--warn); }
.tr-foot.asking { background: #2A1A1E; border-top-color: var(--bad); }
.tr-ask { margin-right: auto; font-weight: 700; font-size: 15px; color: var(--text); }
.danger-btn { background: var(--bad); color: #fff; border: 0; font-weight: 700; }

/* ---------- Travel calendar ---------- */
.trip-cal { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 10px; font-size: 16px; }
.cal-nav button { width: 38px; height: 34px; padding: 0; font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); border-radius: 10px; overflow: hidden; }
.cal-dow { padding: 6px 8px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, 0.04); border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.cal-cell { min-height: 92px; padding: 6px; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); min-width: 0; }
.cal-cell.out { background: rgba(0, 0, 0, 0.15); }
.cal-cell.away { background: rgba(124, 199, 255, 0.07); }
.cal-n { font-size: 12.5px; font-weight: 700; }
.cal-cell.today .cal-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: var(--night); }
.cal-leg { display: block; padding: 2px 5px; border-radius: 5px; background: rgba(124, 199, 255, 0.18); color: #D4ECFF; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-stay { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cal-foot button { padding: 7px 12px; font-size: 12.5px; }

@media (max-width: 860px) {
  .tr-flight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tr-flight .c1, .tr-flight .c2 { grid-column: span 2; } .tr-flight .c3, .tr-flight .c4 { grid-column: span 4; }
  .tr-flight .c1 { grid-column: span 1; }
  .tr-remove { grid-column: 1 / -1 !important; justify-self: start; order: 99; }
  .tr-top, .tr-booking { grid-template-columns: 1fr; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-route { display: none; }
  .cal-leg { font-size: 10px; padding: 1px 3px; }
  .leg-t { font-size: 16px; }
  .leg-dur i { width: 28px; }
  .leg { padding: 10px; gap: 10px; }
  .trip-alert { flex-wrap: wrap; }
  .ta-acts { width: 100%; justify-content: flex-end; }
}

/* Check before saving: places to stay (same 12-column grid as flights) */
.tr-stay { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; margin: 0 0 8px; padding: 10px 12px; border: 1px solid rgba(255, 176, 92, 0.5); border-radius: 10px; }
.tr-stay legend { padding: 0 6px; font-size: 12px; color: #FFC27A; text-transform: capitalize; }
.tr-stay .text-in { padding: 7px 8px; font-size: 13px; }
.tr-stay .code { text-transform: uppercase; }
.tr-stay .c1 { grid-column: span 1; } .tr-stay .c2 { grid-column: span 2; } .tr-stay .c3 { grid-column: span 3; } .tr-stay .c4 { grid-column: span 4; } .tr-stay .c12 { grid-column: 1 / -1; } .tr-stay .c6 { grid-column: span 6; }
.tr-found { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); }
.tr-stay .tr-merge { margin: 0; }
.cal-ev { display: block; padding: 1px 5px; border-radius: 5px; background: rgba(255, 176, 92, 0.16); color: #FFD3A0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell.focus { background: rgba(124, 199, 255, 0.12); }
@media (max-width: 860px) {
  .tr-stay { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tr-stay .c1, .tr-stay .c2 { grid-column: span 2; } .tr-stay .c3, .tr-stay .c4, .tr-stay .c6 { grid-column: span 4; }
  .cal-ev { font-size: 10px; padding: 1px 3px; }
}

/* Cost boxes in "Check before saving" (amount + currency; Reports → Trip Costs) */
.tr-booking { grid-template-columns: 1fr 1fr 1fr; }
.tr-cost { display: flex; gap: 6px; }
.tr-cost input[name="cost_amount"] { flex: 1; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tr-cost input[name="cost_cur"] { flex: none; width: 58px; text-align: center; }
.tr-costbox .small { display: block; margin-top: 3px; }
.tr-flight .c8 { grid-column: span 8; }
.tr-costnote { align-self: center; }
@media (max-width: 760px) { .tr-booking { grid-template-columns: 1fr; } }
/* "⚠ Missing flights" filter under the search, and the chips it finds */
.trips-miss { margin: 6px 0 2px; }
.trips-miss[aria-pressed="true"] { background: rgba(242, 193, 78, 0.18); color: var(--warn); border-color: rgba(242, 193, 78, 0.5); }
.trips-miss .n { margin-left: 4px; font-weight: 700; }
.trip-row .trip-chips { margin-top: 4px; }
.nf-miss { margin-top: 8px; }
/* FAA status on flights (core/faa.js): ground stop / closed (red), delay program (orange), delays (amber) */
.faa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9px; font-weight: 700; font-size: 12.5px; text-decoration: none; }
.faa-chip.sm { padding: 1px 7px; font-size: 11px; margin-right: 6px; border-radius: 11px; }
.faa-chip.bad { background: rgba(255, 138, 148, 0.18); color: var(--bad); }
.faa-chip.gdp { background: rgba(255, 160, 90, 0.18); color: #FFB36B; }
.faa-chip.warn { background: rgba(242, 193, 78, 0.16); color: var(--warn); }
.faa-chip .faa-more { font-weight: 400; opacity: 0.8; }
.faa-line { margin-top: 6px; }
/* Photos tab (js/trips/photos.js) */
.ph-drop { border: 2px dashed rgba(150, 175, 210, 0.45); border-radius: 14px; padding: 14px; text-align: center; cursor: pointer; margin-bottom: 8px; }
.ph-drop:hover, body.dragging .ph-drop { border-color: var(--accent); background: rgba(124, 199, 255, 0.06); }
.ph-ups { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; font-size: 12px; }
.ph-up { padding: 2px 8px; border-radius: 9px; background: rgba(150, 175, 210, 0.16); }
.ph-up.done { color: var(--good); } .ph-up.failed { color: var(--bad); }
.ph-day { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 8px; }
/* computers: each day's heading stays on top while you scroll its photos */
@media (min-width: 901px) { .ph-sec .ph-day { position: sticky; top: calc(var(--topbar-h) + 46px); z-index: 3; margin: 10px -6px 6px; padding: 6px; background: #0E1A2C; } }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
/* computers: the size slider sets each photo's width (any size); the columns reflow to fit */
@media (min-width: 901px) and (any-pointer: fine) { .ph-sec .ph-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--ph-size, 150px), 100%), 1fr)); gap: 4px; } }
.ph-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; margin-bottom: 8px; flex-wrap: wrap; }
.ph-head .ph-live { margin-bottom: 0; }
.ph-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.ph-seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; }
.ph-seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.ph-seg button[aria-pressed="true"] { background: rgba(124, 199, 255, 0.16); color: var(--accent); font-weight: 700; }
.ph-showgal { border: 0; border-radius: 18px; padding: 6px 14px; background: var(--accent); color: #0C1626; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ph-showgal:disabled { opacity: 0.4; cursor: default; }
.ph-size { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
@media (max-width: 900px) { .ph-head { flex-wrap: nowrap; } .ph-tools { flex-wrap: nowrap; gap: 6px; } .ph-seg button { padding: 7px 10px; font-size: 13px; } .ph-showgal { padding: 8px 12px; } }
.ph-sz-s { font-size: 9px; } .ph-sz-l { font-size: 15px; }
.ph-size input[type="range"] { width: 120px; height: 20px; accent-color: var(--accent); margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; outline-offset: 2px; }
.ph-tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: rgba(150, 175, 210, 0.16); cursor: pointer; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-tile.sel { outline: 3px solid var(--accent); outline-offset: 2px; z-index: 1; }
.ph-tile img { transition: transform 0.2s ease; }
.ph-fit .ph-tile { background: rgba(150, 175, 210, 0.1); }
.ph-fit .ph-tile img { object-fit: contain; }
/* ♡ / ♥ on every photo (top right): one click or tap; filled red when it's one of your favorites */
.ph-tile .ph-heart { position: absolute; right: 4px; top: 4px; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 16px;
  font-size: 19px; line-height: 1; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75); cursor: pointer; opacity: 0; transition: opacity 0.15s, transform 0.12s; }
.ph-tile:hover .ph-heart, .ph-tile .ph-heart.on, html.touch .ph-tile .ph-heart { opacity: 1; }
html.touch .ph-tile .ph-heart:not(.on) { opacity: 0.85; }
.ph-tile .ph-heart:hover { transform: scale(1.15); background: rgba(0, 0, 0, 0.25); }
.ph-tile .ph-heart.on { color: #FF4D5A; text-shadow: 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.5); }
.ph-tile .ph-ns { right: auto; left: 6px; }
.ph-tile .ph-hov { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); color: #fff; font-size: 10.5px; line-height: 1.3; text-align: left;
  opacity: 0; transition: opacity 0.15s; pointer-events: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ph-tile .ph-hov b { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.ph-tile .ph-hov b:empty { display: none; }
.ph-tile:hover .ph-hov { opacity: 1; }
.ph-tile:hover .ph-pin { opacity: 0; }
.ph-tile.picked img { filter: brightness(0.85); }
.ph-tile .ph-check { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; background: #1F6FD1; color: #fff; font-size: 12px; font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.ph-selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 1150; display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 16px; border-radius: 14px;
  background: #142235; color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); white-space: nowrap; max-width: calc(100vw - 24px); overflow-x: auto; }
.ph-selbar b { margin-right: 6px; }
.ph-selbar button { border: 0; border-radius: 9px; padding: 6px 10px; background: rgba(255, 255, 255, 0.12); color: #fff; font: inherit; font-size: 12.5px; cursor: pointer; }
.ph-selbar button:hover { background: rgba(255, 255, 255, 0.22); }
.ph-selbar button.danger { background: rgba(229, 72, 77, 0.28); color: #ffc2c4; }
.ph-favbtn { font-size: 17px; color: var(--muted); }
.ph-favbtn.on { color: #E5484D; }
.ph-tile .ph-pin { position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; background: rgba(0, 0, 0, 0.55); color: #fff; border-radius: 6px; padding: 1px 6px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-tile .ph-ns { position: absolute; right: 6px; top: 6px; font-size: 10px; background: rgba(255, 255, 255, 0.92); color: #333; border-radius: 6px; padding: 1px 6px; }
.ph-card .ph-nav { margin-left: auto; display: flex; gap: 4px; }
.ph-big { display: block; position: relative; width: 100%; margin-top: 8px; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.ph-big .ph-zoom { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 15px; opacity: 0.85; }
.ph-big:hover .ph-zoom { opacity: 1; }
/* Live photos (trips/photos.js) */
.ph-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--good); margin-bottom: 8px; }
.ph-livedot { width: 8px; height: 8px; border-radius: 4px; background: var(--good); box-shadow: 0 0 0 0 rgba(34, 160, 107, 0.5); animation: ph-pulse 2s infinite; }
@keyframes ph-pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 160, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); } }
.ph-tile.fresh { outline: 3px solid #22A06B; outline-offset: -3px; animation: ph-in 0.5s ease; }
@keyframes ph-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
.ph-tile .ph-new { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 700; background: #22A06B; color: #fff; border-radius: 6px; padding: 1px 6px; }
.ph-coming { display: grid; place-items: center; cursor: default; background: linear-gradient(100deg, rgba(150, 175, 210, 0.14) 30%, rgba(150, 175, 210, 0.32) 50%, rgba(150, 175, 210, 0.14) 70%) 0 0 / 300% 100%; animation: ph-shim 1.4s linear infinite; }
.ph-coming span { font-size: 10.5px; color: var(--muted); padding: 6px; text-align: center; }
@keyframes ph-shim { to { background-position: -150% 0; } }
.ph-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--mnav-h, 0px)); z-index: 1200; display: flex; gap: 14px; align-items: center;
  max-width: calc(100vw - 24px); padding: 10px 14px; border-radius: 14px; background: #142235; color: #fff; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.ph-toast[hidden] { display: none; }
.ph-toast .linkish { color: #9fc3ff; font-weight: 700; }

/* ---------- Photo gallery (trips/gallery.js): always dark, over everything ---------- */
body.gal-open { overflow: hidden; }
.gal { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; background: rgba(8, 12, 20, 0.985); color: #E7EDF6; outline: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: var(--font); animation: gal-in 0.18s ease; }
@keyframes gal-in { from { opacity: 0; } }
.gal-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; font-size: 14px; }
.gal-title { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-n { color: #9fb0c8; font-size: 13px; font-variant-numeric: tabular-nums; }
.gal-sp { flex: 1; }
.gal-b { width: 38px; height: 38px; border-radius: 10px; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 16px; cursor: pointer; text-decoration: none; flex: none; }
.gal-b:hover, .gal-b:focus-visible, .gal-b.on { background: rgba(255, 255, 255, 0.2); }
.gal-b.fav { color: #FF4D5A; }
.gal-b[data-g="fav"] { font-size: 20px; }
.gal-show { width: auto; padding: 0 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.gal-zoomed .gal-arrow { opacity: 0.35; }
.gal:not(.gal-phone) .gal-img { cursor: zoom-in; }
.gal:not(.gal-phone) .gal-stage { overflow: hidden; border-radius: 6px; }
.gal-main { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 0 16px; }
.gal-stage { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.gal-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); user-select: none; -webkit-user-select: none; }
.gal-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 25px; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.gal-arrow:hover { background: rgba(255, 255, 255, 0.26); }
.gal-arrow:disabled { opacity: 0.25; cursor: default; }
.gal-arrow.prev { left: 8px; } .gal-arrow.next { right: 8px; }
.gal-info { flex: none; align-self: flex-start; width: 270px; margin-top: 4px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; line-height: 1.55; }
.gal-capt { display: block; font-size: 15px; margin-bottom: 4px; }
.gal-dim { color: #9fb0c8; }
.gal-map { height: 130px; border-radius: 8px; margin-top: 10px; overflow: hidden; background: #2a4a6b; }
.gal-map .leaflet-control-attribution { font-size: 9px; }
.gal-link { margin-top: 8px; padding: 0; border: 0; background: transparent; color: #9fc3ff; font: inherit; cursor: pointer; }
.gal-strip { display: flex; gap: 6px; justify-content: safe center; overflow-x: auto; padding: 12px 16px 16px; scrollbar-width: thin; }
.gal-th { flex: none; width: 72px; height: 52px; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: #223; opacity: 0.5; cursor: pointer; }
.gal-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-th:hover { opacity: 0.85; }
.gal-th.on { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
/* phones: the photo fills the screen */
.gal.gal-phone { background: #000; touch-action: none; }
.gal.gal-touch { touch-action: none; }
.gal.gal-touch .gal-strip { touch-action: pan-x; }
.gal-in-r { animation: gal-slide-r 0.2s ease-out; } .gal-in-l { animation: gal-slide-l 0.2s ease-out; }
@keyframes gal-slide-r { from { opacity: 0; translate: 40% 0; } }
@keyframes gal-slide-l { from { opacity: 0; translate: -40% 0; } }
.gal-phone .gal-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; background: linear-gradient(rgba(0, 0, 0, 0.6), transparent); }
.gal-phone .gal-n { flex: 1; text-align: center; color: #fff; }
.gal-phone .gal-b { border-radius: 19px; }
.gal-phone .gal-stage { position: absolute; inset: 0; }
.gal-phone .gal-img { max-height: 100dvh; border-radius: 0; box-shadow: none; }
.gal-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 30px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 35%); font-size: 13px; color: #b6c3d6; }
.gal-cap b { color: #fff; font-size: 15px; }
.gal-cap:empty { display: none; }
/* phones: wide Prev / Next under the top bar, centred, away from ✕ */
.gal-pn { position: absolute; z-index: 2; left: 0; right: 0; top: calc(70px + env(safe-area-inset-top, 0px)); display: flex; justify-content: center; gap: 14px; }
.gal-pn button { width: 128px; height: 46px; border: 0; border-radius: 23px; background: rgba(255, 255, 255, 0.18); color: #fff; font: 700 14px var(--font); cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gal-pn button:active { background: rgba(255, 255, 255, 0.3); }
.gal-pn button:disabled { opacity: 0.35; }
.ph-big img { width: 100%; max-height: 340px; object-fit: contain; border-radius: 12px; background: rgba(0, 0, 0, 0.05); display: block; }
.ph-cap { width: 100%; box-sizing: border-box; margin-top: 10px; }
.ph-kv { display: grid; grid-template-columns: 82px 1fr; gap: 5px 10px; font-size: 13px; margin: 10px 0 0; }
.ph-kv dt { color: var(--muted); } .ph-kv dd { margin: 0; }
.ph-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.ph-share { display: inline-flex; gap: 6px; align-items: center; }
.tp-pin.photo span { font-size: 15px; }
/* Photos on phones and tablets: one big button instead of the drop zone */
.ph-addbtn { display: block; width: 100%; min-height: 56px; font: inherit; font-size: 17px; font-weight: 700; border: 0; border-radius: 14px; background: var(--accent); color: #fff; cursor: pointer; }
.ph-note { text-align: center; margin: 8px 4px 4px; }
