.homecms-v2-page {
    --homecms-green: #173f31;
    --homecms-green-2: #245a45;
    --homecms-gold: #c7993c;
    --homecms-cream: #f7f2e7;
    --homecms-ink: #16241e;
    --homecms-muted: #68756e;
    --homecms-border: rgba(24, 68, 50, 0.12);
    --homecms-shadow: 0 18px 50px rgba(18, 48, 37, 0.09);

    width: 100%;
    min-width: 0;
    padding: 22px;
    color: var(--homecms-ink);
    font-family: Cairo, sans-serif;
    box-sizing: border-box;
}

.homecms-v2-page *,
.homecms-v2-page *::before,
.homecms-v2-page *::after {
    box-sizing: border-box;
}

.homecms-v2-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    overflow: hidden;
    padding: 28px 30px;
    margin-bottom: 18px;
    color: #fff;
    background:
        radial-gradient(circle at 8% 15%, rgba(208, 169, 83, 0.24), transparent 24%),
        linear-gradient(135deg, #102f25 0%, #1d4d3a 58%, #276047 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    box-shadow: 0 22px 60px rgba(12, 42, 31, 0.18);
}

.homecms-v2-toolbar::after {
    content: "";
    position: absolute;
    inset-inline-end: -60px;
    bottom: -100px;
    width: 250px;
    height: 250px;
    border: 42px solid rgba(255, 255, 255, 0.035);
    border-radius: 50%;
    pointer-events: none;
}

.homecms-v2-heading {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.homecms-v2-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #e0bd70;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.8px;
}

.homecms-v2-heading h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 900;
    line-height: 1.25;
}

.homecms-v2-connection {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 700;
}

.homecms-v2-connection > span {
    width: 8px;
    height: 8px;
    background: #6ee7a5;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(110, 231, 165, 0.1);
}

.homecms-v2-connection small {
    color: rgba(255, 255, 255, 0.55);
}

.homecms-v2-toolbar-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.homecms-v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 13px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.homecms-v2-btn:hover {
    transform: translateY(-2px);
}

.homecms-v2-btn.primary {
    color: #183426;
    background: #e5bf6d;
    border: 1px solid #e5bf6d;
}

.homecms-v2-btn.secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.homecms-v2-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.homecms-v2-stat {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 17px 19px;
    background: #fff;
    border: 1px solid var(--homecms-border);
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(23, 63, 49, 0.05);
}

.homecms-v2-stat::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--stat-accent, var(--homecms-green));
}

.homecms-v2-stat.visible {
    --stat-accent: #299660;
}

.homecms-v2-stat.hidden {
    --stat-accent: #9aa39e;
}

.homecms-v2-stat.items {
    --stat-accent: #ba8730;
}

.homecms-v2-stat.warning {
    --stat-accent: #cf694f;
}

.homecms-v2-stat span {
    display: block;
    overflow: hidden;
    color: var(--homecms-muted);
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.homecms-v2-stat strong {
    display: block;
    margin-top: 2px;
    color: var(--homecms-ink);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
}

.homecms-v2-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.homecms-v2-card {
    --card-accent: #416d5c;

    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 280px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(251, 249, 244, 0.99));
    border: 1px solid var(--homecms-border);
    border-radius: 22px;
    box-shadow: var(--homecms-shadow);
    transition:
        transform 170ms ease,
        box-shadow 170ms ease,
        border-color 170ms ease;
}

.homecms-v2-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--card-accent) 38%, transparent);
    box-shadow: 0 24px 55px rgba(18, 48, 37, 0.13);
}

.homecms-v2-card-accent {
    height: 5px;
    background: var(--card-accent);
}

.homecms-v2-card.tone-hero {
    --card-accent: #b78630;
}

.homecms-v2-card.tone-teacher {
    --card-accent: #356b55;
}

.homecms-v2-card.tone-alerts {
    --card-accent: #d26b4e;
}

.homecms-v2-card.tone-features {
    --card-accent: #5373a9;
}

.homecms-v2-card.tone-honor {
    --card-accent: #c79b32;
}

.homecms-v2-card.tone-testimonials {
    --card-accent: #8c65a6;
}

.homecms-v2-card.tone-banners {
    --card-accent: #ad5d64;
}

.homecms-v2-card.tone-faq {
    --card-accent: #4c7f8d;
}

.homecms-v2-card.tone-contact {
    --card-accent: #267b62;
}

.homecms-v2-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px 0;
}

.homecms-v2-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: var(--card-accent);
    border-radius: 14px;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--card-accent) 25%, transparent);
}

.homecms-v2-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 27px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.homecms-v2-state::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.homecms-v2-state.visible {
    color: #17623d;
    background: #e8f7ef;
}

.homecms-v2-state.visible::before {
    background: #28a164;
}

.homecms-v2-state.hidden {
    color: #757d79;
    background: #eff1f0;
}

.homecms-v2-state.hidden::before {
    background: #939b97;
}

.homecms-v2-card-image {
    margin: 14px 18px 0;
    overflow: hidden;
    aspect-ratio: 16 / 6;
    background: var(--homecms-cream);
    border: 1px solid rgba(40, 67, 55, 0.09);
    border-radius: 14px;
}

.homecms-v2-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.homecms-v2-card-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 16px 18px;
}

.homecms-v2-card-content h2 {
    margin: 0 0 12px;
    color: var(--homecms-ink);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.35;
}

.homecms-v2-card-metrics {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.homecms-v2-card-metrics strong {
    color: var(--card-accent);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}

.homecms-v2-card-metrics span {
    color: var(--homecms-muted);
    font-size: 11px;
    font-weight: 800;
}

.homecms-v2-card-content p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #69756f;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.8;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.homecms-v2-card-content p.empty {
    color: #a06b55;
}

.homecms-v2-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 13px 18px 16px;
    border-top: 1px solid rgba(23, 63, 49, 0.08);
}

.homecms-v2-card-footer small {
    overflow: hidden;
    min-width: 0;
    color: #8a938f;
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.homecms-v2-card-footer a {
    flex: 0 0 auto;
    color: var(--homecms-green);
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.homecms-v2-card-footer a::after {
    content: " ←";
}

.homecms-v2-loading,
.homecms-v2-error,
.homecms-v2-access-denied,
.homecms-v2-section-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 280px;
    padding: 30px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--homecms-border);
    border-radius: 24px;
    box-shadow: var(--homecms-shadow);
}

.homecms-v2-loading {
    flex-direction: column;
}

.homecms-v2-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #e6ece9;
    border-top-color: var(--homecms-green);
    border-radius: 50%;
    animation: homecms-v2-spin 850ms linear infinite;
}

@keyframes homecms-v2-spin {
    to {
        transform: rotate(360deg);
    }
}

.homecms-v2-error {
    flex-wrap: wrap;
}

.homecms-v2-error-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #fff;
    background: #c95445;
    border-radius: 16px;
    font-size: 22px;
    font-weight: 900;
}

.homecms-v2-error h2,
.homecms-v2-error p {
    margin: 0;
}

.homecms-v2-error button,
.homecms-v2-access-denied a {
    padding: 10px 17px;
    color: #fff;
    background: var(--homecms-green);
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.homecms-v2-access-denied {
    flex-direction: column;
}

.homecms-v2-section-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--homecms-border);
    border-radius: 22px;
    box-shadow: var(--homecms-shadow);
}

.homecms-v2-section-head > div {
    flex: 1 1 auto;
    min-width: 0;
}

.homecms-v2-section-head span:not(.homecms-v2-state) {
    color: var(--homecms-gold);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
}

.homecms-v2-section-head h1 {
    margin: 2px 0 0;
    font-size: 25px;
    font-weight: 900;
}

.homecms-v2-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    color: var(--homecms-green);
    background: var(--homecms-cream);
    border: 1px solid #e5dac0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.homecms-v2-section-placeholder {
    flex-direction: column;
}

.homecms-v2-placeholder-icon {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    color: #fff;
    background: var(--homecms-green);
    border-radius: 22px;
    font-size: 27px;
    font-weight: 900;
    box-shadow: 0 14px 32px rgba(23, 63, 49, 0.2);
}

.homecms-v2-section-placeholder h2,
.homecms-v2-section-placeholder p {
    max-width: 620px;
    margin: 0;
}

.homecms-v2-section-placeholder p {
    color: var(--homecms-muted);
    line-height: 1.9;
}

.homecms-v2-section-placeholder dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px;
    width: min(100%, 620px);
    margin: 10px 0;
}

.homecms-v2-section-placeholder dl > div {
    padding: 13px;
    background: #f7f8f7;
    border: 1px solid #e7ebe9;
    border-radius: 13px;
}

.homecms-v2-section-placeholder dt {
    color: var(--homecms-muted);
    font-size: 10px;
    font-weight: 800;
}

.homecms-v2-section-placeholder dd {
    margin: 3px 0 0;
    font-size: 15px;
    font-weight: 900;
}

.homecms-v2-section-placeholder details {
    width: min(100%, 760px);
    text-align: right;
}

.homecms-v2-section-placeholder summary {
    cursor: pointer;
    font-weight: 900;
}

.homecms-v2-section-placeholder pre {
    overflow: auto;
    max-height: 430px;
    padding: 16px;
    color: #dbe9e2;
    direction: ltr;
    text-align: left;
    background: #10271f;
    border-radius: 15px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.6;
}

.homecms-v2-current-list {
    display: grid;
    gap: 8px;
    width: min(100%, 680px);
}

.homecms-v2-current-list article {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-align: right;
    background: #f8f8f6;
    border: 1px solid #e8e8e2;
    border-radius: 12px;
}

.homecms-v2-current-list article > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.homecms-v2-current-list article > span.active {
    background: #2ba366;
}

.homecms-v2-current-list article > span.inactive {
    background: #9ca39f;
}

.homecms-v2-preview[hidden] {
    display: none;
}

.homecms-v2-preview {
    position: fixed;
    z-index: 100000;
    display: grid;
    inset: 0;
    place-items: center;
    padding: 18px;
    background: rgba(8, 24, 18, 0.82);
    backdrop-filter: blur(8px);
}

.homecms-v2-preview-dialog {
    display: flex;
    flex-direction: column;
    width: min(1380px, 98vw);
    height: min(900px, 95vh);
    overflow: hidden;
    background: #e9eeeb;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 23px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.42);
}

.homecms-v2-preview-dialog > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    color: #fff;
    background: #123326;
}

.homecms-v2-preview-dialog > header > div {
    display: flex;
    gap: 7px;
}

.homecms-v2-preview-dialog button {
    padding: 7px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.homecms-v2-preview-dialog button.active {
    color: #173f31;
    background: #e5bf6d;
    border-color: #e5bf6d;
}

.homecms-v2-preview-frame {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 0;
    padding: 13px;
}

.homecms-v2-preview-frame iframe {
    width: 100%;
    height: 100%;
    background: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(20, 50, 38, 0.18);
    transition: width 180ms ease;
}

.homecms-v2-preview-frame.mobile iframe {
    width: min(390px, 100%);
}

body.homecms-v2-preview-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .homecms-v2-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .homecms-v2-page {
        padding: 12px;
    }

    .homecms-v2-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 21px 18px;
        border-radius: 20px;
    }

    .homecms-v2-heading h1 {
        font-size: 25px;
    }

    .homecms-v2-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .homecms-v2-btn {
        min-width: 0;
        min-height: 41px;
        padding: 8px 6px;
        font-size: 11px;
    }

    .homecms-v2-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .homecms-v2-stat {
        padding: 13px 14px;
        border-radius: 15px;
    }

    .homecms-v2-stat strong {
        font-size: 23px;
    }

    .homecms-v2-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .homecms-v2-card {
        min-height: 0;
        border-radius: 18px;
    }

    .homecms-v2-card:hover {
        transform: none;
    }

    .homecms-v2-card-head {
        padding: 14px 14px 0;
    }

    .homecms-v2-card-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .homecms-v2-card-image {
        margin: 12px 14px 0;
        aspect-ratio: 16 / 7;
    }

    .homecms-v2-card-content {
        padding: 14px;
    }

    .homecms-v2-card-content h2 {
        font-size: 17px;
    }

    .homecms-v2-card-footer {
        padding: 11px 14px 14px;
    }

    .homecms-v2-section-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 15px;
    }

    .homecms-v2-section-head .homecms-v2-state {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .homecms-v2-section-placeholder {
        padding: 23px 15px;
    }

    .homecms-v2-section-placeholder dl {
        grid-template-columns: 1fr;
    }

    .homecms-v2-preview {
        padding: 7px;
    }

    .homecms-v2-preview-dialog {
        width: 100%;
        height: 98vh;
        border-radius: 16px;
    }

    .homecms-v2-preview-dialog > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .homecms-v2-preview-dialog > header > div {
        width: 100%;
    }

    .homecms-v2-preview-dialog button {
        flex: 1 1 0;
    }

    .homecms-v2-preview-frame {
        padding: 7px;
    }
}

/* HOMECMS_V2_PHASE5_CARD_ALERTS */
.homecms-v2-card-alert-list {
    display: grid;
    gap: 7px;
    padding: 0;
    margin: 12px 0 0;
    list-style: none;
}

.homecms-v2-card-alert-list li {
    position: relative;
    overflow: hidden;
    padding-inline-start: 15px;
    color: #596861;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.7;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.homecms-v2-card-alert-list li::before {
    content: "";
    position: absolute;
    top: 0.7em;
    inset-inline-start: 2px;
    width: 6px;
    height: 6px;
    background: #dd694d;
    border-radius: 50%;
}

@media (max-width: 760px) {
    .homecms-v2-card-alert-list {
        gap: 6px;
        margin-top: 10px;
    }

    .homecms-v2-card-alert-list li {
        font-size: 10.5px;
    }
}

/* HOMECMS_V2_PHASE5_OPEN_SITE_NOWRAP */
.homecms-v2-toolbar-actions .homecms-v2-btn {
    white-space: nowrap;
    word-break: keep-all;
}

@media (max-width: 760px) {
    .homecms-v2-toolbar-actions .homecms-v2-btn.primary {
        padding-inline: 4px;
        font-size: 10px;
        letter-spacing: -0.25px;
        white-space: nowrap;
    }
}
