/* ปฏิทินทริป /malitools/trips/calendar (2026-11-08, Phase 5). On minimal.css's
   tokens (frosted cards, --pill for what's picked); loaded before
   soft/space/minimal like the other inner pages. 360px first. */
.tc-page { max-width: 720px; padding-bottom: 40px; }
.tc-page [hidden], .tc-sheet[hidden], .tc-sheet [hidden] { display: none !important; }

/* signed out / loading / failed */
#tcState .fd-mali { text-align: center; }
#tcState .fd-mali img { width: 150px; height: 150px; object-fit: contain; }
#tcState p { margin: 8px 0 14px; font-weight: 700; font-size: 16px; line-height: 1.55; }

/* the calendar card */
.tc-cal { padding: 10px 12px 14px; }
@media (max-width: 380px) { .tc-cal { padding: 10px 6px 14px; } } /* 7 days stay 44px wide at 360 */
.tc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tc-bar h2 { flex: 1; margin: 0; text-align: center; font-size: 17px; font-weight: 800; line-height: 1.5; }
.tc-nav { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 14px; background: transparent; color: var(--text); font-family: inherit; font-weight: 800; font-size: 28px; line-height: 1; cursor: pointer; padding: 0; }
.tc-nav:hover { background: var(--fill); }
.tc-seg { flex: 1 0 100%; display: flex; gap: 4px; margin: 6px auto 4px; padding: 4px; max-width: 280px; border-radius: 999px; background: var(--fill); }
.tc-seg button { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.4; cursor: pointer; }
.tc-seg button[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); }

/* month grid: one 7-column grid per week; the day buttons fill the whole row,
   the trip bars sit in lanes over them (pointer-events off, so a tap is the day's) */
.tc-wds { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 6px 0 2px; }
.tc-wds span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.6; }
.tc-wds span:first-child { color: #e5484d; }
.tc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 26px repeat(3, 17px) 6px; }
.tc-week + .tc-week { border-top: 1px solid var(--line); }
.tc-d { grid-row: 1 / -1; position: relative; min-height: 44px; margin: 0; padding: 3px 0 0; border: 0; border-radius: 12px; background: transparent; color: var(--text);
  font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.tc-d b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tc-d.out { color: var(--muted); }
.tc-d.out b { opacity: .55; }
.tc-d.off b { color: #e5484d; }
.tc-d.today b { box-shadow: 0 0 0 2px #ff4b2b inset; }
.tc-d.sel { background: var(--fill); }
.tc-d.sel b { background: var(--pill); color: var(--pill-text); box-shadow: none; }
.tc-d:focus-visible { outline: 2px solid #ff4b2b; outline-offset: -2px; }
.tc-more { position: absolute; right: 3px; bottom: 1px; font-size: 10.5px; font-weight: 800; color: var(--muted); line-height: 1.3; }
.tc-trip { position: relative; z-index: 1; pointer-events: none; align-self: center; height: 15px; margin: 0 2px; padding: 0 5px; border-radius: 6px;
  background: #ff4b2b; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-trip.going { background: #7a5cff; }
.tc-trip.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tc-trip.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
html[data-theme="dark"] .tc-trip { background: #ff6a4d; color: #1b100b; }
html[data-theme="dark"] .tc-trip.going { background: #a996ff; }

/* the picked day, and the list */
.tc-day { margin-top: 12px; }
.tc-day h3, .tc-list h3 { margin: 0 4px 8px; font-size: 14.5px; font-weight: 800; line-height: 1.5; color: var(--muted); }
.tc-hol { margin: -4px 4px 8px; font-size: 13.5px; line-height: 1.55; color: #e5484d; font-weight: 700; }
.tc-none { margin: 0 4px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.tc-list { margin-top: 10px; }
.tc-rows { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; border: 1px solid var(--edge); background: var(--surface); }
.tc-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; color: var(--text); text-decoration: none; }
.tc-row + .tc-row { border-top: 1px solid var(--line); }
.tc-row:hover { background: var(--fill); }
.tc-row:focus-visible { outline: 2px solid #ff4b2b; outline-offset: -3px; }
.tc-date { flex: none; width: 44px; height: 44px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: color-mix(in srgb, #ff4b2b 16%, transparent); line-height: 1.15; }
.tc-row.going .tc-date { background: color-mix(in srgb, #7a5cff 18%, transparent); }
.tc-date b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tc-date small { font-size: 11px; font-weight: 700; color: var(--muted); }
.tc-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-row-t b { font-size: 15px; font-weight: 700; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-row-t small { font-size: 12.5px; line-height: 1.5; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-chip { flex: none; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, #7a5cff 18%, transparent); font-size: 12px; font-weight: 800; line-height: 1.6; }
.tc-row i { flex: none; font-style: normal; font-size: 22px; color: var(--muted); }
.tc-past { margin-top: 14px; }
.tc-past summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 4px; font-weight: 800; color: var(--muted); line-height: 1.5; }

.tc-empty { text-align: center; padding: 18px 12px 6px; }
.tc-empty img { width: 140px; height: 140px; object-fit: contain; }
.tc-empty p { margin: 8px 0 14px; font-weight: 700; font-size: 16px; line-height: 1.55; }

/* subscribe card */
.tc-subcard { padding: 14px; }
.tc-subhead { display: flex; gap: 12px; align-items: flex-start; }
.tc-subic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--fill); }
.tc-subic img { width: 38px; height: 38px; }
.tc-subhead h2 { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.5; }
.tc-subhead p { margin: 2px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.tc-subbtn { width: 100%; min-height: 48px; margin-top: 12px; justify-content: center; }

/* the subscribe sheet */
html.tc-sheet-open, html.tc-sheet-open body { overflow: hidden; }
.tc-sheet { position: fixed; inset: 0; z-index: 1400; }
.tc-scrim { position: absolute; inset: 0; background: rgba(20, 12, 8, .42); opacity: 0; transition: opacity .2s ease; }
.tc-panel { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; box-sizing: border-box;
  background: var(--surface); color: var(--text); border-radius: 24px 24px 0 0; padding: 6px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .35);
  transform: translateY(100%); transition: transform .22s ease; }
.tc-sheet.open .tc-scrim { opacity: 1; }
.tc-sheet.open .tc-panel { transform: none; }
@media (min-width: 760px) { .tc-panel { bottom: 50%; border-radius: 24px; transform: translateY(calc(50% + 40px)); opacity: 0; transition: transform .22s ease, opacity .2s ease; } .tc-sheet.open .tc-panel { transform: translateY(50%); opacity: 1; } }
.tc-grab { width: 40px; height: 5px; margin: 4px auto 6px; border-radius: 3px; background: var(--line-strong, rgba(0, 0, 0, .2)); }
.tc-panel-head { display: flex; align-items: center; gap: 8px; }
.tc-panel-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 800; line-height: 1.5; }
.tc-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--fill); color: var(--text); font-family: inherit; font-weight: 700; font-size: 26px; line-height: 1; cursor: pointer; }
.tc-line { margin: 10px 0 4px; padding: 12px 14px; border-radius: 16px; background: var(--t5, #fff1c6); font-size: 14px; line-height: 1.55; }
html[data-theme="dark"] .tc-line { background: rgba(255, 210, 120, .14); }
.tc-line p { margin: 0 0 10px; }
.tc-line .fd-btn { min-height: 44px; }
.tc-msg { margin: 8px 2px 0; min-height: 1px; font-size: 14px; font-weight: 700; line-height: 1.55; }
.tc-msg:empty { margin: 0; }
.tc-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tc-opt { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; border-radius: 18px; border: 1px solid var(--edge); background: var(--card-bg, var(--surface)); color: var(--text); text-decoration: none; }
.tc-opt:hover { background: var(--fill); }
.tc-opt-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--fill); }
.tc-opt-ic img { width: 34px; height: 34px; }
.tc-opt-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-opt-t b { font-size: 15px; font-weight: 800; line-height: 1.5; }
.tc-opt-t small { font-size: 13px; line-height: 1.5; color: var(--muted); }
.tc-opt i { flex: none; font-style: normal; font-size: 22px; color: var(--muted); }
.tc-copy label { display: block; margin: 4px 2px 6px; font-size: 13.5px; font-weight: 700; line-height: 1.55; }
.tc-copyrow { display: flex; gap: 8px; }
.tc-copyrow input { flex: 1; min-width: 0; min-height: 46px; box-sizing: border-box; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 13px/1.4 ui-monospace, Menlo, monospace; }
.tc-copyrow .fd-btn { flex: none; min-height: 46px; gap: 6px; }
.tc-copyrow .fd-btn img { width: 22px; height: 22px; }
.tc-reset { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.tc-reset p { margin: 0 2px 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.tc-resetbtn { min-height: 44px; }
