:root {
    --bg: #f4efe7;
    --bg-strong: #e6dac9;
    --surface: rgba(255, 250, 242, 0.9);
    --surface-strong: #fffaf2;
    --ink: #1f2430;
    --ink-muted: #5f6775;
    --line: rgba(31, 36, 48, 0.12);
    --accent: #0f7b6c;
    --accent-strong: #0a5a51;
    --warm: #b45b3c;
    --danger: #8f3120;
    --shadow: 0 24px 70px rgba(43, 31, 17, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 123, 108, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(180, 91, 60, 0.16), transparent 26%),
        linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(31, 36, 48, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 36, 48, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    opacity: 0.35;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100vw - 28px));
    margin: 18px auto 28px;
}

.site-header,
.site-footer,
.panel-card,
.hero-card {
    backdrop-filter: blur(18px);
}

.site-header,
.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 18px 22px;
    background: rgba(255, 250, 242, 0.8);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.site-header {
    position: sticky;
    top: 16px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--warm));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 16px 30px rgba(15, 123, 108, 0.25);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.brand-copy strong,
h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: -0.02em;
}

.brand-copy small,
.guide-card-meta,
.eyebrow,
.site-footer,
.tile-row span,
.side-meta span {
    color: var(--ink-muted);
}

.guide-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.site-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
}

.site-nav a,
.nav-button,
.button,
.toolbar button {
    transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.site-nav a,
.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.is-active,
.nav-button:hover {
    background: rgba(15, 123, 108, 0.1);
    border-color: rgba(15, 123, 108, 0.2);
    color: var(--accent-strong);
}

.inline-form {
    margin: 0;
}

.site-main {
    margin: 24px 0;
    display: grid;
    gap: 24px;
}

.site-main > * {
    min-width: 0;
}

.hero-card,
.panel-card {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.95), rgba(247, 239, 227, 0.9));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    gap: 24px;
    padding: 30px;
    align-items: start;
}

.compact-hero {
    align-items: center;
}

.hero-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.02;
    word-break: break-word;
}

.hero-copy {
    display: grid;
    gap: 10px;
    align-content: start;
    min-width: 0;
}

.hero-copy p,
.panel-card p,
.guide-card p,
.markdown-body,
label span,
input,
textarea,
table {
    line-height: 1.6;
}

.hero-copy p {
    margin: 0;
    max-width: 72ch;
}

.hero-actions,
.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.hero-meta,
.stats-grid,
.tile-grid {
    display: grid;
    gap: 14px;
}

.hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
}

.metric-card,
.info-tile {
    display: grid;
    gap: 8px;
    align-content: start;
    height: 100%;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.metric-card strong,
.info-tile strong {
    display: block;
    font-size: 1.9rem;
    margin-bottom: 4px;
}

.panel-card,
.login-card {
    padding: 24px;
}

.button,
.toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 11px 16px;
    min-height: 46px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.button:hover,
.toolbar button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
}

.button-secondary,
.toolbar button {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(31, 36, 48, 0.12);
}

.button-danger {
    background: linear-gradient(135deg, #af4935, var(--danger));
    color: #fff;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.77rem;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.promo-hero {
    align-items: stretch;
}

.promo-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.promo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 22px;
}

.promo-section {
    display: grid;
    gap: 18px;
}

.pricing-grid,
.benefits-grid,
.quick-actions-grid {
    display: grid;
    gap: 16px;
}

.pricing-grid,
.benefits-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.pricing-card,
.benefit-card,
.shortcut-card {
    display: grid;
    gap: 12px;
    align-content: start;
    height: 100%;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(31, 36, 48, 0.08);
    box-shadow: var(--shadow);
}

.guide-card,
.metric-card,
.info-tile,
.pricing-card,
.benefit-card,
.shortcut-card,
.support-ticket-item,
.support-card,
.support-form-card,
.stack-list .mini-card {
    min-width: 0;
}

.pricing-card-accent,
.trial-tile {
    background: linear-gradient(180deg, rgba(15, 123, 108, 0.16), rgba(255, 255, 255, 0.82));
    border-color: rgba(15, 123, 108, 0.22);
}

.pricing-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.pricing-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 123, 108, 0.08);
}

.pricing-meta span {
    color: var(--ink-muted);
}

.steps-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 12px;
}

.steps-list li {
    padding-left: 4px;
}

.guide-card {
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(31, 36, 48, 0.1);
    box-shadow: var(--shadow);
}

.reveal-card {
    animation: rise-in 420ms ease both;
}

.guide-cover {
    display: block;
    min-height: 180px;
    background-size: cover;
    background-position: center;
}

.guide-cover-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(15, 123, 108, 0.85), rgba(180, 91, 60, 0.72));
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.guide-card-body {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.guide-card h3,
.section-heading h2,
.article-side h1 {
    margin: 8px 0 10px;
}

.text-link {
    color: var(--accent-strong);
    font-weight: 700;
}

.text-link:hover {
    text-decoration: underline;
}

.article-layout,
.stack-grid,
.editor-layout {
    display: grid;
    gap: 22px;
}

.article-layout > *,
.stack-grid > *,
.editor-layout > *,
.support-layout > * {
    min-width: 0;
}

.article-layout {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.article-cover {
    min-height: 260px;
    margin-bottom: 24px;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
}

.side-meta,
.locked-grid {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.side-meta div,
.locked-grid div,
.tile-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5em;
}

.markdown-body pre,
.markdown-body code {
    font-family: Consolas, "Courier New", monospace;
}

.markdown-body pre {
    overflow: auto;
    padding: 14px;
    background: #1d2330;
    color: #f8f3eb;
    border-radius: 16px;
}

.markdown-body code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(31, 36, 48, 0.08);
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
}

.markdown-body img {
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.content-stack,
.content-side,
.editor-side {
    display: grid;
    gap: 18px;
}

.stack-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
}

.tile-head,
.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.status-pill {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    white-space: nowrap;
}

.status-ok {
    background: rgba(15, 123, 108, 0.1);
    color: var(--accent-strong);
}

.status-off {
    background: rgba(143, 49, 32, 0.1);
    color: var(--danger);
}

.access-pill {
    background: rgba(15, 123, 108, 0.1);
    color: var(--accent-strong);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table-shell {
    overflow-x: auto;
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.42);
    -webkit-overflow-scrolling: touch;
}

.check-list {
    margin: 0;
    padding-left: 18px;
}

.check-list li {
    margin-bottom: 10px;
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 60vh;
}

.login-card {
    width: min(520px, 100%);
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(31, 36, 48, 0.14);
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    color: var(--ink);
}

textarea {
    resize: vertical;
}

input[type="file"] {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.72);
}

.form-error {
    padding: 14px 16px;
    margin-bottom: 16px;
    color: #fff;
    background: linear-gradient(135deg, #ba5e41, #96412d);
    border-radius: 16px;
}

.form-success {
    padding: 14px 16px;
    margin-bottom: 16px;
    color: #fff;
    background: linear-gradient(135deg, #188675, #0f6b5f);
    border-radius: 16px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.editor-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 14px;
}

.editor-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.upload-result {
    margin-top: 12px;
    color: var(--ink-muted);
    word-break: break-word;
}

.hero-actions-column,
.tile-actions,
.quick-actions {
    display: grid;
    gap: 10px;
    align-content: start;
}

.action-tile {
    display: grid;
    gap: 14px;
    height: 100%;
}

.action-tile .tile-actions,
.pricing-card .tile-actions {
    margin-top: auto;
}

.action-tile.is-selected {
    border-color: rgba(15, 123, 108, 0.3);
    background: rgba(15, 123, 108, 0.08);
}

.trial-tile .tile-actions,
.pricing-card-accent .tile-actions {
    align-content: start;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.detail-item {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.detail-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-muted);
}

.detail-item strong,
.tile-row strong {
    word-break: break-word;
}

.mono-field {
    font-family: Consolas, "Courier New", monospace;
    min-height: 140px;
}

.instructions-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(31, 36, 48, 0.08);
    line-height: 1.6;
}

.download-button-row {
    margin: 1rem 0;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--warm), #d17c59);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 18px 34px rgba(180, 91, 60, 0.22);
}

.download-button:hover {
    transform: translateY(-1px);
}

.danger-card {
    border-color: rgba(143, 49, 32, 0.22);
}

.admin-shortcuts {
    display: grid;
    gap: 18px;
}

.shortcut-card span {
    color: var(--ink-muted);
}

.message-card,
.locked-card,
.empty-card {
    max-width: 760px;
    margin: 0 auto;
}

.support-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.support-sidebar,
.support-thread-card {
    display: grid;
    gap: 18px;
}

.support-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.support-ticket-list {
    display: grid;
    gap: 10px;
    max-height: min(70vh, 760px);
    overflow: auto;
    padding-right: 4px;
}

.support-ticket-item {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.support-ticket-item.is-active {
    border-color: rgba(15, 123, 108, 0.28);
    background: rgba(15, 123, 108, 0.08);
}

.support-form-card,
.support-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.form-stack {
    display: grid;
    gap: 12px;
}

.message-thread {
    display: grid;
    gap: 12px;
}

.message-bubble {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.message-bubble p {
    margin: 0;
    word-break: break-word;
}

.message-user {
    background: rgba(15, 123, 108, 0.08);
}

.message-admin {
    background: rgba(180, 91, 60, 0.08);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    color: var(--ink-muted);
    font-size: 0.92rem;
}

.thread-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.muted-text {
    margin: 4px 0 0;
    color: var(--ink-muted);
}

.cabinet-banner {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.empty-state {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.site-footer {
    font-size: 0.92rem;
}

.site-footer-copy {
    flex: 1 1 220px;
    min-width: 0;
}

.site-footer-banner {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 320px;
    max-width: 100%;
    text-decoration: none;
}

.site-footer-banner img {
    display: block;
    width: min(100%, 220px);
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(148, 25, 29, 0.14);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .hero-card,
    .article-layout,
    .stack-grid,
    .editor-layout,
    .support-layout,
    .promo-grid {
        grid-template-columns: 1fr;
    }

    .editor-header,
    .site-header,
    .site-footer,
    .cabinet-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .site-header {
        position: static;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .site-nav a,
    .site-nav .inline-form {
        flex: 0 0 auto;
    }

    .hero-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-sidebar {
        position: static;
    }

    .support-ticket-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100vw - 20px, 100%);
        margin: 10px auto 18px;
    }

    .hero-card,
    .panel-card,
    .site-header,
    .site-footer {
        padding: 18px;
        border-radius: 18px;
    }

    .hero-meta,
    .stats-grid,
    .tile-grid,
    .pricing-grid,
    .benefits-grid,
    .quick-actions-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .admin-actions,
    .section-heading,
    .tile-head,
    .thread-actions,
    .message-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions > *,
    .admin-actions > *,
    .thread-actions > * {
        width: 100%;
    }

    .hero-actions .button,
    .hero-actions .inline-form,
    .hero-actions .inline-form .button,
    .hero-actions-column .button,
    .hero-actions-column .inline-form,
    .hero-actions-column .inline-form .button,
    .tile-actions .button,
    .tile-actions .inline-form,
    .tile-actions .inline-form .button,
    .quick-actions .button,
    .quick-actions .inline-form,
    .quick-actions .inline-form .button,
    .thread-actions .button,
    .thread-actions .inline-form,
    .thread-actions .inline-form .button,
    .pager-row .button {
        width: 100%;
    }

    .form-grid,
    .tile-row,
    .locked-grid div,
    .side-meta div {
        grid-template-columns: 1fr;
        display: grid;
    }

    .tile-row strong,
    .side-meta span,
    .message-meta span {
        text-align: left;
    }

    .site-nav a,
    .nav-button {
        min-height: 42px;
        padding: 10px 12px;
    }

    .hero-copy h1 {
        font-size: clamp(1.9rem, 9vw, 2.6rem);
    }

    .data-table {
        min-width: 560px;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: min(100vw - 16px, 100%);
        margin: 8px auto 16px;
    }

    .hero-card,
    .panel-card,
    .site-header,
    .site-footer {
        padding: 16px;
        border-radius: 16px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }
}

.button-danger {
    background: rgba(143, 49, 32, 0.12);
    border-color: rgba(143, 49, 32, 0.24);
    color: var(--danger);
}

.button-danger:hover {
    background: rgba(143, 49, 32, 0.18);
}

.form-panel,
.wide-form,
.stack-list,
.audit-entry,
.backup-entry {
    display: grid;
    gap: 16px;
}

.pager-row,
.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.filter-pill {
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.filter-pill.is-active {
    background: rgba(15, 123, 108, 0.12);
    border-color: rgba(15, 123, 108, 0.28);
    color: var(--accent-strong);
}

.top-gap {
    margin-top: 12px;
}

.preformatted-block {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    background: rgba(31, 36, 48, 0.05);
    border: 1px solid rgba(31, 36, 48, 0.08);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
}

.stack-list .mini-card,
.backup-entry,
.audit-entry {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.stack-list .mini-card {
    display: grid;
    gap: 8px;
}

.filter-pills,
.pager-row,
.table-shell + .pager-row {
    align-items: center;
}

/* Nebulock visual refresh */

:root {
    --shell-max: 1280px;
    --page-pad: clamp(10px, 2.3vw, 24px);
    --surface-glass: rgba(255, 255, 255, 0.68);
    --surface-glass-strong: rgba(255, 255, 255, 0.82);
    --surface-glass-soft: rgba(255, 255, 255, 0.58);
    --panel-border: rgba(17, 26, 38, 0.1);
    --panel-border-strong: rgba(17, 26, 38, 0.16);
    --shadow-soft: 0 18px 44px rgba(28, 21, 12, 0.1);
    --shadow-card: 0 12px 28px rgba(18, 29, 40, 0.09);
    --shadow-pop: 0 26px 76px rgba(18, 29, 40, 0.14);
    --ring-soft: rgba(255, 255, 255, 0.48);
    --bg-top: #f8efe5;
    --bg-bottom: #efe4d6;
    --bg-orb-a: rgba(12, 127, 122, 0.22);
    --bg-orb-b: rgba(207, 96, 55, 0.18);
    --bg-orb-c: rgba(77, 97, 190, 0.14);
    --ease-smooth: 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-home {
    --accent: #0b7f7b;
    --accent-strong: #086565;
    --warm: #cf6034;
    --bg-top: #f8eee6;
    --bg-bottom: #efe2d3;
    --bg-orb-a: rgba(11, 127, 123, 0.24);
    --bg-orb-b: rgba(207, 96, 52, 0.22);
    --bg-orb-c: rgba(45, 92, 165, 0.14);
}

body.page-cabinet,
body.page-key-detail {
    --accent: #176fb3;
    --accent-strong: #0f5e99;
    --warm: #1b9b87;
    --bg-top: #edf4fb;
    --bg-bottom: #e3eef8;
    --bg-orb-a: rgba(23, 111, 179, 0.24);
    --bg-orb-b: rgba(27, 155, 135, 0.18);
    --bg-orb-c: rgba(216, 130, 67, 0.12);
}

body.page-payment {
    --accent: #9c5a16;
    --accent-strong: #7f4509;
    --warm: #cf7545;
    --bg-top: #faf1e6;
    --bg-bottom: #f2e6d8;
    --bg-orb-a: rgba(156, 90, 22, 0.22);
    --bg-orb-b: rgba(207, 117, 69, 0.18);
    --bg-orb-c: rgba(26, 138, 132, 0.12);
}

body.page-support {
    --accent: #0a7a69;
    --accent-strong: #065d51;
    --warm: #c14568;
    --bg-top: #f5efe8;
    --bg-bottom: #ece4db;
    --bg-orb-a: rgba(10, 122, 105, 0.24);
    --bg-orb-b: rgba(193, 69, 104, 0.18);
    --bg-orb-c: rgba(64, 118, 194, 0.12);
}

body.page-guide {
    --accent: #3168b7;
    --accent-strong: #214c8a;
    --warm: #b56f2a;
    --bg-top: #f1f1f8;
    --bg-bottom: #e7e8f2;
    --bg-orb-a: rgba(49, 104, 183, 0.2);
    --bg-orb-b: rgba(181, 111, 42, 0.14);
    --bg-orb-c: rgba(10, 122, 105, 0.12);
}

body.page-editor,
body.page-admin-login,
body[class^="page-admin"] {
    --accent: #2d5f96;
    --accent-strong: #214971;
    --warm: #8f5a34;
    --bg-top: #eff3f7;
    --bg-bottom: #e5ebf1;
    --bg-orb-a: rgba(45, 95, 150, 0.22);
    --bg-orb-b: rgba(143, 90, 52, 0.16);
    --bg-orb-c: rgba(11, 127, 123, 0.1);
}

body {
    position: relative;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "Aptos", "Candara", "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% 12%, var(--bg-orb-a), transparent 30%),
        radial-gradient(circle at 88% 16%, var(--bg-orb-b), transparent 28%),
        radial-gradient(circle at 50% 100%, var(--bg-orb-c), transparent 38%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before {
    background-image:
        linear-gradient(rgba(17, 26, 38, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 26, 38, 0.025) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.55;
}

body::after {
    content: "";
    position: fixed;
    right: -120px;
    bottom: 6vh;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), transparent 34%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
    filter: blur(22px);
    opacity: 0.42;
    pointer-events: none;
    animation: nebula-drift 16s ease-in-out infinite alternate;
}

.page-shell {
    width: min(var(--shell-max), 100%);
    margin: clamp(12px, 2vw, 24px) auto 36px;
    padding-inline: var(--page-pad);
}

.page-shell::before,
.page-shell::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    border-radius: 999px;
    filter: blur(40px);
    opacity: 0.32;
}

.page-shell::before {
    left: -80px;
    top: 18vh;
    width: 220px;
    height: 220px;
    background: rgba(11, 127, 123, 0.12);
}

.page-shell::after {
    right: 4vw;
    top: 54vh;
    width: 180px;
    height: 180px;
    background: rgba(207, 96, 52, 0.12);
}

.site-main {
    gap: clamp(18px, 2.5vw, 28px);
}

.site-main > * {
    width: 100%;
}

.site-header,
.site-footer,
.hero-card,
.panel-card,
.login-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 243, 236, 0.72)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 62%);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-soft);
}

.site-header::before,
.site-footer::before,
.hero-card::before,
.panel-card::before,
.login-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.72), transparent 55%);
    pointer-events: none;
}

.site-header,
.site-footer {
    padding: clamp(16px, 2vw, 22px);
}

.site-header {
    top: clamp(8px, 1.8vw, 18px);
}

.brand-copy strong,
h1,
h2,
h3 {
    font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

.brand-mark {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow:
        0 18px 36px rgba(15, 123, 108, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.26), transparent 56%);
}

.brand-copy strong {
    font-size: clamp(1.08rem, 1.2vw, 1.24rem);
}

.brand-copy small {
    font-size: 0.88rem;
}

.site-nav {
    gap: 10px;
}

.site-nav a,
.nav-button {
    border-color: rgba(17, 26, 38, 0.06);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.site-nav a:hover,
.site-nav a.is-active,
.nav-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.74);
    border-color: rgba(17, 26, 38, 0.12);
    box-shadow: var(--shadow-card);
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.hero-card,
.panel-card,
.login-card {
    border-radius: 28px;
}

.hero-card {
    gap: clamp(18px, 2.8vw, 30px);
    padding: clamp(22px, 4vw, 34px);
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto auto -80px -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.24), transparent 68%);
    pointer-events: none;
}

.hero-copy h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.2rem, 4.9vw, 4.4rem);
    line-height: 0.98;
    text-wrap: balance;
}

.hero-copy p,
.panel-card p,
.guide-card p,
.muted-text,
.guide-card-meta,
.tile-row span,
.side-meta span,
.detail-item span,
.shortcut-card span,
.pricing-meta span,
.site-footer,
.brand-copy small,
.eyebrow {
    color: rgba(31, 36, 48, 0.72);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 4px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(17, 26, 38, 0.08);
    background: rgba(255, 255, 255, 0.48);
    letter-spacing: 0.16em;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--warm));
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.46);
}

.promo-note,
.instructions-box,
.empty-state,
.support-card,
.support-form-card,
.detail-item,
.stack-list .mini-card,
.backup-entry,
.audit-entry,
.preformatted-block,
.message-bubble,
.table-shell,
.metric-card,
.info-tile,
.pricing-card,
.benefit-card,
.shortcut-card,
.guide-card,
.support-ticket-item {
    background:
        linear-gradient(180deg, var(--surface-glass-strong), var(--surface-glass)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 58%);
    border: 1px solid rgba(17, 26, 38, 0.08);
    box-shadow: var(--shadow-card);
}

.metric-card,
.info-tile,
.pricing-card,
.benefit-card,
.shortcut-card,
.guide-card,
.support-ticket-item,
.support-card,
.support-form-card,
.stack-list .mini-card,
.detail-item,
.message-bubble {
    position: relative;
    isolation: isolate;
}

.metric-card::before,
.info-tile::before,
.pricing-card::before,
.benefit-card::before,
.shortcut-card::before,
.guide-card::before,
.support-ticket-item::before,
.support-card::before,
.support-form-card::before,
.stack-list .mini-card::before,
.detail-item::before,
.message-bubble::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

.metric-card strong,
.info-tile strong {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.pricing-card,
.benefit-card,
.shortcut-card,
.guide-card,
.metric-card,
.info-tile {
    border-radius: 24px;
}

.guide-cover {
    min-height: 210px;
    transition: transform var(--ease-smooth), filter var(--ease-smooth);
}

.guide-cover-fallback {
    background:
        radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.2), transparent 26%),
        linear-gradient(135deg, var(--accent), var(--warm));
}

.pricing-price {
    font-size: clamp(2rem, 3vw, 2.5rem);
}

.pricing-meta {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(17, 26, 38, 0.06);
}

.button,
.toolbar button,
.filter-pill,
.download-button {
    transition:
        transform var(--ease-smooth),
        box-shadow var(--ease-smooth),
        background var(--ease-smooth),
        border-color var(--ease-smooth),
        color var(--ease-smooth);
}

.button {
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(17, 26, 38, 0.08);
}

.button-primary {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.24), transparent 30%),
        linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 30px rgba(17, 26, 38, 0.12);
}

.button-secondary,
.toolbar button,
.filter-pill {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(17, 26, 38, 0.1);
}

.button-danger {
    background: rgba(143, 49, 32, 0.12);
    border-color: rgba(143, 49, 32, 0.24);
    color: var(--danger);
}

.button-danger:hover {
    background: rgba(143, 49, 32, 0.18);
}

.text-link {
    position: relative;
    width: fit-content;
}

.text-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--ease-smooth);
}

.text-link:hover::after {
    transform: scaleX(1);
}

.status-pill {
    border: 1px solid rgba(17, 26, 38, 0.08);
    background: rgba(255, 255, 255, 0.62);
    font-weight: 700;
}

.status-ok {
    background: rgba(15, 123, 108, 0.12);
}

.status-off {
    background: rgba(143, 49, 32, 0.12);
}

.article-layout,
.stack-grid,
.editor-layout,
.support-layout,
.promo-grid {
    align-items: stretch;
}

.stack-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr);
}

.promo-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.88fr);
}

.support-layout {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.cabinet-banner {
    padding: clamp(18px, 3vw, 24px);
    align-items: center;
}

.cabinet-banner > * {
    min-width: 0;
}

.message-card,
.locked-card {
    width: min(100%, 860px);
    margin-inline: auto;
}

.empty-card {
    width: 100%;
    max-width: none;
    margin: 0;
}

.guide-card-meta,
.section-heading,
.tile-head,
.message-meta {
    gap: 12px 16px;
}

.table-shell {
    border-color: rgba(17, 26, 38, 0.06);
}

.data-table thead {
    background: rgba(255, 255, 255, 0.64);
}

.data-table th {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(31, 36, 48, 0.62);
}

input,
textarea,
select {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(17, 26, 38, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
    transition: border-color var(--ease-smooth), box-shadow var(--ease-smooth), background var(--ease-smooth);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    border-color: rgba(15, 123, 108, 0.35);
    box-shadow:
        0 0 0 4px rgba(15, 123, 108, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.92);
}

.hero-actions,
.admin-actions,
.tile-actions,
.quick-actions,
.thread-actions,
.pager-row,
.filter-pills {
    gap: 12px;
}

.support-ticket-item.is-active {
    border-color: rgba(15, 123, 108, 0.22);
    box-shadow: 0 18px 36px rgba(15, 123, 108, 0.12);
}

.message-user {
    background:
        linear-gradient(180deg, rgba(15, 123, 108, 0.12), rgba(255, 255, 255, 0.78));
}

.message-admin {
    background:
        linear-gradient(180deg, rgba(180, 91, 60, 0.12), rgba(255, 255, 255, 0.78));
}

.site-main > * {
    opacity: 0;
    animation: neb-section-in 720ms var(--ease-smooth) both;
}

.site-main > *:nth-child(2) {
    animation-delay: 70ms;
}

.site-main > *:nth-child(3) {
    animation-delay: 120ms;
}

.site-main > *:nth-child(4) {
    animation-delay: 170ms;
}

.hero-meta > *,
.tile-grid > *,
.pricing-grid > *,
.benefits-grid > *,
.quick-actions-grid > *,
.guides-grid > *,
.stack-list > *,
.support-ticket-list > * {
    opacity: 0;
    animation: neb-card-in 640ms var(--ease-smooth) both;
}

.hero-meta > *:nth-child(2),
.tile-grid > *:nth-child(2),
.pricing-grid > *:nth-child(2),
.benefits-grid > *:nth-child(2),
.quick-actions-grid > *:nth-child(2),
.guides-grid > *:nth-child(2),
.stack-list > *:nth-child(2),
.support-ticket-list > *:nth-child(2) {
    animation-delay: 80ms;
}

.hero-meta > *:nth-child(3),
.tile-grid > *:nth-child(3),
.pricing-grid > *:nth-child(3),
.benefits-grid > *:nth-child(3),
.quick-actions-grid > *:nth-child(3),
.guides-grid > *:nth-child(3),
.stack-list > *:nth-child(3),
.support-ticket-list > *:nth-child(3) {
    animation-delay: 140ms;
}

.hero-meta > *:nth-child(4),
.tile-grid > *:nth-child(4),
.pricing-grid > *:nth-child(4),
.benefits-grid > *:nth-child(4),
.quick-actions-grid > *:nth-child(4),
.guides-grid > *:nth-child(4),
.stack-list > *:nth-child(4),
.support-ticket-list > *:nth-child(4) {
    animation-delay: 200ms;
}

.reveal-card {
    animation: neb-card-in 640ms var(--ease-smooth) both;
}

@media (hover: hover) {
    .metric-card,
    .info-tile,
    .pricing-card,
    .benefit-card,
    .shortcut-card,
    .guide-card,
    .support-ticket-item,
    .support-card,
    .support-form-card,
    .stack-list .mini-card,
    .detail-item,
    .message-bubble,
    .download-button,
    .filter-pill {
        transition:
            transform var(--ease-smooth),
            box-shadow var(--ease-smooth),
            border-color var(--ease-smooth),
            background var(--ease-smooth);
    }

    .metric-card:hover,
    .info-tile:hover,
    .pricing-card:hover,
    .benefit-card:hover,
    .shortcut-card:hover,
    .guide-card:hover,
    .support-ticket-item:hover,
    .support-card:hover,
    .support-form-card:hover,
    .stack-list .mini-card:hover,
    .detail-item:hover,
    .message-bubble:hover,
    .download-button:hover,
    .filter-pill:hover {
        transform: translateY(-4px);
        border-color: rgba(17, 26, 38, 0.14);
        box-shadow: var(--shadow-pop);
    }

    .guide-card:hover .guide-cover {
        transform: scale(1.03);
        filter: saturate(1.06);
    }

    .button:hover,
    .toolbar button:hover {
        transform: translateY(-3px);
        box-shadow: 0 16px 30px rgba(18, 29, 40, 0.14);
    }
}

@keyframes nebula-drift {
    from {
        transform: translate3d(0, 0, 0) scale(0.96);
    }
    to {
        transform: translate3d(-30px, -18px, 0) scale(1.06);
    }
}

@keyframes neb-section-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes neb-card-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1080px) {
    .hero-card,
    .promo-grid,
    .stack-grid,
    .support-layout,
    .article-layout,
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .site-header,
    .site-footer,
    .editor-header,
    .cabinet-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .site-footer-banner {
        justify-content: center;
    }

    .site-header {
        position: static;
    }

    .hero-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .support-sidebar {
        position: static;
    }

    .support-ticket-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 760px) {
    .page-shell {
        margin: 12px auto 22px;
        padding-inline: 12px;
    }

    .site-main {
        gap: 16px;
    }

    .site-header,
    .site-footer,
    .hero-card,
    .panel-card,
    .login-card {
        padding: 16px;
        border-radius: 22px;
    }

    .hero-meta,
    .stats-grid,
    .tile-grid,
    .pricing-grid,
    .benefits-grid,
    .quick-actions-grid,
    .guides-grid,
    .detail-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .admin-actions,
    .section-heading,
    .tile-head,
    .message-meta,
    .thread-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions > *,
    .admin-actions > *,
    .thread-actions > *,
    .tile-actions > *,
    .quick-actions > *,
    .pager-row > * {
        width: 100%;
    }

    .form-grid,
    .tile-row,
    .locked-grid div,
    .side-meta div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .site-nav a,
    .site-nav .inline-form {
        flex: 0 0 auto;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 11vw, 3.1rem);
    }

    .promo-note,
    .instructions-box,
    .empty-state,
    .support-card,
    .support-form-card,
    .detail-item,
    .stack-list .mini-card,
    .backup-entry,
    .audit-entry,
    .message-bubble {
        padding: 14px;
    }

    .data-table {
        min-width: 540px;
    }
}

@media (max-width: 560px) {
    .page-shell {
        margin: 10px auto 18px;
        padding-inline: 10px;
    }

    .site-header,
    .site-footer,
    .hero-card,
    .panel-card,
    .login-card {
        padding: 14px;
        border-radius: 18px;
    }

    .brand {
        align-items: flex-start;
        gap: 10px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .brand-copy small {
        font-size: 0.82rem;
    }

    .site-nav a,
    .nav-button,
    .button {
        min-height: 44px;
    }

    .hero-meta {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
