:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --accent: #2f6fed;
  --accent-dark: #184ec2;
  --sidebar: #0f172a;
}

/* Course workspace: compact hierarchy, contextual editors and readable media. */
.course-tabs {display:flex;gap:6px;border-bottom:1px solid var(--line);margin:0 0 24px;overflow-x:auto;padding-bottom:8px;}
.course-tabs a {padding:10px 14px;white-space:nowrap;color:var(--muted);border-radius:7px;font-size:.9rem;font-weight:650;}
.course-tabs a[aria-current],.course-tabs a:hover {color:var(--accent);background:var(--surface);}
.course-status {display:flex;gap:12px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:.86rem;margin-bottom:18px;}
.module-workspace {background:var(--surface);border:1px solid var(--line);border-radius:10px;margin-bottom:18px;overflow:visible;}
.module-workspace .module-title {display:flex;align-items:center;gap:14px;padding:18px 20px;border-bottom:1px solid var(--line);}
.module-workspace h3 {font-size:1.05rem;margin:0;}
.module-workspace > .row-actions,.module-actions {padding:14px 20px;}
.module-workspace .lesson-list {padding:0 20px 12px;}
.course-lesson-row,.content-row {display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding:14px 0;min-width:0;}
.lesson-row-copy {min-width:0;flex:1;}
.lesson-row-copy > a {font-weight:650;color:var(--ink);}
.lesson-row-copy small {display:block;color:var(--muted);font-size:.8rem;margin-top:4px;}
.order-tools {display:flex;flex-direction:column;gap:2px;flex-shrink:0;}
.order-tools button {padding:2px 5px;background:transparent;border:0;color:var(--muted);min-height:24px;border-radius:4px;}
.order-tools button:hover {color:var(--accent);background:var(--soft);}
.drag-handle {cursor:grab;}
.is-dragging {opacity:.45;}
.lesson-cover {width:72px;height:46px;object-fit:cover;border-radius:6px;flex-shrink:0;}
.lesson-cover.large {width:180px;height:110px;}
.lesson-format-icon {display:grid;place-items:center;background:var(--soft);color:var(--accent);font-size:1.45rem;}
.row-menu {position:relative;flex-shrink:0;}
.row-menu-actions {position:absolute;right:0;top:100%;z-index:25;min-width:155px;padding:10px;display:grid;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 35px #0002;}
.row-menu-actions .btn {width:100%;text-align:left;}
.row-menu summary {list-style:none;}
.row-menu summary::-webkit-details-marker {display:none;}
.editor-heading {margin-bottom:24px;}
.editor-heading > a {display:inline-block;margin-bottom:12px;font-size:.88rem;}
.editor-heading h2 {font-size:1.65rem;margin:0 0 8px;overflow-wrap:anywhere;}
.editor-heading p {color:var(--muted);}
.editor-panel {max-width:none;}
.editor-options {padding:14px 0;border-top:1px solid var(--line);}
.editor-options summary {font-weight:650;cursor:pointer;min-height:30px;}
.editor-options[open] > .stack-form {margin-top:12px;}
.editor-options[open] > label {margin-top:12px;}
.lesson-editor-grid {display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.2fr);gap:20px;align-items:start;}
.content-type-icon {color:var(--accent);font-size:1.35rem;}
.save-order-status {font-size:.82rem;color:var(--muted);}
.empty-message {padding:18px 0;color:var(--muted);margin:0;}
.learning-layout {display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:24px;align-items:start;}
.learning-layout .lesson-view {max-width:none;min-width:0;}
.lesson-outline {position:sticky;top:100px;background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden;}
.lesson-outline summary {padding:16px;cursor:pointer;font-weight:700;}
.lesson-outline nav {display:grid;max-height:65vh;overflow-y:auto;}
.lesson-outline a {display:flex;gap:10px;align-items:center;padding:12px 16px;border-top:1px solid var(--line);font-size:.88rem;color:var(--muted);overflow-wrap:anywhere;}
.lesson-outline a[aria-current] {color:var(--accent);background:var(--soft);font-weight:700;}
.lesson-hero-cover {width:100%;max-height:320px;object-fit:contain;background:var(--soft);border-radius:8px;margin-bottom:24px;}
.media-figure { min-width:0; margin:0; }
.media-figure > img { display:block; }
.media-caption { display:grid; gap:4px; margin:8px 0 0; color:var(--ink); font-size:.9rem; overflow-wrap:anywhere; }
.media-caption-text { white-space:pre-line; }
.inline-lesson-media { display:inline-flex; flex-direction:column; vertical-align:top; max-width:100%; gap:4px; margin-block:6px; overflow-wrap:anywhere; }
.inline-lesson-media > img { max-width:100%; align-self:flex-start; }
.image-note-dialog { width:min(92vw, 520px); max-height:90dvh; overflow:auto; padding:20px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); }
.image-note-dialog::backdrop { background:#0f172a99; }
.image-note-dialog [hidden] { display:none !important; }
.ql-editor .ql-lesson-media { margin:.75rem 0; }
.ql-lesson-media > button { width:100%; text-align:start; overflow-wrap:anywhere; padding:.65rem .75rem; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:7px; }
.ql-lesson-media > button:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.lesson-content .rich-media-figure { margin:1.25rem 0; display:grid; gap:.55rem; overflow-wrap:anywhere; }
.rich-media-figure > .material-link { justify-self:start; }
.lesson-content .ql-align-center { text-align:center; }
.lesson-content .ql-align-right { text-align:right; }
.lesson-content .ql-align-justify { text-align:justify; }
[data-kind-panel][hidden] { display:none; }
.media-credit { color:var(--muted); font-size:.83rem; }
.cover-card-figure .media-caption { margin:0; padding:6px 14px 0; }
.cover-course-figure { flex:0 1 192px; max-width:100%; }
.cover-lesson-figure { margin-bottom:24px; }
.media-figure .lesson-hero-cover, .media-figure .module-cover { margin-bottom:0; }
.cover-module-figure { margin-bottom:8px; }
.checkout-product .cover-offer-figure { margin-bottom:20px; }
.checkout-product .cover-offer-figure img { margin-bottom:0; }
.checkout-product .cover-offer-figure .media-caption, .checkout-product .cover-offer-figure .media-credit { color:#dbe5f4; }
@media (max-width:900px) { .cover-course-figure { flex-basis:auto; } }
.lesson-blocks {display:grid;gap:28px;}
.lesson-block h3 {font-size:1.15rem;margin-bottom:14px;}
.lesson-block .lesson-content {margin-bottom:0;}
.lesson-image,.lesson-video {display:block;width:100%;max-height:650px;object-fit:contain;border-radius:7px;}
.lesson-video {background:#0b101c;aspect-ratio:16/9;}
.lesson-pdf {width:100%;height:620px;border:1px solid var(--line);border-radius:7px;}
.material-link {display:inline-flex;gap:8px;align-items:center;margin:12px 16px 0 0;font-size:.88rem;font-weight:650;}
.lesson-completion {display:flex;gap:16px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:24px;margin-top:30px;}
.lesson-completion > span {font-size:.82rem;color:var(--muted);}
.lesson-navigation {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;margin-top:28px;padding-top:22px;border-top:1px solid var(--line);}
.lesson-navigation a:last-child {text-align:right;}
.lesson-navigation small {display:block;color:var(--muted);margin-bottom:5px;}
.lesson-navigation strong {font-size:.9rem;overflow-wrap:anywhere;}
.lesson-comments {margin-top:32px;padding-top:26px;border-top:1px solid var(--line);}
.lesson-comments h3 {font-size:1.2rem;}
.lesson-comments .stack-form .btn {justify-self:start;}
.comment-thread,.moderation-list {display:grid;gap:16px;margin-top:24px;}
.comment-card {padding:18px 0;border-top:1px solid var(--line);}
.comment-meta {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.comment-meta small {color:var(--muted);font-size:.8rem;}
.comment-body {white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;margin:12px 0;}
.learner-lesson {display:flex;gap:14px;align-items:center;}
.learner-lesson .lesson-row-copy strong {font-size:.95rem;}
.ql-container {font-family:inherit;font-size:1rem;}
.ql-container.ql-snow {height:auto;}
.ql-editor {min-height:280px;max-height:650px;overflow:auto;}
.ql-editor {min-height:260px;max-height:420px;}
.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before {content:'Parágrafo';}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {content:'Título 1';}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {content:'Título 2';}
.ql-toolbar.ql-snow {border-radius:7px 7px 0 0;border-color:var(--line);background:var(--soft);}
.ql-container.ql-snow {border-radius:0 0 7px 7px;border-color:var(--line);background:var(--surface);color:var(--ink);}
.appearance-colors {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.appearance-colors input[type=color] {width:100%;height:44px;padding:4px;}
.public-logo {width:auto;max-width:120px;max-height:34px;object-fit:contain;margin-right:8px;}
.public-shell .navbar-brand { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; color: var(--ink); }
/* Site controls and consent share the viewport edge without covering each other. */
html { scroll-padding-bottom:var(--site-cookie-offset, 0px); }
body { padding-bottom:var(--site-cookie-offset, 0px); }
[hidden].site-cookie, [hidden].site-float-button, [hidden].site-cookie-settings { display:none; }
.site-footer { border-top:1px solid var(--line); background:var(--surface); padding:18px 20px; }
.site-footer-with-float { padding-inline:70px; }
.site-footer-links { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px 20px; font-size:.9rem; }
.site-footer-links a, .site-cookie-settings { color:var(--accent); text-decoration:underline; text-underline-offset:.18em; }
.site-footer-links a, .site-cookie-settings { display:inline-block; padding:8px 4px; min-height:40px; }
.site-cookie-settings { border:0; background:transparent; font:inherit; cursor:pointer; }
.site-float { position:fixed; z-index:25; bottom:calc(16px + max(var(--site-cookie-offset, 0px), env(safe-area-inset-bottom, 0px))); display:grid; gap:8px; pointer-events:none; }
.site-float-left { left:max(14px, env(safe-area-inset-left, 0px)); }
.site-float-right { right:max(14px, env(safe-area-inset-right, 0px)); }
.site-float-button { width:48px; height:48px; display:grid; place-items:center; border:1px solid var(--line); border-radius:50%; box-shadow:0 2px 12px #0002; background:var(--surface); color:var(--ink); font-size:1.2rem; text-decoration:none; pointer-events:auto; }
.site-float-whatsapp, .site-float-whatsapp:hover { background:#146543; color:#fff; border-color:#146543; }
.site-float-top:hover { background:var(--soft); color:var(--ink); }
.site-cookie { position:fixed; inset:auto 0 0; z-index:35; max-height:65dvh; overflow:auto; border-top:1px solid var(--line); background:var(--surface); color:var(--ink); box-shadow:0 -4px 20px #0002; padding:14px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.site-cookie-inner { max-width:1100px; margin:auto; display:flex; justify-content:space-between; align-items:center; gap:12px 24px; }
.site-cookie h2 { font-size:1rem; margin:0 0 4px; }
.site-cookie p { font-size:.9rem; margin:0; }
.site-cookie p a { color:var(--accent); text-underline-offset:.18em; }
.site-cookie-actions { display:flex; gap:8px; flex-shrink:0; }
.site-consent-button { border:1px solid var(--line); border-radius:7px; min-height:44px; padding:7px 16px; font-weight:650; background:var(--surface); color:var(--ink); }
.site-consent-button:hover { background:var(--soft); }
.sidebar-open :is(.site-float,.site-cookie) { visibility:hidden; }
.help-guide { display:grid; grid-template-columns:minmax(200px, 1fr) minmax(0, 2.6fr); gap:18px; align-items:start; }
.help-index h2, .help-topic h2 { font-size:1.15rem; }
.help-links { margin:0; padding:0; list-style:none; display:grid; gap:8px; }
.help-links a, .help-topic a { text-underline-offset:.18em; }
.help-topics { display:grid; gap:12px; }
.help-topic { scroll-margin-top:16px; }
.help-topic p { margin-bottom:10px; }
.course-classification { display:inline-block; width:fit-content; max-width:100%; margin-block:4px; font-size:.85rem; font-weight:650; color:var(--ink); border:1px solid var(--line); background:var(--surface); border-radius:.45rem; padding:.2rem .5rem; overflow-wrap:anywhere; }
.course-attributes { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
.course-offering { margin-top:14px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); overflow-wrap:anywhere; font-size:.9rem; }
.course-offering-title { font-weight:700; margin-bottom:4px; }
.course-offering a { color:var(--accent); text-decoration:underline; }
.geo-stats li { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; border-top:1px solid var(--line); padding:12px 0; overflow-wrap:anywhere; }
.geo-stats li small { display:block; color:var(--muted); }
.geo-totals { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:.875rem; }
.stats-coverage { color:var(--muted); font-size:.875rem; }
.profile-fields { display:grid; gap:10px; min-width:0; }
.profile-fields .form-text { margin:0; }
.profile-share-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.peer-panel { max-width:none; }
.peer-heading { display:flex; align-items:center; flex-wrap:wrap; gap:14px; min-width:0; margin-bottom:16px; }
.peer-heading h2, .peer-username, .peer-row strong { overflow-wrap:anywhere; }
.peer-username { color:var(--muted); margin:0; }
.peer-bio p { white-space:pre-wrap; overflow-wrap:anywhere; }
.peer-list { display:grid; gap:8px; }
.peer-row { display:flex; gap:12px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:8px; min-height:44px; }
.peer-row > .bi { margin-inline-start:auto; }
@media (max-width:520px) { .profile-share-fields { grid-template-columns:minmax(0,1fr); } }
@media (max-width:900px) { .help-guide { grid-template-columns:minmax(0, 1fr); } }
@media (max-width:640px) {
  .site-cookie-inner { display:grid; }
  .site-cookie-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.btn-primary {
  --bs-btn-color: var(--action-text, #fff);
  --bs-btn-bg: var(--action, #245ac4);
  --bs-btn-border-color: var(--bs-btn-bg);
  --bs-btn-hover-color: var(--bs-btn-color);
  --bs-btn-hover-bg: var(--bs-btn-bg);
  --bs-btn-hover-border-color: var(--bs-btn-border-color);
  --bs-btn-active-color: var(--bs-btn-color);
  --bs-btn-active-bg: var(--bs-btn-bg);
  --bs-btn-active-border-color: var(--bs-btn-border-color);
  --bs-btn-disabled-color: var(--bs-btn-color);
  --bs-btn-disabled-bg: var(--bs-btn-bg);
  --bs-btn-disabled-border-color: var(--bs-btn-border-color);
}
.btn-primary:hover { box-shadow: inset 0 0 0 1px var(--action-text, #fff); }
.sidebar,.sidebar .brand {color:var(--sidebar-text,#fff);}
.brand-mark {background:var(--action,var(--accent));color:var(--action-text,#fff);}
.progress-bar {background:var(--action,var(--accent));}
html[data-theme=dark] {--ink:#e5e7eb;--muted:#a7b1c2;--line:#344054;--surface:#172033;--soft:#101827;color-scheme:dark;}
html[data-theme=dark] body {background:var(--soft);color:var(--ink);}
html[data-theme=dark] .topbar,html[data-theme=dark] .product-card,html[data-theme=dark] .auth-panel,html[data-theme=dark] .checkout-form,html[data-theme=dark] .lesson-view,html[data-theme=dark] .section-node,html[data-theme=dark] .student-row,html[data-theme=dark] .access-item,html[data-theme=dark] .empty-inline {background:var(--surface);color:var(--ink);}
html[data-theme=dark] .form-side,html[data-theme=dark] .module-node,html[data-theme=dark] .student-detail,html[data-theme=dark] .pix-box,html[data-theme=dark] .download-box {background:var(--soft);color:var(--ink);}
html[data-theme=dark] .lesson-content,html[data-theme=dark] label span {color:var(--ink);}
html[data-theme=dark] .auth-page {background:var(--soft);}
html[data-theme=dark] .navbar {background:var(--surface)!important;}
html[data-theme=dark] .ql-snow .ql-stroke {stroke:var(--ink);}
html[data-theme=dark] .ql-snow .ql-fill {fill:var(--ink);}
html[data-theme=dark] .ql-snow .ql-picker {color:var(--ink);}
html[data-theme=dark] .ql-snow .ql-picker-options {background:var(--surface);}
@media(max-width:1200px){.learning-layout{grid-template-columns:minmax(0,1fr)}.lesson-outline{position:static;order:-1}.lesson-outline nav{max-height:230px}}
@media(max-width:900px){.lesson-editor-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:640px){.course-tabs{margin-bottom:20px}.course-lesson-row,.content-row{gap:8px;flex-wrap:wrap}.lesson-cover{width:56px;height:40px}.lesson-row-copy{flex:1 1 110px}.row-menu{margin-left:auto}.lesson-navigation{gap:12px}.lesson-pdf{height:420px}.appearance-colors{grid-template-columns:1fr}.lesson-outline{order:0}.module-workspace .module-title{padding:14px}.module-workspace .lesson-list{padding:0 14px 10px}.module-workspace>.row-actions{padding:12px 14px}.ql-toolbar.ql-snow{padding:8px 4px}}

.list-item small { display: block; color: var(--muted); font-size: .86rem; margin-top: 3px; }
.module-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.course-progress { max-width: none; font-size: .9rem; }

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
a { color: var(--accent); text-decoration: none; }
.btn { border-radius: 8px; font-weight: 700; }
.btn-icon { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); }
.eyebrow { color: var(--accent); display: block; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.flash-wrap { max-width: 1160px; padding-top: 16px; }

.store-hero { min-height: clamp(350px, 45vw, 520px); display: grid; align-items: center; background: radial-gradient(ellipse at 85% 15%, #22374e, transparent 72%), #0f172a; color: #fff; }
.store-hero-inner { max-width: 720px; padding: clamp(44px, 8vw, 80px) 0; }
.store-hero .eyebrow, .checkout-product .eyebrow { color: var(--accent-on-dark, #a5c7ff); }
.store-hero h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); line-height: 1; margin: 14px 0 18px; font-weight: 850; letter-spacing: 0; }
.store-hero p { max-width: 560px; color: rgba(255,255,255,.82); font-size: 1.1rem; }
.section-head, .panel-head, .action-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2, .panel-head h2 { margin: 0; font-size: 1.35rem; font-weight: 850; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product-card { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; transition: transform .16s ease, box-shadow .16s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(15,23,42,.08); }
.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eef2f6; }
.product-card strong { padding: 14px 14px 2px; }
.product-card span { padding: 0 14px 14px; color: var(--muted); }
.empty-inline { border: 1px dashed var(--line); border-radius: 8px; padding: 24px; color: var(--muted); background: #fff; }

.auth-page { min-height: calc(100svh - 57px); display: grid; place-items: center; padding: 36px 16px; background: radial-gradient(circle at top left, #eef4ff, transparent 34%), var(--soft); }
.auth-panel { width: min(100%, 460px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 5vw, 40px); box-shadow: 0 20px 70px rgba(15,23,42,.08); }
.auth-panel.wide { width: min(100%, 960px); }
.auth-panel h1 { font-size:clamp(1.65rem,5vw,2.15rem); line-height:1.14; font-weight: 850; margin: 12px 0 10px; }
.auth-panel p { color: var(--muted); }
.auth-panel .flash-wrap { padding:0; }
.auth-symbol { display:grid; place-items:center; width:2.75rem; height:2.75rem; background:var(--action); color:var(--action-text); border-radius:.75rem; font-size:1.25rem; }
.auth-back { display:block; text-align:center; font-weight:700; padding:.35rem 0; }
.auth-qr { display:block; max-width:100%; height:auto; border:1px solid var(--line); border-radius:7px; background:#fff; }
.auth-qr[hidden] { display:none; }
.auth-factor-status { font-weight:750; }
.auth-recovery { padding:1rem; border:1px solid var(--line); border-radius:8px; background:var(--soft); }
.auth-recovery h3 { font-size:1.15rem; }
.auth-codes { display:grid; gap:.6rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,11rem),1fr)); list-style:none; margin:0; padding:0; }
.auth-codes code { color:var(--ink); overflow-wrap:anywhere; }
.nav-group-label { color:inherit; font-size:.76rem; letter-spacing:.04em; font-weight:750; margin:.9rem .9rem .25rem; }
.stack-form { display: grid; gap: 14px; }
.stack-form label, .product-form label { display: grid; gap: 7px; font-weight: 700; }
.stack-form label span, .product-form label span { color: #344054; font-size: .9rem; }
.form-control, .form-select { border-radius: 8px; border-color: #d0d5dd; min-height: 42px; }

.admin-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; background: var(--sidebar); color: #fff; padding: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 850; margin-bottom: 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); }
.brand-logo { width: 38px; height: 38px; border-radius: 8px; object-fit: contain; background: #fff; }
.sidebar .nav-link { color: var(--sidebar-text, #fff); border-radius: 8px; padding: 11px 12px; border-inline-start: 3px solid transparent; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.admin-main { min-width: 0; }
.topbar { min-height: 76px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 16px 28px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { margin: 0; font-size: 1.3rem; font-weight: 850; }
.workspace { padding: 28px; max-width: 1480px; }

.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.metric { padding: 20px; display: grid; gap: 8px; }
.metric span, td small, .panel-head p, .module-node small { display: block; color: var(--muted); font-size: .88rem; }
.metric strong { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1; }
.finance-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
.finance-metric { color:var(--ink); text-decoration:none; min-width:0; }
.finance-metric:is(:hover,[aria-current=true]) { border-color:var(--accent); }
.finance-metric strong,.finance-table td small { overflow-wrap:anywhere; }
.finance-metric small,.finance-order-facts dt { color:var(--muted); }
.finance-filter { align-items:end; }
.finance-filter label { display:grid; gap:.25rem; }
.finance-order-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap:1rem; }
.finance-order-facts dd { margin-bottom:0; }
@media(max-width:700px){ .metric-row.finance-metrics{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:420px){ .metric-row.finance-metrics{grid-template-columns:1fr} }
.panel { padding: 20px; }
.panel.narrow { max-width: none; }
.panel.compact { padding: 18px; }
.panel.compact h2 { font-size: 1rem; font-weight: 850; margin-bottom: 14px; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.table { margin: 0; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.table td { vertical-align: middle; }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 850; background: #eef2f6; color: #344054; }
.status.paid { background: #e8f7ee; color: #137333; }
.status.pending { background: #fff4df; color: #9a5b00; }
.status.cancelled, .status.refunded { background: #feeceb; color: #b42318; }
.list-stack { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; color: var(--ink); padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.list-item img, .cell-product img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #eef2f6; }
.cell-product { display: flex; align-items: center; gap: 12px; }
.search-shell, .filter-row { display: flex; align-items: center; gap: 10px; }
.search-shell { min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.search-shell input { border: 0; outline: 0; min-height: 42px; width: 100%; }
.filter-row { flex: 1; }

.product-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.form-main, .form-side { display: grid; gap: 16px; }
.form-side { background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.preview-img { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.check-row { display: flex !important; align-items: center; gap: 8px; font-weight: 700; }

.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.builder-forms { display: grid; gap: 18px; }
.course-tree { display: grid; gap: 14px; }
.section-node { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; }
.section-node h3 { font-size: 1.05rem; font-weight: 850; margin-bottom: 12px; }
.module-node { display: grid; gap: 6px; padding: 12px; border-radius: 8px; background: #f9fafb; margin-top: 10px; }
.module-node a { color: var(--ink); display: flex; gap: 8px; align-items: center; padding: 7px 0; }
.node-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.node-head h3 { margin-bottom: 0; }
.node-editor { position: relative; }
.node-editor summary { cursor: pointer; color: var(--accent); font-size: .82rem; font-weight: 850; list-style: none; }
.node-editor summary::-webkit-details-marker { display: none; }
.inline-editor { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.inline-editor.stacked { display: grid; align-items: stretch; }
.mini-input { max-width: 120px; }
.lesson-node { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.lesson-node > a { padding: 4px 0; }

.checkout-page { min-height: calc(100svh - 57px); display: grid; grid-template-columns: minmax(0, 1fr) 440px; }
.checkout-product { min-width: 0; overflow-wrap: anywhere; padding: clamp(30px, 8vw, 90px); background: #0f172a; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.checkout-product img { width: min(100%, 240px); aspect-ratio: 16 / 9; object-fit: contain; border-radius: 8px; margin-bottom: 20px; }
.checkout-product h1 { font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1; font-weight: 850; margin: 10px 0 16px; }
.checkout-product p { color: rgba(255,255,255,.75); max-width: 640px; }
.checkout-product strong { font-size: 2rem; }
.checkout-product .course-fact { margin: 8px 0 0; }
.checkout-form { padding: clamp(24px, 5vw, 46px); background: #fff; display: flex; flex-direction: column; justify-content: center; gap: 15px; }
.checkout-form h2 { font-size: 1.25rem; font-weight: 850; }
.checkout-form label { display: grid; gap: 7px; font-weight: 700; }
.pix-box { border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 8px; background: #f9fafb; }
.pix-box code { white-space: normal; color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.pix-box [data-copy-pix] { justify-self: start; }
.compact-checkout { grid-template-columns: minmax(0, 1fr) 520px; }

.course-head { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.course-head img { width: min(100%, 192px); aspect-ratio: 16 / 9; border-radius: 8px; object-fit: contain; background: var(--soft); }
.lesson-view { max-width: 980px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: clamp(20px, 4vw, 42px); }
.lesson-top { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); margin-bottom: 18px; }
.lesson-view h2 { font-weight: 850; margin-bottom: 22px; }
.video-shell, .download-box { margin-bottom: 24px; }
.download-box { border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; gap: 10px; align-items: center; color: var(--ink); background: #f9fafb; }
.lesson-content { color: #344054; line-height: 1.75; margin-bottom: 26px; }
.student-list { display: grid; gap: 10px; }
.student-row { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.student-row summary { cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px; list-style: none; }
.student-row summary::-webkit-details-marker { display: none; }
.student-row small, .access-item small { display: block; color: var(--muted); }
.access-count { color: var(--muted); font-weight: 800; font-size: .86rem; }
.student-detail { border-top: 1px solid var(--line); padding: 14px; display: grid; gap: 14px; background: #f9fafb; }
.access-list { display: grid; gap: 8px; }
.access-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.brand-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.brand-preview { width: 150px; max-height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.favicon-preview { width: 46px; height: 46px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.settings-subtitle { font-size: 1.1rem; font-weight: 850; margin: 6px 0; }
.settings-help { color: var(--muted); margin-bottom: 14px; }
.permalink-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.email-test-form { max-width: none; }
.email-error { max-width: 360px; color: var(--muted); font-size: .88rem; white-space: normal; }
.migration-list { display: grid; gap: 8px; }
.migration-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.migration-item small { display: block; color: var(--muted); }

@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 280px; visibility: hidden; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 30; }
  body.sidebar-open .sidebar { visibility: visible; transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .split-grid, .builder-layout, .product-form, .checkout-page { grid-template-columns: 1fr; }
  .checkout-page { align-content: start; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .workspace, .topbar { padding: 16px; }
  .topbar { align-items: flex-start; }
  .metric-row { grid-template-columns: 1fr; }
  .action-bar, .section-head, .panel-head, .filter-row { align-items: stretch; flex-direction: column; }
  .checkout-product { padding: 30px 20px; }
  .checkout-form { padding: 24px 20px; }
  .course-head { align-items: flex-start; flex-direction: column; }
  .brand-upload-row, .permalink-grid { grid-template-columns: 1fr; }
  .migration-item { grid-template-columns: 1fr; }
  .student-row summary, .access-item { grid-template-columns: 1fr; display: grid; }
}

/* Layout refinements and accessible interaction states. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2f6fed; outline-offset: 3px; }
.skip-link { position: fixed; top: 12px; left: 16px; padding: 12px 18px; z-index: 100; background: white; border: 2px solid var(--accent); border-radius: 8px; clip-path: inset(50%); }
.skip-link:focus { clip-path: none; }
.sidebar-toggle { display: none; }
.sidebar { overflow-y: auto; }
.brand > span:last-child { overflow-wrap: anywhere; }
.sidebar-backdrop { display: none; }
.workspace { margin-inline: auto; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-actions form { margin: 0; }
.panel-head p { margin: 6px 0 0; }
.filter-row { flex-wrap: wrap; align-items: end; }
.filter-row > .form-control { flex: 2 1 200px; width: auto; }
.filter-row > .form-select { flex: 1 1 170px; width: auto; }
.filter-row > label { flex: 1 1 140px; color: var(--muted); font-size: .85rem; }
.course-head, .course-tree, .course-head > div, .node-head > *, .inline-editor > *, .stack-form, .form-main, .form-side { min-width: 0; }
.course-head { margin-bottom: 24px; }
.course-head h2 { margin: 0 0 8px; }
.course-head p { color: var(--muted); margin: 0; }
.course-fact { overflow-wrap: anywhere; }
.course-head .course-fact { margin-top: 6px; }
.lesson-facts { color: var(--muted); margin-bottom: 18px; }
.lesson-facts p { margin: 5px 0; }
.product-form-actions { grid-column: 1 / -1; }
.product-card .course-card-placeholder { display: grid; min-height: 140px; place-items: center; background: var(--soft); color: var(--muted); border-radius: 8px; font-size: 2rem; }
.course-certificate { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.course-certificate h3 { font-size: 1.1rem; }
.course-certificate p { margin: 0; }
.certificate-page { width: min(calc(100% - 32px), 900px); margin: 32px auto; text-align: center; }
.certificate-sheet { padding: clamp(24px, 6vw, 72px); background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.certificate-icon { display: block; color: var(--accent); font-size: 2.5rem; margin-bottom: 12px; }
.certificate-sheet h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); }
.certificate-sheet p { margin: 10px 0; }
.certificate-student { font-size: clamp(1.5rem, 5vw, 2.25rem); font-weight: 800; }
.certificate-course { font-size: 1.25rem; font-weight: 700; }
.certificate-details { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin: 24px 0; }
.certificate-details div { max-width: 100%; }
.certificate-verification { display: grid; gap: 6px; justify-items: center; }
.certificate-verification code { color: var(--ink); background: var(--soft); border-radius: 4px; padding: 3px 8px; font-weight: 700; }
.certificate-print { margin-top: 16px; }
.dashboard-actions, .resume-panel { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.resume-panel { justify-content: space-between; }
.resume-panel h2 { font-size: 1.25rem; }
.resume-panel p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.pwa-icon-preview { border: 1px solid var(--line); border-radius: 12px; object-fit: contain; }
.publication-checks li { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; gap:.45rem 1rem; padding:.8rem 0; border-top:1px solid var(--line); }
.publication-check-detail { flex:1 1 250px; min-width:0; }
.publication-check-detail .status { margin-inline-start:.4rem; }
.publication-check-detail p { color:var(--muted); margin:.3rem 0 0; }
:is(#pre-publicacao,#url-base,#migracoes,#backups,#pagamentos,#smtp,#teste-email) { scroll-margin-top:110px; }
.diagnostic-list { margin: 0; }
.diagnostic-list > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; }
.diagnostic-list > div + div { border-top: 1px solid var(--line); }
.diagnostic-list dd { margin: 0; color: var(--muted); }
.diagnostic-list small { display: block; color: var(--muted); font-weight: 400; }
#historico { scroll-margin-top: 95px; }
#sessoes { scroll-margin-top: 125px; }
.account-session-list { margin: 0; }
.account-session-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; }
.account-session-list li + li { border-top: 1px solid var(--line); }
.account-session-list small { display: block; color: var(--muted); }
@media(max-width:480px) { #historico { scroll-margin-top: 125px; } }
.history-ip-label { display: none; }
@media (max-width: 640px) {
  .table-responsive .table.account-history-table, .account-history-table tbody { display: block; min-width: 0; }
  .account-history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .account-history-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px 0; gap: 4px 10px; border-bottom: 1px solid var(--line); }
  .account-history-table tbody td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .account-history-table tbody td[colspan] { grid-column: 1 / -1; }
  .account-history-table .history-event { grid-area: 1 / 1; font-weight: 700; }
  .history-time, .history-actor, .history-ip { font-size: .8rem; }
  .history-time, .history-ip { text-align: right; }
  .history-ip-label { display: inline; }
}
.offline-page { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.offline-page main { width: min(100%, 460px); }
.offline-page h1 { font-size: 2rem; }
.offline-page .btn { display: inline-block; padding: 12px 18px; border-radius: 8px; background: #245ac4; color: #fff; font-weight: 700; }
@media print {
  body:has(.certificate-sheet) .navbar, body:has(.certificate-sheet) .skip-link, .certificate-print { display: none !important; }
  .certificate-page { width: 100%; margin: 0 auto; }
  .certificate-sheet { color: #000; background: #fff; border-color: #333; }
  .certificate-verification code { color: #000; background: #fff; }
}
.lesson-content img { max-width: 100%; height: auto; }
.lesson-content pre { overflow: auto; padding: 16px; background: var(--soft); }
.panel, .metric, .student-row, .product-card { overflow-wrap: anywhere; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.inline-editor { flex-wrap: wrap; }
.inline-editor > label, .inline-editor > .form-control { flex: 1 1 160px; }
.node-editor[open] { padding-top: 10px; }
.node-editor summary { padding-block: 10px; min-height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #2f6fed20; }
.btn, .sidebar .nav-link { transition: background-color .16s ease, border-color .16s ease; }
.topbar-actions .dropdown-toggle { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.install-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; padding: 0; list-style: none; }
.install-checks li { font-size: .8rem; padding: 6px 10px; border-radius: 6px; background: #eef2f6; }
.install-checks li.ok { color: #137333; background: #e8f7ee; }
.install-checks li.fail { color: #b42318; background: #feeceb; }
.install-step { display: block; width: 100%; margin: 12px 0 0; font-size: .82rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.course-tree.learner .module-node a { border-top: 1px solid var(--line); min-height: 44px; }
@media (max-width: 1100px) {
  .sidebar-toggle { display: inline-grid; flex-shrink: 0; }
  body.sidebar-open { overflow: hidden; }
  .sidebar { width: min(280px, 85vw); }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; align-items: center; gap: 10px; }
  .topbar h1 { font-size: 1.1rem; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px !important; }
  .topbar-actions .dropdown-toggle { max-width: 140px; }
  .panel { padding: 16px; }
  .panel-head { gap: 12px; }
  .filter-row > .form-control, .filter-row > .form-select, .filter-row > label { width: 100%; flex-basis: auto; }
  .search-shell { min-width: 0; }
  .lesson-top { flex-direction: column; }
  .inline-editor { align-items: stretch; flex-direction: column; }
  .inline-editor > label, .inline-editor > .form-control { flex-basis: auto; }
  .course-head { flex-direction: column; align-items: flex-start; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 16px; }
  .metric strong { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.table-responsive .table { min-width: 680px; }
.table th, .table td { overflow-wrap: normal; word-break: normal; }
.table th, .table .btn, .status { white-space: nowrap; }
.table-responsive { overscroll-behavior-x: contain; }
@media(max-width:700px){
  .table-responsive .table.finance-table,.finance-table tbody { display:block; min-width:0; }
  .finance-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .finance-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem .75rem; padding:.8rem 0; border-bottom:1px solid var(--line); }
  .finance-table tbody td { min-width:0; padding:0; border:0; overflow-wrap:anywhere; }
  .finance-table :is(.finance-product,.finance-buyer,.finance-actions) { grid-column:1 / -1; }
  .finance-table .finance-product { font-weight:700; }
  .finance-actions a { display:inline-flex; align-items:center; min-height:2.5rem; }
}
@media (max-width: 767px) {
  .table-responsive .table.product-list-table, .product-list-table tbody { display:block; min-width:0; }
  .product-list-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .product-list-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:12px 0; border-bottom:1px solid var(--line); }
  .product-list-table td { padding:0; border:0; background:transparent; }
  .product-list-table :is(.product-list-name,.product-list-actions,[colspan]) { grid-column:1 / -1; min-width:0; }
  .product-list-name span { overflow-wrap:anywhere; }
  .product-list-actions .row-actions { flex-wrap:wrap; }
}
.empty-state { min-height: calc(100svh - 57px); display: grid; place-items: center; padding: 40px 20px; }
.empty-state > div { max-width: 540px; }

.split-grid > *, .builder-layout > *, .product-form > *, .checkout-page > * { min-width: 0; }
@media (max-width:1100px) { .split-grid, .builder-layout, .product-form, .checkout-page { grid-template-columns: minmax(0, 1fr); } }

.course-module {background:var(--surface);border:1px solid var(--line);border-radius:10px;margin-bottom:18px;min-width:0;}
.module-heading {display:flex;gap:14px;align-items:center;padding:18px 20px;border-bottom:1px solid var(--line);}
.module-heading h3 {font-size:1.1rem;margin:0 0 5px;}
.module-heading-copy {flex:1;min-width:0;overflow-wrap:anywhere;}
.module-heading-copy>span {font-size:.82rem;color:var(--muted);}
.course-module .lesson-list {padding:0 20px 12px;}
.group-heading {font-size:1rem;color:var(--muted);margin:24px 0 12px;}
.outline-module {font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;padding:16px 16px 8px;color:var(--muted);}
.lesson-block iframe.pdf-viewer,.pdf-shell iframe {width:100%;height:600px;border:1px solid var(--line);border-radius:7px;}
.appearance-colors {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.appearance-colors input[type=color] {width:100%;height:44px;}
.btn-outline-primary {color:var(--accent);border-color:var(--accent);}
.btn-outline-primary:hover {color:var(--action-text);background:var(--action);border-color:var(--action);}
html[data-theme=dark] {--ink:#eef2f7;--muted:#a6b2c6;--surface:#172033;--soft:#101827;--line:#344158;color-scheme:dark;}
html[data-theme=dark] .topbar,html[data-theme=dark] .navbar,html[data-theme=dark] .auth-panel,html[data-theme=dark] .checkout-form,html[data-theme=dark] .panel,html[data-theme=dark] .product-card,html[data-theme=dark] .empty-inline,html[data-theme=dark] .section-node,html[data-theme=dark] .lesson-view,html[data-theme=dark] .student-row,html[data-theme=dark] .access-item,html[data-theme=dark] .migration-item {background:var(--surface)!important;color:var(--ink);}
html[data-theme=dark] .auth-page {background:var(--soft);}
html[data-theme=dark] .module-node,html[data-theme=dark] .form-side,html[data-theme=dark] .student-detail,html[data-theme=dark] .pix-box,html[data-theme=dark] .download-box {background:var(--soft);color:var(--ink);}
html[data-theme=dark] .form-control,html[data-theme=dark] .form-select {background:var(--soft);color:var(--ink);border-color:var(--line);}
html[data-theme=dark] .table {
  --bs-table-color: var(--ink);
  --bs-table-bg: var(--surface);
  --bs-table-border-color: var(--line);
  --bs-table-striped-color: var(--ink);
  --bs-table-striped-bg: var(--soft);
  --bs-table-hover-color: var(--ink);
  --bs-table-hover-bg: #25324a;
}
html[data-theme=dark] .dropdown-menu {
  --bs-dropdown-color: var(--ink);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-color: var(--ink);
  --bs-dropdown-link-hover-bg: #25324a;
}
html[data-theme=dark] .lesson-content,html[data-theme=dark] label span,html[data-theme=dark] .stack-form label span {color:var(--ink);}
html[data-theme=dark] .ql-snow .ql-stroke {stroke:var(--ink);}
html[data-theme=dark] .ql-snow .ql-fill {fill:var(--ink);}
html[data-theme=dark] .ql-snow .ql-picker {color:var(--ink);}
html[data-theme=dark] .ql-snow .ql-picker-options,html[data-theme=dark] .ql-snow .ql-tooltip {background:var(--surface);color:var(--ink);border-color:var(--line);}
html[data-theme=dark] .btn-outline-secondary {color:#cbd5e1;border-color:#8794a8;}
html[data-theme=dark] .btn-outline-secondary:is(:hover, :focus-visible) {color:#eef2f7;background:#344158;border-color:#8794a8;}
html[data-theme=dark] .btn-outline-danger {color:#ff8c9a;border-color:#ff8c9a;}
html[data-theme=dark] .btn-outline-danger:is(:hover, :focus-visible) {color:#ffd7dc;background:#462633;border-color:#ff8c9a;}
html[data-theme=dark] .btn-outline-dark {color:#eef2f7;border-color:#a6b2c6;}
html[data-theme=dark] .text-muted, html[data-theme=dark] .form-text, html[data-theme=dark] .form-control::placeholder {color:var(--muted)!important;opacity:1;}
.sidebar .nav-link.active,.sidebar .nav-link:hover {
  background:var(--sidebar);
  color:var(--sidebar-text,#fff);
}
.sidebar .nav-link.active { border-inline-start-color: currentColor; }
.sidebar .nav-link:hover { text-decoration: underline; }
.brand-mark {background:var(--action);color:var(--action-text);}
:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sidebar :focus-visible { outline-color: var(--sidebar-text, #fff); }
.store-hero :focus-visible, .checkout-product :focus-visible { outline-color: var(--accent-on-dark, #a5c7ff); }
.btn > .bi, .dropdown-item > .bi { margin-inline-end: .2em; }
.btn[aria-label] > .bi:only-child { margin-inline-end: 0; }
@media(max-width:640px){.module-heading{padding:14px;flex-wrap:wrap}.course-module .lesson-list{padding:0 14px 10px}.lesson-block iframe.pdf-viewer,.pdf-shell iframe{height:400px}.appearance-colors{grid-template-columns:1fr}.course-tabs a{padding:9px 11px}.lesson-outline details:not([open]){display:block}}

.course-tabs a[aria-current] {box-shadow:inset 0 -3px var(--highlight);}
.lesson-outline details > summary {min-height:48px;}
@media(max-width:900px){.lesson-outline{order:-1}}
.form-control:focus,.form-select:focus {box-shadow:0 0 0 3px color-mix(in srgb,var(--highlight) 50%,transparent);}
.topbar > div:not(.topbar-actions) {min-width:0;flex:1;}
.topbar h1 {overflow-wrap:anywhere;max-width:100%;}
@media(max-width:640px){.ql-editor{min-height:230px;max-height:360px}.topbar-actions{flex-shrink:0}}
.audit-details { max-width: 32rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.summary-section { margin-bottom:24px; }
.summary-section h2 { font-size:1.05rem; margin-bottom:12px; }
.summary-section .section-head { margin-bottom:12px; gap:12px; }
.summary-section .section-head h2 { margin:0; }
.summary-section small { color:var(--muted); }
.summary-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); border-block:1px solid var(--line); }
.summary-strip > :is(div,a) { padding:16px 12px; min-width:0; }
.summary-strip > a { color:var(--ink); text-decoration:none; }
.summary-strip > a span { text-decoration:underline; text-underline-offset:.2em; }
.summary-strip > a:hover { background:var(--surface); }
.summary-strip span { display:block; color:var(--muted); font-size:.82rem; }
.summary-strip strong { display:block; font-size:1.8rem; font-weight:750; margin-top:6px; }
.teacher-summary [aria-current=true] { background:var(--surface); box-shadow:inset 0 -3px var(--accent); }
.teacher-list { display:grid; gap:.65rem; }
.teacher-row { display:flex; align-items:center; gap:.8rem; padding:.75rem; border:1px solid var(--line); border-radius:8px; flex-wrap:wrap; }
.teacher-row-copy { flex:1 1 130px; min-width:0; overflow-wrap:anywhere; }
.teacher-row-copy small,.teacher-course-link small { display:block; color:var(--muted); }
.teacher-sidebar { align-items:start; }
.teacher-course-link + .teacher-course-link { margin-top:.75rem; }
.teacher-course-link,.teacher-public { overflow-wrap:anywhere; }
.teacher-public h3 { font-size:1.1rem; }
.teacher-bio { white-space:pre-wrap; }
.teacher-contact { display:grid; gap:.5rem 1rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr)); }
.teacher-picker-choices { display:grid; gap:.55rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); }
.teacher-picker-choices :is(label,span) { min-width:0; overflow-wrap:anywhere; }
[data-teacher-search-controls][hidden] { display:none; }
[data-teacher-search-controls] { align-items:end; }
.media-list { margin:0; }
.media-list-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.media-list-row > .bi { font-size:1.3rem; color:var(--muted); }
.media-list-label, .media-name, .media-usage li { overflow-wrap:anywhere; }
.media-list-label small, .media-usage li > :is(span,small) { display:block; color:var(--muted); }
.media-preview { display:block; max-width:100%; max-height:350px; object-fit:contain; border-radius:8px; }
.media-usage li { padding:10px 0; border-bottom:1px solid var(--line); }
@media (max-width:640px) {
  .media-list-row { grid-template-columns:auto minmax(0,1fr); }
  .media-list-row > .btn { grid-column:2; justify-self:start; }
}
.profile-avatar { width:42px; height:42px; flex:0 0 auto; border-radius:50%; object-fit:cover; display:inline-flex; align-items:center; justify-content:center; background:var(--line); color:var(--ink); font-weight:700; }
.profile-avatar.large { width:88px; height:88px; font-size:2rem; }
.profile-avatar.mini { width:22px; height:22px; vertical-align:middle; margin-right:6px; }
.profile-photo-row { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.profile-photo-row > div { flex:1 1 200px; min-width:0; }
@media(max-width:640px){.profile-photo-row > div{flex-basis:100%}}
.student-summary { display:flex; align-items:center; gap:12px; padding:18px 0; border-bottom:1px solid var(--line); }
.student-summary-copy { min-width:0; flex:1; overflow-wrap:anywhere; }
.student-summary-copy small,.account-access small { display:block; color:var(--muted); }
.account-access { padding:12px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.account-access .row-actions { margin-top:8px; }
.protected-text { -webkit-user-select:none; user-select:none; }
.embed-player { background:#101827; border-radius:12px; overflow:hidden; }
.video-start { border:0; background:#101827; color:#fff; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:12px; cursor:pointer; }
.video-start i { font-size:3rem; transition:transform .15s ease; }
.video-start:hover i { transform:scale(1.08); }
.embed-player iframe { border:0; }
@media(max-width:640px){.student-summary{flex-wrap:wrap}.student-summary-copy{flex-basis:calc(100% - 60px)}.summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.summary-section .section-head{align-items:flex-start}.profile-photo-row{align-items:flex-start}}
@media(prefers-reduced-motion:reduce){.video-start i{transition:none}}
@media(max-width:480px){.topbar{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:12px}.topbar-actions{grid-column:1 / -1;justify-self:end;max-width:100%;flex-wrap:wrap;justify-content:flex-end}}

/* Keep the panel content on one reading surface, including headings outside cards. */
.admin-main {
  --gutter: clamp(12px, 1.7vw, 28px);
}
.workspace {
  width: calc(100% - 2 * var(--gutter));
  max-width: none;
  min-width: 0;
  margin: var(--gutter) auto;
  padding: clamp(14px, 2vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.workspace :is(.panel, .split-grid > *, .help-guide > *, .lesson-editor-grid > *) { min-width: 0; }
.workspace > .panel:only-child { border: 0; padding: 0; }
.workspace .summary-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 1px;
  background: var(--surface);
  overflow: hidden;
}
.summary-strip > :is(a, div) { background: var(--surface); }
.workspace .summary-strip a:hover { background: var(--soft); }
.workspace .summary-strip a:focus-visible { outline-offset: -3px; }
.course-tabs { flex-wrap: wrap; }
.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin-top: 24px;
}
.catalog-member-link, .auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
}
.catalog-member-link { color: #fff; text-decoration: underline; text-underline-offset: .22em; }
.catalog-member-link:hover { color: var(--accent-on-dark); }
#catalogo .product-card { display: flex; flex-direction: column; }
#catalogo .product-card img, #catalogo .course-card-placeholder { aspect-ratio: 16 / 9; }
#catalogo .course-card-placeholder { padding: 0; min-height: 0; border-radius: 0; }
.catalog-card-body { display: grid; gap: 6px; padding: 16px; }
.catalog-card-body small { color: var(--muted); font-weight: 650; }
.catalog-card-body strong { font-size: 1.14rem; line-height: 1.3; padding: 0; }
.catalog-card-body .course-classification { padding: .2rem .5rem; }
.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--accent);
}
#catalogo .empty-inline { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .workspace { width: 100%; margin: 0; border: 0; border-radius: 0; }
  .workspace .filter-row { align-items: stretch; }
  .workspace .row-actions .btn, .topbar-actions .btn { min-height: 40px; }
  .public-shell .navbar > .container { flex-wrap: wrap; gap: 8px; }
  .public-shell .navbar-brand { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}
.appearance-fields > legend { float: none; }
#experiencia-do-site .appearance-fields { display: grid; gap: 10px; min-width: 0; }
#experiencia-do-site .check-row { min-height: 44px; cursor: pointer; }

/* Consistent navigation and personal appearance controls. */
.theme-choice { display:inline-flex; align-items:center; gap:6px; margin:0; color:var(--muted); min-width:0; }
.theme-choice .form-select { min-height:38px; width:138px; font-size:.85rem; background-color:var(--surface); color:var(--ink); }
.workspace-trail { margin-bottom:22px; font-size:.86rem; color:var(--muted); }
.workspace-trail ol { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:0; margin:0; list-style:none; }
.workspace-trail li { display:inline-flex; align-items:center; gap:10px; min-width:0; overflow-wrap:anywhere; }
.workspace-trail li:last-child { display:block; }
.workspace-trail a { color:var(--accent); text-underline-offset:.2em; }
.workspace-trail .bi { font-size:.65rem; flex-shrink:0; }
.settings-workspace { max-width:none; }
.settings-jump { border-bottom:1px solid var(--line); padding-bottom:16px; gap:8px; }
.settings-jump a { display:inline-flex; align-items:center; min-height:40px; padding:7px 10px; border-radius:6px; color:var(--accent); background:var(--soft); }
.settings-jump a:hover { text-decoration:underline; }
.settings-workspace :is(fieldset,details), .help-topic { scroll-margin-top:150px; }
.settings-workspace .appearance-fields { margin-block:10px; }
html[data-theme=dark] .theme-choice .form-select { background-color:var(--soft); }
html[data-theme=dark] .summary-strip > :is(a,div) { background:var(--surface); }
@media (max-width:640px) {
  .theme-choice .form-select { width:126px; min-height:40px; }
  .workspace-trail { margin-bottom:16px; }
  .public-shell .navbar > .container > .ms-auto { flex-wrap:wrap; justify-content:flex-end; }
  .settings-workspace :is(fieldset,details), .help-topic { scroll-margin-top:190px; }
}

@media (max-width:640px) {
  .topbar-actions .theme-choice > .bi { display:none; }
  .topbar-actions .theme-choice .form-select { width:112px; }
  .topbar-actions .dropdown-toggle { max-width:120px; }
}

/* Every standalone workspace panel follows the available content width. */
.workspace > .panel { width:100%; min-width:0; }
.workspace > .flash-wrap { max-width:none; padding-inline:0; }

.product-card-type { padding:12px 14px 0; color:var(--muted); font-size:.8rem; }
.product-card-type + strong { padding-top:6px; }
