/* Daniel's legal tools, Milan's ux-hierarchy redo (13 Nov): Ask Legal (ask_legal/show) and the Deviation board's frame (playbook_deviations/show).
   Paul's pages: layout only, tokens only. The board itself (.devboard__*, pages-work.css) is his and stays as it is; this sheet only lays out
   what sits around it (.devpage__*). Controls on these pages are white on the sand page (Milan, 13 Nov: "inputs white on the sand body"). */

/* ── Ask Legal ──────────────────────────────────────────────────
   Four titled sections, 48px apart (16px inside each, so the groups read). A section is a header (title, one-sentence lede, at most one
   action at the right) over one white card of rows: never a stack of cards. */
.page.ldu-page.asklegal { gap: 48px; }
.asklegal :is(.input, .textarea, .ldu-dd__trigger) { background-color: var(--bg-2); }
/* what waits for Daniel, first on the page; only there when something does */
.asklegal__waiting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--ldu-r-xl); background: var(--bg-2); }
.asklegal__waiting > strong { margin-right: auto; font-size: var(--fs-body); color: var(--ink); }
.asklegal__waiticon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.asklegal__sect { display: grid; gap: 16px; min-width: 0; scroll-margin-top: 24px; }
.asklegal__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.asklegal__head > div { display: grid; gap: 4px; min-width: 0; max-width: 60ch; }
.asklegal__title { margin: 0; font-size: var(--fs-h2); font-weight: 600; line-height: 1.3; color: var(--ink); }
.asklegal__lede { margin: 0; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }

/* the rows inside the one card: a hairline between, no box per row */
.asklegal__steps, .asklegal__rows { margin: 0; padding: 0; list-style: none; }
.page.ldu-page .card.asklegal__steps, .page.ldu-page .card.asklegal__rows { display: block; padding: 0; }
/* links inside the page's text read as ink, never lilac or underlined (Milan, 13 Nov); they darken on hover */
.asklegal :is(.asklegal__meta, .asklegal__quote) a, .devpage__lede a { font-weight: 500; }
.asklegal__steps > li + li, .asklegal__rows > * + * { border-top: 1px solid var(--line); }

/* a step: its number (the cell a drag handle takes once the steps can be reordered), what it does, what it holds now, the way to manage it */
.asklegal__step {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 16rem) minmax(9rem, auto); align-items: center; gap: 4px 16px; padding: 14px 20px;
}
.asklegal__num { align-self: start; padding-top: 1px; font-size: var(--fs-ui); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.asklegal__body { display: grid; gap: 2px; min-width: 0; }
.asklegal__name { display: flex; align-items: center; gap: 8px; font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.asklegal__name > .icon { flex: none; color: var(--ink-2); }
.asklegal__what { font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.asklegal__now { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.asklegal__act { display: flex; justify-content: flex-end; }
.asklegal__act .btn { white-space: nowrap; }

/* guidance entries and Cite Check runs: one row each */
.asklegal__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 24px; padding: 16px 20px; }
.asklegal__rowmain { display: grid; gap: 6px; min-width: 0; max-width: 72ch; }
.asklegal__rowacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.asklegal__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }
.asklegal__q { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.asklegal__says { margin: 0; font-size: var(--fs-body); line-height: 1.5; color: var(--ink); }
.asklegal__meta { font-size: var(--fs-meta); line-height: 1.5; color: var(--ink-2); }
.asklegal__alert { font-size: var(--fs-meta); font-weight: 600; color: var(--danger); }
.asklegal__none { display: block; margin: 0; font-size: var(--fs-ui); color: var(--ink-2); }

/* a disclosure (Daniel's own position, a provision's text): a quiet text toggle whose chevron turns */
.asklegal__more > summary { display: inline-flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; font-size: var(--fs-meta); font-weight: 500; color: var(--ink-2); transition: color var(--dur); }
.asklegal__more > summary::-webkit-details-marker { display: none; }
.asklegal__more > summary:hover { color: var(--ink); }
.asklegal__more > summary:focus-visible { outline: var(--ring-w) solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.asklegal__more > summary .icon { transition: transform var(--dur); }
.asklegal__more[open] > summary .icon { transform: rotate(180deg); }
.asklegal__more > p, .asklegal__more > blockquote { margin: 6px 0 0; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink); }

/* a Cite Check run: its head across the row, a finding per citation under it */
.asklegal__row--check { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.asklegal__row--new { grid-template-columns: minmax(0, 1fr); }
.asklegal__checkhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.asklegal__finding { display: grid; gap: 6px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.asklegal__checkhead + .asklegal__finding, .asklegal__checkhead + small + .asklegal__finding { margin-top: 4px; }
.asklegal__quote { margin: 6px 0 0; padding: 10px 12px; border-radius: var(--r-2); background: var(--bg); }
.asklegal__quote small { display: block; margin-top: 4px; font-size: var(--fs-meta); color: var(--ink-2); }
.asklegal__decide { display: flex; flex-wrap: wrap; gap: 8px; }

/* the two forms on the page (Check another text, Try a question): a labelled field, then its button */
.asklegal__form { display: grid; gap: 12px; }
.asklegal__go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.asklegal__row.asklegal__result { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.asklegal__told { margin: 0; padding: 12px 14px; border-radius: var(--r-2); background: var(--bg); white-space: pre-wrap; font-size: var(--fs-meta); line-height: 1.6; color: var(--ink); }

@container page (max-width: 760px) {
  /* a phone: what it does across, then what it holds now with its button beside it */
  .asklegal__step { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; }
  .asklegal__body { grid-column: 2 / -1; }
  .asklegal__now { grid-column: 2; }
  .asklegal__act { grid-column: 3; }
  .asklegal__act:empty, .asklegal__now:empty { display: none; }
  .asklegal__row { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .asklegal__rowacts { justify-content: flex-start; }
  .asklegal__head > .btn { width: 100%; }
}

/* ── Deviation board: the frame around Paul's board ───────────
   One bar (the client on the left, Check a contract on the right, equal heights), the status line with what waits for Daniel, the legend
   of marks before the boards it explains, and each board's title with a one-line lede. */
.devpage :is(.input, .ldu-dd__trigger) { background-color: var(--bg-2); }
/* the page carries .activity (the Tracker's full-height frame, pages-work.css); its boards size to their rows here, so the page sizes to its content */
.page.ldu-page.activity.devpage { height: auto; }
.devpage__bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.devpage__client, .devpage__apply { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; min-width: 0; }
.devpage__field { width: 16rem; max-width: 100%; }
.devpage__field--wide { width: 24rem; }
.devpage__apply .btn { white-space: nowrap; }

.devpage__status { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 2px 12px; }
.devpage__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.devpage__icon--wait { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.devpage__sum { font-size: var(--fs-body); color: var(--ink); }
.devpage__sum strong { font-weight: 600; }
.devpage__swipe { display: none; }

.devpage__legend { align-items: center; }
.devpage__legendlabel { font-size: var(--fs-meta); font-weight: 500; color: var(--ink-2); margin-right: 4px; }

.devpage__head { display: grid; gap: 4px; }
.devpage__title { margin: 0; font-size: var(--fs-h2); font-weight: 600; line-height: 1.3; color: var(--ink); }
.devpage__lede { margin: 0; font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
/* a board is as tall as its rows: no empty band under them; with no contract yet it is one row */
.devpage__kind { flex: 0 0 auto; min-height: 0; }
.devpage__kind .devboard__scroll { flex: 0 0 auto; min-height: 0; }
.devpage .devboard__fill, .devpage__kind--empty .devboard__progress { display: none; }

@container page (max-width: 760px) {
  .devpage__client, .devpage__apply { width: 100%; }
  .devpage__field, .devpage__field--wide { width: 100%; }
  .devpage__apply .btn { width: 100%; }
  .devpage__swipe { display: inline; }
}

/* a phone: the floating Menu button sits over the page's foot, so both pages end with room for it (a media query: the page frame is the
   size container, and a container query cannot style the container itself) */
@media (max-width: 860px) { .page.ldu-page:is(.asklegal, .devpage) { padding-bottom: 104px; } }
