/* Adapted 21st patterns: Configuration Stepper 28551, coss Combobox 11405,
   Reorder List 23550, ShadcnSpace Sheet 25002. See third-party/academai-21st.txt. */
.academai-page #learningApp { max-width: 1240px; margin: 0 auto; padding: 8px 12px 48px; color: var(--ui-fg); }
/* Keep wheel, touch and keyboard scrolling available throughout the test wizard. */
.academai-page #learningApp:has(.ac-wizard), .ac-wizard .ac-source-list { scrollbar-width: none; }
.academai-page #learningApp:has(.ac-wizard)::-webkit-scrollbar, .ac-wizard .ac-source-list::-webkit-scrollbar { display: none; }
.academai-page .app-content { background: var(--ui-muted); }
.ac-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 10px 0 28px; }
.ac-heading h1 { margin: 4px 0 8px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 650; letter-spacing: -.035em; outline: none; }
.ac-heading p:not(.ac-eyebrow), .ac-muted { color: var(--ui-secondary); font-size: 13px; line-height: 1.6; }
.ac-heading p, .ac-section-heading p { margin: 0; }
.ac-eyebrow { font-size: 10px; font-weight: 650; letter-spacing: .14em; color: var(--ui-secondary); margin: 0 0 10px; }
.ac-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; padding: 8px 13px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-bg); color: var(--ui-fg); font: 500 13px/1.4 var(--fusion-font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.ac-btn:hover { background: var(--ui-muted); border-color: var(--ui-secondary); }
.ac-btn.ac-primary { background: var(--fusion-accent); border-color: var(--fusion-accent); color: #fff; }
.ac-btn.ac-primary:hover { background: var(--fusion-accent-hover); }
.ac-btn:disabled { opacity: .5; cursor: wait; }
.ac-panel { background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 1px 2px #0f274406; }
.ac-alert { border: 1px solid var(--ui-line); background: var(--ui-bg); border-radius: 8px; padding: 12px 16px; font-size: 13px; margin: 0 0 18px; }
.ac-error { color: #b42332; }
.theme-dark .ac-error { color: #fda4af; }
.ac-alert.ac-error { border-color: currentColor; }
.ac-search { display: flex; gap: 8px; margin: 0 0 20px; max-width: 440px; }
.ac-search input { flex: 1; min-width: 0; }
.ac-table-wrap { overflow-x: auto; }
.ac-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.ac-table th { padding: 13px 20px; font-weight: 500; color: var(--ui-secondary); background: var(--ui-muted); white-space: nowrap; }
.ac-table td { padding: 19px 20px; border-top: 1px solid var(--ui-line); vertical-align: middle; }
.ac-table tr:hover td { background: color-mix(in srgb, var(--ui-muted) 50%, transparent); }
.ac-table td:last-child { text-align: right; }
.ac-table td.ac-actions { display: table-cell; }
.ac-table td small { display: block; color: var(--ui-secondary); margin-top: 5px; font-size: 11px; }
.ac-text-button { padding: 0; border: 0; background: transparent; font: 550 14px/1.5 var(--fusion-font); color: var(--ui-fg); cursor: pointer; text-align: left; }
.ac-text-button:hover { color: var(--fusion-accent); }
.ac-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--ui-line); border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.ac-badge:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ac-draft, .ac-in_progress { color: #95600a; background: #fff8e9; border-color: #f5e2b9; }
.ac-published, .ac-completed, .ac-submitted { color: #21704a; background: #effaf3; border-color: #c9e8d6; }
.theme-dark .ac-draft, .theme-dark .ac-in_progress { color: #f2cf87; background: #403421; border-color: #5b4830; }
.theme-dark .ac-published, .theme-dark .ac-completed, .theme-dark .ac-submitted { color: #8ee0b7; background: #193c31; border-color: #285543; }
.ac-list-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 12px; }
.ac-list-footer a, .ac-muted a { color: var(--ui-secondary); text-underline-offset: 3px; }
.ac-empty { text-align: center; padding: 70px 24px; border: 1px dashed var(--ui-line); border-radius: 12px; background: var(--ui-bg); margin: 16px 0; }
.ac-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ui-muted); color: var(--ui-secondary); font-size: 25px; }
.ac-empty h2 { font-size: 17px; margin: 20px 0 8px; }
.ac-empty p { color: var(--ui-secondary); font-size: 13px; line-height: 1.6; margin: 0; }
.ac-wizard { overflow: hidden; }
.ac-stepper { display: flex; margin: 0; padding: 24px 30px; list-style: none; border-bottom: 1px solid var(--ui-line); background: color-mix(in srgb, var(--ui-muted) 45%, var(--ui-bg)); }
.ac-stepper li { display: flex; flex: 1; gap: 10px; align-items: center; color: var(--ui-secondary); font-size: 12px; }
.ac-stepper li:after { content: ""; height: 1px; flex: 1; background: var(--ui-line); margin: 0 18px 0 8px; }
.ac-stepper li:last-child { flex: 0; }
.ac-stepper li:last-child:after { display: none; }
.ac-stepper li > span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border: 1px solid var(--ui-line); background: var(--ui-bg); border-radius: 50%; font-weight: 600; }
.ac-stepper li.is-current { color: var(--ui-fg); }
.ac-stepper li.is-current > span, .ac-stepper li.is-done > span { color: #fff; background: var(--fusion-accent); border-color: var(--fusion-accent); }
.ac-step-content { padding: 30px; min-height: 320px; }
.ac-step-content h2 { font-size: 20px; font-weight: 600; margin: 0 0 8px; letter-spacing: -.02em; }
.ac-step-content > .ac-muted { margin-top: 0; }
.ac-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.ac-method { display: flex; align-items: flex-start; gap: 12px; padding: 20px; border: 1px solid var(--ui-line); border-radius: 10px; cursor: pointer; }
.ac-method.is-selected { border-color: var(--fusion-accent); background: color-mix(in srgb, var(--fusion-accent) 4%, var(--ui-bg)); }
.ac-method strong { font-size: 14px; }
.ac-method small, .ac-source small, .ac-employee-options small { display: block; margin-top: 5px; color: var(--ui-secondary); font-size: 12px; }
.ac-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.ac-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ac-field input, .ac-field select, .ac-field textarea, .ac-search input, .ac-combobox > input, .ac-options input[type=text] { box-sizing: border-box; width: 100%; min-height: 40px; border: 1px solid var(--ui-line); border-radius: 7px; color: var(--ui-fg); background: var(--ui-bg); padding: 9px 11px; font: 400 13px/1.5 var(--fusion-font); }
.ac-field textarea { resize: vertical; }
.academai-page :is(button,input,textarea,select,a):focus-visible, .ac-sheet :is(button,input,textarea,select):focus-visible { outline: 2px solid var(--fusion-accent); outline-offset: 3px; }
.academai-page input:is([type=radio],[type=checkbox]), .ac-sheet input:is([type=radio],[type=checkbox]) { accent-color: var(--fusion-accent); width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0 0; }
.ac-source-list { padding: 12px 16px; border: 1px solid var(--ui-line); border-radius: 8px; margin: 0 0 24px; max-height: 300px; overflow: auto; }
.ac-source-list legend { font-size: 12px; padding: 0 5px; color: var(--ui-secondary); }
.ac-source { display: flex; gap: 12px; padding: 10px 0; font-size: 13px; cursor: pointer; overflow-wrap: anywhere; }
.ac-wizard-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 30px; border-top: 1px solid var(--ui-line); }
.ac-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.ac-question-list { list-style: none; margin: 0; padding: 0; }
.ac-question-list li { display: flex; align-items: center; gap: 12px; padding: 16px 12px; border: 1px solid var(--ui-line); border-radius: 9px; margin-bottom: 10px; background: var(--ui-bg); }
.ac-grip { background: transparent; border: none; color: var(--ui-secondary); cursor: grab; font-size: 21px; padding: 5px; }
.ac-question-number { color: var(--ui-secondary); font-size: 12px; }
.ac-question-title { text-align: left; border: 0; background: none; font: 500 14px/1.6 var(--fusion-font); color: var(--ui-fg); flex: 1; min-width: 0; cursor: pointer; }
.ac-question-title small { display: block; font-size: 11px; color: var(--ui-secondary); margin-top: 4px; font-weight: 400; }
.ac-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 28px 0; max-width: 700px; }
.ac-review h3 { font-size: 18px; }
.ac-review > p { font-size: 13px; color: var(--ui-secondary); }
.ac-review-question { padding: 16px 0; border-top: 1px solid var(--ui-line); font-size: 13px; line-height: 1.7; }
.ac-review-question summary { cursor: pointer; font-weight: 500; }
.ac-review-question li { padding: 3px 0; }
.ac-source-refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-source-ref { font-size: 11px; background: var(--ui-muted); color: var(--ui-secondary); padding: 5px 8px; border-radius: 5px; overflow-wrap: anywhere; }
.ac-sheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(540px, 100vw); max-width: 100vw; box-sizing: border-box; padding: 0; border: 0; border-left: 1px solid var(--ui-line); color: var(--ui-fg); background: var(--ui-bg); box-shadow: -16px 0 60px #0002; animation: ac-sheet-enter .18s ease-out; }
.ac-sheet::backdrop { background: #0f172a66; }
.ac-sheet-form { height: 100%; display: flex; flex-direction: column; }
.ac-sheet header { display: flex; align-items: center; justify-content: space-between; padding: 24px; border-bottom: 1px solid var(--ui-line); }
.ac-sheet header h2 { font-size: 20px; margin: 0; }
.ac-sheet-body { padding: 24px; overflow: auto; flex: 1; }
.ac-sheet footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--ui-line); }
.ac-options { border: 0; padding: 0; margin: 0 0 22px; }
.ac-options legend { font-size: 13px; margin-bottom: 12px; }
.ac-options label { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ac-combobox { display: flex; flex-direction: column; gap: 8px; margin: 24px 0; font-size: 13px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ac-chip { border: 1px solid var(--ui-line); background: var(--ui-muted); color: var(--ui-fg); border-radius: 6px; font-size: 11px; padding: 6px 8px; cursor: pointer; }
.ac-employee-options { border: 1px solid var(--ui-line); border-radius: 8px; max-height: 280px; overflow: auto; }
.ac-employee-options:empty { border: 0; }
.ac-employee-options label { display: flex; gap: 12px; padding: 12px; cursor: pointer; }
.ac-employee-options label:hover { background: var(--ui-muted); }
.ac-assignment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ac-assignment { padding: 24px; }
.ac-assignment h2 { font-size: 18px; line-height: 1.5; margin: 20px 0 10px; }
.ac-assignment > p { font-size: 13px; line-height: 1.6; }
.ac-assignment > .ac-btn { margin-top: 12px; }
.ac-exam-layout { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; }
.ac-exam { padding: 32px; }
.ac-exam h2 { font-size: 22px; font-weight: 550; line-height: 1.6; margin: 12px 0 28px; }
.ac-exam .ac-wizard-footer { margin: 30px -32px -32px; }
.ac-exam-options { border: 0; padding: 0; margin: 0; }
.ac-exam-options label { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--ui-line); border-radius: 8px; padding: 17px; margin-bottom: 12px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.ac-exam-options .is-selected { border-color: var(--fusion-accent); background: color-mix(in srgb, var(--fusion-accent) 5%, var(--ui-bg)); }
.ac-exam-nav { padding: 20px; }
.ac-exam-nav h3 { margin: 0; font-size: 15px; }
.ac-exam-nav > p { font-size: 12px; color: var(--ui-secondary); }
.ac-question-dots { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0; }
.ac-question-dots button { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--ui-line); border-radius: 6px; background: var(--ui-bg); color: var(--ui-fg); cursor: pointer; }
.ac-question-dots .is-answered { background: var(--ui-muted); }
.ac-question-dots .is-current { border-color: var(--fusion-accent); color: var(--fusion-accent); }
.ac-timer { padding: 9px 15px; border: 1px solid var(--ui-line); border-radius: 8px; font-variant-numeric: tabular-nums; font-size: 18px; background: var(--ui-bg); }
.ac-score { display: flex; align-items: center; gap: 30px; padding: 32px; }
.ac-score-number { font-size: 50px; font-weight: 600; letter-spacing: -.05em; }
.ac-score h2 { font-size: 21px; margin: 0 0 10px; }
.ac-score p { color: var(--ui-secondary); font-size: 13px; }
.ac-pass { color: #21704a; }
.ac-fail { color: #b42332; }
.theme-dark .ac-pass { color: #8ee0b7; }
.theme-dark .ac-fail { color: #fda4af; }
.ac-review-title { font-size: 18px; margin: 32px 0 18px; }
.ac-result-question { padding: 24px; margin-bottom: 16px; }
.ac-result-question h3 { font-size: 16px; line-height: 1.6; margin: 8px 0 16px; }
.ac-result-question > p { font-size: 13px; line-height: 1.6; }
.ac-result-option { border: 1px solid var(--ui-line); border-radius: 7px; padding: 10px 14px; margin-bottom: 8px; font-size: 13px; }
.ac-result-option.is-correct { border-color: #599e7c; }
.ac-result-option.is-wrong { border-color: #c46773; }
.ac-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes ac-sheet-enter { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 900px) { .ac-exam-layout { grid-template-columns: 1fr; } .ac-exam-nav { order: -1; } .ac-exam-nav > .ac-btn { display: none; } .ac-question-dots { margin: 12px 0; } }
@media (max-width: 640px) {
  .academai-page #learningApp { padding: 0 0 30px; }
  .ac-heading { align-items: flex-start; flex-direction: column; margin-top: 10px; gap: 16px; }
  .ac-heading h1 { font-size: 25px; }
  .ac-stepper { padding: 18px 14px; }
  .ac-stepper li { flex-direction: column; gap: 7px; flex: 1; font-size: 10px; }
  .ac-stepper li:last-child { flex: 1; }
  .ac-stepper li:after { display: none; }
  .ac-step-content { padding: 22px 16px; }
  .ac-methods, .ac-form-grid, .ac-settings { grid-template-columns: 1fr; gap: 10px; }
  .ac-method { padding: 16px; }
  .ac-wizard-footer { padding: 18px 16px; }
  .ac-wizard-footer > .ac-muted { max-width: 130px; font-size: 11px; }
  .ac-section-heading { align-items: flex-start; flex-direction: column; }
  .ac-question-list li { flex-wrap: wrap; gap: 8px; }
  .ac-question-title { flex-basis: 70%; }
  .ac-question-list li > .ac-actions { margin-left: auto; }
  .ac-score { align-items: flex-start; flex-direction: column; gap: 10px; padding: 24px; }
  .ac-exam { padding: 22px; }
  .ac-exam h2 { font-size: 19px; }
  .ac-exam .ac-wizard-footer { margin: 24px -22px -22px; }
  .ac-list-footer { align-items: flex-start; flex-direction: column; }
  .ac-table td, .ac-table th { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .ac-sheet { animation: none; } .ac-btn { transition: none; } }
.ac-workflow-hint { max-width: 740px; margin: 0 0 20px; color: var(--ui-secondary); font-size: 13px; line-height: 1.6; }
@media (max-width: 900px) {
  .academai-page #sidebarMobileDialog #academaiSidebarGroup:not([hidden]) { display: flex !important; flex-direction: column; align-items: stretch; width: 100%; }
}
