/* ============================================================
   Holiday Times — Material Design 3  v2.0
   ============================================================ */

/* No external font requests — GDPR compliant system font stack.
   Roboto is pre-installed on Android/ChromeOS. Other platforms
   fall back to their native UI font which matches MD3 aesthetics. */

/* ── MD3 Color Tokens ─────────────────────────────────────── */
.ht-wrap {
    --md-primary:              #1a56db;
    --md-on-primary:           #ffffff;
    --md-primary-container:    #dde3ff;
    --md-on-primary-container: #00105c;
    --md-secondary:            #5b5d72;
    --md-secondary-container:  #e0e0f9;
    --md-on-secondary-container: #181a2c;
    --md-tertiary:             #76517a;
    --md-tertiary-container:   #ffd6fd;
    --md-error:                #ba1a1a;
    --md-error-container:      #ffdad6;
    --md-bg:                   #faf9ff;
    --md-surface:              #faf9ff;
    --md-surface-variant:      #e3e1ec;
    --md-on-surface:           #1b1b1f;
    --md-on-surface-variant:   #46464f;
    --md-outline:              #777680;
    --md-outline-variant:      #c7c5d0;
    --md-surface-tonal:        #f0efff;
    --md-elev1: 0px 1px 2px rgba(0,0,0,.30), 0px 1px 3px 1px rgba(0,0,0,.15);
    --md-elev2: 0px 1px 2px rgba(0,0,0,.30), 0px 2px 6px 2px rgba(0,0,0,.15);
    --md-elev3: 0px 4px 8px 3px rgba(0,0,0,.15), 0px 1px 3px rgba(0,0,0,.30);
    --md-shape-xs:   4px;
    --md-shape-sm:   8px;
    --md-shape-md:   12px;
    --md-shape-lg:   16px;
    --md-shape-full: 100px;
    --md-font: Roboto, 'Roboto Flex', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    font-family: var(--md-font);
    font-size: 14px;
    color: var(--md-on-surface);
    background: var(--md-bg);
    padding: 24px 16px 48px;
    max-width: 1100px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    /* Prevent horizontal overflow on mobile */
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ── Controls ─────────────────────────────────────────────── */
.ht-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 16px;
    background: var(--md-surface-tonal);
    border-radius: var(--md-shape-lg);
    box-shadow: var(--md-elev1);
}
.ht-field {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ht-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--md-primary);
    margin-bottom: 4px;
    padding-left: 4px;
}
.ht-select {
    appearance: none;
    background: var(--md-surface)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2346464f' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E")
        no-repeat right 10px center;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-shape-xs);
    padding: 12px 40px 12px 14px;
    font-family: var(--md-font);
    font-size: 14px;
    color: var(--md-on-surface);
    cursor: pointer;
    transition: border-color .15s;
    line-height: 1.4;
    width: 100%;
}
.ht-select:hover { border-color: var(--md-on-surface); }
.ht-select:focus { outline: none; border: 2px solid var(--md-primary); }

/* ── Segmented year buttons ───────────────────────────────── */
.ht-year-tabs {
    display: flex;
    margin-left: auto;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-shape-full);
    overflow: hidden;
    flex-shrink: 0;
}
.ht-year-btn {
    background: transparent;
    border: none;
    border-right: 1px solid var(--md-outline);
    padding: 10px 20px;
    font-family: var(--md-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--md-on-surface);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ht-year-btn:last-child { border-right: none; }
.ht-year-btn:hover { background: rgba(26,86,219,.08); color: var(--md-primary); }
.ht-year-btn.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.ht-year-btn.active::before { content: '✓ '; font-size: 12px; opacity: .8; }

/* ── Loading ──────────────────────────────────────────────── */
.ht-loading { display: none; justify-content: center; align-items: center; padding: 48px; gap: 16px; }
.ht-loading.is-visible { display: flex; }
.ht-loading-text { font-size: 14px; color: var(--md-on-surface-variant); }
.ht-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--md-primary-container);
    border-top-color: var(--md-primary);
    border-radius: 50%;
    animation: ht-spin .8s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes ht-spin { to { transform: rotate(360deg); } }

/* ── Year section ─────────────────────────────────────────── */
.ht-year-group { margin-bottom: 40px; }
.ht-year-group.is-hidden { display: none; }
.ht-year-label {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: -.02em;
    margin-bottom: 16px;
    padding-left: 4px;
    line-height: 1;
    user-select: none;
    background: linear-gradient(90deg, var(--md-primary) 0%, var(--md-on-surface-variant) 60%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Month grid ───────────────────────────────────────────── */
.ht-months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 12px;
}
.ht-month-card {
    background: var(--md-surface);
    border-radius: var(--md-shape-lg);
    padding: 16px;
    box-shadow: var(--md-elev1);
    border: 1px solid var(--md-outline-variant);
    transition: box-shadow .2s, transform .2s;
    opacity: 0;
    animation: ht-fade-up .3s cubic-bezier(.2,0,0,1) forwards;
}
.ht-month-card:hover { box-shadow: var(--md-elev2); transform: translateY(-2px); }
@keyframes ht-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ht-months-grid .ht-month-card:nth-child(1)  { animation-delay: .03s; }
.ht-months-grid .ht-month-card:nth-child(2)  { animation-delay: .06s; }
.ht-months-grid .ht-month-card:nth-child(3)  { animation-delay: .09s; }
.ht-months-grid .ht-month-card:nth-child(4)  { animation-delay: .12s; }
.ht-months-grid .ht-month-card:nth-child(5)  { animation-delay: .15s; }
.ht-months-grid .ht-month-card:nth-child(6)  { animation-delay: .18s; }
.ht-months-grid .ht-month-card:nth-child(7)  { animation-delay: .21s; }
.ht-months-grid .ht-month-card:nth-child(8)  { animation-delay: .24s; }
.ht-months-grid .ht-month-card:nth-child(9)  { animation-delay: .27s; }
.ht-months-grid .ht-month-card:nth-child(10) { animation-delay: .30s; }
.ht-months-grid .ht-month-card:nth-child(11) { animation-delay: .33s; }
.ht-months-grid .ht-month-card:nth-child(12) { animation-delay: .36s; }

.ht-month-name {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--md-on-surface-variant);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--md-outline-variant);
}

/* ── Holiday list ─────────────────────────────────────────── */
.ht-holiday-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

/* KEY FIX: no ::before pseudo-element, no absolute children that could block clicks.
   The hover background is applied directly on the element. */
.ht-holiday-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px 7px 10px;
    border-radius: var(--md-shape-sm);
    border-left: 3px solid transparent;
    transition: background .15s;
    /* NO position:relative — tooltip is now inline, not absolute */
}
.ht-holiday-item:hover { background: rgba(26,86,219,.06); }
.ht-holiday-item.is-global   { border-left-color: var(--md-primary); }
.ht-holiday-item.is-regional { border-left-color: var(--md-tertiary); }

/* Day circle */
.ht-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    background: var(--md-primary-container);
    border-radius: 50%;
    flex-shrink: 0;
}
.ht-holiday-item.is-regional .ht-day { background: var(--md-tertiary-container); }
.ht-day-num { font-size: 12px; font-weight: 600; line-height: 1; color: var(--md-on-primary-container); }
.ht-day-name { font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--md-on-primary-container); opacity: .75; line-height: 1; }

/* Info text */
.ht-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.ht-name { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--md-on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-intl-name { font-size: 11px; color: var(--md-on-surface-variant); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Regional badge */
.ht-badge {
    display: inline-flex; align-items: center;
    font-size: 10px; font-weight: 500; letter-spacing: .02em;
    color: var(--md-tertiary); background: var(--md-tertiary-container);
    border-radius: var(--md-shape-full); padding: 2px 8px; margin-top: 3px;
    align-self: flex-start; border: 1px solid rgba(118,81,122,.2);
}

/* ── Countdown label — INLINE, not absolute ───────────────── */
/* Shown only on hover via the parent :hover selector.
   Because it is a normal inline-flex item in the flex row,
   it cannot overlap or block any sibling buttons. */
.ht-countdown-tip {
    display: none;               /* hidden by default */
    align-items: center;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--md-surface);
    background: var(--md-on-surface);
    border-radius: var(--md-shape-full);
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    pointer-events: none;        /* never intercept clicks */
}
.ht-holiday-item:hover .ht-countdown-tip { display: inline-flex; }

/* ── Calendar buttons ─────────────────────────────────────── */
/* Also inline-flex items — always in the flex flow, never overlapping */
.ht-cal-btns {
    display: none;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.ht-holiday-item:hover .ht-cal-btns { display: inline-flex; }
@media (hover: none) {
    .ht-cal-btns { display: inline-flex; } /* always visible on touch */
}

.ht-cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: var(--md-shape-xs);
    background: var(--md-surface-variant);
    color: var(--md-on-surface-variant);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.ht-cal-btn:hover  { transform: scale(1.12); }
.ht-cal-btn:active { transform: scale(.93); }
.ht-cal-google:hover { background: #e8f0fe; }
.ht-cal-apple:hover  { background: var(--md-surface-variant); color: var(--md-on-surface); }

/* ── Current month ────────────────────────────────────────── */
.ht-month-card.is-current-month {
    background: var(--md-primary-container);
    border-color: var(--md-primary);
    border-width: 2px;
    box-shadow: var(--md-elev2);
}
.ht-month-card.is-current-month .ht-month-name {
    color: var(--md-on-primary-container);
    border-bottom-color: rgba(26,86,219,.25);
    display: flex; align-items: center; gap: 6px;
}
.ht-month-card.is-current-month .ht-month-name::before {
    content: ''; display: inline-block;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--md-primary); flex-shrink: 0;
}
.ht-month-card.is-current-month .ht-day { background: var(--md-primary); }
.ht-month-card.is-current-month .ht-day-num,
.ht-month-card.is-current-month .ht-day-name { color: var(--md-on-primary); }
.ht-month-card.is-current-month .ht-holiday-item.is-regional .ht-day { background: var(--md-tertiary); }
.ht-month-card.is-current-month .ht-holiday-item.is-regional .ht-day-num,
.ht-month-card.is-current-month .ht-holiday-item.is-regional .ht-day-name { color: #fff; }

/* ── Next-holiday banner ──────────────────────────────────── */
.ht-next-banner {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
    background: var(--md-primary); color: var(--md-on-primary);
    border-radius: var(--md-shape-lg); padding: 14px 20px;
    margin-bottom: 20px; box-shadow: var(--md-elev2); font-size: 14px;
    animation: ht-fade-up .3s cubic-bezier(.2,0,0,1) forwards;
}
.ht-next-icon  { display: flex; align-items: center; opacity: .85; flex-shrink: 0; }
.ht-next-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; opacity: .75; flex-shrink: 0; }
.ht-next-names { display: flex; flex-direction: column; gap: 1px; }
.ht-next-name  { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ht-next-name-en { font-size: 12px; font-weight: 400; opacity: .75; }
.ht-next-date  { opacity: .8; font-size: 13px; }
.ht-next-countdown {
    margin-left: auto; background: rgba(255,255,255,.18);
    border-radius: var(--md-shape-full); padding: 4px 14px;
    font-size: 13px; font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.ht-next-today { font-weight: 700; letter-spacing: .02em; }

/* ── Misc ─────────────────────────────────────────────────── */
.ht-source { font-size: 12px; color: var(--md-on-surface-variant); text-align: right; margin-top: 16px; }
.ht-source a { color: var(--md-primary); text-decoration: none; font-weight: 500; }
.ht-source a:hover { text-decoration: underline; }
.ht-error { color: var(--md-error); padding: 16px; background: var(--md-error-container); border-radius: var(--md-shape-md); font-size: 14px; font-weight: 500; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .ht-controls       { flex-direction: column; align-items: stretch; }
    .ht-field          { min-width: unset; width: 100%; }
    .ht-select         { width: 100%; }
    .ht-year-tabs      { margin-left: 0; align-self: flex-start; }
    .ht-year-label     { font-size: 28px; }
    .ht-months-grid    { grid-template-columns: 1fr; }
    .ht-wrap           { padding: 16px 12px 32px; }
    .ht-next-countdown { margin-left: 0; }
    .ht-countdown-tip  { display: none !important; }
    /* Prevent any child from breaking out */
    .ht-next-banner    { word-break: break-word; }
    .ht-holiday-item   { min-width: 0; }
    .ht-info           { min-width: 0; overflow: hidden; }
    .ht-name           { white-space: normal; }
    .ht-intl-name      { white-space: normal; }
    .ht-related        { gap: 6px; }
    .ht-related-link   { font-size: 12px; padding: 3px 10px; }
    .ht-country-label  { width: 100%; box-sizing: border-box; }
    .ht-cal-btns       { flex-shrink: 0; }
}

/* ── Seasonal month header colors ────────────────────────── */
/* Shown as a colored left border on the card + tinted month name.
   No ::before pseudo-elements — avoids layout/overflow issues.   */

/* Winter: Dec–Feb — ice blue */
.ht-month-card[data-month="12"],
.ht-month-card[data-month="1"],
.ht-month-card[data-month="2"] {
    border-left: 3px solid #74c0d8;
}
.ht-month-card[data-month="12"] .ht-month-name,
.ht-month-card[data-month="1"]  .ht-month-name,
.ht-month-card[data-month="2"]  .ht-month-name {
    color: #1a6b8a;
    border-bottom-color: #b3dce8;
}

/* Spring: Mar–May — green */
.ht-month-card[data-month="3"],
.ht-month-card[data-month="4"],
.ht-month-card[data-month="5"] {
    border-left: 3px solid #52b76a;
}
.ht-month-card[data-month="3"] .ht-month-name,
.ht-month-card[data-month="4"] .ht-month-name,
.ht-month-card[data-month="5"] .ht-month-name {
    color: #2d7a3a;
    border-bottom-color: #b2ddb8;
}

/* Summer: Jun–Aug — amber */
.ht-month-card[data-month="6"],
.ht-month-card[data-month="7"],
.ht-month-card[data-month="8"] {
    border-left: 3px solid #f5c842;
}
.ht-month-card[data-month="6"] .ht-month-name,
.ht-month-card[data-month="7"] .ht-month-name,
.ht-month-card[data-month="8"] .ht-month-name {
    color: #8a5c00;
    border-bottom-color: #f5d88a;
}

/* Autumn: Sep–Nov — terracotta */
.ht-month-card[data-month="9"],
.ht-month-card[data-month="10"],
.ht-month-card[data-month="11"] {
    border-left: 3px solid #d4663a;
}
.ht-month-card[data-month="9"]  .ht-month-name,
.ht-month-card[data-month="10"] .ht-month-name,
.ht-month-card[data-month="11"] .ht-month-name {
    color: #8a3a1a;
    border-bottom-color: #f0b89a;
}

/* Current month overrides seasonal border — keep primary blue */
.ht-month-card.is-current-month {
    border-left: 3px solid var(--md-primary) !important;
}
/* ── Year holiday count ───────────────────────────────────── */
.ht-year-label {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.ht-year-count {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--md-on-surface-variant);
    opacity: .7;
    -webkit-text-fill-color: initial; /* override gradient from parent */
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

/* ── Badge container ──────────────────────────────────────── */
.ht-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
}

/* ── Bridge day badge ─────────────────────────────────────── */
.ht-badge-regional {
    color: var(--md-tertiary);
    background: var(--md-tertiary-container);
    border: 1px solid rgba(118,81,122,.2);
}
.ht-badge-bridge {
    color: #7a4800;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    font-size: 10px;
    white-space: nowrap;   /* keep text on one line */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ht-holiday-item.is-bridge .ht-day {
    background: #ffe0b2;
}
.ht-holiday-item.is-bridge .ht-day-num,
.ht-holiday-item.is-bridge .ht-day-name {
    color: #7a4800;
}

/* ── Related countries navigation ────────────────────────── */
.ht-related {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--md-surface-tonal);
    border-radius: var(--md-shape-md);
    border: 1px solid var(--md-outline-variant);
}
.ht-related-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--md-on-surface-variant);
    flex-shrink: 0;
    margin-right: 4px;
}
.ht-related-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--md-shape-full);
    font-size: 13px;
    font-weight: 500;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    color: var(--md-primary);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
    max-width: 100%;
}
.ht-related-link:hover {
    background: var(--md-primary-container);
    border-color: var(--md-primary);
    color: var(--md-on-primary-container);
    text-decoration: none;
}
.ht-related-link.is-inactive {
    color: var(--md-on-surface-variant);
    cursor: default;
    opacity: .5;
}
@media (max-width: 640px) {
    .ht-related { gap: 6px; }
    .ht-related-link { font-size: 12px; padding: 3px 10px; }
}

/* ── Static country label (show_selector=false) ──────────── */
.ht-country-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-full);
    color: var(--md-on-surface);
}
.ht-country-label svg {
    color: var(--md-primary);
    flex-shrink: 0;
}
.ht-country-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-on-surface);
}
.ht-country-code {
    font-size: 11px;
    font-weight: 500;
    color: var(--md-on-surface-variant);
    background: var(--md-surface-variant);
    border-radius: var(--md-shape-full);
    padding: 1px 7px;
    letter-spacing: .04em;
}

/* ── FAQ Section ───────────────────────────────────────────── */
.ht-faq {
    margin-top: 40px;
    padding-top: 8px;
}
.ht-faq-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--md-on-surface);
    margin: 0 0 16px 0;
    letter-spacing: .01em;
}
.ht-faq-title svg {
    color: var(--md-primary);
    flex-shrink: 0;
}
.ht-faq-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ht-faq-item {
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-md);
    overflow: hidden;
    transition: box-shadow .2s;
}
.ht-faq-item:hover {
    box-shadow: var(--md-elev1);
}
.ht-faq-item.ht-faq-open {
    border-color: var(--md-primary);
    box-shadow: var(--md-elev1);
}
.ht-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-on-surface);
    cursor: pointer;
    user-select: none;
    transition: background .15s;
    list-style: none;
}
.ht-faq-question:hover {
    background: var(--md-surface-tonal);
}
.ht-faq-item.ht-faq-open .ht-faq-question {
    background: var(--md-primary-container);
    color: var(--md-on-primary-container);
}
.ht-faq-question span {
    flex: 1;
    line-height: 1.45;
}
.ht-faq-chevron {
    flex-shrink: 0;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    color: var(--md-on-surface-variant);
}
.ht-faq-item.ht-faq-open .ht-faq-chevron {
    transform: rotate(180deg);
    color: var(--md-primary);
}
.ht-faq-answer {
    margin: 0;
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s cubic-bezier(.4,0,.2,1), padding .3s;
}
.ht-faq-answer:not([hidden]) {
    padding: 0 16px 14px;
    max-height: 300px;
}
.ht-faq-answer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--md-on-surface-variant);
    border-top: 1px solid var(--md-outline-variant);
    padding-top: 12px;
}
.ht-faq-answer strong {
    color: var(--md-on-surface);
    font-weight: 600;
}

@media (max-width: 480px) {
    .ht-faq-question {
        padding: 12px 14px;
        font-size: 13px;
    }
    .ht-faq-answer p {
        font-size: 13px;
    }
}

/* ── Today / Yesterday / Tomorrow Shortcode ───────────────── */
.ht-today-wrap {
    --md-primary:              #1a56db;
    --md-on-primary:           #ffffff;
    --md-primary-container:    #dde3ff;
    --md-on-primary-container: #00105c;
    --md-on-surface:           #1b1b1f;
    --md-on-surface-variant:   #46464f;
    --md-outline-variant:      #c7c5d0;
    --md-surface:              #faf9ff;
    --md-surface-tonal:        #f0efff;
    --md-surface-variant:      #e3e1ec;
    --md-bg:                   #faf9ff;
    --md-elev1: 0px 1px 2px rgba(0,0,0,.30), 0px 1px 3px 1px rgba(0,0,0,.15);
    --md-elev2: 0px 1px 2px rgba(0,0,0,.30), 0px 2px 6px 2px rgba(0,0,0,.15);
    --md-shape-md:   12px;
    --md-shape-lg:   16px;
    --md-shape-full: 100px;
    --md-font: Roboto, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* 12-color palette for country badges */
    --ht-c0:#1a56db;--ht-c0t:#fff; --ht-c1:#0e9f6e;--ht-c1t:#fff;
    --ht-c2:#d97706;--ht-c2t:#fff; --ht-c3:#dc2626;--ht-c3t:#fff;
    --ht-c4:#7c3aed;--ht-c4t:#fff; --ht-c5:#db2777;--ht-c5t:#fff;
    --ht-c6:#0891b2;--ht-c6t:#fff; --ht-c7:#65a30d;--ht-c7t:#fff;
    --ht-c8:#ea580c;--ht-c8t:#fff; --ht-c9:#0284c7;--ht-c9t:#fff;
    --ht-c10:#9333ea;--ht-c10t:#fff; --ht-c11:#059669;--ht-c11t:#fff;

    /* Header color per mode — default: today (blue) */
    --ht-today-header-bg: var(--md-primary);

    font-family: var(--md-font);
    font-size: 14px;
    color: var(--md-on-surface);
    background: var(--md-bg);
    padding: 24px 16px 48px;
    max-width: 1100px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Yesterday — teal header */
.ht-today-yesterday { --ht-today-header-bg: #0e7490; }
/* Tomorrow — green header */
.ht-today-tomorrow  { --ht-today-header-bg: #15803d; }

/* Header */
.ht-today-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    background: var(--ht-today-header-bg);
    color: #fff;
    border-radius: var(--md-shape-lg);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--md-elev2);
    font-size: 14px;
    animation: ht-fade-up .3s cubic-bezier(.2,0,0,1) forwards;
}
.ht-today-icon { display: flex; align-items: center; opacity: .85; flex-shrink: 0; }
.ht-today-header-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ht-today-date { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ht-today-no-holidays { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.ht-today-count { font-size: 12px; opacity: .8; }
.ht-today-count-pill {
    margin-left: auto;
    background: rgba(255,255,255,.18);
    border-radius: var(--md-shape-full);
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* List */
.ht-today-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ht-today-item {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-md);
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
    min-height: 48px;
}
.ht-today-item:hover {
    box-shadow: var(--md-elev1);
    border-color: var(--ht-item-color, var(--md-primary));
}
.ht-today-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-width: 72px;
    align-self: stretch;
    background: var(--ht-item-color, var(--md-primary));
    color: var(--ht-item-text, #fff);
    text-align: center;
    padding: 8px 6px;
    flex-shrink: 0;
    gap: 3px;
}
.ht-today-code { font-size: 14px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.ht-today-country { font-size: 10px; font-weight: 500; opacity: .9; line-height: 1.3; word-break: break-word; hyphens: auto; max-width: 100%; }
.ht-today-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 12px;
    gap: 2px;
    min-width: 0;
}
.ht-today-hname { font-size: 13px; font-weight: 500; color: var(--md-on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-today-local { font-size: 12px; color: var(--md-on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-today-more  { font-size: 11px; color: var(--md-primary); font-weight: 500; }
.ht-today-empty { padding: 16px; color: var(--md-on-surface-variant); font-size: 14px; }

/* Per-color assignments */
.ht-today-item[data-color="0"]  { --ht-item-color:var(--ht-c0);  --ht-item-text:var(--ht-c0t);  }
.ht-today-item[data-color="1"]  { --ht-item-color:var(--ht-c1);  --ht-item-text:var(--ht-c1t);  }
.ht-today-item[data-color="2"]  { --ht-item-color:var(--ht-c2);  --ht-item-text:var(--ht-c2t);  }
.ht-today-item[data-color="3"]  { --ht-item-color:var(--ht-c3);  --ht-item-text:var(--ht-c3t);  }
.ht-today-item[data-color="4"]  { --ht-item-color:var(--ht-c4);  --ht-item-text:var(--ht-c4t);  }
.ht-today-item[data-color="5"]  { --ht-item-color:var(--ht-c5);  --ht-item-text:var(--ht-c5t);  }
.ht-today-item[data-color="6"]  { --ht-item-color:var(--ht-c6);  --ht-item-text:var(--ht-c6t);  }
.ht-today-item[data-color="7"]  { --ht-item-color:var(--ht-c7);  --ht-item-text:var(--ht-c7t);  }
.ht-today-item[data-color="8"]  { --ht-item-color:var(--ht-c8);  --ht-item-text:var(--ht-c8t);  }
.ht-today-item[data-color="9"]  { --ht-item-color:var(--ht-c9);  --ht-item-text:var(--ht-c9t);  }
.ht-today-item[data-color="10"] { --ht-item-color:var(--ht-c10); --ht-item-text:var(--ht-c10t); }
.ht-today-item[data-color="11"] { --ht-item-color:var(--ht-c11); --ht-item-text:var(--ht-c11t); }

/* Cal buttons on today items */
.ht-today-item .ht-cal-btns { display: none; align-items: center; gap: 3px; flex-shrink: 0; padding-right: 10px; margin-left: auto; }
.ht-today-item:hover .ht-cal-btns { display: inline-flex; }
@media (hover: none) { .ht-today-item .ht-cal-btns { display: inline-flex; } }

@media (max-width: 480px) {
    .ht-today-wrap { padding: 16px 12px 32px; }
    .ht-today-day  { width: 60px; min-width: 60px; }
    .ht-today-hname { font-size: 12px; }
}


/* ── UN International Days Shortcode ──────────────────────── */
.ht-un-wrap {
    --md-primary:              #1a56db;
    --md-on-primary:           #ffffff;
    --md-primary-container:    #dde3ff;
    --md-on-primary-container: #00105c;
    --md-on-surface:           #1b1b1f;
    --md-on-surface-variant:   #46464f;
    --md-outline-variant:      #c7c5d0;
    --md-surface:              #faf9ff;
    --md-surface-tonal:        #f0efff;
    --md-surface-variant:      #e3e1ec;
    --md-bg:                   #faf9ff;
    --md-elev1: 0px 1px 2px rgba(0,0,0,.30), 0px 1px 3px 1px rgba(0,0,0,.15);
    --md-elev2: 0px 1px 2px rgba(0,0,0,.30), 0px 2px 6px 2px rgba(0,0,0,.15);
    --md-shape-md:   12px;
    --md-shape-lg:   16px;
    --md-shape-full: 100px;
    --md-font: Roboto, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    font-family: var(--md-font);
    font-size: 14px;
    color: var(--md-on-surface);
    background: var(--md-bg);
    padding: 24px 16px 48px;
    max-width: 1100px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

/* Header */
.ht-un-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--md-primary);
    color: var(--md-on-primary);
    border-radius: var(--md-shape-lg);
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: var(--md-elev2);
    animation: ht-fade-up .3s cubic-bezier(.2,0,0,1) forwards;
}
.ht-un-icon { display: flex; align-items: center; opacity: .85; flex-shrink: 0; }
.ht-un-header-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ht-un-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ht-un-subtitle { font-size: 12px; opacity: .8; }
.ht-un-subtitle a { color: inherit; text-decoration: underline; opacity: .9; }
.ht-un-subtitle a:hover { opacity: 1; }

/* Year tabs */
.ht-un-year-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,.15);
    border-radius: var(--md-shape-full);
    padding: 3px;
    flex-shrink: 0;
}
.ht-un-year-btn {
    padding: 5px 14px;
    border-radius: var(--md-shape-full);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: background .15s, color .15s;
    cursor: pointer;
}
.ht-un-year-btn:hover { color: #fff; background: rgba(255,255,255,.15); }
.ht-un-year-btn.active { background: #fff; color: var(--md-primary); font-weight: 600; }

/* Month sections */
.ht-un-month {
    margin-bottom: 20px;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-lg);
    overflow: hidden;
    transition: box-shadow .15s;
}
.ht-un-month:hover { box-shadow: var(--md-elev1); }
.ht-un-month.is-current {
    border-color: var(--md-primary);
    border-width: 2px;
    box-shadow: var(--md-elev2);
}
.ht-un-month-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--md-on-surface-variant);
    background: var(--md-surface-tonal);
    border-bottom: 1px solid var(--md-outline-variant);
}
.ht-un-month.is-current .ht-un-month-name {
    color: var(--md-primary);
    background: var(--md-primary-container);
    border-bottom-color: rgba(26,86,219,.2);
}
.ht-un-month-count {
    font-size: 11px;
    font-weight: 600;
    background: var(--md-surface-variant);
    border-radius: var(--md-shape-full);
    padding: 1px 8px;
    color: var(--md-on-surface-variant);
}
.ht-un-month.is-current .ht-un-month-count {
    background: rgba(26,86,219,.15);
    color: var(--md-primary);
}

/* List items */
.ht-un-list { list-style: none; margin: 0; padding: 0; }
.ht-un-item {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 44px;
    border-bottom: 1px solid var(--md-outline-variant);
    transition: background .12s;
}
.ht-un-item:last-child { border-bottom: none; }
.ht-un-item:hover { background: var(--md-surface-tonal); }
.ht-un-item.is-today { background: var(--md-primary-container); }
.ht-un-item.is-past { opacity: .55; }

/* Day box — matches .ht-day style */
.ht-un-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    align-self: stretch;
    background: var(--md-surface-variant);
    color: var(--md-on-surface-variant);
    text-align: center;
    padding: 6px 4px;
    flex-shrink: 0;
    border-right: 1px solid var(--md-outline-variant);
}
.ht-un-item.is-today .ht-un-day {
    background: var(--md-primary);
    color: var(--md-on-primary);
    border-right-color: var(--md-primary);
}
.ht-un-day-num { font-size: 14px; font-weight: 700; line-height: 1.1; }
.ht-un-day-name { font-size: 10px; font-weight: 500; opacity: .8; letter-spacing: .03em; }

/* Info */
.ht-un-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    flex-wrap: wrap;
    min-width: 0;
}
.ht-un-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--md-on-surface);
    text-decoration: none;
    line-height: 1.4;
}
a.ht-un-name:hover {
    color: var(--md-primary);
    text-decoration: underline;
}
.ht-un-badge-today {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--md-on-primary);
    background: var(--md-primary);
    border-radius: var(--md-shape-full);
    padding: 2px 8px;
    flex-shrink: 0;
}

/* Loading state */
.ht-un-loading { opacity: .5; pointer-events: none; transition: opacity .2s; }

@media (max-width: 640px) {
    .ht-un-wrap { padding: 16px 12px 32px; }
    .ht-un-header { gap: 10px; }
    .ht-un-year-tabs { margin-left: 0; }
    .ht-un-day { width: 44px; min-width: 44px; }
    .ht-un-name { font-size: 12px; }
}

/* UN items — cal buttons always visible (not hover-only) */
.ht-un-item .ht-cal-btns { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; margin-left: auto; padding-right: 10px; }

/* UN FAQ — ensure it sits outside month overflow:hidden containers */
.ht-un-wrap .ht-faq {
    margin-top: 32px;
    overflow: visible;
}

/* UN cal buttons — icons via CSS, not inline SVG (performance) */
.ht-un-cal {
    background-color: var(--md-surface-variant);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 14px;
    mask-size: 14px;
}
.ht-un-cal.ht-cal-google {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.36c-.23 1.24-.93 2.29-1.98 2.99v2.49h3.2c1.88-1.73 2.98-4.28 2.98-7.49z'/%3E%3Cpath d='M12 22c2.7 0 4.96-.9 6.62-2.43l-3.2-2.49c-.9.6-2.04.96-3.42.96-2.63 0-4.86-1.78-5.65-4.17H3.06v2.57C4.71 19.88 8.09 22 12 22z'/%3E%3Cpath d='M6.35 13.87A5.98 5.98 0 0 1 6 12c0-.65.11-1.28.35-1.87V7.56H3.06A9.99 9.99 0 0 0 2 12c0 1.61.39 3.13 1.06 4.44l3.29-2.57z'/%3E%3Cpath d='M12 6.58c1.48 0 2.81.51 3.86 1.51l2.9-2.9C16.95 3.59 14.69 2.58 12 2.58 8.09 2.58 4.71 4.7 3.06 7.56l3.29 2.57C7.14 8.36 9.37 6.58 12 6.58z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.36c-.23 1.24-.93 2.29-1.98 2.99v2.49h3.2c1.88-1.73 2.98-4.28 2.98-7.49z'/%3E%3Cpath d='M12 22c2.7 0 4.96-.9 6.62-2.43l-3.2-2.49c-.9.6-2.04.96-3.42.96-2.63 0-4.86-1.78-5.65-4.17H3.06v2.57C4.71 19.88 8.09 22 12 22z'/%3E%3Cpath d='M6.35 13.87A5.98 5.98 0 0 1 6 12c0-.65.11-1.28.35-1.87V7.56H3.06A9.99 9.99 0 0 0 2 12c0 1.61.39 3.13 1.06 4.44l3.29-2.57z'/%3E%3Cpath d='M12 6.58c1.48 0 2.81.51 3.86 1.51l2.9-2.9C16.95 3.59 14.69 2.58 12 2.58 8.09 2.58 4.71 4.7 3.06 7.56l3.29 2.57C7.14 8.36 9.37 6.58 12 6.58z'/%3E%3C/svg%3E");
    background-color: var(--md-surface-variant);
}
.ht-un-cal.ht-cal-google:hover { background-color: #4285F4; }
.ht-un-cal.ht-cal-apple {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E");
    background-color: var(--md-on-surface-variant);
}
.ht-un-cal.ht-cal-apple:hover { background-color: var(--md-on-surface); }
