/* home-more screen styles, round 1 (wave 2, agent D).
   Dashboards: one large number first, one change line, labelled quick actions, then detail rows.
   Rows read label left, value right. Bars carry the percent at the row end. No grid of equal boxes. */

/* page title row (S51): the date line, then the screen name */
.hm-head { min-width: 0; }
.hm-head h1 { margin: 0; overflow-wrap: anywhere; }
.hm-head .weak { overflow-wrap: anywhere; }

/* hero (P8 balance card): one flat brand card, label, one large number, one change line, then a bar with both ends named.
   No gradient and no card art. Every colour is a token. */
.hm-hero { display: block; background: var(--bg-brand); border-color: transparent; color: var(--text-on-action); overflow-wrap: anywhere; }
.hm-hero .weak { color: var(--text-on-action); }
.hm-big { font-size: var(--type-h1); line-height: var(--lh-h1); font-weight: var(--weight-strong); margin-top: var(--space-4); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hm-change { margin-top: var(--space-4); font-size: var(--type-small); line-height: var(--lh-small); }
.hm-hero .btn { margin-top: var(--space-16); }
.hm-hero .btn-primary { background: var(--bg-base); color: var(--text-brand-strong); }
.hm-hero .btn-primary:hover:not(:disabled) { background: var(--bg-base); box-shadow: inset 0 0 0 999px var(--fill-hover); }
.hm-hero .btn-primary:active:not(:disabled) { background: var(--bg-base); box-shadow: inset 0 0 0 999px var(--fill-press); }
.hm-hero :focus-visible { outline-color: var(--text-on-action); }
.hm-hero > .bar { margin-top: var(--space-16); }
.hm-hero .bar { background: color-mix(in srgb, var(--text-on-action) 30%, transparent); }
.hm-hero .bar i { background: var(--text-on-action); }
.hm-ends { display: flex; justify-content: space-between; gap: var(--space-12); margin-top: var(--space-8); font-size: var(--type-tiny); line-height: var(--lh-tiny); }
.hm-ends > div { min-width: 0; }
.hm-ends > div:last-child { text-align: right; }
.hm-ends .hm-end-val { font-weight: var(--weight-strong); font-size: var(--type-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; }

/* collection card (S51 summary card): one ring for the single headline percent, two stacked figures beside it */
.hm-coll { display: flex; align-items: center; gap: var(--space-16); }
.hm-ring { position: relative; flex: none; width: 96px; height: 96px; }
.hm-ring svg { display: block; width: 96px; height: 96px; transform: rotate(-90deg); }
.hm-ring-track { fill: none; stroke: var(--stroke-weak); stroke-width: 10; }
.hm-ring-arc { fill: none; stroke: var(--fill-action); stroke-width: 10; stroke-linecap: round; }
.hm-ring-n { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--type-h4); line-height: var(--lh-h4); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.hm-coll-rows { flex: 1; min-width: 0; }
.hm-coll-rows > div { min-width: 0; padding: var(--space-8) 0; overflow-wrap: anywhere; }
.hm-coll-rows > div + div { border-top: 1px solid var(--stroke-weak); }
.hm-coll-val { font-size: var(--type-h4); line-height: var(--lh-h4); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }

/* day group header (P8 transactions): a small label over a column of rows with signed amounts */
.hm-plus { color: var(--text-success); font-weight: var(--weight-strong); }

/* four labelled quick actions in one row, not boxes with a border each */
.hm-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-16); }
.hm-act { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: var(--space-4); min-height: 80px; padding: var(--space-8) 2px; border: 0; background: none; border-radius: var(--radius-control); cursor: pointer; color: var(--text-strong); font-size: var(--type-tiny); line-height: var(--lh-tiny); text-align: center; transition: background var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.hm-act:hover { background: var(--fill-hover); }
.hm-act:active { background: var(--fill-press); transform: scale(0.97); }
.hm-act:disabled { color: var(--text-weak); cursor: not-allowed; }
.hm-ico { width: 48px; height: 48px; border-radius: var(--radius-full); display: grid; place-items: center; background: var(--fill-brand-weak); color: var(--text-brand); }
.hm-act:disabled .hm-ico { background: var(--fill-disabled); color: var(--icon-disabled); }
.hm-lbl { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--weight-medium); }

/* label left, value right */
.hm-kv { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-12); min-height: 40px; padding: var(--space-8) 0; }
.hm-kv + .hm-kv, .hm-prow + .hm-kv, .hm-kv + .hm-prow { border-top: 1px solid var(--stroke-weak); }
.hm-k { color: var(--text-strong); font-size: var(--type-tiny); line-height: var(--lh-tiny); min-width: 0; }
.hm-v { font-weight: var(--weight-medium); text-align: right; flex-shrink: 0; font-size: var(--type-small); line-height: var(--lh-small); }
.hm-sub { color: var(--text-weak); font-size: var(--type-tiny); line-height: var(--lh-tiny); }

/* bar row: name, bar, percent at the end */
.hm-prow { display: grid; grid-template-columns: minmax(0, 96px) minmax(0, 1fr) auto; gap: var(--space-8); align-items: center; min-height: 40px; padding: var(--space-8) 0; }
.hm-pl { font-size: var(--type-tiny); line-height: var(--lh-tiny); min-width: 0; overflow-wrap: anywhere; }
.hm-pp { min-width: 44px; text-align: right; white-space: nowrap; font-weight: var(--weight-strong); font-size: var(--type-small); line-height: var(--lh-small); }

/* one strip for the next action */
.hm-strip { display: flex; align-items: center; gap: var(--space-12); }
.hm-strip .grow > h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* team member card */
.hm-member { display: block; text-decoration: none; color: inherit; cursor: pointer; }
a.hm-member:hover { box-shadow: inset 0 0 0 999px var(--fill-hover); }
a.hm-member:active { box-shadow: inset 0 0 0 999px var(--fill-press); }
div.hm-member { cursor: default; }
.hm-member-head { display: flex; align-items: center; gap: var(--space-12); margin-bottom: var(--space-8); }
.hm-member .hm-rows { margin-top: var(--space-4); }

/* avatar with optional photo */
.hm-av { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--stroke-brand); color: var(--text-brand-strong); display: grid; place-items: center; font-weight: var(--weight-medium); flex-shrink: 0; overflow: hidden; }
.hm-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-av-lg { width: 72px; height: 72px; font-size: var(--type-h4); line-height: var(--lh-h4); }
.hm-av-xl { width: 128px; height: 128px; font-size: var(--type-h3); line-height: var(--lh-h3); }
.hm-ph-prev { display: grid; place-items: center; padding: var(--space-8) 0; }
.hm-ph-msg { min-height: 20px; margin-top: var(--space-8); text-align: center; font-size: var(--type-tiny); line-height: var(--lh-tiny); color: var(--text-weak); }
.hm-ph-msg.err { color: var(--text-error); }
.hm-file { position: relative; }
.hm-file:focus-within { outline: var(--size-focus-ring) solid var(--stroke-focus); outline-offset: 2px; }
.hm-file input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.hm-file.is-busy { pointer-events: none; opacity: 0.6; }
.hm-prof { display: flex; align-items: center; gap: var(--space-16); }
.hm-prof .btn { margin-top: var(--space-8); }

/* extra and loss table */
.hm-tbl { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; align-items: baseline; column-gap: var(--space-8); }
.hm-tbl > div { padding: var(--space-8) 0; min-height: 40px; font-size: var(--type-tiny); line-height: var(--lh-tiny); border-top: 1px solid var(--stroke-weak); }
.hm-tbl > .hm-th { border-top: 0; color: var(--text-weak); font-weight: var(--weight-medium); }
.hm-tbl > .r { text-align: right; font-variant-numeric: tabular-nums; }
.hm-tbl > .hm-tot { font-weight: var(--weight-strong); }
.hm-deal { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-12); }
.hm-deal .r { text-align: right; flex-shrink: 0; }

/* inline new type input under chips */
.hm-other { margin-top: var(--space-8); }

/* visit product search */
.hm-vsearch { margin-top: var(--space-16); }
.hm-vnote { padding: var(--space-8) 0; color: var(--text-weak); font-size: var(--type-tiny); line-height: var(--lh-tiny); }

@media (prefers-reduced-motion: reduce) { .hm-act { transition: none; } .hm-act:active { transform: none; } }

/* R2-06 photo pen badge: 24px visual, 48px touch target */
.hm-av-wrap { position: relative; flex-shrink: 0; width: 72px; height: 72px; }
.hm-pen { position: absolute; right: -12px; bottom: -12px; width: 48px; height: 48px; border: 0; background: none; border-radius: var(--radius-full); display: grid; place-items: center; cursor: pointer; padding: 0; }
.hm-pen-dot { width: 24px; height: 24px; border-radius: var(--radius-full); display: grid; place-items: center; background: var(--fill-action); color: var(--text-on-action); border: 2px solid var(--surface-card); box-sizing: border-box; }
.hm-pen-dot .ic { width: 14px; height: 14px; }
.hm-pen:hover .hm-pen-dot { background: var(--fill-action-hover, var(--fill-action)); filter: brightness(0.92); }
.hm-pen:active .hm-pen-dot { transform: scale(0.92); }
.hm-pen:focus-visible { outline: var(--size-focus-ring) solid var(--stroke-focus); outline-offset: -4px; }
.pf-change { display: flex; gap: var(--space-8); align-items: stretch; }
.pf-change .input { flex: 1; min-width: 0; }
.pf-change .btn { flex-shrink: 0; }
.hm-ph-list .li { min-height: 56px; }
.hm-ph-list .ic-wrap { display: grid; place-items: center; color: var(--icon-brand); }
.hm-ph-list .t-error .ic-wrap { color: var(--text-error); }
.hm-ph-list .li.hm-file:focus-within { outline: none; }
.hm-ph-list .li:has(input:focus-visible), .hm-ph-list button.li:focus-visible { outline: var(--size-focus-ring) solid var(--stroke-focus); outline-offset: -3px; }
.hm-ph-list .li.is-busy { pointer-events: none; opacity: 0.6; }

/* R3-13: to do rows, the section row of the Dashboard page and the team card footer. Every size is an existing token. */
.td { min-height: 56px; padding-top: var(--space-8); padding-bottom: var(--space-8); }
.td .main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.td-title, .td-sub { display: block; overflow-wrap: anywhere; }
.td-ic { width: 40px; height: 40px; border-radius: var(--radius-full); display: grid; place-items: center; flex-shrink: 0; background: var(--fill-warning-weak); color: var(--text-strong); }
.td-ic.td-done { background: var(--fill-success-weak); color: var(--text-success); }
.td .end { display: flex; align-items: center; }
.hm-hero .hm-ends + .hm-ends { margin-top: var(--space-4); }
.dash-nav { margin-top: var(--space-8); }
.dash-nav .chip { flex: 1 1 auto; }
.hm-foot { margin-top: var(--space-12); padding-top: var(--space-12); border-top: 1px solid var(--stroke-weak); }
.hm-foot-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); margin-bottom: var(--space-12); }
.hm-foot-act { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.hm-foot-act .btn { flex: 1 1 120px; }
