/* Decide when to stop a side project. Loaded after articles.css, for this article only.

   The colour rule carries the argument. Orange is the hours a project takes when nobody decided it
   should: the leak. Indigo is the same hours after a day to decide, once they came back. The calm grey
   in between is hours kept on purpose, while the signals run. The brand gradient appears once, as the
   line of the re-decision day. In the tool, orange marks a signal nobody could check. */

.a-hero h1, .a-body h2, .a-body h3 { text-wrap: balance; }
.a-hero .lead, .a-body p, .a-body li { text-wrap: pretty; }
.ds-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* A person before the picture, in one line, so the months still clear the fold. */
.ds-by { margin-top: 18px; }
.ds-by img { width: 32px; height: 32px; }
.ds-by strong { display: inline; margin-right: 0.6em; }

/* ---------- The set piece: nine months of one project, then the same months with a day ----------
   The finished picture is the markup, so no JS still gets all of it. tool.js adds is-before to show
   the drift, grows the months one at a time, then draws the day and turns the hours after it. */
.ds-fig { position: relative; margin: 22px 0 0; padding: clamp(14px, 2.6vw, 24px); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-float); display: grid; gap: 16px; min-width: 0; }
.ds-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ds-toggle { padding: 0.5em 0.95em; border: 0; border-radius: 999px; background: var(--grid); color: var(--ink); font: 700 0.8125rem/1.2 var(--sans); cursor: pointer; transition: background-color 0.2s; }
.ds-toggle:hover { background: var(--rule); }
.ds-toggle[hidden] { display: none; }
.ds-toggle:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* Two sentences in one place, the finished one by default, so no JS still reads true. */
.ds-b4, .ds-b4k { display: none; }
.is-before .ds-b4 { display: inline; }
.is-before .ds-b4k { display: flex; }
.is-before .ds-af, .is-before .ds-afk { display: none; }

.ds-stage { position: relative; min-width: 0; }
.ds-chart { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); min-width: 0; }
.ds-m { position: relative; display: grid; grid-template-rows: 9.5rem auto; gap: 8px; min-width: 0; --dl: 0.2s; }
.ds-m.is-post { --dl: calc(0.55s + (var(--i) - 3) * 0.09s); }
.ds-mn { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; line-height: 1.2; text-align: center; text-transform: uppercase; color: var(--ink); }

/* The hours stand on one baseline, with a faint line every 2 hours a week. The scale is 7 hours, so
   the tallest month still leaves room for what you tell yourself above it. The columns touch, so the
   lines run unbroken across the year. */
.ds-track { position: relative; display: flex; align-items: flex-end; padding: 0 4px; min-width: 0; background-image: linear-gradient(to top, var(--rule) 1px, transparent 1px); background-size: 100% calc(100% * 2 / 7); background-position: left bottom; }
.ds-bar { position: relative; display: grid; align-content: start; gap: 2px; width: 100%; height: calc(var(--h) / 7 * 100%); padding: 7px 4px; border-radius: 8px 8px 3px 3px; background: #DDE0EE; color: var(--ink); text-align: center; transform-origin: bottom; transition: background-color 0.5s var(--ease) var(--dl), box-shadow 0.5s var(--ease) var(--dl), color 0.5s var(--ease) var(--dl), transform 0.42s cubic-bezier(0.34, 1.5, 0.64, 1); }
.ds-bar b { font-size: 0.8125rem; font-weight: 700; line-height: 1.1; }
.ds-bar small { font-size: 0.6875rem; font-weight: 700; line-height: 1.1; }
/* Grey is the hours you chose. Only the months after the day change: orange while nobody decides,
   indigo once the day has given them back. */
.ds-m.is-post .ds-bar { background: #E0E6FF; box-shadow: inset 0 0 0 1.5px #9DAEF9; color: var(--primary-deep); }
.is-before .ds-bar { transition: transform 0.42s cubic-bezier(0.34, 1.5, 0.64, 1); }
.is-before .ds-m.is-post .ds-bar { background: var(--lift-tint); box-shadow: inset 0 0 0 1.5px var(--lift); color: var(--lift-ink); }
.is-before .ds-bar small { display: none; }

/* What you tell yourself, said just above the month it belongs to. */
/* One line each, on the card's own white, so a gridline never runs through the words. */
.ds-note { position: absolute; z-index: 1; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 1px 5px; border-radius: 4px; background: var(--surface); font-style: normal; font-size: 0.75rem; font-weight: 600; line-height: 1.25; white-space: nowrap; color: var(--ink-2); pointer-events: none; }
.is-before .ds-note.ds-b4 { display: block; }

/* The months grow in one at a time when the drift plays. */
.is-empty .ds-m:not(.is-in) .ds-bar { transform: scaleY(0); }

/* The day: the one gradient on the page, drawn as a line between May and June. */
.ds-cut { position: absolute; z-index: 2; top: -6px; bottom: calc(0.85rem + 8px); left: -1.5px; width: 3px; border-radius: 2px; background: linear-gradient(180deg, #AC76FD 0%, #7E71FA 50%, #536CF9 100%); transform-origin: top; transition: transform 0.7s var(--ease) 0.1s; }
.ds-daytag { position: absolute; z-index: 3; top: -6px; left: 8px; padding: 0.35em 0.65em; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px #C9D2FC; color: var(--ink); font-size: 0.75rem; font-weight: 600; line-height: 1.25; white-space: nowrap; transition: opacity 0.3s 0.55s, transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1) 0.55s; }
.ds-daytag b { color: var(--primary-deep); font-weight: 700; }
.is-before .ds-cut { transform: scaleY(0); transition: none; }
.is-before .ds-daytag { opacity: 0; transform: translateY(4px) scale(0.9); transition: none; }

.ds-read { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ds-read > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--paper); min-width: 0; }
.ds-read .eyebrow { color: var(--ink-hint); }
.ds-read b { font-family: var(--serif); font-size: clamp(1.6rem, 1.35rem + 1vw, 2.1rem); font-weight: 700; line-height: 1.05; color: var(--ink); }
.ds-read small { font-size: 0.8125rem; line-height: 1.3; color: var(--ink-hint); text-wrap: pretty; }
.ds-hours b { color: var(--primary-deep); }
.is-before .ds-hours b { color: var(--lift-ink); }

.ds-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; line-height: 1.3; color: var(--ink-2); }
.ds-key li { display: flex; align-items: center; gap: 7px; }
.ds-key li.ds-b4k, .is-before .ds-key li.ds-afk { display: none; }
.is-before .ds-key li.ds-b4k { display: flex; }
.ds-key i { width: 14px; height: 14px; border-radius: 4px; }
.ds-key .k-drift { background: var(--lift-tint); box-shadow: inset 0 0 0 1.5px var(--lift); }
.ds-key .k-kept { background: #DDE0EE; }
.ds-key .k-day { width: 4px; border-radius: 2px; background: linear-gradient(180deg, #AC76FD, #536CF9); }
.ds-key .k-back { background: #E0E6FF; box-shadow: inset 0 0 0 1.5px #9DAEF9; }
.ds-cap { margin-top: 14px; font-size: 0.9375rem; line-height: 1.5; color: var(--ink-hint); }

/* ---------- Cards and fields ---------- */
.ds-card { padding: clamp(14px, 2.4vw, 20px); border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); display: grid; gap: 10px; min-width: 0; }
.ds-lab { font-size: 0.875rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.ds-card .ds-lab + input, .ds-card .ds-lab + .ds-num { margin-bottom: 6px; }
.ds-card input, .ds-row input { width: 100%; min-width: 0; padding: 0.65em 0.8em; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); color: var(--ink); font: 500 1rem/1.4 var(--sans); transition: border-color 0.2s, box-shadow 0.2s; }
.ds-card input:focus, .ds-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 108, 248, 0.25); }
.ds-card input::placeholder, .ds-row input::placeholder { color: var(--ink-hint); }
.ds-num { display: grid; grid-template-columns: 7rem auto; gap: 10px; align-items: center; justify-content: start; font-size: 0.9375rem; font-weight: 600; color: var(--ink-hint); }
.ds-num input { font-family: var(--mono); }
.ds-dayrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.ds-card .ds-dayrow input { width: auto; min-width: 11rem; font-family: var(--mono); }

.ds-say { font-size: 1.0625rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.ds-say[hidden] { display: none; }
.ds-say b { font-family: var(--mono); font-weight: 600; }
.ds-say.is-leak { color: var(--lift-ink); }
.ds-say.is-ok b { color: var(--primary-deep); }
.ds-card .ds-say { font-size: 0.9375rem; color: var(--ink-2); }
.ds-card .ds-say.is-leak { color: var(--lift-ink); }

.ds-try { justify-self: start; padding: 0.6em 1.05em; border: 0; border-radius: 999px; background: var(--primary-tint); color: var(--primary-deep); font: 700 0.9375rem/1.2 var(--sans); cursor: pointer; }
.ds-try:hover { background: #DFE4FD; }
.ds-try:focus-visible, .ds-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.ds-empty { padding: 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); font-size: 1rem; line-height: 1.5; color: var(--ink-hint); }

/* ---------- Step 3: the signals, on the one dark surface in the reading column ---------- */
.ds-tool { padding: clamp(16px, 2.6vw, 26px); border-radius: 22px; background: var(--night); color-scheme: dark; display: grid; gap: 12px; min-width: 0; }
.ds-tool .ds-lab { color: var(--on-night); }
.ds-tool .ds-empty { background: var(--night-2); box-shadow: none; color: var(--on-night-2); }
.ds-sigs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.a-body .ds-sigs { padding: 0; }
.ds-sig { display: grid; gap: 10px; min-width: 0; padding: 14px; border-radius: 14px; background: var(--night-2); }
.ds-sig.is-flag { box-shadow: inset 3px 0 0 var(--lift); }
.ds-sh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ds-sn { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1.2; text-transform: uppercase; color: var(--on-night-2); }
.ds-sv { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--on-night); }
.ds-sm { font: 500 0.875rem/1.45 var(--mono); color: var(--on-night-2); }
.ds-f { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 10px; }
.ds-f label { display: grid; gap: 6px; min-width: 0; font-size: 0.8125rem; font-weight: 700; line-height: 1.25; color: var(--on-night-2); }
.ds-f .ds-wide { grid-column: 1 / -1; }
.ds-f input { width: 100%; min-width: 0; padding: 0.6em 0.75em; border: 1px solid var(--night-line); border-radius: 11px; background: var(--night); color: var(--on-night); font: 500 1rem/1.4 var(--sans); transition: border-color 0.2s, box-shadow 0.2s; }
.ds-f input[type="date"] { font-family: var(--mono); font-size: 0.9375rem; }
.ds-f input::placeholder { color: #767CA6; }
.ds-f input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 108, 248, 0.3); }
.ds-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.a-body .ds-flags { padding: 0; gap: 6px; }
.ds-flags li { font-size: 0.9375rem; line-height: 1.45; color: var(--lift-ring); }
.ds-flags li::before { content: "! "; font-weight: 800; }
.ds-flags:empty, .ds-foot:empty { display: none; }
.ds-ok { font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: #C3CCFF; }
.ds-ok::before { content: "✓ "; font-weight: 800; }
.ds-rm, .ds-keep { padding: 0.1em 0; border: 0; background: none; color: var(--on-night-2); font: 600 0.8125rem/1.3 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ds-keep { justify-self: start; color: var(--on-night); font-size: 0.875rem; }
.ds-rm:hover, .ds-keep:hover { color: #fff; }
.ds-count { font: 600 0.9375rem/1.4 var(--mono); color: var(--on-night); }
.ds-actions { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.ds-add { padding: 0.6em 1.05em; border: 0; border-radius: 999px; background: var(--on-night); color: var(--night); font: 700 0.9375rem/1.2 var(--sans); cursor: pointer; }
.ds-add:hover { background: #fff; }
.ds-add[disabled] { background: var(--night-2); color: var(--on-night-2); cursor: default; }
.ds-text { padding: 0.2em 0; border: 0; background: none; color: var(--on-night); font: 600 0.9375rem/1.2 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ds-text:hover { color: #fff; }
.ds-tool button:focus-visible, .ds-tool input:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.a-body .ds-tool .fine { line-height: 1.5; color: var(--on-night-2); }

/* ---------- Step 3: a feeling, rewritten as something you can see ----------
   The small figures sit on the page itself, with no box of their own: the step already has its tool
   in a box, and another frame on one screen reads as clutter. */
.ds-rew { margin: 4px 0; display: grid; gap: 10px; position: relative; }
.ds-rh, .ds-rr { display: grid; grid-template-columns: minmax(0, 0.8fr) 1.6rem minmax(0, 1.2fr); gap: 10px; align-items: center; }
.ds-rh span { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1.2; text-transform: uppercase; color: var(--ink-hint); }
.ds-rh span:last-child { grid-column: 3; }
.ds-rr i { font-style: normal; font-weight: 700; text-align: center; color: #8990B4; }
.ds-loose, .ds-firm { padding: 0.55em 0.8em; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink); font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.ds-loose { box-shadow: inset 0 0 0 1px var(--rule), inset 3px 0 0 var(--lift); }
.ds-loose u { text-decoration: none; color: var(--lift-ink); background: linear-gradient(var(--lift), var(--lift)) 0 96% / 100% 2px no-repeat; }
.ds-firm small { display: block; margin-top: 3px; font: 500 0.8125rem/1.35 var(--mono); color: var(--ink-hint); }

/* ---------- Step 4: what you can open from where you check ---------- */
.ds-view { margin: 4px 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: stretch; position: relative; }
.ds-vbox { display: flex; flex-wrap: wrap; align-content: start; gap: 8px; padding: 14px; border-radius: 16px; outline: 1.5px dashed #9EA4C4; outline-offset: -1.5px; }
.ds-vt { flex: 1 0 100%; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1.3; text-transform: uppercase; color: var(--ink-hint); }
.ds-chip { display: inline-block; padding: 0.5em 0.8em; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink); font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.ds-vbox .ds-chip::before { content: "✓ "; color: var(--primary-deep); font-weight: 800; }
.ds-chip.is-out { background: #FFF8EF; box-shadow: inset 0 0 0 1.5px var(--lift); color: var(--lift-ink); }
.ds-chip small { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 600; color: var(--lift-ink); }
/* Out of reach: the same top line as the box beside it, so both columns start level. The fix hangs
   off the chip on a short rule, so it reads as the answer to that chip. */
.ds-vout { display: grid; gap: 8px; align-content: start; justify-items: start; padding: 14px 0 14px 4px; }
.ds-ask { margin-left: 14px; padding: 4px 0 4px 12px; border-left: 2px solid #C9CDE0; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; color: var(--ink-2); text-wrap: balance; }

/* ---------- Step 4: one row per signal ---------- */
#ds-seen { display: grid; gap: 12px; min-width: 0; }
.ds-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.a-body .ds-list { padding: 0; }
.ds-row { display: grid; gap: 8px; min-width: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); font-size: 1rem; line-height: 1.4; }
.ds-row.is-flag { box-shadow: inset 0 0 0 1px var(--rule), inset 3px 0 0 var(--lift); }
.ds-row > strong { min-width: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ds-where { font: 500 0.875rem/1.4 var(--mono); color: var(--ink-hint); overflow-wrap: anywhere; }
.ds-where.is-leak { color: var(--lift-ink); }
.ds-q { display: grid; grid-template-columns: minmax(0, 1fr) 10rem; gap: 8px 12px; align-items: center; }
.ds-q > span { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.ds-why { font-size: 0.9375rem; line-height: 1.45; color: var(--lift-ink); }
.ds-tick { font-size: 0.9375rem; font-weight: 600; line-height: 1.45; color: var(--primary-deep); }
.ds-tick::before { content: "✓ "; font-weight: 800; }

.ds-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.ds-seg button { min-height: 2.5rem; padding: 0.3em 0.55em; border: 0; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink-2); font: 700 0.875rem/1.15 var(--sans); cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s, color 0.2s; }
.ds-seg button:hover { box-shadow: inset 0 0 0 2px #B5BAD2; }
.ds-seg button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.ds-seg [aria-pressed="true"] { background: var(--night); box-shadow: none; color: #fff; }
.ds-seg [aria-pressed="true"]:hover { box-shadow: none; }

/* ---------- Step 6: the day, and the card ---------- */
.ds-next { display: grid; gap: 6px; padding: clamp(16px, 2.6vw, 22px); border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--night); min-width: 0; }
.a-body .ds-next .eyebrow { color: var(--ink-hint); }
.ds-nt { font-family: var(--serif); font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem); font-weight: 700; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.ds-nm { font: 600 0.9375rem/1.4 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.ds-nm.is-leak { color: var(--lift-ink); }
.a-step .a-code.is-tall pre { max-height: none; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Phones: the months turn on their side ----------
   Nine columns at 390 leave no room to read, so each month becomes a row and its hours run out to
   the right. The note sits in the part of the month the hours leave empty. A different drawing of
   the same months, not a smaller one. */
@media (max-width: 640px) {
  .ds-chart { grid-template-columns: minmax(0, 1fr); }
  .ds-m { grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-rows: auto; align-items: center; gap: 8px; }
  .ds-mn { grid-column: 1; grid-row: 1; text-align: left; }
  .ds-track { grid-column: 2; grid-row: 1; height: 2.75rem; padding: 3px 0; align-items: stretch; background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px); background-size: calc(100% * 2 / 7) 100%; background-position: left top; }
  .ds-bar { display: flex; align-items: center; gap: 6px; width: calc(var(--h) / 7 * 100%); height: auto; padding: 0 10px; border-radius: 3px 8px 8px 3px; text-align: left; transform-origin: left; }
  .is-empty .ds-m:not(.is-in) .ds-bar { transform: scaleX(0); }
  .ds-note { top: 50%; bottom: auto; left: calc(100% + 8px); right: auto; transform: translateY(-50%); white-space: nowrap; text-align: left; }
  .ds-cut { top: -1.5px; bottom: auto; left: calc(2.5rem + 8px); right: 0; width: auto; height: 3px; background: linear-gradient(90deg, #AC76FD 0%, #7E71FA 50%, #536CF9 100%); transform-origin: left; }
  .is-before .ds-cut { transform: scaleX(0); }
  .ds-daytag { top: -14px; left: auto; right: 0; }
  .ds-read > div { padding: 10px 12px; }
  .ds-key { gap: 5px 14px; font-size: 0.8125rem; }

  .ds-rh { display: none; }
  .ds-rr { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ds-rr i { display: none; }
  .ds-firm::before { content: "→ "; color: #8990B4; font-weight: 700; }

  .ds-view { grid-template-columns: minmax(0, 1fr); }

  .ds-f { grid-template-columns: minmax(0, 1fr); }
  .ds-q { grid-template-columns: minmax(0, 1fr); }
  .ds-q .ds-seg { max-width: 12rem; }
}
@media (max-width: 340px) {
  .ds-bar b { font-size: 0.75rem; }
  .ds-daytag { font-size: 0.6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-toggle, .ds-seg button, .ds-bar, .ds-cut, .ds-daytag { transition: none !important; }
}
