/* Exam analysis (analysis.js). Uses the panel tokens (--radpa-*); every rule is scoped to an-* classes. */
.an-intro h2 { margin: 0 0 8px; }
.an-intro p { line-height: 1.9; margin: 6px 0; }
.an-steps { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 0; margin: 12px 0; list-style: none; counter-reset: an; }
.an-steps li { counter-increment: an; padding: 4px 12px; border-radius: 10px; background: var(--radpa-blue-tint); font-size: 13px; }
.an-steps li::before { content: counter(an, persian) ". "; color: var(--radpa-wine); font-weight: 700; }
.an-price b { color: var(--radpa-wine); font-size: 18px; }
#anStart { min-height: 48px; margin-top: 6px; }
.an-problem { padding: 12px 14px; border-radius: 12px; background: var(--radpa-warning-tint); color: var(--radpa-warning); line-height: 1.9; margin: 10px 0; }
.an-problem p { margin: 0 0 8px; }
.an-err { color: var(--radpa-danger); font-size: 13px; font-weight: 700; margin: 6px 0; }
.an-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e7edf3; }
.an-row p { margin: 4px 0; font-size: 14px; color: #52647a; }
.an-row small { display: block; margin-top: 4px; font-size: 13px; color: #64758a; }
.an-row.waiting small { color: var(--radpa-warning); font-weight: 700; }
.an-row.done small { color: var(--radpa-positive); }
.an-row.refunded small { color: var(--radpa-danger); }
.an-row button { min-height: 44px; flex-shrink: 0; }

/* the form */
.an-form .an-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-stepname { margin: 10px 0 2px; font-size: 13px; color: #64758a; }
.an-steptitle { margin: 4px 0 10px; font-size: 20px; outline: none; }
.an-save { margin: 10px 0 2px; font-size: 13px; color: #64758a; min-height: 20px; }
.an-save.saved { color: var(--radpa-positive); }
.an-save.saving, .an-save.dirty { color: #64758a; }
.an-save.error { color: var(--radpa-danger); font-weight: 700; }
.an-save .text-button { min-height: 32px; padding: 0 6px; }
.an-form h4 { margin: 18px 0 8px; }
.an-form label { display: grid; gap: 6px; margin: 10px 0; font-weight: 700; font-size: 14px; }
.an-form fieldset { border: 1px solid #e1e6ed; border-radius: 14px; padding: 10px 14px; margin: 12px 0; min-width: 0; }
.an-form legend { font-weight: 700; padding: 0 6px; }
.an-form legend small { font-weight: 400; color: #64758a; margin-right: 6px; }
.an-progress { display: flex; gap: 6px; }
.an-progress span { flex: 1; height: 6px; border-radius: 6px; background: #e7edf3; }
.an-progress span.on { background: var(--radpa-wine); }
.an-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.an-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.an-grid3 label { margin: 4px 0; }
.an-date { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.an-date select { min-height: 44px; }
.an-upload { padding: 12px 14px; border: 1px dashed #c9d3df; border-radius: 14px; margin: 12px 0; }
.an-upload p { margin: 6px 0; }
.an-file.ok { color: var(--radpa-positive); font-weight: 700; }
.an-file.pending { color: var(--radpa-warning); font-weight: 700; }
.an-file.none { color: #64758a; }
.an-filebtn { display: inline-flex !important; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--radpa-blue-tint); cursor: pointer; width: fit-content; }
.an-filebtn { position: relative; overflow: hidden; }
body .an-filebtn input { position: absolute; inset-inline-start: 0; top: 0; width: 1px !important; height: 1px !important; min-height: 0; padding: 0; opacity: 0; }   /* a wide hidden picker widened the phone page */
.an-filebtn:focus-within { outline: 3px solid var(--radpa-wine); outline-offset: 2px; }
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.an-chips legend { width: 100%; }
.an-chips label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 12px; min-height: 44px; border: 1px solid #d6dde6; border-radius: 12px; font-weight: 400; cursor: pointer; }
.an-chips label:has(input:checked) { border-color: var(--radpa-wine); background: #f7edf1; font-weight: 700; }
.an-chips input, .an-check input, .an-consent input { width: 20px; height: 20px; min-height: 0; accent-color: var(--radpa-wine); flex-shrink: 0; }
.an-subjects { display: grid; gap: 10px; }
.an-subj input { min-height: 44px; text-align: center; }
.an-live { color: var(--radpa-wine) !important; font-weight: 700 !important; }
.an-level { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.an-level > label:first-child { flex: 1 1 140px; margin: 4px 0; }
.an-check { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px; font-weight: 400 !important; min-height: 44px; margin: 2px 0 !important; cursor: pointer; }
.an-reasons .an-check { padding: 0 6px; border-radius: 10px; }
.an-reasons .an-check:has(input:checked) { background: #f7edf1; }
.an-summaryline { padding: 10px 14px; border-radius: 12px; background: var(--radpa-blue-tint); font-weight: 700; line-height: 1.9; }
.an-scoring { font-size: 12px; }
.an-goals input { min-height: 44px; max-width: 120px; text-align: center; }
.an-radio { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.an-follow-more { margin-top: 4px; }
.an-consent { display: flex !important; align-items: start; gap: 10px; font-weight: 400 !important; line-height: 1.9; padding: 12px 14px; border-radius: 12px; background: var(--radpa-blue-tint); }
.an-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.an-nav button { min-height: 48px; }
.an-nav button[hidden] { display: none; }

/* tables, report and review */
.an-scroll { overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.an-table th { text-align: right; font-size: 12px; color: #64758a; padding: 6px; border-bottom: 1px solid #e1e6ed; }
.an-table td { padding: 10px 6px; border-bottom: 1px solid #edf1f6; }
.an-table td small { display: block; font-size: 12px; color: #64758a; }
.an-table td.up { color: var(--radpa-positive); font-weight: 700; }
.an-table td.down { color: var(--radpa-danger); font-weight: 700; }
.an-report h3, .an-review h3 { margin: 22px 0 8px; }
.an-why { margin: 8px 0; line-height: 1.9; font-size: 14px; }
.an-quote { padding: 12px 14px; border-right: 3px solid var(--radpa-wine); background: #f7f8fa; border-radius: 8px; line-height: 1.9; white-space: pre-wrap; }
.an-notes { padding-right: 18px; line-height: 1.9; font-size: 13px; color: #52647a; }
.an-summary { line-height: 2; white-space: pre-wrap; }
.an-item { padding: 12px 14px; margin: 8px 0; border: 1px solid #e1e6ed; border-radius: 14px; }
.an-item b { display: block; margin: 4px 0; }
.an-item p { margin: 6px 0 0; line-height: 1.9; }
.an-action { padding: 12px 14px; margin: 8px 0; border-radius: 12px; background: #f7edf1; border-right: 3px solid var(--radpa-wine); }
.an-action p { margin: 4px 0 0; font-size: 13px; color: #52647a; }
.an-notice { border-right: 4px solid var(--radpa-wine); }
.an-notice-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.an-notice-row p { margin: 0; line-height: 1.9; flex: 1 1 260px; }
.an-notice-row button { min-height: 44px; }
.an-bars { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 6px; }
.an-bars li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #f3f6fa; font-size: 14px; }
.an-contract { padding-right: 20px; line-height: 2; }
.an-edit-item { padding: 10px 0; border-bottom: 1px dashed #dfe5ec; }
.an-editor label { display: grid; gap: 6px; margin: 8px 0; font-weight: 700; font-size: 14px; }
.an-editor fieldset { border: 1px solid #e1e6ed; border-radius: 14px; padding: 10px 14px; margin: 10px 0; min-width: 0; }
@media (max-width: 760px) {
  .an-grid2 { grid-template-columns: 1fr; }
  .an-grid3 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .an-row { flex-wrap: wrap; }
  .an-row button, #anStart, .an-nav button:not(.text-button) { width: 100%; }
}
@media print {
  #appNav, .panel-back, #anPrint, header, footer { display: none !important; }
  .an-report { box-shadow: none; border: 0; }
}
