/* ============================================================================
   Annota design system — the tokens the style guide states.
   ----------------------------------------------------------------------------
   Source: docs/design/"Annota Style Guide.dc.html". Where this file and that
   one disagree, the style guide wins and this file is the bug.

   The `--ds-` prefix is a survival from the migration: it let this file sit
   beside `design-tokens.css` while pages moved over one at a time. That file
   is gone now, so every page reads from here and the prefix is the only
   reminder there were ever two.

   Two halves: the TOKENS the guide states, then the PARTS it states in terms
   of them (§04, "the parts, as built"). A part lives here the moment a second
   page wants it; a rule only one page can ever use belongs in that page's own
   stylesheet.
   ========================================================================== */

:root {
  /* ---- Colour ----------------------------------------------------------
     Ink and accent do nearly all the work. Green and amber are reserved for
     what a fact IS — stated versus assumed, approved versus questioned — so
     an amber pixel always means the same thing and never decorates. */
  --ds-ink: #14181f;
  --ds-ink-hover: #0b0e13;
  --ds-accent: #2455c8;
  --ds-accent-hover: #1a3f9c;
  --ds-stated: #166043;
  --ds-stated-dot: #1d7a55;
  --ds-assumed: #8a5a10;
  --ds-assumed-dot: #c07b17;

  /* NOT FOUND — a third state the guide's §01 does not yet draw (Jason,
     2026-09-08). "The drawing said it", "we supplied it" and "we could not
     find it" are three facts, and the guide's own rule — an amber pixel always
     means the same thing — is the argument FOR a third colour rather than
     against it. The artboard needs the swatch added to match. */
  --ds-missed: #a8322c;
  --ds-missed-dot: #c0432f;

  --ds-surface: #ffffff;
  --ds-background: #f7f8fa;
  --ds-well: #f2f4f7;
  --ds-void: #e8ebef;
  /* The recess a sheet is dropped into — a step below the void, so paper
     reads as paper against it. */
  --ds-well-deep: #dbe0e7;
  --ds-paper: #f4f2ec;

  /* Ink at an alpha, never a grey tint: the same pigment thinned reads as one
     family over any of the five surfaces above. Body type never goes below
     `--ds-ink-tertiary` — anything fainter is a hairline or a fill. */
  --ds-ink-secondary: rgba(20, 24, 31, 0.7);
  --ds-ink-tertiary: rgba(20, 24, 31, 0.55);
  --ds-ink-meta: rgba(20, 24, 31, 0.45);
  --ds-ink-disabled: rgba(20, 24, 31, 0.3);
  --ds-ink-blocked: rgba(20, 24, 31, 0.22);
  --ds-hairline: rgba(16, 24, 40, 0.1);
  --ds-hairline-strong: rgba(16, 24, 40, 0.18);
  --ds-cell-edge: rgba(36, 85, 200, 0.35);
  --ds-hairline-inner: rgba(16, 24, 40, 0.08);
  --ds-scrim: rgba(16, 20, 28, 0.42);

  /* Washes. The same pigments again at an alpha: a tint says WHICH fact a
     row carries without competing with the words on it. */
  --ds-stated-tint: rgba(24, 110, 70, 0.11);
  --ds-assumed-tint: rgba(190, 120, 20, 0.12);
  --ds-accent-tint: rgba(36, 85, 200, 0.1);
  --ds-selection: rgba(36, 85, 200, 0.18);
  --ds-missed-tint: rgba(168, 50, 44, 0.1);
  --ds-grid-line: rgba(20, 24, 31, 0.05);

  /* ---- Group palette — the item list's grouping, on the canvas ----------
     Twelve hues 30 degrees apart with the lightness alternating, so two
     neighbours differ in more than hue: over grey linework, hue alone is the
     channel that goes. Assigned by a group's POSITION in the list, never by
     what it holds, and mirrored in web/ts/hvac_grouping.ts (one test pins
     the two together). --ds-group-unset is what a group that names an
     ABSENCE takes — "no size", "unassigned" — and it is deliberately the
     one entry that is not a hue. */
  --ds-group-1: #a83232;
  --ds-group-2: #d97a1e;
  --ds-group-3: #8a7415;
  --ds-group-4: #6aa32e;
  --ds-group-5: #1f7a45;
  --ds-group-6: #2fae8f;
  --ds-group-7: #17707f;
  --ds-group-8: #3a8fd0;
  --ds-group-9: #3b4fa8;
  --ds-group-10: #8b6bd6;
  --ds-group-11: #7a2f86;
  --ds-group-12: #cf4a8d;
  --ds-group-unset: #9a9a92;

  /* ---- Item type — canvas ink when no GROUP colours the item ------------
     A plan is drawn in shades of grey, so an item that falls back to grey
     disappears into it. A group colour still wins. None is a status hue,
     and none is the abutment, fitting or selection ink. */
  --ds-type-duct: #173524; /* rigid duct */
  --ds-type-flex: #7f9d8a; /* flex duct */
  --ds-type-equipment: #1f5673; /* equipment */
  --ds-type-terminal: #a8577a;

  /* ---- Type ------------------------------------------------------------
     The split is a rule, not a mood: mono carries every quantity, dimension,
     sheet or view id, source label and machine state; sans carries everything
     a person wrote. An estimator can then scan for numbers without reading. */
  --ds-font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ds-font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --ds-text-page-title: 500 27px / 1.2 var(--ds-font-sans);
  --ds-text-section-title: 500 22px / 1.25 var(--ds-font-sans);
  --ds-text-display: 400 24px / 1.35 var(--ds-font-sans);
  --ds-text-row-label: 400 14px / 1.45 var(--ds-font-sans);
  --ds-text-helper: 400 13px / 1.6 var(--ds-font-sans);
  --ds-text-figure: 600 21px / 1.2 var(--ds-font-mono);
  --ds-text-quantity: 400 13px / 1.4 var(--ds-font-mono);
  --ds-text-id: 600 12.5px / 1.4 var(--ds-font-mono);
  --ds-text-meta: 500 10.5px / 1.4 var(--ds-font-mono);
  --ds-text-note: 400 12px / 1.5 var(--ds-font-sans);
  --ds-text-cell: 400 12px / 1.4 var(--ds-font-mono);
  --ds-text-label-meta: 400 9.5px / 1.4 var(--ds-font-sans);

  --ds-tracking-title: -0.02em;
  --ds-tracking-section: -0.015em;
  --ds-tracking-meta: 0.08em;

  /* ---- Form ------------------------------------------------------------ */
  --ds-radius-tool: 6px;
  --ds-radius-field: 7px;
  --ds-radius-well: 8px;
  --ds-radius-card: 10px;
  --ds-radius-modal: 12px;
  --ds-radius-pill: 999px;

  --ds-height-pill: 24px;
  --ds-height-chip: 30px;
  --ds-tool-pad-tight: 5px;
  --ds-tool-pad-roomy: 14px;
  --ds-tool-gap-tight: 2px;
  --ds-tool-gap-roomy: 8px;
  --ds-height-appbar-control: 34px;
  --ds-height-action: 38px;
  --ds-height-field: 42px;
  --ds-height-login-field: 46px;
  --ds-height-hero-action: 48px;

  --ds-appbar: 60px;
  --ds-toolbar: 56px;
  --ds-statusbar: 30px;
  --ds-table-row: 62px;
  --ds-panel: 296px;
  --ds-document-panel: 392px;

  /* ---- Elevation — two shadows only; everything else is a 1px hairline. */
  --ds-shadow-card: 0 1px 3px rgba(16, 24, 40, 0.07), 0 12px 32px -18px rgba(16, 24, 40, 0.22);
  --ds-shadow-modal: 0 30px 70px -20px rgba(16, 24, 40, 0.45);
  --ds-focus-ring: 0 0 0 3px rgba(36, 85, 200, 0.13);
}

/* ============================================================================
   THE PARTS
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ds-surface);
  color: var(--ds-ink);
  font-family: var(--ds-font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---- Brand ---------------------------------------------------------------
   CSS geometry, never an icon font and never an SVG file: at 26px the mark is
   a bordered square holding an accent square, and that is cheaper to draw
   than to fetch. */

.ds-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.ds-brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--ds-ink);
  border-radius: 3px;
}

.ds-brand-mark::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 1px;
  background: var(--ds-accent);
}

.ds-brand-mark-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.ds-brand-mark-sm::after {
  width: 7px;
  height: 7px;
}

.ds-brand-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: var(--ds-tracking-section);
  color: var(--ds-ink);
}

.ds-brand-name-sm {
  font-size: 15px;
}

/* ---- Mono labels ---------------------------------------------------------
   Mono carries every quantity, id, source label and machine state; the caps
   label is how a machine state introduces itself. */

.ds-meta {
  margin: 0;
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  color: var(--ds-ink-meta);
}

.ds-stamp {
  font: var(--ds-text-meta);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--ds-ink-meta);
}

/* ---- Fields -------------------------------------------------------------- */

.ds-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ds-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ds-field-label {
  font: var(--ds-text-meta);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-ink-tertiary);
}

/* A form's label in the words a person reads, not the meta caps of a sign-in. */
.ds-field-label.ds-field-label-sentence {
  font: var(--ds-text-row-label);
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ds-ink);
}

.ds-field-hint,
.ds-field-error {
  margin: 0;
  font: var(--ds-text-helper);
  font-size: 12.5px;
}

.ds-field-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ds-ink-tertiary);
}

.ds-field-hint-mark {
  flex: none;
  color: var(--ds-stated);
}

.ds-field-error {
  color: var(--ds-missed);
}

.ds-input[aria-invalid="true"],
.ds-input[aria-invalid="true"]:focus-visible {
  border-color: var(--ds-missed);
}

.ds-beta {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent-tint);
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  text-transform: uppercase;
  color: var(--ds-accent);
  vertical-align: middle;
}

.new-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--ds-accent);
  vertical-align: middle;
}

/* Pinned to its owner's corner so it never shares a line with the Beta pill. */
.new-dot-corner {
  position: absolute;
  top: 6px;
  right: 6px;
  box-shadow: 0 0 0 2px var(--ds-surface);
}

.ds-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--ds-height-login-field);
  padding: 0 14px;
  border: 1px solid var(--ds-hairline-strong);
  border-radius: var(--ds-radius-field);
  background: var(--ds-surface);
  font: var(--ds-text-row-label);
  font-size: 14.5px;
  color: var(--ds-ink);
}

.ds-textarea {
  height: auto;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.ds-input::placeholder,
.ds-input-bare::placeholder {
  color: var(--ds-ink-meta);
}

/* The border width never changes on focus — 1px to 1.5px reflows the field and
   nudges everything under it. The ring carries the state instead. */
.ds-input:focus-visible,
.ds-input:has(.ds-input-bare:focus-visible) {
  border-color: var(--ds-accent);
  box-shadow: var(--ds-focus-ring);
  outline: none;
}

/* A control with a control inside it: the box is the label's span, and the
   input within it draws nothing of its own. */
.ds-input-group {
  padding-right: 6px;
}

.ds-input-bare {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: var(--ds-text-quantity);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--ds-ink);
}

.ds-input-bare:focus-visible {
  outline: none;
}

.ds-reveal {
  flex: none;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--ds-radius-tool);
  background: none;
  font: var(--ds-text-meta);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ds-ink-tertiary);
  cursor: pointer;
}

.ds-reveal:hover {
  color: var(--ds-ink);
}

/* ---- Buttons — one primary per view --------------------------------------
   Ink is the page's own primary; accent is the primary INSIDE a card that
   already sits under an ink action. A blocked primary stays in place at ink
   .22 with the reason stated beneath it — never hidden, never a tooltip. */

.ds-button-ink,
.ds-button-outline,
.ds-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ds-height-hero-action);
  padding: 0 22px;
  border: 0;
  border-radius: var(--ds-radius-well);
  font-family: var(--ds-font-sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.ds-button-ink,
.ds-submit {
  background: var(--ds-ink);
  color: var(--ds-surface);
}

.ds-button-ink:hover,
.ds-submit:hover {
  background: var(--ds-ink-hover);
}

.ds-submit:disabled,
.ds-button-ink:disabled {
  background: var(--ds-ink-blocked);
  cursor: default;
}

/* An outline button had NO disabled state, so a Cancel the dialog was
   refusing sat there looking live and swallowed the click (#3890). A control
   that ignores you has to look like it will. */
.ds-button-outline:disabled {
  border-color: var(--ds-hairline);
  color: var(--ds-ink-disabled);
  cursor: default;
}

.ds-button-outline {
  padding: 0 20px;
  border: 1px solid var(--ds-hairline-strong);
  background: var(--ds-surface);
  color: var(--ds-ink);
}

.ds-button-outline:hover {
  border-color: var(--ds-ink-disabled);
}

.ds-button-sm {
  height: var(--ds-height-action);
  padding: 0 15px;
  border-radius: var(--ds-radius-field);
  font-size: 13px;
}

.ds-text-link {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--ds-font-sans);
  font-size: inherit;
  font-weight: 500;
  color: var(--ds-accent);
  cursor: pointer;
}

.ds-text-link:hover {
  color: var(--ds-accent-hover);
}

/* `.workspace-page button` and `.annotation-page button` out-rank a bare
   `.ds-text-link`, so a text link on a button keeps the page's button border. */
.workspace-page button.ds-text-link,
.annotation-page button.ds-text-link,
.workspace-page button.ds-text-link:hover,
.annotation-page button.ds-text-link:hover {
  border: 0;
  background: none;
}

/* The same page rules out-rank an ink button, so it would arrive white and bordered. */
.workspace-page button.ds-button-ink,
.annotation-page button.ds-button-ink {
  border: 0;
  background: var(--ds-ink);
  color: var(--ds-surface);
}

.workspace-page button.ds-button-ink:hover,
.annotation-page button.ds-button-ink:hover {
  background: var(--ds-ink-hover);
}

.workspace-page button.ds-button-ink:disabled,
.annotation-page button.ds-button-ink:disabled {
  background: var(--ds-ink-blocked);
}

/* ---- Status ------------------------------------------------------------
   An empty status is the page with nothing to report, and it must take no
   room: a reserved gap under a form reads as something missing. */

.ds-status {
  margin: 18px 0 0;
  min-height: 20px;
  font: var(--ds-text-helper);
  color: var(--ds-ink-secondary);
}

.ds-status:empty {
  margin: 0;
  min-height: 0;
}

.ds-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--ds-stated);
}

.ds-check::after {
  content: "";
  width: 6px;
  height: 3px;
  border-left: 2px solid var(--ds-surface);
  border-bottom: 2px solid var(--ds-surface);
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ---- The drawing detail --------------------------------------------------
   The one illustration, captioned like a detail on a sheet: a hairline rule
   and a mono stamp. Reskinning it as a flat vector illustration kills it. */

.ds-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.ds-detail-image {
  display: block;
  width: 100%;
  height: auto;
}

.ds-detail-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 24, 31, 0.2);
  font: var(--ds-text-meta);
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--ds-ink-tertiary);
}

/* The processing modal (design 3a) — what a person looks at while their
   drawing is being taken off. web/ts/hvac_processing.ts renders it.

   Rendered on BOTH pages (#3890): the projects page puts it up the moment
   you press Create and paints the upload's own steps on it, and the editor
   takes it over from the run's record — one screen across a navigation,
   which is why it lives in the shared sheet rather than the editor's.

   Positioned against the nearest positioned ancestor, so whatever chrome
   that page has stays where it is and the card says only what is being
   done. */
.processing-scrim {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--ds-scrim);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.processing-scrim[hidden] {
  display: none;
}

.processing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 460px);
  /* Scrolls rather than overflowing the stage: eight stages and a drawing do
     not fit a short window, and a step list clipped at the bottom hides the
     row that is actually running. */
  max-height: 100%;
  overflow-y: auto;
  padding: 24px 26px;
  border-radius: var(--ds-radius-modal);
  background: var(--ds-paper);
  box-shadow: var(--ds-shadow-modal);
  font-family: var(--ds-font-sans);
  color: var(--ds-ink);
  text-align: center;
}

/* The one illustration, at the size a card can carry — the artboard's 360px
   is a whole page's worth. */
.processing-trex {
  display: block;
  width: min(228px, 70%);
  height: auto;
  aspect-ratio: 767 / 840;
}

.processing-headline {
  margin: 6px 0 0;
  font: var(--ds-text-display);
  font-size: 20px;
  letter-spacing: var(--ds-tracking-section);
}

.processing-meta {
  margin: 7px 0 0;
  font: var(--ds-text-helper);
  color: var(--ds-ink-tertiary);
}

.processing-elapsed {
  margin: 7px 0 0;
  font: var(--ds-text-helper);
  color: var(--ds-ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.processing-msg {
  margin: 8px 0 0;
  font: var(--ds-text-helper);
  color: var(--ds-ink-tertiary);
}

.processing-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.processing-card:has(.processing-views) {
  width: min(100%, 1180px);
}

.processing-views {
  width: 100%;
  margin-top: 12px;
  text-align: left;
}

.processing-card .ds-text-link,
.pages-views .ds-text-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.processing-card .processing-views .ds-input,
.pages-views .ds-input {
  padding: 0 10px;
}

.processing-views .ds-sheets,
.pages-views .ds-sheets {
  height: min(72vh, 680px);
}

/* ---- Pages & views, over the editor ------------------------------------- */

.pages-views-scrim {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--ds-scrim);
}

.pages-views {
  display: flex;
  flex-direction: column;
  width: min(100%, 1180px);
  max-height: 100%;
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  font-family: var(--ds-font-sans);
}

.pages-views-head,
.pages-views-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}

.pages-views-head {
  justify-content: space-between;
}

.pages-views-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--ds-hairline);
}

.pages-views-refusal {
  margin: 0 auto 0 0;
  font-size: 13px;
  color: var(--ds-ink);
}

.pages-views-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ds-ink);
}

.pages-views .pages-views-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--ds-radius-field);
  background: none;
  color: var(--ds-ink-tertiary);
}

.pages-views .pages-views-close:hover {
  background: var(--ds-well);
}

.pages-views-body {
  min-height: 0;
  padding: 0 16px 12px;
  overflow: auto;
}

/* ---- The step list ------------------------------------------------------ */

.processing-steps {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(20, 24, 31, 0.14);
  border-radius: var(--ds-radius-card);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.processing-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(20, 24, 31, 0.12);
  overflow: hidden;
}

.processing-bar-fill {
  height: 100%;
  background: var(--ds-accent);
  transition: width 400ms ease-out;
}

.processing-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* A stage nothing has reached is dimmed whole, mark and words together: the
   list reads as a horizon rather than as eight equal claims. */
.processing-step[data-state="queued"] {
  opacity: 0.5;
}

/* A done row wears `.ds-check`, which is the mark; this is the two states
   the guide has no part for. */
.processing-step-mark {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.processing-step[data-state="running"] .processing-step-mark {
  border: 2px solid var(--ds-accent);
  border-top-color: transparent;
  border-right-color: transparent;
  animation: processing-spin 0.9s linear infinite;
}

.processing-step[data-state="queued"] .processing-step-mark {
  border: 1.5px solid rgba(20, 24, 31, 0.35);
}

@keyframes processing-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .processing-step[data-state="running"] .processing-step-mark {
    animation: none;
  }

  .processing-bar-fill {
    transition: none;
  }
}

.processing-step-text {
  flex: 1;
  min-width: 0;
  font: var(--ds-text-row-label);
  font-size: 12.5px;
  color: var(--ds-ink-tertiary);
}

.processing-step[data-state="running"] .processing-step-text {
  font-weight: 500;
  color: var(--ds-ink);
}

/* Which view the run is in. Mono, because a view id is an id. */
.processing-step-at {
  font-family: var(--ds-font-mono);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ds-ink-meta);
}

.processing-step-note {
  flex: none;
  font: var(--ds-text-quantity);
  font-size: 11px;
  color: var(--ds-ink-meta);
}

.processing-step[data-state="running"] .processing-step-note {
  font-weight: 500;
  color: var(--ds-accent);
}

/* The style guide's buttons, WORN — `.ds-button-ink ds-button-sm` and
   `.ds-button-outline ds-button-sm` are on the markup, and these restore only
   what this page steals from them. `.workspace-page button` sets a border, a
   radius, a gradient and an inset highlight on every button here and outranks
   a single class, which is how the primary and the secondary came to render
   identically on the one card whose job is to offer a choice. */
.processing-card .ds-button-ink,
.pages-views .ds-button-ink,
.processing-card .ds-button-outline,
.pages-views .ds-button-outline {
  box-shadow: none;
}

/* The radius and the ink's own text colour are stolen too — `.workspace-page
   button` is one class AND one element, so it outranks every single-class
   rule the guide writes. Measured, not read: on the source these look fine. */
.processing-card .ds-button-sm,
.pages-views .ds-button-sm {
  border-radius: var(--ds-radius-field);
}

.processing-card .ds-button-ink,
.pages-views .ds-button-ink {
  color: var(--ds-surface);
}

.processing-card .ds-button-ink:disabled,
.pages-views .ds-button-ink:disabled {
  background: var(--ds-ink-blocked);
  cursor: default;
}

.processing-card .ds-button-ink:hover,
.pages-views .ds-button-ink:hover,
.processing-card .ds-button-outline:hover,
.pages-views .ds-button-outline:hover {
  transform: none;
  box-shadow: none;
}

.processing-card .ds-button-ink,
.pages-views .ds-button-ink {
  border: 0;
  background: var(--ds-ink);
}

.processing-card .ds-button-ink:hover,
.pages-views .ds-button-ink:hover {
  background: var(--ds-ink-hover);
}

.processing-card .ds-button-outline,
.pages-views .ds-button-outline {
  border: 1px solid var(--ds-hairline-strong);
  background: rgba(255, 255, 255, 0.6);
}

.processing-card .ds-button-outline:hover,
.pages-views .ds-button-outline:hover {
  border-color: var(--ds-ink-disabled);
  background: var(--ds-surface);
}

/* ---- What the reading found, under its sheet ----------------------------- */

.ds-sheet-views {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
}

.ds-view-head {
  margin: 10px 0 0;
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  text-transform: uppercase;
  color: var(--ds-ink-tertiary);
}

.ds-view-head:first-child {
  margin-top: 0;
}

.ds-view-head.is-asking {
  color: var(--ds-assumed);
}

.ds-view {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 8px;
  padding: 6px 8px 6px 4px;
  border-radius: var(--ds-radius-well);
  font: var(--ds-text-helper);
  font-size: 12.5px;
  line-height: 1.5;
}

.ds-view:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.ds-view.is-chosen {
  background: var(--ds-accent-tint);
}

.ds-view.is-editing {
  background: var(--ds-well);
}

.ds-view-slot {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.ds-view-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.ds-view-name {
  font-size: 13px;
  color: var(--ds-ink);
  overflow-wrap: anywhere;
}

.ds-view-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.ds-view-kind {
  color: var(--ds-ink-secondary);
}

.ds-view-scale {
  font: var(--ds-text-quantity);
  font-size: 12px;
  color: var(--ds-ink-tertiary);
}

.ds-view-pick {
  display: flex;
  gap: 6px;
}

.ds-view-pick .ds-chip {
  height: 24px;
  padding: 0 10px;
  border-color: var(--ds-assumed-dot);
  background: var(--ds-assumed-tint);
  font-size: 12px;
  color: var(--ds-assumed);
}

.ds-view-question,
.ds-view-trouble,
.ds-view-note.is-failed {
  color: var(--ds-assumed);
}

.ds-view-question.ds-text-link {
  text-decoration: underline dashed;
  text-underline-offset: 3px;
}

.ds-view-question.ds-text-link:hover {
  color: var(--ds-ink);
}

.ds-view-who {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  color: var(--ds-ink-tertiary);
}

.ds-view-actions {
  display: flex;
  gap: 12px;
}

.ds-view.is-gone .ds-view-name {
  color: var(--ds-ink-meta);
  text-decoration: line-through;
}

.ds-view.is-gone .ds-view-gone {
  color: var(--ds-ink-meta);
}

.ds-view-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
}

.ds-view-form .is-wide {
  grid-column: 1 / -1;
}

.ds-view-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  text-transform: uppercase;
  color: var(--ds-ink-tertiary);
}

.ds-view-field {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  font: var(--ds-text-helper);
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}

.ds-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 8px;
  font: var(--ds-text-helper);
  font-size: 12.5px;
}

.ds-views-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--ds-hairline);
  font: var(--ds-text-helper);
}

.ds-views-add[aria-pressed="true"] {
  padding: 0 8px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-accent);
  color: var(--ds-surface);
}

.ds-view-note {
  margin: 0;
  font: var(--ds-text-helper);
  font-size: 12.5px;
  color: var(--ds-ink-tertiary);
}

.ds-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ds-hairline-strong);
  border-top-color: var(--ds-accent);
  border-radius: 50%;
  animation: ds-spin 700ms linear infinite;
}

.ds-stamp.is-working {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@keyframes ds-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-spinner {
    animation: none;
  }
}

/* ---- Chips and the rate panel ------------------------------------------
   The cost book's rate panel, and the filter chips it is made of: the
   Cost book tab and the estimate screen's Add a rate both wear them. */
.ds-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 26px 0;
}

.ds-chip {
  height: var(--ds-height-chip);
  padding: 0 12px;
  border: 1px solid var(--ds-hairline-strong);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  font-family: var(--ds-font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ds-ink-secondary);
  cursor: pointer;
}

.ds-chip:hover {
  border-color: var(--ds-ink-disabled);
}

.ds-chip.is-on {
  border-color: var(--ds-ink);
  background: var(--ds-ink);
  color: var(--ds-surface);
}

.ds-cost-key {
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  color: var(--ds-ink-meta);
}

.ds-cost-error {
  font: var(--ds-text-meta);
  color: var(--ds-assumed);
}

.ds-cost-words {
  font: var(--ds-text-meta);
  color: var(--ds-ink-meta);
}

.ds-cost-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  max-width: 640px;
  padding: 16px;
  border: 1px solid var(--ds-hairline);
}

.ds-cost-panel label {
  display: grid;
  gap: 6px;
}

.ds-cost-panel > .ds-cost-wide,
.ds-cost-panel > .ds-cost-source,
.ds-cost-panel > .ds-cost-words,
.ds-cost-panel > .ds-cost-price,
.ds-cost-panel > .ds-cost-panel-actions {
  grid-column: 1 / -1;
}

.ds-cost-price {
  display: grid;
  gap: 6px;
}

.ds-cost-price .ds-filters {
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.ds-cost-price .ds-chip {
  white-space: nowrap;
}

/* The add-a-line dialog: label-over-field groups and the numbers row. */
.ds-rate-form {
  display: grid;
  gap: 16px;
}

.ds-rate-form label {
  display: grid;
  align-content: start;
  gap: 6px;
}

.ds-rate-numbers {
  display: grid;
  grid-template-columns: 92px repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.ds-rate-numbers.is-quote {
  grid-template-columns: 92px minmax(0, 1fr);
}

.ds-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ds-rate-grid > .ds-rate-wide {
  grid-column: 1 / -1;
}

.ds-cost-panel-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---- The page list, page pane and page picture -------------------------- */

/* Three cards on a tray. A page with no views card (Design system) leaves two. */
.ds-sheets {
  display: grid;
  flex: 1 1 0;
  grid-auto-columns: 300px;
  grid-auto-flow: column;
  grid-template-columns: 290px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 240px;
  padding: 12px;
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-well);
  background: var(--ds-well);
}

.ds-sheets-pages,
.ds-page-pane,
.ds-page-views {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--ds-hairline-strong);
  border-radius: var(--ds-radius-well);
  background: var(--ds-surface);
  overflow: hidden;
}

.ds-sheets-head-actions {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-left: auto;
  font-size: 12px;
}

.ds-sheets-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden auto;
}

.ds-sheets-boxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.ds-sheet-row {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding-right: 10px;
  border: 1px solid var(--ds-hairline);
  border-radius: 10px;
  background: var(--ds-surface);
  cursor: pointer;
  scroll-margin: 8px 0;
}

.ds-sheet-row:hover {
  background: var(--ds-well);
}

.ds-sheet-row.is-here {
  border-color: var(--ds-accent);
  background: rgba(36, 85, 200, 0.06);
  box-shadow: inset 3px 0 0 var(--ds-accent);
}

.ds-sheet-row:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

.ds-sheet-tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
}

.ds-sheet-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--ds-hairline-strong);
  border-radius: 4px;
}

.ds-sheet-row.is-on .ds-sheet-box,
.ds-view-tick[aria-checked="true"] .ds-sheet-box {
  border-color: var(--ds-accent);
  background: var(--ds-accent);
}

.ds-sheet-box::after {
  content: "";
  width: 6px;
  height: 3px;
  border-left: 2px solid var(--ds-surface);
  border-bottom: 2px solid var(--ds-surface);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}

.ds-sheet-row.is-on .ds-sheet-box::after,
.ds-view-tick[aria-checked="true"] .ds-sheet-box::after {
  opacity: 1;
}

.ds-view-tick {
  display: grid;
  place-items: center;
  width: 24px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.ds-view-tick:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.ds-sheet-id {
  flex: none;
  width: 56px;
  font: var(--ds-text-id);
  color: var(--ds-ink);
}

.ds-sheet-id.is-absent {
  font-weight: 400;
  color: var(--ds-ink-meta);
}

.ds-sheet-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.ds-sheet-name .ds-sheet-title {
  flex: none;
}

.ds-sheet-unread {
  font: var(--ds-text-helper);
  color: var(--ds-assumed);
}

.ds-sheet-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: var(--ds-text-row-label);
  font-size: 13px;
  color: var(--ds-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-sheet-state {
  flex: none;
  font: var(--ds-text-helper);
  font-size: 12px;
  color: var(--ds-assumed);
}

.ds-sheet-row.is-reading .ds-sheet-id,
.ds-sheet-row.is-reading .ds-sheet-title {
  color: var(--ds-ink-tertiary);
}

.ds-sheet-asks {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-assumed-dot);
}

.ds-page-pane-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 52px;
  margin: 0;
  padding: 6px 14px;
  border-bottom: 1px solid var(--ds-hairline-inner);
  font: 500 15px var(--ds-font-sans);
  color: var(--ds-ink);
}

.ds-page-pane-head .ds-sheet-id {
  width: auto;
}

.ds-page-pane-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin: 0;
  font: inherit;
}

.ds-page-zoom {
  display: flex;
  flex: none;
  align-self: center;
  margin-left: auto;
  border: 1px solid var(--ds-hairline-strong);
  border-radius: var(--ds-radius-well);
  overflow: hidden;
}

.ds-page-zoom button {
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  background: var(--ds-surface);
  font: 500 13px var(--ds-font-sans);
  color: var(--ds-ink);
  cursor: pointer;
}

.ds-page-zoom button + button {
  border-left: 1px solid var(--ds-hairline-strong);
}

.ds-page-zoom button:disabled {
  color: var(--ds-ink-disabled);
  cursor: default;
}

.ds-page-pane-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-page-pane-rows {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}

.ds-page-pane-rows .ds-sheet-views {
  padding: 0;
}

/* Fills the card; the page sits in it at whatever the view says. */
.ds-page-picture {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.ds-page-picture-frame {
  position: relative;
  flex: 1;
  box-sizing: border-box;
  min-height: 0;
  background: var(--ds-well-deep);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

.ds-page-picture-frame:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: -2px;
}

.ds-page-picture-frame.is-zoomed {
  touch-action: none;
  cursor: grab;
}

.ds-page-picture-frame.is-zoomed:active {
  cursor: grabbing;
}

.ds-page-picture-stage {
  position: absolute;
  inset: 0;
}

.ds-page-picture-sheet {
  position: absolute;
  pointer-events: none;
}

.ds-page-picture-stage canvas {
  position: absolute;
  display: block;
}

.ds-page-picture-outline {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--ds-accent);
  background: color-mix(in srgb, var(--ds-accent) 12%, transparent);
}

.ds-page-picture-frame.is-adding {
  touch-action: none;
}

/* 40 px for a finger; the square drawn inside it is what the eye sees. */
.ds-page-picture-handle {
  position: absolute;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: none;
}

.ds-page-picture-handle::after {
  content: "";
  position: absolute;
  inset: 15px;
  box-sizing: border-box;
  border: 2px solid var(--ds-accent);
  background: var(--ds-surface);
}

.ds-page-picture-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px;
  font: var(--ds-text-helper);
  color: var(--ds-ink-secondary);
  text-align: center;
}

.ds-page-views.is-unpicked .ds-sheet-views,
.ds-page-pane.is-unpicked .ds-page-picture {
  opacity: 0.55;
}

.ds-page-pane-reading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: var(--ds-text-helper);
  color: var(--ds-ink-tertiary);
}

.ds-sheets-working {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 16px;
  justify-content: center;
  font: var(--ds-text-helper);
  color: var(--ds-ink-tertiary);
}

/* Under this the 300px views card leaves the picture no width: the cards stack. */
@media (max-width: 900px) {
  .ds-sheets {
    display: flex;
    flex: none;
    flex-direction: column;
    min-height: 0;
  }

  .processing-views .ds-sheets,
  .pages-views .ds-sheets {
    height: auto;
  }

  .ds-sheets-pages {
    flex: none;
    max-height: 232px;
  }

  .ds-page-pane,
  .ds-page-views {
    flex: none;
  }

  .ds-page-pane-rows {
    flex: none;
    overflow: visible;
  }

  .ds-page-picture {
    flex: none;
  }

  .ds-page-picture-frame {
    flex: none;
    aspect-ratio: var(--page-aspect);
  }
}

@media (max-width: 640px) {
  .ds-page-pane-head,
  .ds-sheets-head-actions {
    flex-wrap: wrap;
  }

  .ds-page-zoom button {
    min-width: 44px;
    height: 40px;
  }
}

/* ============================================================================
   The new-project modal — artboards 1d and 1e
   ========================================================================== */

.ds-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ds-scrim);
}

/* Over the editor's own top bar (z 60), for a dialog with nothing behind it to return to. */
.ds-scrim.is-over-the-page {
  z-index: 100;
}

.ds-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 100%;
  border-radius: var(--ds-radius-modal);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-modal);
  overflow: hidden;
}

/* A dialog that asks one question is the width of the question, not of the
   sheet list the import modal has to hold. WIDTH ONLY — everything that makes
   this a card belongs to every dialog. */
.ds-modal.is-narrow {
  max-width: 460px;
}

.ds-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 24px 28px 0;
}

.ds-modal-heading {
  flex: 1;
  min-width: 0;
}

.ds-modal-title {
  margin: 0;
  font: var(--ds-text-section-title);
  font-size: 20px;
  letter-spacing: var(--ds-tracking-section);
  color: var(--ds-ink);
}

.ds-modal-lead {
  margin: 5px 0 0;
  font: var(--ds-text-helper);
  color: var(--ds-ink-tertiary);
}

.ds-modal-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--ds-radius-tool);
  background: none;
  color: var(--ds-ink-meta);
  cursor: pointer;
}

.ds-modal-close:hover {
  background: var(--ds-well);
  color: var(--ds-ink);
}

.ds-modal-close svg {
  width: 17px;
  height: 17px;
}

.ds-modal-status {
  margin: 0;
}

.ds-modal-status:empty {
  display: none;
}

.ds-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
  padding: 22px 28px 24px;
  overflow-y: auto;
}

.ds-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 16px 28px;
  border-top: 1px solid var(--ds-hairline);
  background: var(--ds-well);
}

.ds-modal-foot-actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.ds-modal-foot-details {
  flex: 1;
  min-width: 0;
}

.ds-modal-foot .ds-button-ink,
.ds-modal-foot .ds-button-outline,
.ds-modal-foot .ds-button-danger {
  height: var(--ds-height-action);
  padding: 0 18px;
  border-radius: var(--ds-radius-field);
  font-size: 13px;
}

/* ---- The fields ---------------------------------------------------------- */

.ds-modal .ds-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

.ds-modal .ds-input {
  height: var(--ds-height-field);
  padding: 0 13px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .ds-scrim {
    padding: 12px;
  }

  .ds-modal-head {
    padding: 16px 16px 0;
  }

  .ds-modal-head > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .ds-modal-body {
    padding: 16px;
    overflow-wrap: anywhere;
  }

  .ds-modal-foot {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .ds-modal-foot-actions {
    flex-wrap: wrap;
  }

  .ds-modal-foot-actions button {
    flex: 1 1 auto;
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
  }

  .ds-modal .ds-input {
    font-size: 16px;
  }

  .ds-modal .ds-field-label {
    flex-wrap: wrap;
  }
}

/* ---- The proposal page: the PDF as a letter sheet. The Company tab
   draws it as a layout preview, the estimate's Proposal tab as the proposal. ---- */

.proposal-desk {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 18px;
  background: var(--ds-void);
  border-radius: var(--ds-radius-modal);
}

/* The page is the PDF: black ink on a letter sheet whatever the app's theme. */
.proposal-page {
  box-sizing: border-box;
  width: 520px;
  aspect-ratio: 8.5 / 11;
  padding: 16px;
  overflow: hidden;
  font:
    11px / 1.4 "Times New Roman",
    Times,
    serif;
  color: #000;
  background: #fff;
}

.proposal-page[data-type="sans"] {
  font-family: Arial, Helvetica, sans-serif;
}

.proposal-frame {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  box-sizing: border-box;
  padding: 8px 40px;
}

.proposal-frame[data-frame="double"] {
  border: 3px double var(--proposal-accent);
}

.proposal-frame[data-frame="single"] {
  border: 1px solid var(--proposal-accent);
}

.proposal-block {
  cursor: pointer;
}

.proposal-block.is-selected {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

.proposal-block {
  position: relative;
}

.proposal-split.is-selected {
  outline: 2px solid var(--ds-accent);
  outline-offset: 4px;
}

.proposal-split.is-offered {
  position: relative;
  outline: 1px dashed var(--ds-accent);
  outline-offset: 4px;
}

.proposal-row-tab {
  position: absolute;
  top: 50%;
  left: -8px;
  z-index: 1;
  transform: translate(-100%, -50%);
  padding: 0 8px;
  font: var(--ds-text-meta);
  color: var(--ds-accent);
  background: var(--ds-surface);
  border: 1px solid var(--ds-accent);
  border-radius: var(--ds-radius-field);
  cursor: pointer;
}

.proposal-row-tab:hover,
.proposal-row-tab:focus-visible {
  background: var(--ds-accent-tint);
}

.proposal-editable {
  cursor: text;
  border-radius: 2px;
}

.proposal-editable:hover {
  background: var(--ds-accent-tint);
}

.proposal-block:has(.proposal-editable):hover,
.proposal-block:has(.proposal-input) {
  outline: 1px dashed var(--ds-accent);
  outline-offset: 2px;
}

.proposal-input {
  width: 100%;
  font: inherit;
  color: inherit;
  border: 1px solid var(--ds-accent);
  border-radius: 2px;
  background: var(--ds-surface);
}

.proposal-block .proposal-tool {
  position: absolute;
  top: -10px;
  right: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1px 8px;
  border: 1px solid var(--ds-accent);
  border-radius: 10px;
  background: var(--ds-surface);
  color: var(--ds-accent);
  font:
    600 11px/1.6 system-ui,
    sans-serif;
}

.proposal-block .proposal-tool button:not(.ds-button-ink, .ds-button-outline),
.proposal-block .proposal-remove {
  all: unset;
  cursor: pointer;
}

.proposal-block .proposal-remove {
  margin-left: 6px;
  color: var(--ds-ink-tertiary);
}

.proposal-remove::before {
  content: "\00D7";
}

.proposal-add {
  color: var(--ds-accent);
  list-style: none;
  font:
    600 12px/1.6 system-ui,
    sans-serif;
}

.proposal-missing {
  font-style: italic;
  color: #8a8f98;
}

.proposal-from-estimate {
  color: var(--ds-ink-tertiary);
}

.proposal-letterhead[data-align="left"] {
  text-align: left;
}

.proposal-letterhead[data-align="center"] {
  text-align: center;
}

.proposal-letterhead[data-align="right"] {
  text-align: right;
}

.proposal-company {
  font-size: 13px;
  font-variant: small-caps;
  font-weight: 700;
}

.proposal-title {
  font-size: 16px;
  text-align: center;
}

.proposal-who[data-style="grid"] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.proposal-who[data-style="grid"] .proposal-cell {
  padding: 1px 5px 3px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.proposal-cell-key {
  display: block;
  font-size: 7px;
  text-transform: uppercase;
}

.proposal-who[data-style="lines"] .proposal-cell-key {
  display: inline;
  font-size: inherit;
  text-transform: none;
}

.proposal-who[data-style="lines"] .proposal-cell-key::after {
  content: ": ";
}

.proposal-who[data-style="plain"] .proposal-cell-key {
  display: none;
}

.proposal-text,
.proposal-price {
  margin: 0;
}

.proposal-text[data-size="small"] {
  font-size: 8px;
}

.proposal-price {
  font-size: 13px;
  text-align: center;
  text-decoration: underline;
}

.proposal-scope {
  margin: 0;
  padding-left: 22px;
}

.proposal-scope[data-style="sections"] {
  padding-left: 0;
  list-style: none;
}

.proposal-list-title {
  text-decoration: underline;
}

.proposal-list {
  margin: 0;
  padding-left: 22px;
}

/* The first band kept at the bottom takes the free height, so the kept bands sit together at the foot. */
.proposal-frame .is-foot {
  margin-top: auto;
}

.proposal-signatures {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--proposal-accent);
  font-size: 9px;
}

.proposal-sign {
  display: flex;
  gap: 5mm;
  margin-top: 36pt;
  break-inside: avoid;
}

.proposal-sign-line {
  flex: 1;
  border-top: 1px solid #000;
  padding-top: 1px;
  font-size: 7px;
}

.proposal-sign-wide {
  flex: 2;
}

.proposal-logo {
  display: block;
  max-width: 160px;
  max-height: 56px;
  margin: 0 auto 4px;
  object-fit: contain;
}

.proposal-blank {
  display: inline-block;
  min-width: 6em;
  border-bottom: 1px solid #000;
}

.proposal-split[data-dir="row"] {
  display: flex;
}

.proposal-split[data-dir="column"] {
  display: flex;
  flex-direction: column;
}

/* The page's own parts are the frame's, spaced by its gap. */
.proposal-split.is-page {
  display: contents;
}

.proposal-table {
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.proposal-table .proposal-table {
  border: 0;
}

.proposal-table-cell.proposal-signatures {
  border-top: 0;
}

.proposal-table-cell {
  padding: 1px 5px 3px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.proposal-cell-text {
  margin: 0;
}

.proposal-cell-text[data-size="small"] {
  font-size: 8px;
}

.proposal-cell-text[data-size="large"] {
  font-size: 13px;
}

.proposal-cell-text[data-size="title"] {
  font-size: 16px;
}

/* Small text in a table is a column label. */
.proposal-table .proposal-cell-text[data-size="small"] {
  font-size: 7px;
}

.proposal-cell-text[data-caps="all"] {
  text-transform: uppercase;
}

.proposal-cell-text[data-caps="small"] {
  font-variant: small-caps;
}

.proposal-cell-text.is-bold {
  font-weight: 700;
}

.proposal-cell-text.is-underline {
  text-decoration: underline;
}

.proposal-items {
  margin: 0;
  padding-left: 22px;
}

.proposal-items[data-style="sections"] {
  padding-left: 0;
  list-style: none;
}

.proposal-blank[data-blank="space"] {
  min-width: 0;
  border: 0;
}

.proposal-logo[data-align="left"] {
  margin-left: 0;
}

.proposal-logo[data-align="right"] {
  margin-right: 0;
}

.proposal-signatures .proposal-signatures {
  margin: 0;
  padding: 0;
  border: 0;
}

.ds-subtabs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* Doubled: the editor page's `.annotation-page button` rules outrank one class. */
.ds-subtab.ds-subtab,
.ds-subtab.ds-subtab:hover {
  display: flex;
  align-items: center;
  height: 36px;
  margin-bottom: -1px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--ds-radius-card) var(--ds-radius-card) 0 0;
  background: none;
  font: 500 13px var(--ds-font-sans);
  color: var(--ds-ink-tertiary);
  cursor: pointer;
}

.ds-subtab.ds-subtab.is-open {
  position: relative;
  border-color: var(--ds-hairline);
  background: var(--ds-surface);
  color: var(--ds-ink);
  cursor: default;
}

/* What a riser being placed on the next floor asks of the pointer. */
.hvac-riser-pill {
  position: fixed;
  z-index: 60;
  box-sizing: border-box;
  height: var(--ds-height-pill);
  padding: 0 12px;
  border: 1px solid var(--ds-stated-dot);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface);
  color: var(--ds-stated);
  box-shadow: var(--ds-shadow-card);
  font-size: 13px;
  line-height: calc(var(--ds-height-pill) - 2px);
  white-space: nowrap;
  pointer-events: none;
}

/* The callout that says why a change was refused; any page may install it. */
.hvac-refusal {
  position: fixed;
  z-index: 70;
  box-sizing: border-box;
  max-width: min(300px, calc(100vw - 16px));
  padding: 9px 13px 9px 28px;
  border: 1px solid var(--ds-missed);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  color: var(--ds-ink);
  box-shadow: var(--ds-shadow-card);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
}

.hvac-refusal[hidden] {
  display: none;
}

.hvac-refusal::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-missed-dot);
}

.hvac-refusal-tip {
  position: absolute;
  left: var(--refusal-tip-x, 24px);
  width: 11px;
  height: 11px;
  margin-left: -6px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-missed);
  border-right-color: transparent;
  border-bottom-color: transparent;
  top: -6px;
  transform: rotate(45deg);
}

.hvac-refusal[data-side="above"] .hvac-refusal-tip {
  top: auto;
  bottom: -6px;
  transform: rotate(225deg);
}

/* ---- The person ---------------------------------------------------------- */

.ds-account {
  position: relative;
}

.ds-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ds-void);
  font: var(--ds-text-id);
  font-size: 11.5px;
  color: var(--ds-ink);
  cursor: pointer;
}

.ds-menu {
  position: absolute;
  right: 0;
  z-index: 30;
  min-width: 214px;
  padding: 6px;
  border: 1px solid var(--ds-hairline);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-card);
}

.ds-account .ds-menu {
  top: calc(100% + 8px);
}

.ds-menu-who {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--ds-hairline);
  margin-bottom: 6px;
}

.ds-menu-name {
  display: block;
  font: var(--ds-text-row-label);
  font-weight: 600;
  color: var(--ds-ink);
}

.ds-menu-role {
  display: block;
  margin-top: 2px;
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  color: var(--ds-ink-meta);
}

.ds-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--ds-radius-tool);
  background: none;
  font: var(--ds-text-row-label);
  color: var(--ds-ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ds-menu-item:hover {
  background: var(--ds-well);
}

.ds-menu-item svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--ds-ink-tertiary);
}

.ds-menu-org {
  display: block;
  margin-top: 2px;
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  color: var(--ds-ink-meta);
}

.ds-documentation {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--ds-radius-tool);
  background: none;
  font: var(--ds-text-row-label);
  color: var(--ds-ink-secondary);
  cursor: pointer;
}

.ds-documentation:hover {
  background: var(--ds-well);
  color: var(--ds-ink);
}

/* Something waits on the person: a mark beside a label, never a count. */
.ds-dot {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--ds-assumed-dot);
}

.ds-segments {
  display: inline-flex;
}

.ds-segment {
  border-radius: 0;
  height: var(--ds-height-chip);
  padding: 0 12px;
  border: 1px solid var(--ds-hairline-strong);
  background: var(--ds-surface);
  font: var(--ds-text-row-label);
  color: var(--ds-ink-secondary);
  cursor: pointer;
}

.ds-segment:first-child {
  border-radius: var(--ds-radius-field) 0 0 var(--ds-radius-field);
}

.ds-segment + .ds-segment {
  margin-left: -1px;
}

.ds-segment:last-child {
  border-radius: 0 var(--ds-radius-field) var(--ds-radius-field) 0;
}

.ds-segment:disabled {
  color: var(--ds-ink-meta);
  cursor: default;
}

.ds-segment.is-on {
  position: relative;
  border-color: var(--ds-accent);
  background: var(--ds-accent-tint);
  color: var(--ds-ink);
}

.ds-segment-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid var(--ds-hairline-strong);
}

/* ============================================================================
   Maintenance — a closable notice, and a dialog that cannot be closed
   ========================================================================== */

.ds-notice {
  position: fixed;
  top: 68px;
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(92vw, 560px);
  padding: 10px 12px 10px 16px;
  transform: translateX(-50%);
  border: 1px solid var(--ds-hairline-strong);
  border-radius: var(--ds-radius-card);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-card);
  font: var(--ds-text-row-label);
  color: var(--ds-ink);
}

/* Under the editor's tool strip. */
.annotation-page .ds-notice {
  top: 116px;
}

/* styles.css boxes every editor button outside a .ds-modal. */
.annotation-page .ds-notice button,
.annotation-page .ds-notice button:hover {
  border: 0;
  box-shadow: none;
  background: none;
}

.annotation-page .ds-notice button:hover {
  background: var(--ds-well);
}

.annotation-page .ds-notice button:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 1px;
}

/* A phone's app bar wraps to three rows; the editor's own sheet is at the bottom. */
@media (max-width: 640px) {
  .ds-notice {
    top: auto;
    bottom: 16px;
  }

  .annotation-page .ds-notice {
    top: 72px;
    bottom: auto;
  }
}

dialog.ds-modal {
  padding: 0 0 24px;
  border: 0;
  color: var(--ds-ink);
}

dialog.ds-modal:focus-visible {
  outline: none;
}

dialog.ds-modal:not([open]) {
  display: none;
}

dialog.ds-modal::backdrop {
  background: var(--ds-scrim);
}

/* What duct prices include: the Cost book's table, and a project's over it. */
.ds-includes {
  display: grid;
  grid-template-columns: 56px repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
  align-items: center;
}

.ds-includes-head {
  grid-row: 1;
  font: var(--ds-text-meta);
  letter-spacing: var(--ds-tracking-meta);
  color: var(--ds-ink-meta);
}

.ds-includes-type {
  grid-column: 1;
  font: var(--ds-text-cell);
  color: var(--ds-ink);
}

.ds-includes-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.ds-includes-cell.is-all {
  grid-row: 2 / span 3;
  align-self: start;
}

.ds-includes-all {
  flex-basis: 100%;
  font: var(--ds-text-cell);
  color: var(--ds-ink);
}

.ds-includes-said {
  font: var(--ds-text-helper);
  color: var(--ds-ink-secondary);
}

.ds-includes-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--ds-text-helper);
  color: var(--ds-ink-secondary);
  cursor: pointer;
}

.ds-includes-box.is-inherited {
  color: var(--ds-ink-disabled);
}

.ds-includes-box.is-inherited input {
  opacity: 0.5;
}

.ds-includes-reset {
  display: inline-flex;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--ds-ink-tertiary);
  cursor: pointer;
}

.ds-includes-reset:hover {
  color: var(--ds-ink);
}
