/* desk.css: shared component sheet for the WorkflowLab product-document pages and demos.
   Load after brand.css, motion.css and theme.css. Put class="dk" on <main>.
   Sections: 1 tokens · 2 page shell · 3 type · 4 layout · 5 hero · 6 buttons · 7 badges
   8 key points · 9 stats · 10 cards · 11 steps · 12 tables · 13 callouts · 14 FAQ
   15 closing · 16 small parts · 17 phone · 18 motion and print */

/* 1. Tokens (dk- prefix: motion.css and theme.css re-set the unprefixed names) */
:root {
  --dk-paper: #f8f7f2; --dk-surface: #f0efe7; --dk-panel: #fff;
  --dk-ink: #17201c; --dk-ink-2: #37413b; --dk-muted: #616862; --dk-line: #d9ddd3;
  --dk-accent: #f4ce3f; --dk-accent-hover: #e6bd23; --dk-accent-ink: #655100; --dk-accent-soft: #fbf3d3;
  --dk-good: #1f6b45; --dk-good-soft: #e5f2e9;
  --dk-warn: #8a5a00; --dk-warn-soft: #fcf0d2;
  --dk-bad: #a3301f; --dk-bad-soft: #fbe8e3;
  --dk-info: #1d5fa8; --dk-info-soft: #eef4fb; --dk-info-line: #c3d6ec;
  --dk-radius: 12px; --dk-radius-sm: 8px;
  --dk-shadow: 0 1px 2px rgba(23, 32, 28, .04), 0 2px 6px rgba(23, 32, 28, .05);
  --dk-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dk-measure: 68ch; --dk-gutter: clamp(16px, 4vw, 36px);
}

/* 2. Page shell: body, fallback nav and footer (shown when JavaScript is off) */
body { background: var(--dk-paper); color: var(--dk-ink); font: 16px/1.6 var(--dk-sans); }
.brand-nav { max-width: none; margin: 0; border-bottom: 0; row-gap: 12px; }
.brand-nav > a:not(.brand-logo):not(.btn) { font-size: 13px; }
.brand-nav .btn { border-radius: var(--dk-radius-sm); color: var(--dk-ink); }
.brand-footer { max-width: none; margin: 0; border-top: 0; align-items: center; }
.brand-footer a { color: inherit; }
/* These pages have no animation, so the shared "Pause motion" pill is not shown. */
body:has(main.dk) .theme-motion-toggle { display: none; }
body:has(main.dk) .site-footer { padding-bottom: 28px; }

/* 3. Type (scoped to .dk so it wins over the motion.css element rules) */
.dk { display: block; padding-bottom: 72px; text-wrap: pretty; }
.dk h1, .dk h2, .dk h3, .dk h4 { margin: 0; color: var(--dk-ink); font-family: var(--dk-sans); text-wrap: balance; }
.dk h1 { font-size: clamp(31px, 4.4vw, 46px); line-height: 1.12; font-weight: 700; letter-spacing: -.028em; max-width: 27ch; }
.dk h2 { font-size: clamp(23px, 2.6vw, 28px); line-height: 1.22; font-weight: 680; letter-spacing: -.02em; max-width: 34ch; margin-bottom: 16px; }
.dk h3 { font-size: 17px; line-height: 1.4; font-weight: 650; letter-spacing: -.005em; }
.dk h4 { font-size: 14px; line-height: 1.4; font-weight: 650; }
.dk p { margin: 0 0 14px; max-width: var(--dk-measure); color: var(--dk-ink-2); }
.dk p:last-child { margin-bottom: 0; }
.dk a { color: var(--dk-accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dk a:hover { color: var(--dk-ink); text-decoration: underline; }
.dk strong { color: var(--dk-ink); font-weight: 650; }
.dk code { font: .88em var(--dk-mono); background: var(--dk-surface); padding: 2px 6px; border-radius: 6px; }
.dk ul:not([class]), .dk ol:not([class]) { margin: 0 0 14px; padding-left: 20px; max-width: var(--dk-measure); color: var(--dk-ink-2); }
.dk ul:not([class]) li, .dk ol:not([class]) li { margin: 6px 0; }
.dk ul:not([class]) li::marker { color: #a3a99f; }
.dk :focus-visible, .brand-nav :focus-visible, .brand-footer :focus-visible { outline: 3px solid #807021; outline-offset: 3px; border-radius: 4px; }
.dk [id] { scroll-margin-top: 24px; }

/* 4. Layout: 1120px column for cards, tables and demos; text keeps the 68ch measure */
.dk-wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--dk-gutter); }
.dk-section { padding-top: 60px; }
.dk-section > :last-child { margin-bottom: 0; }
.dk-section > h3 { margin: 28px 0 12px; }
.dk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; align-items: start; }

/* 5. Hero */
.dk-crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 0 0; margin: 0; list-style: none; font-size: 13px; color: var(--dk-muted); }
.dk-crumbs li + li::before { content: "/"; margin-right: 6px; color: #a3a99f; }
.dk .dk-crumbs a { color: var(--dk-muted); }
.dk-hero { padding: 44px 0 4px; }
.dk-crumbs + .dk-hero { padding-top: 28px; }
.dk-kicker { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 13px; line-height: 1.4; font-weight: 650; color: var(--dk-accent-ink); }
.dk-kicker::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--dk-accent); }
.dk p.dk-lede { margin: 16px 0 0; max-width: 62ch; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; color: var(--dk-ink-2); }
.dk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 26px 0 0; }
.dk .dk-actions + p { margin-top: 18px; }

/* 6. Buttons (.btn comes from brand.css; these rules restyle it inside .dk) */
.dk .btn { min-height: 44px; padding: 10px 18px; border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); background: var(--dk-panel); color: var(--dk-ink); font: 650 15px/1.3 var(--dk-sans); text-decoration: none; cursor: pointer; }
.dk .btn:hover { background: var(--dk-surface); color: var(--dk-ink); text-decoration: none; }
.dk .btn-primary { background: var(--dk-accent); border-color: var(--dk-accent); }
.dk .btn-primary:hover { background: var(--dk-accent-hover); border-color: var(--dk-accent-hover); }
.dk .btn-secondary { background: var(--dk-panel); border-color: #c3c9bd; }
.dk .btn[disabled], .dk .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* 7. Badges: the only place for status colours, with callouts */
.dk-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #e9e9e0; color: var(--dk-ink-2); font-size: 12.5px; line-height: 1.45; font-weight: 650; white-space: nowrap; }
.dk-badge.neutral { background: #e9e9e0; color: var(--dk-ink-2); }
.dk-badge.good { background: var(--dk-good-soft); color: var(--dk-good); }
.dk-badge.warn { background: var(--dk-warn-soft); color: var(--dk-warn); }
.dk-badge.bad { background: var(--dk-bad-soft); color: var(--dk-bad); }
.dk-badge.accent { background: var(--dk-accent-soft); color: var(--dk-accent-ink); }

/* 8. Key points: the "In short" scan box under the hero */
.dk-keypoints { max-width: 820px; margin: 36px 0 0; padding: 20px 24px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-left: 4px solid var(--dk-accent); border-radius: var(--dk-radius); }
.dk .dk-keypoints h2, .dk .dk-keypoints h3 { margin: 0 0 8px; font-size: 13px; line-height: 1.4; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--dk-muted); }
.dk .dk-keypoints ul { margin: 0; padding-left: 20px; max-width: none; color: var(--dk-ink); }
.dk .dk-keypoints li { margin: 7px 0; }

/* 9. Stats: .k label, .v value, .n where the number comes from */
.dk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 20px; }
.dk-stat { padding: 16px 18px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); box-shadow: var(--dk-shadow); }
.dk-stat .k { font-size: 13px; font-weight: 550; color: var(--dk-muted); }
.dk-stat .v { margin-top: 4px; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--dk-ink); font-variant-numeric: tabular-nums; }
.dk-stat .n { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--dk-muted); }

/* 10. Cards */
.dk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0 0 20px; }
.dk-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 20px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); box-shadow: var(--dk-shadow); }
.dk .dk-card p, .dk .dk-card ul:not([class]) { margin: 0; font-size: 15px; max-width: none; }
.dk .dk-card h3 a { color: var(--dk-ink); }
.dk-card > .dk-badge { align-self: flex-start; }
.dk-card > .dk-actions, .dk-card > .dk-card-foot { margin-top: auto; padding-top: 10px; }

/* 11. Steps: <ol class="dk-steps"><li><h3>…</h3><p>…</p></li></ol> */
.dk-steps { list-style: none; counter-reset: dk-step; max-width: 760px; margin: 0 0 20px; padding: 0; }
.dk-steps > li { counter-increment: dk-step; position: relative; padding: 2px 0 22px 48px; }
.dk-steps > li:last-child { padding-bottom: 0; }
.dk-steps > li::before { content: counter(dk-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--dk-accent); color: var(--dk-ink); font-size: 14px; font-weight: 700; }
.dk-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--dk-line); }
.dk .dk-steps p { margin: 3px 0 0; font-size: 15px; }

/* 12. Tables: key-value (table.dk-kv) and data (.dk-table-wrap > table.dk-data) */
.dk-kv { width: 100%; max-width: 860px; margin: 0 0 20px; border: 1px solid var(--dk-line); border-radius: var(--dk-radius); border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--dk-panel); font-size: 15px; }
.dk-kv th, .dk-kv td { padding: 12px 16px; border-top: 1px solid var(--dk-line); text-align: left; vertical-align: top; }
.dk-kv tr:first-child > * { border-top: 0; }
.dk-kv th { width: 30%; background: var(--dk-surface); color: var(--dk-ink-2); font-weight: 600; }
.dk-kv td { color: var(--dk-ink-2); }
.dk-table-wrap { margin: 0 0 20px; overflow-x: auto; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); -webkit-overflow-scrolling: touch; }
.dk-data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.dk-data th, .dk-data td { padding: 11px 14px; border-bottom: 1px solid var(--dk-line); text-align: left; vertical-align: top; }
.dk-data thead th { background: var(--dk-surface); color: var(--dk-ink-2); font-size: 13px; font-weight: 650; white-space: nowrap; }
.dk-data tbody th { color: var(--dk-ink); font-weight: 600; }
.dk-data td { color: var(--dk-ink-2); }
.dk-data tbody tr:last-child > * { border-bottom: 0; }
.dk-data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 13. Callouts: one caveat or note the reader must not miss */
.dk-callout { max-width: 820px; margin: 0 0 20px; padding: 14px 18px; background: var(--dk-accent-soft); border: 1px solid #eadfb0; border-left: 4px solid var(--dk-accent); border-radius: var(--dk-radius-sm); }
.dk .dk-callout p, .dk .dk-callout ul:not([class]) { margin: 0; max-width: none; font-size: 15px; color: var(--dk-ink); }
.dk .dk-callout p + p, .dk .dk-callout p + ul { margin-top: 8px; }
.dk-callout > strong:first-child, .dk-callout > .dk-badge:first-child { display: block; width: fit-content; margin-bottom: 6px; }
.dk-callout.warn { background: var(--dk-warn-soft); border-color: #ecd9a4; border-left-color: #c98a12; }
.dk-callout.good { background: var(--dk-good-soft); border-color: #c5dfcd; border-left-color: #3d8c62; }

/* 14. FAQ: <div class="dk-faq"><details><summary>Q</summary><p>A</p></details></div> */
.dk-faq { max-width: 860px; margin: 0 0 20px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); overflow: hidden; }
.dk-faq details { padding: 0; border: 0; }
.dk-faq details + details { border-top: 1px solid var(--dk-line); }
.dk-faq summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 15px 18px; list-style: none; cursor: pointer; font-size: 16px; font-weight: 650; color: var(--dk-ink); }
.dk-faq summary::-webkit-details-marker { display: none; }
.dk-faq summary::after { content: "+"; flex: none; font-size: 20px; line-height: 1.2; font-weight: 400; color: var(--dk-muted); }
.dk-faq details[open] summary::after { content: "\2212"; }
.dk-faq summary:hover { background: #fbfaf6; }
.dk .dk-faq summary:focus-visible { outline-offset: -3px; }
.dk .dk-faq details > p, .dk .dk-faq details > div { margin: 0; padding: 0 18px 16px; max-width: 74ch; font-size: 15px; }

/* 15. Closing band: the main action again */
.dk-closing { margin-top: 64px; padding: clamp(24px, 4vw, 40px); background: var(--dk-surface); border: 1px solid var(--dk-line); border-radius: var(--dk-radius); }
.dk .dk-closing h2 { margin-bottom: 10px; }

/* 16. Small parts */
.dk .dk-note { font-size: 13.5px; line-height: 1.55; color: var(--dk-muted); }
.dk-sample-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 10px 14px; background: var(--dk-accent-soft); border: 1px solid #eadfb0; border-radius: var(--dk-radius-sm); font-size: 14px; line-height: 1.45; color: #453a11; }
.dk-sample-banner strong { color: #453a11; }

/* 17. Phone */
@media (max-width: 760px) {
  .dk { padding-bottom: 48px; }
  .dk-section { padding-top: 44px; }
  .dk-hero { padding-top: 32px; }
  .dk-two { grid-template-columns: 1fr; }
  .dk-closing { margin-top: 48px; }
  .brand-footer { flex-direction: column; align-items: flex-start; margin: 0; }
}
@media (max-width: 520px) {
  .dk-actions .btn { flex: 1 1 100%; }
  .dk-keypoints { padding: 16px 18px; }
  .dk-card { padding: 16px; }
  .dk-kv, .dk-kv tbody, .dk-kv tr, .dk-kv th, .dk-kv td { display: block; width: auto; }
  .dk-kv th { padding: 10px 14px 0; background: none; border-top: 1px solid var(--dk-line); font-size: 13px; color: var(--dk-muted); }
  .dk-kv td { padding: 2px 14px 12px; border-top: 0; }
  .dk-data th, .dk-data td { padding: 10px 12px; }
  .dk-data thead th { white-space: normal; }
  /* table.dk-data.dk-stack: each row becomes a block. Put data-label on each td; it shows as the cell label. */
  .dk-data.dk-stack, .dk-data.dk-stack tbody, .dk-data.dk-stack tr, .dk-data.dk-stack th, .dk-data.dk-stack td { display: block; }
  .dk-data.dk-stack thead { display: none; }
  .dk-data.dk-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--dk-line); }
  .dk-data.dk-stack tr:last-child { border-bottom: 0; }
  .dk-data.dk-stack th, .dk-data.dk-stack td { padding: 0; border: 0; }
  .dk-data.dk-stack td { padding-top: 6px; text-align: left; white-space: normal; }
  .dk-data.dk-stack td[data-label]::before { content: attr(data-label) ": "; font-size: 13px; font-weight: 600; color: var(--dk-muted); }
  .dk-steps > li { padding-left: 44px; }
}

/* 18. Reduced motion and print */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dk *, .dk *::before, .dk *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .brand-nav, .brand-footer, .skip, .theme-motion-toggle, .dk-actions, .dk-crumbs { display: none !important; }
  .dk { padding-bottom: 0; }
  .dk-wrap { max-width: none; padding-inline: 0; }
  .dk-section { padding-top: 28px; }
  .dk-card, .dk-stat { box-shadow: none; }
  .dk-card, .dk-stat, .dk-callout, .dk-keypoints, .dk-steps > li, .dk-kv tr, .dk-data tr, .dk-faq details { break-inside: avoid; }
  .dk-faq details::details-content { display: block; content-visibility: visible; }
  .dk-faq summary::after { content: none; }
  .dk a { color: var(--dk-ink); }
}
