:root {
    --panel-primary: #010034;
    --panel-primary-700: #070660;
    --panel-primary-soft: #eef2ff;
    --panel-accent: #4f46e5;
    --panel-accent-2: #14b8a6;
    --panel-bg: #f6f7fb;
    --panel-surface: #ffffff;
    --panel-border: #dfe3f1;
    --panel-text: #17172f;
    --panel-muted: #667085;
}

html, body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--panel-bg);
    color: var(--panel-text);
}

/* Critical shell styles are global so the panel layout survives scoped CSS cache mismatches. */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

main {
    flex: 1;
}

.sidebar {
    background: var(--panel-primary);
    box-shadow: 1px 0 22px rgba(1, 0, 52, 0.18);
}

.sidebar .top-row {
    background-color: rgba(255, 255, 255, 0.06);
    min-height: 3.5rem;
}

.sidebar .navbar-brand {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
}

.sidebar .navbar-toggler {
    appearance: none;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    height: 2.5rem;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    width: 3.5rem;
}

.sidebar .navbar-toggler:checked {
    background-color: rgba(255, 255, 255, 0.5);
}

.sidebar .mobile-nav-backdrop,
.sidebar .mobile-menu-tools {
    display: none;
}

.sidebar .nav-scrollable {
    display: none;
}

.sidebar .navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

.sidebar .bi {
    align-items: center;
    background-size: cover;
    display: inline-flex;
    flex: 0 0 auto;
    height: 1.25rem;
    justify-content: center;
    margin-right: 0.75rem;
    position: relative;
    top: 0;
    width: 1.25rem;
    font-size: 1rem;
    line-height: 1;
}

.sidebar .bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.sidebar .bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.sidebar .bi-people-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H7Zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-5.216 6A2.238 2.238 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.325 6.325 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1h4.784ZM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3C/svg%3E");
}

.sidebar .nav-item,
.sidebar .nav-section {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-link,
.sidebar .nav-group-toggle {
    align-items: center;
    background: none;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    min-height: 3rem;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active,
.sidebar .nav-group-toggle:hover,
.sidebar .nav-group-toggle[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar .nav-group-toggle span:nth-child(2) {
    flex: 1;
}

.sidebar .chevron {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    display: inline-block;
    height: 0.5rem;
    margin-left: auto;
    transform: rotate(45deg);
    width: 0.5rem;
}

.sidebar .chevron.open {
    transform: rotate(225deg);
}

.sidebar .submenu {
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    display: none;
    margin: 0.15rem 0 0.25rem 1.6rem;
    padding-left: 0.7rem;
}

.sidebar .submenu.show {
    display: grid;
    gap: 0.25rem;
}

.sidebar .submenu-link {
    align-items: center;
    border: 0;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.68);
    display: flex;
    font-size: 0.86rem;
    gap: 0.55rem;
    line-height: 1.2;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    width: 100%;
}

.sidebar .submenu-link:hover,
.sidebar .submenu-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.sidebar .nav-link.disabled,
.sidebar .submenu-link.disabled {
    color: rgba(215, 215, 215, 0.46);
    cursor: default;
    pointer-events: none;
}

.sidebar .submenu-logout-form {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    margin: 0.35rem 0 0;
    padding-top: 0.35rem;
}

.sidebar .submenu-logout-form .logout-button {
    background: transparent;
    color: #f1d7d2;
    text-align: left;
}

.sidebar .logout-form {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.sidebar .logout-button {
    background: none;
    border: none;
    border-radius: 4px;
    color: #f1d7d2;
    min-height: 2.75rem;
    text-align: left;
    width: 100%;
}

main > .top-row {
    align-items: center;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    gap: 0.75rem;
    height: 3.5rem;
    justify-content: flex-end;
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 640.98px) {
    main {
        padding-bottom: calc(4.8rem + env(safe-area-inset-bottom));
    }

    main > .top-row .language-selector,
    main > .top-row .domain-selector {
        display: none;
    }

    .sidebar .navbar-toggler {
        z-index: 1003;
    }

    .sidebar .mobile-nav-backdrop {
        background: rgba(15, 23, 42, 0.42);
        inset: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        transition: opacity 180ms ease;
        z-index: 1001;
    }

    .sidebar .navbar-toggler:checked ~ .mobile-nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar .nav-scrollable {
        background: var(--panel-primary);
        box-shadow: 18px 0 36px rgba(15, 23, 42, 0.22);
        display: block;
        height: 100dvh;
        left: 0;
        max-width: 21rem;
        overflow-y: auto;
        padding-bottom: 1.5rem;
        padding-top: 0.75rem;
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        transition: transform 220ms ease;
        width: min(86vw, 21rem);
        z-index: 1002;
    }

    .sidebar .navbar-toggler:checked ~ .nav-scrollable {
        transform: translateX(0);
    }

    .sidebar .mobile-menu-tools {
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
        display: grid;
        gap: 0.75rem;
        margin-bottom: 0.5rem;
        padding-bottom: 1rem;
        padding-top: 3.25rem;
    }

    .sidebar .mobile-menu-tools .language-selector,
    .sidebar .mobile-menu-tools .domain-selector {
        align-items: stretch;
        display: grid;
        gap: 0.35rem;
    }

    .sidebar .mobile-menu-tools .language-label,
    .sidebar .mobile-menu-tools .domain-label {
        color: #b9cbc6;
    }

    .sidebar .mobile-menu-tools .language-select,
    .sidebar .mobile-menu-tools .domain-select {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.24);
        color: #fff;
        min-height: 2.4rem;
        width: 100%;
    }

    .sidebar .mobile-menu-tools .language-select option {
        color: var(--panel-text);
    }

    .mobile-bottom-nav {
        align-items: center;
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #dfe7e2;
        bottom: 0;
        box-shadow: 0 -12px 28px rgba(16, 42, 42, 0.12);
        display: grid;
        gap: 0.25rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        left: 0;
        padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        z-index: 1000;
    }

    .mobile-bottom-link {
        align-items: center;
        border-radius: 8px;
        color: #52605b;
        display: grid;
        font-size: 0.69rem;
        font-weight: 600;
        gap: 0.22rem;
        justify-items: center;
        min-height: 3.65rem;
        padding: 0.35rem 0.2rem;
        text-decoration: none;
    }

    .mobile-bottom-link.active,
    .mobile-bottom-link:hover {
        background: #e9f5ef;
        color: #173b36;
        text-decoration: none;
    }

    .mobile-bottom-icon {
        align-items: center;
        background: #f8faf7;
        border: 1px solid #d9e4df;
        border-radius: 8px;
        display: inline-flex;
        height: 1.9rem;
        justify-content: center;
        position: relative;
        width: 1.9rem;
    }

    .mobile-bottom-icon::before {
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        content: "";
        height: 1.18rem;
        width: 1.18rem;
    }

    .mobile-bottom-icon.kpss::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 20 20'%3E%3Cpath fill='%23176b5d' d='M3 4.5A2.5 2.5 0 0 1 5.5 2H17v13.5A2.5 2.5 0 0 1 14.5 18H5.25A2.25 2.25 0 0 1 3 15.75V4.5Zm3 1.25c0 .414.336.75.75.75h6.5a.75.75 0 0 0 0-1.5h-6.5a.75.75 0 0 0-.75.75Zm0 3c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75Zm0 3c0 .414.336.75.75.75h5.5a.75.75 0 0 0 0-1.5h-5.5a.75.75 0 0 0-.75.75Z'/%3E%3C/svg%3E");
    }

    .mobile-bottom-icon.whatsapp {
        background: #e7f8ef;
        border-color: #bfe8d0;
    }

    .mobile-bottom-icon.whatsapp::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 32 32'%3E%3Cpath fill='%2325D366' d='M16.01 3.2A12.7 12.7 0 0 0 5.2 22.56L3.6 28.8l6.38-1.52A12.7 12.7 0 1 0 16.01 3.2Z'/%3E%3Cpath fill='%23fff' d='M12.1 9.4c-.28-.62-.58-.63-.85-.64h-.72c-.25 0-.65.09-.99.46-.34.37-1.3 1.27-1.3 3.1s1.33 3.59 1.52 3.84c.18.25 2.57 4.12 6.36 5.61 3.15 1.24 3.8.99 4.49.93.69-.06 2.22-.91 2.53-1.78.31-.87.31-1.62.22-1.78-.09-.15-.34-.25-.71-.43-.37-.19-2.22-1.1-2.56-1.22-.34-.12-.59-.19-.84.19-.25.37-.96 1.22-1.18 1.47-.22.25-.43.28-.81.09-.37-.19-1.58-.58-3-1.85-1.11-.99-1.86-2.21-2.08-2.59-.22-.37-.02-.57.16-.76.17-.17.37-.43.56-.65.19-.22.25-.37.37-.62.12-.25.06-.47-.03-.65-.09-.19-.82-2.04-1.14-2.72Z'/%3E%3C/svg%3E");
    }

    .mobile-bottom-icon.ai::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 20 20'%3E%3Cpath fill='%236B4EFF' d='m10 1.75 1.54 4.55 4.71 1.2-4.71 1.2L10 13.25 8.46 8.7 3.75 7.5l4.71-1.2L10 1.75Zm5.1 9.35.86 2.55 2.54.85-2.54.85-.86 2.55-.85-2.55-2.55-.85 2.55-.85.85-2.55ZM5.15 12.2l.62 1.86 1.88.64-1.88.63-.62 1.87-.64-1.87-1.86-.63 1.86-.64.64-1.86Z'/%3E%3C/svg%3E");
    }

    .mobile-bottom-icon.google::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M21.6 12.23c0-.73-.07-1.43-.19-2.11H12v4h5.38a4.6 4.6 0 0 1-1.99 3.02v2.51h3.23c1.89-1.74 2.98-4.3 2.98-7.42Z'/%3E%3Cpath fill='%2334A853' d='M12 22c2.7 0 4.96-.9 6.62-2.35l-3.23-2.51c-.9.6-2.04.95-3.39.95-2.6 0-4.8-1.76-5.58-4.12H3.08v2.59A10 10 0 0 0 12 22Z'/%3E%3Cpath fill='%23FBBC05' d='M6.42 13.97A6 6 0 0 1 6.1 12c0-.68.12-1.34.32-1.97V7.44H3.08A10 10 0 0 0 2 12c0 1.61.39 3.14 1.08 4.56l3.34-2.59Z'/%3E%3Cpath fill='%23EA4335' d='M12 5.91c1.47 0 2.78.5 3.82 1.49l2.87-2.87A9.62 9.62 0 0 0 12 2a10 10 0 0 0-8.92 5.44l3.34 2.59C7.2 7.67 9.4 5.91 12 5.91Z'/%3E%3C/svg%3E");
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        height: 100vh;
        position: sticky;
        top: 0;
        width: 250px;
    }

    .sidebar .navbar-toggler {
        display: none;
    }

    .sidebar .nav-scrollable {
        display: block;
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }

    main > .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }
}

input{
    border:1px solid silver!important;
}

a, .btn-link {
    color: var(--panel-primary-700);
}

.btn-primary {
    color: #fff;
    background-color: var(--panel-primary);
    border-color: var(--panel-primary);
}

.btn-primary:hover {
    background-color: var(--panel-primary-700);
    border-color: var(--panel-primary-700);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(1, 0, 52, 0.28);
}

.content {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

h1:focus {
    outline: none;
}

h1 {
    font-weight: 600;
    letter-spacing: 0;
    margin-bottom: 0.7rem;
}

.lead {
    color: var(--panel-muted);
    max-width: 58rem;
}

.eyebrow {
    color: var(--panel-accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.hero-panel,
.tool-panel {
    /*display: grid;*/
    gap: 1.5rem;
    align-items: center;
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    box-shadow: 0 18px 45px rgba(1, 0, 52, 0.08);
}

.hero-panel {
    grid-template-columns: minmax(0, 1fr) auto;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
}

.metric-card span,
.counter-readout span {
    display: block;
    color: #6c756f;
    font-size: 0.85rem;
}

.metric-card strong {
    display: block;
    font-size: 1.25rem;
    margin-top: 0.2rem;
}

.counter-readout {
    background: var(--panel-primary);
    border-radius: 8px;
    color: #fff;
    max-width: 18rem;
    padding: 1.25rem;
}

.counter-readout strong {
    display: block;
    font-size: 3rem;
    line-height: 1;
    margin-top: 0.35rem;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.language-selector,
.domain-selector {
    align-items: center;
    display: inline-flex;
    gap: 0.4rem;
}

.language-label,
.domain-label {
    color: var(--panel-muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0;
}

.language-select,
.domain-select {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--panel-text);
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
}

.domain-select {
    min-width: 12rem;
    max-width: 16rem;
}

.domain-picker-button {
    text-align: left;
}

.login-language-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.login-language-row .eyebrow {
    margin-bottom: 0;
}

.table {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
}

.customer-table {
    box-shadow: 0 18px 45px rgba(46, 35, 21, 0.06);
    overflow: visible;
}

body.study-copy-guard-active .study-shell,
body.study-copy-guard-active .focus-shell,
body.study-copy-guard-active .study-modal-backdrop,
body.study-copy-guard-active .question-modal-backdrop,
body.study-copy-guard-active .mini-exam-modal-backdrop,
body.study-copy-guard-active .material-viewer-backdrop {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body.study-copy-guard-active .study-shell img,
body.study-copy-guard-active .focus-shell img,
body.study-copy-guard-active .study-shell svg,
body.study-copy-guard-active .focus-shell svg,
body.study-copy-guard-active .study-modal-backdrop img,
body.study-copy-guard-active .question-modal-backdrop img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

body.study-copy-guard-active .study-shell input,
body.study-copy-guard-active .study-shell textarea,
body.study-copy-guard-active .focus-shell input,
body.study-copy-guard-active .focus-shell textarea,
body.study-copy-guard-active .study-modal-backdrop input,
body.study-copy-guard-active .study-modal-backdrop textarea,
body.study-copy-guard-active .question-modal-backdrop input,
body.study-copy-guard-active .question-modal-backdrop textarea {
    -webkit-user-select: text;
    user-select: text;
}

@media print {
    body.study-copy-guard-active .study-shell,
    body.study-copy-guard-active .focus-shell,
    body.study-copy-guard-active .study-modal-backdrop,
    body.study-copy-guard-active .question-modal-backdrop,
    body.study-copy-guard-active .mini-exam-modal-backdrop,
    body.study-copy-guard-active .material-viewer-backdrop {
        display: none !important;
    }

    body.study-copy-guard-active::before {
        content: "Bu calisma alani yazdirma ve kopyalama icin kapatilmistir.";
        display: block;
        padding: 2rem;
        font: 700 18px/1.5 system-ui, sans-serif;
        color: #111827;
    }
}

.customer-table th {
    color: var(--panel-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
}

.data-grid-panel {
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(46, 35, 21, 0.06);
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 1rem;
}

.data-grid-toolbar {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.data-grid-toolbar h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.grid-search {
    min-width: min(100%, 22rem);
}

.product-toolbar-actions {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.data-grid-meta {
    align-items: center;
    color: var(--panel-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.86rem;
    gap: 0.65rem;
    justify-content: space-between;
}

.data-grid-scroll {
    overflow-x: auto;
}

.professional-grid {
    margin: 0;
    min-width: 58rem;
}

.professional-grid tbody tr:hover {
    background: #f6f1e8;
}

.grid-sort-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: inline-flex;
    font: inherit;
    gap: 0.25rem;
    padding: 0;
    text-align: left;
    text-transform: inherit;
}

.grid-sort-button:hover {
    color: #176b5d;
}

.grid-type-pill {
    background: #dceee7;
    border-radius: 999px;
    color: #176b5d;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
}

.seo-url-cell {
    color: #42504a;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.muted-line {
    color: #6c756f;
    display: block;
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.customer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.customer-list-toolbar,
.customer-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin: 0 0 0.75rem;
}

.customer-list-summary {
    align-items: center;
    color: var(--panel-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.92rem;
    gap: 0.55rem;
}

.customer-list-summary strong {
    color: var(--panel-ink);
    font-size: 1rem;
}

.customer-page-size {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.customer-page-size .form-label {
    margin: 0;
    white-space: nowrap;
}

.customer-row-menu {
    display: inline-flex;
    justify-content: flex-end;
    position: relative;
}

.customer-row-menu-button {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
}

.customer-row-menu-panel {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.15);
    display: grid;
    min-width: 9.5rem;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
}

.customer-row-menu-panel a,
.customer-row-menu-panel button {
    background: transparent;
    border: 0;
    color: var(--panel-ink);
    font: inherit;
    padding: 0.65rem 0.85rem;
    text-align: left;
    text-decoration: none;
}

.customer-row-menu-panel a:hover,
.customer-row-menu-panel button:hover {
    background: #f6f1e8;
}

.customer-row-menu-panel .danger {
    color: #a33a2f;
}

.customer-pagination {
    justify-content: flex-end;
    margin: 0.75rem 0 0;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
}

.status-pill.active {
    background: #dceee7;
    color: #176b5d;
}

.status-pill.passive {
    background: #ece7dd;
    color: #6b6256;
}

.status-pill.danger {
    background: #f7dddd;
    color: #9d2f2f;
}

.status-pill.success {
    background: #dcfce7;
    color: #166534;
}

.status-pill.warning {
    background: #fff3cd;
    color: #8a5a00;
}

.json-import-panel {
    border-top: 1px solid #e2e8f0;
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.panel-title.compact h3 {
    font-size: 1rem;
}

.json-import-textarea {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    min-height: clamp(34rem, 62dvh, 720px);
    resize: vertical;
}

.json-import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.json-import-panel small {
    color: #64748b;
    line-height: 1.45;
}

.admin-question-review {
    align-items: stretch;
}

.admin-review-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.admin-review-toolbar .form-select {
    max-width: 220px;
}

.admin-question-review-list {
    display: grid;
    gap: 0.85rem;
}

.admin-question-card {
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 1rem;
}

.admin-question-card header,
.admin-question-card footer,
.admin-question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: space-between;
}

.admin-question-actions {
    justify-content: flex-end;
}

.admin-question-prompt {
    margin-top: 0.85rem;
}

.question-visual {
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 0.8rem;
    overflow: hidden;
    padding: 0.75rem;
}

.question-visual svg {
    display: block;
    height: auto;
    max-height: 320px;
    max-width: 100%;
    width: 100%;
}

.admin-choice-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.admin-choice {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.55rem;
    align-items: start;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.65rem;
    background: #f8fafc;
}

.admin-choice span {
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
}

.admin-choice.correct {
    border-color: #86efac;
    background: #f0fdf4;
}

.admin-choice.correct span {
    background: #22c55e;
    color: #ffffff;
}

.admin-question-explanation {
    margin-top: 0.85rem;
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    padding: 0.75rem;
}

.admin-question-card footer {
    justify-content: flex-start;
    color: #64748b;
    font-size: 0.86rem;
    margin-top: 0.85rem;
}

.form-panel {
    align-items: stretch;
}

.filter-panel {
    align-items: stretch;
    gap: 0.75rem;
}

.filter-panel h1 {
    font-size: 1.25rem;
}

.filter-count {
    align-items: center;
    color: var(--panel-muted);
    display: inline-flex;
    font-size: 0.92rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid-3 .span-3 {
    grid-column: 1 / -1;
}

.form-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.login-shell {
    align-items: center;
    background-image:
        linear-gradient(rgba(248, 249, 255, 0.78), rgba(247, 249, 255, 0.82)),
        var(--login-background-image, none),
        radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.20), transparent 34%),
        radial-gradient(circle at 88% 80%, rgba(20, 184, 166, 0.14), transparent 30%),
        linear-gradient(135deg, #f8f9ff 0%, #eef2ff 48%, #f7f9ff 100%);
    background-position: center, center, 12% 18%, 88% 80%, center;
    background-repeat: no-repeat;
    background-size: cover, cover, auto, auto, cover;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(1rem, 4vw, 3rem);
}

.login-stage {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(1, 0, 52, 0.10);
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(1, 0, 52, 0.18);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(22rem, 0.92fr);
    max-width: 1040px;
    min-height: 620px;
    overflow: hidden;
    width: min(100%, 1040px);
}

.login-visual {
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--login-primary-color, #010034) 96%, #000 4%), color-mix(in srgb, var(--login-accent-color, #14b8a6) 28%, var(--login-primary-color, #010034) 72%)),
        var(--panel-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: clamp(2rem, 5vw, 3.5rem);
    position: relative;
}

.login-visual::before,
.login-visual::after {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    content: "";
    position: absolute;
}

.login-visual::before {
    height: 18rem;
    right: -5rem;
    top: -4rem;
    width: 18rem;
}

.login-visual::after {
    bottom: -7rem;
    height: 22rem;
    left: -7rem;
    width: 22rem;
}

.login-brand-mark {
    align-items: center;
    background: #fff;
    border-radius: 8px;
    color: var(--panel-primary);
    display: inline-flex;
    font-size: 1.25rem;
    font-weight: 900;
    height: 3.1rem;
    justify-content: center;
    position: relative;
    width: 3.1rem;
    z-index: 1;
}

.login-brand-logo {
    background: #fff;
    border-radius: 8px;
    display: block;
    max-height: 8.2rem;
    max-width: 12rem;
    object-fit: contain;
    padding: .45rem .65rem;
    position: relative;
    z-index: 1;
}

.login-visual-copy {
    position: relative;
    z-index: 1;
}

.login-visual-copy .eyebrow {
    color: rgba(255, 255, 255, 0.70);
}

.login-visual-copy h2 {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    margin: 0 0 1rem;
    max-width: 10ch;
}

.login-visual-copy p:last-child {
    color: rgba(255, 255, 255, 0.74);
    font-size: 1rem;
    line-height: 1.65;
    max-width: 27rem;
}

.login-visual-metrics {
    align-items: center;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    position: relative;
    z-index: 1;
}

.login-visual-metrics span {
    color: rgba(255, 255, 255, 0.70);
    font-weight: 700;
}

.login-visual-metrics strong {
    font-size: 1.5rem;
}

.login-panel {
    align-self: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    padding: clamp(2rem, 5vw, 3.5rem);
    width: 100%;
}

.login-panel h1 {
    color: var(--panel-primary);
    font-size: clamp(2rem, 4vw, 2.7rem);
    margin-bottom: 0.5rem;
}

.login-panel .lead {
    margin-bottom: 1.8rem;
}

.login-panel .form-label {
    color: #2b2b46;
    font-weight: 600;
}

.login-panel .form-control {
    border-color: #d8dced !important;
    border-radius: 8px;
    min-height: 3rem;
}

.login-action-links {
    border-bottom: 1px solid #edf0f7;
    display: grid;
    gap: .75rem;
    margin: 1rem 0 1.35rem;
    padding-bottom: 1.25rem;
}

.login-action-links a {
    align-items: center;
    color: #0f8fc6;
    display: inline-flex;
    font-size: .94rem;
    font-weight: 700;
    gap: .45rem;
    text-decoration: none;
    width: fit-content;
}

.login-action-links a:hover {
    color: var(--panel-primary);
    text-decoration: underline;
}

.login-action-links i {
    color: #687184;
    font-size: 1rem;
}

.login-social-panel {
    display: grid;
    gap: .85rem;
}

.login-social-panel > span {
    color: #22263a;
    font-size: .94rem;
}

.login-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.login-social-button {
    align-items: center;
    background: #f1f2f5;
    border: 1px solid #e1e5ee;
    border-radius: 4px;
    box-shadow: 0 .18rem .35rem rgba(15, 23, 42, .12);
    color: #344054;
    display: inline-flex;
    font-size: 1.25rem;
    height: 2.6rem;
    justify-content: center;
    opacity: 1;
    padding: 0;
    width: 2.6rem;
}

.login-social-button.google {
    background: #ffffff;
    color: #4285f4;
}

.login-social-button.facebook {
    background: #2465d6;
    color: #ffffff;
}

.login-social-button.apple {
    background: #111827;
    color: #ffffff;
}

.login-social-button:disabled {
    cursor: default;
}

@media (max-width: 820px) {
    .login-shell {
        overflow: auto;
    }

    .login-stage {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .login-visual {
        min-height: 18rem;
    }

    .login-visual-copy h2 {
        max-width: 12ch;
    }

    .signup-login-panel {
        max-height: none;
    }

    .signup-panel-heading {
        display: grid;
    }
}

.signup-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem 1rem;
}

.signup-login-shell .login-stage {
    min-height: 660px;
}

.signup-login-panel {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: min(92vh, 760px);
    overflow: auto;
}

.signup-panel-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.signup-panel-heading h1 {
    color: var(--panel-primary);
    font-size: clamp(2rem, 4vw, 2.7rem);
    margin: 0 0 .45rem;
}

.signup-panel-heading .lead {
    margin: 0;
}

.signup-step-counter {
    align-items: center;
    background: #eef4ff;
    border: 1px solid #cbd8ff;
    border-radius: 999px;
    color: var(--panel-primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .92rem;
    font-weight: 900;
    min-height: 2.25rem;
    padding: .35rem .8rem;
}

.signup-form-stack {
    display: grid;
    gap: .8rem;
}

.signup-form-stack .mb-3 {
    display: grid;
    gap: .45rem;
}

.auth-mode-link {
    color: var(--panel-primary-700);
    font-size: .92rem;
    font-weight: 600;
    justify-self: center;
    text-decoration: none;
}

.auth-mode-link:hover {
    color: var(--panel-primary);
    text-decoration: underline;
}

.signup-panel {
    background: #fff;
    border: 1px solid #d8e1da;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(33, 42, 38, 0.08);
    display: grid;
    gap: 1.25rem;
    max-width: 760px;
    padding: 1.5rem;
    width: 100%;
}

.signup-header {
    display: grid;
    gap: 0.35rem;
}

.signup-header h1 {
    color: #21342f;
    font-size: 2rem;
    margin: 0;
}

.signup-steps {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, 1fr);
}

.signup-steps span {
    align-items: center;
    background: #eef3ef;
    border-radius: 999px;
    color: var(--panel-muted);
    display: inline-flex;
    font-weight: 600;
    height: 2rem;
    justify-content: center;
}

.signup-steps span.active {
    background: #176b5d;
    color: #fff;
}

.signup-code-box {
    background: #f3faf6;
    border: 1px solid #cde4d7;
    border-radius: 8px;
    display: grid;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 1rem;
}

.signup-code-box strong {
    color: #176b5d;
    font-size: 1.5rem;
}

.signup-code-box small,
.signup-choice span {
    color: var(--panel-muted);
}

.signup-choice-tabs {
    background: #eef3ef;
    border-radius: 8px;
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 1rem;
    padding: 0.35rem;
}

.signup-choice-tabs button,
.signup-choice {
    border: 0;
    font: inherit;
}

.signup-choice-tabs button {
    background: transparent;
    border-radius: 6px;
    color: var(--panel-muted);
    font-weight: 600;
    padding: 0.65rem;
}

.signup-choice-tabs button.active {
    background: #fff;
    color: #176b5d;
    box-shadow: 0 1px 8px rgba(33, 42, 38, 0.08);
}

.signup-choice-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1rem;
}

.signup-choice-grid.compact {
    grid-template-columns: 1fr;
}

.signup-choice {
    background: #fff;
    border: 1px solid #d8e1da;
    border-radius: 8px;
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
    text-align: left;
}

.signup-choice.selected {
    border-color: #176b5d;
    box-shadow: 0 0 0 3px rgba(23, 107, 93, 0.12);
}

.signup-choice strong {
    color: #21342f;
}

.signup-complete {
    display: grid;
    gap: 1rem;
}

.signup-complete h2 {
    color: #21342f;
    margin: 0;
}

.signup-section {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.signup-section h2 {
    color: #21342f;
    font-size: 1.1rem;
    margin: 0;
}

.signup-checkbox-list {
    display: grid;
    gap: 0.65rem;
    max-height: 320px;
    overflow: auto;
    padding-right: 0.25rem;
}

.signup-check-row {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #d8e1da;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
}

.signup-check-row input {
    margin-top: 0.2rem;
}

.signup-check-row span {
    display: grid;
    gap: 0.2rem;
}

.signup-check-row small {
    color: var(--panel-muted);
}

@media (max-width: 820px) {
    .signup-login-panel {
        max-height: none;
    }

    .signup-panel-heading {
        display: grid;
    }
}

.credential-line {
    align-items: center;
    background: #f7f9f6;
    border: 1px solid #d8e1da;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
}

.study-exam-picker {
    display: grid;
    gap: 1rem;
}

.study-exam-picker-heading {
    display: grid;
    gap: 0.35rem;
}

.study-exam-picker-heading h1 {
    color: #21342f;
    margin: 0;
}

.study-exam-picker-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.study-exam-picker-card {
    background: #fff;
    border: 1px solid #d8e1da;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(33, 42, 38, 0.06);
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    text-align: left;
}

.study-exam-picker-card:hover {
    border-color: #176b5d;
    box-shadow: 0 0 0 3px rgba(23, 107, 93, 0.12);
}

.study-exam-picker-card span {
    color: #176b5d;
    font-size: 0.82rem;
    font-weight: 600;
}

.study-exam-picker-card strong {
    color: #21342f;
}

.study-exam-picker-card small {
    color: var(--panel-muted);
}

.permission-grid {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.permission-grid label {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.permission-title {
    color: var(--panel-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-switches {
    display: grid;
    gap: 0.8rem;
    align-content: center;
}

.password-action-row {
    align-items: stretch;
    display: grid;
    gap: .45rem;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
}

.password-action-row .password-input-wrap {
    min-width: 0;
}

.icon-action {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    padding: 0;
}

.image-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}

.image-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    margin-top: 1rem;
}

.image-card {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
}

.image-card img {
    aspect-ratio: 4 / 3;
    background: #ece7dd;
    display: block;
    object-fit: cover;
    width: 100%;
}

.image-card div {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
}

.image-card span {
    color: #6c756f;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.image-actions {
    margin-top: 0.35rem;
}

.inline-editor {
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
}

.image-select {
    max-width: 20rem;
}

.media-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
    margin-bottom: 1rem;
}

.media-library-add-button {
    align-items: center;
    display: inline-flex;
    gap: .45rem;
}

.media-tools-modal {
    max-width: 64rem;
    width: min(100%, 64rem);
}

.media-tools-tabs {
    background: #f8fafc;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    display: grid;
    gap: .35rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
    padding: .35rem;
}

.media-tools-tab {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #334155;
    display: inline-flex;
    font-weight: 600;
    gap: .45rem;
    justify-content: center;
    min-height: 2.35rem;
    padding: .45rem .75rem;
}

.media-tools-tab.active,
.media-tools-tab:hover {
    background: #ffffff;
    border-color: #9db8ff;
    color: #010034;
}

.media-tools-section {
    display: grid;
    gap: 1rem;
}

.upload-drop {
    align-items: center;
    background: #fff;
    border: 1px dashed #b9ad9b;
    border-radius: 8px;
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
}

.upload-drop span {
    color: var(--panel-muted);
    font-size: 0.9rem;
}

.selected-file {
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem;
}

.selected-file strong {
    overflow-wrap: anywhere;
}

.selected-file span {
    color: var(--panel-muted);
    font-size: 0.85rem;
}

.category-picker,
.category-tree {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
}

.category-picker label {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.media-category-management-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.media-category-management {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(14rem, .9fr) minmax(0, 1.1fr);
}

.media-library-tree {
    min-height: 18rem;
}

.media-category-editor {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.media-category-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.media-category-editor-toolbar .icon-action {
    height: 2rem;
    width: 2rem;
}

.selected-category-summary {
    background: #f8fafc;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    display: grid;
    gap: .15rem;
    padding: .75rem;
}

.selected-category-summary span {
    color: #385bd8;
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.selected-category-summary strong {
    color: #010034;
}

.selected-category-summary small {
    color: #64748b;
}

.media-choice {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.primary-choice {
    color: #176b5d;
    font-size: 0.8rem;
    font-weight: 600;
}

.content-media-panel {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.content-edit-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.content-type-step {
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(46, 35, 21, 0.06);
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.content-type-step-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.content-type-step-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.content-type-category-block {
    border-top: 1px solid #e6dac9;
    display: grid;
    gap: 0.85rem;
    padding-top: 1rem;
}

.content-type-category-block h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.content-type-card-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.content-type-card {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--panel-text);
    display: grid;
    gap: 0.35rem;
    min-height: 6rem;
    padding: 1rem;
    text-align: left;
}

.content-type-card:hover {
    background: #dceee7;
    border-color: #a7d2c2;
}

.content-type-card span {
    font-size: 1rem;
    font-weight: 600;
}

.content-type-card strong {
    color: var(--panel-muted);
    font-size: 0.86rem;
}

.content-type-card.category-card {
    min-height: 5rem;
}

.content-media-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.selected-media-strip {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.selected-media-preview {
    width: min(100%, 18rem);
    max-height: 8.5rem;
    object-fit: contain;
    display: block;
    padding: 0.35rem;
    background: #f8fafc;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
}

.selected-media-thumb {
    align-items: center;
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    gap: 0.5rem;
    max-width: 16rem;
    padding: 0.45rem 0.6rem;
}

.selected-media-thumb.primary {
    border-color: #176b5d;
    box-shadow: 0 0 0 2px rgba(23, 107, 93, 0.12);
}

.selected-media-thumb img {
    aspect-ratio: 1;
    border-radius: 6px;
    height: 2.5rem;
    object-fit: cover;
    width: 2.5rem;
}

.selected-media-thumb span {
    font-size: 0.85rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.modal-backdrop-custom {
    align-items: center;
    background: rgba(23, 29, 27, 0.55);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow: hidden;
    padding: 1.25rem;
    position: fixed;
    z-index: 1050;
}

.media-picker-backdrop {
    z-index: 3000 !important;
}

.swal2-container {
    z-index: 5000 !important;
}

.edit-modal {
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 1.5rem 4rem rgba(23, 29, 27, 0.24);
    display: flex;
    flex-direction: column;
    max-height: min(92dvh, 60rem);
    max-width: 76rem;
    overflow: hidden;
    width: min(100%, 76rem);
}

.edit-modal-header,
.edit-modal-footer {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.1rem;
}

.edit-modal-header {
    border-bottom: 1px solid #e6dac9;
}

    .edit-modal-header h2 {
        font-size: 1.3rem;
        font-weight: 600;
        margin: 0;
    }

.edit-modal-header .eyebrow {
    margin-bottom: .25rem;
}

.panel-modal-close {
    align-items: center;
    background: #fff;
    border: 1px solid #d8cdbc;
    border-radius: 50%;
    color: #3b332a;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.panel-modal-close:hover {
    background: #f7efe4;
    border-color: #c7b8a3;
    color: var(--panel-text);
}

.edit-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 1rem;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1rem 1.1rem 1.1rem;
}

.edit-modal-footer {
    border-top: 1px solid #e6dac9;
    justify-content: flex-end;
}

.edit-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
    width: 100%;
}

.campaign-edit-modal {
    max-width: 86rem;
    width: min(100%, 86rem);
}

.wide-modal,
.edit-modal-lg,
.edit-modal-xl {
    max-width: 86rem;
    width: min(100%, 86rem);
}

.sponsor-edit-modal {
    max-width: 48rem;
    width: min(100%, 48rem);
}

.mini-exam-modal {
    max-width: 48rem;
    width: min(100%, 48rem);
}

.password-modal {
    max-width: min(34rem, calc(100vw - 2rem)) !important;
    width: min(34rem, calc(100vw - 2rem)) !important;
}

.password-modal .edit-modal-body {
    padding: 1rem;
}

.password-modal .edit-modal-footer {
    padding: .85rem 1rem;
}

.mini-exam-modal .edit-modal-footer {
    gap: .65rem;
}

.question-editor-modal {
    max-height: min(94dvh, 68rem);
    max-width: 92rem;
    width: min(100%, 92rem);
}

.question-editor-modal .edit-modal-body {
    gap: .85rem;
}

.question-editor-modal .management-tabs {
    flex: 0 0 auto;
    margin-top: 0;
}

.question-editor-modal .form-grid {
    flex: 1 1 auto;
    margin: 0;
    min-height: 0;
}

.question-editor-modal .json-import-area {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    height: clamp(30rem, 58dvh, 48rem);
    min-height: clamp(30rem, 58dvh, 48rem);
    resize: vertical;
    width: 100%;
}

.question-editor-modal .raw-question-input-area {
    height: clamp(18rem, 34dvh, 30rem);
    min-height: clamp(18rem, 34dvh, 30rem);
}

.raw-question-editor-field {
    display: grid;
    gap: .45rem;
}

.raw-question-editor-field > span {
    color: var(--muted-text);
    font-size: .9rem;
    font-weight: 700;
}

.raw-question-editor-field .rich-editor-shell {
    min-height: clamp(24rem, 46dvh, 40rem);
}

.raw-question-editor-field .ckeditor-wrapper {
    min-height: clamp(18rem, 34dvh, 30rem);
}

.raw-question-editor-field .ck-editor__editable {
    min-height: clamp(18rem, 34dvh, 30rem);
}

.question-editor-modal .import-actions {
    align-items: center;
    flex: 0 0 auto;
}

.raw-question-queue {
    display: grid;
    gap: .65rem;
}

.raw-question-queue-item {
    border: 1px solid var(--border-color);
    border-radius: .85rem;
    display: grid;
    gap: .35rem;
    padding: .85rem 1rem;
}

.raw-question-queue-item div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: space-between;
}

.raw-question-queue-item span,
.raw-question-queue-item small {
    color: var(--muted-text);
}

.question-repair-modal {
    max-height: min(94dvh, 66rem);
    max-width: 78rem;
    width: min(100%, 78rem);
}

.study-material-editor-modal {
    max-height: min(94dvh, 70rem);
    max-width: 96rem;
    width: min(100%, 96rem);
}

.study-material-editor-modal .edit-modal-body {
    gap: 1rem;
}

.study-material-editor-modal .material-editor-tab-panel {
    min-height: 0;
}

.study-material-editor-modal .publisher-source-editor {
    min-height: 0;
}

.study-material-editor-modal .publisher-source-textarea {
    height: clamp(34rem, 62dvh, 52rem);
    min-height: clamp(34rem, 62dvh, 52rem);
}

.question-repair-tool,
.question-repair-diff-list {
    display: grid;
    gap: 1rem;
}

.question-repair-search {
    align-items: end;
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(12rem, 1fr) auto;
}

.question-repair-summary {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.question-repair-summary div {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: .85rem;
    padding: .85rem;
}

.question-repair-summary span,
.question-repair-diff span {
    color: #64748b;
    display: block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    margin-bottom: .35rem;
    text-transform: uppercase;
}

.question-repair-summary strong {
    color: #0f172a;
    display: block;
    font-size: 1.35rem;
}

.question-repair-diff {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: .85rem;
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: .9rem;
}

.question-repair-diff > strong {
    color: #0f172a;
    grid-column: 1 / -1;
}

.question-repair-diff textarea {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    min-height: 8rem;
    resize: vertical;
    white-space: pre-wrap;
}

.management-section-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .85rem;
}

.management-section-heading h2 {
    color: #0f172a;
    font-size: 1.15rem;
    margin: .1rem 0;
}

.management-section-heading p {
    color: #64748b;
    margin: 0;
}

.exam-question-list {
    margin-top: 1rem;
}

.exam-question-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: .85rem;
    color: #0f172a;
    cursor: pointer;
    display: grid;
    gap: .65rem;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    margin-bottom: .55rem;
    padding: .75rem .85rem;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    width: 100%;
}

.exam-question-row:hover {
    border-color: #94a3b8;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.exam-question-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-question-row > span:not(.status-pill) {
    color: #64748b;
    font-size: .82rem;
    white-space: nowrap;
}

.question-student-preview {
    display: grid;
    place-items: start center;
}

.student-question-card {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    display: grid;
    gap: 1rem;
    max-width: 48rem;
    padding: 1rem;
    width: 100%;
}

.student-question-prompt {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: .85rem;
    padding: 1rem;
}

.student-choice-list {
    display: grid;
    gap: .65rem;
}

.student-choice-item {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: .85rem;
    display: flex;
    gap: .85rem;
    padding: .75rem .9rem;
}

.student-choice-item span {
    align-items: center;
    background: #16416d;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 2.15rem;
    font-weight: 800;
    height: 2.15rem;
    justify-content: center;
}

.student-choice-item.correct {
    border-color: #22c55e;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .24);
}

.student-choice-item.correct span {
    background: #16a34a;
}

.question-solutions-editor {
    display: grid;
    gap: 1rem;
}

.question-solution-row {
    border: 1px solid #dbe4ef;
    border-radius: .85rem;
    display: grid;
    gap: .8rem;
    padding: .9rem;
}

.solution-row-header {
    align-items: end;
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(14rem, 1fr) 6rem auto auto;
}

.solution-media-editor {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: .85rem;
    display: grid;
    gap: .8rem;
    grid-template-columns: minmax(12rem, .75fr) minmax(18rem, 1.25fr);
    padding: .85rem;
}

.solution-visual-html {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    min-height: 7rem;
    resize: vertical;
}

.solution-media-preview {
    align-items: start;
    display: grid;
    gap: .65rem;
    grid-column: 1 / -1;
}

.solution-media-preview img {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: .75rem;
    max-height: 18rem;
    max-width: min(100%, 34rem);
    object-fit: contain;
    padding: .35rem;
}

.solution-visual-preview {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: .75rem;
    overflow: auto;
    padding: .65rem;
}

.solution-visual-preview svg {
    display: block;
    height: auto;
    max-width: 100%;
}

.question-mapping-editor {
    display: grid;
    gap: .85rem;
}

.mapping-editor-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.mapping-editor-heading div {
    display: grid;
    gap: .2rem;
}

.mapping-editor-heading strong {
    color: #0f172a;
    font-size: 1rem;
}

.mapping-editor-heading span {
    color: #64748b;
    font-size: .9rem;
}

.question-mapping-row {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    display: grid;
    gap: .75rem;
    padding: .85rem;
}

.mapping-row-main,
.mapping-row-levels {
    display: grid;
    gap: .7rem;
}

.mapping-row-main {
    grid-template-columns: minmax(10rem, .7fr) minmax(18rem, 1.3fr);
}

.mapping-row-levels {
    align-items: end;
    grid-template-columns: repeat(3, minmax(5rem, .55fr)) repeat(2, minmax(7rem, auto)) auto;
}

.mapping-row-main label,
.mapping-row-levels label {
    display: grid;
    gap: .3rem;
}

.mapping-check {
    align-items: center;
    display: flex !important;
    gap: .45rem !important;
    min-height: 2.55rem;
}

.mapping-check input {
    flex: 0 0 auto;
}

@media (max-width: 860px) {
    .mapping-editor-heading,
    .mapping-row-main,
    .mapping-row-levels {
        grid-template-columns: 1fr;
    }

    .mapping-editor-heading {
        align-items: stretch;
        display: grid;
    }
}

.edit-modal .campaign-editor {
    box-shadow: none;
    margin: 0;
}

.nested-panel {
    margin: 0;
}

.google-import-options {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
}

.google-category-picker {
    max-height: 13rem;
    overflow: auto;
}




.media-modal {
    background: #ffffff;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    box-shadow: 0 1.35rem 3rem rgba(15, 23, 42, 0.2);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: min(88vh, 58rem);
    max-height: min(88vh, 58rem);
    max-width: 84rem;
    overflow: hidden;
    width: min(calc(100vw - 1.5rem), 84rem);
}

.media-modal-header,
.media-modal-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.9rem 1.15rem;
}

.media-modal-header {
    border-bottom: 1px solid #e5eaf2;
}

.media-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.media-modal-close {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    color: #334155;
    display: inline-flex;
    flex: 0 0 2.2rem;
    height: 2.2rem;
    justify-content: center;
    padding: 0;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
    width: 2.2rem;
}

.media-modal-close:hover {
    background: #eef4ff;
    border-color: #9db8ff;
    color: #010034;
}

.media-modal-body {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: 16rem minmax(0, 1fr);
    min-height: 34rem;
    overflow: hidden;
    padding: 1rem 1.15rem;
}

.media-modal-body.upload-mode {
    grid-template-columns: minmax(0, 1fr);
}

.media-category-sidebar {
    align-content: start;
    background: #f8fafc;
    border: 1px solid #dde6f2;
    border-radius: 8px;
    display: grid;
    gap: 0.45rem;
    grid-auto-rows: max-content;
    min-height: 0;
    overflow: auto;
    padding: 0.65rem;
}

.media-upload-toggle {
    min-height: 2.4rem;
    width: 100%;
}

.media-category-button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #42504a;
    font-weight: 800;
    min-height: 2.55rem;
    padding: 0.55rem 0.75rem;
    text-align: left;
}

.media-category-button.active,
.media-category-button:hover {
    background: #dceee7;
    border-color: #a7d2c2;
    color: #176b5d;
}

.media-category-tree {
    background: #ffffff;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    min-height: 0;
    padding: .35rem;
}

.media-category-tree .tree-view-label span {
    font-size: .88rem;
}

.media-category-tree .tree-view-row {
    min-height: 2.15rem;
}

.media-modal-gallery {
    min-height: 0;
    overflow: auto;
    padding-right: 0.15rem;
}

.media-gallery-toolbar {
    align-items: center;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(18rem, 1fr) 11rem auto;
    margin-bottom: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 4;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 0.75rem;
}

.media-search-field {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d5dfec;
    border-radius: 8px;
    display: flex;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
    padding: 0 0.75rem;
}

.media-search-button {
    min-height: 2.5rem;
    min-width: 4rem;
}

.media-sort-select {
    min-height: 2.5rem;
}

.media-search-field i {
    color: #66758a;
    flex: 0 0 auto;
}

.media-search-field .form-control,
.media-search-field input.form-control {
    background: transparent;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 2.5rem;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
}

.media-search-field .form-control:focus,
.media-search-field input.form-control:focus {
    border: 0 !important;
    box-shadow: none;
    outline: 0;
}

@media (max-width: 760px) {
    .media-gallery-toolbar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .media-search-field {
        width: 100%;
    }
}

.media-modal-gallery .content-media-grid {
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
}

.modal-upload-panel {
    background: #f8fafc;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
}

.modal-upload-head {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.modal-upload-panel input[type="file"] {
    background: #ffffff;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    min-height: 2.25rem;
    padding: 0.35rem;
    width: 100%;
}

.upload-preview-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

.upload-preview-card {
    background: #ffffff;
    border: 1px solid #dde6f2;
    border-radius: 8px;
    display: grid;
    gap: 0.45rem;
    overflow: hidden;
    padding-bottom: 0.7rem;
}

.upload-preview-card img {
    aspect-ratio: 4 / 3;
    background: #eef2f7;
    object-fit: contain;
    width: 100%;
}

.upload-preview-card strong,
.upload-preview-card span {
    padding: 0 0.55rem;
}

.upload-preview-card .form-label,
.upload-preview-card .form-control {
    margin-left: 0.55rem;
    margin-right: 0.55rem;
    width: calc(100% - 1.1rem);
}

.upload-preview-card span {
    color: var(--panel-muted);
    font-size: 0.8rem;
}

.upload-progress {
    background: #ffffff;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    display: grid;
    gap: 0.45rem;
    padding: 0.75rem;
}

.upload-progress > div:first-child {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.upload-progress-track {
    background: #e8edf5;
    border-radius: 999px;
    height: 0.6rem;
    overflow: hidden;
}

.upload-progress-track i {
    background: linear-gradient(90deg, #010034, #4f7cff);
    display: block;
    height: 100%;
    transition: width .18s ease;
}

.media-modal-footer {
    background: #ffffff;
    border-top: 1px solid #e5eaf2;
}

.media-choice-card {
    background: #ffffff;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    display: grid;
    grid-template-rows: auto minmax(0, auto);
    overflow: hidden;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.media-choice-card:hover {
    border-color: #b8c7da;
    box-shadow: 0 .65rem 1.6rem rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.media-choice-card.selected {
    border-color: #176b5d;
    box-shadow: 0 0 0 2px rgba(23, 107, 93, 0.14);
}

.media-choice-visual {
    background:
        linear-gradient(45deg, #f4f7fb 25%, transparent 25%),
        linear-gradient(-45deg, #f4f7fb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f4f7fb 75%),
        linear-gradient(-45deg, transparent 75%, #f4f7fb 75%);
    background-color: #ffffff;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    position: relative;
}

.media-choice-visual img {
    aspect-ratio: 16 / 10;
    background: transparent;
    display: block;
    object-fit: contain;
    width: 100%;
}

.media-choice-body {
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem 0.7rem 0.7rem;
}

.media-choice-card .image-actions {
    display: flex;
    gap: .35rem;
    padding: 0;
    position: absolute;
    right: .5rem;
    top: .45rem;
    transition: opacity .16s ease, transform .16s ease;
    z-index: 2;
}

.media-choice-card .image-actions .icon-action {
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 .4rem 1rem rgba(15, 23, 42, .14);
    height: 1.85rem;
    width: 1.85rem;
}

.media-choice-selectors {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .7rem;
}

.media-choice-selectors label {
    align-items: center;
    color: #475569;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 700;
    gap: .32rem;
    margin: 0;
}

.media-choice-selectors input {
    accent-color: #010034;
    cursor: pointer;
    height: 1rem;
    margin: 0;
    width: 1rem;
}

.media-choice-title {
    color: #0f172a;
    font-size: .9rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (hover: hover) and (min-width: 761px) {
    .media-choice-card .image-actions {
        opacity: 0;
        transform: translateY(-.2rem);
        pointer-events: none;
    }

    .media-choice-card:hover .image-actions,
    .media-choice-card:focus-within .image-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.empty-state {
    background: #f6f1e8;
    border: 1px dashed #b9ad9b;
    border-radius: 8px;
    display: grid;
    gap: 0.5rem;
    padding: 1rem;
}

.empty-state span {
    color: var(--panel-muted);
}

.table-media-summary {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.table-media-summary img {
    aspect-ratio: 1;
    border-radius: 6px;
    height: 2.5rem;
    object-fit: cover;
    width: 2.5rem;
}

.content-visit-cell {
    display: grid;
    gap: 0.15rem;
    min-width: 7.5rem;
}

.content-visit-cell strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.content-visit-cell span {
    color: #6c756f;
    font-size: 0.8rem;
    white-space: nowrap;
}

.toast-stack {
    display: grid;
    gap: 0.75rem;
    max-width: min(26rem, calc(100vw - 2rem));
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 1200;
}

.app-toast {
    align-items: stretch;
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 1rem 2.2rem rgba(23, 29, 27, 0.18);
    display: grid;
    grid-template-columns: 0.32rem minmax(0, 1fr) auto;
    min-height: 4rem;
    overflow: hidden;
}

.toast-accent {
    background: #176b5d;
}

.app-toast.success .toast-accent {
    background: #176b5d;
}

.app-toast.error .toast-accent {
    background: #b32121;
}

.app-toast.warning .toast-accent {
    background: #c95f2d;
}

.app-toast.info .toast-accent {
    background: #325f8f;
}

.toast-content {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
}

.toast-content strong {
    color: var(--panel-text);
    font-size: 0.92rem;
}

.toast-content span {
    color: var(--panel-muted);
    font-size: 0.86rem;
}

.toast-close {
    align-self: start;
    background: transparent;
    border: 0;
    color: #6c756f;
    font-size: 1rem;
    line-height: 1;
    padding: 0.75rem;
}

.toast-close:hover {
    color: var(--panel-text);
}

.selection-drawer-backdrop {
    background: rgba(23, 29, 27, 0.38);
    inset: 0;
    position: fixed;
    z-index: 1090;
}

.selection-drawer {
    background: var(--panel-surface);
    border-left: 1px solid #e6dac9;
    box-shadow: -1rem 0 2.5rem rgba(23, 29, 27, 0.2);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    height: 100vh;
    max-width: min(100vw, 34rem);
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform 180ms ease;
    width: min(34rem, 100vw);
    z-index: 1100;
}

.selection-drawer.open {
    transform: translateX(0);
}

.selection-drawer-header,
.selection-drawer-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
}

.selection-drawer-header {
    border-bottom: 1px solid #e6dac9;
}

.selection-drawer-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.selection-drawer-search {
    padding: 1rem 1rem 0;
}

.selection-drawer-meta {
    color: var(--panel-muted);
    display: flex;
    font-size: 0.86rem;
    font-weight: 600;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.selection-drawer-list {
    display: grid;
    gap: 0.5rem;
    overflow: auto;
    padding: 0 1rem 1rem;
}

.selection-drawer-item {
    align-items: center;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--panel-text);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 2rem minmax(0, 1fr);
    padding: 0.75rem;
    text-align: left;
}

.selection-drawer-item:hover,
.selection-drawer-item.selected {
    background: #dceee7;
    border-color: #a7d2c2;
}

.selection-check {
    align-items: center;
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    color: #176b5d;
    display: inline-flex;
    font-weight: 900;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.selection-drawer-item strong,
.selection-drawer-item small,
.selection-drawer-item em {
    display: block;
}

.selection-drawer-item small {
    color: var(--panel-muted);
    font-size: 0.82rem;
    margin-top: 0.1rem;
}

.selection-drawer-item em {
    color: #176b5d;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 600;
    margin-top: 0.25rem;
}

.selection-drawer-footer {
    border-top: 1px solid #e6dac9;
}

.settings-shell {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
}

.settings-tabs {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
}

.settings-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #35443d;
    display: flex;
    font-weight: 700;
    gap: 0.6rem;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    text-align: left;
    width: 100%;
}

.settings-tab:hover,
.settings-tab.active {
    background: #eef6f3;
    color: #176b5d;
}

.settings-tab span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.settings-content {
    min-width: 0;
}

.settings-content > .section-heading {
    display: none;
}

.registration-shell {
    display: grid;
    min-height: calc(100vh - 4rem);
    place-items: center;
    padding: 2rem 1rem;
}

.registration-panel {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(33, 42, 38, 0.08);
    max-width: 920px;
    padding: 1.5rem;
    width: 100%;
}

.module-card-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-choice-card,
.permission-module-card {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: block;
    padding: 1rem;
}

.module-choice-card {
    cursor: pointer;
}

.module-choice-card.selected {
    border-color: #176b5d;
    box-shadow: 0 0 0 3px rgba(23, 107, 93, 0.12);
}

.module-choice-card input {
    position: absolute;
    opacity: 0;
}

.module-choice-card span {
    display: grid;
    gap: 0.4rem;
}

.module-choice-card small {
    color: var(--panel-muted);
}

.module-choice-card b {
    color: #176b5d;
}

.permission-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-top: 1rem;
}

.check-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

@media (max-width: 900px) {
    .settings-shell {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        flex-direction: row;
        overflow-x: auto;
    }

    .settings-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        width: auto;
    }
}

.feed-drawer {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.feed-drawer .feed-drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

.feed-drawer .feed-drawer-body {
    overflow: visible !important;
    position: static !important;
}

.selected-summary {
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--panel-muted);
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0.75rem;
}

.selected-summary strong {
    color: var(--panel-text);
}

.note-panel {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.note-panel-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.note-panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.note-panel-header span {
    color: var(--panel-muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.note-compose {
    display: grid;
    gap: 0.65rem;
}

.note-list {
    display: grid;
    gap: 0.65rem;
}

.note-card {
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.45rem;
    padding: 0.8rem;
}

.note-card div {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.note-card strong {
    color: var(--panel-text);
}

.note-card span {
    color: var(--panel-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.note-card p {
    margin: 0;
    white-space: pre-wrap;
}

.note-card .btn {
    justify-self: end;
}

@media (max-width: 760px) {
    .media-modal {
        max-height: calc(100vh - 1rem);
        width: calc(100vw - 1rem);
    }

    .media-modal-body {
        gap: 0.75rem;
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }

    .media-category-sidebar {
        border: 1px solid #dde6f2;
        max-height: 12rem;
        padding: 0.65rem;
    }

    .media-modal-header,
    .media-modal-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .media-modal-footer .button-row {
        width: 100%;
    }

    .media-modal-footer .button-row .btn {
        flex: 1;
    }
}

.category-picker.compact {
    max-height: 12rem;
    overflow: auto;
    padding: 0.75rem;
}

.category-root-target {
    background: #f6f1e8;
    border: 1px dashed #b9ad9b;
    border-radius: 8px;
    color: var(--panel-muted);
    font-size: 0.85rem;
    padding: 0.65rem 0.75rem;
}

.category-node {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    cursor: grab;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.7rem 0.75rem;
}

.category-node.dragging {
    opacity: 0.55;
}

.category-node span {
    color: #6c756f;
    display: block;
    font-size: 0.8rem;
}

.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.media-filter {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tag-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 !important;
}

.media-tag {
    background: #dceee7;
    border-radius: 999px;
    color: #176b5d !important;
    display: inline-flex;
    font-size: 0.75rem !important;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
}

.permission-matrix {
    display: grid;
    gap: 0.85rem;
}

.permission-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.button-row.compact {
    margin: 0;
}

.permission-table-wrap {
    border: 1px solid #d8dfdc;
    border-radius: 8px;
    overflow-x: auto;
}

.permission-table {
    background: #fff;
    border-collapse: collapse;
    min-width: 720px;
    width: 100%;
}

.permission-table th,
.permission-table td {
    border: 1px solid #e2e7e4;
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.permission-table th {
    background: #f4f7f5;
    color: #1f2d29;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
}

.permission-table th:not(:nth-child(-n + 2)),
.permission-table td:not(:nth-child(-n + 2)) {
    text-align: center;
    width: 8.5rem;
}

.permission-table .form-check-input {
    cursor: pointer;
    margin: 0;
}

.user-edit-form {
    gap: 1rem;
}

.user-edit-tabs {
    border-bottom: 1px solid #d7dee8;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding-bottom: .65rem;
}

.user-edit-tabs button,
.permission-group-tabs button {
    background: #f4f7fb;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    color: #334155;
    min-height: 2.35rem;
    padding: .45rem .75rem;
}

.user-edit-tabs button.active,
.permission-group-tabs button.active {
    background: #010034;
    border-color: #010034;
    color: #fff;
}

.user-edit-tab-panel {
    display: grid;
    gap: 1rem;
}

.permission-group-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: 190px minmax(0, 1fr);
}

.permission-group-tabs {
    display: grid;
    gap: .45rem;
}

.permission-group-tabs button {
    justify-content: flex-start;
    text-align: left;
}

@media (max-width: 820px) {
    .permission-group-layout {
        grid-template-columns: 1fr;
    }

    .permission-group-tabs {
        display: flex;
        flex-wrap: wrap;
    }
}

.study-dashboard-tabs {
    align-items: stretch;
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
}

.study-dashboard-tabs button {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    color: #334155;
    display: flex;
    gap: 0.7rem;
    min-height: 4.25rem;
    padding: 0.65rem 1rem;
    position: relative;
    text-align: left;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.study-dashboard-tabs button:last-child {
    border-right: 1px solid rgba(15, 23, 42, .08);
}

.study-dashboard-tabs .tab-icon {
    align-items: center;
    background: var(--tab-soft);
    border-radius: 8px;
    color: var(--tab-ink);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.08rem;
    font-weight: 900;
    height: 2.35rem;
    justify-content: center;
    width: 2.35rem;
}

.study-dashboard-tabs .tab-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.study-dashboard-tabs .tab-copy span {
    color: var(--tab-ink);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.study-dashboard-tabs .tab-copy strong {
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.15;
}

.study-dashboard-tabs button.active,
.study-dashboard-tabs button:hover {
    border-color: var(--tab-border);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.study-dashboard-tabs button.active {
    background: var(--tab-fill);
}

.study-dashboard-tabs button.active .tab-icon,
.study-dashboard-tabs button:hover .tab-icon {
    background: var(--tab-ink);
    color: #ffffff;
}

.study-dashboard-tabs button.active .tab-copy span {
    color: var(--tab-ink);
}

.study-dashboard-tabs button.active .tab-copy strong,
.study-dashboard-tabs button:hover .tab-copy strong {
    color: #0f172a;
}

.study-dashboard-tabs .tone-mint {
    --tab-soft: #d9f8ef;
    --tab-fill: #eefdf7;
    --tab-ink: #0f766e;
    --tab-border: #8ee7d2;
}

.study-dashboard-tabs .tone-amber {
    --tab-soft: #fff0c2;
    --tab-fill: #fff8df;
    --tab-ink: #b45309;
    --tab-border: #f7cf68;
}

.study-dashboard-tabs .tone-sky {
    --tab-soft: #dff3ff;
    --tab-fill: #f0f9ff;
    --tab-ink: #0369a1;
    --tab-border: #93d8ff;
}

.study-dashboard-tabs .tone-rose {
    --tab-soft: #ffe1ec;
    --tab-fill: #fff1f6;
    --tab-ink: #be185d;
    --tab-border: #f9a8d4;
}

.study-flow-grid {
    align-items: start;
}

@media (max-width: 760px) {
    .study-dashboard-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .study-dashboard-tabs button {
        min-height: 3rem;
        padding: 0.5rem;
    }

    .study-dashboard-tabs .tab-icon {
        height: 1.75rem;
        width: 1.75rem;
        font-size: .9rem;
    }

    .study-dashboard-tabs .tab-copy strong {
        font-size: 0.86rem;
    }
}

.content-tabs {
    margin-bottom: .75rem;
}

.campaign-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #e8edf3;
}

.campaign-tab {
    padding: .52rem .8rem;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-weight: 600;
}

.campaign-tab.active {
    border-color: #3467b1;
    background: #eef5ff;
    color: #174077;
}

.campaign-tab:disabled {
    opacity: .55;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading.compact {
    margin-top: 0;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.1rem;
}

.campaign-channel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.campaign-channel-grid.vertical {
    grid-template-columns: 1fr;
    margin-top: 0;
}

.campaign-channel-card {
    display: grid;
    gap: .65rem;
    padding: .9rem;
    border: 1px solid #e4e8ef;
    border-radius: 8px;
    background: #fbfcfe;
}

.channel-title,
.channel-media-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.channel-title {
    font-weight: 700;
}

.channel-media-row {
    justify-content: space-between;
    color: #667085;
    font-size: .9rem;
}

.campaign-targets.no-border {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.selected-image-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    min-height: 2.5rem;
}

.selected-image-row img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dfe5ec;
}

.send-actions {
    display: grid;
    grid-template-columns: minmax(200px, 260px) auto auto;
    align-items: end;
    gap: .75rem;
}

.editor-disabled-wrap.disabled {
    opacity: .55;
    pointer-events: none;
}

@media (max-width: 1100px) {
    .campaign-channel-grid,
    .send-actions {
        grid-template-columns: 1fr;
    }
}

.product-editor form {
    display: grid;
    gap: 1rem;
}

.product-editor {
    min-width: 0;
}

.product-tab-bar {
    align-items: center;
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.35rem;
}

.product-tab-button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #42504a;
    flex: 0 0 auto;
    font-weight: 600;
    min-height: 2.25rem;
    padding: 0.45rem 0.8rem;
}

.product-tab-button.active,
.product-tab-button:hover {
    background: var(--panel-primary);
    border-color: #173b36;
    color: #fff;
}

.product-info-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-info-grid .span-2 {
    grid-column: 1 / -1;
}

.product-subpanel {
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.product-subpanel-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.product-subpanel-heading h2 {
    color: var(--panel-text);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.product-store-picker {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.product-store-row {
    align-items: flex-start;
    border: 1px solid #dde5f0;
    border-radius: 8px;
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem;
}

.product-store-row input {
    margin-top: 0.2rem;
}

.product-store-row span {
    display: grid;
    gap: 0.12rem;
}

.product-store-row small {
    color: #667085;
}

.panel-host-selector,
.panel-host-chip,
.admin-role-selector {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
}

.panel-host-label,
.panel-host-chip span,
.admin-role-label {
    color: #667085;
    font-size: 0.82rem;
    font-weight: 600;
}

.panel-host-select,
.admin-role-select {
    border-color: #d8dfeb;
    border-radius: 8px;
    color: #010034;
    font-size: 0.86rem;
    font-weight: 600;
    min-height: 2.35rem;
    min-width: 12.5rem;
}

.admin-role-select {
    min-width: 10.5rem;
}

.panel-host-chip {
    background: #f8fafc;
    border: 1px solid #d8dfeb;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
}

.panel-host-chip strong {
    color: #010034;
    font-size: 0.86rem;
}

.product-row-grid {
    align-items: start;
    border-top: 1px solid #ece3d6;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: minmax(11rem, 1.2fr) repeat(5, minmax(6.5rem, 1fr)) auto;
    padding-top: 0.75rem;
}

.product-row-grid.variant-grid {
    grid-template-columns: repeat(6, minmax(6.5rem, 1fr)) auto;
}

.product-row-grid .form-label {
    color: var(--panel-muted);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.product-row-grid .row-action {
    align-self: end;
    padding-bottom: 0.05rem;
}

.appointment-panel {
    background: var(--panel-surface);
}

.appointment-product-grid {
    align-items: start;
    border-top: 1px solid #ece3d6;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: minmax(14rem, 1.4fr) minmax(5rem, 0.5fr) minmax(8rem, 0.7fr) minmax(8rem, 0.7fr) auto;
    padding-top: 0.75rem;
}

.appointment-product-grid .form-label {
    color: var(--panel-muted);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.appointment-product-grid .row-action {
    align-self: end;
}

.appointment-total {
    align-items: center;
    background: #f6f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 0.75rem;
}

.appointment-total span {
    color: var(--panel-muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.appointment-total strong {
    color: #176b5d;
    font-size: 1.15rem;
}

.contact-list {
    display: grid;
    gap: 1rem;
}

.contact-card {
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
}

.contact-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.contact-card p {
    color: var(--panel-muted);
    margin-bottom: 0.25rem;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button {
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: #42504a;
    font-weight: 700;
    padding: 0.7rem 1rem;
}

.tab-button.active,
.tab-button:hover {
    background: var(--panel-primary);
    border-color: #173b36;
    color: #fff;
}

.rich-editor-shell {
    display: grid;
    gap: 0.5rem;
}

.rich-editor-actions {
    display: flex;
    justify-content: flex-end;
}

.rich-source-toggle {
    border: 1px solid #173b36;
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
    color: #173b36;
    background: #f7f1e8;
    font-weight: 700;
}

.rich-source-toggle:hover {
    color: #fff;
    background: var(--panel-primary);
}

.rich-editor {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
}

.rich-editor.source-hidden {
    display: none;
}

.rich-source-area {
    width: 100%;
    min-height: 17rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
    color: #17231f;
    background: #fff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
}

.rich-source-area:focus {
    border-color: #2bb9a7;
    box-shadow: 0 0 0 0.2rem rgba(43, 185, 167, .14);
    outline: 0;
}

.message-body-editor {
    display: grid;
    gap: 0.5rem;
    width: 100%;
}

.message-body-toolbar {
    display: flex;
    justify-content: flex-end;
}

.message-emoji-overlay {
    align-items: flex-start;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 8vh 1rem 1rem;
    position: fixed;
    z-index: 2600;
}

.message-emoji-backdrop {
    background: rgba(15, 23, 42, .42);
    border: 0;
    inset: 0;
    position: absolute;
}

.message-emoji-dialog {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    display: grid;
    gap: 0.75rem;
    max-width: min(94vw, 390px);
    padding: 0.85rem;
    position: relative;
    width: 390px;
}

.message-emoji-dialog header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.message-emoji-dialog header strong {
    color: #101828;
    font-size: 1rem;
}

.message-emoji-panel {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
}

.message-emoji-panel emoji-picker {
    --border-radius: 8px;
    --category-emoji-size: 1rem;
    --emoji-size: 1.35rem;
    height: 340px;
    width: 100%;
}

.ckeditor-wrapper .ck.ck-toolbar {
    background: #f7f1e8;
    border: 0;
    border-bottom: 1px solid #d9d1c3;
}

.ckeditor-wrapper .ck.ck-editor__main > .ck-editor__editable {
    border: 0;
    box-shadow: none;
    min-height: 13rem;
    padding: 1rem;
}

.ckeditor-wrapper .ck.ck-editor__editable.ck-focused {
    border: 0;
    box-shadow: inset 0 0 0 1px #2bb9a7;
}

.ckeditor-wrapper .ck-content h2,
.ckeditor-wrapper .ck-content h3 {
    margin-top: 1rem;
}

.ckeditor-wrapper .ck-content p:last-child {
    margin-bottom: 0;
}

.rich-preview {
    color: var(--panel-muted);
    margin-top: 0.5rem;
}

.auto-reply-channel-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    background: #fff;
}

.auto-reply-channel-state div {
    display: grid;
    gap: 0.1rem;
}

.auto-reply-channel-state span,
.auto-reply-preview span {
    color: #69766f;
    font-size: 0.82rem;
}

.auto-reply-channel-state strong {
    color: #173b36;
}

.auto-reply-preview {
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.85rem;
    margin-top: 1rem;
    background: #f9f5ee;
}

.auto-reply-preview strong {
    color: #173b36;
}

.auto-reply-preview p {
    margin: 0;
    color: #34423d;
    white-space: pre-wrap;
}

.whatsapp-format-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.keyword-editor {
    min-height: 7rem;
}

.auto-reply-media-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.auto-reply-media-preview img {
    width: 120px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #fff;
}

.auto-reply-media-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.auto-reply-media-heading > div {
    display: grid;
    gap: 0.1rem;
}

.auto-reply-empty-media {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border: 1px dashed #b9c4bc;
    border-radius: 8px;
    background: #f8fbf8;
    color: #315045;
}

.auto-reply-empty-media span,
.auto-reply-media-preview span {
    color: #607268;
    font-size: 0.9rem;
}

.auto-reply-selected-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.auto-reply-selected-image {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.auto-reply-selected-image.primary {
    border-color: #2bb9a7;
    box-shadow: 0 0 0 2px rgba(43, 185, 167, .18);
}

.auto-reply-selected-image img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.auto-reply-selected-image span {
    display: block;
    padding: 0.5rem 0.6rem;
    color: #34423d;
    font-size: 0.86rem;
    font-weight: 700;
}

.rich-preview p:last-child {
    margin-bottom: 0;
}

.editor-label-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.editor-label-row .form-label {
    margin-bottom: 0;
}

.ai-assist-panel {
    background: #f7f1e8;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(150px, 0.28fr) minmax(240px, 1fr);
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

.taxonomy-group-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 1rem;
}

.taxonomy-group-card {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
}

.taxonomy-group-card strong {
    display: block;
}

.taxonomy-group-card span {
    color: #66736d;
    font-size: 0.88rem;
}

.category-tree-panel.compact {
    max-height: 260px;
}

.empty-state.compact {
    min-height: auto;
    padding: 0.75rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 760px) {
    .hero-panel,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
    }

    .data-grid-toolbar,
    .product-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .product-toolbar-actions .btn,
    .grid-search {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .customer-actions {
        justify-content: flex-start;
    }

    .media-layout {
        grid-template-columns: 1fr;
    }

    .product-row-grid,
    .product-row-grid.variant-grid,
    .appointment-product-grid,
    .product-info-grid {
        grid-template-columns: 1fr;
    }

    .product-info-grid .span-2 {
        grid-column: auto;
    }

    .toast-stack {
        left: 1rem;
        right: 1rem;
        top: 0.75rem;
        max-width: none;
    }
}

.form-field-v {
    /*display: flex;*/
    gap: 10px;
    margin-top: 8px;
    align-items: center;
}

.form-field{
    display:flex;
    gap:10px;
    margin-top:8px;
    align-items:center;
}

.form-field .form-label {
    min-width:100px;
}

.domain-create-steps {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.step-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #d6dde8;
    border-radius: 999px;
    color: #475569;
    background: #f8fafc;
    font-size: 0.85rem;
    font-weight: 600;
}

.step-pill.active {
    color: #0f172a;
    border-color: #7aa2ff;
    background: #eef4ff;
}

.shipping-zone-editor {
    display: grid;
    grid-template-columns: minmax(280px, 0.36fr) minmax(360px, 1fr);
    gap: 1rem;
    align-items: start;
}

.shipping-tree-panel {
    border: 1px solid #d6dde8;
    border-radius: 8px;
    background: #ffffff;
    max-height: 620px;
    overflow: auto;
    padding: 0.5rem;
}

.tree-view {
    color: #172554;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-view-branch {
    border-left: 1px solid #dbeafe;
    margin-left: 1.17rem;
    padding-left: .2rem;
}

.tree-view-item {
    margin: .08rem 0;
}

.tree-view-row {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #172554;
    display: flex;
    flex-direction: row;
    gap: .45rem;
    min-height: 2.35rem;
    padding: .25rem .45rem;
    transition: background .16s ease, border-color .16s ease;
}

.tree-view-row:hover {
    background: #f0f9ff;
    border-color: #dbeafe;
}

.tree-view-row.active {
    background: #eef4ff;
    border-color: #7aa2ff;
    color: #0f172a;
}

.tree-view-row.group-node .tree-view-label span {
    font-weight: 700;
}

.tree-view-toggle,
.tree-view-label {
    background: transparent;
    border: 0;
    color: inherit;
}

.tree-view-toggle {
    align-items: center;
    display: inline-flex;
    flex: 0 0 1.45rem;
    font-size: 1.1rem;
    height: 1.45rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 1.45rem;
}

.tree-view-toggle-placeholder {
    flex: 0 0 1.45rem;
    height: 1px;
    width: 1.45rem;
}

.tree-view-check {
    accent-color: #2563eb;
    flex: 0 0 1.05rem;
    height: 1.05rem;
    margin: 0;
    width: 1.05rem;
}

.tree-view-chevron {
    display: inline-block;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .16s ease;
}

.tree-view-chevron.expanded {
    transform: rotate(90deg);
}

.tree-view-label {
    display: grid;
    flex: 1 1 auto;
    gap: .05rem;
    justify-content: stretch;
    min-height: 2.15rem;
    min-width: 0;
    padding: .2rem 0;
    text-align: left;
}

.tree-view-label span {
    color: #172554;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-view-label small {
    color: #47658f;
    display: block;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.15;
}
.shipping-district-panel {
    min-width: 0;
}

.shipping-district-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.shipping-district-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.shipping-district-table th:first-child,
.shipping-district-table td:first-child {
    width: 5.5rem;
    text-align: center;
}

.shipping-price-input {
    max-width: 12rem;
}

.product-category-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.35fr) minmax(320px, 1fr);
    gap: 1rem;
    align-items: start;
}

.category-tree-panel {
    max-height: 360px;
    overflow: auto;
    border: 1px solid #d6dde8;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.5rem;
}

.related-product-picker {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    border: 1px solid #d6dde8;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.85rem;
}

.related-product-picker strong,
.related-product-picker span {
    display: block;
}

.related-product-table th:first-child,
.related-product-table td:first-child {
    width: 5rem;
    text-align: center;
}

.selection-list {
    display: grid;
    gap: 0.5rem;
    max-height: 360px;
    overflow: auto;
    border: 1px solid #d6dde8;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.65rem;
}

.selection-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.6rem 0.7rem;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    background: #f8fafc;
}

.selection-row span,
.selection-row small {
    overflow-wrap: anywhere;
}

.faq-question-row {
    align-items: start;
}

.faq-question-row .drag-order {
    font-weight: 700;
    padding-top: 2.35rem;
}

.faq-question-fields {
    min-width: 0;
}

.faq-question-row .rich-editor {
    background: #fff;
}

.muted-text {
    color: #64748b;
}

@media (max-width: 900px) {
    .shipping-zone-editor {
        grid-template-columns: 1fr;
    }

    .product-category-layout {
        grid-template-columns: 1fr;
    }

      .related-product-picker {
          grid-template-columns: 1fr;
      }

      .ai-assist-panel {
          grid-template-columns: 1fr;
      }
  }

.wa-settings-layout,
.wa-inbox-layout,
.wa-report-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.wa-report-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wa-card {
    padding: 1rem;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #fff;
}

.wa-card h2 {
    margin: 0 0 .75rem;
    font-size: 1.1rem;
    color: #142033;
}

.wa-list {
    display: grid;
    gap: .55rem;
}

.wa-list-row,
.conversation-card {
    display: grid;
    gap: .25rem;
    width: 100%;
    padding: .75rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f7f9fc;
    color: #263247;
    text-align: left;
    text-decoration: none;
}

.wa-list-row.active,
.wa-list-row:hover,
.conversation-card.active,
.conversation-card:hover {
    border-color: #b7dfca;
    background: #e9f7ef;
    color: #136b3b;
}

.wa-list-row span,
.wa-list-row small,
.conversation-card span,
.conversation-card small,
.empty-mini {
    color: #748296;
    font-size: .88rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.span-2 {
    grid-column: 1 / -1;
}

.toggle-row,
.button-row,
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.token-input {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .9rem;
}

.endpoint-box {
    display: grid;
    gap: .35rem;
    margin-top: 1rem;
    padding: .8rem;
    border: 1px solid #dfe8f3;
    border-radius: 8px;
    background: #f8fafc;
}

.endpoint-box code {
    white-space: normal;
    word-break: break-all;
}

.status-pill {
    align-self: start;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: #e7f7ed;
    color: #166534;
    font-size: .8rem;
    font-weight: 700;
}

.conversation-column {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.conversation-top {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
}

.conversation-top em {
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #0f7a43;
    color: #fff;
    font-style: normal;
    font-size: .78rem;
    display: inline-grid;
    place-items: center;
}

.chat-workspace {
    min-height: 72vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5ebf2;
}

.chat-header h2 {
    margin-bottom: .15rem;
}

.message-thread {
    display: grid;
    gap: .75rem;
    padding: 1rem 0;
}

.message-bubble {
    max-width: min(760px, 86%);
    padding: .85rem;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    background: #f8fafc;
}

.message-bubble.outbound {
    justify-self: end;
    background: #e9f7ef;
    border-color: #c3e5d2;
}

.message-bubble.failed {
    background: #fff6f6;
    border-color: #f3b2b2;
}

.message-bubble p {
    margin: .45rem 0;
    white-space: pre-wrap;
}

.message-meta,
.message-audit {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .8rem;
    color: #66768a;
    font-size: .8rem;
}

.error-line {
    color: #a11d1d;
    font-weight: 700;
}

.reply-box {
    padding-top: 1rem;
    border-top: 1px solid #e5ebf2;
}

.empty-state {
    display: grid;
    place-content: center;
    min-height: 52vh;
    color: #64748b;
    text-align: center;
}

.report-grid,
.wa-home-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card,
.wa-home-card {
    display: grid;
    gap: .35rem;
    padding: 1rem;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #fff;
    color: #203047;
    text-decoration: none;
}

.metric-card strong {
    font-size: 2rem;
    color: #12352f;
}

.metric-card.danger strong {
    color: #a11d1d;
}

.wa-home-card span {
    font-size: 1.45rem;
    color: #136b3b;
}

.message-log {
    display: grid;
    gap: .65rem;
}

.message-log-row {
    display: grid;
    gap: .3rem;
    padding: .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fbfcfe;
}

.message-log-row.failed {
    border-color: #f5b5b5;
    background: #fff6f6;
}

.message-log-row pre {
    max-height: 180px;
    overflow: auto;
    margin: .35rem 0 0;
    padding: .55rem;
    border-radius: 6px;
    background: #101828;
    color: #d7e3f8;
    font-size: .78rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .65rem 0 .4rem;
}

.question-meta span {
    padding: .2rem .45rem;
    border: 1px solid #dfe8f3;
    border-radius: 999px;
    background: #f8fafc;
    color: #42526a;
    font-size: .78rem;
    font-weight: 700;
}

.bot-designer-shell {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1.35fr) minmax(320px, .9fr);
    gap: 1rem;
    align-items: start;
}

.bot-flow-list,
.bot-canvas,
.bot-inspector {
    min-width: 0;
}

.bot-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bot-panel-heading h2 {
    margin: 0;
    color: #142033;
    font-size: 1.12rem;
    font-weight: 600;
}

.bot-start-card,
.bot-node {
    width: 100%;
    display: grid;
    gap: .25rem;
    padding: .8rem;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #fff;
    color: #142033;
    text-align: left;
}

.bot-start-card {
    margin-bottom: .75rem;
    cursor: pointer;
    background: #f8fafc;
}

.bot-start-card.selected,
.bot-node.selected {
    border-color: #2f7d57;
    box-shadow: 0 0 0 3px rgba(47, 125, 87, .12);
}

.bot-tree {
    display: grid;
    gap: .55rem;
}

.bot-node-wrap {
    display: grid;
    gap: .45rem;
    margin-left: calc(var(--depth) * 1.25rem);
}

.bot-node {
    cursor: pointer;
    background: #fbfcfe;
}

.bot-node:hover {
    background: #f3f8f6;
}

.bot-node.inactive {
    opacity: .58;
}

.bot-node span {
    color: #64748b;
    font-size: .78rem;
    font-weight: 700;
}

.bot-node strong {
    font-size: .96rem;
    overflow-wrap: anywhere;
}

.bot-node small,
.bot-start-card small {
    color: #64748b;
    overflow-wrap: anywhere;
}

.bot-node-children {
    display: grid;
    gap: .45rem;
    margin-left: .8rem;
    padding-left: .7rem;
    border-left: 1px solid #d6dde8;
}

.message-format-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .45rem;
}

.message-editor {
    min-height: 8rem;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.message-preview {
    margin-top: .55rem;
    padding: .65rem .75rem;
    border: 1px solid #dfe8f3;
    border-radius: 8px;
    background: #f8fafc;
}

.message-preview span {
    display: block;
    margin-bottom: .3rem;
    color: #64748b;
    font-size: .78rem;
    font-weight: 600;
}

.message-preview p {
    margin: 0;
    color: #1d2a3d;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .wa-settings-layout,
    .wa-inbox-layout,
    .wa-report-layout,
    .report-grid,
    .wa-home-grid,
    .bot-designer-shell {
        grid-template-columns: 1fr;
    }

    .conversation-column {
        position: static;
        max-height: none;
    }

    .bot-node-wrap {
        margin-left: 0;
    }
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .message-bubble {
        max-width: 100%;
    }

    .management-list .material-list-item {
        grid-template-columns: 1fr;
    }

    .management-list .material-list-item .material-row-title,
    .management-list .material-list-item .pill-row,
    .management-list .material-list-item .management-card-actions {
        grid-column: 1;
    }

    .management-list .material-list-item .management-card-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
.study-management-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.management-tree-panel,
.management-content,
.management-empty,
.management-card,
.management-modal {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.management-tree-panel {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 7rem);
    overflow: auto;
    padding: 1rem;
}

.management-content,
.management-empty,
.management-card,
.management-modal {
    padding: 1rem;
}

.management-panel-title,
.management-header,
.management-card header,
.management-modal header,
.management-modal footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.management-panel-title {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.management-header {
    margin-bottom: 1rem;
}

.management-header h1,
.management-card h2,
.management-modal h2 {
    margin: 0.15rem 0;
    color: #0f172a;
}

.question-list-item h2 {
    margin-bottom: 0;
    line-height: 1.45;
    font-size: 1.5rem;
}

.material-list-item h2,
.material-list-item h3 {
    margin-bottom: 0;
    line-height: 1.4;
}

.material-type-card {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.management-list .material-type-card {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.management-list .material-type-card > header {
    display: none;
}

.material-type-card > header,
.material-list-item > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.material-type-card h2,
.material-list-item h3 {
    margin: 0.15rem 0;
    color: #0f172a;
}

.material-type-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.management-list .material-type-list {
    gap: 0;
    margin-top: 0;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.material-list-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.85rem;
}

.management-list .material-list-item {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 2fr) auto;
    gap: 0.75rem;
    align-items: center;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    padding: 0.8rem 0.95rem;
}

.management-list .material-list-item:last-child {
    border-bottom: 0;
}

.management-list .material-list-item > header {
    display: contents;
}

.management-list .material-list-item .material-row-title {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.35;
}

.management-list .material-list-item .pill-row {
    grid-column: 2;
    justify-content: flex-start;
}

.management-list .material-list-item .management-card-actions {
    grid-column: 3;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.management-header h1 {
    font-size: 1.55rem;
}

.management-header p,
.management-empty,
.management-panel-title span {
    color: #64748b;
}

.management-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.management-stats article {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    padding: 0.85rem;
    background: #f8fafc;
}

.management-stats span {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
}

.management-stats strong {
    color: #0f172a;
    font-size: 1.45rem;
}

.management-toolbar,
.management-card-actions,
.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.management-toolbar {
    margin-bottom: 1rem;
}

.management-toolbar .form-select {
    width: min(260px, 100%);
}

.management-toolbar .question-page-size-select {
    width: min(150px, 100%);
}

.management-list {
    display: grid;
    gap: 0.85rem;
}

.question-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin: 0.85rem 0 1.25rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 0.92rem;
}

.question-pagination-bar > div {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.question-pagination-bar strong {
    color: #0f172a;
    white-space: nowrap;
}

.lesson-page-pro {
    display: grid;
    gap: 1rem;
    color: #172033;
    line-height: 1.65;
}

.lesson-page-pro * {
    box-sizing: border-box;
}

.lesson-page-pro h2,
.lesson-page-pro h3,
.lesson-page-pro h4 {
    margin: 0;
    color: #101827;
    letter-spacing: 0;
}

.lesson-page-pro p {
    margin: 0;
}

.lesson-hero-pro {
    display: grid;
    gap: 0.75rem;
    padding: 1.2rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f1f8ff 0%, #f8fff6 100%);
    border: 1px solid #d9e7ef;
}

.lesson-hero-pro .eyebrow {
    color: #246b5f;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lesson-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.lesson-box-pro {
    padding: 0.95rem;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #ffffff;
}

.lesson-box-pro.accent {
    border-color: #9ddfb1;
    background: #f4fff7;
}

.lesson-box-pro.warn {
    border-color: #ffd2a6;
    background: #fff8ef;
}

.lesson-box-pro.note {
    border-color: #c9d8ff;
    background: #f6f8ff;
}

.lesson-box-pro h3,
.lesson-box-pro h4 {
    margin-bottom: 0.45rem;
}

.lesson-box-pro ul,
.lesson-box-pro ol {
    margin: 0.45rem 0 0;
    padding-left: 1.2rem;
}

.lesson-visual-pro {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border-radius: 8px;
    background: #fbfcff;
    border: 1px solid #dbe4ee;
}

.lesson-visual-pro svg {
    width: 100%;
    max-height: 260px;
}

.lesson-steps-pro {
    display: grid;
    gap: 0.65rem;
    counter-reset: lessonStep;
}

.lesson-step-pro {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
}

.lesson-step-pro::before {
    counter-increment: lessonStep;
    content: counter(lessonStep);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #172033;
    color: #fff;
    font-weight: 800;
}

.lesson-table-pro {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #dbe4ee;
}

.lesson-table-pro th,
.lesson-table-pro td {
    padding: 0.72rem;
    border-bottom: 1px solid #e6edf5;
    vertical-align: top;
}

.lesson-table-pro th {
    background: #eef6ff;
    text-align: left;
    color: #0f3f68;
}

.lesson-faq-pro details {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    background: #fff;
}

.lesson-faq-pro details + details {
    margin-top: 0.55rem;
}

.lesson-faq-pro summary {
    cursor: pointer;
    font-weight: 800;
    color: #172033;
}

.publisher-lesson {
    --ink: #172033;
    --muted: #657083;
    --line: #d8e1eb;
    --paper: #fffdf8;
    --blue: #2357d8;
    --green: #148458;
    --amber: #c87514;
    --rose: #d94a42;
    display: grid;
    gap: 1.15rem;
    color: var(--ink);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
}

.publisher-lesson * {
    box-sizing: border-box;
}

.publisher-lesson h2,
.publisher-lesson h3,
.publisher-lesson h4,
.publisher-lesson p {
    margin: 0;
    letter-spacing: 0;
}

.publisher-cover {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 1rem;
    min-height: 360px;
    padding: 1.35rem;
    border: 1px solid #d8e1eb;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.88), rgba(255,255,255,0.65)),
        repeating-linear-gradient(0deg, rgba(35,87,216,0.05), rgba(35,87,216,0.05) 1px, transparent 1px, transparent 28px),
        var(--paper);
    overflow: hidden;
}

.publisher-cover-copy {
    display: grid;
    align-content: space-between;
    gap: 1rem;
}

.publisher-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #bad3ff;
    border-radius: 999px;
    background: #eef5ff;
    color: #1642a1;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.publisher-title {
    display: grid;
    gap: 0.5rem;
}

.publisher-title h2 {
    max-width: 720px;
    color: #111827;
    font-size: clamp(2rem, 4vw, 4.2rem);
    font-weight: 950;
    line-height: 0.95;
}

.publisher-title p {
    max-width: 580px;
    color: #334155;
    font-size: 1.05rem;
}

.publisher-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.publisher-meta-strip span {
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    color: #475569;
    font-weight: 800;
    font-size: 0.86rem;
}

.publisher-cover-art {
    display: grid;
    align-items: center;
    min-height: 300px;
}

.publisher-cover-art svg {
    width: 100%;
    height: auto;
}

.publisher-spread {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 1rem;
}

.publisher-page {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.publisher-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #172033;
}

.publisher-page-header h3 {
    font-size: 1.55rem;
    font-weight: 950;
}

.publisher-page-header span {
    color: var(--muted);
    font-weight: 800;
}

.publisher-sidebar {
    display: grid;
    align-content: start;
    gap: 0.8rem;
}

.publisher-tab {
    padding: 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.publisher-tab strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #111827;
}

.publisher-tab p,
.publisher-tab li {
    color: #475569;
    font-size: 0.92rem;
}

.publisher-tab ul {
    margin: 0.45rem 0 0;
    padding-left: 1.05rem;
}

.publisher-tab.green {
    border-color: #9ad7bb;
    background: #f1fff7;
}

.publisher-tab.amber {
    border-color: #ffd59b;
    background: #fff8ed;
}

.publisher-definition {
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.95rem;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid #dce9ff;
}

.publisher-definition::before {
    content: "";
    border-radius: 999px;
    background: var(--blue);
}

.publisher-definition h4 {
    margin-bottom: 0.25rem;
    color: #12357f;
    font-size: 1.08rem;
    font-weight: 950;
}

.publisher-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.publisher-rule {
    display: grid;
    gap: 0.35rem;
    min-height: 135px;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.publisher-rule b {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    background: #172033;
    color: #fff;
}

.publisher-rule strong {
    color: #111827;
    font-size: 1rem;
}

.publisher-rule p {
    color: #475569;
    font-size: 0.94rem;
}

.publisher-diagram-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfdff;
}

.publisher-diagram-card svg {
    width: 100%;
    height: auto;
}

.publisher-caption {
    color: #475569;
    font-size: 0.9rem;
}

.publisher-example {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 0.9rem;
    padding: 0.95rem;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #fff;
}

.publisher-example-problem {
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem;
    border-radius: 8px;
    background: #f8fafc;
}

.publisher-example-problem .label {
    color: var(--rose);
    font-weight: 950;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.publisher-solution {
    display: grid;
    gap: 0.55rem;
    counter-reset: solutionStep;
}

.publisher-solution div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    align-items: start;
}

.publisher-solution div::before {
    counter-increment: solutionStep;
    content: counter(solutionStep);
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: #eaf1ff;
    color: #1642a1;
    font-weight: 950;
}

.publisher-workshop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.publisher-task {
    min-height: 170px;
    padding: 0.9rem;
    border-radius: 8px;
    border: 1px dashed #aebed0;
    background: #fffdf8;
}

.publisher-task strong {
    display: block;
    margin-bottom: 0.4rem;
    color: #111827;
}

.publisher-answer-line {
    display: block;
    height: 34px;
    margin-top: 0.65rem;
    border-bottom: 2px solid #cbd5e1;
}

.publisher-checklist {
    display: grid;
    gap: 0.5rem;
}

.publisher-checklist label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
    padding: 0.65rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.publisher-checklist input {
    margin-top: 0.25rem;
}

.publisher-source-editor,
.publisher-source-preview,
.simple-editor-panel {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid #d8e1eb;
    border-radius: 8px;
    background: #ffffff;
}

.material-editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.35rem;
    margin-bottom: 1rem;
    border: 1px solid #d8e1eb;
    border-radius: 10px;
    background: #f8fafc;
}

.material-editor-tabs button {
    flex: 1 1 210px;
    padding: 0.7rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-weight: 800;
}

.material-editor-tabs button.active {
    background: #ffffff;
    color: #172033;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.material-content-mode-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.3rem;
    border: 1px solid #d8e1eb;
    border-radius: 10px;
    background: #eef4ff;
    width: fit-content;
}

.material-content-mode-tabs button {
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    background: transparent;
    color: #475569;
    font-weight: 800;
}

.material-content-mode-tabs button.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.material-rich-append-editor {
    border-color: #b7d1ff;
    background: #f8fbff;
}

.rich-append-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.editor-warning {
    padding: 0.75rem 0.85rem;
    border: 1px solid #f4c542;
    border-radius: 8px;
    background: #fff7db;
    color: #6b4e00;
}

.lesson-manual-rich-block {
    margin-top: 1.25rem;
}

.material-editor-tab-panel {
    display: grid;
    gap: 1rem;
}

.form-grid.compact {
    align-items: end;
}

.compact-empty {
    min-height: 150px;
}

.publisher-source-editor {
    border-color: #b7d1ff;
    background: #f8fbff;
}

.publisher-source-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.publisher-source-head strong {
    display: block;
    color: #111827;
}

.publisher-source-head span {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
}

.publisher-source-textarea {
    min-height: 420px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
}

.publisher-source-preview {
    background: #f8fafc;
}

.lesson-media-slot-panel {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px dashed #9bbcf4;
    border-radius: 8px;
    background: #f5f9ff;
}

.lesson-media-slot-empty {
    padding: 0.85rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #d8e1eb;
    color: #64748b;
}

.lesson-media-slot-list {
    display: grid;
    gap: 0.65rem;
}

.lesson-media-slot-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    border: 1px solid #d8e1eb;
    border-radius: 8px;
    background: #ffffff;
}

.lesson-media-slot-row.is-empty {
    border-style: dashed;
}

.lesson-media-slot-row.has-image {
    border-color: #9fd4ba;
    background: #f7fff9;
}

.lesson-media-slot-thumb {
    display: grid;
    place-items: center;
    width: 72px;
    height: 54px;
    overflow: hidden;
    border-radius: 8px;
    background: #eaf1f8;
    color: #64748b;
}

.lesson-media-slot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-media-slot-thumb i {
    font-size: 1.5rem;
}

.lesson-media-slot-info {
    min-width: 0;
}

.lesson-media-slot-info strong,
.lesson-media-slot-info span,
.lesson-media-slot-info small {
    display: block;
}

.lesson-media-slot-info strong {
    color: #111827;
}

.lesson-media-slot-info span {
    color: #64748b;
    font-size: 0.9rem;
}

.lesson-media-slot-info small {
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-media-slot-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.lesson-image-slot {
    margin: 1.25rem 0;
    padding: 0.85rem;
    border: 1px solid #d8e1eb;
    border-radius: 14px;
    background: #ffffff;
}

.lesson-image-slot.is-empty {
    border-style: dashed;
    background: #f8fafc;
}

.lesson-image-slot img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
}

.lesson-image-slot figcaption {
    margin-top: 0.65rem;
    color: #475569;
    font-size: 0.92rem;
    text-align: center;
}

.lesson-image-slot-empty {
    display: grid;
    place-items: center;
    gap: 0.35rem;
    min-height: 220px;
    padding: 1.25rem;
    border: 2px dashed #b7c7d8;
    border-radius: 12px;
    color: #64748b;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(20, 184, 166, 0.05)),
        #ffffff;
}

.lesson-image-slot-empty strong {
    color: #172033;
    font-size: 1rem;
}

.lesson-image-slot-empty span {
    color: #64748b;
}

.lesson-disclosure-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.lesson-disclosure {
    border: 1px solid #d8e1eb;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.lesson-disclosure[open] {
    border-color: #9bbcf4;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.lesson-disclosure summary {
    cursor: pointer;
    list-style: none;
    padding: 0.85rem 1rem;
    color: #172033;
    font-weight: 800;
    background: #f8fafc;
}

.lesson-disclosure summary::-webkit-details-marker {
    display: none;
}

.lesson-disclosure summary::after {
    content: "+";
    float: right;
    color: #2563eb;
    font-weight: 900;
}

.lesson-disclosure[open] summary::after {
    content: "-";
}

.lesson-disclosure-body {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

.lesson-disclosure-body > :last-child {
    margin-bottom: 0;
}

.lesson-reader-content .accordion-collapse,
.study-note .accordion-collapse,
.publisher-source-preview .accordion-collapse {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
}

.lesson-reader-content .accordion-item,
.study-note .accordion-item,
.publisher-source-preview .accordion-item {
    margin-bottom: 0.65rem;
    border: 1px solid #d8e1eb;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.lesson-reader-content .accordion-button,
.study-note .accordion-button,
.publisher-source-preview .accordion-button {
    cursor: default;
    width: 100%;
    text-align: left;
    border: 0;
    background: #f8fafc;
    color: #172033;
    font-weight: 800;
}

.lesson-reader-content .accordion-body,
.study-note .accordion-body,
.publisher-source-preview .accordion-body {
    border-top: 1px solid #e2e8f0;
    padding: 1rem;
}

.publisher-source-preview .lesson-reader-content {
    max-height: 720px;
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.simple-editor-panel {
    background: #fffdf8;
}

.simple-editor-panel summary {
    cursor: pointer;
    color: #172033;
    font-weight: 800;
}

.simple-editor-panel p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 900px) {
    .publisher-cover,
    .publisher-spread,
    .publisher-example {
        grid-template-columns: 1fr;
    }

    .publisher-rule-grid,
    .publisher-workshop {
        grid-template-columns: 1fr;
    }

    .publisher-title h2 {
        font-size: 2.25rem;
    }
}


.management-table-card {
    overflow-x: auto;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
}

.management-table-group-card {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.management-table-group-card .management-table-card {
    border: 0;
    border-radius: 0;
}

.management-table-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #dbe4ee;
    background: #fff;
}

.management-table-group-header h2 {
    margin: 0;
    color: #020617;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.management-table {
    width: 100%;
    border-collapse: collapse;
    color: #020617;
}

.management-table th,
.management-table td {
    padding: 0.72rem 0.58rem;
    border-bottom: 1px solid #dbe4ee;
    text-align: left;
    vertical-align: middle;
}

.management-table th {
    font-size: 0.92rem;
    font-weight: 700;
    color: #020617;
    white-space: nowrap;
}

.management-table tbody tr {
    transition: background-color 0.16s ease;
}

.management-table tbody tr:hover {
    background: #f8fafc;
}

.management-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-primary-text {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.35;
}

.table-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.table-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.question-prompt,
.material-preview {
    margin-top: 0.9rem;
    color: #1e293b;
}

.choice-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.choice-row,
.choice-input-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
}

.choice-input-row {
    grid-template-columns: auto auto minmax(0, 1fr);
}

.choice-row {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    padding: 0.5rem;
    background: #f8fafc;
}

.choice-row.correct {
    border-color: rgba(22, 101, 52, 0.28);
    background: #f0fdf4;
}

.choice-row span,
.choice-input-row span {
    display: inline-grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 600;
}

.material-url {
    display: block;
    margin-top: 0.75rem;
    word-break: break-word;
}

.management-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.42);
}

.management-modal {
    width: min(920px, 100%);
    max-height: min(88vh, 860px);
    overflow: auto;
}

.management-tabs,
.import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.management-tabs {
    margin-top: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.management-tabs button {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #64748b;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
}

.management-tabs button.active {
    border-bottom-color: #2563eb;
    color: #0f172a;
}

.json-import-area {
    min-height: clamp(34rem, 62dvh, 720px);
    resize: vertical;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.45;
}

.modal-close {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 1.35rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}

.form-grid label,
.form-grid .form-field,
.choice-editor {
    display: grid;
    gap: 0.35rem;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.choice-editor {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    padding: 0.8rem;
    background: #f8fafc;
}

.form-error {
    margin-bottom: 0.8rem;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fee2e2;
    color: #991b1b;
}

.management-note {
    margin-bottom: 0.8rem;
    border-radius: 8px;
    padding: 0.75rem;
    background: #eef2ff;
    color: #334155;
}

.management-note.success {
    background: #dcfce7;
    color: #166534;
}

.management-muted {
    color: #64748b;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 0.5rem !important;
}

.customer-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.85rem;
    line-height: 1;
}

.customer-rating.large {
    font-size: 1rem;
}

.customer-rating.large .customer-stars {
    font-size: 1.35rem;
}

.customer-stars {
    --score-percent: 0%;
    position: relative;
    display: inline-block;
    color: #d6dde6;
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0;
}

.customer-stars::before {
    content: "★★★★★";
    position: absolute;
    inset: 0;
    width: var(--score-percent);
    color: #ffb020;
    overflow: hidden;
    white-space: nowrap;
}

.score-summary-panel,
.score-editor-card {
    display: grid;
    gap: 0.65rem;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
}

.score-summary-panel {
    margin-block: 1rem;
}

.score-editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.score-editor-card strong {
    display: block;
    color: #0f172a;
    font-size: 1rem;
}

.score-editor-card span {
    color: #64748b;
    font-size: 0.85rem;
}

.score-input-row {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
}

.score-input-row .form-label {
    margin-bottom: 0;
}

.score-active-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #334155;
    font-weight: 700;
}

.user-wizard-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(16, 185, 129, 0.10)),
        #f8fafc;
}

.user-wizard-panel {
    width: min(100%, 620px);
    display: grid;
    gap: 1.2rem;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}

.user-wizard-panel h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1.15;
}

.user-wizard-panel .lead {
    margin: 0;
    color: #475569;
    font-size: 1rem;
}

.user-wizard-options {
    display: grid;
    gap: 0.75rem;
}

.user-wizard-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem;
    min-height: 74px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    padding: 0.95rem 1rem;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.user-wizard-option:hover,
.user-wizard-option.selected {
    border-color: #0ea5e9;
    background: #f0f9ff;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.12);
}

.user-wizard-option input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #0ea5e9;
}

.user-wizard-option strong,
.user-wizard-option small {
    display: block;
}

.user-wizard-option strong {
    color: #0f172a;
    font-size: 1rem;
}

.user-wizard-option small {
    margin-top: 0.2rem;
    color: #64748b;
    line-height: 1.35;
}

.education-management-shell {
    display: grid;
    gap: 1.25rem;
}

.education-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.education-stat-grid article {
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
}

.education-stat-grid span,
.education-title-cell small {
    display: block;
    color: #64748b;
    font-size: 0.85rem;
}

.education-stat-grid strong {
    display: block;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1.2;
}

.education-list-panel {
    overflow: hidden;
}

.education-table td,
.education-table th {
    vertical-align: middle;
}

.education-title-cell {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}

.education-title-cell img,
.education-image-placeholder {
    width: 54px;
    height: 54px;
    border-radius: 8px;
}

.education-title-cell img {
    object-fit: cover;
}

.education-image-placeholder {
    display: grid;
    place-items: center;
    border: 1px solid #dbe4ee;
    background: #f8fafc;
    color: #64748b;
}

.education-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.education-editor-grid label,
.education-editor-grid .full {
    min-width: 0;
}

.education-editor-grid label > span:not(.form-label),
.education-editor-grid .full > span.form-label {
    margin-bottom: 0.35rem;
    color: #334155;
    font-weight: 700;
}

.education-editor-grid .full {
    grid-column: 1 / -1;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 900px) {
    .study-management-shell,
    .management-stats,
    .media-category-management,
    .education-stat-grid,
    .education-editor-grid,
    .form-grid,
    .score-editor-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .management-tree-panel {
        position: static;
        max-height: none;
    }

    .media-tools-tabs {
        grid-template-columns: 1fr;
    }

    .management-header,
    .management-card header,
    .management-modal header,
    .management-modal footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .management-list .material-list-item {
        grid-template-columns: 1fr;
    }

    .management-list .material-list-item .material-row-title,
    .management-list .material-list-item .pill-row,
    .management-list .material-list-item .management-card-actions {
        grid-column: 1;
    }

    .management-list .material-list-item .management-card-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
