/* Keep these selectors specific enough to override the form and theme buttons. */
body input[data-htd-date][hidden] { display: none !important; }
body :is(#htf, #quote) button.htd-date-trigger,
body form button.htd-date-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 12px 14px;
    border: 1.5px solid #d8e2e8;
    border-radius: 10px;
    background: #f8fbfc;
    color: #506771;
    box-shadow: none;
    font: 400 16px/1.5 'Open Sans', Arial, sans-serif;
    text-align: left;
    text-transform: none;
    cursor: pointer;
    transition: border-color 120ms, background-color 120ms;
}
body form button.htd-date-trigger.has-value { color: #14384a; }
body form button.htd-date-trigger:hover { border-color: #057092; background: #f0f7f8; }
body form button.htd-date-trigger svg { flex: none; color: #057092; }
body form button.htd-date-trigger::after,
body dialog.htd-date-dialog button::after { display: none; }
body form button.htd-date-trigger:focus-visible,
body dialog.htd-date-dialog button:focus-visible { outline: 3px solid #057092; outline-offset: 3px; }

body dialog.htd-date-dialog {
    width: min(392px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    box-sizing: border-box;
    margin: auto;
    padding: 24px;
    overflow: auto;
    border: 1px solid #e1eaed;
    border-radius: 20px;
    background: #fff;
    color: #14384a;
    box-shadow: 0 20px 64px rgb(9 54 72 / 24%), 0 2px 8px rgb(9 54 72 / 8%);
    font: 400 16px/1.5 'Open Sans', Arial, sans-serif;
    text-align: left;
}
body dialog.htd-date-dialog::backdrop { background: rgb(9 35 46 / 48%); }
body dialog.htd-date-dialog * { box-sizing: border-box; }
body dialog.htd-date-dialog .htd-date-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 20px; }
body dialog.htd-date-dialog h2 { margin: 0 0 6px; font: 700 21px/1.3 'Open Sans', Arial, sans-serif; color: #14384a; }
body dialog.htd-date-dialog p { margin: 0; font-size: 13px; line-height: 1.5; color: #506771; }
body dialog.htd-date-dialog button {
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f0f6f7;
    color: #14384a;
    box-shadow: none;
    font: 600 14px/1.4 'Open Sans', Arial, sans-serif;
    text-transform: none;
    cursor: pointer;
}
body dialog.htd-date-dialog button:hover { background: #e2eff1; }
body dialog.htd-date-dialog button:active { transform: scale(.96); }
body dialog.htd-date-dialog .htd-date-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; background: transparent; color: #057092; }
body dialog.htd-date-dialog .htd-date-header .htd-date-icon { margin: -8px -8px 0 auto; }
body dialog.htd-date-dialog .htd-date-year-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 4px; border-radius: 12px; background: #f0f6f7; }
body dialog.htd-date-dialog .htd-date-year { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
body dialog.htd-date-dialog .htd-date-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
body dialog.htd-date-dialog .htd-date-months button { min-height: 46px; padding: 10px 4px; }
body dialog.htd-date-dialog .htd-date-months button[aria-current="date"] { border-color: #0d8169; }
body dialog.htd-date-dialog .htd-date-months button[aria-pressed="true"] { border-color: transparent; background: linear-gradient(120deg, #057092, #0d8169); color: #fff; }
body dialog.htd-date-dialog .htd-date-clear { width: 100%; min-height: 44px; margin-top: 18px; padding: 10px; background: transparent; color: #057092; }
@media (max-width: 380px) {
    body dialog.htd-date-dialog { padding: 18px; }
    body dialog.htd-date-dialog h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    body form button.htd-date-trigger { transition: none; }
    body dialog.htd-date-dialog button:active { transform: none; }
}
