/* WAHAJ prototype — Green the Desert: the build plan (docs/DECISIONS.md V6G-27).
   One job at a time on the left of the Build screen; the seven steps above it become a row of round icons. */

/* the goal card on Build: the goal, its three chips and the seven steps as icons */
.fg-quest.compact { flex: none}
.fg-quest.compact .fg-stl { display: none}
.fg-quest.compact .fg-sts { display: flex; gap: 6px; margin-top: 12px}
.fg-quest.compact .fg-st { min-height: 0; padding: 0; border: 0; background: none; flex: none}
.fg-quest.compact .fg-st span, .fg-quest.compact .fg-st em, .fg-quest.compact .fg-st i::after { display: none}
.fg-quest.compact .fg-st i { width: 30px; height: 30px}

/* the plan */
.fg-lcol > .fp { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 12px 12px 10px}
.fp-h { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px}
.fp-h b { font-size: 12px; font-weight: 600; color: #a1a1a6}
.fp-body { min-height: 0; overflow-y: auto; scrollbar-width: none; display: grid; gap: 4px}
.fp-body::-webkit-scrollbar { display: none}
.fp-ph { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 2px 4px; color: #8e8e93; font-size: 13.5px}
.fp-ph i { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font: normal 700 12px/1 inherit; color: #8e8e93; background: rgba(255, 255, 255, 0.07)}
.fp-ph b { flex: 1; min-width: 0; font-weight: 600}
.fp-ph small { font-size: 11.5px; color: #8e8e93; white-space: nowrap}
.fp-ph.done { color: #c7c7cc}
.fp-ph.done i { color: #0a0a0b; background: #00FF6F}
.fp-ph.now { color: #fff}
.fp-ph.now i { color: #0a0a0b; background: #f5f5f7}
.fp-ph.now small { color: #c7c7cc}

.fp-jobs { list-style: none; margin: 2px 0 6px; padding: 0 0 0 14px; display: grid; gap: 2px; border-inline-start: 2px solid rgba(255, 255, 255, 0.08); margin-inline-start: 15px}
[dir="rtl"] .fp-jobs { padding: 0 14px 0 0}
.fp-j { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; color: #c7c7cc}
.fp-j > i { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #a1a1a6; background: rgba(255, 255, 255, 0.06)}
.fp-j.done { color: #8e8e93}
.fp-j.done > i { color: #0a0a0b; background: #00FF6F}
.fp-j.first:not(.done) > i { color: #fff; background: #8B5CF6}
.fp-j.now { align-items: flex-start; margin: 4px 0; padding: 10px 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); animation: fpIn .35s ease both}
.fp-j.now > i { width: 28px; height: 28px; color: #0a0a0b; background: #f5f5f7}
.fp-j.now > div { flex: 1; min-width: 0}
.fp-j.now b { display: block; font-size: 14.5px; line-height: 1.25; color: #fff}
.fp-j.now p { margin: 5px 0 10px; font-size: 12.5px; line-height: 1.45; color: #c7c7cc}
.fp-tag { display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 999px; font: normal 700 10.5px/1.5 inherit; color: #fff; background: #8B5CF6}
.fp-show { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #0a0a0b; background: #00FF6F; transition: transform .15s ease}
.fp-show:hover { transform: scale(1.03)}
.fp-cta { margin: 2px 0 6px 15px; padding: 10px 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16)}
.fp-cta p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; color: #e5e5ea}
.fp-cta.ok { display: flex; align-items: center; gap: 8px; color: #00FF6F}
.fp-cta.ok p { margin: 0; color: #fff; font-weight: 600}
@keyframes fpIn { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }

/* what the plan asks for next: its part, its pipe or cable, and the tab that holds it, outlined and breathing */
.fg-slot.fp-next { outline: 2px solid #00FF6F; outline-offset: -3px; animation: fpBreath 1.6s ease-in-out infinite}
.fg-seg button.fp-next { outline: 2px solid #00FF6F; outline-offset: -2px}
.mx-foot .mx-go.fp-pulse { animation: fpGo 1.8s ease-in-out infinite}
@keyframes fpBreath { 0%, 100% { outline-color: rgba(0, 255, 111, 1) } 50% { outline-color: rgba(0, 255, 111, 0.25) } }
@keyframes fpGo { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.05) } }

/* light theme */
[data-theme="light"] .fp-h b, [data-theme="light"] .fp-ph, [data-theme="light"] .fp-ph small, [data-theme="light"] .fp-j.done { color: #6e6e73}
[data-theme="light"] .fp-ph i, [data-theme="light"] .fp-j > i { color: #6e6e73; background: rgba(0, 0, 0, 0.06)}
[data-theme="light"] .fp-ph.done, [data-theme="light"] .fp-j { color: #3a3a3c}
[data-theme="light"] .fp-ph.now, [data-theme="light"] .fp-j.now b { color: #1d1d1f}
[data-theme="light"] .fp-ph.now i, [data-theme="light"] .fp-j.now > i { color: #fff; background: #1d1d1f}
[data-theme="light"] .fp-ph.done i, [data-theme="light"] .fp-j.done > i { color: #0a0a0b; background: #00FF6F}
[data-theme="light"] .fp-jobs { border-color: rgba(0, 0, 0, 0.08)}
[data-theme="light"] .fp-j.now, [data-theme="light"] .fp-cta { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.12)}
[data-theme="light"] .fp-j.now p, [data-theme="light"] .fp-cta p { color: #3a3a3c}
[data-theme="light"] .fp-cta.ok { color: #0A9B45}
[data-theme="light"] .fp-cta.ok p { color: #1d1d1f}
[data-theme="light"] .fg-slot.fp-next, [data-theme="light"] .fg-seg button.fp-next { outline-color: #0A9B45}

@media (prefers-reduced-motion: reduce) { .fp-j.now, .fg-slot.fp-next, .mx-foot .mx-go.fp-pulse { animation: none !important } }

/* the card scrolls to the phase being worked on */
.fp-body { position: relative}

/* the palms' water tag: a choice, not an alarm */
.fg-wtag.opt { color: #c7c7cc; background: rgba(255, 255, 255, 0.08)}
[data-theme="light"] .fg-wtag.opt { color: #3a3a3c; background: rgba(0, 0, 0, 0.06)}

/* on Build the map gives the plan a little more room */
.fg[data-route="f-build"] .fg-lcol > .fg-mini .fg-mapin { height: 84px}

/* how close the farm is, kept on Build (V6G-14), a little tighter */
.fg-quest.compact .fh-close { margin-top: 10px; padding: 8px 10px; gap: 2px}

/* V6G-28: no map; the plan reaches down to the budget card, every job of the parts to come in view */
.fg-lcol > .fp { flex: 1 1 auto}
.fp-jobs.later { opacity: 0.7}
/* the labels and the Top view beside DO */
.fg-qh { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px}
.fg-qt { display: inline-flex; gap: 4px}
.fg-qt .fg-chipb { height: 26px; padding: 0 9px; font-size: 12px; gap: 5px}
/* the budget breakdown: what each line is, how many at what price, and what it costs */
.fg-bh { margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #a1a1a6; text-transform: uppercase}
.fg-bt .fg-brow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline}
.fg-bt .fg-brow i { font-style: normal; font-size: 11.5px; color: #a1a1a6; white-space: nowrap}
.fg-bt .fg-brow.over b { color: var(--pipe-dry)}
.fg-bnone { margin: 2px 0 6px; font-size: 12.5px; color: #a1a1a6}
[data-theme="light"] .fg-bh, [data-theme="light"] .fg-bt .fg-brow i, [data-theme="light"] .fg-bnone { color: #6e6e73}
/* the mission's progress: each step fills in its phase's colour as the learner works on it */
.mx-pseg i.part::before { content: ""; position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--ph-do); transition: width .4s ease}
.mx-pseg i.part.know::before { background: var(--ph-know)} .mx-pseg i.part.become::before { background: var(--ph-become)}

/* the real price on a part card stays on one line (V6G-28) */
.fg-inv2 .fg-slot .fg-price { white-space: nowrap; font-size: 11.5px; letter-spacing: -0.01em}

/* a long breakdown scrolls inside its panel instead of running off the screen */
#layer .pop:has(.fg-bh) { max-height: 1040px; overflow-y: auto; scrollbar-width: thin}

/* V6G-31: the picked part's toolbar is fixed at the top of the land, between the goal card and Hint, whatever the camera does */
.fg-ctx { left: 50%; top: 92px; transform: translateX(-50%); max-width: 784px; flex-wrap: wrap; justify-content: center}

/* V6G-32: the links, always in view on the right of the land (they left the Connect tab): switch, relink, remove */
.fg-links { position: absolute; inset-inline-end: 16px; top: 168px; width: 300px; max-height: 632px; z-index: 6; display: flex; flex-direction: column; padding: 12px 12px 10px}
.fl-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 8px}
.fl-h b { font-size: 12px; font-weight: 600; color: #a1a1a6}
.fl-warn { display: flex; align-items: center; gap: 6px; margin: 0 2px 8px; font-size: 12.5px; font-weight: 600; color: var(--pipe-dry)}
.fl-list { min-height: 0; overflow-y: auto; display: grid; gap: 6px; align-content: start; scrollbar-width: none}
.fl-list::-webkit-scrollbar { display: none}
.fl-list .fg-prow { min-height: 54px; padding-block: 6px}
.fl-list .fg-pname b { white-space: normal; line-height: 1.25}
.fl-list .fg-pnone { margin: 2px; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45}
.fg-cnote { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 14px; font-size: 13.5px; line-height: 1.45; color: #c7c7cc}
#stage:has(#mchat:not([hidden])) .fg-links { display: none}
[data-theme="light"] .fl-h b { color: #6e6e73}
[data-theme="light"] .fg-cnote { color: #3a3a3c}
.fl-list .fg-pname small { white-space: normal; line-height: 1.35}

/* V6G-40: a link: its name on its own line; the length and state under it, beside the switch, Relink and Remove */
.fl-list .fg-prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "sub ctl"; align-items: center; gap: 4px 8px; flex: none; min-height: 0; height: auto; padding: 9px 6px 7px 10px}
.fl-list .fg-pname { grid-area: name; cursor: pointer; display: flex; width: 100%; height: auto; padding: 0; align-items: flex-start; gap: 8px}
.fl-list .fg-pname .fg-pdot { margin-top: 4px}
.fl-list .fg-pname b { flex: 1 1 0; min-width: 0; display: block; white-space: normal; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3}
.fl-list .fl-sub { grid-area: sub; display: block; min-width: 0; padding-inline-start: 18px; font-size: 11.5px; line-height: 1.35; color: #a1a1a6; cursor: pointer}
.fl-list .fg-prow.dry .fl-sub { color: var(--pipe-dry)}
.fl-list .fl-ctl { grid-area: ctl; display: flex; align-items: center; gap: 2px}
.fl-list .fg-prow.sel { border-color: #ff4fa3}
.fl-list .fg-prow.sel .fg-pname b { color: #ff4fa3}
[data-theme="light"] .fl-list .fl-sub { color: #6e6e73}
[data-theme="light"] .fl-list .fg-prow.dry .fl-sub { color: var(--pipe-dry)}
[data-theme="light"] .fl-list .fg-prow.sel { border-color: #e0287f}
[data-theme="light"] .fl-list .fg-prow.sel .fg-pname b { color: #c81e6c}

/* V6G-40: the budget window: Spent, Budget and Left; two tabs; each line with its share of the total */
.modal.fb-modal { width: 600px}
.fb-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px}
.fb-tile { padding: 12px 14px; border-radius: 14px; border: 1px solid #2c2c2e; background: #161618}
.fb-tile small { display: block; font-size: 12px; font-weight: 600; color: #a1a1a6}
.fb-tile b { display: block; margin-top: 4px; font-size: 19px; font-weight: 700; color: #f5f5f7; white-space: nowrap}
.fb-tile.left b { color: var(--accent)}
.fb-tile.over b { color: var(--pipe-dry)}
.fb-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: #2c2c2e; overflow: hidden}
.fb-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent)}
.fb-bar.over i { background: var(--pipe-dry)}
.fb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 12px; background: #1c1c1e}
.fb-tabs button { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #a1a1a6}
.fb-tabs button.on { background: #3a3a3c; color: #ffffff}
.fb-pane { display: grid; gap: 2px}
.fb-pane[hidden] { display: none}
.fb-why { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: #c7c7cc}
.fb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 8px 2px}
.fb-row b { display: block; font-size: 14px; font-weight: 600}
.fb-row small { display: block; font-size: 12px; color: #98989d}
.fb-row strong { font-size: 15px; font-weight: 700; white-space: nowrap}
.fb-share { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: #232325; overflow: hidden}
.fb-share i { display: block; height: 100%; border-radius: inherit; background: #8B5CF6}
.fb-sumrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; border-top: 1px solid #2c2c2e; font-size: 14px; color: #c7c7cc}
.fb-sumrow b { font-size: 15px; color: #f5f5f7; white-space: nowrap}
.fb-sumrow.total { font-weight: 700; color: #f5f5f7}
.fb-sumrow.total b { font-size: 17px}
.fb-modal .fg-fx { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: #8e8e93}
[data-theme="light"] .fb-tile { border-color: #e5e5ea; background: #f5f5f7}
[data-theme="light"] .fb-tile small, [data-theme="light"] .fb-row small, [data-theme="light"] .fb-modal .fg-fx { color: #6e6e73}
[data-theme="light"] .fb-tile b, [data-theme="light"] .fb-sumrow b, [data-theme="light"] .fb-sumrow.total { color: #1d1d1f}
[data-theme="light"] .fb-tile.left b { color: #1d1d1f}
[data-theme="light"] .fb-bar, [data-theme="light"] .fb-share { background: #e5e5ea}
[data-theme="light"] .fb-tabs { background: #f0f0f2}
[data-theme="light"] .fb-tabs button { color: #6e6e73}
[data-theme="light"] .fb-tabs button.on { background: #ffffff; color: #1d1d1f; border: 1px solid #e5e5ea}
[data-theme="light"] .fb-why, [data-theme="light"] .fb-sumrow { color: #3a3a3c; border-color: #e5e5ea}
/* V6G-40: the list is a column that scrolls; each link keeps the height of its text */
.fg-links .fl-list { display: flex; flex-direction: column; gap: 6px}
.fg-links .fl-list > * { flex: none}
.fb-row { padding: 6px 2px}
.fb-tabs button.on { border: 0; box-shadow: none; outline: none}
[data-theme="light"] .fb-tabs button.on { border: 1px solid #e5e5ea}

/* ---------- V6G-41: diagnose, plan, retest; what the work shows; the return challenge ---------- */
.modal.fi-modal, .modal.fr-modal { width: 760px}
.fi-ev { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid #2c2c2e; background: #161618}
.fi-ev h5 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: #a1a1a6}
.fi-ev > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px}
.fi-ev span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #1c1c1e}
.fi-ev span .ico { grid-row: 1 / 3; color: #8B5CF6}
.fi-ev small { font-size: 11.5px; line-height: 1.3; color: #a1a1a6}
.fi-ev b { font-size: 16px; font-weight: 700; color: #f5f5f7}
.fi-q { margin: 12px 0 6px; font-size: 14px; font-weight: 700}
.fi-q small { font-weight: 500; color: #8e8e93}
.fi-fb { min-height: 20px; margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--pipe-dry)}
.fi-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 2px}
.fi-next p { margin: 0; font-size: 13.5px; color: #d1d1d6}
.fi-plan, .fi-vs { display: flex; align-items: flex-start; gap: 7px; margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: #d1d1d6}
.fi-vs.ok .ico { color: var(--accent)}
.fi-vs.no .ico { color: var(--pipe-dry)}
.fp-loop .fp-j.fp-lite span { font-weight: 700}
.fp-mine { display: flex; align-items: center; gap: 6px; margin: 6px 4px; font-size: 12.5px; line-height: 1.4; color: #a1a1a6}
.fp-idea { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: #a1a1a6; text-decoration: underline; text-underline-offset: 3px}
.fp-try { margin: 4px 0 0; font-size: 12.5px; color: #a1a1a6}
.fp-show.quiet { background: transparent; border: 1px solid #3a3a3c; color: #e5e5ea}
.fw-box { margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid #2c2c2e}
.fw-box h5 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 13px; font-weight: 700}
.fw-row { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid #232325}
.fw-row > span { display: flex; align-items: center; gap: 7px; font-size: 13px}
.fw-row > span .ico { color: #8e8e93}
.fw-row.ok > span .ico { color: var(--accent)}
.fw-row small { padding-inline-start: 22px; font-size: 12px; line-height: 1.4; color: #a1a1a6}
.fw-caps { display: inline-flex; gap: 4px; margin-inline-end: 6px}
.fw-caps em { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; border: 1px solid #3a3a3c; color: #a1a1a6}
.fw-caps em.ok { border-color: var(--accent); color: var(--accent)}
.fr-card { display: grid; gap: 6px; padding: 9px 0 2px; border-top: 1px solid #232325}
.fr-card b { display: flex; align-items: center; gap: 7px; font-size: 13px}
.fr-card p { margin: 0; padding-inline-start: 22px; font-size: 12px; line-height: 1.4; color: #a1a1a6}
.fr-card.retained b .ico { color: var(--accent)}
.fr-card .btn { justify-self: start; height: 34px; margin-inline-start: 22px; font-size: 13px}
.fr-card small { padding-inline-start: 22px; font-size: 11.5px; color: #8e8e93}
.fr-story { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; color: #d1d1d6}
.fr-item { padding: 12px 0; border-top: 1px solid #2c2c2e}
.fr-item h5 { margin: 0 0 8px; font-size: 14px; line-height: 1.45; font-weight: 600}
.fr-item h6 { margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: #c7c7cc}
.fr-num { max-width: 220px}
.fr-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-bottom: 8px}
.fr-months span { display: grid; justify-items: center; padding: 4px 0; border-radius: 8px; background: #1c1c1e}
.fr-months small { font-size: 10px; color: #8e8e93}
.fr-months b { font-size: 12.5px}
.rc-need { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.4; color: #a1a1a6}
.rc-lines { margin: 4px 0 10px}
[data-theme="light"] .fi-ev { border-color: #e5e5ea; background: #f5f5f7}
[data-theme="light"] .fi-ev span, [data-theme="light"] .fr-months span { background: #ffffff}
[data-theme="light"] .fi-ev b { color: #1d1d1f}
[data-theme="light"] .fi-ev small, [data-theme="light"] .fw-row small, [data-theme="light"] .fr-card p, [data-theme="light"] .fp-mine, [data-theme="light"] .fp-try, [data-theme="light"] .rc-need { color: #6e6e73}
[data-theme="light"] .fi-next p, [data-theme="light"] .fi-plan, [data-theme="light"] .fi-vs, [data-theme="light"] .fr-story { color: #3a3a3c}
[data-theme="light"] .fw-box, [data-theme="light"] .fw-row, [data-theme="light"] .fr-card, [data-theme="light"] .fr-item { border-color: #e5e5ea}
[data-theme="light"] .fp-show.quiet { border-color: #d1d1d6; color: #1d1d1f}
