.analytics-page {
    max-width: 1200px;
    margin: 70px auto 0;
    padding: 24px 20px 110px;
}

.analytics-hero {
    margin-bottom: 24px;
}

.analytics-title {
    margin-bottom: 12px;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.24;
}

.analytics-subtitle {
    max-width: 700px;
    color: #8a96a3;
    line-height: 1.6;
}

.analytics-search {
    margin-bottom: 18px;
}

.analytics-search input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d1117;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.analytics-search input:focus {
    border-color: #2f8cff;
}

.analytics-categories {
    margin-bottom: 22px;
}

.category-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.category-group-title {
    margin-right: 4px;
    color: #8a96a3;
    font-size: 12px;
}

.category-group.beginner {
    padding-left: 10px;
    border-left: 3px solid #facc15;
}

.category-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d1117;
    color: #c4ccd6;
    cursor: pointer;
    font-size: 13px;
}

.category-btn:hover {
    border-color: rgba(47, 140, 255, 0.3);
    color: #fff;
}

.category-btn.active {
    background: #2f8cff;
    border-color: #2f8cff;
    color: #fff !important;
}

.analytics-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.analytics-toolbar h2 {
    margin-bottom: 4px;
    font-size: 18px;
}

.analytics-toolbar p {
    color: #8a96a3;
    font-size: 13px;
}

.analytics-create-btn {
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f8cff, #1f6fe0);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

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

.analytics-card {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #0d1117;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.analytics-card:hover {
    transform: translateY(-4px);
    border-color: rgba(47, 140, 255, 0.28);
}

.analytics-card__image-wrap {
    display: block;
}

.analytics-card__image {
    width: 100%;
    height: 188px;
    object-fit: cover;
}

.analytics-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #11151c;
    color: #48525f;
    font-size: 12px;
}

.analytics-card__body {
    padding: 15px;
}

.analytics-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.analytics-meta-chip,
.analytics-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
}

.analytics-meta-chip {
    background: rgba(255, 255, 255, 0.05);
    color: #a7b1be;
}

.analytics-tag {
    font-weight: 500;
}

.analytics-card__title {
    margin-bottom: 8px;
    font-size: 17px;
    line-height: 1.35;
}

.analytics-card__title a {
    color: #fff;
    text-decoration: none;
}

.analytics-card__excerpt {
    margin-bottom: 14px;
    color: #8a96a3;
    font-size: 13px;
    line-height: 1.55;
}

.analytics-card__stats {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.analytics-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.analytics-stat__label {
    color: #6f7b8b;
    font-size: 10px;
}

.analytics-stat__value {
    font-size: 14px;
    font-weight: 600;
}

.analytics-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 12px;
    background: rgba(47, 140, 255, 0.1);
    color: #2f8cff;
    text-decoration: none;
    font-size: 13px;
}

.analytics-empty,
.analytics-no-results {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.analytics-load-sentinel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    margin-top: 18px;
    color: #7d8a99;
    font-size: 13px;
}

.analytics-load-sentinel.is-hidden {
    display: none;
}

.analytics-load-sentinel.is-loading .analytics-load-sentinel__label {
    opacity: 1;
}

.analytics-load-sentinel__label {
    opacity: 0.74;
    transition: opacity 0.18s ease;
}

.analytics-empty__box {
    width: min(480px, 100%);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #0d1117;
    text-align: center;
}

.analytics-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1200;
}

.analytics-modal.is-open {
    display: flex;
}

body.analytics-modal-open {
    overflow: hidden;
}

.analytics-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.76);
    backdrop-filter: blur(10px);
}

.analytics-modal__dialog {
    position: relative;
    width: min(860px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 24px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #0f1724 0%, #0b1220 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.analytics-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.analytics-modal__header h3 {
    margin: 0 0 6px;
    font-size: 24px;
}

.analytics-modal__header p {
    margin: 0;
    color: #8a96a3;
    font-size: 13px;
}

.analytics-modal__close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.analytics-create-form {
    display: grid;
    gap: 22px;
}

.analytics-create-form__section {
    display: grid;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.analytics-create-form__section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.analytics-create-form__section-head {
    display: grid;
    gap: 6px;
}

.analytics-create-form__section-head h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.analytics-create-form__section-head p {
    margin: 0;
    color: #8a96a3;
    font-size: 12px;
    line-height: 1.55;
}

.analytics-create-form__grid {
    display: grid;
    gap: 16px;
}

.analytics-create-form__grid--two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-create-form__field {
    display: grid;
    gap: 8px;
}

.analytics-create-form__field label {
    font-size: 13px;
    color: #cfd8e3;
}

.analytics-create-form__field input[type="text"],
.analytics-create-form__field input[type="file"],
.analytics-create-form__field select,
.analytics-create-form__field textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d1117;
    color: #fff;
    outline: none;
}

.analytics-create-form__field textarea {
    min-height: 220px;
    resize: vertical;
}

.analytics-create-form__field input:focus,
.analytics-create-form__field select:focus,
.analytics-create-form__field textarea:focus {
    border-color: #2f8cff;
}

.analytics-create-form__field ul.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #ff8e8e;
    font-size: 12px;
}

.analytics-create-form__field--checkbox {
    align-content: start;
}

.analytics-create-form__field--checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.analytics-create-form__field--align-end {
    align-content: end;
}

.analytics-create-form__field--full {
    grid-column: 1 / -1;
}

.analytics-compose-box,
.analytics-section-card {
    display: grid;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
}

.analytics-section-card--accent {
    border: 0;
    background: transparent;
}

.analytics-compose-box__header,
.analytics-section-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.analytics-compose-box__header label,
.analytics-section-card__header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.analytics-compose-box__header p,
.analytics-section-card__header p {
    margin: 6px 0 0;
    color: #8a96a3;
    font-size: 12px;
    line-height: 1.55;
}

.analytics-mirror-block {
    display: none;
    margin-top: 4px;
}

.analytics-mirror-block.is-active {
    display: block;
}

.analytics-color-field {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.analytics-color-field input[type="color"] {
    width: 52px;
    min-width: 52px;
    height: 40px;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d1117;
    cursor: pointer;
}

.analytics-color-field__hint {
    color: #8a96a3;
    font-size: 12px;
}

.analytics-create-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.analytics-compose-box__hint {
    margin-top: 10px;
    color: #8090a3;
    font-size: 12px;
    line-height: 1.5;
}

.analytics-context-menu {
    position: absolute;
    z-index: 1400;
    display: none;
    min-width: 188px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(13, 17, 23, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
}

.analytics-context-menu__item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #eef4fb;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.analytics-context-menu__item:hover {
    background: rgba(47, 140, 255, 0.12);
    color: #ffffff;
}

.analytics-create-form__secondary,
.analytics-create-form__submit {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
}

.analytics-create-form__secondary {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #c4ccd6;
}

.analytics-create-form__submit {
    border: 0;
    background: #2f8cff;
    color: #fff;
    font-weight: 600;
}

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

@media (max-width: 720px) {
    .analytics-page {
        padding: 14px 10px calc(92px + env(safe-area-inset-bottom));
        margin-top: 64px;
    }

    .analytics-hero {
        margin-bottom: 18px;
    }

    .analytics-title {
        font-size: 24px;
        line-height: 1.2;
    }

    .analytics-subtitle {
        font-size: 13px;
    }

    .analytics-search {
        margin-bottom: 14px;
    }

    .analytics-search input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .analytics-categories {
        margin-bottom: 18px;
    }

    .category-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .category-group::-webkit-scrollbar {
        display: none;
    }

    .category-group-title {
        flex: 0 0 auto;
    }

    .category-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .analytics-toolbar {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 16px;
    }

    .analytics-toolbar__right,
    .analytics-create-btn {
        width: 100%;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .analytics-card {
        border-radius: 14px;
    }

    .analytics-card__image {
        height: 176px;
    }

    .analytics-card__body {
        padding: 14px;
    }

    .analytics-card__title {
        font-size: 16px;
    }

    .analytics-card__excerpt {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .analytics-card__stats {
        gap: 8px;
    }

    .analytics-stat {
        min-width: 0;
    }

    .analytics-create-form__grid {
        grid-template-columns: 1fr;
    }

    .analytics-create-form__grid--nested {
        grid-template-columns: 1fr;
    }

    .analytics-modal {
        padding: 10px;
    }

    .analytics-modal__dialog {
        padding: 18px;
        max-height: calc(100vh - 20px);
    }
}


/* Chrome, Edge, Opera */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}
