:root {
    --bg: #152238;
    --bg-soft: #1e3150;
    --surface: #ffffff;
    --surface-muted: #f4f7fb;
    --text: #1b2433;
    --text-muted: #5f6b7c;
    --border: #d8e0ea;
    --primary: #2f6fed;
    --primary-dark: #2457be;
    --danger: #d64545;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    --status-draft: #f5d547;
    --status-completed: #5b9cff;
    --status-approved: #43b581;
    --status-rejected: #f2994a;
    --editor-accent: #d4a017;
    --editor-accent-soft: #fef3c7;
    --editor-board: #f8fafc;
    --editor-board-border: #e2e8f0;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #182842 0%, var(--bg) 100%);
    color: var(--text);
}

body {
    direction: rtl;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.page {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.login-card {
    width: min(420px, 100%);
    margin: 72px auto 0;
    padding: 32px;
}

.login-card h1,
.page-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.field label {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.field input,
.field select,
.toolbar select,
.toolbar input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: #ffe9e9;
    color: var(--danger);
    border: 1px solid #ffcaca;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

.btn-accent {
    background: linear-gradient(135deg, #fbbf24 0%, var(--editor-accent) 100%);
    color: #422006;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 14px rgba(212, 160, 23, 0.35);
}

.btn-accent:hover {
    filter: brightness(1.05);
}

.btn-block {
    width: 100%;
}

.error-text {
    min-height: 20px;
    margin-top: 8px;
    color: var(--danger);
    font-size: 0.9rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    color: #fff;
}

/* App shell (levels list & shared) */
.app-body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 160, 23, 0.1), transparent),
        linear-gradient(180deg, #182842 0%, var(--bg) 100%);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    color: #fff;
}

.app-header-welcome {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.app-header-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fde68a, var(--editor-accent));
    color: #422006;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(212, 160, 23, 0.35);
}

.app-header-text {
    min-width: 0;
}

.welcome-greeting {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    margin: 4px 0 0;
    font-size: 0.88rem;
    opacity: 0.78;
    line-height: 1.4;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-ghost-light {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.16);
}

.app-header .admin-switch summary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 8px 14px;
}

.admin-switch {
    position: relative;
}

.admin-switch summary {
    list-style: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
}

.admin-switch summary::-webkit-details-marker {
    display: none;
}

.admin-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 20;
}

.admin-menu button {
    width: 100%;
    text-align: right;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
}

.admin-menu button:hover,
.admin-menu button.active {
    background: var(--surface-muted);
}

.panel {
    padding: 20px;
    margin-bottom: 16px;
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.toolbar-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.toolbar-row .field {
    flex: 1;
    margin-bottom: 0;
}

.toolbar-row .btn {
    align-self: end;
    white-space: nowrap;
}

.levels-filters {
    padding: 12px 14px;
    margin-bottom: 12px;
}

.levels-filters-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.9fr)
        minmax(0, 1fr)
        minmax(0, 0.75fr)
        minmax(0, 0.95fr)
        minmax(120px, 1.4fr)
        auto
        auto;
    gap: 8px;
    align-items: end;
}

.field--compact {
    margin-bottom: 0;
    gap: 4px;
}

.field--compact label {
    font-size: 0.75rem;
    line-height: 1.2;
}

.levels-filters-grid .field--compact input,
.levels-filters-grid .field--compact select {
    padding: 7px 10px;
    font-size: 0.88rem;
    border-radius: 8px;
}

.levels-filters-btn {
    padding: 7px 12px;
    font-size: 0.84rem;
    border-radius: 8px;
    white-space: nowrap;
}

.level-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 300px);
    overflow: auto;
    padding: 4px;
}

.level-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.level-item--no-handle {
    grid-template-columns: minmax(0, 1fr) auto;
}

.level-item--drag-source {
    opacity: 0.45;
}

.level-item--drop-target {
    border-color: #5b9cff;
    box-shadow: 0 0 0 2px rgba(91, 156, 255, 0.25);
}

.level-item--has-pending-swap {
    border-inline-start: 3px solid #5b9cff;
}

.level-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: #6b7c93;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
    user-select: none;
}

.level-drag-handle-grip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 12px;
}

.level-drag-handle-grip span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.level-drag-handle:hover:not(:disabled) {
    border-color: #b8c9e6;
    color: var(--text);
    background: #f0f4fa;
}

.level-drag-handle:active:not(:disabled) {
    cursor: grabbing;
}

.level-drag-handle:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.level-drag-ghost {
    position: fixed;
    z-index: 60;
    pointer-events: none;
    margin: 0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    border-color: #5b9cff;
    opacity: 0.95;
    will-change: transform;
}

.info-btn--swap {
    border-color: #a8c4f5;
    background: #eef4ff;
    color: #2457be;
}

.level-item:hover {
    border-color: #b8c9e6;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.level-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.level-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.level-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
}

.level-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.level-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    line-height: 1.4;
}

.level-meta-chip--wide {
    flex: 1 1 auto;
    min-width: fit-content;
}

.level-meta-label {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.level-meta-label::after {
    content: "·";
    margin-inline-start: 6px;
    color: #c5ced9;
}

.level-meta-value {
    color: var(--text);
    font-weight: 600;
}

.level-meta-value--date {
    font-weight: 500;
    font-size: 0.8rem;
}

.level-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.level-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-shrink: 0;
}

.level-actions .btn-compact {
    padding: 8px 14px;
    font-size: 0.84rem;
    border-radius: 8px;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-Draft {
    background: rgba(245, 213, 71, 0.25);
    color: #8a6d00;
}

.status-Completed {
    background: rgba(91, 156, 255, 0.18);
    color: #2457be;
}

.status-Approved {
    background: rgba(67, 181, 129, 0.18);
    color: #1f7a52;
}

.status-Rejected {
    background: rgba(242, 153, 74, 0.2);
    color: #b35a12;
}

.info-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #f0c090;
    background: #fff7ef;
    color: #b35a12;
    cursor: pointer;
}

.list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 32, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
}

.modal h2 {
    margin-top: 0;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
    gap: 6px;
    margin-top: 16px;
}

.modal-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    font-weight: 700;
}

.modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .levels-filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .levels-filters-search {
        grid-column: 1 / -1;
    }

    .level-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .level-item--no-handle {
        grid-template-columns: 1fr;
    }

    .level-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-start;
    }

    .level-actions .btn-compact {
        flex: 1;
    }
}

/* Editor */
.editor-body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 160, 23, 0.12), transparent),
        linear-gradient(180deg, #182842 0%, var(--bg) 100%);
}

.editor-page {
    width: min(1240px, 100%);
    padding-inline: 16px;
    padding-bottom: 120px;
    box-sizing: border-box;
}

.editor-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    color: #fff;
}

.editor-topbar-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.editor-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fde68a, var(--editor-accent));
    color: #422006;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(212, 160, 23, 0.4);
}

.editor-brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.editor-topbar-left,
.grid-size-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.grid-size-label-text {
    font-size: 0.88rem;
    opacity: 0.85;
}

.grid-size-select {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}

.grid-size-select option {
    color: var(--text);
    background: var(--surface);
}

.editor-message {
    margin: 0;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: #fff7e6;
    border: 1px solid #f5d547;
    color: #8a6d00;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.45;
    animation: editor-message-in 0.25s ease;
}

.editor-message--footer {
    flex: 1 1 220px;
    min-width: 0;
    max-width: min(520px, 100%);
    text-align: center;
    align-self: center;
}

.editor-footer-bar .editor-message.hidden {
    display: none;
}

@keyframes editor-message-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-message.error {
    background: #ffe9e9;
    border-color: #ffcaca;
    color: var(--danger);
}

.editor-message.success {
    background: #e8f8ef;
    border-color: #b8e6cc;
    color: #1f7a52;
}

.editor-panel {
    padding: 0;
    overflow: hidden;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    min-height: min(440px, calc(100vh - 300px));
}

.editor-sidebar {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: linear-gradient(180deg, #fafbfc 0%, var(--surface-muted) 100%);
    border-left: 1px solid var(--border);
    min-width: 0;
    min-height: 0;
    gap: 12px;
}

.sidebar-section {
    margin-bottom: 0;
}

.sidebar-section--words {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-section--words .section-heading {
    margin-bottom: 10px;
    font-size: 0.92rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.section-heading--inset {
    padding: 20px 20px 0;
    margin-bottom: 16px;
}

.section-heading-icon {
    font-size: 1.1rem;
    opacity: 0.75;
}

.settings-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.settings-title {
    margin: 0 0 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-card--compact {
    padding: 12px 14px;
}

.settings-card--compact .settings-title {
    margin: 0 0 10px;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text);
}

.settings-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.settings-card--compact .field,
.field--compact {
    margin-bottom: 0;
    gap: 4px;
}

.settings-card--compact .field label,
.field--compact label {
    font-size: 0.75rem;
    line-height: 1.25;
}

.settings-card--compact .field input,
.field--compact input {
    padding: 7px 9px;
    font-size: 0.88rem;
    border-radius: 8px;
}

.settings-card .field {
    margin-bottom: 12px;
}

.settings-card .field:last-child {
    margin-bottom: 0;
}

.editor-main {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 280px;
    overflow: auto;
}

.editor-canvas {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(520px, 100%);
    max-width: 100%;
    gap: 12px;
}

.editor-board-wrap {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.editor-board {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 2.5vw, 24px);
    border-radius: var(--radius-lg);
    background: var(--editor-board);
    border: 2px solid var(--editor-board-border);
    box-shadow:
        inset 0 2px 8px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.06);
    width: min(520px, 100%);
    max-width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: editor-board;
}

.editor-board-stage {
    position: relative;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
}

.editor-path-arrows {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 2;
}

.editor-path-arrows.is-hidden {
    display: none;
}

.editor-board--test {
    margin: 0 auto;
    width: fit-content;
    max-width: 100%;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 80px;
    max-height: none;
    overflow: auto;
    padding: 2px;
    margin-bottom: 0;
}

.word-list .empty-state {
    padding: 18px 14px;
    font-size: 0.88rem;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}

.word-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    background: transparent;
    overflow: visible;
    transition: box-shadow 0.15s ease;
}

.word-item-strip {
    flex: 0 0 44px;
    width: 44px;
    min-height: 48px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--word-accent-bg, #e2e8f0);
    color: var(--word-accent, #334155);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    border: 2px solid var(--word-accent, #94a3b8);
    border-left: none;
    border-radius: 0 999px 999px 0;
}

.word-item:hover .word-item-strip,
.word-item:hover .word-item-body {
    border-color: #b8c9e6;
}

.word-item:hover .word-item-body {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.word-item.active .word-item-strip,
.word-item.active .word-item-body {
    border-color: var(--primary);
}

.word-item.active .word-item-body {
    box-shadow: 0 4px 16px rgba(47, 111, 237, 0.18);
}

.word-item.active .word-item-strip {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.word-item-body {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 14px 0 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 999px 0 0 999px;
}

.word-item-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.6;
    direction: rtl;
    white-space: nowrap;
    overflow: visible;
}

.word-item-meta {
    display: none;
}

.editor-toolbox {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.editor-toolbox-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.editor-toolbox .btn-compact {
    padding: 7px 10px;
    font-size: 0.84rem;
    border-radius: 8px;
}

.editor-toolbox .btn-ghost.btn-compact {
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.editor-toolbox .btn-ghost.btn-compact:hover {
    background: #eef2f7;
    color: var(--text);
}

.path-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    color: #713f12;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid #fcd34d;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.path-hint-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.editor-grid {
    --tile-size: 54px;
    --grid-cols: 5;
    display: grid;
    gap: clamp(5px, 1.2vw, 10px);
    grid-template-columns: repeat(var(--grid-cols), var(--tile-size));
    margin: 0 auto;
    width: fit-content;
    max-width: 100%;
    touch-action: none;
    user-select: none;
}

.editor-tile {
    width: var(--tile-size);
    height: var(--tile-size);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(0.85rem, calc(var(--tile-size) * 0.38), 1.2rem);
    cursor: pointer;
    position: relative;
    background: var(--surface);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

.editor-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.editor-tile:active {
    transform: translateY(0);
}

.editor-tile .order-badge {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 0.62rem;
    color: #854d0e;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.75);
    padding: 1px 5px;
    border-radius: 999px;
}

.editor-tile.is-draft {
    background: linear-gradient(180deg, #fef08a 0%, #fde047 100%);
    border-color: #eab308;
}

.editor-tile.is-free {
    background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%);
    border-color: #86efac;
}

.editor-tile.is-blocked {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.editor-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin: 0;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.legend-draft { background: #fef08a; border: 1px solid #eab308; }
.legend-free { background: #dcfce7; border: 1px solid #86efac; }
.legend-filled { background: #bfdbfe; border: 1px solid #3b82f6; }

.path-arrows-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-inline-start: auto;
    color: var(--text);
    font-weight: 600;
}

.path-arrows-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.path-arrows-toggle-ui {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.path-arrows-toggle-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

.path-arrows-toggle input:checked + .path-arrows-toggle-ui {
    background: #3b82f6;
}

.path-arrows-toggle input:checked + .path-arrows-toggle-ui::after {
    transform: translateX(16px);
}

.hints-panel {
    padding-bottom: 20px;
}

.hints-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 20px 4px;
}

.hints-list .empty-state {
    grid-column: 1 / -1;
    padding: 20px 16px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.hint-row {
    display: grid;
    grid-template-columns: minmax(88px, max-content) 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--word-accent, var(--border));
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hint-row:focus-within {
    border-color: var(--border);
    border-inline-start-color: var(--word-accent, var(--primary));
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.08);
}

.hint-row label {
    font-weight: 700;
    padding-top: 0;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
}

.hint-row textarea {
    width: 100%;
    min-height: 24px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
    background: var(--surface);
    line-height: 1.5;
    transition: border-color 0.15s ease;
}

.hint-row textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.hint-row .btn {
    margin-top: 0;
    white-space: nowrap;
    font-size: 0.84rem;
    padding: 6px 12px;
}

.editor-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.08);
}

.editor-footer-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    max-width: 100%;
}

.modal-editor {
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.modal-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0 0 6px;
}

.modal-header .subtitle {
    margin: 0;
}

.dictionary-section {
    margin-bottom: 16px;
}

.dictionary-section:last-of-type {
    margin-bottom: 0;
}

.dictionary-section-title {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dictionary-new-word-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.dictionary-new-word-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.dictionary-new-word-row .btn {
    white-space: nowrap;
}

.dictionary-new-word-hint {
    margin: 8px 0 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.dictionary-new-word-hint--error {
    color: #b45309;
    font-weight: 600;
}

#dictionary-new-word-section {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

#dictionary-search-section .toolbar-row {
    margin-top: 0;
}

.dictionary-current-hint {
    margin-top: 12px;
    flex-shrink: 0;
}

.dictionary-current-hint .dictionary-item {
    margin: 0;
}

.dictionary-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    margin-top: 12px;
    padding: 4px;
}

.dictionary-status {
    text-align: center;
    color: var(--text-muted);
    padding: 10px 12px;
    font-size: 0.88rem;
}

.dictionary-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dictionary-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(47, 111, 237, 0.12);
}

.dictionary-item--hint-pick {
    cursor: default;
}

.dictionary-item--hint-pick:hover {
    border-color: var(--border);
}

.dictionary-item--current-hint {
    cursor: default;
    border-color: #b8d4f0;
    background: #f0f7ff;
}

.dictionary-item--current-hint strong {
    color: var(--primary);
}

.dictionary-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 4px;
}

.dictionary-item-title {
    font-size: 1rem;
}

.dictionary-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dictionary-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #92d7ff;
    border: 1px solid #7ec8f5;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0c4a6e;
    white-space: nowrap;
}

.dictionary-meta-chip--last-use-recent {
    background: #fecaca;
    border-color: #fca5a5;
    color: #991b1b;
}

.dictionary-meta-chip--last-use-medium {
    background: #fde68a;
    border-color: #fcd34d;
    color: #92400e;
}

.dictionary-meta-chip--last-use-old {
    background: #bbf7d0;
    border-color: #86efac;
    color: #166534;
}

.dictionary-meta-chip--last-use-none {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
}

.dictionary-item small {
    display: block;
    color: var(--text-muted);
    margin-top: 4px;
}

.dictionary-hints {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.dictionary-hint-option {
    width: 100%;
    text-align: right;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    line-height: 1.5;
}

.dictionary-hint-option:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.modal-wide {
    width: min(960px, 100%);
}

#test-modal .modal {
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    min-height: min(78vh, 760px);
    max-height: min(92vh, 900px);
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: contain;
}

#test-modal .modal-header,
#test-modal .test-hud,
#test-modal .test-hint-guide,
#test-modal .test-hint-toolbar,
#test-modal .modal-actions {
    flex-shrink: 0;
}

.test-play-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(58vh, 540px);
    overflow: hidden;
    margin-bottom: 4px;
}

.test-answers-panel {
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-inline: 4px;
    border-inline-start: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

.test-board-panel {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}

#test-modal .editor-board--test {
    width: fit-content;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: clamp(8px, 1.5vw, 14px);
    box-sizing: border-box;
    container-type: normal;
}

.test-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.test-coins {
    font-weight: 700;
    color: var(--text-muted);
}

.test-current-word {
    flex: 1;
    min-height: 28px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
}

.test-hint-guide {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fffbeb;
    max-height: min(22vh, 180px);
    overflow-y: auto;
}

.test-hint-guide h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.test-hint-guide pre {
    margin: 0 0 10px;
    white-space: pre-wrap;
    font: inherit;
    line-height: 1.7;
}

.test-answer-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
}

.test-answer-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.test-answer-label {
    font-weight: 700;
    min-width: 22px;
    padding-top: 6px;
}

.test-answer-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.test-answer-slot {
    width: clamp(26px, 3.6vw, 34px);
    height: clamp(26px, 3.6vw, 34px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    font-weight: 700;
    font-size: clamp(0.78rem, 1.8vw, 0.95rem);
    flex-shrink: 0;
}

.test-answer-slot.revealed {
    background: #fff;
}

.test-answer-slot.solved {
    background: #dcfce7;
    border-color: #86efac;
}

.test-answer-hint {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    padding-inline-start: 30px;
}

.test-hint-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.test-selected-word {
    min-height: 28px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.test-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.test-answer-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.test-answer-chip.solved {
    background: #dcfce7;
    border-color: #86efac;
    text-decoration: line-through;
    opacity: 0.7;
}

.editor-tile.test-selected {
    background: #fde68a;
    border-color: #f59e0b;
}

.editor-tile.test-solved {
    background: #e5e7eb;
    color: transparent;
    border-color: #d1d5db;
    pointer-events: none;
}

.editor-tile.test-hint-revealed {
    background: #bbf7d0;
    border-color: #22c55e;
}

.test-grid {
    touch-action: none;
    user-select: none;
    cursor: grab;
    margin: 0 auto;
    width: fit-content;
    max-width: 100%;
    --tile-size: 40px;
}

.test-grid .editor-tile {
    cursor: inherit;
}

.test-grid .editor-tile:hover {
    transform: none;
}

.test-grid:active {
    cursor: grabbing;
}

textarea {
    font: inherit;
}

/* Editor responsive — must come after base editor rules */
@container editor-board (max-width: 9999px) {
    .editor-grid:not(.test-grid) {
        --tile-size: clamp(
            36px,
            calc(
                (
                    min(100cqw, 520px)
                    - 2 * clamp(14px, 2.5vw, 24px)
                    - (var(--grid-cols) - 1) * clamp(5px, 1.2vw, 10px)
                ) / var(--grid-cols)
            ),
            96px
        );
    }
}

@media (max-width: 1100px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-main {
        order: 1;
        min-height: 240px;
        padding: 16px;
    }

    .editor-sidebar {
        order: 2;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .word-list {
        flex: none;
        max-height: min(320px, 45vh);
    }
}

@media (max-width: 640px) {
    #test-modal .modal {
        min-height: 0;
        max-height: 94vh;
        padding: 16px;
    }

    .test-play-area {
        grid-template-columns: 1fr;
        max-height: none;
        overflow: visible;
    }

    .test-answers-panel {
        order: 2;
        max-height: min(34vh, 260px);
        border-inline-start: none;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }

    .test-board-panel {
        order: 1;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    #test-modal .modal {
        max-height: 94vh;
        padding: 16px;
    }
}

@media (max-width: 720px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .app-header-welcome {
        justify-content: center;
    }

    .app-header-actions {
        justify-content: center;
    }

    .editor-page {
        padding-inline: 12px;
        padding-bottom: 140px;
    }

    .editor-topbar {
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: center;
    }

    .editor-topbar-center {
        order: -1;
    }

    .editor-topbar-left,
    .grid-size-label {
        justify-content: center;
    }

    .editor-footer-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }

    .editor-message--footer {
        order: -1;
        max-width: none;
        width: 100%;
        text-align: right;
    }

    .editor-footer-group {
        width: 100%;
        justify-content: center;
    }

    .editor-footer-group .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        font-size: 0.88rem;
        padding: 10px 8px;
    }

    .hint-row {
        grid-template-columns: 1fr;
    }

    .hint-row label {
        padding-top: 0;
    }

    .hint-row .btn {
        width: 100%;
        margin-top: 0;
    }

    .path-hint {
        width: 100%;
        font-size: 0.85rem;
    }

    .section-heading--inset {
        padding-inline: 16px;
    }

    .hints-list {
        grid-template-columns: 1fr;
        padding-inline: 16px;
    }
}

@media (max-width: 400px) {
    .editor-footer-group .btn {
        flex: 1 1 100%;
    }

    .grid-size-label-text {
        display: none;
    }
}

/* Super admin panel */
.page--wide {
    width: min(1120px, calc(100% - 32px));
}

.super-admin-login-card {
    border-top: 4px solid #c9a227;
}

.super-admin-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde68a, #c9a227);
    color: #422006;
    font-size: 0.78rem;
    font-weight: 700;
}

.super-admin-login-note {
    margin-top: 20px;
    margin-bottom: 0;
    font-size: 0.88rem;
}

.super-admin-login-note a {
    color: var(--primary);
    text-decoration: underline;
}

.super-admin-header .super-admin-icon {
    background: linear-gradient(135deg, #fde68a, #b45309);
}

.super-admin-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.super-admin-intro h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.super-admin-intro p {
    margin: 0;
    color: var(--text-muted);
}

.super-admin-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.super-admin-search {
    min-width: 0;
}

.field-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.users-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.users-table-head,
.users-table-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1.1fr 1.2fr;
    gap: 12px;
    align-items: center;
}

.users-table-head {
    padding: 0 14px 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.users-table-row {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.users-table-row--banned {
    opacity: 0.78;
    background: #fff7f7;
}

.users-table-username {
    font-weight: 600;
}

.users-table-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.users-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.swap-requests-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swap-requests-head,
.swap-requests-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.swap-requests-head {
    padding: 0 12px 8px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.swap-requests-row {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.swap-requests-levels {
    font-weight: 700;
}

.swap-requests-date {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.swap-requests-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.role-chip--admin {
    background: #e8f0ff;
    color: #2457be;
}

.role-chip--designer {
    background: #fef3c7;
    color: #92400e;
}

.status-chip--active {
    background: #e8f8ef;
    color: #1f7a4c;
}

.status-chip--banned {
    background: #ffe9e9;
    color: var(--danger);
}

.empty-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.login-footer-links {
    margin-top: 20px;
    margin-bottom: 0;
    font-size: 0.88rem;
}

.login-footer-links a {
    color: var(--primary);
    text-decoration: underline;
}

@media (max-width: 860px) {
    .super-admin-toolbar {
        grid-template-columns: 1fr;
    }

    .users-table-head {
        display: none;
    }

    .users-table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .users-table-actions {
        padding-top: 4px;
    }
}

.field-hint {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.field-checkbox {
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    line-height: 1.6;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Account: force password + profile */
.modal-backdrop--blocking {
    z-index: 80;
    background: rgba(12, 20, 34, 0.82);
}

.modal--blocking,
.modal--profile {
    width: min(460px, 100%);
}

.modal-lead {
    margin: 0 0 18px;
    color: var(--text-muted);
    line-height: 1.7;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-username {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.profile-role {
    margin: 0;
    color: var(--text-muted);
}

.profile-meta {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.profile-stat strong {
    font-size: 1.35rem;
    line-height: 1.2;
}

.profile-stat span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.profile-stat--approved {
    background: #e8f8ef;
    border-color: #b7e4c7;
}

.profile-stat--rejected {
    background: #fff1f1;
    border-color: #ffcaca;
}

@media (min-width: 520px) {
    .profile-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .profile-stat:first-child {
        grid-column: span 3;
    }
}
