/* Spending: stacked share/total chart (screens/insights.js, PLAN3, SPEC §5.2). */
.spend-card { position: relative; padding: 16px; }
.spend-head small { display: block; font: 500 calc(14px * var(--font-scale, 1)) var(--font-body); color: var(--ink2); }
.spend-amt { margin-top: 4px; height: 40px; white-space: nowrap; font: 500 calc(16px * var(--font-scale, 1)) var(--font-body); color: var(--ink2); }
.spend-amt .sc-big { font-size: calc(30px * var(--font-scale, 1)); color: var(--ink); }
.sc-top { margin-top: 12px; }
.spend-sec { margin-top: 22px; }
.sc { position: relative; }
.sc .seg { display: inline-flex; height: 40px; padding: 3px; }
.sc .seg-opt { white-space: nowrap; min-width: 0; padding: 0 12px; border-radius: 9px; font: 600 calc(14px * var(--font-scale, 1)) var(--font-body); color: var(--ink2); }
.sc .seg-opt.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sc-mid .seg { display: flex; height: 32px; padding: 2px; }
.sc-mid .seg-opt { flex: 1; padding: 0 10px; font-size: max(11px, calc(12px * var(--font-scale, 1))); border-radius: 8px; }
.sc-readout { height: 70px; margin-top: 14px; }
/* E14: "See them" shares line 1; line 2 has the full width and may wrap
   to two lines inside its fixed height, never truncated. */
.sc-r1 { height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-r1t { min-width: 0; font: 400 calc(14px * var(--font-scale, 1)) var(--font-body); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-r2 { height: 46px; display: flex; align-items: center; }
.sc-r2t { min-width: 0; font: 400 calc(15px * var(--font-scale, 1))/1.2 var(--font-body); color: var(--ink2); }
.sc-r2t .sc-big { font-size: calc(24px * var(--font-scale, 1)); line-height: 1; }
.sc-big { font: 500 calc(28px * var(--font-scale, 1)) var(--font-display); color: var(--ink); letter-spacing: -.01em; }
.sc-see { flex: none; }
.sc-mid { height: 60px; display: flex; flex-direction: column; justify-content: space-between; margin-top: 6px; }
.sc-mid .sc-legend { order: 2; height: 18px; align-items: center; }
.sc-legend { display: flex; gap: 14px; font: 500 max(11px, calc(12px * var(--font-scale, 1))) var(--font-body); color: var(--ink2); white-space: nowrap; overflow: hidden; }
.sc-legend .dim { opacity: .4; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw.mine { background: var(--primary); }
.sw.others { background: #F0D9CB; border: 1px solid #C07A5A; }
.sc-plot { position: relative; height: 150px; margin: 12px 44px 0 0; container-type: inline-size; border-bottom: 1.5px solid var(--line); }
.sc-gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.sc-gl.top { top: 0; } .sc-gl.half { top: 50%; }
.sc-gl span { position: absolute; right: -44px; top: -8px; width: 40px; text-align: right; font: 500 max(11px, calc(11px * var(--font-scale, 1))) var(--font-body); color: var(--ink2); transition: opacity 120ms; }
.sc-hair { position: absolute; top: -1px; left: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); opacity: 0; }
.sc.cold .sc-hair { opacity: 1; animation: hair 1s var(--ease) infinite; }
@keyframes hair { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.sc-slot { position: absolute; left: 0; bottom: 0; height: 100%; width: calc(100cqw / 12); padding: 0; border-radius: 6px 6px 0 0; transition: transform var(--m-morph) var(--ease), background-color 120ms; }
.sc-slot.sel { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.sc-slot:disabled { cursor: default; }
.sc-seg { position: absolute; left: 18%; right: 18%; bottom: 0; height: 100%; transform-origin: 50% 100%; transition: transform var(--m-morph) var(--ease), background-color var(--m-morph), border-color var(--m-morph); }
.sc-seg.mine { background: var(--primary); border-radius: 2px; }
.sc-seg.others { background: #F0D9CB; border: 1px solid #C07A5A; border-radius: 3px; }
.sc.m-total .sc-seg.others { background: var(--bar); border-color: var(--bar); }
.sc.loading .sc-seg.others { background: var(--sunk); border-color: var(--sunk); }
.sc-axis { position: relative; height: 38px; margin-right: 44px; container-type: inline-size; }
.sc-x { position: absolute; left: 0; top: 4px; width: calc(100cqw / 12); text-align: center; font: 500 max(11px, calc(12px * var(--font-scale, 1))) var(--font-body); color: var(--ink2); transition: transform var(--m-morph) var(--ease); }
.sc-x.sel { color: var(--primary); font-weight: 700; text-decoration: underline 2px; text-underline-offset: 3px; }
.sc-xl { display: block; animation: xl-in 240ms both; white-space: nowrap; }
.sc-xs { display: block; height: 14px; font: 500 max(10px, calc(10px * var(--font-scale, 1)))/14px var(--font-body); color: var(--ink3); text-decoration: none; }
@keyframes xl-in { 0%, 50% { opacity: 0; } to { opacity: 1; } }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.sc-note { font: 400 calc(13px * var(--font-scale, 1))/1.4 var(--font-body); color: var(--ink2); }
.sc-table-toggle { flex: none; font-size: calc(13px * var(--font-scale, 1)); }
.sc-table { width: 100%; margin-top: 8px; border-collapse: collapse; font: 400 calc(13px * var(--font-scale, 1)) var(--font-body); }
.sc-table th, .sc-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.sc-table th[scope="row"], .sc-table thead th:first-child { text-align: left; }
.who-paid { margin-top: 0; }
.wp-row { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.wp-row:last-child { border-bottom: 0; }
.wp-name { width: 32%; min-width: 0; font: 600 calc(15px * var(--font-scale, 1)) var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-bar { flex: 1; height: 10px; border-radius: 5px; overflow: hidden; }
.wp-bar i { display: block; height: 100%; border-radius: 5px; background: var(--bar); transform-origin: left; }
.wp-row b { font: 600 calc(15px * var(--font-scale, 1)) var(--font-body); white-space: nowrap; }
.wp-row.skel .sk.av { width: 36px; height: 36px; border-radius: 50%; }
.wp-row.skel .sk.ln { flex: 1; height: 12px; }
@media (prefers-reduced-motion: reduce) {
  .sc-slot, .sc-seg, .sc-x, .sc-gl span { transition: none !important; }
  .sc-xl { animation: none; }
  .sc.cold .sc-hair { animation: none; transform: none; }
}
/* G4: axis labels keep full contrast near the tab bar: no bottom fade on
   Spending (the Add button fades out over the chart instead, F11), and a
   little room under the labels. */
.has-tabs .screen:has(#panel-spending:not([hidden]))::after { display: none; }
.sc-axis { height: 44px; }
