/* =========================================================================
   ai.controlpaths.com — AI tooling for FPGA/SoC engineers
   Dark-first restyle of the controlpaths.com design-token system.
   Tokens mirror the blog's :root[data-theme="dark"] block so both properties
   stay visually related. Fonts are the blog's: Orbitron / Poppins / Ubuntu Mono.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* Surfaces & text */
  --bg:            #0e1622;
  --bg-subtle:     #131d2b;
  --surface:       #16212f;
  --surface-2:     #1b2838;
  --text:          #e6edf5;
  --text-muted:    #9fb0c3;
  --heading:       #eaf2fb;

  /* Borders */
  --border:        #26344a;
  --border-strong: #33455f;

  /* Brand — navy base + cyan accent, lifted for a dark ground */
  --primary:       #4aa8ff;
  --primary-600:   #6bb8ff;
  --accent:        #2fd0ec;
  --accent-600:    #5cdcf2;

  /* Links */
  --link:          #67c7e8;
  --link-hover:    #9bd9f0;

  /* Buttons */
  --btn-bg:        #1f6feb;
  --btn-bg-hover:  #388bfd;
  --btn-text:      #ffffff;

  /* Code */
  --code-bg:       #0c1521;
  --code-text:     #cfe3f5;

  /* Translucent header (glassmorphism) */
  --header-bg:     rgba(14, 22, 34, .72);

  /* Status colours for tool cards */
  --ok:            #28c840;
  --warn:          #febc2e;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 44px -14px rgba(0, 0, 0, .60);

  /* Shape */
  --radius:    14px;
  --radius-sm: 10px;

  /* Layout */
  --content-width: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--heading);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.8rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .18s ease;
}

a:hover {
  color: var(--link-hover);
}

code, pre, .mono {
  font-family: 'Ubuntu Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

img {
  max-width: 100%;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================================
   Header — fixed, glassmorphism, same anatomy as the blog's #site-header
   ========================================================================= */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform .28s ease, box-shadow .2s ease;
}

#site-header.scrolled {
  box-shadow: var(--shadow-md);
}

#site-header.hide {
  transform: translateY(-100%);
}

.site-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.7rem 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  color: var(--heading);
  line-height: 1.05;
}

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

.brand-sub {
  display: block;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav > a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9px;
  transition: color .18s ease, background .18s ease;
}

.nav > a:hover {
  color: var(--accent);
  background: var(--bg-subtle);
}

.nav > a.is-active {
  color: var(--accent);
}

.nav-social {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--border);
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-subtle);
}

/* the blog's glyphs are dark artwork — invert them on this dark ground */
.social-btn img {
  display: block;
  filter: invert(1) brightness(1.8);
}

/* =========================================================================
   Buttons — same pill shapes as the blog
   ========================================================================= */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease,
              border-color .2s ease, color .2s ease;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  color: var(--btn-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--heading);
  border-color: var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================================
   Hero
   ========================================================================= */

main {
  padding-top: 92px; /* JS syncs this to the real header height */
}

.hero {
  position: relative;
  margin: 0.5rem 0 3rem;
  padding: 1.6rem 0 0.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10px 0 0;
  z-index: 0;
  background-image: radial-gradient(circle at center, var(--border) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(120% 80% at 70% 30%, #000 0%, transparent 70%);
  mask-image: radial-gradient(120% 80% at 70% 30%, #000 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 2.5rem;
}

.kicker {
  display: block;
  width: fit-content;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-600);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.hero-title {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 34rem;
  margin: 0 0 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

/* --- Terminal window ----------------------------------------------------- */

.terminal {
  background: #0c1626;
  border: 1px solid #1d2c44;
  border-radius: 14px;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .65), 0 2px 8px rgba(0, 0, 0, .35);
  overflow: hidden;
  font-family: 'Ubuntu Mono', monospace;
  transform: perspective(1200px) rotateY(-3deg) rotateX(2deg);
  transition: transform .35s ease;
}

.terminal:hover {
  transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: #0f1d33;
  border-bottom: 1px solid #1d2c44;
}

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a3c5a;
}

.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }

.term-title {
  margin-left: 8px;
  font-size: 0.82rem;
  color: #6b7e9c;
  letter-spacing: 0.02em;
}

.term-body {
  margin: 0;
  padding: 18px 18px 22px;
  font-size: 1rem;
  line-height: 1.7;
  color: #cfe3f5;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 9em;
}

.term-prompt  { color: #28c840; font-weight: 700; }
.term-flag    { color: #febc2e; }
.term-comment { color: #6b7e9c; }
.term-arrow   { color: var(--accent); font-weight: 700; }
.term-bad     { color: #ff7b72; }
.term-good    { color: #28c840; }

#typed { color: #a5d6ff; }

.term-cursor {
  display: inline-block;
  width: 9px;
  height: 1.15em;
  vertical-align: -0.2em;
  margin-left: 2px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* =========================================================================
   Sections & tool cards
   ========================================================================= */

.section {
  margin: 0 0 3.5rem;
}

.section-head {
  margin-bottom: 1.6rem;
}

.section-head h2 {
  font-size: 1.9rem;
  margin-bottom: 0.4rem;
}

.section-head p {
  color: var(--text-muted);
  margin: 0;
  max-width: 44rem;
}

.tool-grid {
  display: grid;
  /* one column per live tool: three cards read as a row, not as two-plus-one */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}

@media (max-width: 900px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease;
}

a.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.tool-card h3 {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  flex: 1;
}

.tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.badge {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge.live {
  color: var(--ok);
  border-color: rgba(40, 200, 64, .45);
  background: rgba(40, 200, 64, .09);
}

.badge.beta {
  color: var(--warn);
  border-color: rgba(254, 188, 46, .45);
  background: rgba(254, 188, 46, .09);
}

.badge.soon {
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.tool-meta {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

/* --- "How it works" steps ------------------------------------------------ */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.3rem;
  counter-reset: step;
}

.step {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.step h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* --- Call to action ------------------------------------------------------ */

.cta {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.cta h2 {
  margin-bottom: 0.6rem;
}

.cta p {
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 auto 1.4rem;
}

/* =========================================================================
   Tool pages — forms, results, notices
   ========================================================================= */

.page-head {
  margin: 0 0 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}

.page-head h1 {
  font-family: 'Ubuntu Mono', monospace;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.page-head p {
  color: var(--text-muted);
  max-width: 46rem;
  margin: 0;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
  margin-bottom: 3rem;
}

.tool-layout.wide {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--code-bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.95rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field textarea {
  min-height: 340px;
  line-height: 1.5;
  resize: vertical;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 208, 236, .18);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.3rem 0 0;
}

.form-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

/* Result area */

.result {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 300px;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-body {
  margin: 0;
  padding: 1.1rem;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--code-text);
  white-space: pre;
  overflow-x: auto;
}

.placeholder {
  color: var(--text-muted);
  padding: 3rem 1.2rem;
  text-align: center;
  white-space: normal;
}

/* Lint findings */

.findings {
  list-style: none;
  margin: 0;
  padding: 0.6rem;
}

.finding {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 0.6rem;
}

.finding-sev {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  height: fit-content;
  white-space: nowrap;
}

.finding-sev.error {
  color: #ff7b72;
  background: rgba(255, 123, 114, .12);
  border: 1px solid rgba(255, 123, 114, .4);
}

.finding-sev.warning {
  color: var(--warn);
  background: rgba(254, 188, 46, .12);
  border: 1px solid rgba(254, 188, 46, .4);
}

.finding-sev.info {
  color: var(--accent);
  background: rgba(47, 208, 236, .12);
  border: 1px solid rgba(47, 208, 236, .4);
}

.finding-main strong {
  display: block;
  color: var(--heading);
  font-size: 0.95rem;
}

.finding-main p {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.finding-loc {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
}

/* Notices */

.notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.notice.error {
  border-color: rgba(255, 123, 114, .45);
  background: rgba(255, 123, 114, .08);
  color: #ffb3ae;
}

.notice strong {
  color: var(--heading);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================================
   Footer
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  margin-top: 3rem;
  padding: 2.5rem 0 1.5rem;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem;
}

.footer-col p,
.footer-col li {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-title {
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.5rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.35rem;
}

.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .terminal,
  .terminal:hover {
    transform: none;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header-inner {
    padding: 0.6rem 20px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .nav > a {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .cta {
    padding: 1.6rem 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .term-cursor { animation: none; }
  .terminal,
  .terminal:hover { transform: none; }
  * { transition: none !important; }
}

/* =========================================================================
   Filter designer — tabs, plots, coefficient table, verdicts
   ========================================================================= */

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 0.9rem 0.2rem;
  margin: 0 0 1rem;
}

.fieldset legend {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 0.4rem;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label {
  text-align: center;
  padding: 0.5rem 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.seg input:checked + label {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.tabs {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.6rem 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  padding: 1rem;
}

.tab-panel[hidden] {
  display: none;
}

.plot {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.plot + .plot {
  margin-top: 0.8rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.7rem 0 0;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid var(--c);
  margin-right: 6px;
  vertical-align: middle;
}

.legend span.dashed::before {
  border-top-style: dashed;
}

.legend span.dots::before {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--c);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}

.stat .k {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat .v {
  display: block;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 1.05rem;
  color: var(--heading);
  margin-top: 0.15rem;
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Ubuntu Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

.verdict.pass {
  color: var(--ok);
  border-color: rgba(40, 200, 64, .45);
  background: rgba(40, 200, 64, .09);
}

.verdict.fail {
  color: #ff7b72;
  border-color: rgba(255, 123, 114, .45);
  background: rgba(255, 123, 114, .09);
}

.verdict.skip {
  color: var(--warn);
  border-color: rgba(254, 188, 46, .45);
  background: rgba(254, 188, 46, .09);
}

.table-wrap {
  overflow-x: auto;
}

table.coeffs {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
}

table.coeffs th,
table.coeffs td {
  text-align: right;
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.coeffs th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

table.coeffs td:first-child,
table.coeffs th:first-child {
  text-align: left;
  color: var(--accent);
}

.code-view {
  margin: 0;
  padding: 1rem;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: pre;
  overflow: auto;
  max-height: 70vh;
  tab-size: 2;
}

.code-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.7rem;
}

.warn-list {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.warn-list li {
  border-left: 3px solid var(--warn);
  background: rgba(254, 188, 46, .07);
  padding: 0.5rem 0.8rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.note-list li {
  border-left-color: var(--accent);
  background: rgba(47, 208, 236, .07);
}

/* --- per-tone simulation cards --------------------------------------------- */

.tone-card {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
}

.tone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.6rem;
}

.tone-title {
  font-family: 'Ubuntu Mono', monospace;
  font-weight: 700;
  color: var(--heading);
}

.tone-nums {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
}

/* --- API / MCP access call-outs -------------------------------------------- */

.access-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow-md);
}

.access-panel h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.access-panel p {
  color: var(--text-muted);
  margin: 0;
  max-width: 44rem;
}

.access-panel .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

.access-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 0.8rem;
}

.btn-small {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .access-panel {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.4rem;
  }
}

/* --- lint: summary and implementation ------------------------------------- */

.summary-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
}

.summary-box p {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-line;
}

.summary-box .badge {
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.finding-fix {
  color: var(--accent) !important;
}

.impl-h {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.1rem 0 0.4rem;
}

.impl-h:first-child {
  margin-top: 0;
}

.impl-p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.7;
}

.impl-p code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 0.4rem;
  font-size: 0.85rem;
  color: var(--code-text);
}

/* --- code cards (one per generated file) ---------------------------------- */

.code-card {
  margin: 0 0 1rem;
}

.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.85rem;
  color: var(--heading);
}

.code-card-meta {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-card .code-view {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 46vh;
}

/* --- axi-slave: description box, register map table, copy buttons --------- */

.field textarea.short {
  min-height: 150px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.92rem;
}

table.regmap th,
table.regmap td {
  text-align: left;
}

table.regmap td.desc {
  white-space: normal;
  min-width: 16rem;
  color: var(--text-muted);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
}

table.regmap td:nth-child(2) {
  color: var(--heading);
}

table.regmap .badge {
  font-size: 0.65rem;
  padding: 1px 8px;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
}

.link-btn:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
