/* Family E (Tools and My Wealth): only the parts system.css does not have, from the approved mock-ups
   (docs/premium/phase-d/redesign/03-family-E-workspace/family.css, E-1 to E-3 and E-7). Tokens come from system.css. */

/* E-1 tool layout: form beside the result from 900 px, stacked below */
.ds .tool{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--s5);align-items:start;padding-bottom:var(--s5)}
.ds .tool>*{min-width:0}
@media (min-width:900px){.ds .tool{grid-template-columns:400px minmax(0,1fr);gap:var(--s6)}.ds .tool>.formcard{position:sticky;top:calc(var(--bar-h) + 16px)}}
.ds .formcard,.ds .addform{display:grid;gap:var(--s4)}
.ds .two{display:grid;grid-template-columns:1fr 1fr;gap:var(--s3)}
.ds .acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ds .formcard .acts .btn.primary{flex:1}
.ds .pchips{display:flex;flex-wrap:wrap;gap:6px}
.ds .formcard details.more .body{display:grid;gap:var(--s3);padding-left:0}
.ds .back{margin-left:-8px;margin-bottom:6px}
.ds .dca-tool .two{grid-template-columns:repeat(2,minmax(0,1fr))}
.ds .dca-tool .result{grid-template-columns:minmax(0,1fr);container-type:inline-size}
.ds .dca-tool .dca-ending dd{font-size:clamp(17px,3.7cqi,28px)}
.ds .dca-tool input[type=date]{width:100%;min-width:0;padding-inline:6px;font-size:14px}
.ds .dca-tool .chipin{min-width:0}
.ds .dca-tool .chipin input{min-width:0}
.ds .dca-tool .tok,.ds .dca-tool .tok .cap{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.ds .dca-tool .dca-table{width:100%;font-size:var(--t-small)}
.ds .dca-tool .dca-table th[scope=row]{text-align:left}
.ds .dca-tool .dca-table td{overflow-wrap:anywhere}
.ds .dca-tool .dca-ledger{margin-top:var(--s2)}
.ds .dca-swatch{display:inline-block;width:.75em;height:.75em;margin-inline-end:.45em;border-radius:3px;background:var(--signal);border:1px solid color-mix(in srgb,var(--signal) 72%,var(--ink))}
#dcaEmbed{padding:2px}
@media (min-width:900px){.ds #dcaEmbed .formcard{position:static}}
@container (max-width:640px){
  .ds .dca-tool .dca-table tr{display:grid;gap:4px;padding:8px 0}
  .ds .dca-tool .dca-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .ds .dca-tool .dca-table td{display:flex;justify-content:space-between;gap:8px;padding:4px 0}
  .ds .dca-tool .dca-table td::before{content:attr(data-k);color:var(--muted);text-align:left}
  .ds .dca-tool .dca-table th[scope=row]{padding:4px 0}
  .ds .dca-tool .dca-table caption{display:block}
}
@media (max-width:359px){.ds .dca-tool .two{grid-template-columns:minmax(0,1fr)}}

/* E-2 fold: after a run on phones the form folds to one "Change inputs" row, so the answer is on the first screen */
.ds .fold{display:none}
@media (max-width:899px){
  .ds .tool[data-ran] .fold{display:flex;align-items:center;gap:10px;width:100%;min-height:var(--tap);padding:8px 12px;border:1px solid var(--ctl);border-radius:var(--r-md);background:var(--panel);color:var(--ink);text-align:left;cursor:pointer;font:inherit;font-size:var(--t-small)}
  .ds .tool[data-ran] .fold .sum{flex:1;min-width:0;color:var(--muted)}  /* F-08: the summary wraps on a phone, never cut off */
  .ds .tool[data-ran] .fold b{color:var(--accent-strong);white-space:nowrap}
  .ds .tool[data-ran]:not([data-open]) .formcard{display:none}
}

/* E-3 result block: the answer first and large, in a polite live region */
.ds .result{display:grid;gap:var(--s3);min-width:0}
.ds .result .ask{font-size:var(--t-small);color:var(--muted);font-weight:600}
.ds .big{font:700 var(--t-display)/1.05 var(--f-body);letter-spacing:-.025em;font-variant-numeric:tabular-nums lining-nums}
.ds .pair{display:grid;grid-template-columns:1fr 1fr;gap:0}
.ds .pair>div{padding:4px var(--s4) 4px 0;min-width:0}
.ds .pair>div+div{padding-left:var(--s4);border-left:1px solid var(--line)}
@media (max-width:599px){.ds .pair{grid-template-columns:1fr}.ds .pair>div+div{padding-left:0;border-left:0;border-top:1px solid var(--line)}}  /* F-08: two big A$ figures stack on a phone (A$213,778 at 36 px does not fit half of 390 px) */
.ds .pair .k{font-size:var(--t-small);color:var(--muted);font-weight:600}
.ds .pair .big{font-size:var(--t-3xl)}
.ds .pair .s{font-size:var(--t-cap);color:var(--muted)}
.ds .result-line{max-width:var(--measure)}
.ds .common{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
.ds .result .chart-card{margin-top:var(--s3)}
.ds .cplot{height:420px;margin-top:8px}  /* amendment 1: at least 420 px at 1440, 300 px on phones */
.ds .ctools{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;margin-top:8px}
.ds .chart-card .chartcredit{font-size:var(--t-cap);color:var(--muted);margin-top:8px}
@media (max-width:599px){.ds .cplot{height:300px}}

/* The chart card is the dark chart surface in both themes (VISUAL-IMPACT-AMENDMENT 1): the dark theme's tokens, scoped to the
   card, so the lines (read with ctok), legend, sentence and table under them stay readable on it */
.ds .result .chart-card{background:var(--chart-bg);border-color:transparent;border-radius:var(--r-lg);color-scheme:dark;
  --panel:var(--chart-bg);--ink:#E8ECEA;--ink2:#E8ECEA;--muted:#A9B3BC;--faint:#A9B3BC;--line:#25303A;--line-strong:#5F6A72;--inset:#1B252E;--hover:#1D2731;--ctl:#6B7785;
  --accent:#C9D8EA;--accent-strong:#C9D8EA;--up:#7CC47F;--down:#EC8A8A;--teal:#4FC1B8;  /* WO29: the dark theme's derived tokens */--s-focus:#6AA8F0;--s-gold:#D9B65C;--s-silver:#C98BC9;--s-btc:#A9BC5A;
  --s-share:#9C9CF5;--s-cash:#8A949E;--s-neutral:#C3CCD4;color:var(--ink)}
.ds .result .chart-card a{color:var(--accent-strong)}

/* E-7 tool rows on the hub: icon, name, one-line purpose, quiet Open */
.ds .trows{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.ds .trows>li{border-bottom:1px solid var(--line)}
.ds .trow{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:2px 14px;align-items:center;padding:16px 4px;color:inherit;text-decoration:none;min-height:72px}
.ds a.trow:hover{background:var(--hover)}
.ds .trow>.i{color:var(--accent);width:24px;height:24px}
.ds .trow b{font-size:var(--t-h3);font-weight:600}
.ds .trow .p{grid-column:2;color:var(--muted);font-size:var(--t-small)}
.ds .trow .go{grid-row:1/span 2;grid-column:3;display:inline-flex;align-items:center;gap:4px;min-height:var(--tap);color:var(--accent-strong);font-weight:600;font-size:var(--t-small);white-space:nowrap}
.ds .trows .priv{margin:12px 0;padding:var(--s4)}
.ds .trows .priv .trow{padding-bottom:4px}
@media (max-width:599px){.ds .trow .go span{display:none}}

/* My Wealth (address /assets). Spec K: card padding, type and the reading column come from system.css; nothing here overrides them */
.ds .rows>li{position:relative}
.ds .tbl td{position:relative}
.ds .phead .chip-priv{margin-left:4px}
.ds .addform{max-width:var(--measure);margin-bottom:var(--s4)}
.ds .watchbox{max-width:var(--measure);margin-bottom:var(--s4)}
.ds .wline{display:flex;gap:8px}
.ds .wline .input{flex:1;min-width:0}
.ds .pick{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.ds #hmsg,.ds #wmsg{max-width:var(--measure)}
.ds #hmsg .state,.ds #wmsg .state{margin-bottom:var(--s4)}
.ds .expo{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:var(--s5);margin-top:var(--s4)}
.ds .split{list-style:none;margin:8px 0 0;padding:0}
.ds .split li{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid var(--line);font-size:var(--t-small)}
.ds .row .t2 .spark{width:96px;height:28px}
.ds #htab .iconbtn{margin:-10px 0}

/* WC-3: a box's problem, in words under it (never colour alone) */
.ferr{display:block;font-size:var(--t-cap);color:var(--error);margin-top:4px}.ferr:empty{display:none}[aria-invalid=true]{border-color:var(--error)}
/* Tools look (Jason, 22 Nov 2026: "why have pages under this section gone away from our style?"). The Home, Shares and ETF look on
   every tool: white cards with the soft shadow, teal accents from the app palette (--brand), a "You get" line under each title,
   short labels with an ⓘ for the detail, folds inside a form at body size, and one big answer first. */
.ds .youget{display:flex;align-items:flex-start;gap:8px;margin-top:var(--s3);max-width:60ch;color:var(--muted);font-size:var(--t-base);line-height:1.45}
.ds .youget .i{flex:none;width:18px;height:18px;margin-top:3px;color:var(--brand)}
.ds .youget b{color:var(--ink);font-weight:600}
/* the hub: one card per tool, two across on a PC, one on a phone */
.ds .tgrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s4)}
.ds .tgrid>li{display:flex;min-width:0}
@media (max-width:719px){.ds .tgrid{grid-template-columns:minmax(0,1fr);gap:var(--s3)}}
.ds .toolcard{flex:1;display:flex;flex-direction:column;gap:var(--s2);min-width:0;padding:var(--s5);background:var(--panel);border:1px solid var(--line);
  border-top:3px solid var(--tc,var(--brand));border-radius:var(--r-lg);box-shadow:var(--shadow);color:inherit;text-decoration:none;transition:border-color .15s,box-shadow .15s}
.ds a.toolcard:hover{border-color:color-mix(in srgb,var(--tc,var(--brand)) 45%,var(--line));border-top-color:var(--tc,var(--brand));box-shadow:var(--shadow-pop)}
.ds a.toolcard:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
/* no-pills (Jason, 22 Nov): the tool's icon stands bare in its colour, a little larger, no tinted square */
.ds .toolcard .tico{display:grid;place-items:start;color:var(--tc,var(--brand))}
.ds .toolcard .tico .i{width:30px;height:30px;stroke-width:1.7}
.ds .toolcard h3{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:var(--s1);font-size:var(--t-xl);font-weight:700;line-height:1.25}
.ds .toolcard .p{color:var(--muted);line-height:1.5}
.ds .toolcard .get{font-size:var(--t-xs);color:var(--muted)}
.ds .toolcard .get b{color:var(--ink);font-weight:600}
.ds .toolcard .go{margin-top:auto;padding-top:var(--s2);display:inline-flex;align-items:center;gap:6px;min-height:var(--tap);color:var(--brand);font-weight:600}
@media (max-width:599px){.ds .toolcard{padding:var(--s4)}}
/* forms: the app's card, labels with an ⓘ, a fold inside a form at body size (the 22 px fold title is for page sections) */
.ds .tool .formcard{border-radius:var(--r-lg);box-shadow:var(--shadow)}
.ds .flab{position:relative;display:flex;align-items:center;gap:2px;min-width:0}
.ds .flab>label{min-width:0;font-size:var(--t-cap);font-weight:600;color:var(--muted)}  /* as system.css .field>label */
.ds .flab .ti{position:static}
.ds .flab .ti>summary{display:grid;place-items:center;width:32px;height:32px;margin:-6px 0;border-radius:50%;cursor:pointer;list-style:none;color:var(--muted)}
.ds .flab .ti>summary::-webkit-details-marker{display:none}
.ds .flab .ti>summary:hover,.ds .flab .ti[open]>summary{color:var(--brand)}
.ds .flab .ti>summary .i{width:16px;height:16px}
.ds .flab .ti-b{position:absolute;z-index:8;left:0;right:0;top:calc(100% + 4px);margin:0;padding:10px 12px;background:var(--panel);border:1px solid var(--line-strong);
  border-radius:var(--r-md);box-shadow:var(--shadow-pop);color:var(--ink);font-size:var(--t-xs);font-weight:400;line-height:1.45;min-width:200px}
.ds .formcard details.more{padding:0}
.ds .formcard details.more>summary{min-height:var(--tap);font-size:var(--t-base);font-weight:600}
.ds .formcard details.more[open]{box-shadow:none;padding:4px 14px 12px}
.ds .formcard details.more[open]>summary{margin:0 -14px var(--s3);padding:6px 14px}
.ds .pchip[aria-pressed=true]{background:color-mix(in srgb,var(--brand) 12%,var(--panel));border-color:var(--brand);color:var(--ink)}
/* the answer first: one card with the big figure and a bar of what you put in and the growth (compound) */
.ds .rhero{padding:var(--s5);background:color-mix(in srgb,var(--brand) 6%,var(--panel));border:1px solid color-mix(in srgb,var(--brand) 26%,var(--line));
  border-radius:var(--r-lg);margin-bottom:var(--s4)}
.ds .rhero .ask{color:var(--muted)}
.ds .rhero>.big{font-size:var(--t-3xl);font-weight:700;letter-spacing:-.02em;line-height:1.1;margin-top:var(--s1)}
.ds .rhero .pair{margin-top:var(--s2)}
.ds .rhero .pair .big{font-size:var(--t-2xl)}
.ds .gbar{display:flex;height:14px;margin-top:var(--s4);border-radius:var(--r-pill);overflow:hidden;background:var(--inset)}
.ds .gbar i{display:block;height:100%;transition:width .2s}
.ds .gbar .gin,.ds .rhero .sw.in{background:var(--s-cash)}
.ds .gbar .ggr,.ds .rhero .sw.gr{background:var(--brand)}
.ds .rhero .sw{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:baseline}
@media (max-width:599px){.ds .rhero{padding:var(--s4)}.ds .rhero>.big{font-size:var(--t-2xl)}}
/* the DCA result in the app's cards: white plan cards with the soft shadow, StackIQ in teal, the difference marked in teal */
.ds .dca-tool .dca-period h2{font-size:var(--t-xl)}
.ds .dca-tool .dca-plan{border-radius:var(--r-lg);background:var(--panel);box-shadow:var(--shadow);border-top:3px solid var(--s-neutral)}
.ds .dca-tool .dca-plan.stackiq{background:color-mix(in srgb,var(--brand) 6%,var(--panel));border-top-color:var(--brand)}
.ds .dca-tool .dca-plan.dca-diff{border-top-color:var(--brand)}
.ds .dca-tool .dca-preview{border-radius:var(--r-lg);box-shadow:var(--shadow)}
