/* travelcal.css — the /travel-calendar page (travel-calendar/index.html, js/travelcal/*). */
.tc-page { box-sizing: border-box; max-width: 1600px; margin: 0 auto; padding: 14px 18px 40px; }
.tc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tc-bar button { white-space: nowrap; }
.tc-arrows { display: inline-flex; gap: 2px; }
.tc-arrows button { font-size: 18px; padding: 4px 12px; }
.tc-title { margin: 0 8px 0 4px; font-size: 21px; flex: 1 1 auto; min-width: 140px; }
.tc-views { display: inline-flex; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; }
.tc-views button { background: transparent; color: var(--muted); border-radius: 0; padding: 7px 12px; font-weight: 400; }
.tc-views button[aria-pressed="true"] { background: var(--accent); color: var(--night); font-weight: 700; }
.tc-search { width: 150px; }
.tc-side-btn { display: none; }
.tc-more { display: inline-flex; gap: 2px; }
.tc-quick { display: flex; gap: 8px; margin: 10px 0 0; }
.tc-quick input { flex: 1; }
.tc-msg { margin: 8px 0 0; }
.tc-reminders { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(242, 193, 78, 0.14); border: 1px solid rgba(242, 193, 78, 0.55); }
.rem-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.rem-t { flex: 1; text-align: left; color: var(--text) !important; }
.tc-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; margin-top: 14px; align-items: start; }
.tc-side { position: sticky; top: calc(var(--topbar-h) + 14px); max-height: calc(100dvh - var(--topbar-h) - 28px); overflow-y: auto; font-size: 13.5px; }
.tc-box { margin: 14px 0; }
.tc-box h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.tc-layer { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.tc-layer span { flex: 1; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: -1px; }
.tc-next { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-left: 3px solid var(--c); border-radius: 0; padding: 4px 8px; margin: 4px 0; font-weight: 400; }
.tc-next small { color: var(--muted); }
kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--edge); border-radius: 4px; font-size: 11px; }
.tc-loading { padding: 30px; }
.tc-mini { position: relative; }
.tc-mini-nav { position: absolute; right: 0; top: -4px; display: flex; }
.tc-mini-nav button { padding: 2px 8px; }

/* Mini months (sidebar, Year) */
.mm-t { display: block; margin: 0 0 6px; font-size: 14px; }
.mm-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.mm-g > i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.mm-d { position: relative; padding: 4px 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 12px; font-weight: 400; cursor: pointer; }
.mm-d:hover { background: rgba(255, 255, 255, 0.08); }
.mm-d.trip { background: color-mix(in srgb, var(--c) 30%, transparent); }
.mm-d.hol { text-decoration: underline dotted; }
.mm-d.today { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
.mm-d.sel { background: var(--accent); color: var(--night); }
.mm-d i { position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--warn); }
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.year .mm { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--edge); }

/* Month */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--weeks), minmax(112px, 1fr)); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; }
.mh { padding: 6px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--edge); text-align: left; }
.mc { min-width: 0; padding: 3px 3px 5px; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); display: flex; flex-direction: column; gap: 2px; cursor: copy; }
.mc:nth-child(7n) { border-right: 0; }
.mc.other { background: rgba(0, 0, 0, 0.18); }
.mc.other .mc-n { color: var(--muted); }
.mc.wkend { background: rgba(255, 255, 255, 0.018); }
.mc.today { background: rgba(124, 199, 255, 0.08); }
.mc.today .mc-n { background: var(--accent); color: var(--night); font-weight: 700; }
.mc-n { align-self: flex-start; padding: 1px 7px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 12.5px; font-weight: 400; cursor: pointer; }
.mc-n:hover { background: rgba(255, 255, 255, 0.1); }
.drop-over { outline: 2px dashed var(--accent); outline-offset: -3px; }
.band { display: block; width: calc(100% + 6px); margin: 0 -3px; padding: 1px 6px; border: 0; border-radius: 0; background: color-mix(in srgb, var(--c) 34%, transparent); color: var(--text); font-size: 11.5px; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.band.first { margin-left: 2px; width: calc(100% + 1px); border-radius: 6px 0 0 6px; }
.band.last { width: calc(100% - 1px); border-radius: 0 6px 6px 0; }
.band.first.last { width: calc(100% - 4px); border-radius: 6px; }
.band.focus { background: color-mix(in srgb, var(--c) 60%, transparent); }
.ch { display: block; width: 100%; min-width: 0; padding: 1px 5px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 11.5px; font-weight: 400; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--c); }
.ch:hover { background: rgba(255, 255, 255, 0.08); }
.ch.allday { background: color-mix(in srgb, var(--c) 26%, transparent); border-left-width: 0; }
.ch.allday.mid, .ch.allday.last { border-radius: 0 5px 5px 0; }
.ch-t { color: var(--muted); }
.ch-late { color: var(--bad); font-weight: 700; }
.ch.done, .blk.done, .ag-it.done { opacity: 0.55; text-decoration: line-through; }
.ch.cancelled, .blk.cancelled, .ag-it.cancelled .ag-t { text-decoration: line-through; color: var(--bad); }
.ch.l-holidays { color: var(--muted); }
.ch[draggable="true"] { cursor: grab; }
.more { align-self: flex-start; padding: 0 5px; border: 0; background: transparent; color: var(--accent); font-size: 11.5px; font-weight: 700; cursor: pointer; }

/* Week / Day */
.week { border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; }
.wk-head, .wk-all { display: grid; grid-template-columns: 54px repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--edge); }
.wh { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border: 0; border-left: 1px solid var(--edge); border-radius: 0; background: transparent; color: var(--text); font-weight: 400; cursor: pointer; }
.wh small { color: var(--muted); }
.wh b { font-size: 20px; }
.wh.today b { color: var(--night); background: var(--accent); border-radius: 50%; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.wk-gut { padding: 4px; text-align: right; }
.wa { min-width: 0; padding: 3px; border-left: 1px solid var(--edge); display: flex; flex-direction: column; gap: 2px; min-height: 26px; cursor: copy; }
.wk-scroll { max-height: calc(100dvh - var(--topbar-h) - 250px); min-height: 360px; overflow-y: auto; }
.wk-grid { display: grid; grid-template-columns: 54px repeat(var(--days), minmax(0, 1fr)); position: relative; }
.hr { height: var(--hour); position: relative; }
.hr span { position: absolute; right: 6px; top: -8px; font-size: 11px; color: var(--muted); }
.wc { position: relative; border-left: 1px solid var(--edge); height: calc(var(--hour) * 24); cursor: copy; touch-action: pan-y;
  background-image: repeating-linear-gradient(to bottom, var(--edge) 0 1px, transparent 1px var(--hour)); }
.wc.today { background-color: rgba(124, 199, 255, 0.05); }
.blk { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 0; overflow: hidden; padding: 2px 6px; border: 0; border-left: 3px solid var(--c); border-radius: 6px; background: color-mix(in srgb, var(--c) 28%, #101C30); color: var(--text); font-size: 12px; font-weight: 400; text-align: left; cursor: pointer; z-index: 1; }
.blk b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.blk small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.blk[data-move] { cursor: grab; touch-action: none; }
.blk.dragging { opacity: 0.85; z-index: 5; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); cursor: grabbing; }
.ghost-blk { position: absolute; left: 2px; right: 2px; border-radius: 6px; background: rgba(124, 199, 255, 0.35); border: 1px dashed var(--accent); font-size: 11.5px; padding: 2px 6px; pointer-events: none; z-index: 4; }
.now { position: absolute; left: 0; right: 0; height: 2px; background: #f87171; z-index: 3; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #f87171; }

/* Agenda */
.agenda { display: flex; flex-direction: column; }
.ag-day { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--edge); }
.ag-day.past { opacity: 0.6; }
.ag-date { display: flex; flex-direction: column; align-items: flex-start; border: 0; background: transparent; color: var(--text); font-weight: 400; padding: 0; cursor: pointer; }
.ag-date b { font-size: 24px; line-height: 1; }
.ag-date span { color: var(--muted); font-size: 12px; }
.ag-day.today .ag-date b { color: var(--accent); }
.ag-items { display: flex; flex-direction: column; gap: 4px; }
.ag-it { display: grid; grid-template-columns: 130px 12px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-weight: 400; text-align: left; cursor: pointer; }
.ag-it:hover { background: rgba(255, 255, 255, 0.05); }
.ag-time { color: var(--muted); font-size: 12.5px; }
.ag-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.empty { padding: 40px 10px; text-align: center; }

/* Details popover */
.tc-pop { position: fixed; z-index: 60; width: min(360px, calc(100vw - 16px)); padding: 14px 16px; border-radius: 14px; background: #101C30; border: 1px solid var(--edge); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); font-size: 13.5px; }
.tc-pop.sheet { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; }
.tc-pop p { margin: 6px 0; overflow-wrap: anywhere; }
.pop-head { display: flex; align-items: flex-start; gap: 10px; }
.pop-head h3 { flex: 1; margin: 0; font-size: 16px; }
.pop-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 4px; background: var(--c); }
.pop-when { color: var(--muted); }
.pop-notes { white-space: pre-wrap; padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.pop-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 10px; }

/* Event dialog */
.ev-dlg { width: min(560px, calc(100vw - 20px)); }
.ev-dlg .share-body { max-height: calc(100dvh - 40px); overflow-y: auto; }
.ev-kind { display: flex; gap: 6px; margin: 4px 0 10px; }
.ev-title { width: 100%; box-sizing: border-box; font-size: 17px; padding: 10px 12px; }
.ev-when { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.ev-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ev-row label, .ev-tz { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); flex: 1 1 140px; }
.ev-row input, .ev-row select, .ev-tz input { color: var(--text); }
.ev-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ev-custom { padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.ev-custom[hidden] { display: none; }
.ev-days { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ev-day input { position: absolute; opacity: 0; }
.ev-day span { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--edge); font-size: 12px; cursor: pointer; }
.ev-day input:checked + span { background: var(--accent); color: var(--night); font-weight: 700; }
.ev-day input:focus-visible + span { outline: 2px solid var(--accent); }
.ev-rem { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
.ev-rem .chip { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); }
.ev-rem p { flex-basis: 100%; margin: 2px 0 0; }
.ev-lab { font-size: 12.5px; color: var(--muted); margin-right: 4px; }
.ev-rem-add { width: auto; }
.ev-more { margin: 10px 0; }
.ev-more summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-bottom: 6px; }
.ev-more .sf-f { margin: 6px 0; }
.ev-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ev-cat input { position: absolute; opacity: 0; }
.ev-cat span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--edge); font-size: 12.5px; cursor: pointer; }
.ev-cat span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.ev-cat input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); font-weight: 700; }
.ev-cat input:focus-visible + span { outline: 2px solid var(--accent); }
.ev-msg { min-height: 1.2em; color: var(--warn); font-size: 13px; margin: 4px 0; }
.ev-acts, .feed-dlg .share-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ev-acts .sp, .feed-dlg .sp { flex: 1; }

/* Subscribe dialog */
.feed-dlg { width: min(600px, calc(100vw - 20px)); }
.feed-link { display: flex; gap: 8px; margin: 10px 0; }
.feed-link input { flex: 1; font-size: 12px; }
.feed-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.feed-opts { border: 1px solid var(--edge); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.feed-opts legend { color: var(--muted); font-size: 12.5px; padding: 0 4px; }
.feed-how summary { cursor: pointer; color: var(--accent); }
.feed-how p { font-size: 13px; }

/* Phones and small tablets */
@media (max-width: 1000px) {
  .tc-grid { grid-template-columns: minmax(0, 1fr); }
  .tc-side { display: none; position: static; max-height: none; padding: 4px 12px; border: 1px solid var(--edge); border-radius: 12px; }
  .tc-app.side-open .tc-side { display: block; }
  .tc-side-btn { display: inline-flex; }
}
@media (max-width: 760px) {
  .tc-page { padding: 10px 10px 30px; }
  .tc-title { order: -1; flex-basis: 100%; font-size: 18px; margin: 0 0 2px; }
  .tc-views { order: 5; flex-basis: 100%; }
  .tc-views button { flex: 1; padding: 7px 4px; }
  .tc-search { flex: 1; width: auto; min-width: 90px; }
  .tc-more, #tc-subscribe { display: none; }
  .tc-quick input { font-size: 14px; }
  .month { grid-template-rows: auto repeat(var(--weeks), minmax(64px, auto)); }
  .mh { padding: 4px 3px; font-size: 11px; }
  .ch { font-size: 10.5px; padding: 0 3px; }
  .ch-t { display: none; }
  .band { font-size: 10px; }
  .ag-it { grid-template-columns: 84px 10px minmax(0, 1fr); }
  .ag-day { grid-template-columns: 58px minmax(0, 1fr); }
  .tc-app.side-open #tc-subscribe { display: inline-flex; }
}

/* Print: just the calendar */
@media print {
  @page { margin: 12mm; }
  body.tc-body { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .topbar, .tc-side, .tc-quick, .tc-reminders, .tc-msg, .tc-pop, .tc-bar button, .tc-views, .tc-search, .tc-more, #updates-banner { display: none !important; }
  .tc-grid { display: block; margin: 0; }
  .tc-title { color: #000; font-size: 20pt; }
  .month, .week, .mc, .mh, .wa, .wc, .wk-head, .wk-all, .ag-day { border-color: #bbb !important; }
  .mc, .mc.other, .mc.wkend, .mc.today { background: #fff !important; }
  .mc-n, .wh, .ch, .blk, .ag-it, .ag-date, .band, .ch-t, .ag-time { color: #000 !important; }
  .ch, .band, .blk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wk-scroll { max-height: none !important; overflow: visible !important; }
  .month { break-inside: avoid; }
}
.blk.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.blk.short b, .blk.short small { line-height: 1.2; }
#ev-tzs { display: none; }
.tc-app.pk-locked .tc-side, .tc-app.pk-locked .tc-bar > :not(.tc-title), .tc-app.pk-locked .tc-quick { display: none; }
.tc-app.pk-locked .tc-grid { display: block; }
