/* Travel Notes app (/work/tools/travel): a list of places, plans and notes on the left, the pixel world on the right.
   The top bar and the gate are the Songbook's (body.sb-page in style.css); everything inside the app is here.
   The map itself is drawn on a canvas by travel.js; its labels use Silkscreen (and DotGothic16 for Chinese). */
.tv-page {
  --tv-paper: #efe9dc; --tv-ink: #263238; --tv-soft: rgba(38, 50, 56, .66); --tv-faint: rgba(38, 50, 56, .45); --tv-line: rgba(38, 50, 56, .12);
  --tv-side: #f7f4ee; --tv-green: #2e4b48; --tv-pixel: "Silkscreen", "Karla", monospace;
}
.travel-app { position: relative; flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0; color: var(--tv-ink); font: 15px/1.5 var(--sans); }
.travel-app button, .travel-app select, .travel-app input, .travel-app textarea { font: inherit; color: inherit; }
.travel-app [hidden] { display: none !important; }
.travel-app :focus-visible { outline: 2px solid var(--tv-green); outline-offset: 1px; }

/* ---- Side ---- */
.tv-side { display: flex; flex-direction: column; min-height: 0; background: var(--tv-side); border-right: 1px solid var(--tv-line); }
.tv-side-head { display: flex; gap: 6px; padding: 12px 10px 6px; }
.tv-find { flex: 1; }
.tv-search { width: 100%; height: 34px; padding: 0 10px; font-size: 14px; background: #fff; border: 1px solid var(--tv-line); border-radius: 6px; }
.tv-search:focus { outline: none; border-color: var(--tv-green); }
.tv-side-close { display: none; width: 34px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.tv-tabs { display: flex; gap: 2px; padding: 4px 10px 8px; border-bottom: 1px solid var(--tv-line); }
.tv-tabs button { flex: 1; padding: 6px 0; border: 0; border-radius: 6px; background: none; font: 400 12px/1 var(--tv-pixel); letter-spacing: .5px; text-transform: uppercase; color: var(--tv-soft); cursor: pointer; }
.tv-tabs button[aria-selected="true"] { background: var(--tv-green); color: #fff; }
.tv-list { flex: 1; overflow-y: auto; padding: 6px 6px 16px; }
.tv-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 4px 6px; }
.tv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 13px; border: 1px solid var(--tv-line); border-radius: 99px; background: #fff; cursor: pointer; }
.tv-chip i { width: 8px; height: 8px; }
.tv-chip small { color: var(--tv-faint); }
.tv-chip[aria-pressed="true"] { border-color: var(--tv-ink); background: var(--tv-ink); color: #fff; }
.tv-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .7); }
.tv-gnote { align-items: flex-start; padding-top: 6px; padding-bottom: 6px; }
.tv-gnote .tv-dot { margin-top: 5px; }
.tv-gnote span { flex: 1; min-width: 0; }
.tv-gnote b { display: block; }
.tv-gnote em { display: block; font-style: normal; font-size: 13px; color: var(--tv-faint); white-space: pre-wrap; overflow-wrap: anywhere; }
.tv-group { display: flex; align-items: center; gap: 8px; margin: 10px 8px 4px; padding: 6px 8px 6px 10px; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--tv-line); font-size: 13px; }
.tv-group span { flex: 1; min-width: 0; }
.tv-ungroup { flex: none; border: 0; background: none; font: inherit; font-size: 12px; color: var(--tv-faint); cursor: pointer; text-decoration: underline; }
.tv-lab { margin: 14px 8px 4px; font: 400 11px/1.4 var(--tv-pixel); letter-spacing: .5px; text-transform: uppercase; color: var(--tv-faint); }
.tv-sub { margin: 8px 10px 2px; font-size: 12px; color: var(--tv-faint); }
.tv-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: 14px; color: var(--tv-ink); text-decoration: none; cursor: pointer; }
.tv-item:hover { background: rgba(38, 50, 56, .06); }
.tv-item.on { background: #fff; box-shadow: 0 0 0 1px var(--tv-line); }
.tv-item b { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-item small { flex: none; max-width: 40%; font-size: 12px; color: var(--tv-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-dot, .tv-chip i, .tv-seg i, .tv-legend i { flex: none; display: inline-block; width: 10px; height: 10px; box-shadow: inset 0 0 0 1.5px rgba(38, 50, 56, .7); image-rendering: pixelated; }
.tv-hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tv-faint); }
.tv-plan-dot { background: var(--tv-green); }
.tv-note-dot { background: #c9b48a; }
.tv-empty { margin: 16px 10px; font-size: 14px; color: var(--tv-faint); }
.tv-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--tv-line); font-size: 12px; color: var(--tv-faint); }
.tv-status { flex: 1; }
.tv-acts { display: flex; gap: 6px; }
.tv-dl, .tv-in, .tv-out { padding: 4px 8px; font-size: 12px; border: 1px solid var(--tv-line); border-radius: 6px; background: #fff; cursor: pointer; }
.tv-login { display: flex; gap: 6px; }
.tv-login .tv-input { width: 130px; height: 28px; font-size: 13px; }
.tv-login .tv-btn { height: 28px; font-size: 13px; }

/* plans */
.tv-new { display: flex; gap: 6px; padding: 6px 4px 10px; }
.tv-input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; font-size: 14px; background: #fff; border: 1px solid var(--tv-line); border-radius: 6px; }
.tv-input:focus, .tv-note:focus, .tv-dnote:focus, .tv-dlabel:focus { outline: none; border-color: var(--tv-green); }
.travel-app .tv-btn { flex: none; height: 34px; padding: 0 12px; font-size: 14px; color: #fff; background: var(--tv-green); border: 0; border-radius: 6px; cursor: pointer; }
.tv-plan { padding: 4px; }
.tv-backlink { display: inline-block; margin: 2px 4px 8px; font-size: 13px; color: var(--tv-soft); }
.tv-ptitle { width: 100%; height: 40px; font-weight: 700; font-size: 16px; }
.tv-day { margin-top: 12px; padding: 8px; background: #fff; border: 1px solid var(--tv-line); border-radius: 8px; }
.tv-dlabel { width: 100%; padding: 2px 4px; border: 1px solid transparent; border-radius: 4px; background: none; font: 400 12px/1.6 var(--tv-pixel); text-transform: uppercase; letter-spacing: .5px; }
.tv-stops { margin: 6px 0; padding-left: 26px; font-size: 14px; }
.tv-stops li { padding: 2px 0; }
.tv-stops li a { display: inline-flex; align-items: center; gap: 6px; color: var(--tv-ink); }
.tv-mv { float: right; display: inline-flex; gap: 2px; opacity: .45; }
.tv-stops li:hover .tv-mv, .tv-mv:focus-within { opacity: 1; }
.tv-mv button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.tv-mv button:hover { background: rgba(38, 50, 56, .08); }
.tv-dnote { width: 100%; padding: 6px 8px; font-size: 13px; border: 1px solid var(--tv-line); border-radius: 6px; resize: vertical; }
.tv-day .tv-empty { margin: 6px 4px; font-size: 13px; }
.tv-addday { width: 100%; margin-top: 12px; background: #fff; color: var(--tv-green); border: 1px dashed var(--tv-green); }
.tv-del { margin-top: 16px; padding: 4px 0; border: 0; background: none; font-size: 13px; color: #b42318; cursor: pointer; }
.tv-del.sure { font-weight: 700; }

/* ---- The map ---- */
.tv-main { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--tv-paper); }
.tv-map { position: absolute; inset: 0; }
.tv-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; image-rendering: pixelated; }
.tv-regions { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.tv-reg { pointer-events: auto; padding: 5px 10px 4px; font: 400 12px/1.3 var(--tv-pixel); color: var(--tv-ink); background: rgba(255, 255, 255, .88); border: 2px solid var(--tv-ink); box-shadow: 2px 2px 0 var(--tv-ink); text-decoration: none; }
.tv-reg small { font-size: 10px; color: var(--tv-faint); }
.tv-reg[aria-selected="true"] { background: var(--tv-ink); color: #fff; }
.tv-reg[aria-selected="true"] small { color: rgba(255, 255, 255, .7); }
.tv-reg:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--tv-ink); }
.tv-side-open { display: none; }
.tv-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.tv-zoom button { width: 34px; height: 34px; padding: 0; font: 400 18px/1 var(--tv-pixel); background: #fff; border: 2px solid var(--tv-ink); box-shadow: 2px 2px 0 var(--tv-ink); cursor: pointer; }
.tv-zoom button:active { transform: translate(2px, 2px); box-shadow: none; }
.tv-legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: calc(100% - 80px); padding: 6px 10px; font-size: 12px; background: rgba(255, 255, 255, .85); border: 2px solid var(--tv-ink); }
.tv-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tv-legend small { color: var(--tv-faint); }
.tv-banner { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); padding: 8px 12px; font-size: 14px; color: #fff; background: var(--tv-ink); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.tv-banner button { margin-left: 8px; padding: 2px 8px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px; background: none; color: #fff; cursor: pointer; }
.tv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 14px var(--tv-pixel); color: var(--tv-soft); background: var(--tv-paper); }

/* ---- The card ---- */
.tv-card { position: absolute; top: 56px; right: 12px; width: 340px; max-width: calc(100% - 24px); max-height: calc(100% - 120px); overflow-y: auto; padding: 18px 18px 16px;
  background: #fff; border: 2px solid var(--tv-ink); box-shadow: 4px 4px 0 var(--tv-ink); }
.tv-reader { width: 460px; }
.tv-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0; border: 0; background: none; font-size: 20px; cursor: pointer; }
.tv-title { margin: 0 24px 4px 0; font: 700 19px/1.3 var(--sans); }
.tv-meta { font-size: 13px; color: var(--tv-soft); }
.tv-approx { display: inline-block; padding: 0 6px; font-size: 11px; color: #8a5a00; background: #fdf1d0; border-radius: 4px; }
.tv-seg { display: flex; margin-top: 12px; border: 2px solid var(--tv-ink); }
.tv-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; font-size: 13px; border: 0; background: #fff; cursor: pointer; }
.tv-seg button + button { border-left: 2px solid var(--tv-ink); }
.tv-seg button[aria-pressed="true"] { background: var(--tv-ink); color: #fff; }
.tv-stars { margin-top: 8px; }
.tv-stars button { padding: 0 2px; border: 0; background: none; font-size: 18px; color: #d6d0c4; cursor: pointer; }
.tv-stars button[aria-pressed="true"] { color: #f2b12e; }
.tv-k { margin: 14px 0 4px; font: 400 11px/1.4 var(--tv-pixel); letter-spacing: .5px; text-transform: uppercase; color: var(--tv-faint); }
.tv-photos { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 10px; padding-bottom: 4px; }
.tv-photos a { flex: none; }
.tv-photos img { display: block; height: 96px; width: auto; border-radius: 4px; }
.tv-gn { margin: 0; padding: 6px 10px; font-size: 14px; white-space: pre-wrap; border-left: 3px solid #c9b48a; background: #faf7f0; }
.tv-note { width: 100%; padding: 8px 10px; font-size: 14px; line-height: 1.5; border: 1px solid var(--tv-line); border-radius: 6px; resize: vertical; }
.tv-pill { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; font-size: 13px; color: var(--tv-ink); background: #f1ede4; border-radius: 99px; }
.tv-row { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.tv-pick { flex: 1; min-width: 0; height: 34px; padding: 0 6px; font-size: 14px; border: 1px solid var(--tv-line); border-radius: 6px; background: #fff; }
.tv-link { font-size: 14px; color: var(--tv-green); text-decoration: underline; text-underline-offset: 3px; }
.tv-row .tv-del { margin: 0 0 0 auto; }
.tv-dropform { display: flex; gap: 6px; margin-top: 12px; }
.tv-md { margin-top: 10px; font-size: 15px; line-height: 1.7; }
.tv-md p, .tv-md ul, .tv-md ol, .tv-md blockquote { margin: 0 0 10px; }
.tv-md h3, .tv-md h4, .tv-md h5 { margin: 16px 0 6px; font-weight: 700; }
.tv-md blockquote { padding-left: 10px; border-left: 3px solid #c9b48a; color: var(--tv-soft); }
.tv-md a { color: var(--tv-green); text-decoration: underline; }

/* ---- Narrow: the side becomes a drawer, the card a sheet ---- */
@media (max-width: 899px) {
  .travel-app { grid-template-columns: minmax(0, 1fr); }
  .tv-side { position: absolute; top: 0; bottom: 0; left: 0; z-index: 5; width: min(320px, 86vw); transform: translateX(-102%); transition: transform .25s ease; }
  .travel-app.side-open .tv-side { transform: none; box-shadow: 8px 0 32px rgba(0, 0, 0, .18); }
  .tv-side-close { display: block; }
  .tv-scrim { position: absolute; inset: 0; z-index: 4; background: rgba(0, 0, 0, .25); }
  .tv-side-open { display: block; position: absolute; top: 12px; left: 12px; padding: 6px 10px; font: 400 12px/1.3 var(--tv-pixel); background: #fff; border: 2px solid var(--tv-ink); box-shadow: 2px 2px 0 var(--tv-ink); }
  .tv-regions { top: 52px; flex-wrap: nowrap; overflow-x: auto; pointer-events: auto; scrollbar-width: none; }
  .tv-reg { flex: none; }
  .tv-legend small { display: none; }
  .tv-card, .tv-reader { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-width: none; max-height: 62%; border-width: 2px 0 0; box-shadow: 0 -4px 0 var(--tv-ink); }
  .tv-banner { top: 96px; width: calc(100% - 32px); }
}

/* read-only: what's set shows, nothing can be changed */
.tv-ro .tv-seg button { cursor: default; }
.tv-ro .tv-seg button:not([aria-pressed="true"]) { color: var(--tv-faint); }
.tv-ro .tv-stars button { cursor: default; }
.tv-mynote { margin: 0; font-size: 14px; white-space: pre-wrap; }
p.tv-dlabel { margin: 0; }
p.tv-dnote { margin: 4px 0 0; border: 0; padding: 0; white-space: pre-wrap; }

/* Planner (signed in only): trips, their days with what each holds, and their moves */
.tv-trip-dot { background: #3f8a63; }
.tv-tripitem.now b::after { content: " ●"; color: #3f8a63; font-size: 10px; }
.tv-trip { padding: 4px; }
.tv-ttitle { width: 100%; }
.tv-tdates { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 4px 0; }
.tv-tdates label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tv-faint); }
.tv-tdates input { height: 28px; padding: 0 6px; font: inherit; font-size: 13px; color: var(--tv-ink); background: #fff; border: 1px solid var(--tv-line); border-radius: 6px; }
.tv-tday { margin-top: 12px; padding: 8px; background: #fff; border: 1px solid var(--tv-line); border-radius: 8px; }
.tv-tday.on { border-color: #3f8a63; box-shadow: 0 0 0 1px #3f8a63; }
.tv-tdhead { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 4px; color: var(--tv-ink); text-decoration: none; }
.tv-tdhead b { font: 400 12px/1.6 var(--tv-pixel); text-transform: uppercase; letter-spacing: .5px; }
.tv-tdhead small { font-size: 12px; color: var(--tv-faint); }
.tv-tplace { margin-left: auto; max-width: 50%; font-size: 12px; color: #3f8a63; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-dtitle { font: 500 14px/1.5 var(--sans); text-transform: none; letter-spacing: 0; }
.tv-titems { margin: 6px 0 4px; padding: 0; list-style: none; }
.tv-titems li { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; border-top: 1px dashed var(--tv-line); }
.tv-titems li:first-child { border-top: 0; }
.tv-titems input { min-width: 0; padding: 2px 4px; font: inherit; font-size: 13px; color: var(--tv-ink); background: none; border: 1px solid transparent; border-radius: 4px; }
.tv-titems input:hover { border-color: var(--tv-line); }
.tv-titems input:focus { outline: none; border-color: #3f8a63; background: #fff; }
.tv-it-t { flex: none; width: 82px; font-variant-numeric: tabular-nums; color: var(--tv-soft) !important; }
.tv-it-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tv-it-n { font-size: 12px !important; color: var(--tv-faint) !important; }
.tv-it-p { padding: 0 4px; font-size: 11px; color: #3f8a63; }
.tv-titems li.struck .tv-it-a { text-decoration: line-through; color: var(--tv-faint); }
.tv-titems .tv-mv { float: none; flex: none; }
.tv-titems li:hover .tv-mv { opacity: 1; }
.tv-trow { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.tv-mini { padding: 3px 8px; font-size: 12px; color: var(--tv-soft); background: none; border: 1px solid var(--tv-line); border-radius: 6px; cursor: pointer; }
.tv-mini:hover { color: var(--tv-ink); border-color: var(--tv-soft); }
.tv-legs { margin: 6px 0 2px; padding: 0; list-style: none; font-size: 13px; }
.tv-legs li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.tv-legs small { color: var(--tv-faint); }
.tv-legmark { flex: none; width: 16px; height: 0; border-top: 2px solid #1f7a3f; }
.tv-legmark.air { border-top: 2px dashed #1b4f8a; }
.tv-legx { margin-left: auto; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--tv-faint); cursor: pointer; }
.tv-addleg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; font-size: 12px; }
.tv-addleg select, .tv-addleg input { max-width: 110px; height: 26px; padding: 0 4px; font: inherit; font-size: 12px; background: #fff; border: 1px solid var(--tv-line); border-radius: 5px; }
.tv-addleg input { width: 64px; }
.tv-tday .tv-delday { display: block; margin: 6px 0 0 auto; }
.tv-addtday { width: 100%; margin-top: 12px; }
/* the planner's side is wider; a note shows when it has words, or while its item is being worked on */
@media (min-width: 900px) { .travel-app.tv-planning { grid-template-columns: 380px minmax(0, 1fr); } }
.tv-it-n:placeholder-shown { display: none; }
.tv-titems li:hover .tv-it-n, .tv-titems li:focus-within .tv-it-n { display: block; }
.tv-showleg { margin-top: 4px; }
.tv-legend .tv-legmark { display: inline-block; width: 18px; height: 0; margin-right: 4px; vertical-align: middle; background: none; box-shadow: none; }
