/* Exams: one reading direction, quiet surfaces, motion only on entry. */
#examsView { --exam-enter: 320ms; }
#examsView .exam-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
#examsView .exam-tabs { display: flex; gap: 6px; width: fit-content; max-width: 100%; padding: 6px; border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-primary-soft); }
#examsView .exam-tabs button { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 48px; padding: 12px 18px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--color-text-muted); box-shadow: none; font-size: 14px; line-height: 1.4; text-align: left; transform: none; }
#examsView .exam-tabs button:hover, #examsView .exam-tabs button[aria-selected="true"] { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-border); }
#examsView .exam-tabs button[aria-selected="true"] { box-shadow: var(--shadow-sm); }
#examsView .exam-sections > [hidden] { display: none; }
#examsView :is(.exam-tabs button, .exam-sections > section):focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }
@media (max-width: 640px) {
  #examsView .exam-tabs { width: 100%; }
  #examsView .exam-tabs button { flex: 1 1 0; padding: 10px 8px; gap: 8px; font-size: 12px; }
}
#examsView .loop-card-head { flex-wrap: wrap; }
#examsView .exam-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
@media (max-width: 640px) { #examsView .exam-header-actions { width: 100%; margin-left: 0; } }
#examsView .dashboard-head { margin-bottom: 16px; }
#examsView .dashboard-intro { margin-bottom: 0; }
#examsView .exam-icon { width: 20px; height: 20px; flex: 0 0 auto; }
#examsView .dashboard-head { align-items: center; gap: 20px; }
#examsView .exam-create-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; flex-shrink: 0; }
#examsView .exam-heading-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 26px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--color-primary-soft); color: var(--color-primary); font-size: .75rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
#examsView .exam-heading-count:empty { display: none; }
body.exam-create-open { overflow: hidden; }
#examsView .exam-create-dialog { width: min(720px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
#examsView .exam-create-dialog::backdrop { background: rgb(20 15 35 / .55); }
#examsView .exam-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--color-border); }
#examsView .exam-dialog-head h2 { margin: 8px 0; font-size: 1.5rem; }
#examsView .exam-dialog-head p { margin: 0; color: var(--color-text-muted); font-size: .875rem; line-height: 1.6; }
#examsView .exam-dialog-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; }
#examsView .exam-create-dialog .loop-form-body { padding: 24px; }
#examsView .exam-create-dialog .actions { flex-wrap: wrap; }
#examsView .exam-create-error:not([hidden]) { margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--color-danger); border-radius: var(--radius-sm); color: var(--color-danger); line-height: 1.6; }
#examsView .exam-sections { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
#examsView .exam-sections > .loop-card { margin: 0; padding: 24px; border: 1px solid var(--color-border); box-shadow: none; }
#examsView .loop-card-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#examsView .loop-card-head h2 .exam-icon { color: var(--color-primary); }
#examsView .loop-card-head .eyebrow { margin-bottom: 8px; }
#examsView .loop-collection-toolbar { border: 0; padding: 0 0 16px; gap: 16px; }
#examsView .loop-control { flex: 0 1 220px; }
#examsView .loop-search { flex: 1 1 220px; }
#examsView .loop-collection-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; padding: 0; }
#examsView .loop-item-list { display: block; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-border); }
#examsView .exam-list-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 16px; align-items: center; margin: 0; padding: 22px 0; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; background: transparent; transition: background-color var(--duration-fast) var(--ease); }
#examsView .exam-list-row:hover, #examsView .exam-list-row:focus-within { background: var(--color-surface-subtle); }
#examsView .exam-row-symbol { display: grid; place-items: center; width: 44px; height: 48px; border-radius: 12px; background: var(--color-primary-soft); color: var(--color-primary); }
#examsView .exam-row-symbol .exam-icon { width: 23px; height: 23px; }
#examsView .exam-list-row .loop-item-main { min-width: 0; }
#examsView .exam-list-row .loop-item-main strong { display: block; margin: 6px 0; font-size: 1rem; line-height: 1.5; }
#examsView .exam-list-row .loop-chip { padding: 0; border: 0; background: transparent; color: var(--color-text-muted); font-size: .75rem; font-weight: 500; }
#examsView .exam-list-row .loop-item-main p { margin: 6px 0 0; line-height: 1.6; }
#examsView .exam-row-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; }
#examsView .exam-row-meta > span { display: inline-flex; align-items: center; gap: 6px; }
#examsView .exam-row-meta .exam-icon { width: 16px; height: 16px; }
#examsView .exam-coverage { color: var(--color-warning); }
#examsView .exam-list-row .loop-item-actions { margin: 0; }
#examsView :is(.loop-item-actions button,.exam-refresh) { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; }
#examsView .exam-start { background: var(--color-primary-soft); color: var(--color-primary); border: 1px solid transparent; box-shadow: none; }
#examsView .exam-start:hover { background: var(--color-primary); color: var(--color-surface); }
#examsView .exam-history-row .exam-row-symbol { color: var(--color-text-muted); background: var(--color-surface-subtle); }
#examsView .exam-history-row .loop-chip { color: var(--color-primary); font-weight: 600; }
#examsView .loop-collection-footer { border: 0; padding-top: 16px; }
#examsView .loop-empty { padding: 32px 16px; text-align: center; color: var(--color-text-muted); background: var(--color-surface-subtle); border-radius: 12px; line-height: 1.7; }
#examsView :is(button,summary,input,select):focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  #examsView:not(.hidden) > .dashboard-head { animation: exam-arrive var(--exam-enter) var(--ease) both; }
  #examsView:not(.hidden) > .exam-sections { animation: exam-arrive var(--exam-enter) var(--ease) 70ms both; }
  #examsView .exam-create-dialog[open] { animation: exam-arrive 220ms var(--ease) both; }
}
@keyframes exam-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  #examsView .exam-sections { gap: 20px; }
  #examsView .exam-sections > .loop-card { padding: 16px; }
  #examsView .loop-control { flex: 1 1 100%; }
  #examsView .exam-list-row { grid-template-columns: 36px minmax(0,1fr); gap: 12px; padding: 18px 0; }
  #examsView .exam-row-symbol { width: 36px; height: 40px; align-self: start; }
  #examsView .exam-list-row .loop-item-actions { grid-column: 2; width: 100%; }
  #examsView .loop-item-actions button { width: 100%; }
  #examsView .dashboard-head { flex-direction: column; align-items: stretch; }
  #examsView .exam-create-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: var(--radius-md); }
  #examsView .exam-dialog-head, #examsView .exam-create-dialog .loop-form-body { padding: 20px; }
  #examsView .exam-create-dialog .actions button { width: 100%; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  #examsView *, #examsView *::before, #examsView *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
