:root {
    --bg: #f6f8fb;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-solid: #ffffff;
    --text: #101828;
    --muted: #667085;
    --muted-2: #98a2b3;
    --line: #e7eaf0;
    --line-strong: #d8dee8;
    --blue: #2f80ed;
    --blue-strong: #1672e8;
    --cell: #f0f2f5;
    --shadow: 0 24px 80px rgba(16, 24, 40, 0.08);
    --radius-xl: 28px;
    --calendar-gap: 5px;
    --cell-size: 14px;
}

* { box-sizing: border-box; }

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(47, 128, 237, 0.10), transparent 30%),
        radial-gradient(circle at 88% 6%, rgba(120, 175, 255, 0.12), transparent 26%),
        var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, select { font: inherit; }
a { color: inherit; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    inset: 12px auto auto 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .18s ease;
}

.skip-link:focus { transform: translateY(0); }

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 52px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    font-weight: 760;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    padding: 6px;
    background: #111827;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.16);
}

.brand-mark span {
    border-radius: 3px;
    background: #fff;
    opacity: .96;
}

.brand-mark span:last-child { background: #60a5fa; }
.brand-text { font-size: 17px; }

.brand-text small {
    margin-inline-start: 7px;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

.settings {
    display: flex;
    align-items: center;
    gap: 14px;
}

.compact-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.select-wrap { position: relative; }

.select-wrap::after {
    content: "";
    position: absolute;
    pointer-events: none;
    inset-inline-end: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-inline-end: 1.5px solid #667085;
    border-bottom: 1.5px solid #667085;
    transform: translateY(-68%) rotate(45deg);
}

select {
    appearance: none;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.9);
    color: #344054;
    padding: 9px 36px 9px 12px;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16,24,40,.03);
}

select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
.calendar-scroll:focus-visible {
    outline: 3px solid rgba(47,128,237,.24);
    outline-offset: 3px;
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 0;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    display: block;
}

.hero::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    inset-inline-end: -170px;
    top: -205px;
    background: radial-gradient(circle, rgba(73,143,245,.21), rgba(73,143,245,0));
    pointer-events: none;
}

.hero-main {
    padding: 48px 58px 50px;
    min-width: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0;
    color: #475467;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .03em;
}

.eyebrow-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 5px rgba(47,128,237,.10);
}

h1 { margin: 23px 0 0; }

.display-date {
    display: block;
    white-space: nowrap;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.03;
    letter-spacing: -.055em;
    font-weight: 780;
}

.date-subline {
    max-width: 620px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.date-subline strong { color: #344054; font-weight: 680; }

.data-delay {
    margin: 12px 4px -8px;
    padding: 10px 14px;
    border: 1px solid #f3d8a6;
    border-radius: 12px;
    background: #fff9ec;
    color: #7a4d0b;
    font-size: 13px;
    line-height: 1.5;
}

.data-delay[hidden] { display: none; }

.methodology > summary {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 26px;
    color: #344054;
    font-size: 14px;
    font-weight: 680;
    cursor: pointer;
    list-style: none;
}

summary::-webkit-details-marker { display: none; }
.summary-icon { color: var(--muted-2); font-size: 19px; font-weight: 400; transition: transform .18s ease; }
details[open] > summary .summary-icon { transform: rotate(45deg); }

.history {
    margin-top: 24px;
    border: 1px solid rgba(255,255,255,.84);
    border-radius: var(--radius-xl);
    background: var(--panel-solid);
    box-shadow: 0 16px 50px rgba(16,24,40,.055);
    padding: 32px 34px 24px;
}

.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.history-title-wrap h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.history-title-wrap p { max-width: 580px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.summary { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.summary-item { text-align: end; min-width: 86px; }
.summary-item strong { display: block; color: #1d2939; font-size: 15px; font-weight: 720; }
.summary-item span { display: block; margin-top: 5px; color: var(--muted-2); font-size: 11px; }
.summary-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.summary-item-elapsed { min-width: 118px; }

.calendar-scroll {
    overflow-x: auto;
    padding: 4px 2px 8px;
    scrollbar-width: thin;
    scrollbar-color: #d5dbe5 transparent;
}

.calendar-wrap { position: relative; width: 100%; min-width: 100%; padding-top: 26px; }
.month-labels { position: absolute; inset: 0 0 auto; height: 20px; color: var(--muted-2); font-size: 12px; user-select: none; }
.month-label { position: absolute; white-space: nowrap; }

.calendar-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, var(--cell-size));
    grid-template-columns: repeat(var(--calendar-weeks, 53), minmax(var(--cell-size), 1fr));
    gap: var(--calendar-gap);
    width: 100%;
}

.day-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    padding: 0;
    border-radius: 4px;
    background: var(--cell);
    border: 1px solid transparent;
}

button.day-cell { cursor: pointer; background: var(--blue); transition: transform .14s ease, box-shadow .14s ease; }
button.day-cell:hover,
button.day-cell:focus-visible { transform: translateY(-1px) scale(1.14); box-shadow: 0 0 0 3px rgba(47,128,237,.15); outline: 0; }
button.day-cell[data-multiple="true"] { background: var(--blue-strong); }

.calendar-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.legend-cell { width: 13px; height: 13px; border-radius: 4px; background: var(--cell); }
.legend-cell.confirmed { background: var(--blue); }
.scroll-hint { color: var(--muted-2); font-size: 11px; }

.recent-section { display: none; }

.methodology { margin-top: 20px; border-top: 1px solid var(--line); }
.methodology > summary { padding-inline: 2px; }
.methodology-body { padding: 2px 2px 8px; }
.method-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.method-grid .data-source-card { grid-column: 1 / -1; }
.method-grid section { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.method-grid h3 { margin: 0; font-size: 14px; }
.method-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.faq-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.faq-list details + details { border-top: 1px solid var(--line); }
.faq-list summary { padding: 13px 15px; color: #344054; font-size: 13px; font-weight: 650; cursor: pointer; }
.faq-list p { margin: 0; padding: 0 15px 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.site-footer { padding: 22px 18px 0; text-align: center; color: var(--muted-2); font-size: 12px; line-height: 1.65; }
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: 6px; }

.popover {
    position: fixed;
    z-index: 100;
    width: min(360px, calc(100vw - 24px));
    padding: 18px;
    border-radius: 16px;
    background: #182230;
    color: #fff;
    box-shadow: 0 18px 48px rgba(16,24,40,.28);
}

.popover[hidden] { display: none; }
.popover-close { position: absolute; inset: 9px 10px auto auto; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #aab4c4; font-size: 22px; cursor: pointer; }
.popover-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.popover-date { display: block; padding-inline-end: 32px; font-size: 14px; }
.popover-event { margin-top: 13px; }
.popover-event + .popover-event { padding-top: 13px; border-top: 1px solid rgba(255,255,255,.12); }
.popover-status { color: #dce7f8; font-size: 12px; font-weight: 700; }
.popover-note, .popover-scope { margin-top: 7px; color: #c7d0dc; font-size: 12px; line-height: 1.55; }
.popover-source { display: inline-block; margin-top: 10px; color: #8ec1ff; font-size: 12px; font-weight: 650; text-decoration: none; }
.popover-source:hover { text-decoration: underline; }
.popover-time-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); color: #8f9aaa; font-size: 11px; line-height: 1.5; }

.toast {
    position: fixed;
    z-index: 200;
    inset: auto 18px 18px auto;
    padding: 11px 14px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    box-shadow: 0 12px 30px rgba(16,24,40,.2);
    font-size: 13px;
}

.toast[hidden] { display: none; }
.noscript { margin: 16px; padding: 14px; background: #fff1e8; color: #7a2e0e; border-radius: 12px; }

@media (max-width: 900px) {
    .hero-main { padding: 42px; }
    .settings { gap: 8px; }
    .compact-control > span:first-child { display: none; }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 20px, 560px); padding: 18px 0 34px; }
    .topbar { gap: 10px; margin-bottom: 14px; }
    .brand { gap: 8px; }
    .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
    .brand-text { font-size: 16px; }
    .brand-text small { display: none; }
    .settings { margin-inline-start: auto; }
    #languageSelect { width: 78px; }
    #timezoneSelect { width: 150px; }
    select { min-height: 38px; padding-block: 8px; font-size: 12px; }

    .hero { border-radius: 22px; }
    .hero-main { padding: 34px 24px 30px; }
    .eyebrow { font-size: 12px; line-height: 1.45; }
    .display-date { font-size: clamp(38px, 10.5vw, 48px); }
    .display-date.is-long { font-size: clamp(32px, 8.8vw, 40px); }
    .display-date.is-very-long { font-size: clamp(27px, 7.2vw, 34px); }
    .date-subline { font-size: 15px; }
    .history { padding: 26px 20px 20px; border-radius: 22px; }
    .history-head { flex-direction: column; margin-bottom: 20px; }
    .summary { width: 100%; justify-content: flex-start; gap: 18px; }
    .summary-item { min-width: 74px; text-align: start; }
    .calendar-scroll { margin-inline: -4px; }
    .calendar-footer { align-items: flex-start; }
    .scroll-hint { text-align: end; }

    .recent-section { display: block; margin-top: 24px; }
    .recent-section h3 { margin: 0 0 10px; font-size: 15px; }
    .recent-events { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
    .recent-event + .recent-event { border-top: 1px solid var(--line); }
    .recent-event summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; }
    .recent-event-date { color: #1d2939; font-size: 13px; font-weight: 700; }
    .recent-event-kind { color: var(--muted); font-size: 12px; text-align: end; }
    .recent-event-body { padding: 0 14px 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
    .recent-event-body p { margin: 0; }
    .recent-event-body p + p { margin-top: 7px; }
    .recent-event-body a { display: inline-block; margin-top: 9px; color: #236fc6; font-weight: 650; }

    .method-grid { grid-template-columns: 1fr; }
    .methodology > summary { padding-inline: 0; }
    .site-footer { padding-inline: 8px; }

    .popover { inset: auto 12px 12px !important; width: auto; max-height: min(70vh, 520px); overflow: auto; }
}

@media (max-width: 430px) {
    #languageSelect { width: 68px; }
    #timezoneSelect { width: 138px; }
    .settings { gap: 5px; }
    .select-wrap::after { inset-inline-end: 10px; }
    select { padding-inline: 9px 28px; }
}

@media (max-width: 360px) {
    .topbar { flex-wrap: wrap; }
    .settings {
        width: 100%;
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        margin-inline-start: 0;
    }
    .compact-control, .select-wrap { min-width: 0; }
    #languageSelect, #timezoneSelect { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
