/* pages/targets.css — monthly store targets (#/targets, 2026-11-01). Tokens only (lint_css.js reads this file): colours,
   durations and layers come from tokens.css; table alignment from the shared table layer in styles.css; the verdict chip is
   the shared .badge, its word and its colour together. Motion: none of its own -- the cards rise with every page's first
   paint, and the one reduced-motion guard in styles.css stills that. Bar sizes come from the data (inline width/height). */
.tg { display: flex; flex-direction: column; gap: var(--sp-4); }
.tg > .card, .tg .kpi-row { margin-bottom: 0; }
.tg-sec { margin: var(--sp-2) 0 0; font-size: var(--fs-lg); color: var(--ink-strong); }
.tg h4 { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 650; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; }

/* the controls: month and shop -- they wrap before they widen a phone */
.tg-ctl { padding: var(--sp-4); }
.tg-ctl-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.tg-field { display: flex; flex-direction: column; min-width: 0; }
.tg-field .finput { min-width: 180px; font-size: var(--fs-md); }
@media (max-width: 640px) { .tg-field .finput { font-size: var(--fs-input); } }
.tg-note, .tg-built { margin: var(--sp-3) 0 0; line-height: 1.5; }
.tg-built .ic { vertical-align: -2px; }
.tg-small { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); line-height: 1.5; }

/* one shop */
.tg-shop .card-h { flex-wrap: wrap; gap: var(--sp-2); }
.tg-cur { margin-left: var(--sp-1); background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.tg-chip { white-space: normal; text-transform: none; letter-spacing: 0; }
.tg-chip--none { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }

/* the odds of each commission band */
.tg-odd { display: grid; grid-template-columns: minmax(150px, 1.4fr) 3fr 48px; align-items: center; gap: var(--sp-3); padding: 4px 0; font-size: var(--fs-md); }
.tg-odd-bar { height: 10px; border-radius: var(--r-pill); background: var(--bar-track); overflow: hidden; }
.tg-odd-bar i { display: block; height: 100%; background: var(--bar-fill); border-radius: var(--r-pill); }
.tg-odd .num { text-align: right; font-variant-numeric: tabular-nums; }

/* how the target was set: the owner's minimum as a small bridge, the model's level beside it */
.tg-basis-line { margin: 0 0 var(--sp-2); line-height: 1.5; }
.tg-basis-b { margin-left: var(--sp-1); text-transform: none; letter-spacing: 0; background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.tg-basis--owner { border-color: var(--accent); }
.tg-why { margin: var(--sp-3) 0 0; line-height: 1.5; }

/* the plan per day */
.tg-days { display: flex; align-items: flex-end; gap: 2px; height: 72px; padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.tg-day { flex: 1 1 0; min-width: 3px; height: 100%; display: flex; align-items: flex-end; }
.tg-day i { display: block; width: 100%; background: var(--bar-track); border-radius: 2px 2px 0 0; }
.tg-day.is-done i { background: var(--bar-fill); }
.tg-day.is-shut i { background: var(--line-strong); }

.tg-tbl { width: 100%; }
.tg-hist { max-height: 560px; overflow: auto; }
.tg-events { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink); }
.tg-assume ul { margin: 0; padding-left: var(--sp-5); line-height: 1.5; }
.tg-notes { margin: var(--sp-3) 0 0; line-height: 1.5; }

/* the legend of verdicts */
.tg-legend { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; align-items: baseline; }
.tg-legend dd { margin: 0; line-height: 1.5; color: var(--ink); }

@media (max-width: 640px) {
  .tg-field, .tg-field .finput { width: 100%; }
  .tg-odd { grid-template-columns: 1fr 48px; }
  .tg-odd-bar { grid-column: 1 / -1; grid-row: 2; }
  .tg-legend { grid-template-columns: 1fr; }
}

/* the three scenarios of expected sales: pessimistic · realistic (the sales to plan on, highlighted) · optimistic */
.tg-scen-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.tg-scen-i { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tg-scen-i .tg-small { margin: 0; }
.tg-scen--realistic { border: 2px solid var(--accent); background: var(--surface); }
.tg-scen-v { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.tg-scen--realistic .tg-scen-v { font-size: var(--fs-xl); }
.tg-prev { margin-top: var(--sp-2); }
@media (max-width: 640px) { .tg-scen-row { grid-template-columns: 1fr; } }

/* ==== the dashboard (plan section 4, 2026-11-01): tabs · at a glance · charts · coming months · history · data quality ==== */
/* the tabs: real tabs (one in the Tab order, the arrows move); the row scrolls on a phone rather than wrapping */
.tg-tabs { display: flex; gap: var(--sp-1); margin: 0 0 var(--sp-3); padding: 3px; border-radius: var(--r-md); background: var(--surface-3); overflow-x: auto; scrollbar-width: none; }
.tg-tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 36px; padding: 6px 14px; border: 0;
  border-radius: var(--r-sm); background: transparent; font: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--ink-muted); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.tg-tab:hover { color: var(--ink-strong); }
.tg-tab.on { background: var(--surface); color: var(--brand); box-shadow: var(--sh-1); }
.tg-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tg-panel { display: flex; flex-direction: column; gap: var(--sp-4); }
.tg-panel > .card, .tg-panel .kpi-row { margin-bottom: 0; }

/* each shop at a glance: one tile per shop, the status as colour + icon + sign + word */
.tg-glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); }
.tg-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: var(--sp-4); text-align: left; font: inherit; color: inherit;
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); }
button.tg-tile { cursor: pointer; transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
button.tg-tile:hover { box-shadow: var(--sh-2); }
button.tg-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tg-tile--ok { border-left-color: var(--ok-vivid); }
.tg-tile--warn { border-left-color: var(--warn-vivid); }
.tg-tile--danger { border-left-color: var(--danger-vivid); }
.tg-tile--info { border-left-color: var(--info-vivid); }
.tg-tile-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.tg-tile-n { font-size: var(--fs-base); color: var(--ink-strong); }
.tg-tile-v { font-size: var(--fs-xl); font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tg-tile-v .muted { font-size: var(--fs-md); font-weight: 500; }
.tg-tile-l { font-size: var(--fs-sm); line-height: 1.45; color: var(--ink); font-variant-numeric: tabular-nums; }
.tg-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 750; border: 1px solid transparent; white-space: nowrap; }
.tg-status .ic { width: 13px; height: 13px; }
.tg-status--ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tg-status--warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tg-status--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.tg-status--info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.tg-sign { font-weight: 900; }
/* progress to the target: filled = sales to date, the notch = the plan to date */
.tg-prog { position: relative; display: block; height: 8px; border-radius: var(--r-pill); background: var(--bar-track); overflow: visible; }
.tg-prog-f { display: block; height: 100%; border-radius: var(--r-pill); background: var(--bar-fill); transition: width var(--dur-slow) var(--ease); }
.tg-prog--ok { background: var(--ok-vivid); } .tg-prog--warn { background: var(--warn-vivid); } .tg-prog--danger { background: var(--danger-vivid); } .tg-prog--info { background: var(--info-vivid); }
.tg-prog-m { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; background: var(--ink-strong); border-radius: 1px; }
.tg-rule { margin-top: 0; }
.tg-live { color: var(--info); font-weight: 600; }
.tg-live .ic { width: 13px; height: 13px; vertical-align: -2px; }
.tg-livebar { margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--info-soft); color: var(--info); font-size: var(--fs-md); line-height: 1.5; }
.tg-review { margin: var(--sp-3) 0 0; line-height: 1.5; }

/* the charts: inline SVG, no text inside (the legend carries the figures; the sentence is the aria-label) */
.tg-track { margin-top: var(--sp-4); }
.tg-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.tg-fig { margin: 0; min-width: 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tg-fig-h { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: var(--fs-sm); font-weight: 650; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; }
.tg-svg { display: block; width: 100%; height: auto; }
.tg-grid { stroke: var(--chart-grid); stroke-width: 1; }
.tg-base { stroke: var(--line-strong); stroke-width: 1; }
.tg-goal { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 6 4; }
.tg-l { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tg-l--act { stroke: var(--chart-1); stroke-width: 3; }
.tg-l--plan { stroke: var(--chart-10); stroke-width: 1.6; }
.tg-l--proj { stroke: var(--chart-1); stroke-width: 2; stroke-dasharray: 5 4; opacity: .7; }
.tg-l--ly { stroke: var(--chart-6); stroke-width: 1.6; stroke-dasharray: 1.5 3.5; }
.tg-l--live { stroke: var(--info-vivid); stroke-width: 2; stroke-dasharray: 2 3; }
.tg-dot { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.tg-dot--live { fill: var(--info-vivid); }
.tg-axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; margin-top: 2px; }
.tg-keys { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink); font-variant-numeric: tabular-nums; }
.tg-key { display: inline-flex; align-items: center; gap: 6px; }
.tg-key i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--ink-faint); }
.tg-key--act i { background: var(--chart-1); height: 4px; }
.tg-key--plan i { background: var(--chart-10); }
.tg-key--proj i { background: repeating-linear-gradient(90deg, var(--chart-1) 0 5px, transparent 5px 8px); }
.tg-key--goal i { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 9px); }
.tg-key--ly i { background: repeating-linear-gradient(90deg, var(--chart-6) 0 2px, transparent 2px 5px); }
.tg-key--live i, .tg-key--live i { background: var(--info-vivid); }
.tg-key--plan-bar i, .tg-key--ok i, .tg-key--warn i, .tg-key--danger i, .tg-key--shut i, .tg-key--ly-bar i, .tg-key--pr-bar i { width: 10px; height: 10px; border-radius: 2px; }
.tg-key--plan-bar i { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tg-key--ok i { background: var(--ok-vivid); } .tg-key--warn i { background: var(--warn-vivid); } .tg-key--danger i { background: var(--danger-vivid); }
.tg-key--shut i { height: 3px; background: var(--line-strong); }
.tg-key--ev i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tg-bar-plan { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1; }
.tg-bar-shut { fill: var(--line-strong); }
.tg-bar-act { fill: var(--chart-1); }
.tg-bar-act.is-ok { fill: var(--ok-vivid); } .tg-bar-act.is-warn { fill: var(--warn-vivid); } .tg-bar-act.is-danger { fill: var(--danger-vivid); } .tg-bar-act.is-live { fill: var(--info-vivid); opacity: .8; }
.tg-ev { fill: var(--accent); }
.tg-ev--ramadan, .tg-ev--ramadan-last10 { fill: var(--chart-9); }
.tg-ev--eid-fitr, .tg-ev--eid-adha { fill: var(--chart-4); }
.tg-ev--adha-runup { fill: var(--chart-5); }
.tg-ev--black-friday { fill: var(--ink-strong); }
.tg-key--ev.tg-ev--ramadan i, .tg-key--ev.tg-ev--ramadan-last10 i { background: var(--chart-9); }
.tg-key--ev.tg-ev--eid-fitr i, .tg-key--ev.tg-ev--eid-adha i { background: var(--chart-4); }
.tg-key--ev.tg-ev--adha-runup i { background: var(--chart-5); }
.tg-key--ev.tg-ev--black-friday i { background: var(--ink-strong); }
.tg-cbar-ly { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1; }
.tg-cbar-pr { fill: var(--chart-1); }
.tg-cbar-pr.is-ok { fill: var(--ok-vivid); } .tg-cbar-pr.is-warn { fill: var(--warn-vivid); } .tg-cbar-pr.is-danger { fill: var(--danger-vivid); }
.tg-cmodel { stroke: var(--ink-strong); stroke-width: 2; }
.tg-key--ly-bar i { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tg-key--pr-bar i { background: var(--chart-1); }
.tg-key--model i { background: var(--ink-strong); }
/* the actual line draws in once, on the page's first paint (the reduced-motion guard in styles.css stills it) */
.tg-l--act { stroke-dasharray: 1; stroke-dashoffset: 0; }
:not(.is-settled) > .tg .tg-l--act { animation: tg-draw var(--dur-count) var(--ease) both; }
@keyframes tg-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* fold-outs: the days table, the target's reasons, a shop's coming months, a season's day list */
.tg-more, .tg-season { margin-top: var(--sp-3); }
.tg-more > summary, .tg-season > summary { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; padding: var(--sp-2) 0; font-weight: 600; color: var(--brand); list-style: none; }
.tg-season > summary { flex-wrap: wrap; font-weight: 500; color: var(--ink); }
.tg-more > summary::-webkit-details-marker, .tg-season > summary::-webkit-details-marker, .tg-shopmore > summary::-webkit-details-marker { display: none; }
.tg-more > summary .ic, .tg-season > summary .ic, .tg-shopmore > summary > .ic { transition: transform var(--dur-fast) var(--ease); }
.tg-more[open] > summary .ic, .tg-season[open] > summary .ic, .tg-shopmore[open] > summary > .ic { transform: rotate(90deg); }
.tg-shopmore > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); cursor: pointer; list-style: none; }
.tg-shopmore > summary h3 { margin: 0; }
.tg-shopmore > summary > .ic { margin-left: auto; }
.tg-days-tbl { max-height: 520px; overflow: auto; }
.tg-evrow td { background: var(--accent-soft); }
.tg-d--ok { color: var(--ok); font-weight: 600; } .tg-d--warn { color: var(--warn); font-weight: 600; } .tg-d--danger { color: var(--danger); font-weight: 600; }

/* coming months and history: a cell holds the figure, then its context lines */
.tg-matrix { max-height: 640px; overflow: auto; }
.tg-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.tg-cell .tg-small { margin: 0; }
.tg-chance, .tg-q { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.tg-chance--ok, .tg-q--ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tg-chance--warn, .tg-q--warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tg-chance--danger, .tg-q--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.tg-q--info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.tg-q--none, .tg-chance--, .tg-chance--none { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.tg-diffmark { font-size: var(--fs-xs); font-weight: 700; color: var(--danger); }
.tg-formula p { margin: 0 0 var(--sp-2); font-size: var(--fs-md); line-height: 1.55; }
.tg-cell b, .tg-cell .tg-small, .tg-diffmark { white-space: nowrap; }
.tg-matrix td:first-child, .tg-matrix th:first-child { white-space: nowrap; }
.tg-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.tg-qbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tg-qchip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 12px; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border: 1px solid var(--line-strong); }
.tg-qchip.on { box-shadow: 0 0 0 2px var(--brand); }
.tg-qchip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tg-qtbl { max-height: 720px; overflow: auto; }
.tg-qtbl td { vertical-align: top; }
.tg-qtbl td.num { white-space: nowrap; }
.tg-qtbl td:last-child { min-width: 320px; width: 45%; line-height: 1.45; }
@media (max-width: 640px) { .tg-qtbl td:last-child { min-width: 260px; } }
.tg-iss { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); font-size: var(--fs-sm); line-height: 1.45; color: var(--ink); }

@media (max-width: 900px) { .tg-figs, .tg-two { grid-template-columns: 1fr; } }
/* a phone: one column, the tabs and the shop picker stay under the top bar */
@media (max-width: 640px) {
  .tg-sticky { position: sticky; top: var(--topbar-h); z-index: var(--z-sticky); padding: var(--sp-2); box-shadow: var(--sh-2); }
  .tg-sticky .tg-note { display: none; }
  .tg-sticky .tg-tabs { margin-bottom: var(--sp-2); }
  .tg-sticky .tg-ctl-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-2); }
  .tg-sticky .flabel { font-size: var(--fs-xs); margin-bottom: 2px; }
  .tg-sticky .finput { min-width: 0; padding-top: 6px; padding-bottom: 6px; }
  .tg-tab { flex: 0 0 auto; min-height: 34px; padding: 5px 10px; }
  .tg-tab .ic { display: none; }
  .tg-glance { grid-template-columns: 1fr; }
  .tg-tile-v { font-size: var(--fs-lg); }
}

/* ==== Set targets (owner's decisions, 2026-11-01): one card per shop for the chosen month ====
   Motion, all from tokens and all interruptible: the card lifts while it differs from the target (transition), the
   gauge sweeps (stroke-dashoffset transition), the band bars slide (transform: scaleX), the numbers count in pages/targets.js
   (requestAnimationFrame, picking up from where they are), a changed difference glows once, the saved tick draws once.
   The one reduced-motion guard in styles.css stills every one of them; the JS count checks the same media query. */
.tg-ed-head .tg-ctl-row { align-items: flex-end; justify-content: space-between; }
.tg-ed-count { margin: 0; font-size: var(--fs-md); color: var(--ink); font-variant-numeric: tabular-nums; }
.tg-ed { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.tg-ed.is-editing { transform: translateY(-2px); box-shadow: var(--sh-3), inset 0 0 0 1px var(--accent); }
.tg-ed .card-h { flex-wrap: wrap; gap: var(--sp-2); }
.tg-ed-kind { font-size: var(--fs-md); }
.tg-ed-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); font-size: var(--fs-md); line-height: 1.5; }
.tg-ed-st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-weight: 650; border: 1px solid transparent; }
.tg-ed-st .ic { width: 14px; height: 14px; }
.tg-ed-st--info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.tg-ed-st--ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tg-ed-st--accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.tg-ed-chg { font-variant-numeric: tabular-nums; }
.tg-ed-why { flex-basis: 100%; color: var(--ink); overflow-wrap: anywhere; }
.tg-ed-formula { margin: var(--sp-3) 0 0; font-size: var(--fs-md); line-height: 1.5; font-variant-numeric: tabular-nums; }
.tg-ed-formula .ic { width: 14px; height: 14px; vertical-align: -2px; color: var(--ink-muted); }
.tg-ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--sp-5); margin-top: var(--sp-4); }
.tg-ed-fig { display: flex; flex-direction: column; gap: 2px; }
.tg-ed-val { font-size: var(--fs-2xl); font-weight: 750; line-height: 1.15; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tg-ed-sub { font-size: var(--fs-md); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tg-ed-ctl { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.tg-ed-inputs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2); }
.tg-ed-inputs .tg-field { flex: 1 1 160px; }
.tg-ed-in { font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.tg-ed-link { padding-bottom: 10px; color: var(--ink-faint); font-size: var(--fs-lg); }
.finput.is-bad { border-color: var(--danger-vivid); box-shadow: 0 0 0 3px rgba(var(--danger-rgb), .12); }
.tg-ed-steps { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tg-ed-stepb { min-width: 52px; justify-content: center; font-variant-numeric: tabular-nums; }
.tg-ed-reset .ic { width: 14px; height: 14px; }
.tg-ed .btn:disabled, .tg-ed-head .btn:disabled { opacity: .45; cursor: default; }
.tg-ed-reason textarea { resize: vertical; min-height: 44px; font: inherit; font-size: var(--fs-md); }
.tg-ed-err { margin: 0; min-height: 0; color: var(--danger); font-size: var(--fs-md); font-weight: 600; }
.tg-ed-err:empty { display: none; }
.tg-ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-2); }
.tg-ed-actions .btn .ic { width: 15px; height: 15px; }
.tg-ed-side { display: flex; flex-direction: column; gap: var(--sp-4); }
.tg-ed-gauge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tg-gauge { width: 168px; height: auto; display: block; }
.tg-gauge-tr, .tg-gauge-f { fill: none; stroke-width: 11; stroke-linecap: round; }
.tg-gauge-tr { stroke: var(--bar-track); }
.tg-gauge-f { stroke: var(--ink-faint); stroke-dasharray: 100 100; transition: stroke-dashoffset var(--dur-slow) var(--ease), stroke var(--dur) var(--ease); }
.tg-gauge-f.is-ok { stroke: var(--ok-vivid); } .tg-gauge-f.is-warn { stroke: var(--warn-vivid); } .tg-gauge-f.is-danger { stroke: var(--danger-vivid); }
.tg-ed-chance { margin-top: -26px; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.tg-ed-chance.tg-chance--ok { color: var(--ok); } .tg-ed-chance.tg-chance--warn { color: var(--warn); } .tg-ed-chance.tg-chance--danger { color: var(--danger); }
.tg-ed-need { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.tg-ed-need b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.tg-ed-need .tg-small { margin: 0; }
.tg-ed-diffs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0 0; }
.tg-ed-diffs > div { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.tg-ed-diffs dt { font-size: var(--fs-sm); color: var(--ink-muted); }
.tg-ed-diffs dd { margin: 2px 0 0; font-size: var(--fs-base); font-weight: 650; color: var(--ink-strong); font-variant-numeric: tabular-nums; border-radius: 4px; }
.tg-ed-flash { animation: tg-flash var(--dur-slow) var(--ease); }
@keyframes tg-flash { from { background: var(--accent-soft); } to { background: transparent; } }
.tg-ed-band { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(140px, 1fr) 2fr 48px; align-items: center; gap: var(--sp-3); padding: 4px 0; font-size: var(--fs-md); }
.tg-ed-band-v { font-variant-numeric: tabular-nums; }
.tg-ed-band .num { text-align: right; font-variant-numeric: tabular-nums; }
.tg-ed-band-bar i { transform-origin: left center; transition: transform var(--dur-slow) var(--ease); }
.tg-ed-hist { margin-top: var(--sp-3); }
.tg-ed-log { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--fs-md); line-height: 1.55; }
.tg-ed-log .tg-ed-why { display: block; }
.tg-ed-batch { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.tg-ed-batch p { margin: 0 0 var(--sp-2); }
.tg-ed-batch ul { margin: 0 0 var(--sp-2); padding-left: var(--sp-5); line-height: 1.6; font-variant-numeric: tabular-nums; }
/* saved: a quiet green line whose tick draws once */
.tg-ed-ok { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); font-size: var(--fs-md); font-weight: 600; }
.tg-ed-tick { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ok-vivid); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tg-ed-tick circle, .tg-ed-tick path { stroke-dasharray: 60; stroke-dashoffset: 0; }
.tg-ed.is-saved .tg-ed-tick circle { animation: tg-tick var(--dur-slow) var(--ease) both; }
.tg-ed.is-saved .tg-ed-tick path { animation: tg-tick var(--dur-slow) var(--ease) var(--dur-fast) both; }
@keyframes tg-tick { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@media (max-width: 900px) { .tg-ed-grid { grid-template-columns: 1fr; } .tg-ed-side { flex-direction: row; flex-wrap: wrap; align-items: center; } .tg-ed-need { flex: 1 1 180px; } }
@media (max-width: 640px) {
  .tg-ed-diffs { grid-template-columns: 1fr; }
  .tg-ed-band { grid-template-columns: 1fr 48px; }
  .tg-ed-band-v { grid-column: 1 / -1; grid-row: 2; }
  .tg-ed-band-bar { grid-column: 1 / -1; grid-row: 3; }
  .tg-ed-in { font-size: var(--fs-input); }
  .tg-ed-link { display: none; }
  .tg-ed.is-editing { transform: none; }
}
