/* Accounts screen layout. Loaded by the router on first visit. */

.acs-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.acs-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (max-width: 1279px) {
  .acs-grid { grid-template-columns: minmax(0, 1fr); }
  .acs-col { display: contents; }
  .acs-sum { order: 1; } .acs-list { order: 2; } .acs-src { order: 3; }
}
@media (max-width: 639px) { .acs-grid { gap: 12px; } }

/* Net worth summary */
.acs-big { font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 8px; }
.acs-eq { font-size: var(--t-s); line-height: 1.5; }
.acs-delta { font-size: var(--t-s); line-height: 1.4; margin-top: 8px; color: var(--ink); }
.acs-btns { margin-top: 10px; }
.acs-gname { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }

/* Where the numbers come from; paragraphs of two or more sentences are 16px / 1.6 */
.acs-src h2 { margin-bottom: 8px; }
.acs-body { font-size: var(--t-m); line-height: 1.6; }
.acs-body + .acs-body { margin-top: 8px; }

/* Empty state */
.acs-empty { max-width: 760px; display: grid; gap: 12px; padding: 24px; }
.acs-empty h2 { font-size: var(--t-l); margin: 0; }

/* The saved note is the shared form kit's (.fk-saved) */
.fk-saved.acs-flash { margin: 0 0 16px; }
.acs-flash:focus { outline: none; }
.acs-flash:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Forms (sheets opened from this screen). Fields, errors and the confirm box are the shared form kit (.fk-*). */
.acs-sheet { max-width: 640px; display: grid; gap: 14px; margin-bottom: 16px; }
.acs-sheet h2 { font-size: var(--t-l); margin: 0; }
.acs-sheet h2:focus { outline: none; }
.acs-sheet h2:focus-visible { outline: 2px solid var(--focus); }
.acs-sheet .fk-field input { font-variant-numeric: tabular-nums; }
.acs-confirm .fk-confirm { margin: 0; }

/* Accounts by type */
.acs-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acs-status:empty { display: none; }
.acs-status { margin: 0 0 8px; color: var(--ink); }
.acs-count { margin-bottom: 4px; }
.acs-group { padding-top: 6px; }
.acs-ghead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: var(--t-s); line-height: 1.3; margin: 10px 0 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.acs-gcount { font-weight: 400; color: var(--muted); font-size: var(--t-xs); }
.acs-gtotal { font-variant-numeric: tabular-nums; }
.acs-gsum { padding: 6px 0 2px; }
.acs-accts { list-style: none; margin: 0; padding: 0; }
.acs-acct { border-bottom: 1px solid var(--line); }
.acs-acct:last-child { border-bottom: 0; }
.acs-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 72px 16rem; gap: 2px 12px; align-items: center; width: 100%;
  grid-template-areas: "ico name spark amt" "ico name spark chg";
  padding: 10px 6px; margin: 0; background: none; border: 0; border-radius: var(--r-s); color: var(--ink);
  font: var(--t-s)/1.35 var(--font); text-align: left; cursor: pointer; }
.acs-row:hover { background: var(--panel-2); }
.acs-row[aria-expanded="true"] { background: var(--ledger-tint); }
.acs-ico { grid-area: ico; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font: 700 13px/1.2 var(--font); }
.acs-name { grid-area: name; min-width: 0; }
.acs-title { display: block; font-weight: 600; }
.acs-row .sub { display: block; font-size: var(--t-xs); line-height: 1.3; color: var(--muted); margin-top: 2px; }
.acs-spark { grid-area: spark; display: flex; align-items: center; }
.acs-amt { grid-area: amt; justify-self: end; align-self: end; font-weight: 600; }
.acs-chg { grid-area: chg; justify-self: end; align-self: start; text-align: right; font-size: var(--t-xs); line-height: 1.3; color: var(--muted); }
.acs-ghead .sw { width: 12px; height: 12px; }

/* One account in detail */
.acs-detail { padding: 6px 6px 16px; }
.acs-detail h4 { font-size: var(--t-s); margin: 8px 0 6px; }
.acs-chart { min-height: 180px; }
.acs-readout { font-size: var(--t-xs); line-height: 1.4; margin: 6px 0; min-height: 1.4em; }
.acs-readout b { font-weight: 600; }
.acs-where { margin-top: 12px; font-size: var(--t-m); line-height: 1.6; }
.acs-where h4 { margin-top: 0; }
.acs-where p + p { margin-top: 6px; }
.acs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.acs-sheet .acs-actions, .acs-empty .acs-actions { margin: 4px 0 0; }
.acs-entries td.acs-entry-acts { white-space: nowrap; }
/* Keeps the hidden "Actions" heading inside the scrolling table, so the page never scrolls sideways */
.acs-detail .tablewrap { position: relative; }
.acs-entries .linkbtn { padding: 6px 4px; }

@media (max-width: 639px) {
  .acs-big { font-size: 32px; }
  .acs-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "ico name amt" "ico chg chg"; padding: 10px 2px; gap: 4px 10px; }
  .acs-spark { display: none; }
  .acs-ico { width: 28px; height: 28px; align-self: start; }
  .acs-amt { align-self: start; }
  .acs-chg { justify-self: start; text-align: left; }
  .acs-detail { padding: 4px 0 14px; }
}
