/* Design system page. Only layout for the guide itself lives here, every class starts with ds-.
   The components on the page are the board's own, styled by app.css. */
body.ds { overflow: auto; height: auto; overscroll-behavior: auto; }
.ds-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
.ds-toc { position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 8px 20px; scrollbar-width: thin; }
.ds-toc .brand { margin-bottom: 6px; }
.ds-toc .nav-item { text-decoration: none; }
.ds-toc .ds-ver { font-size: 11px; color: var(--faint); padding: 0 8px 8px; }
.ds-main { min-width: 0; padding: 28px 40px 80px; max-width: 1180px; }
.ds-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ds-top .spacer { flex: 1; }
.ds-hero h1 { font-size: 28px; font-weight: 680; letter-spacing: -.025em; margin: 0 0 6px; line-height: 1.15; }
.ds-hero p { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 68ch; margin: 0 0 6px; }
.ds-sec { padding-top: 44px; scroll-margin-top: 8px; }
.ds-sec > h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 4px; }
.ds-sec > .ds-lead { color: var(--muted); max-width: 72ch; margin: 0 0 16px; line-height: 1.55; }
.ds-sub { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 26px 0 8px; }
.ds-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 18px; }
.ds-box.bg { background: var(--bg); }
.ds-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ds-row + .ds-row { margin-top: 12px; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.ds-cap { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.ds-cap code, .ds-lead code, .ds-rules code, .ds-table code { font-family: var(--mono); font-size: .9em; background: var(--hover); padding: 1px 4px; border-radius: 4px; color: var(--text); }
.ds-ex { display: grid; gap: 8px; }
.ds-ex > .ds-cap { margin-top: 0; }

/* principles */
.ds-princ { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 18px; }
.ds-princ .ds-box { padding: 14px 16px; }
.ds-princ b { display: block; font-size: 14px; margin-bottom: 3px; }
.ds-princ span { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* colour */
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ds-sw { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.ds-sw-chip { height: 56px; border-bottom: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.ds-sw-body { padding: 8px 10px 9px; display: grid; gap: 2px; }
.ds-sw-body b { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.ds-sw-body span { font-size: 11.5px; color: var(--muted); }
.ds-sw-hex { display: flex; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ds-sw-hex i { font-style: normal; display: inline-flex; align-items: center; gap: 4px; }
.ds-sw-hex i::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); border: 1px solid var(--line-strong); }
.ds-bcolors { display: flex; flex-wrap: wrap; gap: 14px; }
.ds-bcolors div { display: grid; justify-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ds-bcolors i { width: 34px; height: 34px; border-radius: 9px; }

/* tables */
.ds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ds-table th, .ds-table td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ds-table th { font-size: 11.5px; font-weight: 600; color: var(--muted); border-bottom-color: var(--line-strong); }
.ds-table tr:last-child td { border-bottom: 0; }
.ds-table .mono { color: var(--muted); }
.ds-scroll { overflow-x: auto; }
.ds-ratio { font-variant-numeric: tabular-nums; font-weight: 600; }
.ds-ratio.ok { color: var(--ok); } .ds-ratio.mid { color: var(--text); } .ds-ratio.low { color: var(--danger); }
.ds-aa { font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 8px; background: var(--hover); color: var(--muted); margin-left: 6px; }

/* type */
.ds-type td:first-child { width: 48%; }

/* spacing, radius, shadow */
.ds-tokens { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.ds-tok { display: grid; justify-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.ds-tok code { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ds-rad { width: 64px; height: 48px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ds-shd { width: 120px; height: 72px; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); }
.ds-sp { background: var(--info); border-radius: 2px; height: 14px; opacity: .8; }
.ds-heights { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ds-heights div { display: grid; justify-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.ds-heights i { width: 54px; border: 1px dashed var(--line-strong); border-radius: 6px; background: var(--panel); }

/* icons */
.ds-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ds-icon { display: grid; justify-items: center; gap: 8px; padding: 14px 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11.5px; }
.ds-icon:hover { border-color: var(--line-strong); background: var(--hover); }
.ds-icon svg.ic { width: 20px; height: 20px; }
.ds-icon code { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ds-glyphs { display: flex; gap: 18px; flex-wrap: wrap; }
.ds-glyphs div { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }

/* board sample */
.ds-board { display: flex; gap: 6px; overflow-x: auto; padding: 10px 6px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; }
.ds-board .col { min-width: 236px; }
.ds-board .col-body { overflow: visible; padding-bottom: 8px; }
.ds-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.ds-cards .col { max-width: none; min-width: 0; }
.ds-slots { position: relative; }
.ds-slots .card { outline: 1px dashed transparent; }
.ds-slot-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.ds-slot-list b { color: var(--text); font-weight: 600; }

/* static versions of overlays */
.ds-dialog .dialog { animation: none; }
.ds-drawer { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); max-width: 640px; }
.ds-drawer .d-body { overflow: visible; padding-bottom: 20px; }
.ds-side { width: 236px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px 8px; display: flex; flex-direction: column; }
.ds-side .nav { flex: none; }
.ds-chat { max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.ds-toasts { display: grid; gap: 8px; justify-items: start; }

/* motion */
.ds-motion { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ds-ease { height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; margin: 12px 0 4px; }
.ds-ease i { position: absolute; top: 0; left: 0; width: 28%; height: 100%; border-radius: 2px; background: var(--accent); }
.ds-ease.go i { animation: ds-slide var(--d) var(--e) both; }
@keyframes ds-slide { from { transform: translateX(0); } to { transform: translateX(257%); } }

/* rules */
.ds-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ds-rules .ds-box { padding: 14px 16px; }
.ds-rules h3 { margin: 0 0 6px; font-size: 14px; }
.ds-rules ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.55; font-size: 13px; }
.ds-rules li { margin: 2px 0; }
.ds-rules li b { color: var(--text); font-weight: 600; }
.ds-do { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ds-do > div { border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); }
.ds-do .yes { border-top: 3px solid var(--ok); } .ds-do .no { border-top: 3px solid var(--danger); }
.ds-do b { display: block; font-size: 12px; margin-bottom: 6px; } .ds-do .yes b { color: var(--ok); } .ds-do .no b { color: var(--danger); }
.ds-foot { margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }

.ds-menu { display: none; }
@media (max-width: 860px) {
  .ds-wrap { grid-template-columns: minmax(0, 1fr); }
  .ds-toc { position: fixed; z-index: 35; left: 0; top: 0; width: min(280px, 84vw); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); padding-top: calc(14px + env(safe-area-inset-top)); }
  .ds-toc.on { transform: none; }
  .ds-menu { display: grid; }
  .ds-main { padding: calc(14px + env(safe-area-inset-top)) 14px 60px; }
  .ds-hero h1 { font-size: 23px; }
  .ds-do { grid-template-columns: 1fr; }
}
