/* Site-wide design system — light, system fonts only.
   Shared public stylesheet (replaces main.css). engine.css stays for tool UI. */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

img { max-width: 100%; height: auto; }

[hidden] { display: none !important; }

.container,
.container-wide {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

.container { max-width: 1160px; }
.container-wide { max-width: 1280px; }

.layout-primary {
  width: min(100%, 1080px);
  margin-inline: auto;
}

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #fff;
  color: var(--accent, #2563EB);
  overflow: visible;
  white-space: normal;
}

.site-header,
.site-main,
.site-footer {
  max-width: 100%;
  overflow-x: clip;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text, #0F172A);
  text-decoration: none;
  font-weight: 700;
  min-width: 0;
}

.brand:hover { text-decoration: none; color: inherit; }

.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  background: var(--accent, #2563EB);
  flex-shrink: 0;
}

.nav {
  display: none;
  align-items: center;
  gap: 1rem;
}

.nav a {
  color: var(--muted, #5B6577);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent, #2563EB);
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border, #E3E8F2);
  background: #fff;
  color: var(--text, #0F172A);
  cursor: pointer;
}

.nav-panel {
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--border, #E3E8F2);
}

.nav-panel.is-open { display: block; }

.nav-panel .nav {
  display: grid;
  gap: 0.25rem;
  padding: 0 20px 1rem;
}

.nav-panel .nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

@media (min-width: 860px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .nav-panel { display: none !important; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 1.1rem;
  min-height: 48px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent, #2563EB);
  border-color: var(--accent, #2563EB);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover, #1D4ED8);
  border-color: var(--accent-hover, #1D4ED8);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border, #E3E8F2);
  color: var(--text, #0F172A);
}

.btn-sm {
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.muted { color: var(--muted, #5B6577); }

.prose { color: var(--text, #0F172A); }
.prose p,
.prose ol,
.prose ul,
.prose h3 {
  margin: 0 0 0.85rem;
}
.prose h3 {
  margin-top: 1.1rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.25;
}
.prose a { color: var(--accent, #2563EB); }
.prose a:hover { text-decoration: underline; }
.prose a:visited { color: #1D4ED8; }

.breadcrumbs {
  display: block;
  color: var(--muted, #5B6577);
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0 0 0.75rem;
}

.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs-list li:not(:last-child)::after {
  content: "/";
  color: var(--muted, #5B6577);
  opacity: 0.7;
}

.breadcrumbs a {
  color: var(--muted, #5B6577);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent, #2563EB);
  text-decoration: underline;
}

.page-reviewed {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
}

.section { padding: 0; }

.grid-tools {
  display: grid;
  gap: 0.7rem;
}

.site-footer {
  margin-top: 0;
}

.footer-grid {
  display: grid;
  gap: 1.5rem 1rem;
}

.footer-col {
  display: grid;
  gap: 0.1rem;
  align-content: start;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 0.85rem;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border, #E3E8F2);
  color: var(--muted, #5B6577);
  font-size: 0.82rem;
  text-align: center;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border, #E3E8F2);
  background: #fff;
}

.alert-error {
  border-color: rgba(185, 28, 28, 0.35);
  background: #FEF2F2;
}

body.home-page {
  --bg: #FFFFFF;
  --bg-alt: #F6F8FC;
  --text: #0F172A;
  --muted: #5B6577;
  --border: #E3E8F2;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #EAF1FF;
  --ok: #16A34A;
  --warn: #B45309;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

@media (min-width: 768px) {
  body.home-page { font-size: 17px; }
}

/* ========== HEADER ========== */
body.home-page .site-header {
  height: 56px;
  min-height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: none;
}

body.home-page .header-inner {
  min-height: 56px;
  height: 56px;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

body.home-page .brand {
  min-width: 0;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

body.home-page .brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  box-shadow: none !important;
  background: var(--accent);
  flex-shrink: 0;
}

body.home-page .header-actions {
  flex-shrink: 0;
  gap: 8px;
}

body.home-page .header-cta {
  display: inline-flex !important;
  height: 36px;
  min-height: 36px;
  border-radius: 999px;
  font-weight: 650;
  padding: 0 14px;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: none !important;
}

@media (min-width: 860px) {
  body.home-page .header-cta {
    height: 40px;
    min-height: 40px;
  }
}

body.home-page .nav-toggle {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 860px) {
  body.home-page .nav-toggle {
    display: none !important;
  }

  body.home-page .site-header > .container-wide > .header-inner > .nav {
    display: flex;
  }
}

body.home-page .btn,
body.home-page .btn-primary,
body.home-page .btn-primary:hover,
body.home-page .home-cta .btn-primary {
  box-shadow: none !important;
}

body.home-page .btn {
  min-height: 48px;
  height: 48px;
  border-radius: 999px;
  font-weight: 650;
}

body.home-page .btn-sm {
  min-height: 36px;
  height: 36px;
}

body.home-page a:hover,
body.home-page a:focus {
  text-decoration: underline;
}

body.home-page .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

body.home-page .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: none;
}

body.home-page .btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

body.home-page a:visited {
  color: #1D4ED8;
}

body.home-page a:focus-visible,
body.home-page button:focus-visible,
body.home-page summary:focus-visible,
body.home-page .tool-card a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-main--home,
body.home-page .site-main--home {
  padding: 0;
  padding-bottom: 0;
}

.site-main--home > .container-wide,
.site-main--home .layout-primary {
  max-width: none;
  padding: 0;
  width: 100%;
}

/* ========== HERO ========== */
.home-hero {
  text-align: center;
  padding: 20px 20px 12px;
  background: var(--bg);
}

.home-hero-inner {
  max-width: 880px;
  margin: 0 auto;
}

.home-hero h1 {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
  text-wrap: balance;
}

body.home-page h1 { line-height: 1.15; text-wrap: balance; }
body.home-page h2 { line-height: 1.2; text-wrap: balance; }
body.home-page h3 { line-height: 1.25; }

.home-hero-intro {
  margin: 0.55rem auto 0;
  max-width: 40rem;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text);
}

.home-hero--tool .breadcrumbs {
  display: flex;
  justify-content: center;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.home-hero--tool .breadcrumbs-list {
  justify-content: center;
}

.home-hero--tool .breadcrumbs a {
  color: var(--muted);
}

.home-hero--tool .breadcrumbs a:hover {
  color: var(--accent);
}

.home-hero-intro.prose > :first-child {
  margin-top: 0;
}

.home-hero-intro.prose > :last-child {
  margin-bottom: 0;
}

.home-hero-intro.prose p {
  margin: 0 0 0.55rem;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.home-page-reviewed {
  margin-top: 1.25rem;
  text-align: center;
}

.home-trust-pills {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  margin: 0.7rem 0 0;
  padding: 0;
  overflow: hidden;
}

.home-trust-pills li {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .home-trust-pills li { font-size: 12px; padding: 0 8px; }
}

/* ========== TOOL PANEL ========== */
.home-tool-section {
  padding: 0 20px 12px;
  background: var(--bg);
}

.home-tool-card {
  max-width: 1040px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 16px;
}

body.home-page .home-tool-card.workbench {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
}

body.home-page .home-tool-card.workbench::before {
  display: none;
}

.home-tool-card .tool-shell {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.home-tool-card .tool-shell--connected,
.home-tool-card:has(.tool-shell--connected) {
  border-color: rgba(22, 163, 74, 0.6);
}

.home-tool-card:has(.tool-shell--connected) {
  border-color: rgba(22, 163, 74, 0.6);
}

.home-tool-label {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.home-tool-help {
  margin: 0.35rem 0 0.7rem;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Status box */
.home-tool-card .tool-status-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 0;
}

.home-tool-card .status-text {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
}

.home-tool-card .status-text::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 0.4em;
  border-radius: 50%;
  background: #94A3B8;
  flex-shrink: 0;
}

.home-tool-card .tool-status-bar[data-connected="1"] .status-text {
  color: #166534;
}

.home-tool-card .tool-status-bar[data-connected="1"] .status-text::before {
  background: var(--ok);
}

.home-tool-card .tool-status-bar [data-engine-recheck] {
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
}

@media (min-width: 640px) {
  .home-tool-card .tool-status-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .home-tool-card .tool-status-bar [data-engine-recheck] {
    width: auto;
    flex-shrink: 0;
  }
}

/* Drawing — no dashed nested box */
body.home-page .home-tool-card .tool-connect {
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0;
  min-height: 0;
}

.home-tool-card .engine-controller--preview {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(4px, 1.5vw, 12px) 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-tool-card .engine-controller--preview {
  margin: 12px 0;
}

.home-tool-card .engine-controller-svg {
  width: min(100%, 460px);
  max-width: 100%;
  height: auto;
  max-height: 150px;
  aspect-ratio: 720 / 420;
  margin: 0 auto;
}

body.home-page .home-chips.tool-quicklinks,
.home-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start !important;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-top: 12px;
  padding: 0;
  padding-left: 0;
}

.home-chips::-webkit-scrollbar { display: none; }

.home-chips a {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
}

.home-chips a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.home-browse-all {
  margin: 12px 0 0;
  text-align: center;
}

.home-browse-all a {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.home-browse-all a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.home-after-tool {
  margin: 0 auto;
  padding: 8px 20px 24px;
  max-width: 760px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  background: var(--bg);
}

/* ========== SECTIONS ========== */
.home-section {
  padding: 44px 20px;
}

.home-section--bg { background: var(--bg); }
.home-section--alt { background: var(--bg-alt); }

.home-below {
  content-visibility: auto;
  contain-intrinsic-size: 1px 720px;
}

.home-copy {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

#all-tools > .home-copy {
  max-width: 1040px;
  width: 100%;
  padding-inline: 20px;
  box-sizing: border-box;
  text-align: left;
}

.home-section h2,
body.home-page .section.home-section > .container > h2,
body.home-page .section.home-section > .container-wide > h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.home-section h2 + p,
.home-section h2 + ol,
.home-section h2 + ul,
.home-section h2 + .table-scroll,
.home-section h2 + .home-controller-grid,
.home-section h2 + .home-faq,
.home-section h2 + .home-about-card,
.home-section h2 + .home-callout,
.home-section h2 + .cta-band,
body.home-page .section.home-section > .container > h2 + p,
body.home-page .section.home-section > .container > h2 + ol,
body.home-page .section.home-section > .container > h2 + .home-callout {
  margin-top: 0;
}

.home-facts-card {
  margin-top: 1rem;
}

.home-facts-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.65rem;
}

.home-facts-list li {
  margin: 0;
}

.home-facts-note {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.home-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.25;
}

.home-steps {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
  counter-reset: home-step;
}

.home-steps li {
  position: relative;
  padding-left: 48px;
  counter-increment: home-step;
}

.home-steps li::before {
  content: counter(home-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.875rem;
  display: grid;
  place-items: center;
}

.home-callout {
  margin-top: 1.25rem;
  padding: 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
}

.home-figure,
.content-figure {
  margin: 1.25rem 0 0;
  max-width: 760px;
  padding: 0;
  border: 0;
  background: none;
}

.content-figure img,
.home-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.home-figure picture {
  display: block;
  line-height: 0;
  margin: 0;
  padding: 0;
}

.home-figure img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin: 0;
  background: #f6f8fc;
}

.home-figure figcaption {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* ========== TOOL CARDS ========== */
.home-tools {
  max-width: 1040px;
  margin: 1rem auto 0;
  padding: 0 20px;
}

.home-tool-group {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-tools .tool-category {
  margin-bottom: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.home-related-grid .tool-card--related {
  position: relative;
}

.home-related-grid .tool-card--related h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

@media (max-width: 639px) {
  .home-related-grid .tool-card--related {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    min-height: 84px;
    height: 84px;
    padding: 12px 14px;
    overflow: hidden;
  }

  .home-related-grid .tool-card--related .tool-card-icon {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
  }

  .home-related-grid .tool-card--related h3,
  .home-related-grid .tool-card--related p {
    margin: 0;
  }

  .home-related-grid .tool-card--related p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .home-related-grid .tool-card--related {
    transition: border-color 150ms ease, transform 150ms ease;
  }

  .home-related-grid .tool-card--related:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: start;
  padding: 14px 16px;
  min-height: 84px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: none;
}

.tool-card--featured {
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 14px 16px;
  margin-bottom: 0.5rem;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 84px;
}

.tool-card-icon {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  align-self: center;
}

.tool-card--featured .tool-card-icon {
  background: #fff;
}

.tool-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  grid-column: 2;
}

.tool-card h3 a {
  color: inherit;
  text-decoration: none;
}

.tool-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  grid-column: 2;
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  max-height: none;
}

@media (prefers-reduced-motion: no-preference) {
  .tool-card {
    transition: border-color 150ms ease;
  }
  .tool-card:hover {
    border-color: var(--accent);
  }
}

.home-controller-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
  align-items: stretch;
}

.home-controller-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.home-controller-card p {
  margin: 0;
  color: var(--text);
}

/* ========== TABLES ========== */
.home-section .table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  margin: 1rem 0;
  -webkit-overflow-scrolling: touch;
}

.home-section .table-scroll table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

body.home-page .home-support-table table {
  min-width: 0 !important;
}

.home-section .table-scroll th,
.home-section .table-scroll td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 15px;
}

.home-section .table-scroll thead th {
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-section .table-scroll tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 640px) {
  .home-capabilities-table {
    overflow-x: visible;
  }

  .home-capabilities-table table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
  }

  .home-capabilities-table th,
  .home-capabilities-table td {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  .home-support-table {
    overflow: visible !important;
    overflow-x: visible !important;
    border: 0;
    background: transparent;
    border-radius: 0;
    max-width: 100%;
  }

  .home-support-table table,
  .home-support-table thead,
  .home-support-table tbody,
  .home-support-table tr,
  .home-support-table th,
  .home-support-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
    white-space: normal;
  }

  .home-support-table table {
    border: 0;
    background: transparent;
  }

  .home-support-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .home-support-table tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 0 0 10px;
    background: #fff;
    box-shadow: none;
  }

  .home-support-table tr:last-child {
    margin-bottom: 0;
  }

  .home-support-table td {
    border: 0;
    padding: 0;
    background: transparent;
  }

  /* Device name = card title, no label */
  .home-support-table td:first-child {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
    padding: 0;
  }

  .home-support-table td:first-child::before {
    content: none;
    display: none;
  }

  /* Remaining fields: label + value, divider between them only */
  .home-support-table td:not(:first-child) {
    padding-top: 10px;
    margin-top: 0;
    border-top: 1px solid var(--border);
  }

  .home-support-table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
  }
}

/* ========== FAQ ========== */
.home-faq {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.home-faq details {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.home-faq details:last-child {
  border-bottom: 0;
}

.home-faq summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.home-faq summary::-webkit-details-marker { display: none; }

.home-faq summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 150ms ease;
  flex-shrink: 0;
}

.home-faq details[open] summary::after {
  transform: rotate(225deg);
}

.home-faq .prose {
  padding: 0 16px 1rem;
}

.home-about-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

.home-cta {
  background: var(--accent-soft);
  border: 0;
  border-radius: 18px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: none;
}

/* ========== CONNECTED STATE (homepage) ========== */
body.home-page #tool-panel [data-engine-dashboard] .tool-quicklinks,
body.home-page #tool-panel [data-engine-dashboard] .engine-note {
  display: none !important;
}

body.home-page #tool-panel .engine-shell-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}

body.home-page #tool-panel .engine-btn {
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}

body.home-page #tool-panel .engine-btn.is-pressed {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: none;
  box-shadow: none;
}

body.home-page #tool-panel .engine-btn.is-pressed strong,
body.home-page #tool-panel .engine-btn.is-pressed span,
body.home-page #tool-panel .engine-btn.is-pressed em {
  color: #fff;
}

body.home-page #tool-panel .engine-btn.was-pressed {
  box-shadow: none;
}

body.home-page #tool-panel .engine-controller-svg .svg-btn.is-on > circle,
body.home-page #tool-panel .engine-controller-svg .svg-btn.is-on > rect {
  fill: var(--accent) !important;
}

body.home-page #tool-panel .engine-controller-svg .svg-btn.is-on .svg-btn-label {
  fill: #fff !important;
}

body.home-page #tool-panel .engine-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.home-page #tool-panel .engine-sticks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

body.home-page #tool-panel .engine-stick-card {
  min-width: 0;
}

body.home-page #tool-panel .engine-stick {
  min-height: 150px;
  width: 100%;
}

body.home-page #tool-panel .engine-triggers {
  width: 100%;
}

body.home-page #tool-panel .engine-layout--pro {
  overflow-x: clip;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  body.home-page #tool-panel .engine-btn {
    transition: none;
  }
}

@media (min-width: 768px) {
  body.home-page #tool-panel .engine-buttons {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ========== FOOTER ========== */
body.home-page .site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 0 24px;
  margin: 0;
}

body.home-page .footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1rem;
}

body.home-page .footer-brand {
  grid-column: 1 / -1;
}

@media (min-width: 640px) and (max-width: 1023px) {
  body.home-page .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.home-page .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  body.home-page .footer-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
  }

  body.home-page .footer-brand {
    grid-column: auto;
  }
}

body.home-page .footer-brand p {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

body.home-page .footer-col-title {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

body.home-page .footer-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}

body.home-page .footer-col a:hover {
  color: var(--text);
  text-decoration: underline;
}

body.home-page .footer-bottom {
  justify-content: center;
  text-align: center;
  border-top-color: var(--border);
}

/* ========== BREAKPOINTS ========== */
@media (min-width: 640px) {
  .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .tool-card,
  .tool-card--featured {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0.45rem;
    padding: 20px;
    min-height: 0;
  }

  .tool-card-icon {
    grid-row: auto;
    align-self: start;
  }

  .tool-card h3,
  .tool-card p {
    grid-column: auto;
  }

  .tool-card p {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

@media (min-width: 700px) {
  .home-controller-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home-page .footer-grid {
    grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr));
  }

  body.home-page .footer-brand {
    grid-column: auto;
  }
}

@media (min-width: 768px) {
  body.home-page .site-header,
  body.home-page .header-inner {
    height: 60px;
    min-height: 60px;
  }

  body.home-page .header-cta {
    height: 40px;
    min-height: 40px;
    padding: 0 0.85rem;
    font-size: 0.875rem;
  }

  .home-hero {
    padding: 40px 32px 24px;
  }

  .home-hero h1 {
    font-size: clamp(2rem, 1.4rem + 1.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .home-hero-intro {
    font-size: 16px;
  }

  .home-trust-pills {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .home-trust-pills li {
    height: 32px;
    padding: 0 0.85rem;
    font-size: 13px;
  }

  .home-tool-section,
  .home-section,
  .home-tools {
    padding-left: 32px;
    padding-right: 32px;
  }

  #all-tools > .home-copy {
    padding-inline: 32px;
  }

  .home-section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .home-section h2,
  body.home-page .section.home-section > .container > h2,
  body.home-page .section.home-section > .container-wide > h2 {
    margin-bottom: 18px;
    font-size: clamp(1.5rem, 1.15rem + 1.8vw, 2.125rem);
  }

  .home-tool-card {
    padding: 24px;
    border-radius: 18px;
  }

  .home-tool-label {
    font-size: 18px;
  }

  .home-tool-help {
    font-size: 15px;
  }

  .home-tool-card .tool-shell {
    min-height: 440px;
  }

  .home-tool-card .engine-controller-svg {
    width: min(100%, 520px);
    max-height: 240px;
  }

  .home-chips {
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (min-width: 1024px) {
  .home-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
  .home-faq summary::after { transition: none; }
}
