/* The docs site's own layout; everything else comes from ui.css. */
html { scroll-padding-top: 24px; }
body { overflow: hidden; }
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100dvh; }
.side {
  display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px 10px;
  border-right: 1px solid var(--ui-border); background: var(--ui-bg);
}
.brand { padding: 2px 4px; gap: 8px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--ui-fg); letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: var(--ui-accent); position: relative; }
.mark::after { content: ""; position: absolute; inset: 4px 5px 5px; border: 2px solid #fff; border-top: 0; border-radius: 0 0 5px 5px; }
.search { justify-content: flex-start; width: 100%; color: var(--ui-fg-3); font-weight: 400; gap: 4px; }
#nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
#nav details { margin-bottom: 6px; }
#nav summary {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px; list-style: none; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--ui-fg-3); border-radius: var(--ui-radius-sm); user-select: none;
}
#nav summary::-webkit-details-marker { display: none; }
#nav summary::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: -45deg; margin-left: 2px; transition: rotate var(--ui-fast) var(--ui-ease); }
#nav details[open] > summary::after { rotate: 45deg; }
#nav summary:hover { color: var(--ui-fg-2); }
#nav summary .count { margin-left: auto; order: 2; font-variant-numeric: tabular-nums; }
#nav ul { list-style: none; padding: 0; margin: 2px 0 0; display: grid; gap: 1px; }
#nav a {
  display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: var(--ui-radius);
  color: var(--ui-fg-2); font-weight: 500;
}
#nav a:hover { background: var(--ui-bg-2); color: var(--ui-fg); text-decoration: none; }
#nav a[aria-current="page"] { background: var(--ui-bg-3); color: var(--ui-fg); }
#nav a .badge { height: 16px; padding: 0 4px; font-size: 10px; margin-left: auto; }
#nav li.new a::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-accent); margin-left: auto; animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { opacity: .2; } }
.side-foot { gap: 8px; padding: 8px 4px 2px; border-top: 1px solid var(--ui-border); }
.side-foot .tabs, .side-foot .tablist { width: 100%; }
.side-foot .tablist > label { flex: 1; justify-content: center; }

.main { min-width: 0; min-height: 0; overflow-y: auto; }
.top { position: sticky; top: 0; z-index: 5; height: 48px; padding: 0 8px; border-bottom: 1px solid var(--ui-border); background: color-mix(in srgb, var(--ui-bg) 85%, transparent); backdrop-filter: blur(8px); }
.page { max-width: 820px; margin: 0 auto; padding: 40px 32px 96px; outline: none; }
.page > header { margin-bottom: 24px; }
.page > header h1 { display: flex; align-items: center; gap: 10px; }
.page > header p { margin-top: 6px; font-size: 15px; color: var(--ui-fg-2); max-width: 62ch; }
.doc { display: grid; gap: 12px; max-width: 70ch; }
.doc h2 { margin-top: 20px; }
.doc h3 { margin-top: 12px; }
.doc ul, .doc ol { display: grid; gap: 4px; }
.doc table { font-size: var(--ui-text); }
.doc .table-wrap { margin: 4px 0; }

.example { border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); overflow: hidden; margin-bottom: 24px; }
.example > .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--ui-border); background: var(--ui-bg); }
.example > .bar .title { font-size: 12px; color: var(--ui-fg-3); font-weight: 500; }
.example > .stage { padding: 24px; background: var(--ui-bg); display: grid; gap: 14px; }
.example > .stage[data-theme] { background: var(--ui-bg); }
.example > pre { margin: 0; border: 0; border-top: 1px solid var(--ui-border); border-radius: 0; max-height: 320px; font-size: 12px; background: var(--ui-bg-2); }
.example > pre[hidden] { display: none; }
.sink-item { margin-bottom: 40px; }
.sink-item > h2 { margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.sink-item > h2 a { color: inherit; }

.hero { padding: 8px 0 24px; }
.hero h1 { font-size: 32px; letter-spacing: -0.03em; }
.hero p { font-size: 16px; color: var(--ui-fg-2); margin-top: 8px; max-width: 56ch; }
.cats { margin-top: 28px; }
.cats .card header { font-size: 13px; }
.cats .card p { font-size: 12px; }

.editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 24px; }
.editor .controls { display: grid; gap: 14px; position: sticky; top: 16px; }
.editor .controls .field label { display: flex; justify-content: space-between; }
.editor .controls output { color: var(--ui-fg-3); font-variant-numeric: tabular-nums; font-weight: 400; }
.editor .preview { border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); padding: 20px; display: grid; gap: 14px; }

.tokens td:first-child { font-family: var(--ui-mono); font-size: 12px; white-space: nowrap; }
.tokens td:nth-child(2) { font-family: var(--ui-mono); font-size: 12px; color: var(--ui-fg-2); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--ui-border-strong); vertical-align: -3px; margin-right: 6px; }

.palette { padding: 0; width: min(560px, calc(100vw - 32px)); margin: 12vh auto auto; border: 1px solid var(--ui-border-strong); border-radius: 12px; background: var(--ui-bg); color: var(--ui-fg); box-shadow: var(--ui-shadow-lg); }
.palette::backdrop { background: rgb(0 0 0 / .45); }
.palette input { height: 44px; border: 0; border-bottom: 1px solid var(--ui-border); border-radius: 0; padding: 0 14px; font-size: 14px; box-shadow: none; }
.palette input:focus { box-shadow: none; border-color: var(--ui-border); }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: var(--ui-radius); color: var(--ui-fg); }
.palette li a:hover, .palette li[aria-selected="true"] a { background: var(--ui-bg-3); text-decoration: none; }
.palette li small { color: var(--ui-fg-3); margin-left: auto; white-space: nowrap; }
.palette .none { padding: 16px; color: var(--ui-fg-3); }

.toast { position: fixed; right: 16px; bottom: 16px; z-index: 20; padding: 10px 14px; border-radius: var(--ui-radius); background: var(--ui-bg-3); border: 1px solid var(--ui-border-strong); box-shadow: var(--ui-shadow-lg); }
.problems { margin-bottom: 20px; }

.only-mobile { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30; translate: -100% 0; transition: translate var(--ui-slow) var(--ui-ease); box-shadow: var(--ui-shadow-lg); }
  .side.open { translate: 0 0; }
  .only-mobile { display: flex; }
  .page { padding: 24px 16px 80px; }
  .editor { grid-template-columns: 1fr; }
  .editor .controls { position: static; }
  .example > .stage { padding: 16px; }
  .example > .bar .title { display: none; }
  .example > .bar .spacer { display: none; }
}
