/* Separate presentation layer preserves the feature DOM contracts. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Source+Serif+4:wght@500;600;700&display=swap');
:root { --bg:#f7f8f6; --surface:#fff; --surface-strong:#fff; --line:#dfe5e6; --text:#123343; --muted:#617381; --primary:#185663; --primary-strong:#103f49; --accent:#d58b24; --shadow:0 6px 24px #1233430a; }
body { font-family:'IBM Plex Sans',sans-serif; background:radial-gradient(ellipse at top right,#e8f0ed55,transparent 60%),var(--bg); }
h1,h2,h3,h4 { font-family:'Source Serif 4',Georgia,serif; }
button,input,select,textarea { font-family:inherit; }
.workspace-shell { grid-template-columns:240px minmax(0,1fr); }
.sidebar { padding:26px 20px; background:var(--surface); position:sticky; top:0; height:100dvh; overflow-y:auto; border-right:1px solid var(--line); gap:0; justify-content:flex-start; }
.brand-block { order:0; margin-bottom:20px; }
.brand-logo { width:160px; height:82px; max-width:100%; object-fit:contain; }
.brand-block { display:block; }
.brand-block-head { margin-top:8px; min-height:0; }
.translation-shell { display:flex; align-items:center; gap:8px; }
.translation-toggle { transform:scale(.8); transform-origin:left center; }
.translation-label { font-size:12px; color:var(--muted); }
#sidebar-collapse-toggle { display:none; }
.product-nav-secondary { border-top:1px solid var(--line); padding-top:12px; margin-top:28px; display:grid; gap:6px; }
.menu-list { order:1; gap:6px; margin-top:12px; }
.sidebar-panel { order:2; margin-top:24px; border-radius:8px; box-shadow:none; padding:14px; font-size:13px; }
.sidebar-panel .panel-label,.sidebar-panel #user-role-copy,.sidebar-panel #user-id-meta { display:none; }
.sidebar-panel .panel-value { font-size:16px; margin:8px 0; }
.profile-status { font-size:12px; }
.sidebar-profile-avatar { max-width:64px; max-height:64px; }
.menu-item,.product-nav-link { display:flex; align-items:center; gap:12px; min-height:48px; padding:10px 12px; border:0; border-radius:6px; background:transparent; text-align:left; color:var(--text); text-decoration:none; font-weight:500; font-size:16px; }
.product-nav-icon { display:inline-block; width:24px; height:24px; flex:0 0 24px; background:currentColor; mask-size:contain; mask-repeat:no-repeat; mask-position:center; }
.icon-house { mask-image:url('/icons/house.svg'); }
.icon-book { mask-image:url('/icons/book-open.svg'); }
.icon-search { mask-image:url('/icons/magnifying-glass.svg'); }
.icon-forum { mask-image:url('/icons/chat-circle.svg'); }
.icon-ranking { mask-image:url('/icons/chart-bar.svg'); }
.icon-mail { mask-image:url('/icons/envelope.svg'); }
.icon-editor { mask-image:url('/icons/pencil-simple.svg'); }
.icon-settings { mask-image:url('/icons/gear-six.svg'); }
.icon-user { mask-image:url('/icons/user.svg'); }
.icon-help { mask-image:url('/icons/question.svg'); }
.icon-clock { mask-image:url('/icons/clock.svg'); }
.icon-menu { mask-image:url('/icons/list.svg'); }
.menu-item:hover,.product-nav-link:hover { background:#edf3f3; }
.menu-item.is-active,.product-nav-link.is-active { background:var(--primary); color:white; box-shadow:inset 4px 0 var(--accent); }
.main-shell { padding:24px 44px; min-width:0; width:100%; max-width:1540px; margin:0; align-self:start; }
.product-shell .is-hidden { display:none !important; }
.topbar { border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; background:transparent; padding:0 0 16px; margin-bottom:24px; display:flex; align-items:center; gap:16px; }
.topbar-main { flex:1; min-width:0; }
.product-location { color:var(--primary); font-size:15px; font-weight:500; }
.user-menu-trigger { border:1px solid var(--line); border-radius:8px; background:var(--surface); font-size:14px; }
.user-menu-trigger .topbar-name { font-family:inherit; }
.user-menu-dropdown { border-radius:8px; }
.workspace-tabs-strip,.topbar-secondary-menu,.menu-item[data-view="encyclopedia"],#public-chat-dock,.product-legacy-widgets,#premium-view,#encyclopedia-view { display:none !important; }
#product-menu-toggle { display:none; }
.module-card,.question-card,.list-card,.filters-card,.detail-card,.stat-card { border-radius:8px; box-shadow:none; background:var(--surface); border:1px solid var(--line); }
.module-card,.filters-card,.question-card { padding:24px; }
.module-header h3,.filters-header h3 { font-size:28px; line-height:1.2; }
.module-header,.filters-header { margin-bottom:20px; }
.panel-label,.stat-label { letter-spacing:.08em; font-size:11px; font-family:'IBM Plex Sans',sans-serif; color:var(--muted); }
.panel-meta,.stat-meta,.module-summary { color:var(--muted); line-height:1.5; }
.module-summary { border-radius:6px; padding:12px; background:#edf3f3; }
.primary-btn,.start-mode-btn { border-radius:6px; background:var(--primary); color:#fff; border:1px solid var(--primary); box-shadow:none; }
.primary-btn:hover,.start-mode-btn:hover { background:var(--primary-strong); }
.secondary-btn,.meta-chip,.check-pill,.tag-pill { border-radius:6px; }
.secondary-btn { border:1px solid var(--line); background:#f1f5f4; color:var(--text); }
button,a,input,textarea,select,summary { touch-action:manipulation; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.primary-btn:disabled,.secondary-btn:disabled { cursor:not-allowed; opacity:.55; }
.field-block input,.field-block select,.field-block textarea { border-radius:6px; padding:10px 12px; }
.training-module-btn { background:#fff; color:var(--text); border:1px solid var(--line); border-radius:6px; }
.training-module-btn.is-active { background:var(--primary); color:white; border-color:var(--primary); }
.training-module-btn.is-active .training-module-note { color:#e2f1f2; }
.product-shell .training-module-switch { border-radius:10px; padding:4px; gap:4px; background:var(--bg); border:1px solid var(--line); box-shadow:none; }
.product-shell .training-module-switch .training-module-btn { border-radius:6px; margin:0; box-shadow:none; min-width:0; }
.product-shell .training-module-switch .training-module-btn:not(.is-active) { background:var(--surface); color:var(--text); }
.training-setup-block { padding:18px 0; border-bottom:1px solid var(--line); }
.training-core-grid { margin-top:20px; }
.training-toggle-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.session-start-row { justify-content:flex-end; border-top:1px solid var(--line); padding-top:20px; }
#start-standard-btn { min-width:210px; padding:14px 22px; }
.session-start-row .stat-meta { display:none; }
.db-tree-source-panel { border-radius:6px; background:var(--bg); padding:12px; max-height:360px; overflow:auto; }
.database-search-toolbar { gap:14px; }
.question-card { max-width:1050px; margin:0 auto; }
.question-text { line-height:1.65; margin:24px 0; }
.answer-option { border:1px solid var(--line); border-radius:6px; margin-bottom:10px; min-height:56px; padding:12px 16px; transition:border-color .15s; }
.answer-option:not(.is-locked):hover { border-color:var(--primary); background:#eff6f5; }
.answer-option.correct { border-color:#297d62; background:#edf7f0; }
.answer-option.incorrect { border-color:#b45050; background:#fff1ef; }
.answer-letter-pill { border:1px solid var(--line); border-radius:4px; font-family:inherit; }
.answer-stat { color:var(--muted); }
.result-panel { border-radius:6px; padding:18px; }
.stats-grid { gap:12px; }
.stat-card { padding:16px; }
.stat-value { font-family:'Source Serif 4',Georgia,serif; font-size:30px; }
.profile-settings-layout { gap:16px; }
.messages-thread-card,.forum-topic-card,.chat-message { border-radius:6px; }
.rich-editor-dialog { border-radius:12px; }
.rich-editor-toolbar { border-radius:8px; background:#edf3f3; }
.rich-editor-content { border-radius:6px; }
.product-shell .sidebar .google-translate-host { position:static; width:100%; box-sizing:border-box; padding:8px 0; border:0; background:transparent; box-shadow:none; }
.product-shell .sidebar .goog-te-combo { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
.product-section-nav { display:flex; gap:8px; margin-bottom:18px; }
.product-section-nav a { padding:10px 16px; border:1px solid var(--line); border-radius:6px; color:var(--text); text-decoration:none; }
.product-section-nav .is-active { background:var(--primary); color:white; border-color:var(--primary); }
.product-home { padding:28px 0 32px; max-width:1120px; }
.product-eyebrow { color:var(--muted); letter-spacing:.15em; font-size:12px; }
.product-home h1 { font-size:clamp(32px,4vw,60px); line-height:1.12; margin:20px 0 16px; }
.product-home-intro { font-size:21px; color:var(--muted); margin-bottom:32px; }
.product-paths { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.product-paths article { border:1px solid var(--line); background:var(--surface); border-radius:8px; padding:28px; display:flex; flex-direction:column; }
.product-paths h2 { font-size:36px; margin:0; }
.product-paths h3 { font-size:23px; margin:8px 0 18px; }
.product-paths h3::after { content:''; display:block; width:48px; height:3px; background:#d58b24; margin-top:18px; }
.product-paths p { color:var(--muted); line-height:1.6; flex:1; }
.product-paths button { width:100%; padding:14px; }
.product-home-links { display:flex; flex-wrap:wrap; gap:24px; margin-top:24px; }
.product-home-links a { color:var(--primary); }
.product-resume { display:flex; align-items:center; gap:18px; border:1px solid var(--line); border-radius:8px; background:var(--surface); padding:18px 24px; margin-top:28px; }
.product-resume-icon { font-size:32px; color:var(--primary); }
.product-resume h3 { margin:0 0 6px; font-size:20px; }
.product-resume p { margin:0; color:var(--muted); font-size:14px; }
.product-text-action { border:0; background:none; color:var(--primary); font-weight:600; margin-left:auto; white-space:nowrap; padding:12px; }
.product-footer { display:flex; flex-wrap:wrap; gap:24px; padding:24px 0; border-top:1px solid var(--line); font-size:14px; }
.product-footer a { color:var(--muted); text-decoration:none; }
.product-footer a[href='/support'] { color:#b56914; }
.product-footer span { margin-left:auto; color:var(--muted); }
.app-footer { display:flex; gap:18px; padding:12px 0; }
.app-footer button { border:0; background:none; color:var(--muted); font-size:12px; padding:0; }
#challenges-view .start-layout { display:block; }
#challenges-view .start-card { padding:0; border:0; background:transparent; }
#challenges-view .start-hero-card { padding:24px; }
#product-donate-host { margin-top:24px; }
#product-donate-host .donate-preview-card { border:0; padding:0; }
#profile-view .personal-stats-card { margin-top:24px; }
.product-preview-notice { padding:7px 16px; background:#fff0ca; color:#654512; font-size:12px; text-align:center; }
.product-skip-link { position:fixed; top:-80px; left:16px; z-index:200; background:var(--primary); color:white; padding:12px; }
.product-skip-link:focus { top:8px; }
.product-public-reading .view-section { display:none !important; }
.product-public-content .content { white-space:pre-wrap; overflow-wrap:anywhere; }
.product-public-content h1 { font-size:32px; }
.product-public-content li { margin:12px 0; }
.product-public-content a { color:var(--primary); }
@media(prefers-reduced-motion:no-preference) { .product-home { animation:product-reveal .3s ease-out; } @keyframes product-reveal { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } } }
body[data-theme='dark'] { --bg:#11232c; --surface:#19333e; --surface-strong:#19333e; --line:#35515d; --text:#e3edef; --muted:#b0c3ca; --primary:#217080; --primary-strong:#185663; }
body[data-theme='dark'] .sidebar { background:var(--surface); }
body[data-theme='dark'] .training-module-btn { background:var(--surface); color:var(--text); }
body[data-theme='dark'] .training-module-btn.is-active { background:var(--primary); color:#fff; }
@media(max-width:900px) {
  .workspace-shell,.workspace-shell.is-sidebar-collapsed { grid-template-columns:minmax(0,1fr); }
  .sidebar,.workspace-shell.is-sidebar-collapsed .sidebar { display:none; }
  .product-menu-open .sidebar { display:flex; position:fixed; inset:0 auto 0 0; width:min(300px,85vw); z-index:120; box-shadow:0 0 0 100vmax #12334366; }
  .product-menu-open .sidebar .brand-logo,.product-menu-open .sidebar .menu-list,.product-menu-open .sidebar .sidebar-panel { display:initial; }
  .main-shell { padding:16px; }
  #product-menu-toggle { display:block; border:1px solid var(--line); background:var(--surface); border-radius:6px; padding:8px 14px; color:var(--text); }
  .product-paths { grid-template-columns:1fr; gap:16px; }
  .product-paths article { padding:22px; }
  .product-home { padding-top:12px; }
  .product-home-intro { font-size:18px; }
  .filters-grid { grid-template-columns:1fr; }
  .training-toggle-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .module-card,.filters-card,.question-card { padding:18px; }
  .topbar { gap:12px; margin-bottom:16px; }
  .product-location { font-size:13px; }
  .topbar-name { display:none; }
  .user-menu-trigger { padding:6px; }
  .product-resume { flex-wrap:wrap; padding:16px; gap:12px; }
  .product-resume > div { flex:1; }
  .product-text-action { margin-left:38px; padding:0; }
  .product-footer { gap:16px; }
  .product-footer span { display:none; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .list-card-actions,.module-actions { flex-wrap:wrap; }
  .product-home h1 { font-size:38px; }
  .view-section { min-width:0; }
  img,video { max-width:100%; }
}
@media(max-width:480px) {
  .training-toggle-grid { grid-template-columns:1fr; }
  .product-location { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .messages-app-layout,.profile-settings-layout { grid-template-columns:1fr; }
  .product-paths h2 { font-size:32px; }
  .product-paths h3 { font-size:20px; }
  .module-header h3,.filters-header h3 { font-size:24px; }
  .database-browser-toolbar { flex-wrap:wrap; }
  .question-footer,.question-nav,.session-start-row { flex-wrap:wrap; }
}
