/* Neato Echo manual — layered on styles.css (Read mode: comprehension first) */

.docs-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-block: 1.5rem 4rem;
  align-items: start;
}

/* ---------- sidebar ---------- */
.docs-side-toggle {
  justify-self: start;
  gap: 0.5rem;
}
.docs-side-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.docs-side {
  display: none;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
  scrollbar-width: thin;
}
.docs-side.is-open,
.docs-shell.side-open .docs-side {
  display: block;
}

.docs-search {
  position: relative;
  margin-bottom: 1.25rem;
}
.docs-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: hsl(var(--muted-foreground));
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.docs-search input {
  width: 100%;
  height: 44px;
  padding: 0 0.9rem 0 2.5rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--cream));
  color: hsl(var(--foreground));
  font: 500 0.95rem var(--font-body);
  caret-color: hsl(var(--burnt-orange));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.docs-search input::placeholder {
  color: hsl(var(--muted-foreground) / 0.8);
}
.docs-search input:focus {
  outline: none;
  border-color: hsl(var(--teal));
  box-shadow: 3px 3px 0 hsl(var(--teal) / 0.2);
}
.docs-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  cursor: pointer;
  background: hsl(var(--retro-brown));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-group {
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px dashed hsl(var(--retro-brown) / 0.3);
}
.docs-group:last-child {
  border-bottom: 0;
}
.docs-group h3 {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: hsl(var(--retro-brown));
  margin-bottom: 0.5rem;
}
.docs-group li a {
  display: block;
  padding: 0.32rem 0.65rem;
  margin-left: -0.65rem;
  border-radius: 8px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
}
.docs-group li a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--card));
}
.docs-group li a[aria-current="page"] {
  color: hsl(var(--foreground));
  font-weight: 600;
  background: hsl(var(--card));
  border-left-color: hsl(var(--teal));
}
.docs-group li[hidden],
.docs-group[hidden] {
  display: none;
}
.docs-nav-empty {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  padding: 0.5rem 0;
}
.docs-nav mark {
  background: hsl(var(--mustard) / 0.55);
  color: inherit;
  border-radius: 2px;
  padding: 0 0.1em;
}

/* ---------- article ---------- */
.docs-main {
  min-width: 0;
}
.doc {
  max-width: 72ch;
}
.doc-crumb {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}
.doc-crumb a {
  color: inherit;
  text-decoration: none;
}
.doc-crumb a:hover {
  color: hsl(var(--teal));
}
.doc-crumb span {
  margin-inline: 0.4rem;
  color: hsl(var(--border));
}
.doc-head h1 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem);
  letter-spacing: 0.03em;
}
.doc-lede {
  margin-top: 0.9rem;
  font-size: 1.15rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  text-wrap: pretty;
}
.doc-head {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid hsl(var(--border));
}

.doc-body {
  font-size: 1.04rem;
  line-height: 1.65;
}
.doc-body > * + * {
  margin-top: 1.1rem;
}
.doc-body p {
  text-wrap: pretty;
}
.doc-body h2 {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px dashed hsl(var(--retro-brown) / 0.3);
}
.doc-body h3 {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin-top: 2rem;
  color: hsl(var(--retro-brown));
}
.doc-body h4 {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 1.02rem;
  margin-top: 1.6rem;
}
.doc-body h2 + *,
.doc-body h3 + *,
.doc-body h4 + * {
  margin-top: 0.7rem;
}
.doc-body h2 .anchor,
.doc-body h3 .anchor,
.doc-body h4 .anchor {
  color: inherit;
  text-decoration: none;
}
.doc-body h2 .anchor:hover::after,
.doc-body h3 .anchor:hover::after {
  content: " #";
  color: hsl(var(--teal));
}
.doc-body ul,
.doc-body ol {
  padding-left: 1.4rem;
}
.doc-body li + li {
  margin-top: 0.35rem;
}
.doc-body li > ul,
.doc-body li > ol {
  margin-top: 0.35rem;
}
.doc-body ul {
  list-style: none;
  padding-left: 1.25rem;
}
.doc-body ul > li {
  position: relative;
}
.doc-body ul > li::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: hsl(var(--teal));
}
.doc-body ol {
  counter-reset: item;
  list-style: none;
  padding-left: 1.6rem;
}
.doc-body ol > li {
  position: relative;
  counter-increment: item;
}
.doc-body ol > li::before {
  content: counter(item);
  position: absolute;
  left: -1.6rem;
  top: 0.05em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: hsl(var(--retro-brown));
}
.doc-body strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.doc-body code {
  font-family: var(--font-display);
  font-size: 0.82em;
  background: hsl(var(--muted));
  padding: 0.08em 0.4em;
  border-radius: 3px;
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}
.doc-body pre {
  margin: 1.1rem 0 0;
  padding: 1rem 1.2rem;
  background: hsl(var(--retro-brown));
  color: hsl(var(--cream));
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: 5px 5px 0 hsl(var(--retro-brown) / 0.15);
  font-size: 0.85rem;
  line-height: 1.55;
}
.doc-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.doc-body kbd {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1em 0.5em;
  border: 2px solid hsl(var(--retro-brown));
  border-radius: 4px;
  box-shadow: 2px 2px 0 hsl(var(--retro-brown) / 0.35);
  background: hsl(var(--cream));
  vertical-align: 0.1em;
}
.doc-body blockquote {
  margin: 1.1rem 0 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid hsl(var(--teal));
  color: hsl(var(--muted-foreground));
}
.doc-body hr {
  border: 0;
  border-top: 1px dashed hsl(var(--retro-brown) / 0.35);
  margin: 2rem 0 0;
}
.doc-body img {
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 hsl(var(--retro-brown) / 0.15);
}
.doc-frame {
  margin: 1.1rem 0 0;
}
.doc-frame figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

/* tables: data plate */
.table-wrap {
  overflow-x: auto;
  margin-top: 1.1rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.doc-body th {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: left;
  color: hsl(var(--retro-brown));
  padding: 0.75rem 1rem;
  border-bottom: 2px solid hsl(var(--border));
  white-space: nowrap;
}
.doc-body td {
  padding: 0.7rem 1rem;
  vertical-align: top;
  border-bottom: 1px dashed hsl(var(--retro-brown) / 0.3);
  font-variant-numeric: tabular-nums;
}
.doc-body tr:last-child td {
  border-bottom: 0;
}

/* ---------- components ---------- */
.callout {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border: 2px solid hsl(var(--teal));
  border-radius: var(--radius);
  background: hsl(var(--teal) / 0.08);
  margin-top: 1.1rem;
}
.callout > svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: hsl(var(--teal));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-top: 0.15rem;
}
.callout-warning {
  border-color: hsl(var(--burnt-orange));
  background: hsl(var(--burnt-orange) / 0.08);
}
.callout-warning > svg {
  stroke: hsl(var(--burnt-orange));
}
.callout-tip {
  border-color: hsl(var(--mustard));
  background: hsl(var(--mustard) / 0.14);
}
.callout-tip > svg {
  stroke: hsl(38 80% 38%);
}
.callout-body > * + * {
  margin-top: 0.6rem;
}
.callout-body p {
  font-size: 0.98rem;
}

.doc-steps {
  list-style: none;
  padding: 0;
  margin-top: 1.4rem;
  counter-reset: none;
}
.doc-body .doc-steps {
  padding-left: 0;
}
.doc-body .doc-steps > li::before {
  content: none;
}
.doc-step {
  position: relative;
  padding-left: 3.4rem;
  padding-bottom: 1.6rem;
}
.doc-step + .doc-step {
  margin-top: 0;
}
.doc-step::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 2.4rem;
  bottom: 0;
  border-left: 2px dashed hsl(var(--retro-brown) / 0.35);
}
.doc-step:last-child::after {
  display: none;
}
.doc-step:last-child {
  padding-bottom: 0;
}
.doc-step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: hsl(var(--retro-brown));
  color: hsl(var(--cream));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 3px 3px 0 hsl(var(--teal) / 0.35);
}
.doc-body .doc-step-title {
  margin-top: 0;
  padding-top: 0.45rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: hsl(var(--foreground));
}
.doc-step-body > * + * {
  margin-top: 0.8rem;
}
.doc-step-body > :first-child {
  margin-top: 0.5rem;
}

.acc-group {
  margin-top: 1.1rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  overflow: hidden;
}
.acc-group .acc {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px dashed hsl(var(--retro-brown) / 0.3);
}
.acc-group .acc:last-child {
  border-bottom: 0;
}
.acc {
  margin-top: 1.1rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.acc summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.acc summary::-webkit-details-marker {
  display: none;
}
.acc summary svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: hsl(var(--teal));
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.acc[open] summary svg {
  transform: rotate(90deg);
}
.acc summary:hover {
  color: hsl(var(--teal));
}
.acc-body {
  padding: 0 1.1rem 1.1rem 2.75rem;
}
.acc-body > * + * {
  margin-top: 0.8rem;
}

.doc-cards {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.4rem;
}
.doc-card {
  position: relative;
  padding: 1.25rem 1.4rem;
  border: 2px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 hsl(var(--retro-brown) / 0.15);
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}
.doc-card + .doc-card {
  margin-top: 0;
}
.doc-body .doc-card {
  margin-top: 1.1rem;
}
.doc-body .doc-cards .doc-card {
  margin-top: 0;
}
.doc-card.is-link:hover {
  box-shadow: 8px 8px 0 hsl(var(--teal) / 0.2);
  border-color: hsl(var(--teal));
  transform: translate(-2px, -2px);
}
.doc-body .doc-card-title {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: hsl(var(--foreground));
}
.doc-card-title a {
  color: inherit;
  text-decoration: none;
}
.doc-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.doc-card-title svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: hsl(var(--burnt-orange));
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}
.doc-card.is-link:hover .doc-card-title svg {
  transform: translateX(3px);
}
.doc-card-body {
  margin-top: 0.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
}
.doc-card-body > * + * {
  margin-top: 0.5rem;
}

.doc-tabs {
  margin-top: 1.1rem;
}
.doc-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.doc-tab-list button {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border: 2px solid hsl(var(--border));
  border-radius: 4px;
  background: hsl(var(--cream));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.doc-tab-list button[aria-selected="true"] {
  border-color: hsl(var(--teal));
  color: hsl(var(--teal));
  background: hsl(var(--teal) / 0.08);
}
.doc-tabs[data-ready] .doc-tab-label {
  display: none;
}
.doc-tabs[data-ready] .doc-tab[hidden] {
  display: none;
}
.doc-tab + .doc-tab {
  margin-top: 1.5rem;
}
.doc-tab-body > * + * {
  margin-top: 0.8rem;
}

/* ---------- pager & help ---------- */
.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid hsl(var(--border));
}
.doc-pager-link {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  text-decoration: none;
  color: hsl(var(--foreground));
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.doc-pager-link:hover {
  border-color: hsl(var(--teal));
  box-shadow: 5px 5px 0 hsl(var(--teal) / 0.2);
  transform: translate(-2px, -2px);
  color: hsl(var(--foreground));
}
.doc-pager-link .micro {
  color: hsl(var(--muted-foreground));
}
.doc-pager-next {
  text-align: right;
}
.doc-pager-title {
  font-weight: 600;
  line-height: 1.3;
}

.doc-help {
  margin-top: 2.5rem;
  padding: 1.6rem 1.75rem;
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    hsl(var(--retro-brown) / 0.035) 3px 4px
  );
}
.doc-help h2 {
  font-size: 0.95rem;
}
.doc-help p {
  margin-top: 0.6rem;
  color: hsl(var(--muted-foreground));
  max-width: 60ch;
}
.doc-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
  align-items: center;
}

/* ---------- table of contents ---------- */
.docs-toc {
  display: none;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-left: 1.25rem;
  border-left: 2px solid hsl(var(--border));
  font-size: 0.88rem;
}
.docs-toc h3 {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: hsl(var(--retro-brown));
  margin-bottom: 0.7rem;
}
.docs-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-toc li + li {
  margin-top: 0.35rem;
}
.docs-toc .toc-3 {
  padding-left: 0.9rem;
  font-size: 0.82rem;
}
.docs-toc a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  line-height: 1.35;
  display: block;
}
.docs-toc a:hover,
.docs-toc a.is-active {
  color: hsl(var(--teal));
}

/* ---------- breakpoints ---------- */
@media (min-width: 720px) {
  .doc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .docs-shell {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    gap: 3rem;
    padding-block: 2.5rem 5rem;
  }
  .docs-side-toggle {
    display: none;
  }
  .docs-side {
    display: block;
  }
}

@media (min-width: 1280px) {
  .docs-shell {
    grid-template-columns: 16.5rem minmax(0, 1fr) 13rem;
  }
  .docs-toc {
    display: block;
  }
}

@media (max-width: 519px) {
  .doc-pager {
    grid-template-columns: 1fr;
  }
  .doc-pager-next {
    text-align: left;
  }
  .doc-step {
    padding-left: 2.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-card,
  .doc-pager-link,
  .acc summary svg,
  .doc-card-title svg {
    transition: none;
  }
}
