/* The docs and 404 pages. They load home.css first (tokens, nav, footer, buttons, the
   palette), then this. */

/* ---------- Reading progress (docs) ---------- */

.read-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--blue), var(--cyan));
  box-shadow: 0 0 12px rgba(69, 212, 255, 0.6);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* ---------- Docs layout ---------- */

.docs-main {
  position: relative;
  isolation: isolate;
}

.docs-main:focus {
  outline: none;
}

.docs-glow {
  position: absolute;
  inset: 0 0 auto;
  height: 900px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 78% 0%, rgba(61, 110, 240, 0.22), transparent 70%),
    radial-gradient(35% 45% at 12% 8%, rgba(155, 140, 255, 0.12), transparent 70%);
}

.docs-glow::after {
  /* the hero's grid, faded into the top of the page */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91, 140, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 140, 255, 0.09) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 60% 0%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 60% 0%, black, transparent 75%);
}

.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  padding: 148px 0 120px;
}

/* ---------- Contents ---------- */

.doc-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.doc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  margin-bottom: 28px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.doc-search:hover {
  border-color: rgba(91, 140, 255, 0.5);
  background: rgba(91, 140, 255, 0.07);
  color: var(--text);
}

.doc-search svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.doc-search span {
  flex: 1;
}

.doc-search kbd {
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--dim);
  font-size: 11px;
}

.toc-title {
  margin-bottom: 12px;
  color: var(--dim);
  font: 600 11.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-toc a {
  position: relative;
  display: block;
  padding: 6px 0 6px 14px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s;
}

.doc-toc a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  opacity: 0;
  transform: scaleY(0.3);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.doc-toc a:hover {
  color: var(--text);
}

.doc-toc a[aria-current] {
  color: var(--text);
}

.doc-toc a[aria-current]::before {
  opacity: 1;
  transform: none;
}

.doc-toc li.in-view > a {
  color: var(--text);
}

.doc-toc ul ul {
  margin: 2px 0 8px 14px;
  border-left: 1px solid var(--line);
}

.doc-toc ul ul a {
  padding-block: 4px;
  font-size: 13.5px;
}

.doc-toc ul ul a::before {
  left: -1px;
}

/* ---------- Docs header ---------- */

.doc-head {
  padding-bottom: 56px;
}

.doc-head h1 {
  font-size: clamp(46px, 6.4vw, 84px);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.doc-head .lede {
  max-width: 58ch;
  margin-top: 20px;
}

.doc-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.doc-body .doc-quick a {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.35s var(--ease), box-shadow 0.35s;
}

.doc-quick a:hover {
  border-color: rgba(91, 140, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -20px rgba(91, 140, 255, 0.6);
}

.doc-quick a::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 16px;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid var(--dim);
  border-right: 1.5px solid var(--dim);
  transform: rotate(45deg);
  transition: border-color 0.2s, transform 0.3s var(--ease);
}

.doc-quick a:hover::after {
  border-color: var(--cyan);
  transform: translateX(3px) rotate(45deg);
}

.doc-quick b {
  font-size: 16px;
  font-weight: 650;
}

.doc-quick span {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}

.doc-body .doc-agents {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: none;
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.doc-agents svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: #93b4ff;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(147, 180, 255, 0.35);
  text-underline-offset: 3px;
}

.linkish:hover {
  color: var(--cyan);
}

/* ---------- Docs body ---------- */

.doc-section {
  position: relative;
  padding-top: 64px;
  margin-top: 72px;
}

.doc-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.5), var(--line) 30%, transparent);
}

.doc-section:first-of-type {
  margin-top: 0;
}

.doc-body h2,
.doc-body h3 {
  position: relative;
  scroll-margin-top: 96px;
}

.doc-body h2 {
  margin-bottom: 20px;
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.doc-body h3 {
  margin: 48px 0 12px;
  font-size: 22px;
}

.anchor {
  position: absolute;
  top: 50%;
  left: -30px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--dim);
  font: 500 15px/1 var(--mono);
  text-decoration: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}

h2:hover > .anchor,
h3:hover > .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.anchor:hover {
  background: rgba(91, 140, 255, 0.14);
  color: var(--cyan);
}

.doc-body p,
.doc-body li {
  color: #b7c1d4;
  font-size: 16.5px;
  line-height: 1.75;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  max-width: 74ch;
}

.doc-body p {
  margin: 0 0 16px;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body li::marker {
  color: var(--dim);
}

.doc-body strong {
  color: var(--text);
  font-weight: 650;
}

.doc-body a {
  color: #93b4ff;
  text-decoration-color: rgba(147, 180, 255, 0.35);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.doc-body a:hover {
  color: var(--cyan);
  text-decoration-color: currentColor;
}

.doc-body :not(pre) > code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(148, 163, 196, 0.08);
  color: #dbe6ff;
  font-size: 0.86em;
}

.doc-body td code,
.doc-body li code,
.doc-body p code {
  overflow-wrap: anywhere;
}

/* Every built-in rule */
.rule-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  height: 46px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rule-search:focus-within {
  border-color: rgba(91, 140, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.14);
}

.rule-search svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.rule-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font: 14.5px var(--font);
}

.doc-body .rule-count,
.doc-body .rule-loading {
  margin: 12px 0 4px;
  color: var(--dim);
  font-size: 13.5px;
}

.rule-group {
  margin-top: 22px;
}

.rule-group h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 15px;
}

.rule-group h4 span {
  margin-left: 6px;
  color: var(--dim);
  font: 500 12px var(--mono);
}

.rule-group .rule {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) 74px 44px;
  gap: 14px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.rule-try {
  justify-self: end;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: transparent;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
}

.rule-try:hover {
  border-color: rgba(69, 212, 255, 0.55);
  background: rgba(69, 212, 255, 0.08);
}

/* The rule a link (docs.html#rule=<name>) points at. */
.rule-group .rule.hit {
  border-radius: 8px;
  background: rgba(69, 212, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(69, 212, 255, 0.45);
}

.rule-group .rule code {
  justify-self: start;
  overflow-wrap: anywhere;
  color: #dbe6ff;
  font-size: 12.5px;
}

.rule-group .rule > span:nth-child(2) {
  color: #b7c1d4;
}

.rule-group .rule .lvl {
  justify-self: end;
  padding: 2px 8px;
  border-radius: 999px;
  font: 600 11px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lvl.database {
  background: rgba(255, 77, 99, 0.12);
  color: #ff8c9a;
}

.lvl.ask {
  background: rgba(155, 140, 255, 0.14);
  color: #c3b9ff;
}

.lvl.warn {
  background: rgba(255, 181, 71, 0.12);
  color: #ffd38a;
}

@media (max-width: 640px) {
  .rule-group .rule {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
  }

  .rule-group .rule > span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  /* Try (or its empty place) beside the description, under the level. */
  .rule-group .rule > :nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
}

.doc-body code.copyable {
  cursor: copy;
  transition: border-color 0.2s, background 0.2s;
}

.doc-body code.copyable:hover {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(91, 140, 255, 0.12);
}

.code {
  position: relative;
  margin: 18px 0 22px;
}

.doc-body pre {
  margin: 18px 0 22px;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: linear-gradient(180deg, #0a0f1b, #070a12);
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #cfe0ff;
  font-size: 13.5px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.code pre {
  margin: 0;
  padding-right: 84px;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(14, 19, 32, 0.9);
  color: var(--muted);
  font: 500 12px/1 var(--mono);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}

.code:hover .copy,
.copy:focus-visible,
.copy[data-done] {
  opacity: 1;
}

.copy:hover {
  border-color: rgba(91, 140, 255, 0.5);
  color: var(--text);
}

.copy[data-done] {
  border-color: rgba(61, 220, 151, 0.5);
  color: var(--green);
}

@media (hover: none) {
  .copy {
    opacity: 1;
  }
}

/* Light shell coloring, added by home.js: comments, flags, strings, the rollcage command. */
.doc-body pre .c {
  color: var(--dim);
}

.doc-body pre .f {
  color: #b7a9ff;
}

.doc-body pre .s {
  color: #9be7c4;
}

.doc-body pre .k {
  color: var(--cyan);
}

.doc-body table {
  display: block;
  max-width: 100%;
  margin: 20px 0 26px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
}

.doc-body th,
.doc-body td {
  padding: 12px 18px 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  border-bottom-color: var(--line-2);
  color: var(--dim);
  font: 600 11.5px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-body td {
  color: #b7c1d4;
  line-height: 1.6;
}

.doc-body tr {
  transition: background 0.2s;
}

.doc-body tbody tr:hover {
  background: rgba(91, 140, 255, 0.04);
}

.doc-body td:first-child code {
  white-space: nowrap;
}

.doc-body blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid rgba(255, 181, 71, 0.22);
  border-left: 3px solid var(--amber);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 181, 71, 0.06);
}

.doc-body blockquote p {
  margin: 0;
  color: #f1dcbb;
}

/* A search hit, flashed where the palette sent you. */
mark.doc-hit {
  border-radius: 4px;
  background: rgba(255, 181, 71, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.35);
  color: #fff;
  animation: hit 2.6s var(--ease) forwards;
}

@keyframes hit {
  0%,
  60% {
    background: rgba(255, 181, 71, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.35);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 3px transparent;
  }
}

.doc-fab {
  display: none;
}

/* Palette: a search hit's surrounding words, under the section's name. */
.palette-item.has-snip {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.palette-item.has-snip small {
  margin-left: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: normal;
}

.palette-item small mark {
  border-radius: 3px;
  background: rgba(255, 181, 71, 0.25);
  color: var(--text);
}

@media (max-width: 960px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 120px;
  }

  .doc-toc {
    display: none;
  }

  .doc-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-fab {
    position: fixed;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 18px 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: rgba(14, 19, 32, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(91, 140, 255, 0.15);
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
  }

  .doc-fab svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .anchor {
    display: none;
  }
}

@media (max-width: 640px) {
  .doc-quick {
    gap: 10px;
    margin-top: 32px;
  }

  .doc-body .doc-quick a {
    padding: 14px 14px 16px;
  }

  .doc-quick a::after {
    display: none;
  }

  .doc-body table,
  .doc-body tbody,
  .doc-body tr,
  .doc-body td {
    display: block;
  }

  .doc-body thead {
    display: none;
  }

  .doc-body tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .doc-body td {
    padding: 2px 0;
    border: 0;
  }

  .doc-body td:first-child {
    color: var(--text);
    font-weight: 600;
  }

  .doc-body td:first-child code {
    white-space: normal;
  }
}

/* ---------- 404 ---------- */

.lost {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 120px 16px 80px;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.lost::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto;
  height: 110%;
  z-index: -2;
  background:
    radial-gradient(45% 45% at 50% 40%, rgba(61, 110, 240, 0.26), transparent 70%),
    radial-gradient(30% 35% at 20% 15%, rgba(155, 140, 255, 0.14), transparent 70%),
    radial-gradient(30% 35% at 80% 85%, rgba(255, 77, 99, 0.1), transparent 70%);
}

.lost::after {
  content: "";
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 50%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(91, 140, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 140, 255, 0.16) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(600px) rotateX(62deg);
  transform-origin: top;
  mask-image: linear-gradient(to bottom, transparent, black 30%, black 55%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 55%, transparent 95%);
}

.lost-brand {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.lost-brand .logo {
  width: 130px;
  height: auto;
}

.lost-code {
  font: 800 clamp(110px, 22vw, 240px)/0.9 var(--font);
  letter-spacing: -0.06em;
  background: linear-gradient(180deg, #ffffff 10%, #7aa2ff 60%, rgba(69, 212, 255, 0.15) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 20px 60px rgba(61, 110, 240, 0.45));
  animation: rise 1s var(--ease) both;
}

.lost h1 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 44px);
  animation: rise 1s var(--ease) 0.08s both;
}

.lost-term {
  width: min(520px, 100%);
  margin: 28px auto 32px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(7, 10, 18, 0.85);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  text-align: left;
  animation: rise 1s var(--ease) 0.18s both;
}

.lost-term-bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.lost-term-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
}

.lost-term pre {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  color: #cfe0ff;
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}

.lost-term .p {
  color: var(--green);
}

.lost-term .no {
  color: var(--red);
}

.lost-term .ok {
  color: var(--green);
}

.lost-term .dim {
  color: var(--dim);
}

.lost-guess {
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: 17px;
  animation: rise 1s var(--ease) 0.24s both;
}

.lost-guess a {
  color: var(--cyan);
  font-weight: 600;
  text-underline-offset: 3px;
}

.lost-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  animation: rise 1s var(--ease) 0.28s both;
}

/* ---------- Printing the docs (or saving them as a PDF) ---------- */

@media print {
  :root {
    color-scheme: light;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
  }

  body::after,
  .nav,
  .doc-toc,
  .doc-fab,
  .docs-glow,
  .read-progress,
  .doc-quick,
  .doc-agents,
  .rule-search,
  .copy,
  .anchor,
  .foot,
  .toast,
  .palette,
  .skip {
    display: none !important;
  }

  .docs {
    display: block;
    width: auto;
    padding: 0;
  }

  .doc-head h1,
  .doc-body h2,
  .doc-body h3,
  .doc-body h4,
  .doc-body strong,
  .doc-body p,
  .doc-body li,
  .doc-body td,
  .doc-body th,
  .doc-body .lede,
  .rule-group .rule > span {
    color: #111 !important;
  }

  .grad {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    color: #111;
  }

  .kicker {
    color: #555;
  }

  .doc-body :not(pre) > code,
  .rule-group .rule code {
    border-color: #ccc;
    background: #f3f3f3;
    color: #111;
  }

  .doc-body pre,
  .code pre {
    border-color: #ccc;
    background: #f6f6f6;
    box-shadow: none;
    color: #111;
    padding-right: 18px;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .doc-body pre span {
    color: inherit !important;
  }

  .doc-body a {
    color: #111;
    text-decoration: underline;
  }

  .doc-section {
    margin-top: 28px;
    padding-top: 20px;
  }

  .doc-section::before {
    background: #ccc;
  }

  .doc-body h2,
  .doc-body h3 {
    break-after: avoid;
  }

  .doc-body pre,
  .doc-body tr,
  .rule-group .rule {
    break-inside: avoid;
  }

  .rule-try {
    display: none;
  }

  .doc-body th,
  .doc-body td,
  .rule-group .rule {
    border-color: #ddd;
  }

  .lvl.database,
  .lvl.ask,
  .lvl.warn {
    background: none;
    color: #111;
    border: 1px solid #999;
  }
}

/* ---------- Playground ---------- */
.play-main {
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
}

.play-head {
  max-width: 760px;
  margin-bottom: 32px;
}

.play-head h1 {
  margin: 10px 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  overflow: hidden;
}

.play-files {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #04070d;
}

.play-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.play-tabs {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.play-tabs [role="tab"] {
  flex: none;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 12.5px var(--mono);
}

.play-tabs [role="tab"]:hover {
  color: var(--text);
}

.play-tabs [role="tab"][aria-selected="true"] {
  background: rgba(69, 212, 255, 0.12);
  color: #e6f7ff;
}

.play-tools {
  display: flex;
  flex: none;
  gap: 14px;
}

.play-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.play-editor {
  flex: 1;
  min-height: 440px;
  padding: 18px 20px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: #d9e1f0;
  font: 13px/1.7 var(--mono);
  tab-size: 2;
  white-space: pre;
}

.play-files:has(.play-editor:focus-visible) {
  box-shadow: inset 0 0 0 2px rgba(91, 140, 255, 0.55);
}

.play-path {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font: 12px var(--mono);
}

.play-run {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 24px;
}

.play-cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #060911;
  font: 14px var(--mono);
}

.play-cmd > span {
  color: var(--green);
}

.play-cmd input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
}

.play-cmd:has(input:focus-visible) {
  border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

.play-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.play-chips button {
  max-width: 100%;
  padding: 5px 10px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 12px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-chips button:hover {
  color: var(--text);
}

.play-chips button[aria-pressed="true"] {
  border-color: rgba(69, 212, 255, 0.55);
  background: rgba(69, 212, 255, 0.1);
  color: #e6f7ff;
}

.play-out {
  display: grid;
  gap: 16px;
}

/* The command is in the box above: no second copy of it. */
.play-out .xray-cmd {
  display: none;
}

.play-detail {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12.5px;
}

.verdict[data-kind="none"] .verdict-icon {
  background: rgba(148, 163, 196, 0.1);
  color: var(--muted);
}

.play-run .xray-foot {
  margin-top: auto;
}

.play-ideas {
  margin-top: 56px;
}

.play-ideas h2 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.play-ideas > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.play-idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.play-idea {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s, transform 0.25s var(--ease);
}

.play-idea:hover {
  border-color: rgba(69, 212, 255, 0.45);
  transform: translateY(-2px);
}

.play-idea b {
  font-size: 16px;
}

.play-idea span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.play-idea code {
  margin-top: auto;
  overflow: hidden;
  color: #e6f7ff;
  font: 12px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .play {
    grid-template-columns: minmax(0, 1fr);
  }

  .play-files {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .play-editor {
    min-height: 300px;
  }

  .play-main {
    padding-top: 96px;
  }
}

.play-main:focus {
  outline: none;
}
