/* The detail panel (library.html#<id>): one figure in a panel over the grid, a full sheet on a phone. Uses the
   library's tokens. */
.dwrap { position: fixed; inset: 0; z-index: 4; display: grid; grid-template-columns: minmax(0, 1fr) min(860px, 100%); }
.dwrap[hidden] { display: none; }
.dscrim { background: var(--scrim); }
.dpanel { position: relative; overflow-y: auto; overscroll-behavior: contain; background: var(--bg);
  box-shadow: var(--glass-shadow); padding: 0 56px calc(112px + env(safe-area-inset-bottom)); }
.dbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 64px; margin: 0 -8px; padding: 0 0 0 8px; background: var(--bg); }
.dgroup { font-size: 13px; color: var(--faint); }
.dx { width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--soft); cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.dx:hover { background: var(--hover); color: var(--ink); }
.dmain { padding-top: 16px; min-width: 0; }

.dmain h2#dtitle { font-size: 28px; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
.dmsg { margin-top: 12px; font-size: 16px; line-height: 1.55; color: var(--soft); max-width: 48ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags span { height: 24px; padding: 0 10px; display: inline-flex; align-items: center; background: var(--hover); border-radius: 999px;
  font-size: 13px; color: var(--soft); }
.tags .fpage { margin-left: 4px; display: inline-flex; align-items: center; height: 24px; font-size: 13px; color: var(--soft);
  text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.tags .fpage:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* tabs: quiet text tabs on a hairline, the chosen one underlined in ink */
.dhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 40px; }
.dtabs { display: flex; gap: 24px; }
/* the style switch: the dock's Style, for this panel; a locked style carries a quiet lock and Pro */
.dstyle { display: flex; gap: 2px; }
.dstyle button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; cursor: pointer; font-size: 13px; color: var(--soft);
  display: inline-flex; align-items: center; gap: 6px; }
.dstyle button:hover { color: var(--ink); background: var(--hover); }
.dstyle button[aria-pressed="true"] { color: var(--ink); background: var(--hover); }
.specs .pro { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--faint); vertical-align: -1px; }
.specs .pro i { font-size: 13px; }
.dtabs button { height: 38px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: none; cursor: pointer;
  font-size: 14px; color: var(--soft); }
.dtabs button:hover { color: var(--ink); }
.dtabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.pane { padding-top: 24px; }
.pane[hidden] { display: none; }
.pane .btns { margin-top: 24px; }

.use { display: grid; gap: 16px; }
.use div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; }
.use dt { color: var(--soft); font-size: 13px; line-height: 22px; }
.use dd { font-size: 15px; line-height: 1.5; color: var(--ink); }

/* the code: the website's "yours" box */
.code { border-radius: 12px; background: var(--hover); min-width: 0; }
.cbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 16px; font-size: 13px; color: var(--faint); }
.copy { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 13px; color: var(--faint);
  display: inline-flex; align-items: center; gap: 6px; }
.copy:hover, .copy.done { color: var(--ink); background: var(--hover); }
.copy i { font-size: 14px; }
.code pre { margin: 0; padding: 12px 18px 18px; overflow: auto; font: 400 11px/1.7 var(--mono); color: var(--soft); white-space: pre-wrap; word-break: break-all; }
.copy[hidden], .cpro[hidden] { display: none; }
.cpro { margin: 0; padding: 12px 18px 18px; font-size: 14px; line-height: 1.5; color: var(--soft); }
.cpro a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cpro a:hover { color: var(--soft); }
.code .t-k { color: var(--ink); }
.code .t-a { color: var(--soft); }
.code .t-s { color: var(--ink); opacity: .78; }
.code .t-p { color: var(--faint); }

.dsec { margin-top: 56px; }
.dsec h3 { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.dsec ul { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.dsec li, .dsec p { font-size: 14px; line-height: 1.55; color: var(--soft); }
.dsec p { margin-top: 12px; max-width: 60ch; }
.dsec strong { font-weight: 500; color: var(--ink); }
.dsec .vary { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.dsec .vary:hover { text-decoration-color: var(--ink); }

.specs { margin-top: 48px;
  display: flex; flex-wrap: wrap; gap: 12px 32px; font: 400 11px/1.4 var(--mono); }
.specs dt { color: var(--faint); }
.specs dd { color: var(--ink); }

.pn { margin-top: 48px; display: flex; justify-content: space-between; gap: 16px; }
.pn a { display: grid; grid-template-columns: auto; gap: 2px; text-decoration: none; font-size: 15px; color: var(--ink); max-width: 48%; }
.pn a span { font-size: 13px; line-height: 1.4; color: var(--soft); }
.pn a i { display: none; }
.pn .next { text-align: right; margin-left: auto; }
.pn a:hover { color: var(--soft); }

@media (max-width: 900px) {
  .dwrap { grid-template-columns: minmax(0, 1fr); }
  .dscrim { display: none; }
  .dpanel { box-shadow: none; padding: 0 24px calc(112px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .dpanel { padding: 0 20px calc(104px + env(safe-area-inset-bottom)); }
  .use div { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
}
