*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #f9f9f7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding: 2rem 1rem;
    text-align: center;
    color: #1a1a1a;
}

#date {
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    color: #bbb;
    letter-spacing: 0.03em;
}

h1 {
    font-size: clamp(0.7rem, 1.8vw, 0.875rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #999;
}

#clock {
    font-size: clamp(3rem, 20vw, 10rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #1a1a1a;
}

/* ── Device clock warning ── */

#time-warning {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: #bf4040;
    max-width: 42ch;
    line-height: 1.5;
}

#time-warning:empty { display: none; }

/* ── Timezones ── */

#timezones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem 1rem;
    max-width: 560px;
    margin-top: 1.5rem;
}

#timezones button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: clamp(0.75rem, 1.8vw, 0.8rem);
    color: #ccc;
    padding: 0.25rem 0;
    transition: color 0.15s;
    line-height: 1.4;
}

#timezones button:hover {
    color: #888;
}

/* User's local timezone — always more visible */
#timezones button.tz-local {
    color: #555;
    font-weight: 500;
}

/* Selected timezone */
#timezones button.tz-selected {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Local + selected */
#timezones button.tz-local.tz-selected {
    color: #1a1a1a;
    font-weight: 600;
}

/* ── Map link (main page) ── */

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: clamp(0.875rem, 2.2vw, 1rem);
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
    margin-top: 0.5rem;
}

.map-link:hover { color: #222; }

/* ── Description (SEO) ── */

body > p.seo-description {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: #aaa;
    max-width: 42ch;
    margin-top: 1rem;
}

/* ── Accessibility / SEO ── */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Subpages (map, about) ── */

.subpage {
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    gap: 0;
}

/* ── Map page ── */

.map-page {
    height: 100vh;
    min-height: unset;
}

.map-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    min-height: 5.5rem;
}

.back-link {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(0.875rem, 2.2vw, 1rem);
    font-weight: 500;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.back-link:hover { color: #222; }

.back-link::before {
    content: '←';
    display: inline-block;
    transform: translateY(-2px);
    margin-right: 0.3em;
}

.map-page #clock {
    font-size: clamp(1.75rem, 5vw, 3rem);
}

.map-page #clock.clock-flash {
    animation: clockFlash 0.9s ease-out forwards;
    transition: none;
}

@keyframes clockFlash {
    0%, 25% { color: #5db389; }
    100%    { color: #1a1a1a; }
}

#tz-label {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    color: #aaa;
    margin-top: 0.15rem;
}

#map {
    flex: 1;
    min-height: 0;
}

.leaflet-container {
    background: #d0cfd4;
}

/* ── Site footer ── */

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 0.6rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-top: 1px solid #eee;
    font-size: 0.7rem;
    color: #999;
    pointer-events: none;
    z-index: 1001;
}

.site-footer a {
    pointer-events: auto;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.site-footer a:hover { color: #555; }

.site-footer a:not(:last-child)::after {
    content: '·';
    margin-left: 0.6rem;
    color: #ddd;
    pointer-events: none;
}

@media (max-width: 480px) {
    .site-footer {
        gap: 0.25rem 0.4rem;
    }
    .site-footer a:not(:last-child)::after {
        margin-left: 0.3rem;
    }
}

.map-page .site-footer {
    position: static;
    background: #f9f9f7;
}

/* ── Content pages (utc, dst, privacy-policy) ── */

.privacy-main {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    line-height: 1.7;
    color: #444;
    text-align: left;
}

.privacy-main h1 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.25rem; color: #1a1a1a; }
.privacy-main .updated { font-size: 0.8rem; color: #aaa; margin-bottom: 2rem; }
.privacy-main h2 { font-size: 1rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.4rem; color: #1a1a1a; }
.privacy-main h3 { font-size: 0.9rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.3rem; color: #333; }
.privacy-main p, .privacy-main ul { font-size: 0.9rem; margin-bottom: 0.75rem; }
.privacy-main ul { padding-left: 1.4rem; }
.privacy-main a { color: #555; }
.privacy-main a:hover { color: #1a1a1a; }
.privacy-main table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 1rem; }
.privacy-main th { text-align: left; padding: 0.4rem 0.6rem; background: #f3f3f1; color: #555; font-weight: 600; border-bottom: 1px solid #e5e5e5; }
.privacy-main td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #f0f0ee; vertical-align: top; }

/* ── About page ── */

.about-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    gap: 1.25rem;
    text-align: center;
}

.about-main h1 {
    font-size: clamp(0.875rem, 2.5vw, 1.1rem);
}

.about-main p {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    color: #555;
    max-width: 36ch;
    line-height: 1.8;
}
