/* ECC: Montserrat is linked in index.html. Outfit and Plus Jakarta imports removed (one typeface). */

:root {
    --font-primary: var(--ces-font-body);
    --font-heading: var(--font-sans);

    /* ECC Light Theme Mapping */
    --bg-base: var(--surface-sunken);
    --bg-surface: var(--surface);
    --bg-surface-elevated: var(--surface);
    --bg-surface-bubble: var(--surface);
    --border-color: var(--border);
    --border-color-light: var(--border);
    --border-highlight: var(--brand);

    /* Text Colors */
    --text-primary: var(--ink);
    --text-secondary: var(--ink);
    --text-muted: var(--ink-muted);
    --text-dim: var(--ink-muted);

    /* Branding & Accent Colors */
    --accent-green: var(--brand);
    --accent-green-bright: var(--brand);
    --accent-gold: #FDB515; /* retained for ENSIGN wordmark only */
    --accent-gold-warm: var(--brand);
    --accent-gradient: var(--brand);
    --button-gradient: var(--brand);

    /* Status Colors */
    --status-success: var(--brand);
    --status-warning: var(--ink-muted);
    --status-danger: var(--danger-text);

    /* Transitions & Shadows */
    --transition-smooth: var(--ces-transition);
    --shadow-premium: var(--shadow-card);
    --shadow-glow: none;

    font-family: 'Montserrat', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--surface-sunken);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0.75rem 0;
    overflow-x: hidden;
}

/* Core Utility Display Classes */
.hidden,
[hidden],
.modal-overlay.hidden,
.modal-overlay[hidden] {
    display: none !important;
}

.app-container {
    max-width: 100vw; /* ECC: fill the width. Side space comes from --gutter, not a fixed cap. */
    width: 100%;
    box-sizing: border-box;
    padding-inline: var(--gutter, clamp(24px, 3vw, 56px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: calc(100vh - 1.5rem);
    height: auto;
    min-width: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-branding {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-text {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    font-weight: 500;
}

.system-status {
    display: flex;
    gap: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.25rem 0.65rem;
    border: 2px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--brand);
    font-size: 1.0625rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    width: fit-content;
}

.dashboard-link:hover {
    border-color: var(--brand);
    background: var(--surface-sunken);
    color: var(--brand);
}

.dashboard-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-color: var(--brand);
}

.dashboard-link-top { margin-bottom: 0.25rem; }

@media (max-width: 768px) {
    header { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
    .header-actions { width: 100%; justify-content: space-between; }
    .app-container { height: auto; min-height: calc(100vh - 3rem); }
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 1.0625rem;
    font-weight: 600;
    background-color: var(--brand-tint, #e6f0ec);
    border: 1px solid var(--border);
    color: var(--ink);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ink-muted);
}

.status-indicator.connected {
    background-color: var(--brand);
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
}

/* =========================================================
   VIEW 1: Mode Selection Onboarding Card & Intake Container
   ========================================================= */
.mode-selection-container,
.intake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.85rem 0;
    /* ECC scroll model: these views grow with content and the page scrolls.
       They were overflow-y:auto + overscroll-behavior:contain with no bounded height,
       which made them dead wheel zones: the wheel only scrolled over the page margins. */
    overflow: visible;
}

.selection-card {
    margin: auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.25rem 2.5rem;
    box-shadow: var(--shadow-card);
    max-width: none; /* ECC: fill the width */
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.selection-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 1.0625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background-color: var(--brand-tint, #e6f0ec);
    color: var(--brand);
    border: 1px solid var(--border);
}

.selection-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.25;
}

.selection-subtitle {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    max-width: 680px;
    line-height: 1.6;
}

.mode-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    margin-top: 0.75rem;
    min-width: 0;
}

@media (max-width: 720px) {
    .selection-card { padding: 1.5rem 1.25rem; }
    .mode-cards-grid { grid-template-columns: 1fr; gap: 1rem; }
    .selection-card h2 { font-size: 1.6rem; }
}

.mode-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--ink);
    cursor: pointer;
    transition: var(--transition-smooth);
    min-height: 220px;
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.mode-card:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.mode-card:active {
    transform: translateY(-1px);
}

.mode-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
    min-width: 0;
}

.mode-card-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.mode-card-title-group h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.mode-card-tag {
    font-size: 1.0625rem;
    color: var(--brand);
    font-weight: 600;
}

.mode-card-desc {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.mode-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    min-width: 0;
}

.mode-card:hover .mode-card-action {
    color: var(--brand-hover, var(--brand));
}

.action-arrow {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.mode-card:hover .action-arrow {
    transform: translateX(4px);
}

.selection-footer-privacy {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    margin-top: 0.5rem;
}

.selection-footer-privacy strong {
    color: var(--ink);
}

/* =========================================================
   VIEW 2: Active Chat View & Controls
   ========================================================= */
.chat-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    min-width: 0;
}

.chat-container[hidden],
.mode-selection-container[hidden],
.intake-container[hidden],
.app-layout[hidden] {
    display: none !important;
}

/* Chat Header Bar with Active Mode Badge & Navigation Buttons */
.chat-header,
.chat-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chat-header-info,
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.chat-header-info h2 {
    font-size: 1.15rem;
    font-family: var(--font-heading);
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.01em;
}

.chat-header-info p {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    margin: 0.1rem 0 0 0;
    font-weight: 500;
}

.chat-header-meta,
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    min-width: 0;
}

.btn-icon-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--brand);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.btn-icon-back:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
    transform: translateX(-2px);
}

.btn-icon-back:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    background: var(--brand-tint, #e6f0ec);
    border: 1px solid var(--border);
    color: var(--brand);
    font-size: 1.0625rem;
    font-weight: 600;
}

.btn-chat-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    min-height: 44px;
    border-radius: 8px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--brand);
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-chat-back:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
}

.btn-chat-back:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.active-mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
}

.active-mode-icon {
    font-size: 1.25rem;
}

.active-mode-title {
    color: var(--brand);
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

.btn-switch-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    min-height: 44px;
    border-radius: 8px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--brand);
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-switch-mode:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
}

.chat-history,
.chat-messages {
    flex: 1 1 auto;
    min-height: 200px;
    padding: 0.85rem 1.25rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    /* ECC scroll model: the feed is the one inner scroller. 'auto' (not 'contain') hands the
       wheel back to the page at the feed's top and bottom, so the composer is always reachable. */
    overscroll-behavior: auto;
    /* Bounded so header + feed + chips + composer fit one screen once the page scrolls past the top chrome.
       Without a bound the feed grows with every reply and pushes Send off-screen. */
    max-height: max(320px, calc(100dvh - 330px));
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.chat-history::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 9px;
}
.chat-history::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: var(--surface-sunken);
}
.chat-history::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
}

.message {
    display: flex;
    max-width: 78%; /* ECC: user bubble max 78% */
    min-width: 0;
}

.message.user-msg {
    align-self: flex-end;
}

.message.system-msg {
    align-self: stretch;
    max-width: 100%; /* ECC: assistant message is a full-width card */
    min-width: 0;
}
.message.system-msg .message-content { flex: 1 1 auto; }

.message-content {
    padding: 1.15rem 1.35rem;
    border-radius: 14px;
    font-size: var(--text-body);
    line-height: 1.6;
    word-wrap: break-word;
    color: var(--ink);
    min-width: 0;
}

.user-msg .message-content {
    background: var(--brand);
    color: #ffffff;
    border: 1px solid var(--brand);
    border-bottom-right-radius: 3px;
}

.system-msg .message-content {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
    border-bottom-left-radius: 3px;
    box-shadow: var(--shadow-card);
}

/* Markdown Styling in Messages */
.system-msg .message-content p { margin-bottom: 0.85rem; }
.system-msg .message-content p:last-child { margin-bottom: 0; }
.system-msg .message-content ul, 
.system-msg .message-content ol { 
    padding-left: 1.65rem; 
    margin-bottom: 0.85rem; 
}
.system-msg .message-content li {
    margin-bottom: 0.35rem;
}
.system-msg .message-content strong { 
    color: var(--ink);
    font-weight: 700;
}
.system-msg .message-content em {
    color: var(--ink-muted);
}
.system-msg .message-content h3,
.system-msg .message-content h4 {
    color: var(--ink);
    font-family: var(--font-heading);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.system-msg .message-content code { 
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    color: var(--brand);
    padding: 0.2rem 0.45rem; 
    border-radius: 5px; 
    font-size: 0.9em;
}
.system-msg .message-content blockquote {
    border-left: 3px solid var(--brand);
    padding-left: 0.85rem;
    margin: 0.75rem 0;
    color: var(--ink-muted);
}

/* Processing Indicator */
.processing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 1.5rem 0;
    padding: 0.75rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
}

.processing-indicator[hidden] { display: none; }

.processing-dot {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 0.75rem;
    border-radius: 50%;
    background: var(--brand);
    animation: processing-pulse 1.2s ease-in-out infinite;
}

@keyframes processing-pulse {
    50% { box-shadow: 0 0 0 0.55rem transparent; }
}

/* Quick Prompt Suggestion Chips Toolbar */
.quick-prompts-bar {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.55rem 1.5rem 0.45rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.quick-prompts-label {
    font-size: 1.0625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
}

.quick-chips-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.quick-chip {
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: 20px;
    padding: 0.4rem 0.85rem;
    min-height: 44px;
    color: var(--brand);
    font-family: var(--font-primary);
    font-size: 1.0625rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
    white-space: nowrap;
}

.quick-chip:hover {
    border-color: var(--brand);
    background: var(--surface-sunken);
    color: var(--brand);
    transform: translateY(-1px);
}

.quick-chip:active {
    transform: translateY(0);
}

/* Input Area with High Contrast & Prominent Attachment Button */
.chat-input-area {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    min-width: 0;
}

/* Prominent High-Contrast Document Attachment Button (Orange) */
.btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.65rem 1.15rem;
    border-radius: 10px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--brand);
    font-weight: 700;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.btn-upload:hover:not(:disabled) {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-2px);
}

.btn-upload:active:not(:disabled) {
    background: var(--surface-sunken);
    transform: translateY(0);
}

.upload-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.upload-label {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .upload-label {
    display: none;
}
    .btn-upload {
    padding: 0.65rem 0.9rem;
}
}

textarea {
    flex-grow: 1;
    background-color: var(--input-fill);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    color: var(--ink);
    padding: 0.85rem 1rem;
    font-size: var(--text-body);
    font-family: var(--font-primary);
    transition: var(--transition-smooth);
    resize: none;
    min-height: 44px;
    line-height: 1.45;
    box-shadow: var(--shadow-card);
}

textarea::placeholder {
    color: var(--ink-muted);
}

textarea:focus {
    border-color: var(--input-border);
    box-shadow: var(--shadow-focus);
    background-color: var(--surface);
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-hover, var(--brand));
    border-color: var(--brand-hover, var(--brand));
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.send-arrow {
    font-size: 1.0625rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(40%);
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink-muted);
    border: 2px solid var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-sunken);
    color: var(--ink);
    border-color: var(--brand);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--ink-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    min-height: 44px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.privacy-notice {
    padding: 0.65rem 1.5rem 0.9rem;
    font-size: 1.0625rem;
    color: var(--ink-muted);
    text-align: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.privacy-notice strong {
    color: var(--ink);
}

/* =========================================================
   Answer Feedback (Thumbs Up / Down & Suggested Improvement)
   ========================================================= */
.answer-feedback {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.feedback-prompt {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 0.45rem;
}

.feedback-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.feedback-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.feedback-button:hover:not(:disabled) {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
}

.feedback-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-up {
    color: var(--brand);
}

.feedback-down {
    color: var(--danger-text);
}

.feedback-submit {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.feedback-submit:hover:not(:disabled) {
    background: var(--brand-hover, var(--brand));
    color: #ffffff;
}

.feedback-cancel {
    background: transparent;
    border-color: var(--border);
    color: var(--ink-muted);
}

.feedback-cancel:hover:not(:disabled) {
    background: var(--surface-sunken);
    color: var(--ink);
}

.feedback-form {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
}

.feedback-form[hidden] {
    display: none !important;
}

.feedback-form label {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.1rem;
}

.feedback-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    background: var(--input-fill);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    color: var(--ink);
    font-size: var(--text-body);
    line-height: 1.4;
    resize: vertical;
    box-shadow: var(--shadow-card);
}

.feedback-form textarea[readonly] {
    background: var(--surface-sunken);
    color: var(--ink-muted);
    border-color: var(--border);
}

.feedback-form textarea:focus-visible {
    border-color: var(--input-border);
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    box-shadow: var(--shadow-focus);
    background: var(--surface);
}

.feedback-warning {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    line-height: 1.35;
}

.feedback-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
}

.feedback-status {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 0.45rem;
    min-height: 1.2em;
}

.feedback-success {
    color: var(--brand);
}

.feedback-error {
    color: var(--danger-text);
}

/* =========================================================
   Resume Subviews & Dual Intake Card Styles
   ========================================================= */
.btn-subview-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    min-height: 44px;
    border-radius: 8px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--brand);
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: -0.25rem;
}

.btn-subview-back:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
}

.intake-card {
    max-width: none; /* ECC: fill the width */
}

.dual-intake-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    margin-top: 0.5rem;
    min-width: 0;
}

@media (max-width: 768px) {
    .dual-intake-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
}

.intake-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    text-align: left;
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.intake-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.intake-panel-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.intake-panel-title h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.1rem;
}

.intake-panel-sub {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    font-weight: 600;
}

.intake-upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.intake-upload-btn {
    min-height: 44px;
    padding: 0.45rem 0.95rem;
    font-size: 1.0625rem;
}

.file-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    min-height: 44px;
    background: var(--brand-tint, #e6f0ec);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 600;
}

.file-status-chip[hidden] {
    display: none !important;
}

.file-status-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--brand);
}

.btn-clear-file {
    background: transparent;
    border: none;
    color: var(--danger-text);
    cursor: pointer;
    font-size: 1.0625rem;
    font-weight: bold;
    padding: 0 0.2rem;
    line-height: 1;
    min-height: 44px;
}

.btn-clear-file:hover {
    color: var(--danger-text);
}

.intake-textarea {
    width: 100%;
    min-height: 140px;
    background: var(--input-fill);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    color: var(--ink);
    padding: 0.85rem;
    font-family: var(--font-primary);
    font-size: var(--text-body);
    line-height: 1.5;
    resize: vertical;
    box-shadow: var(--shadow-card);
}

.intake-textarea:focus {
    border-color: var(--input-border);
    box-shadow: var(--shadow-focus);
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    background: var(--surface);
}

.intake-submit-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.btn-large {
    min-height: 44px;
    padding: 0.75rem 2rem;
    font-size: 1.0625rem;
}

.intake-error-message {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--brand-tint, #e6f0ec);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--danger-text);
    font-size: 1.0625rem;
    font-weight: 600;
    text-align: center;
}

.intake-error-message[hidden] {
    display: none !important;
}

\n
/* ==============================================================================
   MENTOR VERSION SPECIFIC STYLING
   ============================================================================== */

.header-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mentor-badge {
    display: inline-block;
    background: var(--brand);
    color: #ffffff;
    font-size: 1.0625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    vertical-align: middle;
}

/* Mentor Ribbon (Lookup & Session Bar) */
.mentor-ribbon {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    box-shadow: var(--shadow-card);
    flex-shrink: 0;
    min-width: 0;
}

.lookup-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.lookup-input-group {
    display: flex;
    align-items: center;
    background: var(--input-fill);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.65rem;
    gap: 0.45rem;
    transition: var(--transition-smooth);
    min-height: 44px;
}

.lookup-input-group:focus-within {
    border-color: var(--input-border);
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    box-shadow: var(--shadow-focus);
}

.lookup-input-group input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--ink);
    font-size: var(--text-body);
    outline: 2px solid transparent;
    font-family: var(--font-primary);
    min-height: 44px;
}

.lookup-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-card);
}

.lookup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 0;
}

.lookup-item:hover {
    background: var(--surface-sunken);
}

.lookup-item-name {
    font-weight: 700;
    color: var(--ink);
    font-size: 1.0625rem;
}

.lookup-item-email {
    font-size: 1.0625rem;
    color: var(--ink-muted);
}

.lookup-item-score {
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.0625rem;
}

/* Selected Student VMock Card */
.selected-student-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--brand-tint, #e6f0ec);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.student-avatar {
    font-size: 1.35rem;
    line-height: 1;
}

.student-name {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--ink);
}

.student-email {
    font-size: 1.0625rem;
    color: var(--ink-muted);
}

.vmock-score-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.vmock-score-badge {
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-weight: 800;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
}

.vmock-score-badge.score-green {
    background: var(--brand-tint, #e6f0ec);
    color: var(--brand);
    border-color: var(--brand);
}

.vmock-score-badge.score-yellow {
    background: var(--surface-sunken);
    color: var(--ink);
    border-color: var(--border);
}

.vmock-score-badge.score-red {
    background: var(--surface-sunken);
    color: var(--danger-text);
    border-color: var(--border);
}

.score-number {
    font-size: 1.2rem;
    line-height: 1;
}

.score-max {
    font-size: 1.0625rem;
    opacity: 0.8;
}

.score-meta {
    display: flex;
    flex-direction: column;
}

.score-zone-label {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
}

.score-subdate {
    font-size: 1.0625rem;
    color: var(--ink-muted);
}

.btn-outline-orange {
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--brand);
    font-weight: 700;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    min-height: 44px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-outline-orange:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
}

/* Session Management Bar & Tabs */
.session-management-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 0.35rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.session-tabs-strip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
}

.session-tabs-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
}

.session-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    min-height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink-muted);
    font-size: 1.0625rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.session-tab:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.session-tab.active {
    background: var(--brand-tint, #e6f0ec);
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 700;
}

.session-tab-close {
    font-size: 1.0625rem;
    opacity: 0.6;
    margin-left: 2px;
}

.session-tab-close:hover {
    opacity: 1;
    color: var(--danger-text);
}

.btn-tab-add {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--ink-muted);
    padding: 0.25rem 0.55rem;
    min-height: 44px;
    border-radius: 6px;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-tab-add:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.session-actions-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
}

.btn-danger-soft {
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--danger-text);
    font-weight: 700;
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    min-height: 44px;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-danger-soft:hover {
    background: var(--surface-sunken);
    border-color: var(--danger-text);
}

/* Mentor Action Toolbar */
.mentor-action-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.3rem 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-width: 0;
}

.toolbar-label {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.toolbar-buttons {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-width: 0;
}

.btn-mentor-action {
    display: inline-flex;
    max-width: 100%; /* ECC: lets long labels wrap at 320px instead of pushing past the edge */
    text-align: left;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    min-height: 44px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.btn-print {
    background: var(--surface);
    color: var(--brand);
    border-color: var(--border-strong);
}

.btn-print:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
    color: var(--brand);
}

.btn-email {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
}

.btn-email:hover {
    background: var(--brand-hover, var(--brand));
    border-color: var(--brand-hover, var(--brand));
}

.btn-notes {
    background: var(--surface);
    color: var(--brand);
    border-color: var(--border-strong);
}

.btn-notes:hover {
    background: var(--surface-sunken);
    border-color: var(--brand);
}

.toast-message {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-tint, #e6f0ec);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal-overlay.hidden,
.modal-overlay[hidden] {
    display: none !important;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.modal-header-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    min-width: 0;
}

/* Email Form */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.form-group label {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.form-group input, .form-group textarea {
    background: var(--input-fill);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--ink);
    padding: 0.65rem 0.85rem;
    font-family: var(--font-primary);
    font-size: var(--text-body);
    min-height: 44px;
    box-shadow: var(--shadow-card);
}

.email-form-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

/* Printable Sheet View inside Modal */
.printable-sheet {
    background: #ffffff;
    color: #111827;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 0.5rem;
}

.print-header {
    border-bottom: 2px solid var(--brand);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.print-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
}

.print-subtitle {
    font-size: 1.0625rem;
    color: var(--brand);
    font-weight: 700;
}

.print-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.65rem;
    font-size: 1.0625rem;
    color: #334155;
    min-width: 0;
}

.print-section {
    margin-bottom: 1rem;
}

.print-section-title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
    margin-bottom: 0.4rem;
}

.print-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1.0625rem;
    color: #1e293b;
    line-height: 1.5;
}

.print-box ul, .print-box ol {
    padding-left: 1.25rem;
    margin-top: 0.35rem;
}

.print-box li {
    margin-bottom: 0.35rem;
}

.print-score-callout {
    margin-top: 0.5rem;
    padding: 0.4rem 0.65rem;
    background: var(--brand-tint, #e6f0ec);
    border-left: 4px solid var(--brand);
    border-radius: 4px;
    font-size: 1.0625rem;
    color: var(--ink);
}

.print-next-steps {
    background: var(--brand-tint, #e6f0ec);
    border-color: var(--border);
}

.print-link {
    font-family: monospace;
    font-size: 1.0625rem;
    color: var(--brand);
    font-weight: 700;
    margin: 0.25rem 0;
}

.print-footer {
    display: flex;
    justify-content: space-between;
    font-size: 1.0625rem;
    color: #64748b;
    border-top: 1px solid #cbd5e1;
    padding-top: 0.5rem;
    margin-top: 1.25rem;
}

/* ==============================================================================
   STRICT 2-PAGE PRINT MEDIA STYLES
   ============================================================================== */

@media print {
    @page {
    size: letter portrait;
    margin: 0.4in;
}

    body, html {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

    /* Hide screen-only interactive chrome */
    .app-container, header, .mentor-ribbon, .mentor-action-toolbar, .dashboard-grid, .modal-header, #email-modal {
    display: none !important;
}

    #print-modal {
    position: static !important;
    background: transparent !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
}

    .print-modal-content {
    background: #ffffff !important;
    color: #111827 !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

    .printable-sheet {
    display: block !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    color: #111827 !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 10.5pt !important;
    line-height: 1.35 !important;
    max-height: 20.5in !important; /* STRICT CEILING: strictly 2 letter pages maximum */
}

    .print-header {
    border-bottom: 2px solid var(--brand) !important;
    padding-bottom: 0.35rem !important;
    margin-bottom: 0.6rem !important;
}

    .print-section {
    margin-bottom: 0.65rem !important;
    page-break-inside: avoid !important;
}

    .print-box {
    border: 1px solid #d1d5db !important;
    background: #f9fafb !important;
    padding: 0.5rem 0.75rem !important;
}

    .print-footer {
    margin-top: 0.75rem !important;
    padding-top: 0.35rem !important;
}
}

/* ═════════════════════════════════════════════════════════════════════════════
   Superdesign v4 Layout & Section Feedback UX
   ═════════════════════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    flex-direction: row;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1rem;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    width: 100%;
    min-width: 0;
}

.section-controls {
    width: 340px;
    flex: 0 0 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    min-width: 0;
}

.chat-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.feedback-controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    min-width: 0;
}

@media (max-width: 900px) {
    .app-layout {
    flex-direction: column;
}
    .section-controls {
    width: 100%;
    flex: 0 0 auto;
}
}

.feedback-controls h2 {
    font-size: 1.0625rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.feedback-controls p {
    font-size: 1.0625rem;
    color: var(--ink-muted);
}

/* ECC: this label appears only after entering the chat workspace. */
#feedback-controls label { font-size: 17px; }

.feedback-scope-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--surface-sunken);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    min-width: 0;
}

.scope-button {
    flex: 1;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    font-size: 1.0625rem;
    border: 2px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.scope-button.active {
    background: var(--brand);
    color: #ffffff;
    font-weight: 600;
}

#section-selector,
.section-scope-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--input-fill);
    color: var(--ink);
    border: 2px solid var(--input-border);
    font-family: var(--font-primary);
    font-size: var(--text-body);
    min-height: 44px;
    box-shadow: var(--shadow-card);
}

.section-choice-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.section-choice {
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink-muted);
    text-align: left;
    cursor: pointer;
    font-size: 1.0625rem;
    transition: var(--transition-smooth);
}

.section-choice:hover {
    border-color: var(--brand);
    background: var(--surface-sunken);
}

.section-choice.active {
    border-color: var(--brand);
    background: var(--brand-tint, #e6f0ec);
    color: var(--brand);
    font-weight: 600;
}

/* Chat history standalone rule for test_chat_history_flex_grow_regression */
.chat-history {
    flex-grow: 1;
}

/* Details and Summary Collapsible Accordion */
details {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.2s;
    min-width: 0;
}

summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.75rem 1rem;
    user-select: none;
    outline: 2px solid transparent;
    color: var(--ink);
    background: var(--surface-sunken);
    font-size: var(--text-body);
}

summary:hover {
    background: var(--surface-sunken);
}

summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

details[open],
.resume-section-panel[open] {
    border-color: var(--brand);
}

.resume-section-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--surface);
    min-width: 0;
}

.resume-section-panel .panel-body {
    padding: 1rem;
    color: var(--ink-muted);
    line-height: 1.6;
    font-size: var(--text-body);
}

/* Mentor Authentication Overlay */
.mentor-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.mentor-auth-dialog {
    background: var(--surface);
    max-width: 440px;
    width: 100%;
    border-radius: 16px;
    padding: 2.2rem 2rem;
    box-shadow: var(--shadow-card);
    text-align: left;
    color: var(--ink);
    border: 1px solid var(--border);
    min-width: 0;
}

.mentor-auth-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.mentor-lock-icon {
    font-size: 2.5rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.mentor-auth-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--brand);
    font-weight: 800;
}

.mentor-auth-subtitle {
    margin: 0.25rem 0 0;
    font-size: 1.0625rem;
    color: var(--ink-muted);
    font-weight: 600;
}

.mentor-auth-notice {
    font-size: 1.0625rem;
    color: var(--ink-muted);
    line-height: 1.5;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1.25rem;
}


/* ECC runtime-audit fixes (index.html). Login modal moved off inline hex to tokens.
   Lookup field: fill and border live on the input itself so the field looks like every other ECC field. */
.mentor-auth-field { margin-bottom: 1rem; }
.mentor-auth-label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 1.0625rem; color: var(--ink); }
.mentor-auth-input { width: 100%; min-height: 44px; padding: 0.75rem; box-sizing: border-box; font-size: 1.0625rem; font-family: var(--font-primary); color: var(--ink); background: var(--input-fill); border: 2px solid var(--input-border); border-radius: var(--radius-md); }
.mentor-auth-input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mentor-auth-error { color: var(--danger-text, #991b1b); background: #fee2e2; border: 1px solid #fca5a5; padding: 0.6rem; border-radius: 6px; font-size: 1.0625rem; margin-bottom: 1rem; }
.mentor-auth-submit { font-family: inherit; width: 100%; min-height: 44px; padding: 0.75rem; font-size: 1.0625rem; font-weight: 700; cursor: pointer; }
.mentor-auth-footer { margin-top: 1.25rem; font-size: 1.0625rem; color: var(--ink-muted); text-align: center; }

.lookup-input-group { position: relative; background: transparent; border: none; padding: 0; gap: 0; min-height: 44px; }
.lookup-input-group .lookup-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }
.lookup-input-group input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 2.9rem; background: var(--input-fill); border: 2px solid var(--input-border); border-radius: var(--radius-md); }
.lookup-input-group #btn-clear-lookup { position: absolute; right: 0; top: 0; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
/* ECC: form controls do not inherit font by default, so they rendered in Arial */
button, input, select, textarea { font-family: inherit; }

/* Upload lives in the chat header now (top of the workspace). A brand border makes it the obvious first step. */
.chat-header-meta .btn-upload { border: 2px solid var(--brand); background: var(--surface); }
.chat-header-meta .btn-upload:hover:not(:disabled) { background: var(--brand-tint, #e6f0ec); }

/* ECC: user bubble may widen to 90% at 375px and below. */
@media (max-width: 375px) {
    .message { max-width: 90%; }
}
