/* Docs page furniture and docs home (scripts/build-docs.mjs, js/docs-page.js; docs/product/docs-design-2026-11-04.md 3.4-3.8).
   Loaded after css/docs.css, which owns the layout grid, sidebar look, drawer, typography and callouts. Shared tokens
   and .say / .prompt-line / .copy-btn live in /styles.css and docs.css. */

/* ---- Phone bar: menu button plus the current section, stuck under the site header (docs.js opens the drawer) ---- */
.docs-bar { display: none; }
@media (max-width: 899px) {
  .docs-js .docs-bar { display: block; position: sticky; top: 0; z-index: 15; border-bottom: 1px solid var(--line); background: var(--page, var(--bg)); }
  .docs-bar .docs-menu-btn { display: flex; width: 100%; margin: 0; border: 0; border-radius: 0; background: none; justify-content: flex-start; padding-left: 0; padding-right: 0; }
  .docs-bar .docs-menu-btn[hidden] { display: none; }
  .docs-bar-sec { margin-left: auto; padding-left: 12px; color: var(--muted); font-weight: 400; font-size: var(--fs-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 760px) and (max-width: 899px) { .docs-js .docs-bar { top: var(--head-h, 68px); } }
@media (min-width: 900px) { .docs-bar { display: none !important; } }

/* ---- Drawer Close button (DD1's docs.css owns the sidebar parts) ---- */
.docs-side-title { font-weight: 700; font-size: 17px; }
.docs-side-close { min-height: 44px; min-width: 64px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 600 15px/1 var(--body); cursor: pointer; }

/* ---- Page actions row: last updated left, Copy page right ---- */
.dd-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 24px; }
.docs-article .dd-actions .updated { margin: 0; }
.dd-copy { position: relative; display: inline-flex; align-items: stretch; }
.dd-copy-btn, .dd-menu summary, .dd-menu-list button { font: 600 var(--fs-ui)/1.2 var(--body); color: var(--ink); cursor: pointer; }
.dd-copy-btn { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px 0 0 10px; background: var(--surface); }
.dd-copy-btn[hidden] { display: none; }
.dd-copy-btn:hover, .dd-menu summary:hover { border-color: var(--line-strong); }
.dd-copy-btn[data-copied] { background: var(--ink); color: var(--paper); }
.dd-menu summary { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 10px; list-style: none; border: 1px solid var(--line); border-radius: 0 10px 10px 0; background: var(--surface); }
.dd-copy-btn[hidden] + .dd-menu summary { border-radius: 10px; }
.dd-menu summary::-webkit-details-marker { display: none; }
.dd-menu-label { font-weight: 600; }
.dd-copy-btn:not([hidden]) + .dd-menu .dd-menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dd-menu summary svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dd-menu summary:focus-visible, .dd-copy-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.dd-menu-list { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 220px; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(20, 20, 40, 0.16); }
/* On a phone the row wraps, so Copy page sits at the left in some languages and at the right in others: a 220px list hung from its right edge opened off the left of the screen (Fable audit F20). There the list hangs from the whole row instead and is as wide as it, so it is on screen wherever the button is. */
@media (max-width: 899px) { .dd-actions { position: relative; } .dd-copy { position: static; } .dd-menu-list { left: 0; right: 0; width: auto; } }
.dd-menu-list li { margin: 0; }
.dd-menu-list a, .dd-menu-list button { display: block; width: 100%; min-height: 40px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left; text-decoration: none; font-weight: 500; }
.dd-menu-list button[hidden] { display: none; }
.dd-menu-list a:hover, .dd-menu-list button:hover { background: var(--hl); }
.docs-article .dd-menu-list a { color: var(--ink); font-size: var(--fs-ui); }

/* ---- On this page: h3 under h2, tools under the list ---- */
.docs-toc li.toc-h3 a, .toc-inline li.toc-h3 a { padding-left: 22px; font-size: var(--fs-xs); }
.toc-inline li.toc-h3 { break-inside: avoid; }
.toc-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.toc-tools .dd-copy-btn { border-radius: 10px; min-height: 36px; font-weight: 500; }
.toc-top { padding: 4px 10px; color: var(--muted); font-size: var(--fs-ui); text-decoration: none; }
.toc-top:hover { color: var(--ink); }

/* ---- Page end: helpful, ask your AI, previous/next, contact last ---- */
.dd-end { max-width: 760px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 20px; }
.dd-helpful { display: grid; gap: 10px; justify-items: start; }
.dd-helpful[hidden], .dd-helpful [hidden] { display: none; }
.dd-helpful-q { margin: 0; font-weight: 700; }
.dd-helpful-btns { display: flex; gap: 8px; }
.dd-helpful-btns button, .dd-helpful-form button { min-height: 44px; min-width: 72px; padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 600 15px/1 var(--body); cursor: pointer; }
.dd-helpful-btns button:hover { background: var(--hl); }
.dd-helpful-btns button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.dd-helpful-form { display: grid; gap: 8px; width: 100%; max-width: 520px; justify-items: start; }
.dd-helpful-form label { font-size: var(--fs-sm); color: var(--muted); }
.dd-helpful-form textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 15px/1.4 var(--body); resize: vertical; }
.dd-helpful-form button { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.dd-helpful-thanks { margin: 0; color: var(--muted); }
.dd-helpful button:focus-visible, .dd-helpful textarea:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.dd-ask.say { margin: 0; max-width: 100%; box-shadow: none; border-color: var(--line); background: var(--hl); }
.dd-end + .prev-next { margin-top: 20px; }
.dd-contact { margin: 20px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.docs-article ~ .dd-contact a, .dd-contact a { color: var(--muted); }

/* ---- Docs home: task tiles, then every section as a link list ---- */
.dd-tasks { margin-top: 40px; }
.dd-tiles { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .dd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .dd-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dd-tile { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color var(--ease); }
.dd-tile:hover, .dd-tile:focus-within { border-color: var(--line-strong); }
.dd-tile-main { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 16px 18px; color: var(--ink); text-decoration: none; }
.dd-tile-main:focus-visible, .dd-tile-also:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: var(--radius); }
.dd-tile-title { font-weight: 700; font-size: 17px; }
.dd-tile-text { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.dd-tile-also { display: flex; align-items: center; min-height: 44px; padding: 0 18px; color: var(--primary); font-size: var(--fs-ui); font-weight: 600; text-decoration: none; }
.dd-tile-also::after { content: " \2192"; }
.dd-tile-also:hover { text-decoration: underline; }
.dd-browse-h { margin: 56px 0 0; font-size: var(--fs-h2); }
.dd-browse-h + .docs-group { margin-top: 20px; }
.dd-steps h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; }
.dd-browse { display: grid; gap: 28px 32px; margin-top: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .dd-browse { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .dd-browse { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dd-browse .docs-group { margin: 0; }
.dd-links h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.dd-links-lede { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-ui); line-height: 1.45; }
.dd-links ul, .dd-links-plain { list-style: none; margin: 0; padding: 0; }
.dd-links li, .dd-links-plain li { margin: 0; }
.dd-links li a, .dd-links-plain li a { display: block; padding: 5px 0; color: var(--ink); text-decoration: none; font-size: var(--fs-sm); line-height: 1.4; }
.dd-links li a:hover, .dd-links-plain li a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 899px) { .dd-links li a, .dd-links-plain li a { min-height: 44px; display: flex; align-items: center; padding: 6px 0; } }
.dd-help { padding-top: 24px; border-top: 1px solid var(--line); }
.dd-help .dd-contact { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .dd-tile { transition: none; } }
