* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f4f7fc;
    color: #0b1a33;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
button, input, select { font: inherit; }
:where(a, button, input, select):focus-visible { outline: 3px solid #8ec7ff; outline-offset: 3px; }
.calculator-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 66px;
    padding: 10px 28px;
    background: #fff;
    border-bottom: 1px solid #e7edf5;
}
.calculator-plan { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; background: #eaf8ef; color: #16803d; font-size: .8rem; font-weight: 500; }
.calculator-plan strong { font-size: .85rem; font-style: italic; font-weight: 800; }
.calculator-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 1.325rem; line-height: 1.4; }
.calculator-title-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #006acd; font-size: 1.5rem; }
.holiday-calendar-icon { position: relative; width: 21px; height: 21px; border: 2px solid currentColor; border-top-width: 6px; border-radius: 4px; }
.holiday-calendar-icon::before { position: absolute; top: -8px; left: 3px; width: 2px; height: 4px; border-radius: 1px; background: currentColor; box-shadow: 9px 0 currentColor; content: ""; }
.holiday-calendar-icon::after { position: absolute; right: 3px; bottom: 3px; width: 5px; height: 5px; border-radius: 1px; background: currentColor; content: ""; }
.calculator-open-link { align-items: center; gap: 6px; justify-self: end; color: #69798d; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.calculator-open-link:hover { color: #006acd; }
.calculator-main { flex: 1; display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 1008px; margin: 0 auto; padding: 32px 24px 16px; }
.calculator-card { padding: 22px; border: 1px solid #e5ebf3; border-radius: 24px; background: #fff; box-shadow: 0 12px 40px rgba(18, 61, 107, .06); }
.holiday-controls { display: flex; align-items: center; gap: 16px; }
.holiday-year-label { display: flex; flex: none; align-items: center; gap: 10px; color: #4b5a6a; font-weight: 600; }
.holiday-year-label select, .holiday-search input { min-height: 44px; border: 1px solid #e5ebf3; border-radius: 12px; background: #f8faff; color: #0b1a33; }
.holiday-year-label select { padding: 8px 10px; }
.holiday-search { position: relative; flex: 1; min-width: 0; }
.holiday-search-icon { position: absolute; top: 50%; left: 13px; width: 13px; height: 13px; transform: translateY(-60%); border: 1.5px solid currentColor; border-radius: 50%; color: #69798d; pointer-events: none; }
.holiday-search-icon::after { position: absolute; right: -4px; bottom: -2px; width: 6px; height: 1.5px; transform: rotate(45deg); border-radius: 1px; background: currentColor; content: ""; }
.holiday-search input { width: 100%; padding: 8px 12px 8px 38px; }
.holiday-search input::placeholder { color: #69798d; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.holiday-months { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.holiday-months button { flex: 1 0 auto; min-height: 38px; padding: 7px 10px; border: 1px solid #e5ebf3; border-radius: 10px; background: #f8faff; color: #315d8d; cursor: pointer; font-size: .875rem; white-space: nowrap; }
.holiday-months button:hover { background: #eef4fe; }
.holiday-months button[aria-pressed="true"] { border-color: #006acd; background: #006acd; color: #fff; font-weight: 600; }
.holiday-results-header, .holiday-results-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.holiday-results-header { justify-content: space-between; margin: 0 2px 14px; }
.holiday-results-header h2 { margin: 0; font-size: 1.125rem; }
.holiday-results-summary p { margin: 0; color: #52637a; font-size: .875rem; }
.holiday-results-summary button { padding: 4px 0; border: 0; background: transparent; color: #006acd; cursor: pointer; font-size: .875rem; }
.holiday-results-summary button:hover { text-decoration: underline; }
.holiday-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.holiday-results[data-single-month="true"] { grid-template-columns: minmax(0, 1fr); }
.holiday-group { padding: 16px 20px; }
.holiday-group h3 { margin: 2px 0 8px; color: #315d8d; font-size: 1rem; }
.holiday-group ul { margin: 0; padding: 0; list-style: none; }
.holiday-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; border-top: 1px solid #eef2f8; }
.holiday-date { color: #52637a; font-variant-numeric: tabular-nums; font-size: .875rem; white-space: nowrap; }
.holiday-name { display: block; font-weight: 600; }
.holiday-rule { display: block; margin-top: 2px; color: #52637a; font-size: .75rem; }
.holiday-kind { padding: 3px 6px; border-radius: 6px; background: #eef4fe; color: #315d8d; font-size: .75rem; white-space: nowrap; }
.holiday-kind[data-kind="traditional"] { background: #fdf1ea; color: #9a4a20; }
.holiday-kind[data-kind="term"] { background: #eaf8ef; color: #16803d; }
.holiday-empty { margin: 0; color: #52637a; text-align: center; }
.calculator-tips { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid #e7edf5; color: #66758a; font-size: .9rem; line-height: 1.8; text-align: center; }
.calculator-tips p { margin: 0; }

@media (max-width: 767.98px) {
    .calculator-header { padding: 8px 16px; gap: 10px; }
    .calculator-title { gap: 7px; font-size: 1.175rem; }
    .calculator-title-icon { width: 32px; height: 32px; font-size: 1.3rem; }
    .calculator-open-link { font-size: .8rem; }
    .calculator-main { padding: 24px 16px 16px; gap: 20px; }
    .holiday-results { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .calculator-header { grid-template-columns: minmax(0, 1fr) auto; }
    .calculator-title { grid-column: 1 / -1; grid-row: 1; }
    .calculator-plan { grid-column: 1; grid-row: 2; padding: 5px 8px; font-size: .72rem; }
    .calculator-open-link { grid-column: 2; grid-row: 2; }
    .calculator-card { padding: 16px 14px; border-radius: 22px; }
    .holiday-controls { flex-direction: column; align-items: stretch; gap: 10px; }
    .holiday-months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
    .holiday-months button { padding-inline: 0; }
    .holiday-months button:first-child { grid-column: 1 / -1; }
    .calculator-tips { font-size: .8rem; }
}
