html, body {
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--surface-page);
    line-height: 1.5;
}

:root {
    color-scheme: light;
    --surface-page: #F4F9F8;
    --surface: #FFFFFF;
    --surface-subtle: #EDF5F4;
    --surface-accent: #EFF8F6;
    --text: #172033;
    --text-secondary: #34445A;
    --text-muted: #68778C;
    --border: #DCE9E7;
    --border-strong: #BED3CF;
    --accent: #0F766E;
    --accent-strong: #0D655E;
    --support: #0F766E;
    --support-subtle: #ECFDF5;
    --success: #15803D;
    --warning: #B45309;
    --error: #B91C1C;
    --info: #0369A1;
    --shadow-card: 0 1px 2px rgba(23, 32, 51, 0.025);
    --shadow-overlay: 0 18px 40px rgba(23, 32, 51, 0.14);
}

body.education-saas {
    margin: 0;
    background: var(--surface-page);
}

html:has(.app-shell),
body.education-saas:has(.app-shell) {
    height: 100%;
    overflow: hidden;
}

::selection {
    color: var(--text);
    background: #ADE0D8;
}

.education-saas :is(a, button, input, select, textarea, [role="button"]) {
    transition-duration: 180ms;
    transition-timing-function: ease-out;
}

.education-saas :is(a, button, input, select, textarea, [role="button"]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.education-saas :is(input, select, textarea) {
    color: var(--text-secondary);
    border-color: var(--border);
    background-color: var(--surface);
}

.education-saas :is(input, select, textarea):focus {
    border-color: var(--accent);
}

.app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    color: var(--text-secondary);
    background: var(--surface-page);
}

.app-sidebar {
    min-height: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    border-color: var(--border);
    background: var(--surface);
    box-shadow: 4px 0 20px rgba(23, 32, 51, 0.035);
}

.app-wordmark {
    color: var(--accent);
    letter-spacing: -0.035em;
}

.app-navigation {
    min-height: 0;
    scrollbar-gutter: stable;
}

.app-sidebar-footer {
    border-color: var(--border);
    background: var(--surface);
}

.app-content {
    background: var(--surface-page);
    scrollbar-gutter: stable;
}

.education-saas .bg-white {
    background-color: var(--surface);
}

.education-saas .bg-gray-50 {
    background-color: var(--surface-page);
}

.education-saas .bg-gray-100 {
    background-color: var(--surface-subtle);
}

.education-saas .border-gray-100,
.education-saas .border-slate-100 {
    border-color: #EDF5F4;
}

.education-saas .border-gray-200,
.education-saas .border-slate-200 {
    border-color: var(--border);
}

.education-saas .text-gray-900,
.education-saas .text-slate-900 {
    color: var(--text);
}

.education-saas .text-gray-700,
.education-saas .text-slate-700 {
    color: var(--text-secondary);
}

.education-saas .text-gray-500,
.education-saas .text-slate-500 {
    color: var(--text-muted);
}

.education-saas .shadow-sm {
    box-shadow: var(--shadow-card);
}

.education-saas .shadow-md,
.education-saas .shadow-lg,
.education-saas .shadow-xl,
.education-saas .shadow-2xl {
    box-shadow: var(--shadow-overlay);
}

@media (max-width: 768px) {
    .app-content {
        padding: 1rem;
    }

    .education-saas :is(input, select, textarea) {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .education-saas *,
    .education-saas *::before,
    .education-saas *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.v2-progress {
    overflow: hidden;
    border-radius: 999px;
}

.v2-progress::-webkit-progress-bar,
.v2-progress::-webkit-progress-value,
.v2-progress::-moz-progress-bar {
    border-radius: 999px;
}

a, .btn-link {
    color: var(--accent);
}

.btn-primary {
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--surface), 0 0 0 0.25rem rgba(37, 99, 235, 0.28);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    out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MTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjAxODMgMjYzLjU3NiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ========================================
   Inline Image Styling - Adaptive sizing based on natural height
   - Inline images: Small (< 75px) = 1.3em, Large (>= 75px) = 2.2em
   - Block images: Preserve natural size
   ======================================== */

/* Base inline image styling - default for small inline images */
img {
    /* Display inline with text by default */
    display: inline;
    
    /* Default: Small inline images - 1.3em */
    height: 1.3em;
    max-height: 1.3em;
    width: auto;
    max-width: 100%;
    
    /* Align with text baseline */
    vertical-align: middle;
    
    /* Maintain aspect ratio */
    object-fit: contain;
    
    /* Smooth rendering */
    image-rendering: auto;
    
    /* Subtle spacing around images */
    margin: 0 0.15em;
    
    /* Prevent layout shift */
    line-height: 0;
}

/* Large inline images (naturalHeight >= 75px) */
img.img-large {
    height: 2.2em !important;
    max-height: 2.2em !important;
    display: inline !important;
    vertical-align: middle !important;
}

/* Small inline images (naturalHeight < 75px) - explicit */
img.img-small {
    height: 1.3em !important;
    max-height: 1.3em !important;
    display: inline !important;
    vertical-align: middle !important;
}

/* Block-level images - preserve natural size */
img.img-block {
    height: auto !important;
    max-height: none !important;
    width: auto !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0.5rem 0 !important; /* Vertical spacing */
    vertical-align: baseline !important;
}

/* Specific styling for different text sizes - inline only */
.text-xs img.img-small,
.text-sm img.img-small,
.text-base img.img-small,
.text-lg img.img-small {
    height: 1.3em !important;
    max-height: 1.3em !important;
}

.text-xs img.img-large,
.text-sm img.img-large,
.text-base img.img-large,
.text-lg img.img-large {
    height: 2.2em !important;
    max-height: 2.2em !important;
}

/* Block images in any context preserve natural size */
.text-xs img.img-block,
.text-sm img.img-block,
.text-base img.img-block,
.text-lg img.img-block,
.leading-relaxed img.img-block {
    height: auto !important;
    max-height: none !important;
    display: block !important;
}

/* For images in content areas with line-height context */
.leading-relaxed img.img-small {
    height: 1.3em !important;
}

.leading-relaxed img.img-large {
    height: 2.2em !important;
}

/* Ensure inline images in flex containers stay inline */
.flex-1 img:not(.img-block),
.flex img:not(.img-block) {
    display: inline;
    vertical-align: middle;
}

/* Block images in flex */
.flex-1 img.img-block,
.flex img.img-block {
    display: block;
}

/* Images in gray background boxes */
.bg-gray-50 img:not(.img-block),
.bg-gray-100 img:not(.img-block) {
    display: inline;
    vertical-align: middle;
}

.bg-gray-50 img.img-block,
.bg-gray-100 img.img-block {
    display: block;
}

/* For MathJax and LaTeX rendered content - always inline */
.MathJax img,
.mjx-container img,
mjx-container img {
    display: inline !important;
    vertical-align: middle;
    margin: 0 0.1em;
}

/* Ensure paragraphs with inline images maintain proper line height */
p img:not(.img-block),
div img:not(.img-block),
span img:not(.img-block) {
    display: inline;
    vertical-align: middle;
}

/* For question content specifically */
#question-content img:not(.img-block) {
    display: inline;
    vertical-align: middle;
}

#question-content img.img-block {
    display: block;
    margin: 0.75rem auto;
}

/* Fixed user avatars in assessment/workspace management tables.
   The important constraints intentionally override adaptive content-image sizing. */
img.user-avatar-100,
.user-avatar-100 {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
    flex: 0 0 100px;
    object-fit: cover !important;
    margin: 0 !important;
}

/* ========================================
   Custom Scrollbar Styling - Subtle & Light
   ======================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.6);
}

/* Hide scrollbar when not hovering (optional - shows on hover) */
.overflow-y-auto::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
}

.overflow-y-auto:hover::-webkit-scrollbar-thumb,
.overflow-x-auto:hover::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}

/* Specific scrollable panels in ReviewQuestions */
#question-content::-webkit-scrollbar {
    width: 5px;
}

#question-content::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.25);
    border-radius: 3px;
}

#question-content:hover::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.45);
}
.overflow-wrap-anywhere {
    overflow-wrap: anywhere;
}

/* Shared reference style: white navigation, teal workspace actions. */
:root {
    --navigation: #2563EB;
    --navigation-active: #EFF6FF;
    --accent-subtle: #EFF8F6;
}
.education-saas { font-size: 13px; }
.education-saas .app-sidebar .app-wordmark {
    color: var(--navigation);
}
.education-saas .app-sidebar .app-nav-active {
    background: var(--navigation-active);
    color: var(--navigation);
}
.education-saas .app-sidebar .app-nav-active > div {
    color: var(--navigation);
}
.education-saas .app-content { padding: 16px; }
.education-saas .app-content :is(h1, h2) {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}
.education-saas .app-content h1 { color: var(--support); }
.education-saas .app-content :is(.text-sm, .text-base) { font-size: 13px; }
.education-saas .app-content :is(.rounded-lg, .rounded-xl, .rounded-2xl) { border-radius: 8px; }
.education-saas .app-content :is(.bg-white, .bg-gray-50):is(.p-5, .p-6, .p-8) { padding: 16px; }
.education-saas .app-content :is(input, select, textarea):focus-visible {
    outline: none;
    box-shadow: none;
    border-color: var(--accent);
}
@media (max-width: 640px) {
    .education-saas .app-content :is(input, select, textarea) { font-size: 16px; }
}

/* Socket progress report */
.socket-report-layout { display:grid; grid-template-columns:minmax(280px,340px) minmax(0,1fr); gap:16px; align-items:start; }
.socket-surface { border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.socket-control { min-height:40px; border:1px solid var(--border-strong); border-radius:8px; padding:8px 12px; background:var(--surface); font-size:13px; }
.socket-control:focus, .socket-report button:focus-visible, .socket-report [tabindex]:focus-visible { outline:1px solid var(--accent); outline-offset:2px; }
.socket-control:focus { outline:none; border-color:var(--accent); }
.socket-report button { transition:background-color 150ms; }
.socket-report button:disabled { opacity:.55; cursor:wait; }
.socket-job { display:block; width:100%; padding:12px 16px; border-bottom:1px solid var(--border); text-align:left; overflow-wrap:anywhere; }
.socket-job:hover, .socket-log-row:hover { background:var(--surface-subtle); }
.socket-selected { background:var(--accent-subtle); box-shadow:inset 3px 0 var(--accent); }
.socket-timeline { min-width:640px; }
.socket-timeline-row { display:grid; grid-template-columns:180px minmax(200px,1fr) 100px; gap:12px; align-items:center; width:100%; padding:8px; border-bottom:1px solid var(--border); }
.socket-timeline-header { font-size:12px; color:var(--text-muted); background:var(--surface-subtle); }
.socket-field { display:grid; grid-template-columns:150px minmax(0,1fr); gap:12px; }
@media(max-width:1023px) { .socket-report-layout { grid-template-columns:minmax(0,1fr); } }
@media(max-width:639px) { .socket-report { font-size:16px; } .socket-field { grid-template-columns:minmax(0,1fr); gap:4px; } .socket-report input,.socket-report select { font-size:16px; } }
@media(prefers-reduced-motion:reduce) { .socket-report button { transition:none; } }
