/* Daily Life Doc, round 38 (zone G2): the Plan tab's two parts, Goals and Rules (js/plan/plan-goal-draw.js, the page
   "Goals, Progress, Instructions", part 1): each goal one paragraph with a ring before it (filled when Done), Pause and
   Required or Optional at its right, its lines under it as "time · the expert's words · You" (no chips); then the
   Rules. Round 42 (zone P, decision 30): the goal's tinted box, today's record and the "what happens" words went; the
   folded line under each goal is css/plan-fold.css (it reuses the status pills .pgst-* here). The headings reuse the
   round 30 section label (css/plan-sections.css .psec). */

.plines.pgmode { gap: 0; }
.pg-goals, .pg-rules { display: flex; flex-direction: column; }
.pg-goals > .psec { margin-top: 4px; }
.pgadd { align-self: flex-start; margin: 4px 0 6px 16px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink3);
  font: inherit; font-size: var(--t-s); cursor: pointer; transition: background-color var(--m-step, 160ms) ease, color var(--m-step, 160ms) ease; }
.pgadd:hover { background: var(--field); color: var(--ink2); }

/* ---------- A goal ---------- */
.pgb { display: flex; flex-direction: column; gap: 2px; margin: 0 10px; padding: 8px 6px 10px; border-top: 1px solid var(--cardline); }
.pg-list > .pgb:first-child { border-top: 0; }
.pgb.in { animation: dd-rise var(--m-add, 260ms) var(--ease-out, ease-out) backwards; }
.pgh { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 9px; align-items: start; }
.pgcw { display: block; width: 16px; height: 16px; margin-top: 7px; }
.pgc { display: block; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 2px solid var(--sage-d); background: none; box-sizing: border-box; }
button.pgc { cursor: pointer; transition: background-color var(--m-step, 160ms) ease, transform var(--m-press, 100ms) ease; }
button.pgc:hover { background: color-mix(in srgb, var(--sage) 30%, transparent); }
button.pgc:active { transform: scale(.9); }
.pgb.done .pgc { background: var(--sage); border-color: var(--sage); }
.pgb.unpub .pgc { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 30%, transparent); }
.pgln.pln { padding: 3px 6px; font-size: var(--t-m); font-weight: 500; }
.pgln .ptx { flex-basis: 100%; }
.pgm { display: flex; align-items: center; gap: 2px; }
.pgrq { margin-top: 6px; padding: 1px 6px; border: 0; border-radius: 6px; background: none; color: var(--ink3); font: inherit; font-size: var(--t-2xs);
  font-weight: 500; white-space: nowrap; cursor: pointer; }
button.pgrq:hover { background: var(--field); color: var(--ink2); }
.pgrq.opt { font-style: italic; }
.pgs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-left: 31px; font-size: var(--t-xs); color: var(--ink3); }
.pgs:empty { display: none; }
.pgs .chp.q { white-space: normal; text-align: left; }
/* Round 52 (zone A, decision 5): "Read as: …", the reading the AI took of an open choice; a tap opens the words. */
.prdas { display: block; padding: 0 6px 4px 112px; margin: -2px 0 0; font-size: var(--t-2xs); line-height: 1.4; color: var(--ink3); }
.pg-rl .prdas { padding-left: 6px; }
@media (max-width: 520px) { .pgl .prdas { padding-left: 92px; } }
.pgdone b { font-weight: 600; color: var(--sage-d); }
.pgpz { color: var(--try-d); font-weight: 500; }
.pgb.paused .pgl .ptx { color: var(--ink3); }

/* ---------- The goal's lines: time · the expert's words · You ---------- */
/* css/profile.css's .prow (a Profile row: padding, a rule between rows) shares the name: the plan's rows have neither. */
.pgmode .prow { padding: 0; gap: 0; border-radius: 0; }
.pgmode .prow + .prow { border-top: 0; }
.pgl { display: flex; flex-direction: column; padding-left: 19px; }
.pgl:empty { display: none; }
.pgmode .pln { align-items: baseline; }
.pgmode .pgl .pln { flex-wrap: nowrap; font-size: var(--t-s); }
.pgmode .pgl .pend { flex: none; }
/* Fixer FX1 (round 52, walk W1 fault 1): a line the AI could not read keeps its words readable at every width: the
   words take the row beside the time and "You", and the "?" goes on its own row under the words (it squeezed the words
   to one letter a row at 430 and 340 px). */
.pgmode .pln:has(> .pend > .chp.q) { flex-wrap: wrap; }
.pgmode .pln:has(> .pend > .chp.q) > .ptx { flex: 1 1 0; }
.pgmode .pln:has(> .pend > .chp.q) > .pend { order: 10; flex: 1 0 100%; margin-left: 0; }
.pgmode .pgl .pln:has(> .pgtm:not([hidden])):has(> .pend > .chp.q) > .pend { padding-left: 106px; }
.chp.pgtm { flex: 0 0 96px; display: inline-block; padding: 0; border-radius: 4px; background: none; color: var(--ink2); font-weight: 500;
  font-size: var(--t-xs); font-variant-numeric: tabular-nums; text-align: left; white-space: pre-line; line-height: 1.35; cursor: pointer; }
.chp.pgtm.on { box-shadow: none; color: var(--sage-d); text-decoration: underline; text-underline-offset: 3px; }
.chp.pgtm[hidden] { display: none; }
.pg-rl .chp.pgtm { flex: none; margin-right: 6px; } /* a Rule's time never runs into its words (fixer VF2) */
.pgmode .pln .aitag { order: 9; flex: none; white-space: nowrap; }
.pgmode .pln.isai .aitag { display: none; }
.pgmode .pln.isyou .aitag { display: inline-block; max-width: none; opacity: 1; padding: 0 6px; background: color-mix(in srgb, var(--sage) 26%, transparent); color: var(--sage-d); }
.pgmode .pln.isyou .aitag:empty { display: none; }

/* ---------- Status pills (the folded line's open rows, css/plan-fold.css) ---------- */
.pgst { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: var(--t-2xs); font-weight: 600; line-height: 18px; white-space: nowrap; }
.pgst-ready { background: color-mix(in srgb, var(--sage) 26%, transparent); color: var(--sage-d); }
/* Round 40 (zone B): Creating… (was Building…), a row being made: it breathes like "Writing…" until it is Ready. */
.pgst-creating { background: var(--note); color: var(--note-d); animation: dd-wait 1.2s ease-in-out infinite; }
.pgst-waiting { background: var(--try-bg); color: var(--try-d); }
.pgst-cannot { background: var(--bad-bg); color: var(--bad-d); }
.pgst-asking { background: var(--note); color: var(--note-d); } /* an Atlas field asked of the client (fixer VF2) */
.pgnote { color: var(--ink3); }

/* ---------- The Rules ---------- */
.pg-rl { display: flex; flex-direction: column; padding: 0 10px; }
.pg-rules > .psec { margin-top: 16px; }

/* ---------- The plan beside Chat: read only, quieter ---------- */
.cpside .pgb { margin: 0; padding: 6px 0 8px; }
.cpside .pgln.pln { font-size: var(--t-s); }
.cpside .pgl { padding-left: 12px; }
.cpside .chp.pgtm { flex-basis: 84px; } /* "Every 2 days" on one line (fixer FX-Z) */
.cpside .pgmode .pgl .pln { display: flex; }

@media (max-width: 520px) {
  .pgb { margin: 0 4px; padding-left: 2px; padding-right: 2px; }
  .pgh { grid-template-columns: 16px minmax(0, 1fr); }
  .pgm { grid-column: 2; padding-left: 6px; }
  .pgrq { margin-top: 0; padding-left: 0; }
  .pgl { padding-left: 0; }
  .chp.pgtm { flex-basis: 78px; } /* "Every 2 days", "Right away" on one line at a phone width (fixer FX-Z) */
  .pgmode .pgl .pln:has(> .pgtm:not([hidden])):has(> .pend > .chp.q) > .pend { padding-left: 88px; } /* fixer FX1 */
  .pgs { padding-left: 0; }
  .pgadd { margin-left: 8px; }
  .pg-rl { padding: 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .pgb.in, .pgst-creating { animation: none; }
}

/* ---------- Publish's list of what changes (js/plan/plan-publish-list.js) ---------- */
.publ { display: grid; gap: 5px; margin: 0 0 14px; }
.publh { margin-top: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--ink3); }
.publr { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; font-size: var(--t-s); line-height: 1.4; overflow-wrap: anywhere; }
.publm { font-weight: 600; color: var(--sage-d); text-align: center; }
.publr.off { color: var(--ink2); }
.publr.off .publm { color: var(--bad-d); }
.pubwh { margin-top: 4px; }

/* Round 39 (builder M1): the goal's block or the Rules a dragged line will land in. */
.pgb.pgdrop, .pg-rules.pgdrop { border-radius: 12px; background: var(--soft); box-shadow: inset 0 0 0 2px var(--sage-d); transition: background 120ms var(--ease-out); }
