/* Loaded after the theme and utility styles on customer and management pages. */
body :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="url"], input[type="tel"], textarea, select) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #1f2937;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.5;
}
body :is(input, textarea)::placeholder { color: #6b7280; opacity: 1; }
body :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="url"], input[type="tel"], textarea, select):focus {
    border: 1px solid #1f2937;
}
body :is(input, textarea, select, button, a):focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    scroll-margin-top: 90px;
}
body :is(input, textarea, select)[aria-invalid="true"] { border-color: #b91c1c; }
.error-message { color: #991b1b; margin-top: 6px; font-weight: 600; }
body :is(input, textarea, select):disabled { background: #f3f4f6; color: #4b5563; border-color: #6b7280; cursor: not-allowed; }
body :is(input, textarea)[readonly] { background: #f3f4f6; border-style: dashed; }
body textarea { min-height: 144px; resize: vertical; }
.course-search { display: flex; align-items: stretch; gap: 8px; width: 100%; max-width: 26rem; min-width: 0; }
body .course-search input[type="search"] { flex: 1 1 0; width: 0; min-width: 0; margin: 0; }
.course-search button { flex: 0 0 auto; white-space: nowrap; min-height: 44px; margin: 0; }
.header_search { display: flex; align-items: end; gap: 8px; max-width: 480px; }
.header-search-field { flex: 1; min-width: 0; }
.header-search-field label { display: block; color: #111827; font-size: 12px; line-height: 1.2; }
header .header_search input, header.is-dark .header_search input { color: #111827 !important; background: #fff; min-width: 0; }
header .header_search input::placeholder, header.is-dark .header_search input::placeholder { color: #6b7280 !important; }
header .header_search button { min-height: 44px; padding: 8px 12px; background: #1d4ed8; color: #fff; border-radius: 6px; }
.site-brand { font-weight: 700; color: #111827 !important; white-space: nowrap; }
.header_inner .left-side #logo .site-brand { display: flex; align-items: center; gap: 8px; max-width: 260px; white-space: normal; line-height: 1.35; }
.header_inner .left-side #logo .site-brand > span { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.header_inner .left-side #logo img.site-brand-logo { display: block; width: auto; max-width: 80px; height: 32px; object-fit: contain; flex-shrink: 0; }
.header_inner .left-side #logo img.site-brand-logo[hidden] { display: none !important; }
.brand-preview { display: flex; align-items: center; gap: 12px; padding: 16px; background: #f8fafc; overflow-wrap: anywhere; }
.brand-preview img { max-width: 120px; max-height: 48px; object-fit: contain; }
.brand-preview strong { min-width: 0; }
[data-brand-editor] input[type="checkbox"] { appearance: auto; display: inline-block; position: static; opacity: 1; visibility: visible; width: 20px; min-width: 20px; height: 20px; min-height: 20px; margin-right: 8px; vertical-align: middle; }
[data-brand-editor] .checkbox label { padding-left: 0; }
[data-brand-editor] .checkbox label::before, [data-brand-editor] .checkbox label::after { display: none; }
.course-edit-form input[type="checkbox"] { appearance: auto; display: inline-block; position: static; opacity: 1; visibility: visible; width: 20px; min-width: 20px; height: 20px; min-height: 20px; margin-right: 8px; vertical-align: middle; }
.course-edit-form .checkbox label { padding-left: 0; }
.course-edit-form .checkbox label::before, .course-edit-form .checkbox label::after { display: none; }
[data-brand-editor] button.button.light { background: #f1f5f9; color: #1e293b; border: 1px solid #94a3b8; }
.bg-blue-600 .course-access-state { color: #fff; }
@media (max-width: 767px) {
    .header_inner .left-side #logo .site-brand { max-width: 140px; font-size: 14px; }
    .header_inner .left-side #logo img.site-brand-logo { max-width: 40px; height: 28px; }
    header.has-guest-actions .header_inner { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    header.has-guest-actions .header_inner .left-side { flex: 1 1 100%; }
    header.has-guest-actions .header_inner .left-side #logo .site-brand { max-width: 280px; }
    header.has-guest-actions .header_inner .right-side { position: static; flex: 1 1 100%; display: flex; justify-content: flex-end; }
}
.sidebar a[aria-current="page"] { background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.menu-close { display: none; }
.error-recovery { max-width: 680px; margin: 8vh auto; padding: 32px 24px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; }
.error-recovery h1 { font-size: 1.5rem; margin-bottom: 20px; }
.recovery-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.recovery-links a { color: #1d4ed8; text-decoration: underline; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-settings { scroll-margin-top: 24px; }
.report-stat-label { min-height: 3em; font-size: 14px; line-height: 1.5; }
.report-status-tabs a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; border: 1px solid #cbd5e1; background: #fff; color: #1d4ed8; }
.report-status-tabs a.button[aria-current="page"] { border-color: #1d4ed8; background: #1d4ed8; color: #fff; }
.course-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: linear-gradient(135deg, #172554, #155e75); }
.course-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.course-cover-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; color: #fff; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.course-cover img[hidden], [data-cover-row][hidden] { display: none; }
.cover-preview-original { max-width: 100%; max-height: 320px; object-fit: contain; }
#reading-content { overflow-wrap: anywhere; }
#reading-content img { max-width: 100%; height: auto; }
.hero-preview { position: relative; overflow: hidden; background: #111827; color: #fff; border-radius: 6px; }
.hero-preview-desktop { aspect-ratio: 1100 / 450; }
.hero-preview-mobile { width: 390px; max-width: 100%; aspect-ratio: 390 / 450; }
.hero-preview img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.2); }
.hero-preview-copy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px; text-shadow: 0 1px 5px #000; }
.hero-preview-copy strong { font-size: clamp(16px, 2.3vw, 30px); }
.hero-preview-copy span { font-size: 14px; }
@media (max-width: 1200px) {
    body.learning-menu-open { overflow: hidden; }
    .menu-close { display: block; min-height: 44px; padding: 12px 20px; margin-left: auto; }
    .sidebar .sidebar_inner { max-width: calc(100vw - 44px); }
    .sidebar[aria-hidden="true"] { visibility: hidden; }
    header .header_inner .left-side .triger { min-width: 44px; min-height: 44px; background: #fff; color: #111827; }
}
@media (max-width: 767px) {
    header .header_search { display: none; }
    header .left-side #logo { width: auto; margin-right: 8px; }
    .site-brand { font-size: 16px; }
}

/* Reading layout is scoped to lesson pages; other navigation keeps its layout. */
body.lesson-reading { background: #f8fafc; }
#learning-reflection button.button.light, #learning-reflection a.button.light {
    background: #f1f5f9; color: #1e293b; border: 1px solid #94a3b8; box-shadow: none;
}
#learning-reflection button.button.light[value="delete"] { color: #b91c1c; border-color: #b91c1c; }
.course-comparison-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 16px; }
.course-comparison-pair > section { min-width: 0; overflow-wrap: anywhere; }
.course-comparison-pair p { line-height: 1.8; white-space: normal; }
.course-comparison-image { display: block; max-width: 100%; height: auto; object-fit: contain; margin: 12px auto; }
@media (max-width: 767px) { .course-comparison-pair { grid-template-columns: minmax(0, 1fr); } }
.lesson-reading #wrapper { padding: 0; }
.lesson-reading .main_content { margin: 0; padding: 0; }
.lesson-reading .lesson-toolbar {
    position: relative; width: 100%; height: auto; min-height: 64px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
    padding: 8px 24px; background: #fff; border-bottom: 1px solid #cbd5e1;
    box-sizing: border-box; z-index: 20;
}
.lesson-toolbar h1 { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.lesson-toolbar a, .lesson-toolbar summary, .lesson-document-help a, .lesson-document-help summary {
    display: inline-flex; align-items: center; min-height: 44px; color: #1d4ed8; cursor: pointer;
}
.lesson-toolbar summary, .lesson-document-help summary { display: list-item; padding: 10px 4px; }
.lesson-reading .lesson-page { width: auto; max-width: none; margin: 0; padding: 12px 24px 24px; }
.lesson-reading .lesson-body { min-width: 0; }
.lesson-reading #reading-content { width: 100%; margin-top: 0; scroll-margin-top: 12px; }
.lesson-reading #reading-content iframe { display: block; width: 100%; height: calc(100dvh - 160px); min-height: 220px; border: 0; }
.lesson-reading .lesson-text { max-width: 76ch; margin: auto; font-size: 18px; line-height: 1.9; overflow-wrap: anywhere; }
.lesson-reading.lesson-reading-narrow #reading-content { max-width: 1000px; margin-left: auto; margin-right: auto; }
.lesson-document-help { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-bottom: 4px; }
.lesson-reading .lesson-panel {
    position: absolute; top: 100%; right: 12px; width: min(560px, calc(100vw - 24px));
    max-height: 70dvh; overflow: auto; padding: 16px; background: #fff;
    border: 1px solid #64748b; box-shadow: 0 8px 24px #0002; border-radius: 8px;
    z-index: 40; box-sizing: border-box; overflow-wrap: anywhere;
}
.lesson-document-help { position: relative; z-index: 10; }
.lesson-reading .lesson-panel button { min-height: 44px; padding: 8px 12px; border: 1px solid #64748b; border-radius: 4px; }
.lesson-reading nav.lesson-panel > a { display: block; padding: 10px; }
.lesson-reading details > summary:focus-visible, .lesson-reading a:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
@media (max-width: 767px) {
    .lesson-reading .lesson-toolbar { padding: 8px 12px; gap: 4px 12px; }
    .lesson-toolbar h1 { order: -1; flex-basis: 100%; font-size: 17px; }
    .lesson-reading .lesson-page { padding: 8px 12px 20px; }
    .lesson-reading .lesson-text { padding: 16px; font-size: 17px; }
}

/* Admin pages share the learning header and navigation. */
.admin-page-content { min-width: 0; }
.admin-page-heading > div { flex-wrap: wrap; gap: 16px; }
.admin-page-content .overflow-hidden:has(> table) { overflow-x: auto; }
@media (max-width: 767px) {
    .admin-page-content main { padding-left: 16px; padding-right: 16px; }
    .admin-page-heading .flex { flex-wrap: wrap; gap: 8px; }
}

/* Keep account actions at the viewport edge in every header layout. */
header.site-header .header_inner { max-width: 100% !important; padding-right: 24px; }
header.site-header .header_inner .right-side {
    flex: 1 0 auto;
    width: auto;
    max-width: none;
    margin-left: auto;
    padding-right: 0;
    justify-content: flex-end;
}
header.site-header .header-account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

header.site-header .header_widgets .is-icon { color: #334155 !important; }
@media (max-width: 767px) {
    header.site-header .header_inner,
    header.site-header.has-guest-actions .header_inner { padding-right: 16px; }
}

#stripe-settings code { white-space: normal; overflow-wrap: anywhere; word-break: break-all; }

.quality-records { overflow-wrap: anywhere; }
.quality-records section[id] { scroll-margin-top: 90px; }
.quality-check { display: flex; align-items: flex-start; gap: 8px; }
.quality-check input[type="checkbox"] { display: inline-block; appearance: auto; position: static; opacity: 1; visibility: visible; width: 20px; min-width: 20px; height: 20px; flex-shrink: 0; }
