/* Native date inputs remain the source of truth; only the calendar presentation changes. */
.tp-calendar-field { display: inline-block; position: relative; min-width: 0; max-width: 100%; vertical-align: middle; }
.tp-calendar-field .tp-calendar-input { box-sizing: border-box; width: 100% !important; min-width: 0; padding-right: 48px !important; }
.tp-calendar-input::-webkit-calendar-picker-indicator { display: none; }
.tp-calendar-field .tp-calendar-trigger { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #277cac; cursor: pointer; }
.tp-calendar-trigger:hover { background: rgba(14, 116, 190, .1); }
.tp-calendar { box-sizing: border-box; width: min(420px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow: auto; padding: 24px; margin: auto; border: 1px solid #cfdae6; border-radius: 22px; background: #fff; color: #172637; box-shadow: 0 24px 80px rgba(18, 43, 68, .24); font-family: inherit; font-size: 16px; line-height: 1.5; }
.tp-calendar::backdrop { background: rgba(15, 30, 48, .32); }
.tp-calendar .tp-calendar-title { margin: 0 0 16px; padding: 0; font: inherit; font-size: 16px; font-weight: 600; color: #51657a; }
.tp-calendar .tp-calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tp-calendar .tp-calendar-month { font-size: 23px; font-weight: 750; color: inherit; text-align: center; }
.tp-calendar button { font-family: inherit; line-height: 1; cursor: pointer; box-sizing: border-box; }
.tp-calendar .tp-calendar-month-button { width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 1px solid #d7e1eb; border-radius: 12px; background: #f5f8fb; color: #243c53; font-size: 30px; }
.tp-calendar .tp-calendar-grid { width: 100%; margin: 0; table-layout: fixed; border: 0; border-collapse: separate; border-spacing: 2px 4px; background: transparent; color: inherit; }
.tp-calendar .tp-calendar-grid th { height: 30px; padding: 0; border: 0; background: transparent; color: #52657a; text-align: center; font-size: 14px; font-weight: 650; }
.tp-calendar .tp-calendar-grid td { padding: 0; border: 0; background: transparent; text-align: center; }
.tp-calendar .tp-calendar-day { width: 100%; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 11px; background: transparent; color: inherit; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-calendar .tp-calendar-day:hover:not(:disabled) { background: #e9f3fc; }
.tp-calendar .tp-calendar-day[aria-current="date"] { border-color: #3682b5; }
.tp-calendar [aria-selected="true"] .tp-calendar-day { background: #0875bd; color: white; border-color: #0875bd; }
.tp-calendar [aria-selected="true"] .tp-calendar-day:hover { background: #0766a6; }
.tp-calendar button:disabled { color: #99a7b5; background: transparent; cursor: not-allowed; }
.tp-calendar .tp-calendar-help { margin: 16px 0; font-size: 12px; color: #61758a; line-height: 1.5; }
.tp-calendar .tp-calendar-actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid #e0e7ee; }
.tp-calendar .tp-calendar-actions button { min-height: 44px; min-width: 64px; padding: 10px 14px; border: 1px solid #d7e1eb; border-radius: 10px; background: #f5f8fb; color: #243c53; font-size: 15px; font-weight: 600; }
.tp-calendar button:focus-visible, .tp-calendar-trigger:focus-visible { outline: 3px solid #1483ca; outline-offset: 2px; }
html[data-theme="dark"] .tp-calendar { background: #142131; color: #f1f5fb; border-color: #42566c; }
html[data-theme="dark"] .tp-calendar .tp-calendar-title, html[data-theme="dark"] .tp-calendar .tp-calendar-grid th, html[data-theme="dark"] .tp-calendar .tp-calendar-help { color: #b9cadd; }
html[data-theme="dark"] .tp-calendar .tp-calendar-month-button, html[data-theme="dark"] .tp-calendar .tp-calendar-actions button { color: #eef5ff; background: #213449; border-color: #42566c; }
html[data-theme="dark"] .tp-calendar .tp-calendar-day:hover:not(:disabled) { background: #294765; }
html[data-theme="dark"] .tp-calendar button:disabled { color: #708298; background: transparent; }
html[data-theme="dark"] .tp-calendar-field .tp-calendar-trigger { color: #80c8f5; }
/* Weekend and holiday accents are informational, never availability rules. */
.tp-calendar .tp-calendar-header { padding-bottom: 14px; border-bottom: 1px solid #e9eef4; }
.tp-calendar .tp-calendar-month { letter-spacing: -.035em; }
.tp-calendar .tp-calendar-grid th.is-sunday { color: #c43749; }
.tp-calendar .tp-calendar-grid th.is-saturday, .tp-calendar .tp-calendar-day.is-saturday { color: #286dad; }
.tp-calendar .tp-calendar-day.is-sunday, .tp-calendar .tp-calendar-day.is-holiday { color: #c12d43; background: #fff3f4; }
.tp-calendar .tp-calendar-day.is-holiday { position: relative; }
.tp-calendar .tp-calendar-day.is-holiday::after { content: ''; position: absolute; bottom: 3px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.tp-calendar .tp-calendar-day.is-sunday:hover:not(:disabled), .tp-calendar .tp-calendar-day.is-holiday:hover:not(:disabled) { background: #ffe4e8; }
.tp-calendar [aria-selected="true"] .tp-calendar-day { color: #fff; }
.tp-calendar [aria-selected="true"] .tp-calendar-day:is(.is-sunday, .is-holiday) { background: #bd2e43; color: #fff; border-color: #bd2e43; }
.tp-calendar .tp-calendar-day:disabled { opacity: .48; cursor: not-allowed; }
.tp-calendar .tp-calendar-holidays { display: grid; gap: 6px; margin-top: 14px; padding: 12px 14px; border: 1px solid #f5dce1; border-radius: 12px; background: #fff8f9; }
.tp-calendar .tp-calendar-holidays[hidden] { display: none; }
.tp-calendar .tp-calendar-holiday-item { display: flex; align-items: baseline; gap: 10px; color: #9b3242; font-size: 12px; line-height: 1.5; }
.tp-calendar .tp-calendar-holiday-dates { min-width: 38px; flex-shrink: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.tp-calendar .tp-calendar-holiday-note { margin: 12px 0 0; color: #64748b; font-size: 11px; line-height: 1.5; }
.tp-calendar .tp-calendar-help { margin: 6px 0 14px; }
html[data-theme="dark"] .tp-calendar .tp-calendar-header { border-color: #34465a; }
html[data-theme="dark"] .tp-calendar .tp-calendar-grid th.is-sunday { color: #ff9fac; }
html[data-theme="dark"] .tp-calendar .tp-calendar-grid th.is-saturday, html[data-theme="dark"] .tp-calendar .tp-calendar-day.is-saturday { color: #92c7ff; }
html[data-theme="dark"] .tp-calendar .tp-calendar-day.is-sunday, html[data-theme="dark"] .tp-calendar .tp-calendar-day.is-holiday { color: #ff9fac; background: #382835; }
html[data-theme="dark"] .tp-calendar .tp-calendar-day:is(.is-sunday, .is-holiday):hover:not(:disabled) { background: #563140; }
html[data-theme="dark"] .tp-calendar [aria-selected="true"] .tp-calendar-day { color: #fff; background: #0875bd; }
html[data-theme="dark"] .tp-calendar [aria-selected="true"] .tp-calendar-day:is(.is-sunday, .is-holiday) { color: #fff; background: #ad2941; border-color: #ed8c9d; }
html[data-theme="dark"] .tp-calendar .tp-calendar-holidays { background: #302632; border-color: #584050; }
html[data-theme="dark"] .tp-calendar .tp-calendar-holiday-item { color: #ffb3bd; }
html[data-theme="dark"] .tp-calendar .tp-calendar-holiday-note { color: #b9cadd; }
@media (max-width: 420px) {
    .tp-calendar { padding: 16px; border-radius: 18px; }
    .tp-calendar .tp-calendar-month { font-size: 21px; }
    .tp-calendar .tp-calendar-day { height: 44px; font-size: 18px; }
}
