/* Exact financial values are rendered on the server; these elements only show
   their proportions. Keep detail available in the text beside every chart. */
.review-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; list-style: none; padding: 0; margin: 1.4rem 0; }
.review-steps li { display: flex; gap: .75rem; align-items: center; padding: 1rem; border: 1px dashed var(--line,#d8ded4); border-radius: .6rem; }
.review-steps li.complete { border-style: solid; background: var(--surface,#fffefa); }
.review-steps li.current { border: 2px solid var(--accent,#245c4f); background: #f0f5ed; }
.step-number { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: 0 0 auto; border: 1px solid #9aaa96; border-radius: 50%; font-size: .8rem; }
.complete .step-number { background: #e1eedc; border-color: transparent; color: #245c4f; }
.current .step-number { background: #245c4f; color: white; border-color: #245c4f; }
.waterfall-row { display: grid; grid-template-columns: 1fr minmax(7rem,.85fr) auto; gap: 1.5rem; align-items: center; padding: 1.2rem 0; border-top: 1px solid #e4e7df; }
.waterfall-row p { font-size: .85rem; line-height: 1.6; color: #53635d; margin: .3rem 0 0; }
.waterfall-row.shared { border-top: 1px solid #294b40; font-size: 1.1rem; }
.waterfall-row meter { width: 100%; height: .85rem; border: 0; appearance: none; background: #edf0e9; border-radius: 3px; }
.waterfall-row meter::-webkit-meter-bar { background: #edf0e9; border: none; height: .85rem; }
.waterfall-row meter::-webkit-meter-optimum-value { background: #387d68; }
.waterfall-row.loss meter::-webkit-meter-optimum-value { background: repeating-linear-gradient(135deg,#b76455 0 3px,#d3988b 3px 6px); }
.waterfall-row.retained meter::-webkit-meter-optimum-value { background: #bf9e51; }
.waterfall-row.shared meter::-webkit-meter-optimum-value { background: #194b39; }
.waterfall-row meter::-moz-meter-bar { background: #387d68; }
.waterfall-row.loss meter::-moz-meter-bar { background: #b76455; }
.waterfall-row.retained meter::-moz-meter-bar { background: #bf9e51; }
.owner-allocation-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin: 1rem 0; }
.owner-allocation-grid .panel { margin: 0; }
.owner-allocation h3 { font: 1.5rem Georgia,serif; }
.review-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; padding: .85rem 0; border-bottom: 1px solid #e5e9e0; }
.review-amount strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.review-total strong { font-size: 1.25rem; }
.review-total { font-weight: 600; }
.owner-allocation progress,.payment-impact progress { display:block; width:100%; height:.65rem; margin: .9rem 0; border:0; appearance:none; background:#edf0e9; border-radius:3px; }
.owner-allocation progress::-webkit-progress-bar,.payment-impact progress::-webkit-progress-bar { background: #edf0e9; border-radius:3px; }
.owner-allocation progress::-webkit-progress-value { background: repeating-linear-gradient(135deg,#8098ac 0 3px,#b4c3cf 3px 6px); }
.payment-impact progress::-webkit-progress-value { background: #245c4f; }
.owner-allocation progress::-moz-progress-bar { background:#8098ac; }
.payment-impact progress::-moz-progress-bar { background:#245c4f; }
.review-info { background: #edf3f8; color: #315873; }
.review-warning { background: #faf0d8; color: #805a15; }
.approval-panel { border: 1px solid #c9dbc2; border-radius: .65rem; padding: 1.3rem; margin-top: 1.3rem; }
.approval-panel p { max-width: 75ch; line-height: 1.7; }
.payment-type-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin: .9rem 0; }
.payment-type { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 1px solid #d7ded0; border-radius: .5rem; text-decoration: none; color: #243e37; }
.payment-type span { font-size: .8rem; color: #52685d; }
.payment-type.selected { border: 2px solid #2d6b59; padding: calc(1rem - 1px); background: #f0f5ed; }
.payment-type:hover { background: #f0f5ed; }
.payment-review-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); gap: 1.5rem; align-items: start; }
.payment-impact { position: sticky; top: 1.5rem; border-color: #c9dbc2; }
.payment-impact .button { width: 100%; text-align: center; }
.payment-impact .form-actions { flex-direction: column; align-items: stretch; }
.payment-page { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); gap: 1.5rem; align-items: start; }
.payment-page > .panel, .payment-page > .callout { grid-column: 1; margin: 0; }
.payment-page > .payment-review-grid { display: contents; }
.payment-page > .payment-review-grid > div { grid-column: 1; display: grid; gap: 1.5rem; min-width: 0; }
.payment-page > .payment-review-grid > div > .panel { margin: 0; }
.payment-page .payment-impact { grid-column: 2; grid-row: 1 / span 3; }
.correction-review > summary { margin-bottom: 1rem; }
.review-explanation { margin: 1.3rem 0; }
.review-effects { padding-left: 1.2rem; line-height: 1.8; }
.affected-months { display: grid; grid-template-columns: repeat(auto-fit,minmax(12rem,1fr)); gap: .65rem; margin: 1rem 0 1.5rem; }
.affected-month { display: flex; flex-direction: column; gap: .6rem; text-decoration: none; padding: 1rem; border: 1px solid #c7d6e2; border-radius: .5rem; background: #f3f7fa; }
.affected-month span { font-size: .8rem; }
.correction-period { margin: 1.7rem 0; scroll-margin-top: 2rem; }
.correction-period h4 { padding: .7rem; margin: 0; border: 1px solid #dce3d6; background: #f4f6f0; }
.comparison-table .comparison-change { background: #f0f5f9; color: #315873; }
.comparison-table th[scope="row"] { font-weight: 600; }
@media (max-width: 850px) {
  .payment-review-grid { grid-template-columns: 1fr; }
  .payment-page { grid-template-columns: 1fr; }
  .payment-page .payment-impact { grid-column: 1; grid-row: auto; }
  .payment-impact { position: static; }
  .waterfall-row { grid-template-columns: 1fr auto; gap: .8rem; }
  .waterfall-row meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 580px) {
  .owner-allocation-grid,.payment-type-grid { grid-template-columns: 1fr; }
  .review-steps { gap: .3rem; }
  .review-steps li { flex-direction: column; gap: .4rem; padding: .7rem .35rem; text-align: center; font-size: .75rem; }
  .review-amount { gap: .8rem; }
  .owner-allocation .panel-head { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
@media print {
  .review-steps,.approval-panel,.payment-type-grid { display: none; }
  .payment-review-grid,.owner-allocation-grid { display: block; }
  .owner-allocation { break-inside: avoid; margin-bottom: 1rem; }
  .payment-impact { position: static; }
}

.field-error { color: #9a3e2d; font-size: .78rem; line-height: 1.5; font-weight: 500; }
input[aria-invalid="true"],select[aria-invalid="true"] { border-color: #b35240; box-shadow: 0 0 0 1px #b35240; }
.activity-tabs { margin-top: .6rem; }
.activity-filter { display: inline-flex; gap: 2px; padding: 3px; margin: .4rem 0 1rem; border: 1px solid #d7ded0; border-radius: .5rem; background: #f6f8f2; }
.activity-filter a { padding: .35rem .9rem; border-radius: .35rem; font-size: .85rem; color: #53635d; text-decoration: none; }
.activity-filter a.selected { background: #245c4f; color: white; }
.activity-list { display: grid; gap: .7rem; margin: .8rem 0 1rem; }
.activity-card { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; padding: 1rem 1.2rem; border: 1px solid #d7ded0; border-radius: .6rem; background: var(--surface,#fffefa); }
.activity-card-main { min-width: 0; }
.activity-card-main h3 { margin: .35rem 0 .25rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.activity-card-main p { margin: .1rem 0; font-size: .85rem; }
.activity-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.activity-chips .chip { padding: .1rem .55rem; border: 1px solid #d7ded0; border-radius: 999px; font-size: .75rem; background: #f0f5ed; }
.activity-chips .chip.muted { background: transparent; color: #66756f; }
.badge.returned { background: #faf0d8; color: #805a15; }
.activity-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; flex: 0 0 auto; }
.activity-amount { font-variant-numeric: tabular-nums; font-size: 1.15rem; white-space: nowrap; }
.activity-footer { margin-top: .5rem; }
@media (max-width: 600px) {
  .activity-card { flex-direction: column; align-items: stretch; }
  .activity-card-side { flex-direction: row; justify-content: space-between; align-items: center; }
}
/* Journal review screen (draft review, returned, posted). */
.review-head .review-subline { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: .35rem 0; }
.review-reference { margin: .2rem 0 0; }
.review-callout { margin: 1rem 0; }
.review-callout .button { margin-top: .6rem; }
.review-note { font-style: italic; margin: .4rem 0 0; overflow-wrap: anywhere; }
.review-steps small { display: block; }
.review-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 1.2rem; align-items: start; }
.review-main,.review-side { display: grid; gap: 1.1rem; min-width: 0; }
.review-grid .panel { margin: 0; }
.review-sentence { margin: .2rem 0 1rem; line-height: 1.7; max-width: 70ch; padding: .85rem 1rem; background: #f0f5ed; border-radius: .5rem; }
.review-lines .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-lines td small { display: block; }
.review-lines tfoot td { border-top: 1px solid #294b40; font-weight: 600; }
.review-chip { display: inline-flex; padding: .1rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.review-chip.ok { background: #e4eee0; color: #396034; }
.review-chip.bad { background: #f6e8e1; color: #904b39; }
.review-conversion-note { margin: .8rem 0 0; }
.review-details .record-meta { display: grid; gap: .6rem; margin: 0; }
.review-details .record-meta > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #edf0e9; padding-bottom: .5rem; }
.review-details .record-meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.check-list li { display: flex; gap: .6rem; align-items: baseline; font-size: .9rem; line-height: 1.5; }
.check-list .check-mark { flex: 0 0 1.2rem; font-weight: 700; }
.check-list li.ok .check-mark { color: #396034; }
.check-list li.warn .check-mark { color: #805a15; }
.check-list li.bad .check-mark { color: #9a3e2d; }
.review-lock { background: #fff3e9; border-color: #e3c5b4; color: #873e26; }
.review-blocked { color: #9a3e2d; font-weight: 600; }
.review-actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.review-send-back { margin-top: 1rem; }
.review-send-back form { padding: 0 1rem 1rem; display: grid; gap: .7rem; }
.review-send-back textarea { width: 100%; min-height: 5rem; padding: .6rem .75rem; border: 1px solid #d4dfd1; border-radius: 6px; }
.review-bar p { margin: 0 0 .8rem; }
.review-still-open p { margin: .3rem 0 .7rem; }
.review-change ul { margin: .4rem 0 1rem; }
.history-list { list-style: none; margin: 0; padding: .4rem 1rem 1rem; display: grid; gap: .6rem; }
.history-list li { display: flex; gap: 1rem; align-items: baseline; }
.history-list time { flex: 0 0 8.5rem; white-space: nowrap; }
.review-related { margin-top: 1rem; }
@media (max-width: 900px) {
  .review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .history-list li { flex-direction: column; gap: .15rem; }
  .history-list time { flex: 0 0 auto; }
  .review-details .record-meta > div { flex-direction: column; gap: .15rem; }
  .review-details .record-meta dd { text-align: left; }
}
.sale-options { display: grid; gap: .6rem; margin: .8rem 0; }
.sale-options .sale-option { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .8rem; padding: .85rem 1rem; border: 1px solid #d7ded0; border-radius: .5rem; cursor: pointer; font-size: .95rem; color: inherit; font-weight: 400; text-align: left; }
.sale-options .sale-option:has(input:checked) { border: 2px solid #2d6b59; padding: calc(.85rem - 1px) calc(1rem - 1px); background: #f0f5ed; }
.sale-options .sale-option:hover { background: #f0f5ed; }
.sale-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.sale-body small,.sale-owed small { color: #52685d; }
.sale-owed { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.payment-values { grid-template-columns: repeat(2,minmax(0,1fr)); }
.js .payment-nojs { display: none; }
@media (max-width: 580px) {
  .sale-options .sale-option { grid-template-columns: auto minmax(0,1fr); }
  .sale-owed { grid-column: 2; align-items: flex-start; }
  .payment-values { grid-template-columns: 1fr; }
}
