/* The scenario cards, Plans and the scenario screen (run F-EM2). Linked
 * after ember.css, whose card rules these build on.
 *
 * design/ai-first/SPEC.md §3 and §6: charts are SVG to one scale, grid
 * lines in --edge, labels in --faint at 10 px, the endpoint marked; amber
 * the first line, peach the second, cool at 16% a range's band. A card never
 * scrolls sideways. Never red: a step not seen is the one quiet nudge. */

/* A receipt chip outside the conversation: Plans and the scenario screen. */
.plans .num, .scenscreen .num, .ecard .num {
  display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; font: inherit;
  color: var(--gold); font-weight: 600; text-decoration: underline dotted rgba(255, 209, 102, .6); text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.ecard .num.v { color: var(--ink2); font-variant-numeric: tabular-nums; }
.ecard .num.up { color: var(--cream); }
.ecard .num.dn { color: var(--peach); }

/* The scenario's note: today's dollars, and the Estimate label in peach. */
.ecard .snote, .scenscreen .snote { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); }
.snote .est {
  display: inline-block; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: 1; letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--peach); border: 1px solid var(--peach); border-radius: 999px; padding: 2px 6px; vertical-align: 1px;
}
.ecard .unit, .scenscreen .unit { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); }

/* ---- a chart: the SVG stretched to the card, the words over it as HTML ---- */
.ecard .chart { position: relative; width: 100%; height: 120px; margin: 6px 0 18px; }
.ecard .chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ecard .chart .grid { stroke: var(--edge); stroke-width: 1; }
.ecard .chart .ln { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ecard .chart .ln.amber, .ecard .chart .pole.amber { stroke: var(--amber); }
.ecard .chart .ln.peach, .ecard .chart .pole.peach { stroke: var(--peach); }
.ecard .chart .ln.cream, .ecard .chart .pole.cream { stroke: var(--cream); }
.ecard .chart .ln.cool { stroke: var(--cool); }
.ecard .chart .bandfill { fill: rgba(127, 176, 216, .16); stroke: none; }
.ecard .chart .target { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 3; }
.ecard .chart .pole { stroke-width: 1; stroke-dasharray: 2 2; opacity: .8; }
.ecard .chart .pole.ghost { stroke: var(--faint); stroke-dasharray: 1 3; }
.ecard .chart .layer { position: absolute; inset: 0; pointer-events: none; }
.ecard .chart .dot {
  position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 0 2px var(--wall);
}
.ecard .chart .dot.peach { background: var(--peach); }
.ecard .chart .dot.cream { background: var(--cream); }
.ecard .chart .dot.cool { background: var(--cool); }
.ecard .chart .tlab { position: absolute; left: 0; transform: translateY(-115%); font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: 1; color: var(--faint); }
.ecard .chart .flag { position: absolute; top: -2px; }
.ecard .flag {
  display: inline-block; width: 9px; height: 7px; margin-left: -1px; background: var(--amber);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.ecard .flag.peach { background: var(--peach); }
.ecard .flag.cream { background: var(--cream); }
.ecard .flag.ghost { background: none; box-shadow: inset 0 0 0 1px var(--faint); clip-path: none; width: 7px; height: 7px; border-radius: 1px; }
/* The years along the foot: the first, the last, the middle one placed. */
.ecard .chart .years { position: absolute; left: 0; right: 0; top: 100%; height: 14px; margin-top: 3px; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); color: var(--faint); }
.ecard .chart .years span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ecard .chart .years .first { left: 0; transform: none; }
.ecard .chart .years .last { right: 0; left: auto; transform: none; }
.ecard .legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .legend li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.ecard .legend .sw { flex: none; width: 12px; height: 2px; background: var(--amber); }
.ecard .legend .sw.peach { background: var(--peach); }
.ecard .legend .sw.cream { background: var(--cream); }
.ecard .legend .sw.cool { background: var(--cool); }
.ecard .legend .sw.band { height: 8px; background: rgba(127, 176, 216, .32); }
.ecard .flags { list-style: none; margin: 0; padding: 0; }
.ecard .flags li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--edge); font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); }
.ecard .flags li .l { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ecard .flags li .num { flex: none; }
.ecard .flags li.was { color: var(--faint); }
.ecard .flags li.was .num { color: var(--softc); }
/* Range: the headline is the band's two ends, in the pixel face. */
.ecard .big.band { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.ecard .big.band .num { color: var(--amber); text-decoration-thickness: 1px; }
.ecard .big.band .to { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .line.note { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .line.foot { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); }

/* ---- Checklist: boxes, each step's look-for line, its state ---- */
.ecard .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ecard .steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--edge); }
.ecard .steps li:first-child { border-top: 0; }
.ecard .steps .box {
  flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 4px; border: 1.5px solid var(--softc);
  display: grid; place-items: center;
}
.ecard .steps .box.on { background: var(--amber); border-color: var(--amber); }
.ecard .steps .box.on::after {
  content: ''; width: 9px; height: 5px; border: solid var(--ground); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg);
}
.ecard .steps .sb { min-width: 0; display: grid; gap: 2px; }
.ecard .steps p { margin: 0; overflow-wrap: anywhere; }
.ecard .steps .look { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .steps .state { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); }
.ecard .steps .state.verified, .ecard .steps .state.late { color: var(--cream); }
.ecard .steps .state.overdue { color: var(--amber); }
.ecard .steps .state.unseen { color: var(--cool); }
.ecard .link, .scenscreen .link {
  justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--amber); cursor: pointer;
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: var(--lh-small); text-align: left; text-decoration: underline; text-underline-offset: 2px;
}
.ecard .planhead { color: var(--ink2); }
.ecard .clines { display: grid; gap: 6px; }
.ecard .clines .line { overflow-wrap: anywhere; }

/* ---- Plans' "Your plan" ---- */
.plans { display: grid; gap: 12px; font-family: var(--body-face); color: var(--ink2); min-width: 0; }
.plans > .ecard, .scenscreen .ecard { min-width: 0; }
.plans .subhead {
  margin: 8px 0 -4px; padding: 0 4px; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--rail);
}
.plans .pnote, .scenscreen .pnote { margin: 0; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.pnote.cool { color: var(--cool); }
.pnote.stale { color: var(--amber); }
.plans .plancard { border-color: rgba(255, 180, 84, .55); }
.plans .ptitle { margin: 0; font-family: var(--body-face); font-weight: 600; font-size: var(--t-title); line-height: var(--lh-title); color: var(--ink2); }
.plans .line.standing { font-weight: 600; }
.plans .line.standing.waiting { color: var(--amber); }
.plans .ways, .scenscreen .ways { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ecard .ways li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 10px; }
.ecard .ways li.default { border-color: var(--amber); }
.ecard .ways .tag { justify-self: start; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: 1; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--ground); background: var(--amber); border-radius: 999px; padding: 3px 6px; }
.ecard .ways p { margin: 0; overflow-wrap: anywhere; }
.ecard .ways .wf { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.askbtn.ghost { background: none; border-color: var(--edge); color: var(--softc); }
.askbtn:disabled { opacity: .5; cursor: default; }

/* ---- the scenario screen: one saved scenario, full height ---- */
.scenscreen {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; min-width: 0;
  background: var(--ground); font-family: var(--body-face); color: var(--ink2); animation: rise var(--dur-fast) var(--ease);
}
.scenscreen .shead { flex: none; display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--edge); }
.scenscreen .back { border: 0; background: none; color: var(--amber); font-family: var(--body-face); font-weight: 600; font-size: var(--t-body); line-height: 1; padding: 8px 4px; cursor: pointer; }
.scenscreen .sbody {
  flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; padding: 12px 16px 28px; display: grid; gap: 12px; align-content: start;
  overscroll-behavior-y: contain;
}
.scenscreen .stop { display: grid; gap: 4px; min-width: 0; }
.scenscreen .stop .k { font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--rail); }
.scenscreen .stitle { margin: 0; font-family: var(--body-face); font-weight: 600; font-size: var(--t-title); line-height: var(--lh-title); }
.scenscreen .stop .big { font-family: var(--body-face); font-weight: 700; font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: var(--ls-figure); color: var(--gold); overflow-wrap: anywhere; }
.scenscreen .stop .rc {
  justify-self: start; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--body-face); font-weight: 400; font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); text-decoration: underline dotted rgba(142, 122, 110, .7); text-underline-offset: 2px;
}
.scenscreen .line { margin: 0; font-family: var(--body-face); font-size: var(--t-read); line-height: var(--lh-read); overflow-wrap: anywhere; }
.scenscreen .ecard .line { font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); }
.scenscreen .firm { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.scenscreen .firm li { display: grid; gap: 2px; }
.scenscreen .assumes summary { cursor: pointer; color: var(--amber); font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: var(--lh-small); }
.scenscreen .assumes .line { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); margin-top: 6px; }
.scenscreen .flagnote { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.scenscreen .makeplan { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.scenscreen .makeplan > .ecard { justify-self: stretch; }
.scenscreen .sbody > .askbtn { justify-self: start; }

/* A receipt outside the conversation: where it came from, how old, the formula. */
.planpop {
  position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 30; display: grid; gap: 4px;
  background: var(--panel); border: 1px solid var(--amber); border-radius: 12px; padding: 10px 34px 10px 12px;
  font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink2); box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
}
.planpop[hidden] { display: none; }
.planpop b { color: var(--amber); font-weight: 600; }
.planpop .x { position: absolute; right: 6px; top: 4px; border: 0; background: none; color: var(--softc); font: 700 18px/1 var(--body-face); padding: 4px 6px; cursor: pointer; }
.planpop .formula { color: var(--softc); }
.planpop .age.stale { color: var(--amber); }
.planpop .age.cool { color: var(--cool); }
