:root {
    --primary: #03224d;
    --primary-panel: #102f5f;
    --secondary: #2d5ea2;
    --secondary-soft: #d6e3ff;
    --secondary-strong: #88b4fe;
    --accent: #2d5ea2;
    --on-accent: #ffffff;
    --bg: #f7f9fb;
    --sidebar-bg: #03224d;
    --chat-bg: #f7f9fb;
    --card: #ffffff;
    --composer-bg: #ffffff;
    --hover-bg: #e9eff8;
    --border: #c4c6d0;
    --surface: #f7f9fb;
    --surface-lowest: #ffffff;
    --surface-low: #f2f4f6;
    --surface-high: #e6e8ea;
    --surface-soft: #eef3fb;
    --text: #191c1e;
    --muted: #44474f;
    --outline: #c4c6d0;
    --sidebar-text: #ffffff;
    --sidebar-muted: rgba(255, 255, 255, 0.72);
    --tooltip-bg: rgba(25, 28, 30, 0.94);
    --tooltip-text: #ffffff;
    --shadow: 0 16px 48px rgba(3, 34, 77, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Satoshi, Arial, Helvetica, sans-serif;
}

button,
textarea,
input {
    font: inherit;
}

.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    opacity: 0;
}

.material-icons-ready .material-symbols-outlined {
    opacity: 1;
}

.app-shell {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns 240ms ease;
}

.sidebar-collapsed .app-shell {
    grid-template-columns: 80px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
    padding: 28px 20px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow: visible;
    border-right: 1px solid rgba(45, 94, 162, 0.18);
    transition: transform 240ms ease, padding 240ms ease;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 8px;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-brand-name {
    min-width: 0;
    color: var(--sidebar-text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mobile-brand-button {
    display: inline-flex;
    align-items: center;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.sidebar-toggle {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: 0;
}

.brand-logo,
.mobile-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.brand-stack {
    display: grid;
    gap: 2px;
    line-height: 1.2;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.sidebar-toggle-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
}

.sidebar-toggle-logo,
.sidebar-toggle-icon {
    position: absolute;
    transition: opacity 160ms ease, transform 160ms ease;
}

.sidebar-toggle-icon {
    opacity: 1;
    transform: scale(1);
}

.sidebar-toggle-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    z-index: 20;
    width: max-content;
    max-width: 160px;
    border-radius: 8px;
    padding: 7px 9px;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity 160ms ease, transform 160ms ease;
}

.sidebar-toggle:hover .sidebar-toggle-tooltip,
.sidebar-toggle:focus-visible .sidebar-toggle-tooltip {
    opacity: 0;
    transform: translate(-4px, -50%);
}

.brand-title,
.brand-subtitle,
.brand-stack,
.nav-item span:last-child,
.profile-info,
.profile-caret {
    min-width: 0;
    overflow: hidden;
    transition: max-width 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.brand-title {
    flex: 1;
    max-width: 170px;
    white-space: nowrap;
}

.nav-item span:last-child {
    max-width: 180px;
    white-space: nowrap;
}

.brand-stack,
.profile-info {
    max-width: 170px;
}

.sidebar-collapsed .brand-title,
.sidebar-collapsed .brand-subtitle,
.sidebar-collapsed .brand-stack,
.sidebar-collapsed .sidebar-brand-name,
.sidebar-collapsed .nav-item span:last-child,
.sidebar-collapsed .profile-info,
.sidebar-collapsed .profile-caret {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
}

.sidebar-collapsed .sidebar {
    padding-right: 12px;
    padding-left: 12px;
}

.sidebar-collapsed .brand-row,
.sidebar-collapsed .nav-item,
.sidebar-collapsed .profile-card {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

.sidebar-collapsed .brand-row {
    gap: 0;
}

.sidebar-collapsed .brand-logo {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.sidebar-collapsed .sidebar-toggle {
    margin: 0;
}

.sidebar-collapsed .sidebar-toggle-logo {
    opacity: 1;
    transform: scale(1);
}

.sidebar-collapsed .sidebar-toggle-icon {
    opacity: 0;
    transform: scale(0.86);
}

.sidebar-collapsed .sidebar-toggle:hover .sidebar-toggle-logo,
.sidebar-collapsed .sidebar-toggle:focus-visible .sidebar-toggle-logo {
    opacity: 0;
    transform: scale(0.86);
}

.sidebar-collapsed .sidebar-toggle:hover .sidebar-toggle-icon,
.sidebar-collapsed .sidebar-toggle:focus-visible .sidebar-toggle-icon {
    opacity: 1;
    transform: scale(1);
}

.sidebar-collapsed .sidebar-toggle:hover .sidebar-toggle-tooltip,
.sidebar-collapsed .sidebar-toggle:focus-visible .sidebar-toggle-tooltip {
    opacity: 1;
    transform: translate(0, -50%);
}

.sidebar-collapsed .nav-item {
    gap: 0;
    min-height: 48px;
    width: 48px;
    border-radius: 14px;
}

.sidebar-collapsed .nav-stack {
    align-items: center;
}

.sidebar-collapsed .docs-dropdown {
    display: none;
}

.sidebar-collapsed .profile-card {
    width: 48px;
    height: 48px;
    padding: 0;
    gap: 0;
    margin-right: auto;
    margin-left: auto;
}

.nav-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.sidebar-collapsed .nav-item::after,
.sidebar-collapsed .profile-card::after {
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    z-index: 20;
    width: max-content;
    max-width: 180px;
    border-radius: 8px;
    padding: 7px 9px;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    content: attr(data-tooltip);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    text-overflow: ellipsis;
    transform: translate(-4px, -50%);
    transition: opacity 160ms ease, transform 160ms ease;
    white-space: nowrap;
}

.sidebar-collapsed .nav-item:hover::after,
.sidebar-collapsed .nav-item:focus-visible::after,
.sidebar-collapsed .profile-card:hover::after,
.sidebar-collapsed .profile-card:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
}

.nav-item .material-symbols-outlined {
    flex: 0 0 auto;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(45, 94, 162, 0.16);
    color: var(--accent);
}

.docs-dropdown {
    display: grid;
    gap: 4px;
    max-height: 240px;
    overflow: hidden;
    padding: 6px 0 6px 14px;
    color: var(--sidebar-text);
    transition: max-height 220ms ease, opacity 180ms ease, padding 220ms ease;
    opacity: 1;
}

.docs-dropdown.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.docs-item,
.docs-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--sidebar-muted);
    font-size: 13px;
    line-height: 1.2;
}

.docs-item {
    cursor: default;
}

.docs-item:hover {
    background: rgba(136, 180, 254, 0.18);
}

.docs-item .material-symbols-outlined {
    flex: 0 0 auto;
    font-size: 19px;
}

.docs-item span:last-child,
.docs-empty {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-area {
    position: relative;
    margin-top: auto;
}

.profile-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.profile-card:hover,
.profile-card:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.profile-info p {
    margin: 0 0 2px;
    font-weight: 700;
}

.profile-info small {
    color: var(--sidebar-muted);
    font-size: 13px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(45, 94, 162, 0.16);
    color: var(--accent);
    overflow: hidden;
    flex: 0 0 auto;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-header {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 11;
    background: rgba(0, 0, 0, 0.42);
    opacity: 1;
    transition: opacity 200ms ease;
}

.sidebar-overlay[hidden] {
    display: none;
}

.chat-page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    background: var(--chat-bg);
}

.chat-container {
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 56px 32px 184px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 999px;
}

.welcome-panel {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 28px;
    overflow: hidden;
    text-align: center;
    padding: 0 16px;
    row-gap: 18px;
    opacity: 1;
    visibility: visible;
    transition: opacity 300ms ease-in-out, max-height 300ms ease-in-out, margin 300ms ease-in-out, visibility 0s linear 0s;
}

.welcome-logo {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 24px;
    background: var(--surface-lowest);
    border: 1px solid var(--outline);
}

.welcome-panel h1 {
    margin: 0;
    color: var(--text);
    font-size: 42px;
    font-weight: 800;
}

.welcome-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    max-width: 640px;
}

.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 16px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.ai,
.message-row.system {
    justify-content: flex-start;
}

.message-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    align-self: flex-end;
    margin: 0 6px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-width 160ms ease, margin 160ms ease, opacity 160ms ease;
}

.message-row.user .message-actions { order: -1; }

.message-row:hover .message-actions,
.message-row:focus-within .message-actions {
    max-width: 76px;
    opacity: 1;
    pointer-events: auto;
}

.message-action {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.message-action:hover,
.message-action:focus-visible {
    background: var(--surface-high);
    color: var(--text);
    outline: 0;
}

.message-action .material-symbols-outlined { font-size: 18px; }
.message-action.copied { color: #16803c; }
.clipboard-fallback { position: fixed; left: -9999px; top: 0; }

.message-bubble {
    max-width: min(86%, 760px);
    border-radius: 26px;
    padding: 18px 20px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.message-row.user .message-bubble {
    background: var(--accent);
    color: var(--on-accent);
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 26px;
}

.message-row.ai .message-bubble {
    background: var(--surface-lowest);
    color: var(--text);
    border: 1px solid var(--outline);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 26px;
}

.message-row.system .message-bubble {
    background: var(--surface-low);
    color: var(--muted);
    font-style: italic;
}

.sources {
    width: fit-content;
    max-width: min(86%, 760px);
    margin: 4px 0 16px 4px;
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
}

.sources a {
    color: var(--accent);
    text-decoration: none;
}

.thinking {
    position: fixed;
    left: 328px;
    bottom: 108px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary);
    transition: left 240ms ease;
}

.sidebar-collapsed .thinking {
    left: 120px;
}

.thinking[hidden] {
    display: none;
}

.thinking span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1s infinite ease-in-out;
}

.thinking span:nth-child(2) {
    animation-delay: 120ms;
}

.thinking span:nth-child(3) {
    animation-delay: 240ms;
}

@keyframes pulse {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.composer-dock {
    position: fixed;
    z-index: 8;
    top: 50%;
    right: 24px;
    left: 312px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    max-width: 900px;
    margin: 0 auto;
    transform: translateY(-50%);
    transition: top 300ms ease-in-out, left 240ms ease, transform 300ms ease-in-out;
}

.sidebar-collapsed .composer-dock {
    left: 104px;
}

.chat-page.chat-started .composer-dock {
    top: calc(100vh - 40px);
    transform: translateY(-100%);
}

.chat-page.chat-started .welcome-panel,
.chat-page.chat-started .suggested-questions {
    max-height: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 300ms ease-in-out, max-height 300ms ease-in-out, margin 300ms ease-in-out, visibility 0s linear 300ms;
}

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--composer-bg);
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.composer:hover,
.composer:focus-within {
    border-color: rgba(45, 94, 162, 0.45);
}

.composer:focus-within {
    border-color: rgba(45, 94, 162, 0.75);
}

.suggested-questions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 22px;
    opacity: 1;
    visibility: visible;
    transition: opacity 300ms ease-in-out, max-height 300ms ease-in-out, margin 300ms ease-in-out, visibility 0s linear 0s;
}

.suggestion-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--outline);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--surface-lowest);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    transition: background-color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.suggestion-pill:hover {
    background: var(--surface-high);
    transform: translateY(-1px);
}

.suggestion-pill .material-symbols-outlined {
    color: var(--accent);
    font-size: 20px;
}

.profile-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    right: 0;
    min-width: 220px;
    border-radius: 18px;
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    padding: 8px 0;
    z-index: 40;
}

.profile-menu form { margin: 0; }

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    appearance: none;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 180ms ease, color 180ms ease;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: 0;
}

.chat-page .composer {
    border-color: var(--border);
}

.icon-button,
.send-button {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.icon-button:hover,
.icon-button:focus-visible,
.send-button:hover,
.send-button:focus-visible {
    background: var(--primary-panel);
    outline: 0;
}

.composer textarea {
    width: 100%;
    min-height: 48px;
    max-height: 180px;
    border: 0;
    outline: 0;
    resize: none;
    padding: 14px 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

.file-input {
    display: none;
}

.status-line {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 312px;
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.8);
    color: var(--muted);
    font-size: 13px;
    transition: left 240ms ease;
}

.sidebar-collapsed .status-line {
    left: 80px;
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #d6e3ff 0%, #f7f9fb 100%);
}

.login-card {
    width: min(100%, 420px);
    padding: 40px;
    border: 1px solid rgba(196, 198, 208, 0.5);
    border-radius: 24px;
    background: var(--surface-lowest);
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-logo-mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #03224d;
}

.login-logo-dark {
    display: none;
}

.login-brand h1 {
    margin: 14px 0 4px;
    color: var(--primary);
}

.login-brand p,
.login-footnote {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 0;
}

.oauth-actions {
    margin-top: 28px;
}

.google-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--outline);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--surface-lowest);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.google-login-button:hover,
.google-login-button:focus-visible {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(45, 94, 162, 0.14);
    outline: 0;
}

.google-mark {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    color: #1a73e8;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 700;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--outline);
}

.login-form label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.field-wrap {
    position: relative;
}

.field-wrap > span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.field-wrap input {
    width: 100%;
    border: 1px solid var(--outline);
    border-radius: 12px;
    padding: 13px 14px 13px 46px;
    background: var(--surface-low);
    color: var(--text);
    outline: 0;
}

.field-wrap input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(45, 94, 162, 0.14);
}

.password-field input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    display: grid;
    place-items: center;
    right: 8px;
    top: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    outline: 0;
}

.password-toggle .material-symbols-outlined {
    font-size: 21px;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    padding: 14px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

.login-error {
    margin: 0 0 8px;
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffdad6;
    color: #93000a;
    font-size: 13px;
}

.login-footnote {
    margin: 24px 0 0;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
        height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 12;
        width: min(86vw, 288px);
        min-height: 100vh;
        transform: translateX(-100%);
        box-shadow: 18px 0 44px rgba(0, 0, 0, 0.24);
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-collapsed .app-shell {
        grid-template-columns: none;
    }

    .sidebar-collapsed .brand-title,
    .sidebar-collapsed .brand-subtitle,
    .sidebar-collapsed .brand-stack,
    .sidebar-collapsed .nav-item span:last-child,
    .sidebar-collapsed .profile-info,
    .sidebar-collapsed .profile-caret {
        max-width: 180px;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .sidebar-collapsed .brand-logo {
        opacity: 1;
        pointer-events: auto;
        position: static;
    }

    .sidebar-collapsed .brand-row,
    .sidebar-collapsed .nav-item,
    .sidebar-collapsed .profile-card {
        justify-content: flex-start;
        padding-right: 16px;
        padding-left: 16px;
    }

    .sidebar-collapsed .brand-row {
        padding-right: 8px;
        padding-left: 8px;
    }

    .sidebar-collapsed .nav-item {
        gap: 14px;
        width: 100%;
        border-radius: 999px;
    }

    .sidebar-collapsed .nav-stack {
        align-items: stretch;
    }

    .sidebar-collapsed .sidebar-toggle {
        margin-left: auto;
    }

    .sidebar-collapsed .sidebar-toggle-logo {
        opacity: 0;
    }

    .sidebar-collapsed .sidebar-toggle-icon {
        opacity: 1;
        transform: scale(1);
    }

    .sidebar-collapsed .sidebar-toggle:hover .sidebar-toggle-logo,
    .sidebar-collapsed .sidebar-toggle:focus-visible .sidebar-toggle-logo {
        opacity: 0;
    }

    .sidebar-collapsed .docs-dropdown {
        display: grid;
    }

    .sidebar-collapsed .profile-card {
        width: 100%;
        height: auto;
        padding: 14px 16px;
        gap: 12px;
    }

    .sidebar-collapsed .nav-item::after,
    .sidebar-collapsed .profile-card::after {
        display: none;
    }

    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 64px;
        padding: 0 16px;
        border-bottom: 1px solid var(--outline);
        background: rgba(247, 249, 251, 0.94);
        backdrop-filter: blur(10px);
    }

    .mobile-brand-button {
        gap: 10px;
        padding: 6px 0;
    }

    .mobile-brand-button strong {
        color: var(--text);
        font-size: 17px;
    }

    .chat-container {
        padding: 96px 16px 168px;
    }

    .composer-dock {
        right: 12px;
        left: 12px;
    }

    .sidebar-collapsed .composer-dock {
        left: 12px;
    }

    .chat-page.chat-started .composer-dock {
        top: calc(100vh - 40px);
    }

    .welcome-panel h1 {
        font-size: 34px;
    }

    .suggested-questions {
        align-items: stretch;
        flex-direction: column;
    }

    .suggestion-pill {
        justify-content: flex-start;
        width: 100%;
    }

    .thinking {
        left: 18px;
    }

    .sidebar-collapsed .thinking {
        left: 18px;
    }

    .status-line {
        left: 0;
        gap: 14px;
        font-size: 10px;
    }

    .sidebar-collapsed .status-line {
        left: 0;
    }

    .message-bubble,
    .sources {
        max-width: 92%;
    }
}

/* Minimal chat layout - final cascade overrides */
.composer-dock { max-width: 760px; }
.welcome-panel { margin-bottom: 18px; }
.welcome-panel h1 { max-width: none; margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.composer { min-height: 52px; padding: 6px 8px 6px 12px; }
.composer textarea { min-height: 38px; max-height: 160px; padding: 8px 4px; line-height: 1.4; }
.chat-divider { width: 100%; height: 1px; margin: 22px 0; background: var(--border); }
.message-row { margin-bottom: 12px; }
.message-bubble { line-height: 1.65; }

@media (max-width: 900px) {
    .composer-dock,
    .sidebar-collapsed .composer-dock,
    .chat-page.chat-started .composer-dock {
        top: auto;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
        transform: none;
    }
    .welcome-panel { margin-bottom: 14px; }
    .welcome-panel h1 { font-size: 25px; }
    .composer { min-height: 48px; padding: 4px 6px 4px 10px; }
    .composer textarea { min-height: 36px; max-height: 112px; padding: 7px 3px; font-size: 15px; }
    .voice-input-button { width: 34px; height: 34px; }
    .send-button { width: 36px; height: 36px; }
    .chat-container { padding-bottom: 108px; }
    .chat-divider { margin: 17px 0; }
    .message-bubble { max-width: 90%; padding: 12px 14px; line-height: 1.55; }
}

/* Final minimal chat composition */
.composer-dock { max-width: 760px; }
.welcome-panel { margin-bottom: 18px; }
.welcome-panel h1 {
    max-width: none;
    margin: 0;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.025em;
}
.composer {
    min-height: 52px;
    padding: 6px 8px 6px 12px;
}
.composer textarea {
    min-height: 38px;
    max-height: 160px;
    padding: 8px 4px;
    line-height: 1.4;
}
.chat-divider {
    width: 100%;
    height: 1px;
    margin: 22px 0;
    background: var(--border);
}
.message-row { margin-bottom: 12px; }
.message-bubble { line-height: 1.65; }

@media (max-width: 900px) {
    .composer-dock,
    .sidebar-collapsed .composer-dock,
    .chat-page.chat-started .composer-dock {
        top: auto;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
        transform: none;
    }
    .welcome-panel { margin-bottom: 14px; }
    .welcome-panel h1 { font-size: 25px; }
    .composer { min-height: 48px; padding: 4px 6px 4px 10px; }
    .composer textarea { min-height: 36px; max-height: 112px; padding: 7px 3px; font-size: 15px; }
    .voice-input-button { width: 34px; height: 34px; }
    .send-button { width: 36px; height: 36px; }
    .chat-container { padding-bottom: 108px; }
    .chat-divider { margin: 17px 0; }
    .message-bubble { max-width: 90%; padding: 12px 14px; line-height: 1.55; }
}

/* School workspace refinement */
.conversation-section { min-height: 0; display: flex; flex: 1; flex-direction: column; margin-top: 10px; overflow: hidden; }
.sidebar-section-label { margin: 8px 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.conversation-list { overflow-y: auto; padding: 0 4px; }
.conversation-empty { margin: 6px 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.conversation-empty[hidden] { display: none; }
.conversation-item { display: flex; align-items: center; border-radius: 8px; }
.conversation-item:hover, .conversation-item.active { background: var(--hover-bg, #eef3f1); }
.conversation-select { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.conversation-select .material-symbols-outlined { flex: none; color: var(--muted); font-size: 18px; }
.conversation-select span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation-delete { width: 30px; height: 30px; margin-right: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; }
.conversation-item:hover .conversation-delete, .conversation-item:focus-within .conversation-delete { opacity: 1; }
.conversation-delete:hover { background: #fee2e2; color: #b42318; }
.conversation-delete .material-symbols-outlined { font-size: 17px; }
.sidebar-divider { height: 1px; margin: 10px 8px; background: var(--border); }
.new-chat-action { border: 1px solid var(--border) !important; background: transparent !important; }
.new-chat-action:hover { border-color: var(--primary) !important; }
.student-context-bar { position: absolute; z-index: 3; top: 0; left: 0; right: 0; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
.student-context-bar > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.student-context-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.context-kicker, .welcome-eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.knowledge-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.knowledge-status i { width: 7px; height: 7px; border-radius: 50%; background: #27ae60; box-shadow: 0 0 0 4px rgb(39 174 96 / 12%); }
.chat-container { padding-top: 92px; }
.welcome-panel { gap: 12px; }
.welcome-panel h1 { max-width: 700px; margin: 0; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.04em; }
.welcome-panel p { max-width: 620px; }
.welcome-logo { width: 54px; height: 54px; margin-bottom: 4px; }
.welcome-logo img { width: 54px; height: 54px; }
.suggestion-pill { border-radius: 8px; box-shadow: none; }
.status-line { justify-content: center; font-size: 11px; }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); box-shadow: 0 24px 70px rgb(0 0 0 / 22%); }
.confirm-dialog::backdrop { background: rgb(15 23 42 / 48%); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 28px; }
.dialog-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #fee2e2; color: #b42318; }
.confirm-dialog h2 { margin: 18px 0 8px; font-size: 20px; }
.confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-actions button { padding: 10px 14px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.dialog-cancel { border: 1px solid var(--border); background: transparent; color: inherit; }
.dialog-delete { border: 1px solid #b42318; background: #b42318; color: white; }
.sidebar-collapsed .conversation-section, .sidebar-collapsed .sidebar-divider { display: none; }
@media (max-width: 760px) {
  .student-context-bar { display: none; }
  .chat-container { padding-top: 26px; }
  .conversation-delete { opacity: 1; }
}

/* Minimal assistant shell — inspired by the supplied interaction reference */
:root {
    --sidebar-bg: #f9f9f9;
    --sidebar-text: #171717;
    --sidebar-muted: #6b6b6b;
    --chat-bg: #ffffff;
    --bg: #ffffff;
    --composer-bg: #f4f4f4;
    --hover-bg: #ececec;
    --border: #dedede;
    --outline: #dedede;
    --surface-lowest: #ffffff;
    --surface-low: #f4f4f4;
    --surface-high: #e9e9e9;
    --text: #171717;
    --muted: #6b6b6b;
}

.app-shell { grid-template-columns: 260px minmax(0, 1fr); }
.sidebar-collapsed .app-shell { grid-template-columns: 68px minmax(0, 1fr); }
.sidebar {
    gap: 16px;
    padding: 12px 10px 10px;
    border-right: 0;
}
.brand-row { min-height: 38px; gap: 10px; padding: 0 4px; }
.brand-logo { width: 30px !important; height: 30px !important; }
.brand-title { color: var(--sidebar-text); font-size: 15px; font-weight: 700; }
.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--sidebar-muted);
}
.sidebar-toggle:hover,
.sidebar-toggle:focus-visible { background: var(--hover-bg); color: var(--sidebar-text); }
.sidebar-toggle-icon { position: static; font-size: 22px; opacity: 1; transform: none; }
.sidebar-toggle-tooltip { display: none; }
.nav-stack { min-height: 0; flex: 1; gap: 2px; }
.nav-item {
    min-height: 38px;
    gap: 11px;
    border-radius: 8px;
    padding: 8px 9px;
    color: var(--sidebar-text);
    font-size: 14px;
}
.nav-item .material-symbols-outlined { font-size: 20px; }
.new-chat-action { border: 0 !important; }
.sidebar-section-label { margin: 20px 8px 6px; color: var(--sidebar-text); font-size: 12px; letter-spacing: 0; text-transform: none; }
.conversation-list { padding: 0; }
.conversation-group-label {
    margin: 18px 8px 5px;
    color: var(--sidebar-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.conversation-group-label:first-child { margin-top: 6px; }
.conversation-item { min-height: 36px; border-radius: 8px; }
.conversation-item:hover,
.conversation-item.active { background: var(--hover-bg); }
.conversation-select { gap: 9px; padding: 8px; }
.conversation-select .material-symbols-outlined { display: none; }
.conversation-select span:last-child { color: var(--sidebar-text); font-size: 13px; }
.conversation-delete { color: var(--sidebar-muted); }
.sidebar-divider { margin: 8px 6px; background: var(--border); }
.docs-dropdown { padding-left: 8px; color: var(--sidebar-text); }
.docs-item,
.docs-empty { color: var(--sidebar-muted); }
.profile-card {
    gap: 10px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sidebar-text);
}
.profile-card:hover,
.profile-card:focus-visible { background: var(--hover-bg); transform: none; }
.profile-info p { font-size: 13px; }
.profile-info small { color: var(--sidebar-muted); font-size: 11px; }
.avatar { width: 32px; height: 32px; background: #e7e7e7; color: #333; }

.student-context-bar {
    min-height: 52px;
    padding: 0 20px;
    border-bottom: 0;
    background: color-mix(in srgb, var(--chat-bg) 88%, transparent);
}
.context-kicker, .knowledge-status { display: none; }
.student-context-bar strong { font-size: 15px; }
.chat-container { max-width: 780px; padding: 72px 24px 170px; }
.composer-dock {
    right: 24px;
    left: 284px;
    max-width: 768px;
}
.sidebar-collapsed .composer-dock { left: 92px; }
.welcome-panel { margin-bottom: 28px; padding: 0; }
.welcome-panel h1 {
    font-size: clamp(23px, 3vw, 30px);
    font-weight: 500;
    letter-spacing: -.025em;
}
.composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 56px;
    padding: 7px 8px 7px 12px;
    border: 0;
    border-radius: 28px;
    background: var(--composer-bg);
    box-shadow: none;
}
.composer:hover,
.composer:focus-within { border: 0; box-shadow: 0 0 0 1px var(--border); }
.composer textarea {
    min-height: 42px;
    padding: 10px 4px;
    font-size: 16px;
}
.composer textarea::placeholder { color: #777; }
.voice-input-button {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.voice-input-button:hover { background: var(--surface-high); color: var(--text); }
.voice-input-button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}
.voice-input-button .material-symbols-outlined { font-size: 21px; }
.voice-input-button.listening {
    background: #c62828;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.30);
    animation: voice-pulse 1.45s ease-in-out infinite;
}
@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.38); }
    50% { box-shadow: 0 0 0 10px rgba(198, 40, 40, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .voice-input-button.listening { animation: none; }
}
.send-button {
    width: 40px;
    height: 40px;
    background: var(--text);
    color: var(--bg);
}
.send-button .material-symbols-outlined { font-size: 21px; font-weight: 600; }
.send-button:hover,
.send-button:focus-visible { background: #333; }
.suggested-questions { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.suggestion-pill {
    width: auto;
    gap: 6px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}
.suggestion-pill:hover { background: var(--surface-low); transform: none; color: var(--text); }
.suggestion-pill .material-symbols-outlined { font-size: 16px; color: inherit; }
.message-bubble { box-shadow: none; }
.message-row.user .message-bubble {
    background: var(--surface-low);
    color: var(--text);
    border-radius: 18px;
}
.message-row.ai .message-bubble {
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
    border: 0;
    background: transparent;
}
.status-line {
    left: 260px;
    padding: 6px 12px;
    border: 0;
    background: var(--chat-bg);
    font-size: 10px;
}
.sidebar-collapsed .status-line { left: 68px; }
.thinking { left: calc(260px + 32px); color: var(--muted); }
.sidebar-collapsed .thinking { left: 100px; }
.sidebar-collapsed .sidebar { padding-right: 10px; padding-left: 10px; }
.sidebar-collapsed .brand-logo { opacity: 0; pointer-events: none; position: absolute; }
.sidebar-collapsed .sidebar-toggle-icon { opacity: 1; transform: none; }
.sidebar-collapsed .nav-item,
.sidebar-collapsed .profile-card { width: 44px; min-height: 44px; border-radius: 8px; }

@media (max-width: 760px) {
    .sidebar { width: min(88vw, 260px); }
    .composer-dock { right: 12px; left: 12px; }
    .welcome-panel h1 { font-size: 24px; }
    .suggested-questions { display: none; }
    .status-line { left: 0; }
}

/* Conversation actions and manual rename */
.conversation-actions { position: relative; flex: 0 0 auto; }
.conversation-menu-button {
    display: grid;
    width: 30px;
    height: 30px;
    margin-right: 3px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--sidebar-muted);
    opacity: 0;
    cursor: pointer;
}
.conversation-item:hover .conversation-menu-button,
.conversation-item:focus-within .conversation-menu-button,
.conversation-menu-button[aria-expanded="true"] { opacity: 1; }
.conversation-menu-button:hover { background: color-mix(in srgb, var(--hover-bg) 70%, var(--border)); color: var(--sidebar-text); }
.conversation-menu-button .material-symbols-outlined { font-size: 19px; }
.conversation-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 4px;
    width: 150px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-lowest);
    box-shadow: 0 12px 32px rgb(0 0 0 / 16%);
}
.conversation-menu[hidden] { display: none; }
.conversation-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.conversation-menu button:hover { background: var(--surface-low); }
.conversation-menu button.danger { color: #c9362b; }
.conversation-menu .material-symbols-outlined { font-size: 18px; }
.rename-icon { background: var(--surface-low); color: var(--text); }
.rename-field { display: grid; gap: 7px; margin-top: 20px; }
.rename-field span { color: var(--muted); font-size: 12px; font-weight: 600; }
.rename-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: 0;
    background: var(--surface-lowest);
    color: var(--text);
    font: inherit;
}
.rename-field input:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.dialog-save { border: 1px solid var(--text); background: var(--text); color: var(--bg); }
@media (max-width: 760px) {
    .conversation-menu-button { opacity: 1; }
}

/* Shared institutional light palette and viewport-edge chat scrolling */
:root {
    --primary: #0a376f;
    --primary-panel: #082b59;
    --secondary: #2f6fb9;
    --secondary-soft: #dce9f8;
    --accent: #2f6fb9;
    --on-accent: #ffffff;
    --sidebar-bg: #062b5c;
    --sidebar-text: #ffffff;
    --sidebar-muted: rgba(255, 255, 255, 0.72);
    --chat-bg: #f5f7fa;
    --bg: #f5f7fa;
    --composer-bg: #ffffff;
    --hover-bg: #e5ebf3;
    --border: #d9e1eb;
    --outline: #d9e1eb;
    --surface-lowest: #ffffff;
    --surface-low: #e7eaee;
    --surface-high: #dce3eb;
    --surface-soft: #eaf1f9;
    --text: #101c2c;
    --muted: #5f6e82;
}

.sidebar { box-shadow: 1px 0 0 rgba(2, 25, 58, 0.08); }
.sidebar .brand-title,
.sidebar .sidebar-section-label,
.sidebar .conversation-group-label,
.sidebar .conversation-select span:last-child,
.sidebar .profile-info p { color: var(--sidebar-text); }
.sidebar .sidebar-toggle,
.sidebar .conversation-menu-button,
.sidebar .profile-info small { color: var(--sidebar-muted); }
.sidebar .sidebar-toggle:hover,
.sidebar .sidebar-toggle:focus-visible,
.sidebar .profile-card:hover,
.sidebar .profile-card:focus-visible,
.sidebar .conversation-item:hover,
.sidebar .conversation-item.active { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.sidebar .avatar { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.sidebar .sidebar-divider { background: rgba(255, 255, 255, 0.18); }
.sidebar .conversation-menu {
    border-color: #d9e1eb;
    background: #ffffff;
}
.sidebar .conversation-menu button { color: #101c2c; }
.sidebar .conversation-menu button:hover { background: #edf2f7; }
.sidebar .conversation-menu button.danger { color: #b42318; }

/* Final brand sizing: the supplied placeholder mark remains recognizable at navigation scale. */
.brand-logo { width: 48px !important; height: 48px !important; object-fit: contain; }
.mobile-logo { width: 42px; height: 42px; object-fit: contain; }
.brand-row { min-height: 52px; }
.login-logo-mark { width: 78px; height: 78px; }
.login-logo-mark img { width: 72px; height: 72px; object-fit: contain; }

/* Tablet/mobile student shell: title bar + off-canvas navigation. */
@media (max-width: 900px) {
    body.app-shell { display: block; height: 100vh; }
    .sidebar {
        position: fixed;
        z-index: 30;
        inset: 0 auto 0 0;
        width: min(86vw, 288px);
        min-height: 100vh;
        transform: translateX(-100%);
        transition: transform 200ms ease;
        box-shadow: 18px 0 44px rgba(0, 0, 0, .24);
    }
    .sidebar-open .sidebar { transform: translateX(0); }
    .mobile-header.compact-chat-header {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 10px;
        height: 58px;
        padding: 0 12px;
    }
    .compact-chat-header strong {
        overflow: hidden;
        color: var(--text);
        font-size: 14px;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-menu-button { background: transparent; color: var(--text); }
    .student-context-bar { display: none; }
    .chat-container { padding-top: 82px; padding-right: 16px; padding-left: 16px; }
    .composer-dock,
    .sidebar-collapsed .composer-dock { right: 12px; left: 12px; }
    .thinking,
    .sidebar-collapsed .thinking { left: 18px; }
    .status-line,
    .sidebar-collapsed .status-line { left: 0; }
    .sidebar-collapsed .brand-logo { position: static; opacity: 1; pointer-events: auto; }
    .sidebar-collapsed .conversation-section,
    .sidebar-collapsed .sidebar-divider { display: flex; }
    .sidebar-collapsed .sidebar-divider { display: block; }
    .sidebar-collapsed .nav-item,
    .sidebar-collapsed .profile-card { width: 100%; }
    .sidebar-collapsed .nav-item span:last-child,
    .sidebar-collapsed .profile-info,
    .sidebar-collapsed .profile-caret { max-width: 180px; opacity: 1; pointer-events: auto; }
}

.message-row.user .message-bubble {
    background: #062b5c;
    color: #ffffff;
}
.message-row.ai .message-bubble { color: #142238; }
.composer { box-shadow: 0 1px 3px rgba(15, 35, 60, 0.12), 0 0 0 1px rgba(15, 35, 60, 0.08); }
.composer:hover,
.composer:focus-within { box-shadow: 0 1px 3px rgba(15, 35, 60, 0.12), 0 0 0 1px #aebed1; }
.send-button { background: #062b5c; color: #ffffff; }
.send-button:hover,
.send-button:focus-visible { background: #0a376f; }
.voice-input-button.listening { background: #c62828; color: #ffffff; box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.30); }
.login-shell { background: #f5f7fa; }
.login-card {
    border-color: #d9e1eb;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(6, 43, 92, 0.10);
}
.login-button { background: #062b5c; }
.login-button:hover,
.login-button:focus-visible { background: #0a376f; }

.chat-container {
    max-width: none;
    padding-top: 72px;
    padding-right: max(24px, calc((100% - 780px) / 2));
    padding-bottom: 150px;
    padding-left: max(24px, calc((100% - 780px) / 2));
    scrollbar-width: thin;
    scrollbar-color: #aeb7c2 transparent;
    scrollbar-gutter: stable;
}
.chat-container::-webkit-scrollbar { width: 10px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 3px solid transparent;
    border-radius: 999px;
    background: #aeb7c2;
    background-clip: padding-box;
}
.chat-container::-webkit-scrollbar-thumb:hover { background: #8d98a5; background-clip: padding-box; }
.chat-page.chat-started .composer-dock { top: calc(100vh - 16px); }

@media (max-width: 760px) {
    .chat-container {
        padding-top: 80px;
        padding-right: 16px;
        padding-bottom: 132px;
        padding-left: 16px;
    }
    .chat-page.chat-started .composer-dock { top: calc(100vh - 12px); }
}

/* Minimal chat layout - authoritative final rules */
.composer-dock { max-width: 760px; }
.welcome-panel { margin-bottom: 18px; }
.welcome-panel h1 { max-width: none; margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.composer { min-height: 52px; padding: 6px 8px 6px 12px; }
.composer textarea { min-height: 38px; max-height: 160px; padding: 8px 4px; line-height: 1.4; }
.chat-divider { width: 100%; height: 1px; margin: 22px 0; background: var(--border); }
.message-row { margin-bottom: 12px; }
.message-bubble { line-height: 1.65; }

@media (max-width: 900px) {
    .composer-dock,
    .sidebar-collapsed .composer-dock,
    .chat-page.chat-started .composer-dock { top: auto; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; transform: none; }
    .welcome-panel { margin-bottom: 14px; }
    .welcome-panel h1 { font-size: 25px; }
    .composer { min-height: 48px; padding: 4px 6px 4px 10px; }
    .composer textarea { min-height: 36px; max-height: 112px; padding: 7px 3px; font-size: 15px; }
    .voice-input-button { width: 34px; height: 34px; }
    .send-button { width: 36px; height: 36px; }
    .chat-container { padding-bottom: 108px; }
    .chat-divider { margin: 17px 0; }
    .message-bubble { max-width: 90%; padding: 12px 14px; line-height: 1.55; }
}

/* ChatGPT-style suggested prompts */
.suggested-questions {
    display: grid;
    width: min(100%, 700px);
    gap: 2px;
    margin: 14px auto 0;
}
.suggestion-pill {
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
}
.suggestion-pill:hover,
.suggestion-pill:focus-visible { background: var(--surface-low); color: var(--text); transform: none; }
.suggestion-pill .material-symbols-outlined { flex: 0 0 auto; font-size: 18px; color: var(--secondary); }

@media (max-width: 640px) {
    .composer-dock { align-items: stretch; }
    .welcome-panel { order: 1; width: 100%; text-align: center; }
    .welcome-panel h1 { width: 100%; text-align: center; }
    .suggested-questions { order: 2; width: 100%; margin: 6px 0 10px; }
    .suggestion-pill { min-height: 38px; padding: 7px 8px; font-size: 12px; }
    .composer { order: 3; }
}

@media (min-width: 641px) and (max-width: 900px) {
    .mobile-header.compact-chat-header {
        height: 72px;
        padding: max(12px, env(safe-area-inset-top)) 18px 0;
    }
    .chat-container { padding-top: 96px; }
    .composer-dock,
    .sidebar-collapsed .composer-dock { top: 50%; right: 24px; bottom: auto; left: 24px; transform: translateY(-50%); }
    .chat-page.chat-started .composer-dock,
    .sidebar-collapsed .chat-page.chat-started .composer-dock { top: calc(100vh - 16px); bottom: auto; transform: translateY(-100%); }
    .composer { min-height: 52px; padding: 6px 8px 6px 12px; }
    .composer textarea { min-height: 38px; max-height: 160px; padding: 8px 4px; font-size: 16px; }
    .voice-input-button { width: 38px; height: 38px; }
    .send-button { width: 40px; height: 40px; }
}
