/* close-feed styles: the Month-End Close bank feed (#/close-feed) and card feed (#/close-card).
   Uses only the tokens in app.css. Every class is prefixed cf- so it can't collide with other pages. */

/* ---------- Intro ---------- */
.cf-intro { margin-top: 32px; max-width: 760px; }
.cf-lead { font-size: 16px; }
.cf-h { margin-top: 28px; font-size: 17px; }
.cf-qs { margin: 12px 0 0; padding-left: 24px; }
.cf-qs li { padding-left: 4px; }
.cf-qs li + li { margin-top: 10px; }
.cf-qs li::marker { font-weight: 700; }
.cf-note { margin-top: 16px; color: var(--muted); font-size: 15px; }

/* ---------- Account strip ---------- */
.cf-acct {
  margin-top: 40px; padding: 20px 24px; border-radius: 8px; background: var(--subtle);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 40px;
}
.cf-acct-t { font-weight: 700; font-size: 17px; }
.cf-acct-s { margin-top: 2px; color: var(--muted); font-size: 14px; }
.cf-figs { gap: 12px 40px; }
.cf-figs .figure .v { font-size: 19px; }

/* ---------- Feed toolbar ---------- */
.cf-feed { margin-top: 32px; }
.cf-steps .cf-feed { margin-top: 0; }
.cf-progress { display: flex; align-items: center; gap: 16px; }
.cf-count { font-weight: 600; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-bar { flex: 1; max-width: 320px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.cf-bar-fill { display: block; height: 100%; width: 0; background: var(--good); transition: width .2s ease; }
.cf-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px;
  margin-top: 20px; border-bottom: 1px solid var(--line);
}
.cf-tabs { display: flex; gap: 28px; }
.cf-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 0 10px; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 15px;
}
.cf-tab:hover { color: var(--ink); }
.cf-tab[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--ink); }
.cf-tab-n { min-width: 24px; padding: 0 7px; border-radius: 10px; background: var(--line-soft); font-size: 13px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.cf-tab[aria-pressed=true] .cf-tab-n { background: var(--line); }
.cf-filter { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.cf-filter-k { margin-right: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cf-chip {
  min-height: 30px; padding: 3px 12px; border: 1px solid var(--field); border-radius: 16px;
  background: var(--bg); color: var(--ink); font-size: 14px; cursor: pointer;
}
.cf-chip:hover { border-color: #B9C0C5; }
.cf-chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cf-chip:disabled { opacity: .5; cursor: default; }

/* ---------- Feed rows ---------- */
.cf-list { list-style: none; margin: 0; padding: 0; }
.cf-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 116px 116px 104px; column-gap: 16px;
  align-items: center; padding: 12px 0;
}
.cf-head { padding: 12px 0 8px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.cf-head .cf-amt { font-size: 13px; }
.cf-item { border-bottom: 1px solid var(--line-soft); }
.cf-item.is-open { border-bottom-color: transparent; }
.cf-item.is-open > .cf-row .cf-desc-t { font-weight: 700; }
.cf-date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.cf-desc { min-width: 0; }
.cf-desc-t { font-size: 14px; letter-spacing: .01em; overflow-wrap: anywhere; }
.cf-sub { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.cf-coded { display: flex; align-items: flex-start; gap: 4px; }
.cf-coded .icon { margin-top: 2px; color: var(--good); }
.cf-coded .icon svg { width: 14px; height: 14px; }
.cf-tag {
  display: inline-block; margin-top: 4px; padding: 0 8px; border: 1px solid var(--field); border-radius: 10px;
  background: var(--bg); font-size: 12px; font-weight: 600; line-height: 18px;
}
.cf-amt { text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-amt-k { display: none; }
.cf-act { display: flex; justify-content: flex-end; }
.cf-open-btn { min-height: 34px; padding: 6px 16px; font-size: 14px; }
.cf-open-btn.is-open { background: var(--subtle); }
.cf-solved { display: inline-flex; align-items: center; gap: 4px; color: var(--good); font-size: 14px; font-weight: 600; }
.cf-item.is-solved > .cf-row .cf-desc-t, .cf-item.is-solved > .cf-row .cf-amt { color: var(--muted); }
.cf-item.is-done .cf-act .link-btn { font-size: 14px; color: var(--muted); }
.cf-empty { padding: 24px 0; color: var(--muted); }
.cf-reset { margin-top: 24px; }
.cf-reset .link-btn { font-size: 14px; color: var(--muted); }

/* ---------- The open line ---------- */
.cf-detail { margin: 0 0 16px; padding: 24px; border-radius: 8px; background: var(--subtle); }
.cf-detail-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.cf-detail-in.has-side { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
.cf-main { min-width: 0; }
.cf-side { min-width: 0; }
.cf-side-k, .cf-form-label, .cf-choose-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.cf-side-k { margin-bottom: 8px; }
.cf-side-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.cf-side .doc-card { max-width: none; }
.cf-sample { margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }

/* Action chooser: real radio buttons drawn as tiles */
.cf-choose { margin: 0; padding: 0; border: 0; min-width: 0; }
.cf-choose-label { padding: 0; margin-bottom: 8px; }
.cf-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cf-opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 480px; }
.cf-opt { position: relative; display: block; cursor: pointer; }
.cf-opt-input { position: absolute; top: 0; left: 0; width: 1px !important; height: 1px !important; opacity: 0; margin: 0; }
.cf-opt-body {
  display: block; height: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: var(--radius);
  background: var(--bg);
}
.cf-opt:hover .cf-opt-body { border-color: #B9C0C5; }
.cf-opt-t { display: block; font-size: 15px; font-weight: 700; }
.cf-opt-s { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.cf-opt-input:checked + .cf-opt-body { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cf-opt-input:checked + .cf-opt-body .cf-opt-t::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--good); }
.cf-opt-input:focus-visible + .cf-opt-body { outline: 2px solid var(--ink); outline-offset: 2px; }
.cf-opt-input:disabled + .cf-opt-body { cursor: default; }
.cf-opt-input:disabled:not(:checked) + .cf-opt-body { opacity: .55; }

.cf-form { margin-top: 20px; }
.cf-form:empty { display: none; }
.cf-form-label { margin-bottom: 8px; }
.cf-form-note { font-size: 14px; color: var(--muted); }
.cf-empty-note { padding: 12px 16px; border: 1px dashed var(--field); border-radius: var(--radius); background: var(--bg); color: var(--muted); font-size: 15px; }
.cf-recs { max-width: none; }
.cf-rec { padding: 12px 4px; }
.cf-rec-t { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cf-rec-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.cf-cat-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cf-cat-grid .wide { grid-column: auto; }
.cf-span2 { grid-column: 1 / -1; }

/* Split editor */
.cf-split-head, .cf-split-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 128px 32px; gap: 8px; align-items: center; }
.cf-split-head { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cf-split-head .num { text-align: right; }
.cf-split-rows { display: grid; gap: 8px; margin-top: 6px; }
.cf-split-row { border-radius: var(--radius); }
.cf-split-row.row-bad { margin: 0 -8px; padding: 8px; background: var(--bad-bg); }
.cf-sc { min-width: 0; }
.cf-sc-label { display: none; }
.cf-sc-del { display: flex; justify-content: center; }
.cf-split-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; margin-top: 12px; }
.cf-split-foot .link-btn { font-size: 14px; }
.cf-split-figs { display: flex; gap: 24px; }
.cf-split-fig { text-align: right; }
.cf-split-k { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.cf-split-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cf-split-fig.zero .cf-split-v { color: var(--good); }

.cf-foot .actions { margin-top: 20px; }
.cf-fb .fb { max-width: 680px; }
.cf-answer-act { font-weight: 700; }
.cf-answer-lines { margin: 4px 0 0; padding-left: 20px; font-variant-numeric: tabular-nums; }
.cf-answer .link-btn { margin-top: 12px; }

/* Card extras */
.cf-after-note { margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font-size: 14px; }
.cf-noreceipt { padding: 20px 24px; border: 1px dashed var(--field); border-radius: 8px; background: var(--bg); font-size: 15px; }
.cf-noreceipt-t { font-weight: 700; }
.cf-noreceipt p + p { margin-top: 6px; color: var(--muted); }
.cf-noreceipt .btn { margin-top: 16px; }
.cf-roll-wrap { max-width: 560px; }
.cf-roll-wrap + .cf-roll-wrap { margin-top: 32px; }
.cf-roll { width: 100%; border-collapse: collapse; font-size: 15px; }
.cf-roll td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.cf-roll td.num { padding-left: 16px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-roll tr.grand td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; }
.cf-roll-in input { width: 140px; height: 36px; }
.cf-roll-note { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .cf-detail-in.has-side { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
}
@media (max-width: 900px) {
  .cf-detail-in.has-side { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cf-side { order: -1; max-width: 480px; }
}
@media (max-width: 720px) {
  .cf-intro { margin-top: 24px; }
  .cf-acct { margin-top: 32px; padding: 16px; }
  .cf-toolbar { flex-direction: column; align-items: stretch; gap: 0; }
  .cf-tabs { border-bottom: 1px solid var(--line); }
  .cf-filter { flex-wrap: wrap; padding: 12px 0; }
  .cf-head { display: none; }
  .cf-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "date desc amt" "date desc act";
    row-gap: 6px; column-gap: 12px; align-items: start;
  }
  .cf-date { grid-area: date; padding-top: 1px; }
  .cf-desc { grid-area: desc; }
  .cf-out, .cf-in { grid-area: amt; }
  .cf-amt:empty { display: none; }
  .cf-amt-k { display: inline; font-size: 12px; color: var(--muted); }
  .cf-act { grid-area: act; }
  .cf-open-btn { min-height: 32px; padding: 4px 14px; }
  .cf-detail { padding: 16px; }
  .cf-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cf-cat-grid { grid-template-columns: minmax(0, 1fr); }
  .cf-split-head { display: none; }
  .cf-split-rows { gap: 0; }
  .cf-split-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
    grid-template-areas: "acct acct del" "cls amt amt";
    padding: 12px 0; border-top: 1px solid var(--line); border-radius: 0; row-gap: 10px;
  }
  .cf-split-row.row-bad { margin: 0 -8px; padding: 12px 8px; border-radius: var(--radius); border-top-color: transparent; }
  .cf-sc-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .cf-sc-acct { grid-area: acct; }
  .cf-sc-cls { grid-area: cls; }
  .cf-sc-amt { grid-area: amt; }
  .cf-sc-del { grid-area: del; align-self: end; padding-bottom: 4px; }
  .cf-split-foot { flex-direction: column; }
  .cf-split-figs { width: 100%; justify-content: space-between; gap: 12px; }
  .cf-roll-in input { width: 120px; }
}
