/* --------------------------------------------------------------------------
   Freebuff UI layer — product components applied to documentation.
   Loaded on every page after main.css.
   -------------------------------------------------------------------------- */

/* One icon set: a sprite in the shell, drawn with currentColor.
   Slot sizes live in main.css; this only sets the baseline. */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.pager-dir {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pager-dir .icon {
  width: 14px;
  height: 14px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.chip-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.ui-tabs {
  margin: 0 0 18px;
}

.ui-tablist {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 10px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-inset);
}

.ui-tablist button {
  padding: 6px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}

.ui-tablist button[aria-selected="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.ui-tablist button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 1px;
}

.ui-tabpanel[hidden] {
  display: none;
}

.code-block {
  position: relative;
  margin: 0 0 20px;
}

.code-block pre {
  margin: 0;
}

.code-copy {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.code-copy.is-done {
  border-color: var(--accent-line);
  color: var(--accent-text);
  opacity: 1;
}

.ui-spec {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
}

.ui-spec b {
  color: var(--text);
  font-weight: 600;
}

.ui-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.ui-grid > li,
.ui-grid > div {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.ui-grid strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
}

.ui-grid code {
  white-space: normal;
}

/* Composer-shaped search surfaces: same white card, soft radius, quiet shadow. */
.search-trigger,
.hero-search {
  background: var(--bg-elevated);
  box-shadow: none;
}

.search-trigger:hover,
.hero-search:hover {
  border-color: var(--border-strong);
}

.article kbd {
  vertical-align: 1px;
}

@media (max-width: 560px) {
  .code-copy {
    opacity: 1;
  }
}
