/* The desk: the pages an estimator uses to add a project, see what was found, start the reading and keep the company's guidance.
   One stylesheet, every class prefixed ds-. Same tokens and rules as the estimator's review screen and docs/design/ui-guide.md:
   one coral accent, status only ever with a word, no gradients, no side stripes, no tinted cards, light and dark by tokens, 4px grid,
   left-aligned lists, 16px gutters, nothing scrolls sideways. No remote assets, no web fonts. */

:root {
  color-scheme: light;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #f0f1f3;
  --border: #e6e7ea;
  --border-strong: #d4d6db;
  --text: #0f1115;
  --text-2: #5b616e;
  --text-3: #6f7682;
  --accent: #bf4f26;
  --accent-hover: #a94422;
  --accent-text: #a94422;
  --accent-contrast: #ffffff;
  --red: #c4320a;
  --amber: #a15c07;
  --green: #067647;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0c0e;
    --surface: #111316;
    --surface-2: #15171b;
    --surface-3: #1c1f24;
    --border: #24272d;
    --border-strong: #30343c;
    --text: #eceef1;
    --text-2: #a3a9b5;
    --text-3: #8b919d;
    --accent: #f0784c;
    --accent-hover: #f39470;
    --accent-text: #f39470;
    --accent-contrast: #1a1206;
    --red: #f97066;
    --amber: #fdb022;
    --green: #47cd89;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0e;
  --surface: #111316;
  --surface-2: #15171b;
  --surface-3: #1c1f24;
  --border: #24272d;
  --border-strong: #30343c;
  --text: #eceef1;
  --text-2: #a3a9b5;
  --text-3: #8b919d;
  --accent: #f0784c;
  --accent-hover: #f39470;
  --accent-text: #f39470;
  --accent-contrast: #1a1206;
  --red: #f97066;
  --amber: #fdb022;
  --green: #47cd89;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ds {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.ds :is(h1, h2, h3, p, ul, ol, fieldset, figure) { margin: 0; padding: 0; }
.ds :is(ul, ol) { list-style: none; }
.ds fieldset { border: 0; min-width: 0; }
:where(.ds) :is(button, input, textarea, select) { font: inherit; color: inherit; }
.ds button { cursor: pointer; }
.ds [hidden] { display: none !important; }
.ds :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds a { color: var(--accent-text); text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ds-skip { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--surface); border: 1px solid var(--border-strong); padding: 8px 12px; border-radius: 6px; color: var(--text); }
.ds-skip:focus { top: calc(var(--proto-bar-h, 0px) + 8px); }
.ds-quiet { color: var(--text-3); }
.ds-say { color: var(--text-2); }

/* ---------- the frame ---------- */
.ds-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.ds-nav { display: flex; align-items: center; gap: 4px; max-width: 1040px; margin: 0 auto; padding: 0 6px; min-height: 48px; flex-wrap: wrap; }
.ds-nav a { color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.ds-nav a:hover { background: var(--surface-3); color: var(--text); }
.ds-nav a[aria-current="page"] { color: var(--text); }
.ds-nav a[aria-current="page"]::after { content: ""; display: block; height: 2px; margin-top: 2px; border-radius: 1px; background: var(--accent); }
.ds-main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 16px 56px; display: grid; gap: 32px; align-content: start; min-width: 0; }
.ds-main:focus { outline: none; }
.ds-foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.ds-link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent-text); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.ds-link-btn:hover { color: var(--accent-hover); }
.ds-link-btn.is-quiet { color: var(--text-2); text-decoration-color: var(--border-strong); }
.ds-link-btn.is-quiet:hover { color: var(--text); }
.ds-net { color: var(--amber); }

/* ---------- sign-in (a desk other people reach) ---------- */
.ds-nav-title { padding: 8px 10px; font-weight: 600; color: var(--text); }
.ds-session { margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 0 10px; color: var(--text-2); font-size: 13px; min-width: 0; }
.ds-session-who { overflow-wrap: anywhere; }
.ds-login { width: 100%; max-width: 420px; margin: 24px auto 0; display: grid; gap: 20px; }
.ds-login h1 { font-size: 24px; line-height: 32px; font-weight: 650; letter-spacing: -0.012em; }
.ds-login .ds-lead { color: var(--text-2); }
.ds-login-form { display: grid; gap: 16px; }
.ds-login-form .ds-btn { width: 100%; }
.ds-login-alt { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ds-code-input { min-height: 52px; font-size: 22px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

.ds-pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ds-pagehead h1 { font-size: 24px; line-height: 32px; font-weight: 650; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.ds-pagehead .ds-lead { margin-top: 4px; color: var(--text-2); max-width: 60ch; }
.ds-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; color: var(--text-3); font-size: 13px; margin-top: -8px; }
.ds-meta a { color: var(--text-2); }
.ds-meta a:hover { color: var(--text); }

/* ---------- buttons ---------- */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.ds a.ds-btn { color: var(--text); }
.ds-btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--surface-3); }
.ds-btn:disabled, .ds-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.ds-btn-primary, .ds a.ds-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.ds-btn-primary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--accent-hover); border-color: var(--accent-hover); }
.ds-btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.ds-btn-quiet:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.ds-btn-lg { min-height: 44px; padding: 0 20px; font-size: 15px; }
.ds-btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.ds-btn-warn { color: var(--red); }

/* ---------- a project's card ---------- */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.ds-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; box-shadow: var(--shadow-sm); }
.ds-card h2 { font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.ds-card-top { display: grid; gap: 2px; }
.ds-updated { color: var(--text-3); font-size: 12.5px; }
.ds-sample-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; line-height: 18px; vertical-align: 2px; }
.ds-status { display: grid; gap: 2px; }
.ds-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ds-state-reading { color: var(--accent-text); }
.ds-state-done { color: var(--text); }
.ds-state-failed { color: var(--red); }
.ds-state-stopped, .ds-state-draft, .ds-state-ready { color: var(--text-2); }
.ds-detail { color: var(--text-2); }
.ds-why { color: var(--text-3); font-size: 13px; }
.ds-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ds-pulse 1.8s ease-in-out infinite; flex: none; }
@keyframes ds-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .ds-pulse { animation: none; } }
.ds-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.ds-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s var(--ease); }
@media (prefers-reduced-motion: reduce) { .ds-bar > i { transition: none; } }
.ds-now { color: var(--text-2); }
.ds-status .ds-bar { margin: 6px 0 4px; }
.ds-ready-line { color: var(--text); font-weight: 600; }
.ds-card-acts { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.ds-btn.ds-btn-wrap { white-space: normal; text-align: center; padding-top: 6px; padding-bottom: 6px; line-height: 1.35; }
.ds-confirm { display: grid; gap: 8px; margin-top: auto; }
.ds-confirm p { color: var(--text-2); }
.ds-confirm-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- empty, loading, error, notices ---------- */
.ds-empty { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 48px 24px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.ds-empty h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
.ds-empty p { color: var(--text-2); max-width: 52ch; }
.ds-skel { background: var(--surface-3); border-radius: 6px; animation: ds-skel 1.6s ease-in-out infinite; }
@keyframes ds-skel { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .ds-skel { animation: none; } }
.ds-card-skel { height: 148px; border-radius: 12px; }
.ds-skel-block { height: 160px; border-radius: 12px; }
.ds-notice { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 16px; display: grid; gap: 6px; justify-items: start; }
.ds-notice h2, .ds-notice h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.ds-notice p { color: var(--text-2); max-width: 64ch; }
.ds-notice .ds-btn { margin-top: 8px; }
.ds-problem { color: var(--red); font-size: 13px; }

/* ---------- the new project page ---------- */
.ds-steps { display: grid; gap: 24px; }
.ds-step { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 16px; display: grid; gap: 16px; min-width: 0; }
.ds-step-head { display: grid; gap: 2px; }
.ds-eyebrow { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; }
.ds-step h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
.ds-step-hint { color: var(--text-2); max-width: 64ch; }
.ds-step.is-locked { background: transparent; border-style: dashed; }
.ds-step.is-locked h2, .ds-step.is-locked .ds-eyebrow { color: var(--text-3); }
.ds-step-body { display: grid; gap: 16px; min-width: 0; }
.ds-field { display: grid; gap: 6px; }
.ds-label { font-weight: 600; }
.ds-hint { color: var(--text-3); font-size: 13px; }
.ds-input, .ds-select, .ds-textarea { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.ds-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.ds-input:focus-visible, .ds-select:focus-visible, .ds-textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.ds-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.ds-row .ds-input { flex: 1 1 240px; width: auto; }
.ds-set { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ds-set strong { font-size: 16px; overflow-wrap: anywhere; }

.ds-drop { border: 2px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); min-height: 200px; padding: 24px 16px; display: grid; gap: 12px; place-content: center; justify-items: center; text-align: center; transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease); }
.ds-drop.is-compact { min-height: 120px; padding: 16px; }
.ds-drop.is-over { border-color: var(--accent); background: var(--surface-3); }
.ds-drop h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.ds-drop p { color: var(--text-2); max-width: 46ch; }
.ds-drop-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.ds-sum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.ds-sum-line { font-weight: 600; }
.ds-tree { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-height: min(640px, 75vh); overflow: auto; }
.ds-tree ul { display: block; }
.ds-tree .ds-sub { margin-left: 20px; }
.ds-node { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 6px 12px; min-height: 36px; border-bottom: 1px solid var(--border); }
.ds-tree li:last-child > .ds-node:last-child { border-bottom: 0; }
.ds-node-name { min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; }
.ds-node-folder .ds-node-name { font-weight: 600; }
.ds-node-folder .ds-fstate { grid-column: 2 / -1; }
.ds-caret { width: 24px; height: 24px; border: 0; background: transparent; border-radius: 6px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.ds-caret:hover { background: var(--surface-3); }
.ds-caret::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.12s var(--ease); }
.ds-caret[aria-expanded="true"]::before { transform: rotate(45deg); }
.ds-fstate { font-size: 13px; white-space: nowrap; color: var(--text-2); text-align: right; }
.ds-fstate-uploading { color: var(--accent-text); font-weight: 600; }
.ds-fstate-added { color: var(--text-2); }
.ds-fstate-kept { color: var(--text-2); }
.ds-fstate-refused, .ds-fstate-failed { color: var(--red); font-weight: 600; white-space: normal; }
.ds-fstate-exists { color: var(--amber); font-weight: 600; }
.ds-fnote { grid-column: 1 / -1; color: var(--text-3); font-size: 12.5px; padding-left: 0; }
.ds-fnote.is-problem { color: var(--text-2); }
.ds-facts { color: var(--text-3); }

.ds-found { display: grid; gap: 24px; }
.ds-block { display: grid; gap: 8px; min-width: 0; }
.ds-block h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.ds-block > p { color: var(--text-2); }
.ds legend { padding: 0; margin-bottom: 8px; }
.ds-block-title h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.ds-table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.ds-table-wrap.is-long { max-height: 440px; overflow: auto; }
.ds-table-wrap.is-long th { position: sticky; top: 0; }
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ds-table th { height: 36px; padding: 0 12px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ds-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.ds-table tr:last-child td { border-bottom: 0; }
.ds-table .ds-n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-table .ds-ref { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ds-plain li { padding: 8px 0; border-top: 1px solid var(--border); color: var(--text-2); overflow-wrap: anywhere; }
.ds-plain li:first-child { border-top: 0; }
.ds-none { color: var(--text-3); }
.ds-boqline { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: baseline; }
.ds-boqline strong { overflow-wrap: anywhere; }
.ds-radios { display: grid; gap: 8px; }
.ds-radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.ds-radio:hover { background: var(--surface-2); }
.ds-radio:has(input:checked) { border-color: var(--accent); }
.ds-radio input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.ds-radio input:focus-visible { outline-offset: 3px; }
.ds-radio span { display: grid; min-width: 0; }
.ds-radio small { color: var(--text-3); font-size: 13px; }
.ds-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-choices .ds-radio { flex: 1 1 140px; }
.ds-estimate { font-weight: 600; }
.ds-startbar { display: grid; gap: 8px; justify-items: start; }
.ds-startbar .ds-btn { min-width: 200px; }

/* ---------- guidance ---------- */
.ds-group { display: grid; gap: 12px; min-width: 0; }
.ds-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ds-group-head h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
.ds-group-note { color: var(--text-2); max-width: 70ch; }
.ds-rules { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.ds-rule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: start; }
.ds-rule:last-child { border-bottom: 0; }
.ds-rule.is-off .ds-rule-text { color: var(--text-3); }
.ds-rule-body { display: grid; gap: 4px; min-width: 0; }
.ds-rule-text { overflow-wrap: anywhere; }
.ds-rule-meta { color: var(--text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.ds-rule-acts { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; }
.ds-rule-edit { display: grid; gap: 8px; }
.ds-rule-confirm { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; color: var(--text-2); }
.ds-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--text-2); font-size: 13px; width: 64px; }
.ds-switch-track { width: 32px; height: 18px; border-radius: 9px; background: var(--border-strong); position: relative; flex: none; transition: background-color 0.12s var(--ease); }
.ds-switch-track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.12s var(--ease); }
.ds-switch[aria-checked="true"] .ds-switch-track { background: var(--accent); }
.ds-switch[aria-checked="true"] .ds-switch-track::after { transform: translateX(14px); }
.ds-switch[aria-checked="true"] .ds-switch-word { color: var(--text); font-weight: 600; }
.ds-held { display: inline-block; width: 9.5rem; color: var(--text-3); font-size: 12.5px; line-height: 20px; }
.ds-block h3 .ds-quiet { font-weight: 400; }
.ds-fold { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ds-fold > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-radius: 12px; font-weight: 600; }
.ds-fold > summary::-webkit-details-marker { display: none; }
.ds-fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(-45deg); transition: transform 0.12s var(--ease); flex: none; margin-left: 4px; }
.ds-fold[open] > summary::before { transform: rotate(45deg); }
.ds-fold > summary .ds-quiet { font-weight: 400; }
.ds-fold-body { display: grid; gap: 12px; padding: 0 0 4px; }
.ds-fold-body > p, .ds-fold-body .ds-block > h3 { padding: 0 16px; }
.ds-fold-body > p { color: var(--text-2); }
.ds-fold .ds-rules { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; }
.ds-add { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.ds-sources { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.ds-sources h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.ds-chips { display: flex; gap: 6px 12px; flex-wrap: wrap; color: var(--text-2); }
.ds-found-line { font-weight: 600; }

/* ---------- pricing on the guidance page: the company's numbers, each with the words it was read from ---------- */
.ds-pricing { gap: 16px; }
.ds-price-tools { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.ds-price-report { display: grid; gap: 2px; font-weight: 500; max-width: 70ch; }
.ds-prices { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.ds-fold .ds-prices { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; }
.ds-price { padding: 12px 16px; display: grid; gap: 4px; min-width: 0; border-bottom: 1px solid var(--border); }
.ds-prices > .ds-price:last-child { border-bottom: 0; }
.ds-price-lone { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.ds-price-main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 11rem) 5.5rem; gap: 2px 16px; align-items: baseline; }
.ds-price-label { font-weight: 600; overflow-wrap: anywhere; }
.ds-price-value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ds-price.is-needs_choice .ds-price-value, .ds-price.is-not_given .ds-price-value { color: var(--text-3); }
.ds-price-tag { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.ds-price-tag.is-edited { color: var(--accent-text); }
.ds-price-tag.is-needs_choice { color: var(--amber); }
.ds-price-act { justify-self: end; text-align: right; }
.ds-price-says, .ds-price-src, .ds-price-needs { color: var(--text-3); font-size: 13px; max-width: 80ch; overflow-wrap: anywhere; }
.ds-price-needs { color: var(--text-2); }
.ds-price-words { color: var(--text-2); }
.ds-price-edit { display: grid; gap: 8px; margin-top: 4px; max-width: 560px; }
.ds-price-edit .ds-row { align-items: center; }
.ds-row .ds-input.ds-price-input { flex: 0 1 200px; }
.ds-unit { color: var(--text-3); font-size: 13px; }
.ds-price-others { display: grid; gap: 4px; margin-top: 4px; }
.ds .ds-dept { list-style: decimal; padding-left: 28px; margin: 4px 0 0; display: grid; gap: 2px; color: var(--text); }

/* ---------- rates: where they start, the table, specialist work ---------- */
.ds-rates { display: grid; gap: 24px; min-width: 0; }
.ds-rates-start .ds-radios { max-width: 640px; }
.ds-rates-from { font-weight: 600; }
.ds-rates-empty { padding: 32px 24px; }
.ds-rates-table { display: grid; gap: 12px; min-width: 0; }
.ds-table.ds-rates-tbl { table-layout: fixed; }
.ds-table.ds-rates-tbl th:nth-child(1) { width: 30%; }
.ds-table.ds-rates-tbl th:nth-child(2) { width: 17%; }
.ds-table.ds-rates-tbl th:nth-child(3) { width: 11%; }
.ds-table.ds-rates-tbl th:nth-child(4) { width: 17%; }
.ds-table.ds-rates-tbl th:nth-child(5) { width: 14%; }
.ds-table.ds-rates-tbl th:nth-child(6) { width: 11%; }
.ds-table.ds-rates-tbl td { vertical-align: top; padding: 8px; }
.ds-table.ds-rates-tbl th { white-space: normal; height: auto; padding: 8px; }
.ds-table.ds-rates-tbl .ds-input, .ds-table.ds-rates-tbl .ds-select { min-height: 36px; padding: 4px 8px; }
.ds-table.ds-rates-tbl small { display: block; margin-top: 2px; }
.ds-rate-act { text-align: right; }
.ds-rates [aria-invalid="true"] { border-color: var(--red); }
.ds-rates-fold { padding: 0 16px 16px; }
.ds-rates-fold .ds-radios { max-width: 640px; }
.ds-rates-bar { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.ds-rates-state { color: var(--text-2); }
.ds-spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px 16px; }
.ds-startwrap { display: grid; }
.ds-rates-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; }

/* ---------- delete a project: a quiet text action at the end of the card's row, asked in the card itself ---------- */
.ds-del { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; margin-left: auto; }
.ds-link-btn:disabled, .ds-link-btn:disabled:hover { color: var(--text-3); text-decoration: none; cursor: default; }
.ds-flash { color: var(--text); font-weight: 600; }

@media (max-width: 720px) {
  .ds-price-main { grid-template-columns: minmax(0, 1fr) auto; }
  .ds-price-label { grid-column: 1; grid-row: 1; }
  .ds-price-act { grid-column: 2; grid-row: 1; }
  .ds-price-value { grid-column: 1 / -1; grid-row: 2; }
  .ds-price-tag { grid-column: 1 / -1; grid-row: 3; }
  .ds-price { padding: 12px; }
  .ds-row .ds-input.ds-price-input { flex: 1 1 140px; }
  .ds-table-wrap.ds-rates-wrap { border: 0; border-radius: 0; background: transparent; }
  .ds-table.ds-rates-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ds-table.ds-rates-tbl, .ds-table.ds-rates-tbl tbody { display: block; }
  .ds-table.ds-rates-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .ds-table.ds-rates-tbl td { display: block; padding: 0; border: 0; }
  .ds-table.ds-rates-tbl td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
  .ds-table.ds-rates-tbl td[data-label="Material or product"], .ds-table.ds-rates-tbl td.ds-rate-act { grid-column: 1 / -1; }
  .ds-table.ds-rates-tbl td.ds-rate-act { text-align: left; }
  .ds-table.ds-rates-tbl td.ds-rate-act::before { content: none; }
  .ds-rates-link { min-height: 44px; }
}

@media (max-width: 720px) {
  .ds-main { padding: 24px 16px 48px; gap: 24px; }
  .ds-pagehead { display: grid; }
  .ds-pagehead .ds-btn { width: 100%; }
  .ds-pagehead h1 { font-size: 22px; }
  .ds-btn { min-height: 44px; }
  .ds-btn-sm { min-height: 40px; }
  .ds-two { grid-template-columns: 1fr; gap: 24px; }
  .ds-card-acts .ds-btn-primary, .ds-card-acts .ds-btn-quiet { flex: 1 1 100%; }
  .ds-step { padding: 16px 12px; }
  .ds-row .ds-btn { width: 100%; }
  .ds-startbar .ds-btn { width: 100%; }
  .ds-rule { grid-template-columns: minmax(0, 1fr); }
  .ds-node { grid-template-columns: minmax(0, 1fr) auto; }
  .ds-node .ds-node-act { grid-column: 1 / -1; justify-self: start; }
  .ds-tree .ds-sub { margin-left: 12px; }
  .ds-empty { padding: 32px 16px; }
  .ds-drop { min-height: 160px; }
  .ds-drop-acts .ds-btn { flex: 1 1 100%; }
  .ds-link-btn { min-height: 32px; }
  .ds-card-acts .ds-del, .ds-card-acts .ds-rates-link { min-height: 44px; }  /* a finger: the quiet actions are as tall as the buttons beside them */
  .ds-switch { min-height: 36px; }
}

/* Price lists: what was read from a supplier's quote, and the boards it holds. */
.ds-pl-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; color: var(--text-2); font-size: 13px; }
.ds-pl-read { display: grid; gap: 8px; }
.ds-table .ds-pl-group th { background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; height: 32px; white-space: normal; }
.ds-pl-table td small { display: block; }
.ds-pl-table .ds-nw { white-space: nowrap; }
@media (max-width: 520px) {
  .ds-pl-table th, .ds-pl-table td { padding: 8px 6px; font-size: 13px; }
  .ds-pl-table th { white-space: normal; height: auto; }
}

/* ---------- the page after Start reading: the drawings being opened ---------- */
.ds-opening { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 16px; display: grid; gap: 12px; max-width: 640px; min-width: 0; }
.ds-opening-name { font-weight: 600; overflow-wrap: anywhere; }
.ds-opening-count { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -0.01em; }
.ds-opening .ds-bar { height: 6px; border-radius: 3px; }
.ds-opening .ds-bar > i { border-radius: 3px; }
.ds-opening-now { color: var(--text-2); overflow-wrap: anywhere; }
.ds-opening-lines { display: grid; gap: 6px; color: var(--text-2); overflow-wrap: anywhere; }
.ds-opening-lines li:first-child { color: var(--text); }
.ds-opening-time { color: var(--text-3); font-size: 13px; }
