/* Docs handbook — same brand system as landing */
@import url("../brand.css");

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
}

.brand {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 0.2rem;
}

.brand span {
  color: var(--accent);
}

.brand:hover {
  text-decoration: none;
  color: var(--ink);
}

.brand-sub {
  margin: 0 0 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-group {
  margin: 1.15rem 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar nav a {
  display: block;
  padding: 0.4rem 0.55rem;
  margin: 0.12rem 0;
  border-radius: var(--radius);
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar nav a:hover {
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
}

.sidebar nav a.active {
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.main {
  padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
  /* Fill the layout's 1fr column; constrain prose separately so cards/rows aren't skinny. */
  max-width: none;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.88rem;
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
}

.topbar a:hover {
  color: var(--accent-2);
}

.main h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 550;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.main h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.85rem;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 56rem;
  margin: 0 0 1.5rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.25rem;
  margin: 1rem 0 1.75rem;
  max-width: 56rem;
  width: 100%;
  box-sizing: border-box;
}

.card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.85rem;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.task-list li {
  margin: 0;
  padding: 0;
  width: 100%;
}

/* Whole row is one control — flex, not nested grids (avoids crushed columns). */
.task-list .task-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.task-list .task-row .n {
  flex: 0 0 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.task-list .task-row .label {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.task-list .task-row .go {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  opacity: 0.85;
}

.task-list .task-row:hover,
.task-list .task-row:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
  text-decoration: none;
  outline: none;
}

.task-list .task-row:hover .label,
.task-list .task-row:focus-visible .label {
  color: var(--accent-2);
}

.task-list .task-row:hover .go,
.task-list .task-row:focus-visible .go {
  opacity: 1;
  color: var(--accent-2);
}

.links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.links li {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.links a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 50%, transparent);
  text-underline-offset: 0.16em;
  color: var(--accent-2);
}

.links a:hover {
  color: #c7ceff;
  text-decoration-color: #c7ceff;
}

.note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.main p {
  color: var(--ink-dim);
  max-width: 56rem;
  margin: 0 0 1rem;
}

.main ul {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  color: var(--ink-dim);
  max-width: 56rem;
}

.main li {
  margin: 0.35rem 0;
}

.main code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent-2);
}

.card ul {
  margin: 0.5rem 0 0;
}

.card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.mono-block {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  background: #050507;
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  display: block;
  overflow-x: auto;
  color: var(--ink-dim);
  margin: 1rem 0;
}

.code-block {
  position: relative;
  margin: 1rem 0;
}

.code-block .mono-block {
  margin: 0;
  padding-top: 2.35rem;
}

.copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.copy-btn.is-copied {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

table.matrix td.pending {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    /* Below this width the ~40-link nav no longer fits as a vertical list
       without pushing all page content below the fold -- turn it into one
       horizontally scrollable strip instead (drag / swipe / trackpad, no
       JS needed) so a reader lands on content immediately and slides the
       nav sideways only when they actually want a different page. */
    padding-bottom: 0.9rem;
  }
  .sidebar nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 0.15rem;
    padding: 0.15rem 1.25rem 0.35rem 0;
    margin: 0 -1rem 0 0;
    /* Fade the right edge so it's visually obvious there's more to scroll to. */
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  }
  .sidebar nav .nav-group {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 0.6rem 0 0.7rem;
    white-space: nowrap;
    position: relative;
  }
  .sidebar nav .nav-group:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0.9rem;
    background: var(--line);
  }
  .sidebar nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0 0.05rem;
  }
  /* Keep a compact jump back to nav when the long sidebar scrolls away. */
  .main .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.65rem 0;
    margin: -0.25rem 0 1.25rem;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
  }
}

.try-visual {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
  align-items: stretch;
}
.flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.flow-card {
  padding: 0.95rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
.flow-card .n {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.flow-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.3rem;
}
.flow-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.try-admin {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
}
.try-admin .cap {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.try-admin img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 860px) {
  .try-visual { grid-template-columns: 1fr; }
}

/* Only force one line when the main column is wide enough to fit the title */
@media (min-width: 1180px) {
  h1.one-line {
    white-space: nowrap;
  }
}

/* Feature guide template */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

.guide-grid section {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.guide-grid h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.guide-grid p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.steps {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  color: var(--ink-dim);
  max-width: 56rem;
}

.steps li {
  margin: 0.55rem 0;
}

.shot {
  margin: 1rem 0 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
}

.shot .cap {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.expect {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  color: var(--ink-dim);
  max-width: 56rem;
}

.expect li {
  margin: 0.45rem 0;
}

.catalog {
  display: grid;
  gap: 0.35rem 1.25rem;
  margin: 0 0 1.75rem;
}

.catalog a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 50%, transparent);
  text-underline-offset: 0.16em;
  color: var(--accent-2);
}

.catalog a:hover {
  color: #c7ceff;
  text-decoration-color: #c7ceff;
}

.catalog span {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

/* Framework matrix */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

table.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}

table.matrix th,
table.matrix td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.matrix th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--accent-soft);
}

table.matrix tbody tr:last-child td {
  border-bottom: 0;
}

table.matrix td:first-child {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
