:root {
    --color-primary: #0d9488;
    --color-primary-dark: #0f766e;
    --color-primary-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    --color-secondary: #f8fafb;
    --color-success: #047857;
    --color-success-light: #d1fae5;
    --color-warning: #b45309;
    --color-warning-light: #fef3c7;
    --color-danger: #b91c1c;
    --color-danger-light: #fee2e2;
    --color-info: #0d9488;
    --color-info-light: #ccfbf1;
    --color-text-primary: #111827;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-surface: rgba(255, 255, 255, 0.94);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --radius-lg: 16px;
    --radius-xl: 20px;
    --space-2: 0.625rem;
    --space-3: 0.875rem;
    --space-4: 1.125rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 2.75rem;
    --font-family-sans: "DM Sans", "Plus Jakarta Sans", system-ui, sans-serif;
    --font-family-display: "Plus Jakarta Sans", system-ui, sans-serif;
    --3b-blue: #001fff;
    --3b-green: #00ff36;
    --3b-purple: #ae00ff;
    --brand-navy: #1a1a2e;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family-sans);
    color: var(--color-text-primary);
    background: #fff;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-dark);
}

h1,
h2,
h3 {
    margin: 0 0 var(--space-3);
    font-family: var(--font-family-display);
    line-height: 1.15;
}

p {
    margin: 0 0 var(--space-4);
    color: var(--color-text-secondary);
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 72px;
}

.logo {
    font-family: var(--font-family-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.header-identity {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.nav-link:hover {
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
}

.nav-link-primary {
    background: var(--color-primary-gradient);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.nav-link-primary:hover {
    color: #fff;
    transform: translateY(-1px);
}

.page {
    padding: var(--space-6) 0 var(--space-8);
}

.flash-stack {
    display: grid;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.alert {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.alert strong {
    font-size: 0.95rem;
}

.alert span {
    color: var(--color-text-secondary);
}

.alert-success {
    background: var(--color-success-light);
    border-color: rgba(4, 120, 87, 0.25);
}

.alert-warning {
    background: var(--color-warning-light);
    border-color: rgba(180, 83, 9, 0.25);
}

.alert-danger {
    background: var(--color-danger-light);
    border-color: rgba(185, 28, 28, 0.25);
}

.alert-info {
    background: var(--color-info-light);
    border-color: rgba(3, 105, 161, 0.25);
}

.section {
    margin-bottom: var(--space-8);
}

.hero {
    padding: 5rem 0 3rem;
}

.hero-content {
    display: flex;
    justify-content: center;
}

.hero-card {
    max-width: 760px;
    text-align: center;
}

.content-box {
    background: var(--color-surface);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
}

.auth-shell {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 720px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: var(--space-3);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
    gap: var(--space-4);
}

.auth-panel {
    display: grid;
    gap: var(--space-4);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.auth-panel-muted {
    align-content: start;
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.04) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.auth-panel h2 {
    margin: 0;
}

.section-header h1 {
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle,
.lead,
.muted {
    color: var(--color-text-secondary);
}

.text-small {
    font-size: 0.95rem;
}

.form {
    display: grid;
    gap: var(--space-4);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.form-group {
    display: grid;
    gap: 0.55rem;
}

.form-group label,
.info-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.form-help {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.form-control {
    width: 100%;
    min-height: 50px;
    padding: 0.9rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: #fff;
    color: var(--color-text-primary);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.button-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-2);
}

.inline-form {
    margin-top: var(--space-4);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0.9rem 1.35rem;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: #fff;
    color: var(--color-text-primary);
    border: 2px solid var(--color-border);
}

.preview-link-box,
.info-grid {
    display: grid;
    gap: var(--space-3);
}

.preview-link-box {
    margin-top: var(--space-3);
    padding: 1rem 1.15rem;
    border-radius: var(--radius-lg);
    background: rgba(13, 148, 136, 0.06);
}

.info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: var(--space-5);
}

.info-item {
    padding: 1rem 1.15rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.auth-info-grid {
    margin-top: var(--space-4);
}

.student-hero-card {
    display: grid;
    gap: var(--space-5);
}

.student-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: var(--space-4);
}

.student-panel,
.student-services-panel {
    background: rgba(255, 255, 255, 0.88);
}

.student-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-tool-card {
    gap: var(--space-3);
}

.student-tool-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.student-tool-prompts span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.06);
    color: var(--color-text-secondary);
    font-size: 0.92rem;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.admin-shortcut-groups {
    display: grid;
    gap: var(--space-5);
}

.admin-shortcut-section {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-sm);
}

.admin-shortcut-section-header {
    margin-bottom: var(--space-4);
}

.admin-shortcut {
    display: block;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.admin-shortcut strong {
    display: block;
    margin-bottom: 0.35rem;
}

.dashboard-alert-panel {
    margin-bottom: var(--space-5);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(185, 28, 28, 0.15);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: var(--shadow-sm);
}

.dashboard-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.dashboard-alert-list {
    display: grid;
    gap: var(--space-3);
}

.dashboard-alert-item {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.dashboard-alert-item strong {
    display: block;
    margin-bottom: 0.2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 0.95rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.admin-table th {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.admin-table tbody tr:hover {
    background: rgba(13, 148, 136, 0.04);
}

.admin-table code {
    display: inline-block;
    max-width: min(24rem, 100%);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.table-meta {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.media-cell {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.admin-thumb {
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.admin-thumb-book {
    width: 56px;
    height: 72px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.status-badge.active {
    background: var(--color-success-light);
    color: var(--color-success);
}

.status-badge.inactive {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.button-row form {
    margin: 0;
}

.button-row-inline {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.empty-state {
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: rgba(3, 105, 161, 0.06);
}

.admin-panel {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.panel-header h2 {
    margin-bottom: 0.35rem;
    font-size: 1.2rem;
}

.repeatable-list {
    display: grid;
    gap: var(--space-4);
}

.repeatable-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.05) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.repeatable-grid,
.upload-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: end;
}

.table-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.table-scroll .admin-table {
    min-width: 880px;
}

.cover-uploader {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.cover-preview-card,
.workbook-context-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.82);
}

.cover-preview-frame {
    width: 100%;
    aspect-ratio: 1000 / 1293;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(255, 255, 255, 0.96) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
}

.cover-preview-frame-sm {
    width: 84px;
    flex: 0 0 84px;
    margin-bottom: 0;
}

.cover-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cover-preview-empty {
    padding: var(--space-4);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.upload-status {
    margin-top: 0.65rem;
}

.upload-status[data-tone="error"] {
    color: #b91c1c;
}

.upload-status[data-tone="success"] {
    color: #15803d;
}

.lesson-conversion-actions {
    align-items: center;
}

.lesson-conversion-stack {
    display: grid;
    gap: var(--space-5);
}

.lesson-conversion-block {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.88);
}

.lesson-conversion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.lesson-conversion-tabs {
    display: inline-flex;
    gap: 0.45rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    margin-bottom: var(--space-3);
}

.lesson-conversion-tab {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    background: transparent;
    color: var(--color-text-secondary);
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.lesson-conversion-tab.is-active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(13, 148, 136, 0.18);
}

.lesson-conversion-panel {
    display: none;
}

.lesson-conversion-panel.is-active {
    display: block;
}

.lesson-conversion-formatted[readonly] {
    background: rgba(248, 250, 252, 0.92);
    color: var(--color-text-secondary);
}

.lesson-conversion-button.is-ready {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 14px 28px rgba(13, 148, 136, 0.18);
}

.lesson-conversion-button.is-ready:hover {
    background: #0016d1;
    border-color: #0016d1;
    color: #fff;
}

.lesson-submit-status {
    color: var(--color-text-secondary);
    font-weight: 600;
}

.lesson-submit-status[hidden] {
    display: none;
}

.lesson-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid rgba(18, 24, 48, 0.16);
    border-top-color: var(--color-primary);
    animation: lesson-spin 0.75s linear infinite;
}

@keyframes lesson-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.textarea-lg {
    min-height: 220px;
}

.textarea-md {
    min-height: 170px;
}

.textarea-xl {
    min-height: 260px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-shell {
    max-width: 1440px;
}

.chat-header-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.chat-kicker {
    margin-bottom: 0.45rem;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
    gap: var(--space-4);
    align-items: stretch;
    height: min(76vh, 860px);
    min-height: 620px;
}

.chat-panel,
.chat-side-card {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    min-height: 0;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--space-5);
}

.chat-side-panel {
    display: grid;
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: var(--space-4);
    min-height: 0;
}

.chat-panel-header,
.chat-side-card-header,
.chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.chat-panel-header,
.chat-side-card-header {
    margin-bottom: var(--space-4);
}

.chat-panel-body,
.chat-side-card-body {
    min-height: 0;
}

.chat-panel-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.chat-side-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--space-5);
}

.chat-work-card .chat-side-card-body,
.chat-context-card .chat-side-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.chat-context-card .chat-side-card-body {
    overflow-y: auto;
    padding-right: 0.2rem;
}

.chat-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    font-size: 0.92rem;
    font-weight: 700;
}

.chat-status.is-pending {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.chat-thread {
    display: grid;
    flex: 1 1 auto;
    gap: var(--space-3);
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.04) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.chat-bubble {
    width: fit-content;
    max-width: 88%;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.chat-bubble.is-user {
    justify-self: end;
    background: var(--color-primary-gradient);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.chat-bubble.is-assistant {
    justify-self: start;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-bottom-left-radius: 6px;
}

.chat-bubble.is-streaming {
    border-style: dashed;
}

.chat-bubble-meta {
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-bubble-body {
    line-height: 1.55;
    word-break: break-word;
}

.chat-bubble-body h2,
.chat-bubble-body h3,
.chat-bubble-body h4 {
    margin: 0 0 0.7rem;
    line-height: 1.3;
    color: var(--color-text-primary);
}

.chat-bubble-body h2 {
    font-size: 1.05rem;
}

.chat-bubble-body h3,
.chat-bubble-body h4 {
    font-size: 0.98rem;
}

.chat-bubble-body p,
.chat-bubble-body ul,
.chat-bubble-body ol {
    margin: 0 0 0.85rem;
}

.chat-bubble-body p:last-child,
.chat-bubble-body ul:last-child,
.chat-bubble-body ol:last-child {
    margin-bottom: 0;
}

.chat-bubble-body ul,
.chat-bubble-body ol {
    padding-left: 1.35rem;
}

.chat-bubble-body li + li {
    margin-top: 0.25rem;
}

.chat-bubble-body code {
    display: inline-block;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    font-size: 0.92em;
}

.chat-table-wrap {
    margin: 0 0 0.85rem;
    overflow-x: auto;
    border: 1px solid rgba(18, 24, 48, 0.1);
    border-radius: 16px;
    background: #fff;
}

.chat-markdown-table {
    width: 100%;
    min-width: 22rem;
    border-collapse: collapse;
}

.chat-markdown-table th,
.chat-markdown-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(18, 24, 48, 0.08);
    text-align: left;
    vertical-align: top;
}

.chat-markdown-table th {
    background: rgba(13, 148, 136, 0.05);
    font-size: 0.88rem;
    font-weight: 700;
}

.chat-markdown-table tr:last-child td {
    border-bottom: 0;
}

.chat-composer {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.96) 40%);
}

.chat-message-input,
.chat-workbox {
    min-height: 140px;
    resize: vertical;
}

.chat-workbox {
    min-height: 0;
    flex: 1 1 auto;
    resize: none;
}

.chat-resource-list {
    display: grid;
    gap: 0.6rem;
}

.chat-resource-link {
    display: block;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: rgba(13, 148, 136, 0.06);
    border: 1px solid rgba(13, 148, 136, 0.08);
    font-weight: 600;
}

@media (max-width: 760px) {
    .header-content,
    .main-nav,
    .button-row,
    .auth-grid,
    .form-grid,
    .info-grid,
    .filter-row,
    .admin-card-grid,
    .repeatable-grid,
    .upload-toolbar,
    .cover-uploader,
    .panel-header {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .header-brand {
        width: 100%;
    }

    .main-nav {
        width: 100%;
        align-items: stretch;
    }

    .content-box {
        padding: var(--space-6);
    }

    .student-dashboard-grid,
    .student-info-grid {
        grid-template-columns: 1fr;
    }

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table tr,
    .admin-table th,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table td {
        border-bottom: 0;
        padding-bottom: 0.4rem;
    }

    .admin-table tr {
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--color-border);
    }

    .table-actions {
        justify-content: flex-start;
        margin-top: 0.65rem;
    }

    .chat-header-card,
    .chat-panel-header,
    .chat-side-card-header,
    .chat-composer-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .chat-thread {
        min-height: 320px;
    }

    .chat-bubble {
        max-width: 100%;
    }

    .chat-side-panel {
        grid-template-rows: none;
    }

    .chat-panel,
    .chat-side-card {
        min-height: 0;
    }

    .chat-workbox {
        min-height: 240px;
    }
}

/* ============================================
   ASKBOHMI UI REFRESH
   ============================================ */

:root {
    --color-primary: #0d9488;
    --color-primary-dark: #0f766e;
    --color-primary-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    --color-secondary: #f8fafb;
    --color-accent-green: #00ff36;
    --color-accent-green-soft: rgba(0, 255, 54, 0.14);
    --color-accent-purple: #ae00ff;
    --color-accent-purple-soft: rgba(174, 0, 255, 0.12);
    --color-primary-soft: rgba(13, 148, 136, 0.12);
    --color-surface: rgba(255, 255, 255, 0.94);
    --color-surface-strong: rgba(255, 255, 255, 0.96);
    --color-border: rgba(18, 24, 48, 0.09);
    --color-text-primary: #121830;
    --color-text-secondary: #3e4868;
    --color-text-muted: #69708d;
    --shadow-sm: 0 12px 32px rgba(12, 20, 44, 0.08);
    --shadow-lg: 0 28px 80px rgba(12, 20, 44, 0.14);
    --radius-lg: 20px;
    --radius-xl: 30px;
    --space-8: 3.25rem;
}

body {
    background:
        radial-gradient(circle at top left, rgba(13, 148, 136, 0.06) 0, transparent 34%),
        radial-gradient(circle at 88% 14%, rgba(13, 148, 136, 0.04) 0, transparent 28%),
        linear-gradient(180deg, #f8fafb 0%, #ffffff 42%, #f8fafb 100%);
}

.page-shell {
    position: relative;
    overflow-x: clip;
}

.page-orb {
    position: fixed;
    z-index: 0;
    width: 20rem;
    height: 20rem;
    border-radius: 999px;
    filter: blur(48px);
    opacity: 0.35;
    pointer-events: none;
}

.page-orb-blue {
    top: -6rem;
    left: -5rem;
    background: rgba(13, 148, 136, 0.24);
}

.page-orb-green {
    right: -5rem;
    bottom: 12%;
    background: rgba(0, 255, 54, 0.18);
}

.page-orb-purple {
    top: 10rem;
    right: -4rem;
    background: rgba(174, 0, 255, 0.2);
}

.page {
    position: relative;
    z-index: 1;
    padding: 2rem 0 4rem;
}

.container {
    max-width: 1200px;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.74);
    border-bottom: 1px solid rgba(18, 24, 48, 0.08);
    box-shadow: 0 10px 30px rgba(18, 24, 48, 0.05);
}

.header-content {
    min-height: 78px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.logo-accent {
    color: var(--color-accent-purple);
}

.header-identity {
    max-width: 36rem;
}

.main-nav {
    flex-wrap: wrap;
}

.nav-link {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(18, 24, 48, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-link:hover {
    background: rgba(13, 148, 136, 0.08);
}

.nav-link-primary {
    background: var(--color-primary-gradient);
    border-color: transparent;
}

.content-box,
.admin-panel,
.repeatable-card,
.chat-panel,
.chat-side-card,
.chat-header-card {
    background: var(--color-surface);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(18, 24, 48, 0.08);
    box-shadow: var(--shadow-lg);
}

.alert {
    border-color: rgba(18, 24, 48, 0.06);
}

.section-header h1 {
    background-image: linear-gradient(135deg, #111827 0%, #0d9488 42%, #14b8a6 100%);
}

.hero-card-label,
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 36px;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-badge {
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.14) 0%, rgba(174, 0, 255, 0.12) 100%);
    color: var(--color-primary);
    box-shadow: 0 10px 28px rgba(13, 148, 136, 0.12);
}

.hero-card-label {
    margin-bottom: var(--space-3);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(18, 24, 48, 0.08);
    color: var(--color-text-secondary);
}

.hero-home {
    padding: 4rem 0 2rem;
}

.hero-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: var(--space-6);
    align-items: center;
}

.hero-copy,
.hero-visual {
    position: relative;
}

.hero-lead {
    max-width: 42rem;
    font-size: 1.15rem;
}

.hero-actions {
    margin-top: var(--space-4);
}

.hero-pill-row,
.chat-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(18, 24, 48, 0.07);
    color: var(--color-text-secondary);
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(18, 24, 48, 0.06);
}

.hero-support-copy {
    margin-top: var(--space-4);
}

.hero-showcase-card {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 249, 255, 0.97) 100%);
}

.hero-showcase-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 52%, #0f766e 100%);
}

.hero-showcase-top {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: flex-start;
    margin-bottom: var(--space-5);
}

.hero-logo-frame {
    box-shadow: 0 14px 34px rgba(18, 24, 48, 0.12);
}

.hero-showcase-grid,
.student-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.hero-feature-card,
.marketing-card,
.student-summary-card {
    position: relative;
    padding: 1.25rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(18, 24, 48, 0.07);
    box-shadow: 0 16px 34px rgba(18, 24, 48, 0.06);
}

.hero-feature-card p,
.marketing-card p {
    margin-bottom: 0;
}

.hero-feature-card-blue {
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.09) 0%, rgba(255, 255, 255, 0.97) 100%);
}

.hero-feature-card-green {
    background: linear-gradient(180deg, rgba(0, 255, 54, 0.1) 0%, rgba(255, 255, 255, 0.97) 100%);
}

.hero-feature-card-purple {
    background: linear-gradient(180deg, rgba(174, 0, 255, 0.09) 0%, rgba(255, 255, 255, 0.97) 100%);
}

.hero-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    margin-bottom: 0.9rem;
    border-radius: 14px;
    background: rgba(18, 24, 48, 0.88);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
}

.marketing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.marketing-card-kicker {
    margin-bottom: 0.8rem;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn {
    box-shadow: 0 12px 28px rgba(18, 24, 48, 0.08);
}

.btn-primary {
    background: var(--color-primary-gradient);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(18, 24, 48, 0.1);
}

.btn-ghost {
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    border: 1px solid rgba(13, 148, 136, 0.1);
}

.form-control {
    border: 1px solid rgba(18, 24, 48, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.form-control:focus {
    border-color: rgba(13, 148, 136, 0.48);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12), 0 12px 24px rgba(13, 148, 136, 0.08);
}

.auth-card-refresh {
    overflow: hidden;
    padding: 2rem;
}

.auth-grid-refresh {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.82fr);
    gap: var(--space-5);
}

.auth-panel-primary,
.auth-panel-aside {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    border: 1px solid rgba(18, 24, 48, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-panel-primary {
    padding: 1.5rem;
}

.auth-panel-aside {
    background:
        linear-gradient(180deg, rgba(174, 0, 255, 0.08) 0%, rgba(255, 255, 255, 0.95) 38%),
        linear-gradient(135deg, rgba(13, 148, 136, 0.05) 0%, rgba(0, 255, 54, 0.06) 100%);
}

.auth-highlight-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.auth-highlight-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(18, 24, 48, 0.07);
}

.auth-highlight-card span {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.auth-actions .btn {
    min-width: 180px;
}

.auth-benefit-list {
    display: grid;
    gap: 1rem;
}

.auth-benefit-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: flex-start;
}

.auth-benefit-item p {
    margin: 0.2rem 0 0;
    font-size: 0.95rem;
}

.auth-benefit-dot {
    display: inline-flex;
    width: 0.9rem;
    height: 0.9rem;
    margin-top: 0.35rem;
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(18, 24, 48, 0.04);
}

.auth-benefit-dot-blue {
    background: var(--color-primary);
}

.auth-benefit-dot-green {
    background: var(--color-accent-green);
}

.auth-benefit-dot-purple {
    background: var(--color-accent-purple);
}

.student-dashboard-shell {
    display: grid;
    gap: var(--space-5);
}

.student-hero-refresh {
    padding: 2rem;
}

.student-hero-top {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: flex-start;
}

.student-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.student-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

.student-summary-card strong {
    display: block;
    font-size: 1.05rem;
}

.student-summary-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lesson-launcher-card {
    background:
        linear-gradient(180deg, rgba(13, 148, 136, 0.06) 0%, rgba(255, 255, 255, 0.94) 44%);
}

.student-account-card {
    background:
        linear-gradient(180deg, rgba(174, 0, 255, 0.06) 0%, rgba(255, 255, 255, 0.94) 44%);
}

.student-note-box {
    background: linear-gradient(135deg, rgba(0, 255, 54, 0.12) 0%, rgba(255, 255, 255, 0.82) 100%);
}

.student-services-refresh {
    padding: 2rem;
    background:
        linear-gradient(180deg, rgba(13, 148, 136, 0.05) 0%, rgba(255, 255, 255, 0.96) 28%);
}

.student-tool-card-refresh {
    display: grid;
    align-content: start;
    min-height: 100%;
    padding: 1.35rem;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 255, 0.96) 100%);
}

.student-tool-card-refresh .media-cell strong {
    font-size: 1.05rem;
}

.student-tool-prompts span {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(174, 0, 255, 0.08) 100%);
    border: 1px solid rgba(18, 24, 48, 0.06);
}

.status-badge.active {
    background: rgba(0, 255, 54, 0.16);
    color: #0c6a22;
}

.status-badge.inactive {
    background: rgba(174, 0, 255, 0.12);
    color: #7b17ae;
}

.chat-shell {
    max-width: 1280px;
    gap: 1rem;
}

.chat-header-card-refresh {
    margin-bottom: 1rem;
    padding: 0.95rem 1.15rem;
    background:
        linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(255, 255, 255, 0.95) 36%, rgba(174, 0, 255, 0.08) 100%);
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.chat-header-cover {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
}

.chat-header-copy {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.chat-header-copy h1 {
    font-size: clamp(1.45rem, 2.1vw, 1.95rem);
}

.chat-header-actions {
    display: grid;
    justify-items: end;
    gap: 0.65rem;
}

.chat-layout-refresh {
    gap: var(--space-5);
    height: min(78vh, 900px);
}

.chat-panel-refresh,
.chat-side-card {
    border-radius: 28px;
}

.chat-panel-refresh {
    padding: 1.4rem;
}

.admin-test-chat-stack {
    grid-template-columns: minmax(0, 1fr);
}

.admin-log-table td {
    min-width: 0;
}

.admin-log-content-cell {
    min-width: 22rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-status {
    background: rgba(13, 148, 136, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(13, 148, 136, 0.09);
    padding: 0.55rem 0.85rem;
}

.chat-status.is-pending {
    background: rgba(0, 255, 54, 0.16);
    color: #0c6a22;
    border-color: rgba(0, 255, 54, 0.18);
}

.chat-thread {
    padding: 1.1rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(174, 0, 255, 0.08) 0, rgba(174, 0, 255, 0) 32%),
        linear-gradient(180deg, rgba(13, 148, 136, 0.06) 0%, rgba(255, 255, 255, 0.98) 100%);
    align-content: start;
    grid-auto-rows: max-content;
}

.empty-state-chat {
    background: rgba(255, 255, 255, 0.86);
    border: 1px dashed rgba(18, 24, 48, 0.16);
}

.chat-bubble {
    border-radius: 22px;
    padding: 1rem 1.15rem;
    width: fit-content;
    max-width: min(88%, 42rem);
}

.chat-bubble.is-user {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 48%, #0f766e 100%);
    box-shadow: none;
}

.chat-bubble.is-assistant {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(18, 24, 48, 0.09);
}

.chat-bubble.is-streaming {
    border-color: rgba(174, 0, 255, 0.3);
    background: linear-gradient(180deg, rgba(174, 0, 255, 0.06) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.chat-composer-refresh {
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 22px;
    border-top: 0;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-run-status-copy {
    max-width: 32rem;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    background: rgba(255, 245, 238, 0.95);
    border: 1px solid rgba(161, 50, 0, 0.16);
    border-left: 4px solid #a13200;
}

.chat-run-status-copy:empty {
    display: none;
}

.chat-side-panel-refresh {
    gap: var(--space-5);
}

.chat-panel-refresh {
    border-top: 3px solid var(--color-primary);
}

.chat-work-card {
    border-top: 3px solid var(--color-accent-green);
}

.chat-context-card {
    border-top: 3px solid var(--color-accent-purple);
}

.chat-side-card {
    padding: 1.35rem;
}

.chat-work-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-work-expand-button {
    min-height: 40px;
    white-space: nowrap;
}

.chat-workbox-actions,
.chat-draft-window-actions {
    flex-wrap: wrap;
}

.chat-draft-window[hidden] {
    display: none;
}

.chat-draft-window {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.chat-draft-window-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 24, 48, 0.34);
    backdrop-filter: blur(10px);
}

.chat-draft-window-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 1.25rem;
}

.chat-draft-window-card {
    width: min(980px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 28px;
    border: 1px solid rgba(18, 24, 48, 0.08);
    border-top: 3px solid var(--color-accent-green);
    background:
        linear-gradient(180deg, rgba(0, 255, 54, 0.06) 0%, rgba(255, 255, 255, 0.98) 14%, #fff 100%);
    box-shadow: 0 28px 80px rgba(12, 20, 44, 0.2);
}

.chat-draft-window-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.chat-draft-window-header h2 {
    margin-bottom: 0;
}

.chat-draft-window-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chat-draft-window-close {
    min-height: 40px;
}

.chat-draft-window-body {
    min-height: 0;
}

.chat-draft-window-input {
    min-height: min(68vh, 680px);
    resize: vertical;
}

body.chat-draft-window-open {
    overflow: hidden;
}

.chat-resource-list-secondary {
    margin-top: var(--space-3);
}

.chat-resource-link {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(18, 24, 48, 0.08);
    box-shadow: 0 10px 24px rgba(18, 24, 48, 0.05);
}

.chat-resource-link:hover {
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
}

@media (max-width: 1120px) {
    .hero-home-grid,
    .auth-grid-refresh,
    .student-dashboard-grid,
    .chat-layout-refresh {
        grid-template-columns: 1fr;
    }

    .chat-layout-refresh {
        height: auto;
        min-height: 0;
    }

    .chat-side-panel-refresh {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .chat-draft-window-card {
        width: min(940px, calc(100vw - 1.5rem));
    }

    .student-summary-strip,
    .hero-showcase-grid,
    .student-tools-grid,
    .marketing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page {
        padding-top: 1.25rem;
    }

    .page-orb {
        width: 14rem;
        height: 14rem;
        filter: blur(34px);
    }

    .main-header {
        background: rgba(255, 255, 255, 0.84);
    }

    .header-content {
        min-height: auto;
        padding: 0.8rem 0;
    }

    .main-nav,
    .button-row,
    .student-hero-top,
    .student-hero-badges,
    .hero-showcase-top,
    .chat-header-card,
    .chat-header-actions,
    .chat-composer-actions {
        align-items: stretch;
    }

    .student-hero-top,
    .student-hero-badges,
    .hero-showcase-top,
    .chat-header-actions {
        flex-direction: column;
    }

    .chat-header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-link,
    .btn {
        width: 100%;
    }

    .hero-home {
        padding-top: 2.2rem;
    }

    .hero-showcase-card,
    .auth-card-refresh,
    .student-hero-refresh,
    .student-services-refresh,
    .chat-header-card-refresh,
    .chat-panel-refresh,
    .chat-side-card {
        padding: 1.25rem;
    }

    .hero-showcase-grid,
    .marketing-grid,
    .student-summary-strip,
    .student-tools-grid,
    .auth-highlight-row,
    .chat-side-panel-refresh {
        grid-template-columns: 1fr;
    }

    .hero-pill-row,
    .chat-header-meta {
        gap: 0.55rem;
    }

    .hero-pill {
        width: auto;
    }

    .chat-work-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .student-summary-card strong,
    .hero-feature-card strong,
    .marketing-card h3 {
        font-size: 1rem;
    }

    .chat-thread {
        min-height: 300px;
    }

    .chat-workbox {
        min-height: 220px;
    }

    .chat-work-expand-button,
    .chat-draft-window {
        display: none;
    }
}

/* ============================================
   ASKBOHMI UI REFRESH V2
   ============================================ */

body {
    background: #f7f8fc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-shell {
    overflow-x: hidden;
}

.page {
    flex: 1 0 auto;
}

.main-header {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(18, 24, 48, 0.04);
}

.nav-link-primary,
.btn-primary {
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    box-shadow: none;
}

.btn-secondary {
    background: #fff;
    border: 1px solid rgba(18, 24, 48, 0.14);
    box-shadow: none;
}

.btn-ghost {
    background: #fff;
    color: var(--color-primary);
    border: 1px solid rgba(18, 24, 48, 0.16);
    box-shadow: none;
}

.btn:hover,
.nav-link:hover {
    transform: none;
}

.btn-disabled,
.btn[disabled] {
    opacity: 0.62;
    cursor: not-allowed;
}

.section-header h1 {
    background: none;
    color: var(--color-text-primary);
    -webkit-text-fill-color: initial;
}

.hero-badge,
.hero-card-label,
.auth-kicker,
.chat-status,
.status-badge {
    background: #fff;
    box-shadow: none;
}

.hero-badge,
.auth-kicker {
    border: 1px solid rgba(13, 148, 136, 0.18);
    color: var(--color-primary);
}

.hero-card-label {
    border-color: rgba(174, 0, 255, 0.22);
    color: var(--color-text-primary);
}

.status-badge.active {
    background: #fff;
    border: 1px solid rgba(0, 255, 54, 0.28);
    color: #148733;
}

.status-badge.inactive {
    background: #fff;
    border: 1px solid rgba(174, 0, 255, 0.25);
    color: var(--color-text-primary);
}

.content-box,
.admin-panel,
.repeatable-card,
.chat-panel,
.chat-side-card,
.chat-header-card,
.marketing-card,
.hero-feature-card,
.student-summary-card,
.settings-summary-card {
    background: #fff;
    box-shadow: 0 12px 28px rgba(18, 24, 48, 0.05);
    backdrop-filter: none;
}

.hero-showcase-card,
.auth-panel-aside,
.lesson-launcher-card,
.student-account-card,
.student-services-refresh,
.student-tool-card-refresh,
.chat-header-card-refresh,
.chat-thread,
.chat-composer-refresh,
.student-note-box,
.settings-note-box {
    background: #fff;
}

.hero-showcase-card::before {
    background: var(--color-primary);
}

.hero-feature-card-blue {
    border-top: 3px solid var(--color-primary);
}

.hero-feature-card-green {
    border-top: 3px solid var(--color-accent-green);
}

.hero-feature-card-purple {
    border-top: 3px solid var(--color-accent-purple);
}

.auth-panel-primary,
.auth-panel-aside,
.auth-highlight-card,
.info-item,
.settings-identity-item {
    background: #fff;
    border: 1px solid rgba(18, 24, 48, 0.08);
    box-shadow: none;
}

.form-control {
    background: #fff;
    box-shadow: none;
}

.form-control:focus {
    border-color: rgba(13, 148, 136, 0.45);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.lesson-launcher-hero {
    padding: 1.75rem;
}

.student-dashboard-actions {
    justify-content: flex-end;
}

.lesson-launcher-card-prominent {
    padding: 1.5rem;
    border: 1px solid rgba(13, 148, 136, 0.18);
}

.student-services-refresh {
    border-top: 3px solid rgba(174, 0, 255, 0.7);
}

.pro-features-disclosure {
    padding: 1.4rem;
}

.pro-features-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.pro-features-summary::-webkit-details-marker {
    display: none;
}

.pro-features-content {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.btn-summary-toggle {
    white-space: nowrap;
}

.student-tool-card-refresh {
    border-top: 3px solid rgba(13, 148, 136, 0.65);
}

.student-tool-prompts span {
    background: #fff;
    border: 1px solid rgba(13, 148, 136, 0.12);
    color: var(--color-primary);
}

.chat-header-card-refresh {
    padding: 1rem 1.25rem;
    align-items: center;
}

.chat-header-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.chat-header-back-button {
    min-height: 42px;
    padding: 0.7rem 1rem;
    width: auto;
    white-space: nowrap;
}

.chat-status {
    border: 1px solid rgba(13, 148, 136, 0.18);
    color: var(--color-primary);
}

.chat-status.is-pending {
    border-color: rgba(0, 255, 54, 0.28);
    color: #148733;
}

.chat-layout-refresh {
    gap: 1rem;
    height: min(80vh, 920px);
    min-height: 560px;
}

.chat-thread {
    background: #fbfcff;
    border: 1px solid rgba(18, 24, 48, 0.08);
}

.chat-bubble {
    box-shadow: none;
}

.chat-bubble.is-user {
    background: #fff;
    color: var(--color-text-primary);
    border: 1px solid rgba(13, 148, 136, 0.18);
    border-left: 4px solid var(--color-primary);
}

.chat-bubble.is-assistant {
    border-left: 4px solid var(--color-accent-purple);
}

.chat-bubble.is-streaming {
    background: #fff;
    border-style: dashed;
}

.chat-run-status-copy[hidden] {
    display: none;
}

.chat-run-status-copy {
    color: #a13200;
    font-weight: 600;
}

.chat-resource-link {
    background: #fff;
    border-left: 3px solid var(--color-primary);
    box-shadow: none;
}

.chat-resource-link:hover {
    background: #f7f9ff;
}

.btn-copy-link {
    min-height: 38px;
    padding: 0.45rem 0.7rem;
    width: auto;
}

.site-footer {
    margin-top: var(--space-6);
    border-top: 1px solid rgba(0, 255, 54, 0.34);
    background: #fff;
}

.site-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 1rem 0 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.site-footer-content a {
    color: var(--color-primary);
    font-weight: 600;
}

.site-footer-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.app-footer {
    margin-top: var(--space-8);
    padding: 32px 24px;
    background: var(--brand-navy);
    border-top: 3px solid;
    border-image: linear-gradient(90deg, #0d9488, #14b8a6, #0f766e) 1;
    color: rgba(255, 255, 255, 0.5);
}

.app-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.app-footer-brand {
    font-family: var(--font-family-display);
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.app-footer-links {
    display: flex;
    gap: 24px;
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.app-footer-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.app-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.app-footer-copy {
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 12px;
}

@media (max-width: 768px) {
    .app-footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .app-footer-links {
        justify-content: center;
    }
}

.student-settings-shell {
    display: grid;
    gap: var(--space-5);
}

.settings-hero-card {
    padding: 1.75rem;
}

.settings-hero-top {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

.settings-summary-card {
    padding: 1rem 1.1rem;
    border-top: 3px solid rgba(13, 148, 136, 0.7);
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: var(--space-4);
    align-items: start;
}

.settings-sidebar {
    display: grid;
    gap: var(--space-4);
}

.settings-panel {
    padding: 1.5rem;
}

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

.settings-identity-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
}

.settings-upgrade-actions {
    align-items: stretch;
}

.settings-upgrade-panel {
    border-top: 3px solid rgba(174, 0, 255, 0.7);
}

.teacher-dashboard-shell,
.teacher-class-shell {
    display: grid;
    gap: var(--space-5);
}

.teacher-page .button-row form,
.teacher-page .table-actions form {
    margin: 0;
}

.teacher-page .table-actions form {
    display: inline-flex;
}

.strictness {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    outline: none;
    background: linear-gradient(90deg, #22c55e 0%, #f59e0b 50%, #ef4444 100%);
    border: 1px solid rgba(18, 24, 48, 0.14);
}

.strictness::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid rgba(18, 24, 48, 0.25);
    box-shadow: 0 2px 6px rgba(18, 24, 48, 0.12);
    cursor: pointer;
}

.strictness::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid rgba(18, 24, 48, 0.25);
    box-shadow: 0 2px 6px rgba(18, 24, 48, 0.12);
    cursor: pointer;
}

.btn-upgrade-student {
    white-space: nowrap;
    min-width: max-content;
}

.auth-card-refresh {
    border-top: 3px solid rgba(18, 24, 48, 0.08);
}

.auth-card-register {
    padding-bottom: 2.35rem;
}

.auth-panel-aside {
    border-color: rgba(18, 24, 48, 0.09);
    background: #fcfcfe;
}

.auth-highlight-card {
    border-top: 2px solid rgba(13, 148, 136, 0.14);
}

.auth-benefit-dot-purple {
    box-shadow: 0 0 0 5px rgba(174, 0, 255, 0.05);
}

.auth-register-actions {
    margin-bottom: 1rem;
}

.auth-register-footer {
    margin-top: 1rem;
}

.main-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.locale-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem;
    border: 1px solid rgba(18, 24, 48, 0.12);
    border-radius: 999px;
    background: #fff;
}

.locale-switcher-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.2rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    color: var(--color-text-secondary);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.locale-switcher-link:hover,
.locale-switcher-link.is-active {
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
}

.home-hero {
    padding-top: 2.75rem;
    padding-bottom: 2rem;
}

.home-hero-shell {
    display: grid;
    gap: 1.5rem;
}

.home-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    gap: 1.25rem;
    align-items: start;
}

.home-copy-panel,
.home-selector-panel,
.home-story-card {
    padding: 1.6rem;
    background: #fff;
}

.home-copy-panel {
    border-top: 4px solid rgba(13, 148, 136, 0.85);
}

.home-selector-panel {
    border-top: 4px solid rgba(174, 0, 255, 0.82);
}

.home-story-card-wide {
    border-top: 4px solid rgba(0, 255, 54, 0.7);
}

.home-section-header h1 {
    max-width: 14ch;
    font-size: clamp(2.4rem, 5vw, 4.35rem);
    line-height: 1.02;
}

.home-hero-subtitle,
.home-hero-lead {
    max-width: 48rem;
}

.home-hero-subtitle {
    font-size: 1.08rem;
}

.home-hero-lead {
    margin-bottom: 0;
    font-size: 1.06rem;
}

.home-pill-row {
    margin-top: var(--space-4);
}

.home-selector-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.home-selector-form {
    gap: 1rem;
}

.home-selected-lesson-box {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(18, 24, 48, 0.08);
    background: #fbfbfd;
}

.home-selector-actions .btn {
    flex: 1 1 220px;
}

.home-value-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.home-value-card:nth-child(1) {
    border-top: 3px solid rgba(13, 148, 136, 0.78);
}

.home-value-card:nth-child(2) {
    border-top: 3px solid rgba(0, 255, 54, 0.68);
}

.home-value-card:nth-child(3) {
    border-top: 3px solid rgba(174, 0, 255, 0.68);
}

.home-story-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.home-story-card-wide {
    grid-column: 1 / -1;
}

.auth-card {
    max-width: 1120px;
}

.auth-card-register {
    max-width: 900px;
}

.auth-card-refresh {
    padding: 1.6rem;
    background: #fff;
}

.auth-grid-refresh {
    gap: 1.2rem;
}

.auth-panel-primary {
    padding: 1.35rem;
}

.auth-panel-aside {
    border-top: 3px solid rgba(174, 0, 255, 0.5);
}

.auth-actions {
    align-items: stretch;
}

.auth-actions .btn {
    flex: 1 1 220px;
}

@media (max-width: 1120px) {
    .home-intro-grid,
    .home-value-grid,
    .home-story-grid,
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-section-header h1 {
        max-width: none;
    }
}

@media (max-width: 760px) {
    .chat-header-card-refresh,
    .settings-hero-card,
    .settings-panel,
    .lesson-launcher-card-prominent {
        padding: 1.1rem;
    }

    .settings-hero-top,
    .student-dashboard-actions,
    .settings-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-header-status-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }

    .chat-header-cover {
        width: 64px;
        height: 84px;
    }

    .chat-page .chat-header-card-refresh {
        grid-template-columns: 1fr;
    }

    .chat-page .chat-header-card-refresh .chat-header-main,
    .chat-page .chat-header-card-refresh .chat-header-actions {
        grid-column: 1;
    }

    .chat-page .chat-header-card-refresh .chat-header-actions {
        justify-content: flex-start;
        justify-self: stretch;
    }

    .chat-header-back-button,
    .settings-hero-actions .btn {
        width: 100%;
    }

    .btn-upgrade-student {
        min-width: 0;
        width: 100%;
    }

    .pro-features-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-summary-grid {
        grid-template-columns: 1fr;
    }

    .chat-layout-refresh {
        height: auto;
        min-height: 0;
    }

    .chat-bubble {
        width: auto;
        max-width: 100%;
    }

    .site-footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-content {
        align-items: stretch;
    }

    .main-nav {
        width: 100%;
        justify-content: stretch;
    }

    .locale-switcher {
        width: 100%;
        justify-content: space-between;
    }

    .locale-switcher-link {
        flex: 1 1 0;
    }

    .home-copy-panel,
    .home-selector-panel,
    .home-story-card,
    .auth-card-refresh {
        padding: 1.15rem;
    }

    .home-selector-head,
    .home-selector-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-value-grid,
    .home-story-grid {
        grid-template-columns: 1fr;
    }
}

.public-nav-links {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}

.nav-link.is-active {
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
}

.public-page .page {
    padding-top: 0;
}

.marketing-hero {
    padding: 4rem 0 2.5rem;
}

.marketing-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 2.5rem;
    align-items: start;
}

.marketing-hero-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.marketing-hero-copy {
    padding-top: 0.5rem;
}

.public-eyebrow {
    margin-bottom: 1.35rem;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-eyebrow-dot {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: var(--color-primary);
}

.marketing-hero-title {
    max-width: 13ch;
    margin-bottom: 1rem;
    font-size: clamp(2.9rem, 6vw, 4.5rem);
    line-height: 0.98;
}

.marketing-hero-subtitle {
    max-width: 42rem;
    margin-bottom: 1rem;
    font-size: 1.14rem;
    color: var(--color-text-secondary);
}

.marketing-hero-body {
    max-width: 45rem;
    margin-bottom: 1.75rem;
    font-size: 1rem;
    color: var(--color-text-secondary);
}

.marketing-hero-actions {
    margin-bottom: 1.6rem;
}

.marketing-trust-row {
    margin-bottom: 1.2rem;
}

.selector-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

.selector-accent-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, #14b8a6 52%, #0f766e 100%);
}

.selector-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.4rem 1.4rem 0;
}

.selector-label,
.marketing-story-eyebrow {
    margin-bottom: 0.35rem;
    color: var(--color-text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.selector-title {
    margin-bottom: 0.35rem;
    font-size: 1.6rem;
}

.selector-subtitle {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.selector-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: #f6f8fc;
    color: var(--color-primary);
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
}

.selector-logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selector-body {
    padding: 1.1rem 1.4rem 1.4rem;
}

.field {
    margin-bottom: 0.95rem;
}

.field-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--color-text-secondary);
    font-size: 0.83rem;
    font-weight: 700;
}

.field-select {
    width: 100%;
    min-height: 50px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    background: #fff;
    color: var(--color-text-primary);
    font: inherit;
}

.field-select:focus {
    outline: none;
    border-color: rgba(13, 148, 136, 0.45);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.selected-lesson-box {
    margin-bottom: 1.1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: #f8f9fd;
    border: 1px solid rgba(17, 24, 39, 0.07);
}

.selected-lesson-label {
    margin-bottom: 0.22rem;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.selected-lesson-name {
    color: var(--color-text-primary);
    font-size: 0.96rem;
    font-weight: 600;
}

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

.selector-actions .btn {
    width: 100%;
}

.homepage-demo-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: center;
}

.homepage-demo-copy {
    max-width: 31rem;
}

.homepage-demo-title {
    margin-bottom: 0.65rem;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
}

.homepage-demo-body {
    margin-bottom: 0;
    font-size: 1rem;
}

.homepage-demo-preview {
    padding: 1.35rem;
    background: #f7f8fc;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.homepage-demo-thread {
    display: grid;
    gap: 0.95rem;
}

.homepage-demo-message {
    width: fit-content;
    max-width: min(100%, 32rem);
    padding: 1rem 1.1rem;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(18, 24, 48, 0.08);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.homepage-demo-message.is-user {
    margin-left: auto;
    border-color: rgba(13, 148, 136, 0.16);
    box-shadow: 0 10px 26px rgba(13, 148, 136, 0.08);
}

.homepage-demo-message.is-assistant {
    border-left: 4px solid #ae00ff;
}

.homepage-demo-message-label {
    margin-bottom: 0.45rem;
    color: var(--color-text-primary);
    font-size: 0.88rem;
    font-weight: 800;
}

.homepage-demo-message p {
    margin: 0 0 0.7rem;
    color: var(--color-text-secondary);
}

.homepage-demo-message p:last-child {
    margin-bottom: 0;
}

.homepage-spotlight-grid {
    align-items: stretch;
}

.homepage-spotlight-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    height: 100%;
}

.homepage-spotlight-card-publisher {
    border-color: rgba(174, 0, 255, 0.16);
}

.homepage-tool-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.hero-pill-accent {
    background: rgba(13, 148, 136, 0.04);
    border-color: rgba(13, 148, 136, 0.12);
    color: var(--color-text-primary);
    box-shadow: none;
}

.marketing-section {
    padding: 0 0 2.5rem;
}

.marketing-section-tight {
    padding-bottom: 2rem;
}

.marketing-section-header {
    margin-bottom: 1.25rem;
}

.marketing-card-grid {
    display: grid;
    gap: 1rem;
}

.marketing-card-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketing-card-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketing-card-grid-four,
.values-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.marketing-value-card,
.value-card,
.marketing-story-card,
.marketing-step-card,
.pricing-card,
.faq-card {
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.marketing-card-kicker,
.value-kicker {
    margin-bottom: 0.55rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marketing-card-title,
.value-title,
.marketing-step-title,
.pricing-plan-name,
.faq-question {
    margin-bottom: 0.6rem;
}

.marketing-card-body,
.value-body,
.marketing-step-body,
.faq-answer,
.pricing-plan-summary {
    margin-bottom: 0;
    color: var(--color-text-secondary);
}

.value-kicker--blue,
.marketing-card-grid .marketing-value-card:nth-child(4n + 1) .marketing-card-kicker {
    color: var(--color-primary);
}

.value-kicker--orange,
.marketing-card-grid .marketing-value-card:nth-child(4n + 2) .marketing-card-kicker {
    color: #c26b00;
}

.value-kicker--green,
.marketing-card-grid .marketing-value-card:nth-child(4n + 3) .marketing-card-kicker {
    color: #09803a;
}

.value-kicker--violet,
.marketing-card-grid .marketing-value-card:nth-child(4n + 4) .marketing-card-kicker {
    color: #7a00d6;
}

.marketing-number-card {
    position: relative;
    padding-top: 4rem;
}

.marketing-number-badge {
    position: absolute;
    top: 1.3rem;
    left: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    font-size: 0.88rem;
    font-weight: 800;
}

.moderation-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 24px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.moderation-copy {
    padding: 2rem;
}

.moderation-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.06);
    color: #b42318;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.moderation-eyebrow-dot {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: #b42318;
}

.moderation-title {
    max-width: 20ch;
    margin-bottom: 0.9rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.05;
}

.moderation-body {
    max-width: 60rem;
    margin-bottom: 1.3rem;
}

.moderation-features {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.moderation-feature {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.moderation-feature:last-child {
    border-bottom: none;
}

.moderation-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 12px;
    background: #f7f8fc;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 800;
}

.moderation-feature-text strong {
    display: block;
    margin-bottom: 0.18rem;
}

.moderation-feature-text span {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.moderation-status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.moderation-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.15rem 1rem;
    text-align: center;
    border-right: 1px solid rgba(17, 24, 39, 0.08);
}

.moderation-stat:last-child {
    border-right: none;
}

.moderation-stat-label {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.moderation-stat-value {
    font-size: 0.9rem;
    font-weight: 800;
}

.moderation-stat-value--green {
    color: #0f8a38;
}

.moderation-stat-value--red {
    color: #c82121;
}

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

.marketing-story-card-wide {
    grid-column: 1 / -1;
}

.marketing-story-title {
    margin-bottom: 0.55rem;
}

.marketing-story-body {
    margin-bottom: 0;
    color: var(--color-text-secondary);
}

.marketing-steps-grid {
    display: grid;
    gap: 1rem;
}

.pricing-plan-price {
    margin-bottom: 0.7rem;
    color: var(--color-primary);
    font-size: 1.4rem;
    font-weight: 800;
}

.pricing-feature-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding-left: 1.1rem;
}

.pricing-feature-list li {
    color: var(--color-text-secondary);
}

.pricing-school-note {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(0, 255, 54, 0.08);
    border: 1px solid rgba(0, 255, 54, 0.2);
}

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

.marketing-cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.marketing-cta-title {
    margin-bottom: 0.45rem;
}

.marketing-cta-body {
    margin-bottom: 0;
    color: var(--color-text-secondary);
}

@media (max-width: 1120px) {
    .marketing-hero-grid,
    .homepage-demo-shell,
    .marketing-card-grid-four,
    .values-grid,
    .marketing-card-grid-three,
    .marketing-story-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .marketing-card-grid-two {
        grid-template-columns: 1fr;
    }

    .moderation-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .moderation-stat:nth-child(2) {
        border-right: none;
    }

    .moderation-stat:nth-child(-n + 2) {
        border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    }
}

@media (max-width: 760px) {
    .public-nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .public-nav-links .nav-link {
        flex: 1 1 calc(50% - 0.2rem);
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        font-size: 0.82rem;
    }

    .marketing-hero {
        padding: 2.2rem 0 1.8rem;
    }

    .marketing-hero-title {
        max-width: none;
        font-size: 2.65rem;
    }

    .selector-header,
    .selector-body,
    .homepage-demo-preview,
    .moderation-copy,
    .marketing-value-card,
    .value-card,
    .marketing-story-card,
    .marketing-step-card,
    .pricing-card,
    .faq-card,
    .marketing-cta-band {
        padding: 1.2rem;
    }

    .selector-actions,
    .homepage-tool-list,
    .moderation-status-strip,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .homepage-tool-list {
        display: grid;
    }

    .marketing-cta-band {
        flex-direction: column;
        align-items: stretch;
    }
}


/* ============================================
   STUDENT AREA DESIGN — 3andB Palette
   ============================================ */

.student-page .content-box,
.student-page .admin-panel {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    border-radius: 20px;
    background: #fff;
}

.student-accent-bar {
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, var(--3b-blue), var(--3b-green), var(--3b-purple));
}

.student-page .lesson-launcher-hero {
    padding: 0;
    overflow: hidden;
}

.student-page .lesson-launcher-hero .student-hero-top {
    padding: 1.75rem 1.75rem 0;
}

.student-page .lesson-launcher-hero .lesson-launcher-card {
    margin: var(--space-4) 1.75rem 1.75rem;
    border-radius: 16px;
    border: 1.5px solid var(--color-border);
    background: var(--color-secondary);
    box-shadow: none;
}

.student-page .auth-kicker {
    background: rgba(174, 0, 255, 0.08);
    border-color: rgba(174, 0, 255, 0.15);
    color: var(--3b-purple);
}

.student-page .hero-card-label {
    background: rgba(0, 31, 255, 0.06);
    border-color: rgba(0, 31, 255, 0.1);
    color: var(--3b-blue);
}

.student-page .section-header h1 {
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
    color: var(--color-text-primary);
}

.student-page .settings-summary-card {
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: #fff;
}

.student-page .settings-summary-card:nth-child(4n+1) {
    border-top: 3px solid var(--3b-blue);
}
.student-page .settings-summary-card:nth-child(4n+2) {
    border-top: 3px solid var(--3b-green);
}
.student-page .settings-summary-card:nth-child(4n+3) {
    border-top: 3px solid var(--3b-purple);
}
.student-page .settings-summary-card:nth-child(4n+4) {
    border-top: 3px solid var(--color-primary);
}

.student-page .student-services-refresh {
    border-top: none;
    overflow: hidden;
    padding: 0;
    background: #fff;
}

.student-page .student-services-refresh > .panel-header {
    padding: 1.75rem 1.75rem 0;
}

.student-page .student-services-refresh > .student-tools-grid {
    padding: 0 1.75rem 1.75rem;
}

.student-page .student-tool-card-refresh {
    border-top: none;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 1.25rem;
}

.student-page .student-tool-card-refresh:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.student-page .student-tool-card-refresh {
    border-top: 3px solid var(--3b-blue);
}

.student-page .student-tool-card-refresh .table-meta:first-child {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.student-page .student-tool-card-refresh .table-meta:first-child {
    color: var(--3b-blue);
}

.student-page .student-tool-prompts span {
    background: rgba(0, 31, 255, 0.05);
    border: 1px solid rgba(0, 31, 255, 0.1);
    color: var(--3b-blue);
    font-size: 0.78rem;
    font-weight: 500;
}

.student-page .status-badge.active {
    background: rgba(0, 255, 54, 0.12);
    color: #059a1e;
    border: 1px solid rgba(0, 255, 54, 0.18);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.student-page .status-badge.inactive {
    background: rgba(174, 0, 255, 0.08);
    color: var(--3b-purple);
    border: 1px solid rgba(174, 0, 255, 0.12);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.student-page .btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: none;
    box-shadow: none;
}

.student-page .btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.student-page .btn-secondary {
    border-color: var(--color-border);
    box-shadow: none;
}

.student-page .btn-secondary:hover {
    background: rgba(13, 148, 136, 0.06);
    border-color: var(--color-primary);
}

.student-page .pro-features-disclosure {
    overflow: hidden;
    padding: 0;
}

.student-page .pro-features-summary {
    padding: 1.5rem 1.75rem;
}

.student-page .pro-features-content {
    padding: 0 1.75rem 1.75rem;
}

.student-page .settings-panel {
    border-radius: 20px;
}

.student-page .settings-identity-item {
    border-radius: 12px;
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
}

.student-page .form-control {
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
}

.student-page .form-control:focus {
    border-color: var(--3b-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 255, 0.08);
}

/* Chat page — 3andB palette */

.chat-page .chat-header-card-refresh {
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
    align-items: center;
    border-radius: 20px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.chat-accent-bar {
    grid-column: 1 / -1;
    height: 4px;
    background: #001fff;
}

.chat-page .chat-header-card-refresh .chat-header-main {
    grid-column: 1;
    width: 100%;
    padding: 1rem 1.25rem;
}

.chat-page .chat-header-card-refresh .chat-header-actions {
    grid-column: 2;
    width: 100%;
    padding: 0 1.25rem 1rem;
    justify-content: flex-end;
    justify-self: end;
}

.chat-page .chat-status {
    background: rgba(0, 255, 54, 0.1);
    color: #059a1e;
    border: 1px solid rgba(0, 255, 54, 0.15);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-page .chat-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #059a1e;
    flex-shrink: 0;
}

.chat-page .chat-status.is-pending {
    background: rgba(174, 0, 255, 0.08);
    color: var(--3b-purple);
    border-color: rgba(174, 0, 255, 0.15);
}

.chat-page .chat-status.is-pending::before {
    background: var(--3b-purple);
    animation: statusPulse 1.2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.chat-page .chat-panel-refresh {
    border-top: none;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.chat-page .chat-side-card {
    border-radius: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.chat-page .chat-work-card {
    border-top: 3px solid var(--3b-green);
}

.chat-page .chat-context-card {
    border-top: 3px solid var(--3b-purple);
}

.chat-page .chat-thread {
    background: var(--color-secondary);
    border-radius: 16px;
    border: 1px solid var(--color-border);
}

.chat-page .chat-bubble.is-user {
    background: #001fff;
    color: #fff;
    border: none;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 31, 255, 0.15);
}

.chat-page .chat-bubble.is-assistant {
    background: #fff;
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 6px;
}

.chat-page .chat-bubble.is-streaming {
    border-color: rgba(174, 0, 255, 0.25);
    background: linear-gradient(180deg, rgba(174, 0, 255, 0.04) 0%, #fff 100%);
}

.chat-page .chat-composer-refresh {
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: none;
}

.chat-page .chat-message-input:focus {
    border-color: var(--3b-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 255, 0.08);
}

.chat-page .empty-state-chat {
    background: #fff;
    border: 1px dashed rgba(0, 31, 255, 0.18);
    border-radius: 16px;
}

.chat-page .btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: none;
    box-shadow: none;
}

.chat-page .btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.chat-page .chat-header-back-button {
    border-color: var(--color-border);
    box-shadow: none;
}

/* Tools workspace — 3andB palette */

.chat-page .tool-header-card {
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    padding: 0;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.chat-page .tool-header-inner {
    padding: var(--space-6);
    display: flex;
    justify-content: space-between;
    gap: var(--space-5);
    align-items: flex-end;
    flex-wrap: wrap;
}

.chat-page .tool-chip.is-active {
    border-color: rgba(0, 31, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 31, 255, 0.1);
    background: rgba(0, 31, 255, 0.04);
}

.chat-page .tool-chip:hover {
    border-color: rgba(0, 31, 255, 0.3);
}


@media (max-width: 768px) {
    .student-page .student-hero-top {
        flex-direction: column;
    }
    .student-page .student-dashboard-actions {
        justify-content: flex-start;
    }
    .student-page .lesson-launcher-hero .student-hero-top {
        padding: 1.25rem 1.25rem 0;
    }
    .student-page .lesson-launcher-hero .lesson-launcher-card {
        margin: var(--space-3) 1.25rem 1.25rem;
    }
    .student-page .student-services-refresh > .panel-header,
    .student-page .student-services-refresh > .student-tools-grid {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .student-page .pro-features-summary {
        padding: 1.25rem;
    }
    .student-page .pro-features-content {
        padding: 0 1.25rem 1.25rem;
    }
}
