/* Text scale only; keep the root rem and existing layout breakpoints. */
:root {
    --zt-copy: 1rem;
    --zt-meta: .8125rem;
    --zt-label: .875rem;
    --zt-control: 1rem;
    --zt-action: .875rem;
    --zt-card: 1.125rem;
    --zt-section: 1.5rem;
    --zt-page: 1.75rem;
}

@media (min-width: 768px) {
    :root {
        --zt-copy: 1.0625rem;
        --zt-meta: .875rem;
        --zt-label: .9375rem;
        --zt-control: 1.0625rem;
        --zt-action: .9375rem;
        --zt-card: 1.1875rem;
        --zt-section: 1.625rem;
        --zt-page: 2rem;
    }
}

@media (min-width: 1280px) {
    :root {
        --zt-copy: 1.125rem;
        --zt-meta: .9375rem;
        --zt-label: 1rem;
        --zt-control: 1.125rem;
        --zt-action: 1rem;
        --zt-card: 1.25rem;
        --zt-section: 1.875rem;
        --zt-page: 2.25rem;
    }
}
/* Common public pages, dialogs, forms, and account/administration screens. */
html body {
    font-size: var(--zt-copy);
}

    html body :is(main, section, article, footer, form, dialog, [role="dialog"], .modal, .user-content) p {
        font-size: var(--zt-copy);
        overflow-wrap: anywhere;
    }

    html body :is(main, section, article, footer, form, dialog, .modal) :is(small, figcaption, time, .form-text, .field-error, .validation-summary-errors) {
        font-size: var(--zt-meta);
    }

    html body :is(main, section, article, footer, form, dialog, .modal) label {
        font-size: var(--zt-label);
    }

    html body :is(input:not([type]), input:is([type="text"],[type="tel"],[type="email"],[type="password"],[type="search"],[type="number"],[type="url"],[type="date"],[type="datetime-local"]), select, textarea) {
        font-size: var(--zt-control);
        min-inline-size: 0;
        max-inline-size: 100%;
    }

    html body :is(button, [type="submit"], .btn, .gold-btn, .ghost-btn, .panel-link, .hero-btn, .why-btn, .service-link, .works-view-all, .works-project-link, .magazine-read-more, .final-cta__button, .hero-banner__button):not(:is(.top-icon, .mobile-menu, .auth-password-toggle, .modal__close)) {
        font-size: var(--zt-action);
    }

    html body :is(.footer__nav, .footer__contact-info) a {
        font-size: var(--zt-label);
    }

    html body :is(.footer__heading, .panel-heading h2, .auth-feature h3) {
        font-size: var(--zt-card);
    }

    html body :is(.page-heading h1, .auth-card__head h1, .auth-card__head h2) {
        font-size: max(var(--zt-page), clamp(1.875rem, 4vw, 3rem));
    }

    html body :is(.services-heading, .works-heading, .magazine-heading, .service-categories-heading, .why-content, .section-heading, .ds-section-heading) h2 {
        font-size: max(var(--zt-section), clamp(1.5rem, 3vw, 2rem));
    }

    html body :is(.service-card, .works-card, .magazine-card, .product-card, .about-service-card, .owned-product, .favorite-card, .notification-page-card) h3 {
        font-size: var(--zt-card);
    }

    html body :is(.hero-eyebrow, .section-eyebrow, .auth-eyebrow, .topbar-eyebrow, .magazine-category, .works-category, .service-category-link) {
        font-size: var(--zt-meta);
    }
    /* Keep narrow account cards and drawer navigation usable with larger labels. */
    html body[data-zhiura-panel="user"] :is(.user-nav__item span, .logout-link, .profile-mini strong, .top-profile strong, .order-main strong, .full-ticket strong, .sidebar-help strong) {
        font-size: var(--zt-label);
        overflow-wrap: anywhere;
    }

    html body[data-zhiura-panel="user"] :is(.profile-mini span, .top-profile small, .sidebar-help span, .nav-caption, .order-date, .order-status, .ticket-status, .active-pill, .product-topline > span, .user-footer span, .profile-meta span, .profile-field-error) {
        font-size: var(--zt-meta);
    }

    html body[data-zhiura-panel="user"] :is(.stat-card > span, .stat-card p, .user-panel p, .welcome-card__content p, .full-ticket__body p, .ticket-message p) {
        font-size: var(--zt-copy);
        line-height: 1.65;
    }

    html body[data-zhiura-panel="user"] :is(.user-nav__item, .logout-link, .gold-btn, .ghost-btn, .panel-link, .order-row) {
        height: auto;
        min-height: 42px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    html body[data-zhiura-panel="user"] .user-nav__item > b {
        font-size: var(--zt-meta);
        min-height: 22px;
        height: auto;
    }

    html body[data-zhiura-panel="user"] :is(.welcome-actions, .user-home-actions) {
        flex-wrap: wrap;
    }

    html body[data-zhiura-panel="user"] :is(.user-panel, .stat-card, .profile-form, .order-main, .top-profile, .user-nav__item span) {
        min-width: 0;
    }

    html body[data-zhiura-panel="admin"] :is(th, td, .form-label, .field-label) {
        font-size: var(--zt-label);
    }

    html body .auth-card :is(.auth-intro, .auth-links, .field-label) {
        font-size: var(--zt-copy);
    }

    html body .auth-card :is(.auth-help, .security-note, .auth-feature p) {
        font-size: var(--zt-meta);
    }

    html body .auth-card .otp-input {
        font-size: max(1.25rem, var(--zt-control));
    }

@media (max-width: 767px) {
    html body :is(.final-cta__button, .final-cta__submit, .hero-banner__button, .footer__subscribe button, .auth-main-button) {
        height: auto;
        min-height: 44px;
        white-space: normal;
    }

    html body .auth-card .auth-links {
        flex-wrap: wrap;
    }

    html body[data-zhiura-panel="user"] :is(.order-row, .panel-heading, .page-heading) {
        flex-wrap: wrap;
    }
}

/* Let short controls size to their label; wrap the row of controls first. */
html body :is(.auth-links, .welcome-actions, .user-home-actions, .final-cta__buttons) {
    flex-wrap: wrap;
    min-inline-size: 0;
}

    html body :is(.auth-links, .welcome-actions, .user-home-actions, .final-cta__buttons) > :is(button, a) {
        box-sizing: border-box;
        flex: 0 0 auto;
        inline-size: max-content;
        max-inline-size: 100%;
        min-inline-size: 0;
        white-space: nowrap;
        overflow-wrap: normal;
    }

html body :is(.auth-main-button, .hero-banner__button, .gold-btn, .ghost-btn, .panel-link, .final-cta__submit) {
    min-block-size: 44px;
    max-inline-size: 100%;
    block-size: auto;
    white-space: nowrap;
    overflow-wrap: normal;
}

html body[data-zhiura-panel="user"] :is(.order-status, .ticket-status, .active-pill, .nav-badge, .order-price) {
    flex-shrink: 0;
    inline-size: max-content;
    white-space: nowrap;
}

html body[data-zhiura-panel="user"] .user-nav__item span {
    white-space: nowrap;
    overflow-wrap: normal;
}

html body[data-zhiura-panel="user"] .user-nav__item > :is(i, b) {
    flex-shrink: 0;
}

@media (max-width: 950px) {
    html body[data-zhiura-panel="user"] .user-sidebar {
        width: min(320px, calc(100vw - 16px));
    }
}

@media (max-width: 767px) {
    html body main > .final-cta .final-cta__buttons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    }

        html body main > .final-cta .final-cta__buttons > .final-cta__button {
            width: 100%;
            min-width: 0;
            min-height: 46px;
        }
}
/* Extreme narrow widths and zoom: use a second line rather than clip text. */
@media (max-width: 23rem) {
    html body :is(.auth-links, .welcome-actions, .user-home-actions, .final-cta__buttons) > :is(button, a),
    html body :is(.auth-main-button, .hero-banner__button, .gold-btn, .ghost-btn, .panel-link, .final-cta__submit),
    html body[data-zhiura-panel="user"] .user-nav__item span {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Registration feature row: give desktop labels room at their current size. */
@media (min-width: 1029px) {
    html body .auth-page .auth-shell {
        width: min(100%, 640px);
    }

    html body .auth-card .auth-features {
        grid-template-columns: repeat(3, minmax(max-content, 1fr));
    }

    html body .auth-card .auth-feature h3 {
        white-space: nowrap;
    }
}

/* Keep both account footer labels together above the mobile navigation. */
html body[data-zhiura-panel="user"] > .user-footer {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2vw, 16px);
    padding-inline: 8px;
    text-align: center;
}

    html body[data-zhiura-panel="user"] > .user-footer > span {
        white-space: nowrap;
    }

        html body[data-zhiura-panel="user"] > .user-footer > span:first-child {
            direction: ltr;
        }

/* Keep the return link and slogan in the normal flow, below the form. */
html body .auth-page .back-home {
    font-size: var(--zt-control);
    font-weight: 600;
    line-height: 1.6;
    min-height: 44px;
    margin-block: 4px 8px;
    color: rgba(255, 255, 255, .9);
}

    html body .auth-page .back-home i {
        font-size: 1.125em;
    }

html body .auth-page .auth-footer {
    position: relative;
    inset: auto;
    align-items: center;
    margin: 0 0 16px;
    text-align: center;
    font-size: var(--zt-label);
    line-height: 1.6;
    color: rgba(255, 255, 255, .84);
}

    html body .auth-page .auth-footer b {
        font-size: var(--zt-meta);
    }

/* Panel widths and main content offsets share the same desktop variable. */
@media (min-width: 951px) {
    html body[data-zhiura-panel="user"] {
        --sidebar-width: clamp(255px, 21vw, 290px);
    }
}

@media (min-width: 901px) {
    html body[data-zhiura-panel="admin"] {
        --sw: clamp(255px, 22vw, 300px);
    }
}

@media (max-width: 900px) {
    html body[data-zhiura-panel="admin"] .sidebar {
        width: min(300px, calc(100vw - 16px));
    }
}

html body[data-zhiura-panel="admin"] .sidebar nav :is(a, button) {
    overflow-wrap: normal;
    word-break: normal;
}

    html body[data-zhiura-panel="admin"] .sidebar nav :is(a, button) > i {
        flex-shrink: 0;
    }

/* Home production cards: let the box grow when a description takes two lines. */
html body main > .content-process :is(.process-card, .content-card) {
    box-sizing: border-box;
    height: auto;
}

    html body main > .content-process :is(.process-card, .content-card) p {
        font-size: clamp(.8125rem, calc(.75rem + .24vw), .9375rem);
        line-height: 1.55;
        overflow-wrap: break-word;
    }

html body main > .content-process .content-card-text {
    min-width: 0;
}

@media (min-width: 1024px) {
    html body main > .content-process .process-card {
        width: clamp(142px, 13.1vw, 184px);
        min-height: 68px;
        padding: 9px 10px;
        gap: 3px;
    }

    html body main > .content-process .process-column-left {
        left: min(9cap, calc(38.5% - 248px));
        transform: translateX(calc(150px - clamp(142px, 13.1vw, 184px)));
    }

    html body main > .content-process .process-column {
        gap: 34px;
    }

    html body main > .content-process .process-column-right {
        gap: 64px;
    }

    html body main > .content-process .content-cards {
        position: relative;
        inset: auto;
        margin-inline-start: -35px;
        padding-block-start: 40px;
    }

    html body main > .content-process .content-card {
        min-height: 60px;
        padding: 9px 12px;
        gap: 10px;
    }
}

/* Home CTA: flow-based columns keep the form and text inside the background. */
html body main > .final-cta .final-cta__description {
    font-size: clamp(.875rem, calc(.81rem + .16vw), 1rem);
    line-height: 1.65;
    overflow-wrap: break-word;
}

    html body main > .final-cta .final-cta__description br {
        display: none;
    }

html body main > .final-cta .final-cta__buttons {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 8px;
}

    html body main > .final-cta .final-cta__buttons > .final-cta__button {
        box-sizing: border-box;
        width: 100% !important;
        min-height: 44px;
        height: auto;
        margin: 0;
        padding: 6px 8px;
        font-size: clamp(.8125rem, calc(.75rem + .18vw), .9375rem);
        line-height: 1.45;
        text-align: center;
        white-space: normal;
        overflow-wrap: break-word;
    }

        html body main > .final-cta .final-cta__buttons > .final-cta__button > i {
            flex-shrink: 0;
        }

html body main > .final-cta .final-cta__submit {
    padding-block: 8px;
    font-size: .9375rem;
    line-height: 1.5;
}

@media (min-width: 1024px) {
    html body main > .final-cta .final-cta__container {
        box-sizing: border-box;
        display: grid;
        grid-template-columns: clamp(190px, 19vw, 250px) minmax(0, 1fr) minmax(0, 36%);
        grid-template-rows: auto auto 1fr;
        align-content: center;
        gap: 12px 18px;
        min-height: 340px;
        height: auto;
        padding: 20px clamp(16px, 2vw, 26px);
    }

    html body main > .final-cta .final-cta__content {
        display: contents;
    }

    html body main > .final-cta :is(.final-cta__title, .final-cta__buttons, .final-cta__description, .final-cta__form) {
        position: relative;
        inset: auto;
        width: 100%;
        min-width: 0;
        margin: 0;
        z-index: 3;
    }

    html body main > .final-cta .final-cta__title {
        grid-area: 1 / 1 / 2 / 3;
    }

    html body main > .final-cta .final-cta__buttons {
        grid-area: 2 / 2;
        align-self: end;
    }

    html body main > .final-cta .final-cta__description {
        grid-area: 3 / 2;
        text-align: start;
    }

    html body main > .final-cta .final-cta__form {
        grid-area: 2 / 1 / 4 / 2;
        align-self: start;
        z-index: 4;
    }

    html body main > .final-cta .final-cta__overlay {
        background: linear-gradient(to left, rgba(2, 29, 27, .64), rgba(2, 29, 27, .45) 54%, transparent 76%);
    }

    html body main > .final-cta .final-cta__field :is(input, .final-cta__dropdown-trigger) {
        font-size: .875rem;
    }
}

@media (max-width: 1023px) {
    html body main > .final-cta .final-cta__buttons {
        max-width: 400px;
    }
}

/* Newsletter: allocate separate space for the text and the send button. */
html body footer.footer .footer__subscribe {
    box-sizing: border-box;
    width: min(100%, 350px);
    min-height: 44px;
    height: auto;
    gap: 4px;
    padding: 4px;
}

    html body footer.footer .footer__subscribe input {
        box-sizing: border-box;
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        height: auto;
        padding: 6px 4px;
        font-size: clamp(.8125rem, calc(.75rem + .2vw), .9375rem);
        line-height: 1.5;
    }

    html body footer.footer .footer__subscribe button {
        position: static;
        flex: 0 0 32px;
        width: 32px;
        min-height: 36px;
        height: 36px;
        transform: none;
    }

        html body footer.footer .footer__subscribe button:is(:hover, :active) {
            transform: none;
        }
