/* Travel tracker (Travel tab) — multi-year calendar. Uses the dashboard tokens so light/dark follow the theme. */
#planner-root { --pl-sel: var(--pink-500); }
.pl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.pl-years, .pl-seg2 { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-pill { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-700); cursor: pointer; font-variant-numeric: tabular-nums; }
.pl-pill:hover { border-color: var(--pink-300); }
.pl-pill.on { background: var(--fill); border-color: var(--fill); color: var(--surface); }
.pl-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-900); cursor: pointer; }
.pl-btn:hover { border-color: var(--pink-300); color: var(--pink-600); }
.pl-btn.primary { background: var(--pink-600); border-color: var(--pink-600); color: #fff; }
.pl-btn.primary:hover { background: var(--pink-700); color: #fff; }
.pl-btn.danger-o { color: var(--red); }
.pl-btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.pl-monthnav { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pl-monthnav b { min-width: 150px; text-align: center; }
.pl-sum { margin-left: auto; font-size: 13px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.pl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.pl-main { min-width: 0; }
.pl-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.pl-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.pl-card h3 { margin: 0; font-size: 14px; }
.pl-hint { margin: 0 0 8px; font-size: 13px; color: var(--ink-500); line-height: 1.45; }
.pl-link { font: inherit; font-size: 13px; font-weight: 600; background: none; border: 0; padding: 0; color: var(--pink-600); cursor: pointer; text-align: left; }
.pl-link:hover { text-decoration: underline; }
.pl-x { font: inherit; font-size: 20px; line-height: 1; background: none; border: 0; color: var(--ink-500); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.pl-x:hover { color: var(--red); background: var(--soft); }

/* year view */
.pl-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.pl-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 12px; min-width: 0; }
.pl-mtitle { font: inherit; font-size: 14px; font-weight: 700; background: none; border: 0; padding: 0 0 6px; color: var(--ink-900); cursor: pointer; }
.pl-mtitle:hover { color: var(--pink-600); }
.pl-dow, .pl-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.pl-dow span { font-size: 10px; text-align: center; color: var(--ink-500); padding-bottom: 2px; }
.pl-day { position: relative; aspect-ratio: 1; font: inherit; font-size: 11px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-900); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; font-variant-numeric: tabular-nums; }
.pl-day.we { background: var(--soft); }
.pl-day:hover { box-shadow: inset 0 0 0 1.5px var(--ink-300); }
.pl-day.has-trip { font-weight: 700; }
.pl-day.tent::after, .pl-chip.tent::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255,255,255,.38) 4px 7px); pointer-events: none; }
.pl-day.today { box-shadow: inset 0 0 0 2px var(--brand-signal); }
.pl-day.sel, .pl-bday.sel { box-shadow: inset 0 0 0 2px var(--pl-sel); }
.pl-day.sel:not(.has-trip) { background: var(--pink-100); }
.pl-n { position: relative; z-index: 1; }
.pl-dots { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.pl-dots i { width: 4px; height: 4px; border-radius: 50%; box-shadow: 0 0 0 1px var(--surface); }

/* month view */
.pl-bigmonth { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.pl-bigdow, .pl-biggrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.pl-bigdow span { font-size: 11px; font-weight: 600; color: var(--ink-500); text-align: center; padding-bottom: 4px; }
.pl-bday { min-height: 104px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; user-select: none; -webkit-user-select: none; min-width: 0; }
.pl-bday.we { background: var(--soft); }
.pl-bday.today { border-color: var(--brand-signal); box-shadow: inset 0 0 0 1px var(--brand-signal); }
.pl-bday:hover { border-color: var(--ink-300); }
.pl-bn { font-size: 12px; font-weight: 600; color: var(--ink-700); font-variant-numeric: tabular-nums; }
.pl-chip { position: relative; font: inherit; font-size: 11px; text-align: left; border: 0; border-radius: 4px; padding: 2px 5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; min-width: 0; }
.pl-chip.trip { font-weight: 600; margin: 0 -4px; border-radius: 0; }
.pl-chip.ev { background: var(--soft); color: var(--ink-900); border-left: 3px solid var(--c); }
.pl-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-more { font-size: 11px; color: var(--ink-500); }

/* side panel */
.pl-form { display: flex; flex-direction: column; gap: 10px; }
.pl-form-head { display: flex; align-items: center; justify-content: space-between; }
.pl-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-700); }
.pl-f input, .pl-f textarea, .pl-filters input, .pl-filters select, .pl-lrow input[type="text"] { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink-900); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0; }
.pl-f input:focus, .pl-f textarea:focus, .pl-filters input:focus, .pl-filters select:focus { outline: 2px solid var(--pink-300); outline-offset: 0; }
.pl-f textarea { resize: vertical; }
.pl-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-kind { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.pl-kind small { color: var(--ink-500); margin-left: 4px; }
.pl-check { font-size: 13px; display: flex; gap: 8px; align-items: center; }
.pl-form[data-kind="trip"] .pl-time { display: none; }
.pl-sws { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-sw, .pl-brush { font: inherit; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-900); cursor: pointer; }
.pl-sw i, .pl-brush i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.pl-sw.on, .pl-brush.on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.pl-brush small { color: var(--ink-500); font-weight: 500; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-same { font-size: 12px; color: var(--ink-500); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.pl-legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pl-legend .pl-lrow { display: flex; gap: 6px; align-items: center; width: 100%; }
.pl-lrow input[type="color"] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; flex: none; }
.pl-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.pl-aglist { max-height: 420px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pl-ag-m { margin: 8px 0 2px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.pl-ag { font: inherit; text-align: left; background: none; border: 0; border-radius: 8px; padding: 5px 6px; display: flex; gap: 8px; align-items: flex-start; cursor: pointer; color: var(--ink-900); }
.pl-ag:hover { background: var(--soft); }
.pl-ag i { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; flex: none; }
.pl-ag.tent i { opacity: .55; }
.pl-ag span { display: flex; flex-direction: column; min-width: 0; }
.pl-ag b { font-size: 13px; overflow-wrap: anywhere; }
.pl-ag em { font-style: normal; font-size: 11px; color: var(--ink-500); }

@media (min-width: 1001px) { .pl-form-card { position: sticky; top: 76px; z-index: 5; } }
@media (max-width: 1000px) {
  .pl-layout { grid-template-columns: 1fr; }
  .pl-form-card.open { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 88vh; overflow: auto; border-radius: 16px 16px 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px rgba(0,0,0,.28); }
}
@media (max-width: 640px) {
  .pl-year { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .pl-bday { min-height: 72px; padding: 3px 2px; }
  .pl-chip { font-size: 10px; padding: 1px 3px; }
  .pl-chip b { display: none; }
  .pl-sum { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { #planner-root * { scroll-behavior: auto !important; } }

.pl-totals { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-totals li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pl-totals i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pl-totals span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pl-totals b { font-variant-numeric: tabular-nums; }
.pl-totals em { font-style: normal; font-size: 11px; color: var(--ink-500); min-width: 52px; text-align: right; }
.pl-confirm { margin-top: 8px; }

/* tracker view: one row per month, 31 day columns, stays as named bars */
.pl-trk-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.pl-trk { min-width: 760px; display: flex; flex-direction: column; gap: 3px; }
.pl-trow { display: grid; grid-template-columns: 40px repeat(31, minmax(0, 1fr)); grid-auto-rows: 24px; row-gap: 2px; }
.pl-thead { grid-auto-rows: 16px; }
.pl-thead span { font-size: 9.5px; line-height: 16px; text-align: center; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.pl-tm { grid-column: 1; grid-row: 1 / -1; font: inherit; font-size: 12px; font-weight: 600; text-transform: capitalize; text-align: left; background: none; border: 0; padding: 0; color: var(--ink-500); cursor: pointer; align-self: start; line-height: 24px; }
.pl-tm:hover { color: var(--pink-600); }
.pl-tc { grid-row: 1 / -1; border-left: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none; }
.pl-tc.we { background: var(--soft); }
.pl-tc.off { background: var(--line); opacity: .45; cursor: default; }
.pl-tc.today { box-shadow: inset 0 0 0 2px var(--brand-signal); position: relative; z-index: 3; }
.pl-tc.sel { background: var(--pink-100); box-shadow: inset 0 0 0 1px var(--pl-sel); }
.pl-bar { position: relative; z-index: 2; align-self: center; height: 20px; margin: 0 1px; min-width: 0; overflow: hidden; font: inherit; font-size: 11px; font-weight: 600; line-height: 20px; text-align: left; white-space: nowrap; padding: 0 6px; border: 0; border-radius: 5px; background: var(--c); color: #fff; cursor: pointer; }
.pl-bar span { display: block; overflow: hidden; text-overflow: ellipsis; }
.pl-bar.st-inferred { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255,255,255,.34) 4px 7px); opacity: .85; }
.pl-bar.st-potential { background: transparent; color: var(--ink-900); border: 2px dashed var(--c); line-height: 16px; }
.pl-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.pl-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.pl-bar:hover, .pl-bar:focus-visible { box-shadow: 0 0 0 2px var(--ink-900); outline: none; }
.pl-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 2px 0; font-size: 12px; color: var(--ink-500); }
.pl-keys span { display: inline-flex; align-items: center; gap: 6px; }
.pl-key { width: 26px; height: 12px; border-radius: 4px; background: #0f7f86; display: inline-block; }
.pl-key.st-inferred { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255,255,255,.34) 4px 7px); opacity: .85; }
.pl-key.st-potential { background: transparent; border: 2px dashed #0f7f86; }
.pl-day.inf::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255,255,255,.3) 4px 7px); pointer-events: none; }
.pl-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.pl-form[data-kind="event"] .pl-tripf { display: none; }

/* day goals and unassigned days */
.pl-goals { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pl-goal-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pl-goal-top span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pl-goal-top b { font-variant-numeric: tabular-nums; }
.pl-goal em { display: block; font-style: normal; font-size: 11px; color: var(--ink-500); margin-top: 3px; }
.pl-meter { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; margin-top: 4px; }
.pl-meter i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.pl-goal.bad .pl-meter i { background: var(--red); }
.pl-goal.bad em { color: var(--red); }
.pl-goal-form { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px auto; gap: 6px; margin-bottom: 8px; }
.pl-goal-form input, .pl-goal-form select { font: inherit; font-size: 14px; color: var(--ink-900); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0; width: 100%; }
.pl-goal-form input:focus, .pl-goal-form select:focus { outline: 2px solid var(--pink-300); outline-offset: 0; }
.pl-err { color: var(--red); }
.pl-gap-dot { border: 1.5px dashed var(--ink-300); background: transparent; }
@media (max-width: 420px) { .pl-goal-form { grid-template-columns: 1fr 1fr; } }
