/*
 * Site components.
 *
 * insomnia.css (the design system) sits in the "design" cascade layer. This
 * file is unlayered, so a rule here beats any normal design rule whatever its
 * specificity, just like the inline styles these rules replace. The design's
 * !important rules still win, which is also how they behaved in the
 * prototype.
 *
 * Sections follow the page order: shared chrome, then each page.
 */

/* The hidden attribute always wins over component display rules. */
[hidden] {
  display: none !important;
}

/* ===================================================================
 * No-JS fallbacks
 * Without JS the footer carries every link, so the menu button is hidden.
 * =================================================================== */
.no-js header .menu {
  display: none;
}

/* ===================================================================
 * Header
 * =================================================================== */
header nav a[aria-current="page"] {
  color: #f58245;
}

/* Log In lives in the mobile menu (≤900px); see "Phone refinements". */
.nav-login {
  display: none;
}

/* ===================================================================
 * Footer
 * =================================================================== */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px 48px;
  padding: 48px 0 40px;
}

.foot-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.foot-tagline {
  margin: 0;
}

.site-footer .foot-meta {
  font-size: 12px;
  color: #d3d0ca;
}

.foot-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}

.foot-navs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 28px 56px;
}

.foot-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: static;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
}

.foot-nav-title {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f58245;
}

.foot-nav-list {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px 28px;
  justify-items: start;
}

.foot-link {
  color: #c4c2be;
  font-size: 13px;
  text-decoration: none;
}

.foot-link:hover,
.foot-link[aria-current="page"] {
  color: #f58245;
}

/* ===================================================================
 * Shared bits
 * =================================================================== */
.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f58245;
}

/* Copy buttons only work with JS. */
.no-js [data-copy] {
  display: none;
}

/* ===================================================================
 * The Lab: connect panel
 * =================================================================== */
.lab-connect {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.lab-connect .section-heading {
  margin-bottom: 0;
}

.connect-panel {
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
}

.connect-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 18px 24px;
  border-bottom: 1px solid #2a2a2a;
}

.connect-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #a69b8d;
}

.connect-code {
  flex: 1;
  min-width: 0;
  font: 500 16px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f3f2ee;
  overflow-wrap: anywhere;
}

.copy-url {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: #f58245;
  font: 600 13px/1 "DM Sans", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.copy-url:hover {
  color: #ffa56e;
}

.connect-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 0 24px;
}

.connect-tabs {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

/* Links (so tabs work without JS) styled exactly like the design's buttons. */
.connect-tab {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0;
  margin-bottom: -1px;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: #a69b8d;
  font: 500 14px/1 "DM Sans", sans-serif;
  cursor: pointer;
}

.connect-tab:hover {
  color: #f3f2ee;
}

.connect-tab[aria-selected="true"] {
  color: #f3f2ee;
  border-bottom-color: #f58245;
}

.connect-note {
  margin: 0;
  padding: 12px 24px;
  background: #f58245;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: #1e130c;
}

.connect-code-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 24px;
  background: #141414;
}

.connect-pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  font: 400 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d3d0ca;
  white-space: pre;
}

.copy-setup {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: #a69b8d;
  font: 600 13px/1 "DM Sans", sans-serif;
  cursor: pointer;
}

.copy-setup:hover {
  color: #f58245;
}

/* ===================================================================
 * The Lab: tool lists
 * =================================================================== */
.lab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 72px;
}

.lab-list-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 40px;
  padding-bottom: 24px;
}

.lab-list-title {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lab-list-title .eyebrow {
  margin: 0;
}

.lab-list-title h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  color: #f3f2ee;
}

.lab-list-intro {
  margin: 0;
  max-width: 420px;
  font-size: 16px;
  line-height: 1.6;
  color: #d3d0ca;
}

.tool {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px 56px;
  padding: 32px 0;
  border-top: 1px solid #303030;
}

.tool-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 "DM Sans", sans-serif;
  letter-spacing: 0.1em;
  color: #f3f2ee;
  padding: 7px 12px;
  border: 1px solid #303030;
  border-radius: 999px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f58245;
}

/* BETA and COMING SOON badges get a muted dot; LIVE keeps the solid orange
   one. The modifier comes from STATUS_MODIFIERS in app/content.py. */
.status-badge.is-beta .status-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #f58245;
}

.status-badge.is-soon .status-dot {
  background: #a69b8d;
}

.tool-id {
  font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f58245;
}

.tool-name {
  margin: 0;
  font-size: 26px;
  color: #f3f2ee;
}

.tool-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #d3d0ca;
  max-width: 520px;
  text-wrap: pretty;
}

.tool-specs {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 24px;
  align-content: start;
  font-size: 15px;
  line-height: 1.5;
}

.tool-specs dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #a69b8d;
  padding-top: 3px;
}

.tool-specs dd {
  margin: 0;
  color: #f3f2ee;
}

.tool-specs .tool-price {
  color: #f58245;
  font-weight: 600;
}

/* ===================================================================
 * The Lab: how payment works
 * =================================================================== */
.pay-box {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 24px;
  padding: 32px 28px;
  background: #191919;
  border: 1px solid #303030;
  border-radius: 9px;
}

.pay-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 32px;
}

.pay-head h3 {
  margin: 0;
  font-size: 24px;
  color: #f3f2ee;
}

.pay-head p {
  margin: 0;
  font-size: 14px;
  color: #d3d0ca;
}

.pay-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 28px;
}

.pay-steps li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid #303030;
}

.pay-steps span {
  font: 600 12px/1 "DM Sans", sans-serif;
  letter-spacing: 0.1em;
  color: #f58245;
}

.pay-steps p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #d3d0ca;
}

/* ===================================================================
 * FAQ accordion (The Lab)
 * Without JS every answer is shown and the +/- icon is hidden.
 * =================================================================== */
.lab-faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px 56px;
  padding-bottom: 72px;
}

.lab-faq .eyebrow {
  margin: 0;
}

.faq-list {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #303030;
}

.faq-item {
  border-bottom: 1px solid #303030;
}

.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
  min-height: 44px;
  background: none;
  border: 0;
  color: #f3f2ee;
  font: 600 18px/1.4 Manrope, "DM Sans", sans-serif;
  text-align: left;
  cursor: pointer;
}

.faq-q:hover {
  color: #f58245;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #303030;
  border-radius: 50%;
  color: #f58245;
  font-size: 16px;
}

.faq-icon::before {
  content: "+";
}

.faq-q[aria-expanded="true"] .faq-icon::before {
  content: "\2212";
}

.faq-a {
  margin: 0;
  padding: 0 48px 24px 0;
  font-size: 16px;
  line-height: 1.7;
  color: #d3d0ca;
  max-width: 680px;
}

.js .faq-q[aria-expanded="false"] + .faq-a {
  display: none;
}

.no-js .faq-icon {
  display: none;
}

/* ===================================================================
 * The Lab: request a tool
 * =================================================================== */
.lab-request {
  padding-bottom: 88px;
}

.request-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px 40px;
  padding: 28px;
  border: 1px solid #303030;
  border-radius: 9px;
  background: #191919;
}

.request-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}

.request-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f58245;
}

.request-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #d3d0ca;
}

/* ===================================================================
 * Home: showcase ("See what's possible")
 * State is driven by main.js (initShowcase): [aria-selected], [aria-current]
 * and .is-done / .is-current mirror the prototype's per-step styles.
 * =================================================================== */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 56px;
  align-items: center;
}

.showcase-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.showcase-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
  border: 1px solid #303030;
  border-radius: 999px;
  background: #191919;
}

.showcase-tab {
  font-size: 14px;
  min-height: 42px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #d3d0ca;
  transition: background 0.3s, color 0.3s;
}

.showcase-tab[aria-selected="true"] {
  background: #f58245;
  color: #1e130c;
}

.showcase-chapter {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #f58245;
}

.showcase-title {
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.045em;
  color: #f3f2ee;
  text-wrap: balance;
}

.showcase-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: #d3d0ca;
  max-width: 440px;
}

.showcase-steps {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #303030;
}

.showcase-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 8px;
  padding: 14px 0;
  border-bottom: 1px solid #303030;
  background: transparent;
  text-align: left;
  opacity: 0.5;
  transition: opacity 0.4s;
}

.showcase-step[aria-current="true"] {
  opacity: 1;
}

.showcase-step-num {
  font-size: 12px;
  font-weight: 500;
  color: #d3d0ca;
  padding-top: 2px;
}

.showcase-step[aria-current="true"] .showcase-step-num {
  color: #f58245;
}

.showcase-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.showcase-step-label {
  font-weight: 600;
  font-size: 15px;
  color: #f3f2ee;
}

.showcase-step-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #d3d0ca;
}

.showcase-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.showcase-demo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.demo-window {
  border: 1px solid #303030;
  border-radius: 12px;
  background: #101010;
  overflow: hidden;
  box-shadow: 0 30px 80px #00000066;
}

.demo-chrome {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 60px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #303030;
  background: #191919;
  font-size: 12px;
  color: #d3d0ca;
}

.demo-url {
  justify-self: center;
  padding: 4px 14px;
  border-radius: 20px;
  background: #101010;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.demo-chrome-badge {
  justify-self: end;
  padding: 3px 8px;
  border: 1px solid #303030;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d3d0ca;
}

.demo-track {
  display: flex;
  min-height: 440px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}

/* Not in the prototype: keyboard users need to see focus on the track. */
.demo-track:focus-visible {
  box-shadow: inset 0 0 0 2px #f58245;
}

.showcase-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.showcase-rail-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  padding: 6px 0;
  text-align: left;
}

.showcase-rail-bar {
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: #303030;
  transition: background 0.4s;
}

.showcase-rail-item.is-done .showcase-rail-bar {
  background: #f58245;
}

.showcase-rail-label {
  font-size: 12px;
  font-weight: 600;
  color: #d3d0ca;
  transition: color 0.4s;
}

.showcase-rail-item.is-current .showcase-rail-label {
  color: #f3f2ee;
}

.showcase-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.showcase-counter {
  font-size: 12px;
  color: #d3d0ca;
}

.showcase-arrows {
  display: flex;
  gap: 8px;
}

.showcase-prev,
.showcase-next {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 16px;
}

.showcase-prev {
  border: 1px solid #303030;
  background: transparent;
  color: #f3f2ee;
}

.showcase-next {
  border: 1px solid #f3f2ee;
  background: #f3f2ee;
  color: #101010;
}

.showcase-prev:disabled,
.showcase-next:disabled {
  opacity: 0.35;
}

/* Without JS the track still scrolls, but the controls cannot follow it. */
.no-js .showcase-tabs,
.no-js .showcase-rail,
.no-js .showcase-controls {
  display: none;
}

.no-js .showcase-step {
  opacity: 1;
}

/* ===================================================================
 * Home: Lab and Field Notes teasers
 * =================================================================== */
.home-section-title {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-section-title .eyebrow,
.home-section-title h2 {
  margin: 0;
}

.home-lab {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.home-lab-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 32px 64px;
  align-items: end;
}

.home-lab-intro {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  max-width: 460px;
}

.home-lab-panel {
  border: 1px solid #303030;
  border-radius: 10px;
  background: #141414;
  overflow: hidden;
}

.home-lab-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 28px;
  border-bottom: 1px solid #303030;
  background: #191919;
}

.home-lab-connect-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.home-lab-url {
  font: 500 clamp(20px, 3vw, 32px) / 1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f3f2ee;
  overflow-wrap: anywhere;
}

.home-lab-guide {
  font-size: 15px;
  color: #f58245;
}

.home-lab-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 32px 56px;
  padding: 28px;
}

.home-lab-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.home-lab-list-title {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #303030;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #f3f2ee;
}

.home-lab-tools {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-lab-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid #303030;
}

.home-lab-tool-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  min-width: 0;
}

.home-lab-tool-name span {
  font-size: 15px;
  color: #d3d0ca;
}

.home-lab-tool-id {
  font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f58245;
  overflow-wrap: anywhere;
}

.home-lab-tier {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #a69b8d;
}

.home-lab-tier.is-paid {
  color: #f58245;
}

.home-notes {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.home-notes-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 40px;
}

.home-notes-all {
  font-size: 15px;
  font-weight: 600;
  color: #f58245;
}

.home-notes-feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 40px 64px;
  border-top: 1px solid #303030;
  padding-top: 40px;
}

.home-note-lead {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-decoration: none;
  color: #f3f2ee;
}

.home-note-lead:hover {
  color: #f58245;
}

.home-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.home-note-badge {
  padding: 6px 10px;
  background: #f58245;
  color: #1e130c;
  border-radius: 4px;
}

.home-note-meta-text {
  color: #d3d0ca;
}

.home-note-title {
  font-family: Manrope, sans-serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.home-note-excerpt {
  font-size: 17px;
  line-height: 1.6;
  color: #d3d0ca;
  max-width: 520px;
}

.home-note-read {
  font-size: 15px;
  font-weight: 600;
  color: #f58245;
}

.home-note-teaser {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-note-teaser p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: #d3d0ca;
}

.home-note-more {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.home-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #303030;
}

.home-notes-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid #303030;
  text-decoration: none;
  color: #f3f2ee;
}

.home-notes-item:hover {
  color: #f58245;
}

.home-notes-item-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #a69b8d;
}

.home-notes-item-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-notes-item-title {
  font-family: Manrope, sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.home-notes-item-read {
  font-size: 13px;
  color: #d3d0ca;
}

/* ===================================================================
 * Field Notes index
 * =================================================================== */
.notes-index {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.notes-index .section-heading {
  margin-bottom: 0;
}

.notes-index .section-heading .eyebrow {
  font-size: 12px;
}

.notes-index .section-heading > p {
  font-size: 16px;
}

.notes-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  align-items: flex-start;
}

.notes-main {
  flex: 1 1 560px;
  min-width: 0;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.notes-filter {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.notes-search {
  width: 100%;
  padding: 14px 16px;
  background: #191919;
  color: #f3f2ee;
  border: 1px solid #303030;
  border-radius: 6px;
  outline: none;
}

.notes-search:focus {
  border-color: #f58245;
}

.notes-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notes-chip {
  font: 600 13px/1 "DM Sans", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 18px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid #303030;
  background: #101010;
  color: #d3d0ca;
}

.notes-chip[aria-pressed="true"] {
  border-color: #f3f2ee;
  background: #f3f2ee;
  color: #101010;
}

.notes-list {
  display: flex;
  flex-direction: column;
}

.notes-count {
  font-size: 12px;
  letter-spacing: 0.1em;
}

.notes-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notes-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.notes-card .notes-card-date {
  font-size: 12px;
  margin: 0;
  display: inline;
  color: #d3d0ca;
}

.notes-card-title {
  margin-top: 0;
}

.notes-card-excerpt {
  margin: 0;
  font-size: 16px;
  max-width: 620px;
}

.notes-empty {
  padding: 32px 0;
  margin: 0;
  color: #d3d0ca;
}

.notes-aside {
  flex: 1 1 260px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.notes-topics {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notes-aside-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f58245;
}

.notes-topic-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #303030;
}

/* Links (so topics work without JS) styled like the design's buttons. */
.notes-topic {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  min-height: 44px;
  background: none;
  border: 0;
  border-bottom: 1px solid #303030;
  color: #f3f2ee;
  font: 500 16px/1.3 "DM Sans", sans-serif;
  text-align: left;
}

.notes-topic:hover {
  color: #f58245;
}

.notes-topic-count {
  color: #d3d0ca;
}

.notes-suggest {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #191919;
}

.notes-suggest-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #d3d0ca;
}

.notes-suggest-link {
  font-size: 15px;
  font-weight: 600;
  color: #f58245;
}

/* ===================================================================
 * Documents: Field Note pages and legal pages share .doc-* classes
 * =================================================================== */
.doc-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 760px;
}

.note-back {
  font-size: 13px;
  font-weight: 600;
  color: #d1cec8;
}

.doc-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 36px;
  border-bottom: 1px solid #303030;
}

.doc-header .eyebrow {
  margin: 0;
  font-size: 12px;
}

.doc-title {
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.note-byline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.note-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #303030;
}

.note-byline-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-author {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.note-author-name {
  font-size: 15px;
  font-weight: 600;
  color: #f3f2ee;
}

.note-author-role {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f58245;
}

.doc-dateline {
  font-size: 13px;
  color: #d3d0ca;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Article body. Notes are stored as plain semantic HTML (docs/database.md). */
.doc-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
}

.doc-body p {
  margin: 0;
}

.doc-body .lead {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.65;
  color: #e6e2dc;
}

.doc-body h3 {
  margin-top: 20px;
}

.doc-body ol,
.doc-body ul {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  line-height: 1.7;
  color: #d3d0ca;
}

.doc-body li strong {
  color: #f3f2ee;
}

.doc-body a {
  color: #f58245;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Block types beyond the design's originals (written in its language). */
.doc-body h4 {
  margin-top: 16px;
  font-size: 20px;
  line-height: 1.35;
}

.doc-body :not(pre) > code {
  padding: 1px 6px;
  border: 1px solid #303030;
  border-radius: 4px;
  background: #191919;
  font: 500 0.9em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f3f2ee;
}

.doc-body em {
  font-style: italic;
}

.note-quote {
  margin: 8px 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid #f58245;
}

.note-quote p {
  font-family: Manrope, "DM Sans", sans-serif;
  font-size: 19px;
  line-height: 1.6;
  color: #e6e2dc;
}

.note-quote footer {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a69b8d;
}

.note-callout {
  margin: 8px 0;
  padding: 18px 20px;
  border: 1px solid #303030;
  border-left: 3px solid #a69b8d;
  border-radius: 8px;
  background: #191919;
}

.note-callout-tip {
  border-left-color: #f58245;
}

.note-callout-warning {
  border-color: #6b3a1f;
  border-left-color: #ffa56e;
  background: #1e1510;
}

.doc-body .note-callout-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f58245;
}

.note-code {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #141414;
  font: 400 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d3d0ca;
}

.note-figure {
  margin: 12px 0;
}

.note-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #303030;
  border-radius: 8px;
}

.note-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #a69b8d;
}

.note-divider {
  width: 100%;
  margin: 16px 0;
  border: 0;
  border-top: 1px solid #303030;
}

.note-more {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid #303030;
}

.note-more-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.note-more-label {
  margin: 0;
  flex: 1 1 auto;
  max-width: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f58245;
}

.note-more-all {
  font-size: 14px;
  font-weight: 600;
  color: #d3d0ca;
}

.note-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.note-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #191919;
}

.note-card:hover {
  border-color: #f58245;
}

.note-card-kind {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f58245;
}

.note-card-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.note-card-excerpt {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #d3d0ca;
}

.note-card-date {
  margin-top: auto;
  font-size: 13px;
  color: #d3d0ca;
}

/* ===================================================================
 * Log In (visual only until client accounts exist)
 * =================================================================== */
.login-page {
  display: flex;
  justify-content: center;
  padding-block: 96px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 400px;
}

.login-title {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-input {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #303030;
  border-radius: 8px;
}

.login-submit {
  margin-top: 8px;
}

/* Not in the design: shown after a login attempt. */
.login-notice {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #f58245;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #f3f2ee;
}

.login-help {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #d3d0ca;
}

.login-restart {
  align-self: center;
  font-size: 14px;
  color: #d3d0ca;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-restart:hover {
  color: #f58245;
}

.login-notice a {
  color: #f58245;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===================================================================
 * 404 (not in the design; reuses the document page styles)
 * =================================================================== */
.not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.doc-body .not-found-links a {
  color: #1e130c;
  text-decoration: none;
}

/* ===================================================================
 * Contact form (dialog on every page; standalone card on /contact)
 * The dialog itself is styled by the design system's dialog rules.
 * =================================================================== */

/* Spam trap: present for bots, invisible and unreachable for people. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Not in the design: validation feedback. */
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #ffa56e;
}

.contact-form [aria-invalid="true"] {
  border-color: #f58245;
}

.contact-form .form-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #ffa56e;
}

/* /contact: the same form as the dialog, laid out as a card in the page. */
.contact-page {
  display: flex;
  justify-content: center;
}

.contact-card {
  width: min(820px, 100%);
  border: 1px solid #303030;
  border-radius: 14px;
  background: #101010;
  color: #f3f2ee;
  padding: 32px;
}

.contact-card h2 {
  font-size: 34px;
}

.contact-card p {
  font-size: 16px;
  line-height: 1.7;
  color: #d3d0ca;
}

.contact-card form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 25px;
}

.contact-card .primary {
  justify-self: start;
  font-size: 15px;
}

.contact-card .success {
  padding: 35px 0;
}

@media (max-width: 700px) {
  .contact-card {
    padding: 24px 20px;
  }

  .contact-card h2 {
    font-size: 29px;
  }

  .contact-card form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .contact-card h2 {
    font-size: 28px;
    line-height: 1.2;
  }

  .contact-card p {
    font-size: 14px;
  }

  .contact-card form {
    gap: 17px;
  }

  .contact-card .primary {
    width: 100%;
    min-height: 50px;
  }
}

/* Shown on admin previews of unpublished notes. */
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0;
  padding: 10px 16px;
  background: #f58245;
  color: #1e130c;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ===================================================================
 * Phone refinements (deliberate departures from the prototype, which
 * cramps these at narrow widths). Desktop and tablet stay 1:1.
 * =================================================================== */
/* Mobile and tablet header (≤900px, where the Menu button appears): Log In
 * moves from the header bar into the menu. Without JS the menu can't open,
 * so the header button stays. "Let's Talk" keeps its place on the right. */
@media (max-width: 900px) {
  .js header > .login {
    display: none;
  }

  .js header > .small {
    margin-left: auto;
  }

  .js #main-nav .nav-login {
    display: block;
  }
}

@media (max-width: 600px) {
  /* MCP URL: label and Copy on one row, the URL full width beneath. */
  .connect-url {
    row-gap: 4px;
  }

  .copy-url {
    order: 1;
    margin-left: auto;
  }

  .connect-code {
    order: 2;
    flex-basis: 100%;
  }

  /* Wrap setup snippets instead of scrolling them sideways. */
  .connect-pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
