.mg-page {
    --mg-violet: #b29aff;
    --mg-mint: #66e3b0;
    --mg-blue: #77c9ff;
    --mg-gold: #efc778;
    --mg-rose: #f49aa8;
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
    color: var(--text);
}
[data-theme="light"] .mg-page {
    --mg-violet: #6747bd;
    --mg-mint: #147d60;
    --mg-blue: #176ba0;
    --mg-gold: #886000;
    --mg-rose: #a33351;
}
.mg-page .mg-glass {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
}
.mg-page .mg-hero {
    margin-bottom: 18px;
    background-image: linear-gradient(125deg, rgba(132, 89, 240, .16), transparent 70%);
}
.mg-kicker, .mg-actions, .mg-topic h2, .mg-roadmap h2,
.mg-checklist h2, .mg-sources h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mg-kicker { color: var(--mg-violet); }
.mg-hero h1 {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.2;
    margin: 14px 0;
}
.mg-page h2 {
    font-size: 19px;
    line-height: 1.4;
    margin: 0 0 16px;
}
.mg-page p { line-height: 1.75; }
.mg-page a { color: inherit; }
.mg-actions { flex-wrap: wrap; margin-top: 20px; }
.mg-page .mg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    background: var(--surface);
}
.mg-page .mg-primary-button {
    border-color: var(--mg-violet);
    background: rgba(132, 89, 240, .19);
}
.mg-page .mg-button:hover {
    border-color: var(--mg-violet);
}
.mg-icon {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.mg-tone-violet { color: var(--mg-violet); }
.mg-tone-mint { color: var(--mg-mint); }
.mg-tone-blue { color: var(--mg-blue); }
.mg-tone-gold { color: var(--mg-gold); }
.mg-tone-rose { color: var(--mg-rose); }
.mg-telegram {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}
.mg-telegram > .mg-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}
.mg-telegram > div { flex: 1; min-width: 0; }
.mg-telegram p { margin: 0; }
.mg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 20px;
}
.mg-primary, .mg-sidebar {
    display: grid;
    min-width: 0;
    gap: 18px;
}
.mg-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}
.mg-page [id] { scroll-margin-top: 170px; }
.mg-detail {
    border-top: 1px solid var(--line);
}
.mg-detail summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 10px 0;
    list-style: none;
    line-height: 1.5;
}
.mg-detail summary::-webkit-details-marker { display: none; }
.mg-detail[open] > summary .mg-icon { transform: rotate(180deg); }
.mg-detail p { margin: 0 0 14px; font-size: 14px; }
.mg-navigation a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 7px 0;
    text-decoration: none;
    font-size: 13px;
}
.mg-navigation a:hover { color: var(--mg-violet); }
.mg-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    cursor: pointer;
    line-height: 1.5;
    font-size: 13px;
}
.mg-check input {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    accent-color: var(--mg-violet);
}
.mg-checklist progress {
    width: 100%;
    accent-color: var(--mg-violet);
}
.mg-roadmap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.mg-roadmap li { padding: 6px 0; line-height: 1.6; }
.mg-sources a {
    display: block;
    margin: 12px 0;
    color: var(--mg-blue);
    overflow-wrap: anywhere;
}

.mg-practical h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mg-tool-grid, .mg-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.mg-page .mg-tool {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
}
.mg-tool:hover {
    border-color: var(--mg-blue);
}
.mg-tool small {
    display: block;
    margin-top: 8px;
    line-height: 1.5;
}
.mg-practical select,
.mg-practical textarea {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    color-scheme: inherit;
}
.mg-practical select {
    min-height: 44px;
}
.mg-practical textarea {
    resize: vertical;
    line-height: 1.6;
}
.mg-template summary span {
    flex: 1;
}
.mg-budget-plans li {
    padding: 6px 0;
    line-height: 1.5;
}
.mg-page [hidden] {
    display: none !important;
}

.mg-reviews h2,
.mg-review header,
.mg-review-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mg-review {
    padding: 16px;
    margin: 12px 0;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.mg-review header {
    flex-wrap: wrap;
    justify-content: space-between;
}
.mg-review p {
    overflow-wrap: anywhere;
}
.mg-review-form {
    display: grid;
    gap: 14px;
}
.mg-review-form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.mg-rating-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.mg-rating-options label {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}
.mg-rating-options input {
    accent-color: var(--mg-violet);
}
.mg-rating-options label:has(input:checked) {
    border-color: var(--mg-gold);
}
.mg-review-form textarea {
    min-width: 0;
    width: 100%;
    padding: 12px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.mg-review-form button {
    font: inherit;
    color: var(--text);
    justify-self: start;
}
.mg-page :focus-visible {
    outline: 2px solid var(--mg-violet);
    outline-offset: 4px;
}
@media (max-width: 1050px) {
    .mg-layout { grid-template-columns: minmax(0, 1fr); }
    .mg-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .mg-section-grid, .mg-sidebar, .mg-roadmap-grid,
    .mg-tool-grid, .mg-template-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .mg-telegram {
        flex-direction: column;
        align-items: flex-start;
    }
    .mg-page .mg-glass { padding: 16px; }
    .mg-page { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .mg-page *, .mg-page *::before, .mg-page *::after {
        animation: none;
        transition: none;
        scroll-behavior: auto;
    }
}
