
html {
    scrollbar-gutter: stable;
}

:root {
    --background: #f4f5f0;
    --card: #ffffff;
    --text: #17221f;
    --muted: #727d78;
    --accent: #245d4a;
    --line: #e6e9e3;

    --header: #182945;
    --header-control: #2b3f60;
    --header-border: #526a8d;
    --header-text: #ffffff;
    --header-muted: #b9c8df;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.app {
    width: 100%;
    max-width: 700px;
}

/* Top navigation */

.top-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    background: var(--header);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 10px 30px rgba(24, 41, 69, 0.12);
}

.logo {
    flex-shrink: 0;
    color: var(--header-text);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo:hover {
    color: #dce8ff;
}

/* Calendar selector */

.calendar-selector {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 230px;
    min-width: 0;
}

.calendar-selector-label {
    color: var(--header-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.2;
}

.calendar-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    background: var(--header-control);
    border: 1px solid var(--header-border);
    border-radius: 11px;
    transition: background 0.2s, border-color 0.2s;
}

.calendar-select-wrap:hover,
.calendar-select-wrap:focus-within {
    background: #344d72;
    border-color: #8ba8d2;
}

.calendar-select-icon {
    flex-shrink: 0;
    margin-right: 9px;
    font-size: 17px;
    line-height: 1;
}

.calendar-select {
    width: 100%;
    min-width: 0;
    padding: 11px 20px 11px 0;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: transparent;
    color: var(--header-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.calendar-select option {
    background: #ffffff;
    color: #182945;
    font-size: 14px;
}

.calendar-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    color: #d6e2f4;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-55%);
}

/* Date card */

.date-card {
    padding: 55px 30px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(35, 59, 43, 0.04);
}

.date-label {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.day-number {
    margin: 0;
    font-size: clamp(110px, 24vw, 190px);
    line-height: 0.9;
    font-weight: 600;
    letter-spacing: -10px;
    font-variant-numeric: lining-nums;
}

.month-year {
    margin: 22px 0 0;
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 500;
    letter-spacing: -1px;
}

.weekday {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
}

/* Date and time divider */

.date-divider {
    height: 1px;
    margin: 35px 0 28px;
    background: var(--line);
}

/* Clock */

.time-label {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.time {
    font-size: clamp(36px, 8vw, 52px);
    font-weight: 500;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
}

.timezone {
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

/* Calendar description */

.description-card {
    margin-top: 0;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(35, 59, 43, 0.04);
}

.description-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 60px;
    padding: 20px 22px;
    margin: 0;
    border: none;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
	background-color: #d2d2d2;
}

.description-toggle:hover {
    background: var(--card);
	background-color: #d2d2d2;
}

.description-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
}

.description-arrow {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    font-size: 18px;
    line-height: 18px;
    text-align: center;
    transform: rotate(0deg);
}

.description-toggle[aria-expanded="true"] .description-arrow {
    transform: rotate(180deg);
}

.description-content {
    padding: 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.description-content[hidden] {
    display: none;
}

/* Responsive layout */

@media (max-width: 480px) {
    body {
        padding: 14px;
        align-items: flex-start;
    }

    .app {
        margin-top: 12px;
    }

    .top-panel {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        padding: 18px;
        border-radius: 16px;
    }

    .logo {
        font-size: 21px;
    }

    .calendar-selector {
        width: 100%;
    }

    .date-card {
        padding: 42px 18px;
        border-radius: 0;
    }

    .day-number {
        letter-spacing: -6px;
    }

    .month-year {
        line-height: 1.2;
    }

    .description-toggle {
        padding: 18px;
        font-size: 14px;
    }

    .description-content {
        padding: 0 18px 18px;
    }
}










/* Calendar Converter */

.converter-card {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
}

.converter-heading {
    margin-bottom: 28px;
}

.converter-heading h1 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 600;
}

.converter-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.converter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.converter-field label,
.date-input-group legend {
    font-size: 14px;
    font-weight: 500;
}

.converter-field input,
.converter-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #c5cbc5;
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font: inherit;
}

.date-input-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.date-input-group legend {
    display: none;
}

.date-inputs {
    display: grid;
    grid-template-columns: 0.8fr 1.5fr 1.2fr;
    gap: 12px;
    width: 100%;
}

.date-inputs select,
.date-inputs input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #c5cbc5;
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
}

.date-inputs select {
    cursor: pointer;
}

.date-inputs select:focus,
.date-inputs input:focus,
.converter-field select:focus,
.converter-field input:focus {
    outline: none;
    border-color: #c5cbc5;
}


/* Month navigation */

.month-spinner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    min-height: 52px;
    padding: 6px 8px;
    border: 1px solid #c5cbc5;
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
}

.month-spinner span {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.month-spinner button {
    flex-shrink: 0;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.month-spinner button:hover {
    color: var(--accent);
}

.month-spinner button:focus {
    outline: none;
}


.converter-button {
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.converter-button:hover {
    opacity: 0.92;
}

.converter-result[hidden],
.converter-message[hidden] {
    display: none;
}

.converter-result {
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.converter-result-label {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.converter-result-date {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.converter-result-details {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.converter-message {
    margin-top: 22px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    line-height: 1.5;
}

.converter-error {
    color: var(--text);
}

.converter-back {
    display: inline-block;
    margin-top: 24px;
    color: var(--accent);
    text-decoration: none;
}

.converter-back:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .converter-card {
        margin: 16px auto;
        padding: 22px 16px;
        border-radius: 0;
    }

    .date-input-group {
        padding: 12px;
    }

    .date-inputs {
        gap: 8px;
    }

    .converter-heading h1 {
        font-size: 23px;
    }

    .converter-result-date {
        font-size: 22px;
    }
}
