/* CBA Practice Lab - calm, plain product styling.
   One type family, one accent, hairlines instead of boxes, generous space (8px grid). */

:root {
  --ink: #101D26;
  --muted: #5F6B73;
  --line: #E8E8E8;
  --line-soft: #F1F1F1;
  --field: #D5DADE;
  --accent: #9EDB2B;
  --accent-hover: #93CF22;
  --good: #3F6E0B;
  --bad: #B42318;
  --bad-bg: #FEF3F2;
  --bg: #FFFFFF;
  --subtle: #F7F8F8;
  --radius: 6px;
  --font: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: 30px; letter-spacing: -0.015em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.num, .amt-input, td.c-amt, .tot { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 16px; border-radius: var(--radius); z-index: 10; }
.skip-link:focus { left: 16px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 32px; }
body.narrow .wrap { max-width: 880px; }
main.wrap { padding-top: 48px; padding-bottom: 96px; min-height: 60vh; }
main:focus { outline: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 17px; height: 22px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.005em; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 24px; padding-bottom: 40px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a, .footer-links .link-btn { color: var(--muted); font-size: 14px; }
.footer-note { flex-basis: 100%; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 20px;
  border: 1px solid var(--field); border-radius: var(--radius);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #B9C0C5; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: default; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); font-size: 15px; font-weight: 400;
  text-decoration: underline; text-decoration-color: #C3C9CD; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.link-btn:hover { text-decoration-color: var(--ink); }
.link-btn:disabled { color: #A9B0B5; text-decoration-color: transparent; cursor: default; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 24px; }

.icon { display: inline-flex; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius); background: none; color: #9AA3A9; cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--subtle); }

/* ---------- Page heads ---------- */
.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs .sep { color: #C3C9CD; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin: 16px 0 0; }
.page-head .sub, .home-head .sub { margin-top: 8px; color: var(--muted); font-size: 17px; }
.page-aside { display: flex; gap: 24px; align-items: center; padding-bottom: 4px; }

.laptop-note { display: none; color: var(--muted); font-size: 14px; margin-top: 16px; }

/* ---------- Home and course pages ---------- */
.home-head { padding-top: 16px; }
.home-head h1 { font-size: 32px; }
.row-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row-list li { border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 16px; padding: 18px 0; text-decoration: none; color: var(--ink); }
.row:hover .row-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #C3C9CD; }
.row-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.row-meta { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.row-no { width: 40px; flex: none; white-space: nowrap; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.row-go { font-size: 15px; text-decoration: underline; text-decoration-color: #C3C9CD; text-underline-offset: 4px; }
.row:hover .row-go { text-decoration-color: var(--ink); }
.row-done { color: var(--good); display: inline-flex; }
.row-sub { display: block; font-weight: 400; font-size: 15px; color: var(--muted); margin-top: 2px; }
.row-inline-meta { font-weight: 400; color: var(--muted); font-size: 15px; margin-left: 12px; }
.lesson-row .row-title, .sim-row .row-title { font-size: 16px; }
.course-list { margin-top: 56px; }
.course-list .row { padding: 24px 0; }
.course-list .row-title { font-size: 19px; }
.list-section { margin-top: 56px; }
.list-section h2 { margin-bottom: 16px; }

/* ---------- Forms ---------- */
input[type=text], input[type=number], input[type=date], select, textarea {
  height: 40px; padding: 0 12px; width: 100%;
  border: 1px solid var(--field); border-radius: var(--radius); background: #fff; color: var(--ink);
  font-size: 15px;
}
input[type=date] { padding-right: 8px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6B73' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input:disabled, select:disabled { background-color: var(--subtle); color: var(--ink); opacity: 1; }
input::placeholder { color: #A3AAAF; }
.amt-input { text-align: right; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--good); cursor: pointer; }
.bad-field, .bad-field:focus { border-color: var(--bad) !important; box-shadow: 0 0 0 1px var(--bad); background-color: #fff; }
.good-field { border-color: var(--field); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field-note { font-size: 13px; color: var(--bad); line-height: 1.4; }
.field-note:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
.form-grid .wide { grid-column: span 2; }

/* ---------- Feedback, hints, answers ---------- */
.fb { margin-top: 20px; max-width: 720px; }
.fb-head { font-weight: 600; }
.fb-good .fb-head { color: var(--good); }
.fb-bad .fb-head { color: var(--bad); }
.fb-list { list-style: none; margin: 6px 0 0; padding: 0; color: var(--muted); font-size: 15px; }
.fb-list li + li { margin-top: 4px; }
.fb-why { margin-top: 6px; color: var(--muted); font-size: 15px; }
.fb .actions { margin-top: 16px; }
.hint { margin-top: 20px; max-width: 720px; color: var(--muted); font-size: 15px; }
.hint::before { content: 'Hint. '; color: var(--ink); font-weight: 600; }
.answer-box { margin-top: 24px; max-width: 720px; }
.answer-box .link-btn { margin-top: 12px; }
.answer-why, .answer-date { margin-top: 12px; color: var(--muted); font-size: 15px; }
.answer-table { border-collapse: collapse; width: 100%; font-size: 15px; }
.answer-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.answer-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-soft); }
.answer-table .num { text-align: right; }
.table-scroll { overflow-x: auto; }

/* ---------- Journal entry practice ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; }
.q-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.q-nav .link-btn { font-size: 14px; }
.q-count { color: var(--muted); font-variant-numeric: tabular-nums; }

.scenario { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; margin-top: 40px; }
.scenario.no-doc { grid-template-columns: minmax(0, 1fr); }
.scenario-text { max-width: 620px; }
.scenario h1 { font-size: 28px; }
.q-done { display: inline-flex; align-items: center; gap: 4px; margin-left: 12px; vertical-align: middle; color: var(--good); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.q-done:empty { display: none; }
.q-lesson { margin-top: 6px; color: var(--muted); font-size: 14px; }
.prompt { margin-top: 16px; font-size: 17px; line-height: 1.6; }
.prompt-note { margin-top: 8px; color: var(--muted); font-size: 15px; }

.doc-card { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; font-size: 15px; background: #fff; }
.doc-kind { font-size: 13px; color: var(--muted); }
.doc-title { font-weight: 700; margin-top: 2px; }
.doc-from { color: var(--muted); }
.doc-meta { margin: 12px 0 0; display: grid; gap: 2px; font-size: 14px; }
.doc-meta div { display: flex; gap: 12px; }
.doc-meta dt { color: var(--muted); min-width: 72px; }
.doc-meta dd { margin: 0; }
.doc-lines { width: 100%; border-collapse: collapse; margin-top: 16px; }
.doc-lines td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.doc-lines td.num { text-align: right; padding-left: 16px; white-space: nowrap; }
.doc-total { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--ink); font-weight: 700; }
.doc-note { margin-top: 12px; color: var(--muted); font-size: 14px; }

.je-practice { margin-top: 48px; }
.je-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 16px; }
.je-date-field { display: flex; align-items: center; gap: 12px; }
.je-date-field .je-date { width: 180px; }
.je-date-text { font-size: 15px; }
.je-table-wrap { overflow: visible; }
.je-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.je-table th { font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; padding: 0 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.je-table th.c-amt { text-align: right; }
.je-table td { padding: 8px 6px 0; vertical-align: middle; }
.je-table tbody tr.je-row:first-child td { padding-top: 12px; }
.je-table .c-num { width: 28px; padding-left: 0; color: #9AA3A9; font-size: 13px; text-align: left; font-variant-numeric: tabular-nums; }
.je-table .c-acct { width: auto; min-width: 240px; }
.je-table .c-amt { width: 136px; }
.je-table .c-class { width: 168px; }
.je-table .c-desc { width: 180px; }
.je-table .c-name { width: 140px; }
.je-table .c-del { width: 36px; padding-right: 0; text-align: right; }
.je-table .more { display: none; }
.je-table.show-more .more { display: table-cell; }
.je-row.row-bad td { background: var(--bad-bg); }
.je-row.row-bad td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.je-row.row-bad td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.je-row.row-bad td { padding-bottom: 8px; }
.je-row.row-bad + .je-msg td { background: var(--bad-bg); }
.je-msg td { padding: 0 6px 8px 34px; }
.row-note { font-size: 14px; line-height: 1.4; }
.row-note.bad { color: var(--bad); }
.row-note.tip { color: var(--muted); }
.row-note + .row-note { margin-top: 2px; }
.je-msg:not(.bad) td { padding-top: 6px; }
.je-table tfoot td { padding-top: 16px; font-weight: 700; border-top: 0; }
.je-table tfoot .tot-label { color: var(--muted); font-weight: 600; font-size: 13px; }
.je-table tfoot td.c-amt { text-align: right; padding-right: 19px; }
.bal-cell { font-weight: 400 !important; }
.bal-state { font-size: 14px; color: var(--muted); font-weight: 400; }
.bal-state.ok { color: var(--good); }
.je-tools { display: flex; gap: 24px; margin-top: 16px; }
.je-tools .link-btn { font-size: 14px; color: var(--muted); }
.je-form.locked .je-tools { display: none; }
.je-form.locked .del-btn { visibility: hidden; }

/* Account picker */
.acct-combo { position: relative; }
.acct-input {
  padding-right: 32px !important; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6B73' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.acct-list {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 4px); width: max(100%, 340px); max-height: 320px; overflow-y: auto;
  margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--field); border-radius: var(--radius);
}
.acct-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.acct-opt { display: flex; gap: 12px; padding: 6px 12px; cursor: pointer; font-size: 15px; }
.acct-opt-num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 36px; }
.acct-opt.active { background: var(--subtle); }
.acct-opt[aria-selected=true] .acct-opt-name { font-weight: 600; }
.acct-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* ---------- Simulations ---------- */
.sim-intro { margin-top: 8px; color: var(--muted); font-size: 17px; }
.sheet-section { margin-top: 48px; }
.sheet-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.sheet-wrap { overflow-x: auto; position: relative; }
.sheet { width: 100%; border-collapse: collapse; font-size: 15px; }
.sheet th { font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; padding: 0 12px 8px; border-bottom: 1px solid var(--line); vertical-align: bottom; line-height: 1.3; }
.sheet td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.sheet th:first-child, .sheet td:first-child { padding-left: 0; }
.sheet th:last-child, .sheet td:last-child { padding-right: 0; }
.sheet .num { text-align: right; white-space: nowrap; }
.sheet .wrap-cell { min-width: 180px; }
.sheet .coding { color: var(--muted); font-size: 14px; min-width: 150px; }
.sheet .dim { color: #A3AAAF; }
.sheet .nowrap { white-space: nowrap; }
.sheet .group-row td { padding-top: 20px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.sheet tfoot td { border-bottom: 0; font-weight: 600; }
.sheet tfoot tr:first-child td { border-top: 1px solid var(--ink); }
.sheet tfoot .label { text-align: right; color: var(--muted); font-weight: 600; font-size: 14px; }
.sheet .tie-ok { color: var(--good); }
.sheet .tie-bad { color: var(--bad); }
.sheet .input-cell input { height: 34px; width: 112px; font-size: 15px; }
.sheet .input-cell select { height: 34px; width: 150px; font-size: 15px; }
.sheet td.input-cell { padding-top: 6px; padding-bottom: 6px; }
.sheet tr.row-bad td { background: var(--bad-bg); }
.sheet tr.new-row td { background: none; }
.sheet .check-cell { width: 44px; text-align: center; }
.sheet.compact { font-size: 14px; }
.sheet.compact th, .sheet.compact td { padding-left: 8px; padding-right: 8px; }
.sheet.compact th:first-child, .sheet.compact td:first-child { padding-left: 0; }
.sheet.compact th:last-child, .sheet.compact td:last-child { padding-right: 0; }
.sheet.compact .input-cell input { width: 104px; font-size: 14px; }
.dep-table .desc-cell { min-width: 130px; }
.dep-table .input-cell input { width: 100px; }
.cell-note { display: block; font-size: 13px; line-height: 1.35; color: var(--bad); margin-top: 4px; white-space: normal; text-align: left; font-weight: 400; }
.cell-note.ok { color: var(--muted); }
.cell-note:empty { display: none; }
td.num .cell-note { text-align: right; }

.steps { margin-top: 56px; }
.steps.plain { margin-top: 32px; }
.steps.plain > .actions:first-child { margin-top: 0; }
.steps.first { margin-top: 40px; }
.steps.first > .step-panel:first-child { border-top: 0; padding-top: 0; }
.step-panel { padding: 32px 0 0; border-top: 1px solid var(--line); }
.step-panel + .step-panel { margin-top: 32px; }
.step-count { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.task { margin-top: 8px; font-size: 16px; max-width: 680px; }
.step-body { margin-top: 24px; }
.step-body > * + * { margin-top: 24px; }
.step-body > .actions { margin-top: 24px; }
.step-body > .fb, .step-body > .hint { margin-top: 20px; }
.step-panel.done { padding-top: 20px; }
.step-panel.done + .step-panel { margin-top: 20px; }
.step-panel.done h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.step-panel.done .step-body { margin-top: 16px; }
.done-check { color: var(--good); }
.step-summary { margin-top: 4px; margin-left: 24px; color: var(--muted); font-size: 15px; }
.step-sub { font-size: 16px; font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }

.register-wrap { max-width: 880px; }
.register tr.new td { font-weight: 600; }
.register .memo { color: var(--muted); }
.register tr.end td { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 0; }

.choice-list { display: grid; gap: 0; max-width: 720px; border-top: 1px solid var(--line); }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.choice input { margin-top: 3px; flex: none; }
.choice .why { display: block; color: var(--bad); font-size: 14px; margin-top: 4px; }
.choice .why:empty { display: none; }
.choice.right { color: var(--good); }
.choice.wrong { background: var(--bad-bg); }

.figures { display: flex; flex-wrap: wrap; gap: 16px 56px; }
.figure .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.figure .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.figure.zero .v { color: var(--good); }
.figures-note { margin-top: 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.complete-banner { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.complete-banner h2 { color: var(--good); }
.complete-banner p { margin-top: 8px; color: var(--muted); max-width: 640px; }

/* Bank reconciliation */
.levels { display: flex; gap: 24px; font-size: 15px; }
.levels a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.levels a:hover { color: var(--ink); }
.levels a[aria-current=page] { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.levels .icon { color: var(--good); }
.rec-summary { margin-top: 48px; }
.rec-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; margin-top: 40px; align-items: start; }
.rec-col { min-width: 0; }
.rec-col-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 8px; }
.rec-col-head h2 { font-size: 16px; }
.rec-col-head .sub { font-size: 13px; color: var(--muted); }
.rec-table td { padding-top: 8px; padding-bottom: 8px; }
.rec-table .rec-check { width: 32px; text-align: right; }
.rec-table tr.checked td { color: var(--ink); }
.rec-table tr.added td { color: var(--muted); }
.rec-table .prior-note { display: block; font-size: 13px; color: var(--muted); }
.amt-edit { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.amt-edit input { width: 96px; height: 30px; text-align: right; font-size: 15px; }
.pencil-btn { width: 26px; height: 26px; border: 0; background: none; color: #A3AAAF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.pencil-btn:hover { color: var(--ink); background: var(--subtle); }
@media (hover: hover) {
  .rec-table .pencil-btn { opacity: 0; }
  .rec-table tr:hover .pencil-btn, .rec-table .pencil-btn:focus-visible { opacity: 1; }
}
.pencil-btn .icon svg { width: 14px; height: 14px; }
.fixed-flag { font-size: 12px; color: var(--muted); margin-left: 4px; }
.bank-table td { font-size: 13px; }
.rec-table .payee { min-width: 120px; }
.bank-table tr.matched td { color: #A3AAAF; }
.bank-table tr.matched td.mark { color: var(--good); }
.bank-table td.mark { width: 20px; padding-right: 0; }
.bank-table tr.edge td { font-weight: 600; }
.add-form { padding: 24px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.add-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.add-form .actions { margin-top: 20px; }
.rec-actions { margin-top: 32px; }
.rec-report { margin-top: 32px; max-width: 640px; }
.rec-report h2 { margin-bottom: 12px; }
.rec-report table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rec-report td { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.rec-report td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rec-report tr.sub td { color: var(--muted); padding-left: 16px; font-size: 14px; }
.rec-report tr.grand td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 0; }
.rec-report p { margin-top: 12px; color: var(--muted); font-size: 15px; }

/* COA page */
.facts { margin-top: 16px; color: var(--muted); font-size: 15px; }
.downloads { display: flex; gap: 24px; margin-top: 16px; }
.coa-table { margin-top: 48px; }
.coa-table td.acct-num { width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; vertical-align: top; }
.coa-table td.acct-name { width: 40%; font-weight: 600; vertical-align: top; }
.coa-table td.desc { color: var(--muted); font-size: 14px; vertical-align: top; }
.coa-table .group-row td { padding-top: 32px; }
.coa-table .group-row .grp-note { font-weight: 400; margin-left: 12px; }
.coa-table tbody tr:first-child td { padding-top: 12px; }
.class-section { margin-top: 56px; }
.class-section h2 { margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .scenario, .split { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
  .rec-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .laptop-note { display: block; }
  .scenario, .split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .doc-card { max-width: 480px; }
  .split > .doc-card { order: -1; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 32px; padding-bottom: 64px; }
  h1, .home-head h1 { font-size: 26px; }
  .scenario h1 { font-size: 24px; }
  .page-head .sub, .home-head .sub, .sim-intro { font-size: 16px; }
  .course-list { margin-top: 40px; }
  .list-section, .steps, .sheet-section { margin-top: 40px; }
  .row-no { width: 36px; }
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-grid .wide { grid-column: span 2; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .scenario { margin-top: 24px; }
  .prompt { font-size: 16px; }
  .je-practice { margin-top: 32px; }

  /* Journal entry grid stacks into one block per line */
  .je-table, .je-table tbody, .je-table tfoot, .je-table tr, .je-table td { display: block; width: 100%; }
  .je-table thead { display: none; }
  .je-table tr.je-row { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 16px 0; border-top: 1px solid var(--line); }
  .je-table tbody tr.je-row:first-child td { padding-top: 0; }
  .je-table tr.je-row td { padding: 0; width: auto; }
  .je-table td.c-num { position: absolute; top: 16px; right: 40px; width: auto; }
  .je-table td.c-acct { grid-column: 1 / -1; min-width: 0; }
  .je-table td.c-class { grid-column: 1 / -1; }
  .je-table td.c-desc, .je-table td.c-name { grid-column: 1 / -1; }
  .je-table.show-more td.more { display: block; }
  .je-table td.c-del { position: absolute; top: 12px; right: 0; width: auto; }
  .je-table td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
  .je-row.row-bad { background: var(--bad-bg); padding: 16px 12px !important; border-radius: var(--radius) var(--radius) 0 0; border-top-color: transparent !important; }
  .je-row.row-bad td { background: none; border-radius: 0 !important; }
  .je-row.row-bad td.c-del { right: 8px; }
  .je-row.row-bad td.c-num { right: 48px; }
  .je-msg td { padding: 0 0 12px !important; }
  .je-row.row-bad + .je-msg td { background: var(--bad-bg); padding: 0 12px 16px !important; border-radius: 0 0 var(--radius) var(--radius); }
  .actions { gap: 12px 20px; }
  .je-table tfoot tr { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 12px; padding-top: 16px; border-top: 1px solid var(--line); align-items: baseline; }
  .je-table tfoot td { padding: 0 !important; width: auto; }
  .je-table tfoot td.c-num { display: none; }
  .je-table tfoot td.c-amt { text-align: right; }
  .je-table tfoot .bal-cell { grid-column: 1 / -1; text-align: right; }
  .je-table-wrap { overflow: visible; }

  .rec-body { gap: 40px; }
  /* Books list: one compact row per transaction so the cleared box stays on screen */
  .rec-table thead { display: none; }
  .rec-table, .rec-table tbody { display: block; }
  .rec-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 28px; grid-template-areas: "date payee amt chk" "date type amt chk"; column-gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
  .rec-table td { padding: 0 !important; border: 0 !important; }
  .rec-table td:nth-child(1) { grid-area: date; align-self: start; color: var(--muted); }
  .rec-table td:nth-child(2) { grid-area: type; font-size: 13px; color: var(--muted); }
  .rec-table td:nth-child(3) { grid-area: payee; min-width: 0; }
  .rec-table td:nth-child(4), .rec-table td:nth-child(5) { grid-area: amt; }
  .rec-table td:nth-child(6) { grid-area: chk; width: auto; }
  .rec-table td:empty { display: none; }
  /* Simple lists stack so the answer control stays on screen */
  .stack-aging thead, .stack-funds thead { display: none; }
  .stack-aging, .stack-aging tbody, .stack-funds, .stack-funds tbody { display: block; }
  .stack-aging tr, .stack-funds tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .stack-aging td, .stack-funds td { padding: 0 !important; border: 0 !important; }
  .stack-aging tr { grid-template-areas: "who amt" "for date" "sel sel"; }
  .stack-aging td:nth-child(1) { grid-area: who; font-weight: 600; }
  .stack-aging td:nth-child(2) { grid-area: for; min-width: 0; font-size: 14px; }
  .stack-aging td:nth-child(3) { grid-area: date; color: var(--muted); font-size: 14px; }
  .stack-aging td:nth-child(4) { grid-area: amt; }
  .stack-aging td:nth-child(5) { grid-area: sel; margin-top: 8px !important; }
  .stack-funds tr { grid-template-areas: "desc amt" "date amt" "sel sel"; }
  .stack-funds td:nth-child(1) { grid-area: date; color: var(--muted); font-size: 14px; }
  .stack-funds td:nth-child(2) { grid-area: desc; min-width: 0; }
  .stack-funds td:nth-child(3), .stack-funds td:nth-child(4) { grid-area: amt; }
  .stack-funds td:nth-child(3):not(:empty)::before { content: 'In '; color: var(--muted); font-size: 13px; }
  .stack-funds td:nth-child(4):not(:empty)::before { content: 'Out '; color: var(--muted); font-size: 13px; }
  .stack-funds td:empty { display: none; }
  .stack-funds td:nth-child(5) { grid-area: sel; margin-top: 8px !important; }
  .stack-aging .input-cell select, .stack-funds .input-cell select { width: 100%; height: 40px; }
  .stack-aging tr.row-bad, .stack-funds tr.row-bad { background: var(--bad-bg); padding: 12px; border-radius: var(--radius); }
  .stack-aging tr.row-bad td, .stack-funds tr.row-bad td { background: none; }
  .figures { gap: 16px 32px; }
  .figure .v { font-size: 19px; }
  .add-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { flex-direction: column; align-items: flex-start; padding-bottom: 32px; }
  .sheet tfoot .label { text-align: left; white-space: nowrap; }
  .coa-table td.acct-name { width: auto; }
  .coa-table td.desc { display: none; }
}
