* {
    box-sizing: border-box;
}

/* Хуудасны үндсэн өнгө, font, зай авалтыг тохируулна. */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f2ea;
    color: #172033;
}

.site-header {
    position: relative;
    z-index: 10;
    min-height: 82px;
    border-bottom: 1px solid #dacaa8;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(0, 32, 96, 0.08);
}

.site-nav {
    display: flex;
    width: 100%;
    max-width: 1280px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 auto;
    padding: 14px 24px;
}

.site-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: #002060;
    text-decoration: none;
}

.site-logo {
    display: block;
    width: auto;
    max-width: 320px;
    height: 130px;
    object-fit: contain;
}

.site-menu,
.site-footer__links,
.site-footer__contact {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 14px;
}

.site-menu {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.site-footer__links,
.site-footer__contact {
    flex-wrap: wrap;
}

.site-menu a,
.site-footer a {
    color: #002060;
    font-weight: 700;
    text-decoration: none;
}

.site-footer__contact a {
    color: #5b6472;
    font-size: 14px;
}

.site-menu a {
    padding: 8px 10px;
    border-radius: 6px;
}

.site-menu a:hover,
.site-menu a[aria-current="page"] {
    background: #fff3d1;
    color: #001747;
    text-decoration: none;
}

.site-footer a:hover {
    color: #001747;
    text-decoration: underline;
}

.site-footer {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 22px 24px 28px;
    border-top: 1px solid #dacaa8;
    background: #ffffff;
    color: #5b6472;
}

.site-footer p {
    margin: 0;
    font-weight: 700;
}

/* Form болон үр дүнгийн panel-ийг дэлгэцийн голд байрлуулна. */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* MVC View дээр харагдах үндсэн цагаан хайрцаг. */
.panel {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #dacaa8;
    border-radius: 8px;
}

.daily-page {
    align-items: flex-start;
    justify-content: center;
    background: #f3efe5;
}

.calendar-panel {
    max-width: 960px;
    padding: 0;
    border: 0;
    background: transparent;
}

.home-page {
    align-items: flex-start;
}

.home-panel {
    max-width: 760px;
}

.profile-page {
    align-items: flex-start;
}

.profile-panel {
    max-width: 760px;
    display: grid;
    gap: 18px;
}

.premium-page {
    align-items: flex-start;
}

.static-page {
    display: block;
    min-height: auto;
    align-items: flex-start;
    justify-content: initial;
    padding: 28px 24px 40px;
}

.premium-panel {
    max-width: 760px;
    display: grid;
    gap: 18px;
}

.static-panel {
    max-width: 760px;
    margin: 0 auto;
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.simple-panel {
    display: grid;
    gap: 16px;
}

.simple-panel h1 {
    margin-bottom: 0;
}

.static-content {
    display: grid;
    gap: 12px;
}

.static-content h2,
.static-content h3 {
    margin: 8px 0 0;
}

.static-content ul,
.static-content ol {
    margin: 0;
    padding-left: 22px;
    line-height: 1.65;
}

.static-content a {
    color: #002060;
    font-weight: 700;
}

.static-content p {
    margin: 0;
    line-height: 1.65;
}

.static-details {
    margin-top: 18px;
}

.static-details a {
    color: #002060;
    font-weight: 700;
}

.home-zurhai {
    display: grid;
    gap: 18px;
}

.home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-topbar h1 {
    margin: 0;
}

.home-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.home-card,
.today-card,
.profile-card {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #ffffff;
}

.home-card h2,
.profile-card h2 {
    margin: 0;
}

.personal-services {
    display: grid;
    gap: 14px;
}

.personal-services > h2 {
    margin: 0;
}

.personal-services__login {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #fbf8f0;
}

.personal-services__login p {
    margin: 0;
    color: #5b6472;
    line-height: 1.5;
}

.personal-services__login-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.personal-services__login-actions .secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.personal-services__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.personal-service-card {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #ffffff;
}

.personal-service-card strong {
    color: #172033;
    font-size: 18px;
    line-height: 1.35;
}

.personal-service-card p {
    margin: 0;
    color: #5b6472;
    font-size: 14px;
    line-height: 1.5;
}

.personal-service-card__price {
    color: #5b6472;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.personal-service-card--link {
    min-height: 130px;
    color: #002060;
    text-decoration: none;
}

.personal-service-card--link span {
    align-self: end;
    font-weight: 700;
}

.personal-service-card--link:hover {
    border-color: #002060;
    background: #fbf8f0;
}

.personal-service-card__actions {
    display: grid;
    gap: 8px;
}

.personal-service-card__actions .google-link,
.personal-service-card__actions .secondary-link {
    min-height: 44px;
    padding: 10px;
    font-size: 14px;
}

.personal-service-card__actions .secondary-link {
    text-align: center;
}

.profile-calculator {
    gap: 10px;
}

.profile-edit-form {
    gap: 10px;
}

.birth-date-selector-field {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.birth-date-selector-title {
    font-weight: 700;
}

.birth-date-selectors {
    display: grid;
    grid-template-columns: 45fr 27.5fr 27.5fr;
    min-width: 0;
    gap: 10px;
}

.birth-date-selectors > div {
    min-width: 0;
}

.birth-date-selectors select {
    min-width: 0;
    max-width: 100%;
}

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

.profile-readonly-field {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #e4d8bf;
    border-radius: 6px;
    background: #fbf8f0;
}

.profile-readonly-field span {
    color: #6f7682;
    font-size: 13px;
    font-weight: 700;
}

.profile-readonly-field strong {
    color: #172033;
}

.premium-list {
    display: grid;
    gap: 10px;
}

.premium-product-list {
    display: grid;
    gap: 14px;
}

.premium-product-card {
    display: grid;
    grid-template-columns: auto 120px;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #ffffff;
}

.premium-product-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.premium-product-card p {
    margin: 0;
    color: #5b6472;
    font-weight: 700;
}

.premium-buy-form {
    display: block;
}

.premium-login-cta {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #fbf8f0;
}

.premium-login-cta p {
    margin: 0;
    color: #5b6472;
    line-height: 1.5;
}

.premium-login-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.premium-login-cta__actions .secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.compatibility-panel {
    max-width: 760px;
}

.compatibility-form {
    gap: 16px;
}

.compatibility-form fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 16px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #fbf8f0;
}

.compatibility-form legend {
    padding: 0 6px;
    color: #002060;
    font-weight: 800;
}

.compatibility-result {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dacaa8;
    border-radius: 8px;
    background: #ffffff;
}

.compatibility-result h2 {
    margin: 0;
}

.compatibility-result p {
    margin: 0;
    line-height: 1.6;
    white-space: pre-wrap;
}

.premium-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid #e4d8bf;
    border-radius: 8px;
    background: #fbf8f0;
}

.premium-item__content {
    min-width: 0;
}

.premium-item__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.premium-item__view {
    padding: 7px 10px;
    font-size: 13px;
}

.premium-item strong {
    display: block;
}

.premium-item p {
    margin: 6px 0 0;
    color: #6f7682;
    font-size: 14px;
}

.status-pill {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-pill.is-active {
    background: #fff4d8;
    color: #7a4f00;
}

.status-pill.is-inactive {
    background: #f4f0e7;
    color: #5b6472;
}

.field-help {
    margin: -4px 0 2px;
    color: #6f7682;
    font-size: 14px;
}

.result-card h2 + dl {
    margin-top: -4px;
}

.today-card__heading h2 {
    margin: 0 0 6px;
}

.today-card__heading p:last-child {
    margin: 0;
    color: #5b6472;
    font-weight: 700;
}

.haircut-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fff4d8;
    color: #7a4f00;
    font-size: 14px;
    font-weight: 700;
}

.primary-link,
.google-link,
.facebook-link {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    background: #002060;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.primary-link:hover {
    background: #001747;
}

.google-link {
    background: #ffffff;
    color: #172033;
    border: 1px solid #c9b98f;
}

.google-link:hover {
    background: #fbf8f0;
}

.facebook-link {
    background: #1877f2;
    color: #ffffff;
}

.facebook-link:hover {
    background: #1464cc;
}

.login-provider-links {
    display: grid;
    gap: 10px;
}

.disabled-link {
    cursor: not-allowed;
    opacity: 0.58;
    pointer-events: none;
}

.top-nav,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.top-nav a,
.top-nav span {
    padding: 8px 10px;
    border-radius: 6px;
    color: #002060;
    text-decoration: none;
    font-weight: 700;
}

.top-nav a {
    border: 1px solid #c9b98f;
}

.top-nav a:hover {
    background: #fff3d1;
}

.top-nav span {
    color: #7a4f00;
    background: #fff4d8;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-heading p {
    margin: -14px 0 0;
    color: #6f7682;
    font-size: 14px;
}

.secondary-link {
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 1px solid #c9b98f;
    border-radius: 6px;
    color: #002060;
    text-decoration: none;
    font-weight: 700;
}

.secondary-link:hover {
    background: #fff3d1;
}

.today-zurhai,
.calendar-section,
.calendar-day-card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #dacaa8;
    border-radius: 8px;
}

.today-zurhai {
    display: grid;
    gap: 18px;
    margin-bottom: 16px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #002060;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.today-date {
    margin: -12px 0 16px;
    color: #5b6472;
    font-weight: 700;
}

.today-facts,
.calendar-actions,
.calendar-legend,
.special-day-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.today-facts span,
.special-day-badges span {
    padding: 8px 10px;
    border-radius: 6px;
    background: #f8efd8;
    color: #002060;
    font-size: 14px;
    font-weight: 700;
}

.special-day-badges {
    margin-top: 10px;
}

.special-day-descriptions {
    margin-top: 24px;
}

.special-day-description h3 {
    margin: 0 0 10px;
    color: #002060;
    font-size: 21px;
}

.special-day-description h4 {
    margin: 18px 0 8px;
    font-size: 16px;
}

.special-day-description p,
.special-day-description ul {
    line-height: 1.6;
}

.special-day-description ul {
    margin: 0;
    padding-left: 22px;
}

.special-day-descriptions hr {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid #dacaa8;
}

.summary-list {
    margin-bottom: 18px;
}

.summary-list div,
.detail-list div {
    align-items: flex-start;
}

.summary-list dd,
.detail-list dd {
    line-height: 1.45;
}

.calendar-actions .primary-link,
.calendar-actions .secondary-link {
    flex: 1 1 180px;
}

.calendar-section {
    margin-bottom: 16px;
}

.calendar-section__heading,
.calendar-day-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.calendar-section__heading h2,
.calendar-day-card__heading h2 {
    margin: 0;
}

.calendar-section__heading h1 {
    margin: 0 0 4px;
}

.calendar-section__heading p {
    margin: 0;
    color: #5b6472;
    font-weight: 700;
}

.month-nav {
    display: flex;
    gap: 8px;
}

.month-nav a,
.month-nav span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #c9b98f;
    border-radius: 6px;
    color: #002060;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.month-nav span {
    color: #a99b80;
    background: #fbf8f0;
}

.month-nav a:hover {
    background: #fff3d1;
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-auto-flow: row;
    gap: 5px;
    width: 100%;
}

.calendar-weekday {
    display: block;
    min-width: 0;
    min-height: 32px;
    padding-bottom: 8px;
    color: #172033;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.calendar-cell {
    position: relative;
    display: flex !important;
    min-width: 0;
    min-height: 72px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 8px;
    border: 1px solid #ded2b8;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    text-decoration: none;
}

.calendar-special-day-codes {
    display: flex;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 3px;
    margin-top: 6px;
    white-space: nowrap;
}

.special-day-code {
    display: inline-flex;
    min-width: 20px;
    min-height: 18px;
    align-items: center;
    justify-content: center;
    padding: 3px 5px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    text-align: center;
}

.special-day-code--dashnyam {
    border-color: #86aa8b;
    background: #e7f2e9;
    color: #285f32;
}

.special-day-code--baljinyam {
    border-color: #84a8ca;
    background: #e7f0f8;
    color: #285b87;
}

.special-day-code--combined {
    border-color: #568e5e;
    background: #cfe8d3;
    color: #174f22;
    box-shadow: inset 0 0 0 1px rgba(86, 142, 94, 0.12);
}

.special-day-code--modon-homhoi {
    border-color: #ad9277;
    background: #f0e7dc;
    color: #6c4b31;
}

.special-day-code--tersuud {
    border-color: #b9635e;
    background: #f3d9d7;
    color: #842d28;
    box-shadow: inset 0 0 0 1px rgba(185, 99, 94, 0.1);
}

.special-day-code--haircut {
    border-color: #91a8b8;
    background: #eaf0f4;
    color: #425f73;
}

.calendar-cell:hover {
    border-color: #9bafbd;
    background: #f8fbfc;
}

.calendar-cell--blank {
    border-color: transparent;
    background: transparent;
}

.calendar-cell.is-empty {
    color: #a99b80;
    background: #fffdf8;
}

.calendar-cell.is-selected {
    border-color: #91a7b6;
    background: #edf3f6;
    color: #172033;
    box-shadow: inset 0 0 0 1px #c2d0d9;
}

.calendar-cell.is-today {
    border-color: #526f83;
    box-shadow: inset 0 0 0 2px #7890a1;
}

.calendar-day-number {
    display: block;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.compact-list {
    margin-bottom: 0;
}

.calendar-legend {
    align-items: center;
    margin-top: 14px;
    gap: 7px 10px;
}

.calendar-legend span {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    padding: 5px 8px;
    border: 1px solid #ded8ca;
    border-radius: 5px;
    background: #fcfbf7;
    color: #4b5662;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.calendar-legend b {
    margin-right: 4px;
}

.calendar-legend .special-day-code {
    vertical-align: middle;
}

.wide-row {
    display: block;
}

.wide-row dd {
    margin-top: 8px;
    text-align: left;
    line-height: 1.55;
}

h1 {
    margin: 0 0 24px;
    font-size: 28px;
}

/* Form-ийн input, select, button-уудыг нэг баганад жигд байрлуулна. */
form {
    display: grid;
    gap: 12px;
}

label {
    font-weight: 700;
}

input,
select,
button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
}

input,
select {
    border: 1px solid #c9b98f;
    background: #ffffff;
}

button {
    border: 0;
    background: #002060;
    color: #ffffff;
    cursor: pointer;
}

button:hover {
    background: #001747;
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

/* Баталгаажуулалт болон өдрийн мэдээлэл олдоогүй үед харуулах мессежийн загвар. */
.message {
    margin: 18px 0 0;
    padding: 12px;
    border-radius: 6px;
}

.message p {
    margin: 0;
}

.message p + p {
    margin-top: 6px;
}

.error {
    background: #fde8df;
    color: #8a1f1f;
}

.success {
    background: #fff4d8;
    color: #7a4f00;
}

/* Тооцооллын үр дүнгийн хэсгийн зай авалт. */
.result {
    margin-top: 24px;
}

h2 {
    margin: 24px 0 12px;
    font-size: 20px;
}

dl {
    margin: 0;
    display: grid;
    gap: 10px;
}

/* Нэр болон утгыг хоёр талд нь зэрэгцүүлж харуулна. */
dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4d8bf;
}

dt {
    font-weight: 700;
}

dd {
    margin: 0;
    text-align: right;
}

@media (max-width: 768px) {
    .birth-date-selectors {
        grid-template-columns: 1fr;
    }

    .personal-services__grid {
        grid-template-columns: 1fr;
    }

    .personal-services__login-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .premium-login-cta__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .page {
        padding: 16px;
    }

    .page-heading,
    .today-zurhai,
    .home-topbar,
    .home-user-actions,
    .premium-product-card,
    .premium-item,
    .calendar-section__heading,
    .calendar-day-card__heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .premium-item__actions {
        justify-content: flex-start;
    }

    .site-nav {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    .site-logo {
        max-width: 230px;
        height: 52px;
    }

    .static-page {
        padding: 16px;
    }

    .static-panel {
        padding: 20px;
    }

    .site-menu,
    .site-footer__links,
    .site-footer__contact {
        width: 100%;
    }

    .site-menu {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .site-menu a {
        display: flex;
        min-height: 40px;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        padding: 9px 8px;
        border: 1px solid #dacaa8;
        text-align: center;
    }

    .today-zurhai,
    .calendar-section,
    .calendar-day-card {
        padding: 16px;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-weekday {
        min-height: 30px;
        padding-bottom: 8px;
        color: #172033;
        font-size: 15px;
        font-weight: 700;
        text-align: center;
        line-height: 1.15;
    }

    .calendar-cell {
        min-height: 54px;
        padding: 5px 4px;
        border-radius: 6px;
    }

    .calendar-day-number {
        font-size: 16px;
    }

    .calendar-special-day-codes {
        width: 100%;
        margin-top: 4px;
        gap: 2px;
    }

    .calendar-special-day-codes .special-day-code {
        min-width: 0;
        min-height: 15px;
        flex: 1 1 0;
        padding: 2px 1px;
        font-size: 10px;
    }

    .calendar-legend span {
        font-size: 12px;
    }

    dl div {
        display: grid;
        gap: 6px;
    }

    dd {
        text-align: left;
    }
}
