/** * Plan editor styling. * * MDXEditor's structural CSS is imported by the app; this retheme layer maps it * onto Ace's tokens so the editor reads as part of the product rather than as a * third-party widget. */ @import "./callout.css"; /* Evidence can extend beyond the clipped document column; only its panel takes hits. */ .plan-evidence-popover { pointer-events: none; position: fixed; inset: 0; z-index: 40; } .plan-evidence-panel { pointer-events: auto; position: fixed; width: min(20rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; border-radius: var(--radius-md); background: var(--color-page); box-shadow: var(--shadow-overlay); outline: var(--edge-width) solid var(--color-edge); outline-offset: calc(-1 * var(--edge-width)); } .plan-content [data-research-draft-anchor] { margin-block-end: var(--research-draft-space, 0); } .plan-research-draft { width: min(28.125rem, var(--plan-content-width, 48rem), calc(100vw - 2rem)); padding: 0.875rem; border: var(--edge-width) solid var(--color-edge); border-radius: var(--radius-lg); background: var(--color-page); box-shadow: var(--shadow-resting); } [data-research-ready] { box-shadow: var(--shadow-resting-strong); transition: box-shadow var(--duration-fast) var(--ease-out); } [data-research-ready]:hover, [data-research-ready]:focus-within { box-shadow: var(--shadow-raised); } .plan-research-open { position: absolute; z-index: 1; inset: 0; cursor: pointer; border: 0; border-radius: inherit; background: transparent; } /* Research widgets never exceed 450px and shrink with their container. */ .plan-research-composer, .plan-research-tracked { width: 100%; max-width: 28.125rem; } .plan-research-composer { display: grid; gap: 0.625rem; } .plan-research-field { position: relative; } .plan-research-field textarea { display: block; width: 100%; min-height: 5.5rem; resize: none; padding: 0.625rem 2.5rem 3rem 0.75rem; font: inherit; font-size: var(--text-sm); } .plan-research-dismiss { position: absolute; inset: 0.3125rem 0.3125rem auto auto; } .plan-research-send { position: absolute; inset: auto 0.625rem 0.625rem auto; } .plan-research-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; } .plan-research-tracked { display: grid; } .plan-research-status { display: flex; align-items: center; gap: 0.5rem; min-height: 1.5rem; font-size: var(--text-sm); color: var(--color-text-tertiary); } /* Stages that lead with a badge give their header more room. */ .plan-research-status[data-lead] { margin-block-end: 0.25rem; } .plan-research-remove { display: flex; align-items: center; margin-inline-start: auto; } .plan-research-meta { color: var(--color-text-quaternary); } .plan-research-title { font-size: var(--text-sm); font-weight: 600; line-height: var(--text-sm--line-height); color: var(--color-text-primary); } .plan-research-card[data-stage="cancelled"] .plan-research-title { color: var(--color-text-tertiary); } .plan-research-summary { margin: 0; font-size: var(--text-sm); color: var(--color-text-secondary); } .plan-research-footer { display: flex; justify-content: flex-end; } .plan-research-dot { width: 0.5rem; height: 0.5rem; margin-inline: 0.1875rem; border-radius: 50%; background: var(--color-brand); animation: plan-research-pulse 1.4s var(--ease-out) infinite; } .plan-research-dot[data-idle] { background: var(--color-text-quaternary); animation: none; } @keyframes plan-research-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--color-brand) 45%, transparent); } 100% { box-shadow: 0 0 0 0.375rem transparent; } } .plan-research-badge { display: grid; flex-shrink: 0; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--color-danger-surface); color: var(--color-destructive); } .plan-research-badge[data-tone="brand"] { background: var(--color-brand-wash); color: var(--color-brand); } .plan-research-badge [data-nucleo-icon] { color: inherit; } .plan-research-callout { padding: 0.375rem 0.75rem; border-radius: var(--radius-md); background: var(--color-ruby-2); } .plan-research-callout p { margin: 0; padding-block: 0.125rem; font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--color-destructive-ink); } .plan-research-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.25rem; padding-inline: 0.25rem; } .plan-research-track span { position: relative; overflow: hidden; height: 0.3125rem; border-radius: var(--radius-full); background: var(--color-selected); transition: background-color 500ms var(--ease-out); } .plan-research-track span[data-state="now"], .plan-research-track span[data-state="done"] { background: var(--color-brand); } /* The sheen rides its own layer so it can fade without touching the fill. */ .plan-research-track span::after { content: ""; position: absolute; inset: 0; background: linear-gradient( 90deg, transparent 0%, color-mix(in oklch, white 70%, transparent) 50%, transparent 100% ); background-size: 50% 100%; background-repeat: no-repeat; opacity: 0; animation: plan-research-sheen 1.6s linear infinite; transition: opacity 400ms var(--ease-out); } .plan-research-track span[data-state="now"]::after { opacity: 1; transition-delay: var(--duration-base); } @keyframes plan-research-sheen { from { background-position: -100% 0; } to { background-position: 200% 0; } } .plan-research-found { padding-inline: 0.25rem; font-size: var(--text-xs); color: var(--color-text-tertiary); } /* Swap: layers share one grid cell and crossfade by opacity alone. */ .plan-research-swap { display: inline-grid; } .plan-research-swap > span { grid-area: 1 / 1; animation: plan-research-swap-in 360ms var(--ease-out) var(--duration-fast) both; } .plan-research-swap > span[data-initial] { animation: none; } .plan-research-swap > span[data-leaving] { animation: plan-research-swap-out 240ms var(--ease-out) both; } @keyframes plan-research-swap-in { from { opacity: 0; } } @keyframes plan-research-swap-out { to { opacity: 0; } } .plan-research-indicator { place-items: center; } .plan-research-indicator > span { display: grid; place-items: center; min-width: 0.875rem; min-height: 0.875rem; } .plan-research-indicator .plan-research-dot { margin: 0; } /* Fold: animates grid rows so height changes are never a jump. */ .plan-research-fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 420ms var(--ease-out), opacity 300ms var(--ease-out); } .plan-research-fold[data-open] { grid-template-rows: 1fr; opacity: 1; transition-delay: var(--duration-fast); } .plan-research-fold > div { min-height: 0; overflow: hidden; } .plan-research-tracked > .plan-research-fold > div { display: grid; gap: 0.5rem; padding-block-start: 0.625rem; } /* Inside the card a fold owns its gap, so a closed one takes no space. */ .plan-research-card .plan-research-fold { margin-block-start: -0.5rem; } .plan-research-card .plan-research-fold > div > * { margin-block-start: 0.5rem; } @media (prefers-reduced-motion: reduce) { .plan-research-dot, .plan-research-swap > span, .plan-research-track span::after { animation: none; } .plan-research-fold, .plan-research-track span, .plan-research-track span::after { transition: none; } } .plan, .plan-decisions { --plan-gutter: 4rem; /* * A comfortable measure. The panel is resizable and a plan is read far more * often than it is written, so the text stops widening well before the pane * does. At the body size below this is roughly 85 characters a line, near * the top of the range a reader can track back from without losing the row. */ --plan-measure: 43.75rem; /* * Document body text, one step down from the old 17px so prose sits * closer to chrome and chat sizes. Resolved out here because MDXEditor * declares `--text-base`, `--text-sm` * and `--text-xs` on its own root, which sits between `:root` and the * document — so reading the theme token inside the editor gets its 1rem * rather than ours. `.plan` is outside that root, so this catches the * theme's value on the way past. */ --plan-text-xs: var(--text-xs); --plan-text-sm: var(--text-sm); --plan-body: var(--text-base); } /* Document views -------------------------------------------------------- */ .plan-workspace { position: relative; display: flex; flex: 1; min-height: 0; overflow: hidden; } .plan-document { position: relative; container-type: inline-size; flex: 1; min-width: 0; min-height: 0; background: var(--color-page); box-shadow: var(--shadow-raised); } /* A narrow document needs breathing room, but never a 32px tax on each side. */ @container (max-width: 40rem) { .plan-content, .plan-decisions-content { --plan-gutter: 1rem; } /* Anchor state keeps this lane stable when its marker leaves the viewport. */ .plan-document[data-plan-decision-lane] .plan-content { --plan-leading-gutter: 2rem; } /* Wide authored surfaces keep their own visible, keyboard-operable lane. */ .plan-content :is(pre, table, .plan-code-view, [role="tablist"]) { overscroll-behavior-inline: contain; } .plan-content :is(pre, table, .plan-code-view, [role="tablist"])::-webkit-scrollbar { block-size: 8px; } .plan-content :is(pre, table, .plan-code-view, [role="tablist"])::-webkit-scrollbar-track { background: var(--color-inset); } .plan-content :is(pre, table, .plan-code-view, [role="tablist"])::-webkit-scrollbar-thumb { border: 2px solid var(--color-inset); border-radius: var(--radius-lg); background: var(--color-text-quaternary); } } /* Reader-local comment chrome must not move collaborative line boxes. */ .plan-comment-layer { pointer-events: none; position: absolute; inset: 0; z-index: 2; } .plan-comment-chip, .plan-comment-orphan-button { z-index: 1; pointer-events: auto; border: var(--edge-width) solid var(--color-control-edge); background: var(--color-page); color: var(--color-text-secondary); box-shadow: var(--shadow-resting); } /* The button is the hit area: on a coarse pointer 44px wide and as tall as the first line, inside the document. */ .plan-comment-button { pointer-events: auto; position: absolute; border-radius: var(--radius-md); transition: opacity var(--duration-fast) var(--ease-out); } .plan-comment-chip { position: absolute; display: inline-flex; height: 24px; align-items: center; justify-content: center; gap: 0.125rem; border-radius: var(--radius-md); font-size: var(--text-xs); font-variant-numeric: tabular-nums; line-height: 1; } .plan-comment-button[data-slim] .plan-comment-chip { border-radius: var(--radius-sm); } .plan-comment-button[data-replies] .plan-comment-chip { background: var(--color-brand-wash); color: var(--color-brand-ink); } /* Another thread's card is open: this marker steps back and cannot be pressed. */ .plan-comment-button[data-dimmed] { opacity: 0.4; } /* The host receives hits so prose keeps native selection. */ .plan-comment-hit { pointer-events: none; position: absolute; } .plan-comment-button:hover .plan-comment-chip, .plan-comment-button:focus-visible .plan-comment-chip, .plan-comment-button[aria-expanded="true"] .plan-comment-chip, .plan-comment-orphan-button:hover, .plan-comment-orphan-button:focus-visible { background: var(--color-brand-wash); color: var(--color-brand-ink); } .plan-comment-preview, .plan-comment-card { pointer-events: auto; position: absolute; width: min(20rem, calc(100% - 1.5rem)); } .plan-comment-preview { /* A narrow preview can overlap prose, but never intercept it. */ pointer-events: none; max-width: 18rem; padding: 0.625rem; border-radius: var(--radius-md); background: var(--color-page); box-shadow: var(--shadow-overlay); outline: var(--edge-width) solid var(--color-edge); outline-offset: calc(-1 * var(--edge-width)); font-size: var(--text-sm); color: var(--color-text-primary); } .plan-comment-preview p { margin: 0; } .plan-comment-preview .plan-comment-preview-author { display: flex; } .plan-comment-preview .plan-comment-preview-note { margin-top: 0.125rem; } .plan-comment-preview .plan-comment-preview-replies { display: block; margin-top: 0.25rem; color: var(--color-text-tertiary); } .plan-comment-card { max-height: calc(100% - 1rem); overflow: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); --enter-x: 0; --enter-y: 0; animation: plan-comment-enter var(--duration-fast) var(--ease-out); } /* The card enters from its passage: across from the gutter, down from below, up from above. */ .plan-comment-card[data-side="right"] { --enter-x: 0.25rem; transform-origin: top left; } .plan-comment-card[data-side="below"] { --enter-y: -0.25rem; transform-origin: top left; } .plan-comment-card[data-side="above"] { --enter-y: 0.25rem; transform-origin: bottom left; } [data-plan-comment-card] { background: var(--color-page); box-shadow: none; } .plan-comment-close { margin: -0.25rem -0.25rem -0.25rem 0; color: var(--color-text-tertiary); } .plan-comment-back { margin-left: -0.5rem; color: var(--color-text-tertiary); } .plan-comment-group-item { display: flex; width: 100%; flex-direction: column; gap: 0.125rem; padding: 0.375rem 0.5rem; border-radius: var(--radius-md); text-align: left; } .plan-comment-group-item:hover { background: var(--color-hover); } .plan-comment-group-note { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; } .plan-comment-context { padding: 0.5rem 0.625rem; border-radius: var(--radius-md); background: var(--color-inset); } .plan-comment-context-copy { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-height: var(--text-sm--line-height); } .plan-comment-composer[data-inset-send] { border-radius: var(--radius-md); background: var(--color-page); } .plan-comment-composer[data-inset-send] .plan-comment-composer-field { padding-right: 3rem; padding-bottom: 2.75rem; } .plan-comment-confirm { padding: 0.625rem; border-radius: var(--radius-md); background: var(--color-inset); } @keyframes plan-comment-enter { from { opacity: 0; transform: translate(var(--enter-x), var(--enter-y)); } to { opacity: 1; transform: none; } } .motion-comment-preview { opacity: 0; transform: scale(var(--dropdown-pre-scale)); transition: opacity var(--dropdown-open-dur) var(--dropdown-ease), transform var(--dropdown-open-dur) var(--dropdown-ease); will-change: opacity, transform; } .motion-comment-preview.is-open { opacity: 1; transform: none; } @starting-style { .motion-comment-preview.is-open { opacity: 0; transform: scale(var(--dropdown-pre-scale)); } } .motion-comment-preview.is-closing { opacity: 0; transform: scale(var(--dropdown-closing-scale)); transition-duration: var(--dropdown-close-dur); } .motion-comment-preview[data-motion-immediate] { transition: none; } .motion-comment-surface { opacity: 0; transform: scale(var(--dropdown-pre-scale)); transform-origin: top right; transition: opacity var(--dropdown-open-dur) var(--dropdown-ease), transform var(--dropdown-open-dur) var(--dropdown-ease); will-change: opacity, transform; } .motion-comment-surface[data-motion-presentation="sheet"] { transform: translateY(var(--drawer-distance)); transform-origin: bottom center; transition-duration: var(--drawer-open-dur); } .motion-comment-surface.is-open { opacity: 1; transform: none; } .motion-comment-surface.is-closing { pointer-events: none; opacity: 0; transform: scale(var(--dropdown-closing-scale)); transition-duration: var(--dropdown-close-dur); } .motion-comment-surface[data-motion-presentation="sheet"].is-closing { transform: translateY(var(--drawer-distance)); transition-duration: var(--drawer-close-dur); } .plan-comment-orphans { pointer-events: auto; position: absolute; top: 0.5rem; right: 0.5rem; } .plan-comment-orphan-button { border-radius: var(--radius-md); padding: 0.375rem 0.5rem; font-size: var(--text-sm); } .plan-comment-orphan-card { top: 2.5rem; right: 0; } .plan-comment-sheet-backdrop { --backdrop-opacity: 0.24; position: fixed; inset: 0; z-index: 70; background: rgb(var(--shadow-color)); opacity: calc(var(--backdrop-opacity) * (1 - var(--drawer-swipe-progress, 0))); transition: opacity var(--duration-base) var(--ease-out); } .plan-comment-sheet-viewport { pointer-events: none; position: fixed; inset: 0; z-index: 71; display: flex; align-items: flex-end; } .plan-comment-sheet-popup { pointer-events: auto; display: flex; width: 100%; flex-direction: column; height: calc(100dvh - 0.5rem); overflow: hidden; border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--color-page); box-shadow: 0 -1rem 3rem rgb(var(--shadow-color) / 22%); transform: translateY( calc(var(--drawer-snap-point-offset, 100%) + var(--drawer-swipe-movement-y, 0px)) ); transition: transform calc(var(--drawer-swipe-strength, 1) * var(--duration-base)) var(--ease-out); } .plan-comment-sheet-grabber { display: grid; width: 100%; height: 2rem; flex: none; place-items: center; border: 0; background: transparent; color: var(--color-text-tertiary); touch-action: none; } .plan-comment-sheet-grabber span { width: 2.25rem; height: 0.3rem; border-radius: var(--radius-full); background: var(--color-text-tertiary); } /* Sits in the grabber row, so a draft needs no header row; the sheet is touch-only, so 44px. */ .plan-comment-sheet-close { position: absolute; top: 0; right: 0.25rem; width: 2.75rem; height: 2.75rem; margin: 0; } .plan-comment-sheet-title { margin: 0; padding: 0 1rem 0.5rem; color: var(--color-text-primary); font-size: var(--text-sm); font-weight: 600; } .plan-comment-sheet-content { min-height: 0; flex: 1; overflow: auto; padding-right: env(safe-area-inset-right, 0px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--drawer-keyboard-inset, 0px)); padding-left: env(safe-area-inset-left, 0px); overscroll-behavior: contain; } .plan-comment-sheet-content > [data-plan-comment-card] { border-radius: 0; box-shadow: none; } .plan-comment-sheet-popup[data-starting-style], .plan-comment-sheet-popup[data-ending-style] { transform: translateY(100%); } .plan-comment-sheet-backdrop[data-starting-style], .plan-comment-sheet-backdrop[data-ending-style] { opacity: 0; } @media (prefers-reduced-motion: reduce) { .plan-comment-card { animation: none; } .plan-comment-sheet-backdrop, .plan-comment-sheet-popup { transition-duration: 0ms; } } @media (prefers-reduced-motion: reduce) { .motion-comment-preview, .motion-comment-surface { transition: none; } } .plan-decisions { display: flex; height: 100%; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; container-type: inline-size; /* The workspace ground shows through the rail. */ background: transparent; } .plan-decisions-content { padding: 1.5rem var(--plan-gutter) 60vh; margin-inline: auto; max-width: calc(var(--plan-measure) + var(--plan-gutter) * 2); } .plan-decisions-content--empty { display: flex; width: 100%; max-width: none; align-items: safe center; justify-content: center; padding: 3rem var(--plan-gutter); } .plan-decisions-empty { display: flex; width: min(100%, 42rem); min-height: 19rem; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; border: var(--edge-width) dashed var(--color-control-edge); border-radius: var(--radius-lg); text-align: center; } .plan-decisions-empty-icon { display: grid; width: 3.5rem; height: 3.5rem; place-items: center; margin-block-end: 1.5rem; border-radius: var(--radius-lg); background: var(--color-inset); color: var(--color-text-primary); } .plan-decisions-empty h3 { margin: 0; font-size: var(--text-xl); font-weight: 600; line-height: 1.25; color: var(--color-text-primary); } .plan-decisions-empty p { max-width: 27rem; margin: 0.5rem 0 0; font-size: var(--text-base); line-height: 1.5; color: var(--color-text-tertiary); } /* Decorator hosts are block-level plan content, not zero-size anchors. */ .plan .plan-content [data-plan-questionnaire], .plan .plan-content [data-plan-decision] { margin-block: 1rem; } /* Keep the one editable caret paragraph between consecutive cards compact. */ .plan .plan-content > :is([data-plan-questionnaire], [data-plan-decision]):has(+ p > br:only-child):has(+ p + :is([data-plan-questionnaire], [data-plan-decision])) { margin-block-end: 0; } .plan .plan-content > :is([data-plan-questionnaire], [data-plan-decision]) + p:has(> br:only-child):has(+ :is([data-plan-questionnaire], [data-plan-decision])) { margin-block: 0; } .plan .plan-content > :is([data-plan-questionnaire], [data-plan-decision]) + p:has(> br:only-child) + :is([data-plan-questionnaire], [data-plan-decision]) { margin-block-start: 0; } /* The inner card is hidden after resolution, but its Lexical decorator host also has document spacing. Remove that host from layout as well. */ .plan .plan-content [data-plan-questionnaire]:has([data-card-hidden]) { display: none; margin-block: 0; } .plan .plan-content :is([data-plan-questionnaire], [data-plan-decision]) article { width: 100%; } .decision-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out); } .decision-collapse.is-closing { grid-template-rows: 0fr; opacity: 0; } @media (prefers-reduced-motion: reduce) { .decision-collapse { transition: none; } } /* * The prose a sidecar card refers to, while somebody is pointing at that card. * * Registered in `CSS.highlights`, so it paints over the text without putting * anything in the document. One mark for both halves of the sidecar: questions * used to outline a block while comments washed a range, so the same fact — * this is the prose that card refers to — read as two different things * depending on which card it came from. `::highlight()` cannot draw an outline, * so the wash is what they can both be. * * Nothing is painted at rest. Standing marks for live comments and for decided * prose were tried and taken out: a plan accumulates decisions, so anything * permanent ends up covering most of the document, and a page that is mostly * highlighted has told you nothing. * * `background-color`, not `background`: only a handful of longhands are * permitted here, and the shorthand works today solely because browsers expand * it before filtering. Not worth depending on. * * The colour is recorded beside the declaration because it is calibrated as * a rendered wash, not as an abstract percentage of a darker accent. */ ::highlight(plan-related) { /* #d8eaee */ background-color: var(--color-brand-wash); } /* The passage a link is being added to, while its field holds the selection. */ ::highlight(plan-link-target) { background-color: var(--color-brand-wash); } /* * The same pointer, for a browser with no Highlight API. * * A block outline rather than a wash, because without the API there is no way * to mark part of one — less precise, and honest about it. Standing marks are * dropped entirely on this path: outlining every decided passage would box up * half the plan. */ .plan .plan-content [data-plan-related] { border-radius: var(--radius-sm); outline: 1px solid color-mix(in oklch, var(--color-brand) 60%, transparent); outline-offset: 3px; background: var(--color-brand-wash); } /* * Retheme MDXEditor onto Ace's tokens. * * MDXEditor ships a light Radix palette on its own root and only switches off * it for a `.dark-theme` class it expects the host to add. Ace has its own * theme, so rather than opt into a second one we point its variables at ours — * the editor then follows Ace into light or dark with nothing to keep in sync. * * These have to land on the same element MDXEditor sets them on; an ancestor * would lose to its own declaration. */ .plan .mdxeditor { background: transparent; font-family: var(--font-sans); --text-xs: var(--plan-text-xs); --text-sm: var(--plan-text-sm); --text-base: var(--plan-body); --basePageBg: transparent; --baseBase: var(--color-page); --baseBgSubtle: var(--color-inset); --baseBg: var(--color-hover); --baseBgHover: var(--color-hover); --baseBgActive: var(--color-selected); --baseLine: var(--color-edge); --baseBorder: var(--color-edge); --baseBorderHover: var(--color-brand); --baseSolid: var(--color-text-tertiary); --baseSolidHover: var(--color-text-primary); --baseText: var(--color-text-primary); --baseTextContrast: var(--color-text-primary); --accentBase: var(--color-page); --accentBgSubtle: var(--color-brand-wash); --accentBg: var(--color-brand-wash); --accentBgHover: var(--color-brand-wash); --accentBgActive: var(--color-brand-wash); --accentLine: var(--color-edge); --accentBorder: var(--color-edge); --accentBorderHover: var(--color-brand); --accentSolid: var(--color-brand); --accentSolidHover: var(--color-brand-hover); --accentText: var(--color-brand); --accentTextContrast: var(--color-text-primary); --admonitionTipBg: var(--color-success-wash); --admonitionTipBorder: var(--color-success); --admonitionInfoBg: var(--color-brand-wash); --admonitionInfoBorder: var(--color-brand); --admonitionCautionBg: var(--color-warning-wash); --admonitionCautionBorder: var(--color-warning); --admonitionDangerBg: var(--color-destructive-wash); --admonitionDangerBorder: var(--color-destructive); --admonitionNoteBg: var(--color-hover); --admonitionNoteBorder: var(--color-edge); --error-color: var(--color-destructive); --font-body: var(--font-sans); --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; } /* * Scoped to `.plan` on purpose. MDXEditor sets padding and colour directly * on its own content class, which is exactly as specific as ours, so a bare * `.plan-content` wins only by landing later in the bundle. That is a * property of how the CSS happens to be chunked, not of anything we control. */ .plan .plan-content { --plan-leading-gutter: var(--plan-gutter); --plan-wide-inline-size: calc(100cqi - var(--plan-leading-gutter) - var(--plan-gutter)); --plan-wide-inline-offset: calc((100% - var(--plan-wide-inline-size)) / 2); /* * The trailing space is deliberate and large: the caret should never sit * against the bottom of the pane, and a plan is usually appended to. */ padding: 3rem var(--plan-gutter) 60vh; padding-inline-start: var(--plan-leading-gutter); margin-inline: auto; max-width: calc(var(--plan-measure) + var(--plan-gutter) * 2); font-size: var(--plan-body); /* Prose wants looser leading than the UI rhythm the token pairs with. */ line-height: 1.6; color: var(--color-text-primary); } /* * MDXEditor gives its placeholder the content class too. Pin its absolute box * across the wrapper so auto margins center it like the editable document; * without both insets it shrink-wraps left of the caret on a wide canvas. */ .plan .mdxeditor-root-contenteditable > .plan-content { inset-inline: 0; color: var(--color-text-quaternary); } :root[data-plan-coarse-pointer] .plan-menu-row { height: 44px; min-height: 44px; } :root[data-plan-coarse-pointer] .plan-menu-cell { width: 44px; height: 44px; min-width: 44px; } /* * Document typography. * * Tailwind's preflight resets headings to inherit their size and weight and * strips list markers, which is right for an app chrome and wrong for prose. * A plan is prose, so the document elements are given their meaning back here. */ .plan-content :is(h1, h2, h3, h4, h5, h6) { font-weight: 600; line-height: 1.3; margin-block: 1.5em 0.5em; color: var(--color-text-primary); /* Short enough to weigh every break at once, and an 8/1 split reads as a mistake. */ text-wrap: balance; } .plan-content :is(h1, h2, h3, h4, h5, h6):first-child { margin-block-start: 0; } .plan-content h1 { font-size: var(--text-2xl); line-height: var(--text-2xl--line-height); } .plan-content h2 { font-size: var(--text-xl); line-height: var(--text-xl--line-height); } .plan-content h3 { font-size: var(--text-lg); line-height: var(--text-lg--line-height); } .plan-content :is(h4, h5, h6) { font-size: var(--plan-body); } /* iOS Safari zooms the page when it focuses editable text under 16px. */ @media (pointer: coarse) { .plan .plan-content, .plan-content :is(h4, h5, h6) { font-size: max(1rem, var(--plan-body)); } } .plan-content p { margin-block: 0.75em; } .plan-content :is(ul, ol) { margin-block: 0.75em; padding-inline-start: 1.5em; } .plan-content ul { list-style: disc; } .plan-content ol { list-style: decimal; } .plan-content li { margin-block: 0.25em; } /* Nested lists sit tighter than the block they interrupt. */ .plan-content li > :is(ul, ol) { margin-block: 0.25em; } .plan-content blockquote { margin-block: 1em; padding-inline-start: 1em; border-inline-start: 3px solid var(--color-edge); color: var(--color-text-secondary); } .plan-content a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; } /* Prose has no scrollbar of its own, so an authored token must be allowed to wrap. */ .plan-content :is(p, li, blockquote, h1, h2, h3, h4, h5, h6) { overflow-wrap: anywhere; } .plan-content hr { margin-block: 1.5em; border: 0; border-block-start: var(--edge-width) solid var(--color-edge); } .plan-content :is(strong, b) { font-weight: 600; color: var(--color-text-primary); } /* Structural components ------------------------------------------------- */ .plan-content pre { background: var(--color-inset); border-radius: var(--radius-md); padding: 0.75rem 1rem; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, monospace; font-size: var(--text-sm); } /* Inline code follows its parent heading or prose; block code has its own role. */ .plan-content :not(pre) > code { background: var(--color-inset); color: var(--color-text-primary); border-radius: var(--radius-sm); padding: 0.125em 0.3em; font-family: ui-monospace, SFMono-Regular, monospace; font-size: inherit; } /* * Tables scroll independently so a wide one never widens the document. * * `display: block` turns the table itself into the scrollport. Its inline size * is the readable width, while the cells' minimum widths preserve usable * columns and create overflow inside that scrollport when necessary. */ .plan-content table { display: block; inline-size: 100%; max-inline-size: 100%; overflow-x: auto; border-collapse: collapse; margin-block: 1em; } .plan-content th, .plan-content td { border: var(--edge-width) solid var(--color-edge); padding: 0.375rem 0.625rem; text-align: start; /* Without this a cell collapses onto its neighbour when a column is narrow, and two values read as one word. */ vertical-align: top; min-inline-size: 7rem; /* A table is deliberately allowed to scroll as a whole; breaking each unbroken identifier into syllables makes its columns unreadable. */ word-break: normal; overflow-wrap: normal; } .plan-content th { font-weight: 600; background: var(--color-hover); color: var(--color-text-primary); } /* A cell's paragraph is the cell; it should not add document spacing. */ .plan-content :is(th, td) > p { margin-block: 0; word-break: normal; overflow-wrap: normal; } /* Images and rendered diagrams are readings of the document, never its width. */ .plan-content :is(img, svg) { max-inline-size: 100%; block-size: auto; } /* Visual top-level blocks can use the document beyond the prose measure. */ .plan-content > :is(p:has(> [data-plan-src]:first-child + br[data-lexical-managed-linebreak]:last-child), [data-plan-language="mermaid"]) { inline-size: var(--plan-wide-inline-size); max-inline-size: var(--plan-wide-inline-size); margin-inline: var(--plan-wide-inline-offset); } /* * A compact table shrink-wraps around its columns from the prose's start edge, * like every other block; a wide one scrolls inside the prose measure. The row * and column rails are fixed overlays and sit in the gutter outside it. */ .plan-content > table { inline-size: max-content; max-inline-size: 100%; } /* The paragraph owns the wide row; the image keeps its intrinsic size inside it. */ .plan-content > p:has(> [data-plan-src]:first-child + br[data-lexical-managed-linebreak]:last-child) { display: grid; place-items: center; } /* * An image that could not load. In a sentence it is a chip like inline code, * so the sentence still reads; alone in its paragraph it is a quiet frame at * the prose width rather than the wide row a loaded image would use. */ .plan-content .plan-image-missing { display: inline-flex; align-items: center; gap: 0.3em; max-inline-size: 100%; vertical-align: bottom; padding: 0.125em 0.3em; border-radius: var(--radius-sm); background: var(--color-inset); color: var(--color-text-secondary); } .plan-content .plan-image-missing-label { overflow: hidden; min-inline-size: 0; text-overflow: ellipsis; white-space: nowrap; } .plan-content p:has(> [data-plan-src]:first-child + br[data-lexical-managed-linebreak]:last-child):has(.plan-image-missing) { display: block; /* Block layout honours `justify-items` too, which would still centre the frame. */ place-items: normal; inline-size: auto; max-inline-size: 100%; margin-inline: 0; } .plan-content p:has(> [data-plan-src]:first-child + br[data-lexical-managed-linebreak]:last-child) > [data-plan-src]:has(> .plan-image-missing) { display: block; } /* The managed break after a block frame would add an empty line beneath it. */ .plan-content p:has(> [data-plan-src]:first-child > .plan-image-missing) > br[data-lexical-managed-linebreak]:last-child { display: none; } .plan-content p:has(> [data-plan-src]:first-child + br[data-lexical-managed-linebreak]:last-child) .plan-image-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--spacing) * 2); block-size: calc(var(--spacing) * 24); padding-inline: calc(var(--spacing) * 4); border: var(--edge-width) solid var(--color-edge); border-radius: var(--radius-md); color: var(--color-text-tertiary); font-size: var(--plan-text-xs); } .plan-content p:has(> [data-plan-src]:first-child + br[data-lexical-managed-linebreak]:last-child) .plan-image-missing-label { max-inline-size: 100%; } .plan-content :is([data-plan-type], [data-plan-panels], .planMath) { min-inline-size: 0; max-inline-size: 100%; } .plan-content .planMath [data-plan-preview] { max-inline-size: 100%; overflow-x: auto; } /* * A selected range of cells. * * `@lexical/table` marks one by adding the class the theme names under * `tableCellSelected` and does nothing else at all — no inline style, no * fallback. MDXEditor's theme names no table class of any kind, so before * `plan-editor.tsx` added these the selection was live and completely * invisible: dragging across cells appeared to do nothing while a * `TableSelection` was very much in effect, and the next keystroke replaced * everything it covered. */ .plan .plan-content .plan-cell-selected { background: var(--color-selected); } /* Set on the table while a cell range is being dragged out, so the browser's own text selection does not paint underneath ours. */ .plan .plan-content .plan-table-selecting, .plan .plan-content .disable-selection { user-select: none; } /* Table rails ------------------------------------------------------------ */ /* * The grips a table is reshaped from. * * Positioned by script from measured cell rectangles, because a `