/* The detail view (library.html#<id>): a sticky rail of every figure, then one figure in a single column. Uses the
   gallery's tokens and its nav.index rail styles. */
.dwrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 56px; }
.dwrap[hidden], .wrap[hidden] { display: none; }
nav.index.drail { padding-top: 56px; padding-bottom: 40px; max-height: 100vh; overflow-y: auto; scrollbar-width: none; }
.dpick { display: none; }
.dmain { padding: 56px 0 24px; min-width: 0; max-width: 760px; }

.crumb { display: flex; gap: 8px; font-size: 13px; color: var(--faint); }
.crumb a { color: var(--soft); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.dmain h1 { margin-top: 16px; font-size: 36px; font-weight: 500; line-height: 1.15; letter-spacing: -0.025em; }
.dmsg { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--soft); max-width: 48ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags span { height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--rule-2); border-radius: 999px;
  font-size: 12px; color: var(--soft); }

/* tabs: quiet text tabs on a hairline, the chosen one underlined in ink */
.dtabs { display: flex; gap: 20px; margin-top: 32px; border-bottom: 1px solid var(--rule); }
.dtabs button { height: 38px; margin-bottom: -1px; 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: 20px; }
.pane[hidden] { display: none; }
.pane .btns { margin-top: 16px; }

.use { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.use div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.use dt { color: var(--faint); font: 500 11px/22px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.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 18px; font-size: 12px; color: var(--faint); }
.copy { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 12px; 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 12px/1.7 var(--mono); color: var(--soft); white-space: pre-wrap; word-break: break-all; }
.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: 48px; }
.dsec h2 { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.dsec ul { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.dsec li, .dsec p { font-size: 14px; line-height: 1.55; color: var(--soft); }
.dsec p { margin-top: 10px; max-width: 60ch; }
.dsec strong { font-weight: 500; color: var(--ink); }

.specs { margin-top: 40px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 10px 32px; font: 400 12px/1.4 var(--mono); }
.specs dt { color: var(--faint); }
.specs dd { color: var(--ink); }

.pn { margin-top: 32px; 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: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.pn a i { display: none; }
.pn .next { text-align: right; margin-left: auto; }
.pn a:hover { color: var(--soft); }

/* the list: a quiet link from each figure to its detail view */
.side .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 13px; color: var(--soft); text-decoration: none; }
.side .more:hover { color: var(--ink); }

@media (max-width: 900px) {
  .dwrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  nav.index.drail { display: none; }
  .dpick { display: block; padding-top: 16px; }
  .dpick select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--bg); color: var(--ink); font: 400 14px var(--sans); }
  .dmain { padding-top: 24px; }
}
@media (max-width: 520px) {
  .dwrap { padding: 0 16px; }
  .dmain h1 { font-size: 30px; }
  .use div { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
}

/* the dock's Dots control hides when the detail stage shows another style */
.dock .ctl[hidden] { display: none; }
