html, body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f0e8;
    color: #1f2a26;
}

/* 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: #173b36;
    box-shadow: 1px 0 18px rgba(20, 32, 28, 0.12);
}

.sidebar .top-row {
    background-color: rgba(0, 0, 0, 0.18);
    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: #d7d7d7;
    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: #cbd8d4;
    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 #e4e0d7;
    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: #173b36;
        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: #1f2a26;
    }

    .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: 800;
        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: #176b5d;
}

.btn-primary {
    color: #fff;
    background-color: #c95f2d;
    border-color: #b65125;
}

.btn-primary:hover {
    background-color: #ac4821;
    border-color: #9b3f1d;
}

.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 #64b6a6;
}

.content {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

h1:focus {
    outline: none;
}

h1 {
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.7rem;
}

.lead {
    color: #59645f;
    max-width: 58rem;
}

.eyebrow {
    color: #c95f2d;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.hero-panel,
.tool-panel {
    display: grid;
    gap: 1.5rem;
    align-items: center;
    background: #fffaf2;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    box-shadow: 0 18px 45px rgba(46, 35, 21, 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 #e6dac9;
    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: #173b36;
    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: #59645f;
    font-size: 0.8rem;
    font-weight: 800;
    margin: 0;
}

.language-select,
.domain-select {
    background: #fffaf2;
    border: 1px solid #d9d1c3;
    border-radius: 8px;
    color: #1f2a26;
    font-size: 0.82rem;
    font-weight: 800;
    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 #e6dac9;
    border-radius: 8px;
    overflow: hidden;
}

.customer-table {
    box-shadow: 0 18px 45px rgba(46, 35, 21, 0.06);
}

.customer-table th {
    color: #59645f;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.data-grid-panel {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    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: 800;
    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: #59645f;
    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: 800;
    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;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    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;
}

.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: 800;
}

.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: #59645f;
    display: inline-flex;
    font-size: 0.92rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.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 {
    display: grid;
    min-height: calc(100vh - 7rem);
    place-items: center;
}

.login-panel {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(46, 35, 21, 0.08);
    max-width: 28rem;
    padding: 2rem;
    width: 100%;
}

.permission-grid {
    background: #fff;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.permission-grid label {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.permission-title {
    color: #59645f;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.user-switches {
    display: grid;
    gap: 0.8rem;
    align-content: center;
}

.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 #e6dac9;
    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 #e6dac9;
    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;
}

.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: #59645f;
    font-size: 0.9rem;
}

.selected-file {
    background: #f6f1e8;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem;
}

.selected-file strong {
    overflow-wrap: anywhere;
}

.selected-file span {
    color: #59645f;
    font-size: 0.85rem;
}

.category-picker,
.category-tree {
    background: #fff;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
}

.category-picker label {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.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: 800;
}

.content-media-panel {
    background: #fff;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.content-edit-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.content-type-step {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    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: 800;
    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 #e6dac9;
    border-radius: 8px;
    color: #1f2a26;
    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: 800;
}

.content-type-card strong {
    color: #59645f;
    font-size: 0.86rem;
}

.content-media-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.selected-media-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.selected-media-thumb {
    align-items: center;
    background: #f6f1e8;
    border: 1px solid #e6dac9;
    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;
    padding: 1.25rem;
    position: fixed;
    z-index: 1050;
}

.edit-modal {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    box-shadow: 0 1.5rem 4rem rgba(23, 29, 27, 0.24);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: min(92vh, 60rem);
    max-width: 76rem;
    overflow: hidden;
    width: min(100%, 76rem);
}

.edit-modal-header,
.edit-modal-footer {
    align-items: center;
    display: flex;
    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: 800;
        margin: 0;
    }

.edit-modal-body {
    display: grid;
    gap: 1rem;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.1rem;
}

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

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

.edit-modal .campaign-editor {
    box-shadow: none;
    margin: 0;
}

.nested-panel {
    margin: 0;
}

.google-import-options {
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
}

.google-category-picker {
    max-height: 13rem;
    overflow: auto;
}




.media-modal {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    box-shadow: 0 1.5rem 4rem rgba(23, 29, 27, 0.24);
    display: grid;
    gap: 1rem;
    max-height: min(88vh, 58rem);
    max-width: 72rem;
    overflow: hidden;
    width: min(100%, 72rem);
}

.media-modal-header,
.media-modal-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.1rem;
}

.media-modal-header {
    border-bottom: 1px solid #e6dac9;
}

.media-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
}

.media-modal-body {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(12rem, 16rem) 1fr;
    min-height: 0;
    overflow: hidden;
    padding: 0 1.1rem;
}

.media-category-sidebar {
    border-right: 1px solid #e6dac9;
    display: grid;
    gap: 0.4rem;
    max-height: 58vh;
    overflow: auto;
    padding-right: 1rem;
}

.media-upload-toggle {
    width: 100%;
}

.media-category-button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #42504a;
    font-weight: 700;
    padding: 0.55rem 0.7rem;
    text-align: left;
}

.media-category-button.active,
.media-category-button:hover {
    background: #dceee7;
    border-color: #a7d2c2;
    color: #176b5d;
}

.media-modal-gallery {
    max-height: 58vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.modal-upload-panel {
    background: #fff;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

.upload-preview-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

.upload-preview-card {
    background: #f6f1e8;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    gap: 0.4rem;
    overflow: hidden;
}

.upload-preview-card img {
    aspect-ratio: 4 / 3;
    background: #ece7dd;
    object-fit: cover;
    width: 100%;
}

.upload-preview-card strong,
.upload-preview-card span {
    padding: 0 0.55rem;
}

.upload-preview-card span {
    color: #59645f;
    font-size: 0.8rem;
    padding-bottom: 0.55rem;
}

.media-modal-footer {
    border-top: 1px solid #e6dac9;
}

.media-choice-card {
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: grid;
    overflow: hidden;
}

.media-choice-card.selected {
    border-color: #176b5d;
    box-shadow: 0 0 0 2px rgba(23, 107, 93, 0.14);
}

.media-choice-card img {
    aspect-ratio: 4 / 3;
    background: #ece7dd;
    object-fit: cover;
    width: 100%;
}

.media-choice-card div {
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem;
}

.empty-state {
    background: #f6f1e8;
    border: 1px dashed #b9ad9b;
    border-radius: 8px;
    display: grid;
    gap: 0.5rem;
    padding: 1rem;
}

.empty-state span {
    color: #59645f;
}

.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;
}

.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: #fffaf2;
    border: 1px solid #e6dac9;
    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: #1f2a26;
    font-size: 0.92rem;
}

.toast-content span {
    color: #59645f;
    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: #1f2a26;
}

.selection-drawer-backdrop {
    background: rgba(23, 29, 27, 0.38);
    inset: 0;
    position: fixed;
    z-index: 1090;
}

.selection-drawer {
    background: #fffaf2;
    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: 800;
    margin: 0;
}

.selection-drawer-search {
    padding: 1rem 1rem 0;
}

.selection-drawer-meta {
    color: #59645f;
    display: flex;
    font-size: 0.86rem;
    font-weight: 800;
    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 #e6dac9;
    border-radius: 8px;
    color: #1f2a26;
    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 #d9d1c3;
    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: #59645f;
    font-size: 0.82rem;
    margin-top: 0.1rem;
}

.selection-drawer-item em {
    color: #176b5d;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
    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 #e6dac9;
    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 #e6dac9;
    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 #e6dac9;
    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: #59645f;
}

.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;
    }
}

.selected-summary {
    background: #f6f1e8;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    color: #59645f;
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0.75rem;
}

.selected-summary strong {
    color: #1f2a26;
}

.note-panel {
    background: #fff;
    border: 1px solid #e6dac9;
    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: 800;
    margin: 0;
}

.note-panel-header span {
    color: #59645f;
    font-size: 0.86rem;
    font-weight: 800;
}

.note-compose {
    display: grid;
    gap: 0.65rem;
}

.note-list {
    display: grid;
    gap: 0.65rem;
}

.note-card {
    background: #f6f1e8;
    border: 1px solid #e6dac9;
    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: #1f2a26;
}

.note-card span {
    color: #59645f;
    font-size: 0.78rem;
    font-weight: 800;
}

.note-card p {
    margin: 0;
    white-space: pre-wrap;
}

.note-card .btn {
    justify-self: end;
}

@media (max-width: 760px) {
    .media-modal-body {
        grid-template-columns: 1fr;
    }

    .media-category-sidebar {
        border-right: 0;
        border-bottom: 1px solid #e6dac9;
        max-height: 12rem;
        padding: 0 0 1rem;
    }
}

.category-picker.compact {
    max-height: 12rem;
    overflow: auto;
    padding: 0.75rem;
}

.category-root-target {
    background: #f6f1e8;
    border: 1px dashed #b9ad9b;
    border-radius: 8px;
    color: #59645f;
    font-size: 0.85rem;
    padding: 0.65rem 0.75rem;
}

.category-node {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e6dac9;
    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: 800;
    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: 800;
    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;
}

.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: 800;
    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 #e6dac9;
    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: 800;
    min-height: 2.25rem;
    padding: 0.45rem 0.8rem;
}

.product-tab-button.active,
.product-tab-button:hover {
    background: #173b36;
    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 #e6dac9;
    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: #1f2a26;
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.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: #59645f;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.product-row-grid .row-action {
    align-self: end;
    padding-bottom: 0.05rem;
}

.appointment-panel {
    background: #fffaf2;
}

.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: #59645f;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.appointment-product-grid .row-action {
    align-self: end;
}

.appointment-total {
    align-items: center;
    background: #f6f1e8;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 0.75rem;
}

.appointment-total span {
    color: #59645f;
    font-size: 0.86rem;
    font-weight: 800;
}

.appointment-total strong {
    color: #176b5d;
    font-size: 1.15rem;
}

.contact-list {
    display: grid;
    gap: 1rem;
}

.contact-card {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    padding: 1rem;
}

.contact-card h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.contact-card p {
    color: #59645f;
    margin-bottom: 0.25rem;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button {
    background: #fffaf2;
    border: 1px solid #e6dac9;
    border-radius: 8px;
    color: #42504a;
    font-weight: 700;
    padding: 0.7rem 1rem;
}

.tab-button.active,
.tab-button:hover {
    background: #173b36;
    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: #173b36;
}

.rich-editor {
    background: #fff;
    border: 1px solid #d9d1c3;
    border-radius: 8px;
    overflow: hidden;
}

.rich-editor.source-hidden {
    display: none;
}

.rich-source-area {
    width: 100%;
    min-height: 17rem;
    border: 1px solid #d9d1c3;
    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;
}

.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: #59645f;
    margin-top: 0.5rem;
}

.auto-reply-channel-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid #d9d1c3;
    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 #d9d1c3;
    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 #d9d1c3;
    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 #d9d1c3;
    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 #e6dac9;
    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 #e6dac9;
    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: 800;
}

.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: 800;
}

.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%;
    }
}
.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);
}

.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;
}

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

.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-list {
    display: grid;
    gap: 0.85rem;
}

.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: 800;
}

.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: 800;
}

.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;
}

@media (max-width: 900px) {
    .study-management-shell,
    .management-stats,
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .management-tree-panel {
        position: static;
        max-height: none;
    }

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