/* CarterWare Docs — layout on top of site.css (tokens.css first). */
.shell.shell-wide { max-width: 76rem; }

.docs { display: grid; gap: 1.5rem; padding-top: .25rem; }
@media (min-width: 960px) {
  .docs { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 2.75rem; }
}
@media (min-width: 1200px) {
  .docs { grid-template-columns: 13.5rem minmax(0, 42rem) 12rem; justify-content: space-between; }
}

/* Sidebar */
.docs-side { min-width: 0; }
@media (min-width: 960px) {
  .docs-side { position: sticky; top: 5.25rem; align-self: start; max-height: calc(100vh - 6.5rem); overflow-y: auto; scrollbar-width: thin; padding-bottom: 1rem; }
}
.docs-search input {
  width: 100%; font: inherit; color: var(--cw-text);
  background: rgba(255,255,255,.05); border: 1px solid var(--cw-border); border-radius: 12px;
  padding: .62rem .85rem; outline: none; transition: border-color .15s, background .15s;
}
.docs-search input::placeholder { color: rgba(201,165,171,.7); }
.docs-search input:focus { border-color: rgba(255,122,144,.55); background: rgba(255,255,255,.07); }
.docs-search input::-webkit-search-cancel-button { filter: invert(.7); }

.docs-nav { margin-top: .85rem; border: 1px solid var(--cw-border); border-radius: 14px; background: rgba(255,255,255,.025); }
.docs-nav > summary {
  list-style: none; cursor: pointer; padding: .7rem .95rem; font-weight: 600; font-size: .92rem;
  display: flex; align-items: center; justify-content: space-between;
}
.docs-nav > summary::-webkit-details-marker { display: none; }
.docs-nav > summary::after {
  content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--cw-muted); border-bottom: 2px solid var(--cw-muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.docs-nav[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.docs-nav nav { padding: 0 .55rem .7rem; }
@media (min-width: 960px) {
  .docs-nav { border: 0; background: none; margin-top: 1.1rem; }
  .docs-nav > summary { display: none; }
  .docs-nav nav { padding: 0; }
}
.docs-nav-label {
  margin: .9rem .4rem .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #ff8fa0;
}
.docs-nav-label:first-child { margin-top: .2rem; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a {
  display: block; padding: .36rem .55rem; border-radius: 9px; font-size: .92rem;
  color: var(--cw-muted) !important;
}
.docs-nav li a:hover { color: var(--cw-text) !important; background: rgba(255,255,255,.045); }
.docs-nav li a[aria-current="page"] { color: var(--cw-text) !important; background: var(--cw-accent-soft); font-weight: 600; }

/* Article */
.docs-main { min-width: 0; }
.docs-header { padding: .35rem 0 1.25rem; border-bottom: 1px solid var(--cw-border); margin-bottom: .5rem; }
.docs-header h1 {
  font-family: var(--cw-font-display); font-size: clamp(1.75rem, 4.2vw, 2.4rem); line-height: 1.08;
  letter-spacing: -.035em; margin: .15rem 0 0; text-wrap: balance;
}
.docs-header .lede { color: var(--cw-muted); font-size: 1.06rem; margin: .8rem 0 0; max-width: 38rem; }
.docs-head { display: flex; align-items: center; gap: 1rem; }
.docs-head-icon { width: 64px; height: 64px; border-radius: 15px; flex-shrink: 0; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.docs-head .breadcrumb { margin: 0; }
.docs-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; }
.docs-chips span {
  font-size: .8rem; color: var(--cw-muted); background: rgba(255,255,255,.05);
  border: 1px solid var(--cw-border); border-radius: 999px; padding: .22rem .65rem;
}
.docs-chips span:first-child { color: #ffd3da; background: var(--cw-accent-soft); border-color: rgba(228,0,43,.35); }
.docs-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.docs-actions .btn { padding: .55rem .9rem; font-size: .88rem; border-radius: 10px; }

.docs-body { max-width: none; font-size: 1.02rem; line-height: 1.7; }
.docs-body > h2 {
  scroll-margin-top: 5.5rem; margin: 2.75rem 0 .6rem; font-size: 1.5rem; color: var(--cw-text);
  letter-spacing: -.03em; line-height: 1.2;
}
.docs-body > h2::before {
  content: ""; display: block; width: 1.75rem; height: 3px; border-radius: 3px;
  background: var(--cw-accent); margin-bottom: .7rem;
}
.docs-body > h2:first-child { margin-top: 1.5rem; }
.docs-body h3 { scroll-margin-top: 5.5rem; font-size: 1.12rem; margin-top: 1.9rem; }
.docs-body p { color: #dcc3c7; }
.docs-body li { color: #dcc3c7; }
.docs-body ol { counter-reset: step; list-style: none; padding-left: 0; }
.docs-body ol > li { counter-increment: step; position: relative; padding-left: 2.1rem; margin: .55rem 0; }
.docs-body ol > li::before {
  content: counter(step); position: absolute; left: 0; top: .12rem;
  width: 1.45rem; height: 1.45rem; border-radius: 50%; display: grid; place-items: center;
  font-size: .78rem; font-weight: 600; color: #fff; background: rgba(228,0,43,.55);
}
.docs-body blockquote {
  margin: 1.2rem 0; padding: .8rem 1rem; border-radius: 12px;
  background: rgba(255,210,125,.06); border: 1px solid rgba(255,210,125,.2); border-left-width: 3px;
}
.docs-body blockquote p { margin: .2rem 0; color: #f3dfc0; }
.docs-body blockquote strong { color: #ffd27d; }

/* Settings reference */
.doc-settings { margin-top: 1rem; }
.doc-set-group {
  margin: 1.1rem 0; padding: .35rem 1.1rem .6rem; border: 1px solid var(--cw-border);
  border-radius: 16px; background: rgba(255,255,255,.022);
}
.doc-set-group h3 { margin: .75rem 0 .2rem; font-size: 1rem; }
.doc-set-foot { font-size: .9rem; margin: .35rem 0 .5rem; opacity: .9; }
.doc-set-group dl { margin: .35rem 0 0; }
.doc-set { padding: .7rem 0; border-top: 1px solid var(--cw-border); }
.doc-set:first-child { border-top: 0; }
.doc-set dt { font-weight: 600; color: var(--cw-text); }
.doc-set dd { margin: .15rem 0 0; }
.doc-set-type {
  display: inline-block; font-size: .76rem; letter-spacing: .01em; color: #ffb3c0;
  background: rgba(228,0,43,.12); border-radius: 6px; padding: .08rem .45rem;
}
.doc-set dd p { margin: .35rem 0 0; font-size: .95rem; }

/* Footer + pager */
.docs-foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--cw-border); }
.docs-foot > p { color: var(--cw-muted); font-size: .9rem; margin: 0 0 1.25rem; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.docs-pager a {
  display: block; padding: .8rem 1rem; border: 1px solid var(--cw-border); border-radius: 14px;
  color: var(--cw-text) !important; font-weight: 600; transition: border-color .15s, background .15s;
}
.docs-pager a:hover { border-color: rgba(255,122,144,.45); background: rgba(255,255,255,.03); }
.docs-pager a span { display: block; font-size: .75rem; font-weight: 500; color: var(--cw-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .15rem; }
.docs-pager .next { text-align: right; grid-column: 2; }

/* On this page */
.docs-toc { display: none; }
@media (min-width: 1200px) {
  .docs-toc { display: block; position: sticky; top: 5.25rem; align-self: start; font-size: .86rem; }
  .docs-toc p { margin: .4rem 0 .5rem; font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--cw-muted); }
  .docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--cw-border); }
  .docs-toc a { display: block; padding: .28rem 0 .28rem .8rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--cw-muted) !important; }
  .docs-toc a:hover { color: var(--cw-text) !important; }
  .docs-toc a.active { color: var(--cw-text) !important; border-left-color: var(--cw-accent); }
}

/* Index */
.docs-index { max-width: 58rem; margin: 0 auto; }
.docs-hero h1 { font-family: var(--cw-font-display); font-size: clamp(2rem, 5.5vw, 3rem); letter-spacing: -.04em; line-height: 1.04; margin: 0; }
.docs-hero .lede { color: var(--cw-muted); font-size: 1.08rem; max-width: 34rem; margin: .8rem 0 0; }
.docs-search-hero { position: relative; margin-top: 1.5rem; max-width: 36rem; }
.docs-search-hero svg { position: absolute; left: .95rem; top: 50%; width: 1.05rem; height: 1.05rem; transform: translateY(-50%); color: var(--cw-muted); pointer-events: none; }
.docs-search-hero input { padding: .85rem 1rem .85rem 2.6rem; border-radius: 14px; font-size: 1rem; }
.docs-results { max-width: 36rem; margin-top: .6rem; border: 1px solid var(--cw-border); border-radius: 14px; background: var(--cw-panel); overflow: hidden; }
.docs-results a { display: block; padding: .75rem 1rem; border-top: 1px solid var(--cw-border); color: var(--cw-text) !important; }
.docs-results a:first-child { border-top: 0; }
.docs-results a:hover, .docs-results a:focus-visible { background: rgba(255,255,255,.045); outline: none; }
.docs-results small { display: block; font-size: .74rem; color: #ff8fa0; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.docs-results strong { display: block; font-weight: 600; margin: .1rem 0; }
.docs-results span { display: block; font-size: .88rem; color: var(--cw-muted); line-height: 1.45; }
.docs-results mark { background: rgba(228,0,43,.3); color: inherit; border-radius: 3px; padding: 0 .1rem; }
.docs-results .empty { padding: .9rem 1rem; color: var(--cw-muted); margin: 0; }

.docs-group { margin-top: 2.25rem; }
.docs-group h2 { font-family: var(--cw-font-display); font-size: 1.05rem; letter-spacing: -.01em; margin: 0 0 .75rem; color: var(--cw-muted); font-weight: 600; }
.docs-grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }
.docs-card {
  display: flex; align-items: center; gap: .85rem; padding: .85rem .95rem; border-radius: 16px;
  border: 1px solid var(--cw-border); background: rgba(255,255,255,.025); color: var(--cw-text) !important;
  transition: border-color .15s, background .15s, transform .15s;
}
.docs-card:hover { border-color: rgba(255,122,144,.4); background: rgba(255,255,255,.045); transform: translateY(-1px); }
.docs-card img { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; }
.docs-card > span:not(.docs-card-glyph) { min-width: 0; flex: 1; }
.docs-card strong { display: block; font-weight: 600; }
.docs-card em { display: block; font-style: normal; font-size: .86rem; color: var(--cw-muted); line-height: 1.35; margin-top: .1rem; }
.docs-card small { align-self: flex-start; font-size: .72rem; color: var(--cw-muted); background: rgba(255,255,255,.06); border-radius: 999px; padding: .12rem .45rem; }
.docs-card-glyph {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(160deg, #ff3b5c, #b0001f); color: #fff;
}
.docs-card-glyph svg { width: 22px; height: 22px; }
.docs-ai { margin: 2.5rem 0 0; color: var(--cw-muted); font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
  .docs-card, .docs-nav > summary::after { transition: none; }
  .docs-card:hover { transform: none; }
}
