/* ============================================================
   EMI Sleuth Theme - main.css
   ============================================================ */

/* 1. Variables */
:root {
  --c-bg:       #080f1e;
  --c-surf:     #0d1b35;
  --c-surf-2:   #112040;
  --c-accent:   #00c2df;
  --c-accent-h: #33d4ed;
  --c-text:     #ddeaff;
  --c-muted:    #7a9bbf;
  --c-border:   #1a3058;
  --nav-h:      64px;
  --max-w:      1200px;
  --r:          8px;
  --r-lg:       16px;
  --t:          0.18s ease;
}

/* 2. Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--c-accent-h); }

/* 3. Base */
html { scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; }

/* 4. Typography */
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 700; line-height: 1.3; margin: 2rem 0 0.9rem; color: var(--c-text); }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.7rem; color: var(--c-text); }
h4 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
p  { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }
strong { color: var(--c-text); font-weight: 600; }
em { color: var(--c-muted); }

code {
  background: var(--c-surf-2);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 0.15em 0.45em;
  font-size: 0.875em;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}
pre {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
pre code { background: none; border: none; padding: 0; font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; overflow-x: auto; display: block; }
th {
  background: var(--c-surf-2);
  border: 1px solid var(--c-border);
  padding: 0.55rem 0.8rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
td { border: 1px solid var(--c-border); padding: 0.55rem 0.8rem; vertical-align: top; }
/*
tr:nth-child(even) td { background: rgba(13,27,53,0.5); }
tr:hover td { background: rgba(0,194,223,0.04); }
*/

blockquote {
  border-left: 3px solid var(--c-accent);
  background: var(--c-surf);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--c-muted);
}

hr { border: none; border-top: 1px solid var(--c-border); margin: 2rem 0; }

/* 5. Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* 6. Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 15, 30, 0.94);
  /* backdrop-filter moved to ::before — keeps blur effect but does NOT
     create a CSS containing block for position:fixed children (the mobile
     nav overlay). Without this fix, Chrome/Safari treat the overlay as
     positioned relative to the 64px header, giving it zero visible height. */
  border-bottom: 1px solid var(--c-border);
  height: var(--nav-h);
  overflow: visible;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
  pointer-events: none;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--c-text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--c-accent); }
.logo-img {
  height: 55px;        
  width: auto;         
  display: block;
  object-fit: contain;
}
.logo-icon { font-size: 1.25rem; }
.logo-badge {
  background: var(--c-accent);
  color: var(--c-bg);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1.4;
}
.main-nav { display: flex; align-items: center; }
.nav-list {
  display: flex;
  list-style: none;
  padding: 0; margin: 0;
  gap: 0.15rem;
  align-items: center;
}
.nav-item > a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--c-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: var(--r);
  transition: color var(--t), background var(--t);
  white-space: nowrap;
}
.nav-item > a:hover, .nav-item > a.active {
  color: var(--c-text);
  background: rgba(255,255,255,0.06);
}
.nav-item.has-dropdown { position: relative; }
.dropdown-arrow { font-size: 0.65rem; margin-left: 1px; transition: transform var(--t); display: inline-block; }
.nav-item.has-dropdown:hover .dropdown-arrow,
.nav-item.has-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 0.4rem;
  padding-top: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200;
}
.nav-item.has-dropdown:hover .nav-dropdown,
.nav-item.has-dropdown.open .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block;
  color: var(--c-muted);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: color var(--t), background var(--t);
}
.nav-dropdown a:hover { color: var(--c-text); background: var(--c-surf-2); }

.nav-dropdown li {
	list-style: none;
}
/* "All Services →" / "All Tools →" top link in dropdown menus.
   Mobile users cannot navigate to section index pages via the parent label
   (it only opens the sub-menu), so this entry provides that path. */
.nav-dropdown-viewall a {
  font-weight: 600;
  color: var(--c-accent) !important;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 4px;
  padding-bottom: 8px !important;
}
.nav-dropdown-viewall a:hover {
  background: rgba(0,194,223,0.08) !important;
}


.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: var(--t);
  transform-origin: center;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 7. Hero */
.hero {
  padding: 80px 0 72px;
  background: radial-gradient(ellipse 70% 50% at 70% -10%, rgba(0,194,223,0.1) 0%, transparent 60%),
              radial-gradient(ellipse 40% 60% at 10% 80%, rgba(0,80,160,0.08) 0%, transparent 50%);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0,194,223,0.1);
  border: 1px solid rgba(0,194,223,0.3);
  color: var(--c-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.hero-title { color: var(--c-text); margin-bottom: 1.25rem; }
.hero-title span { color: var(--c-accent); }
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--c-muted);
  max-width: 580px;
  margin-bottom: 2.25rem;
  line-height: 1.75;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

/* 8. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--t);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-primary {
  background: var(--c-accent);
  color: var(--c-bg);
  border-color: var(--c-accent);
}
.btn-primary:hover {
  background: var(--c-accent-h);
  border-color: var(--c-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,194,223,0.35);
  color: var(--c-bg);
}
.btn-outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-outline:hover {
  background: var(--c-surf);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* 9. Cards */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: rgba(0,194,223,0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}
.card-icon { font-size: 1.75rem; margin-bottom: 0.9rem; }
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--c-text); }
.card-body { color: var(--c-muted); font-size: 0.875rem; line-height: 1.65; flex: 1; }
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent);
}
.card-link:hover { color: var(--c-accent-h); }

/* Section index list */
.section-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--c-border);
}

.section-list-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.95rem;
}

.section-list-item a {
  font-weight: 600;
  color: var(--c-text);
}

.section-list-item a:hover {
  color: var(--c-accent);
}

.section-list-desc {
  color: var(--c-muted);
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

/* 10. Page chrome */
.page-header {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 44px;
  background: linear-gradient(135deg, var(--c-surf) 0%, transparent 70%);
}
.page-desc { color: var(--c-muted); font-size: 1rem; margin-top: 0.6rem; max-width: 680px; }

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
  font-size: 0.8rem;
  color: var(--c-muted);
}
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb-sep { color: var(--c-border); }

.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 72px;
}
.content-body { max-width: 820px; }

/* 11. Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--c-surf); }
.section-title { margin-top: 0; margin-bottom: 0.6rem; }
.section-subtitle {
  color: var(--c-muted);
  max-width: 580px;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* 12. Info / services grids */
.info-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.info-block h3 { color: var(--c-accent); margin-top: 0; }

/* 13. Tool pages */
.tool-widget {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.tool-widget h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.tool-widget table { display: table; width: auto; margin-bottom: 0.5rem; }
.tool-widget th, .tool-widget td { text-transform: none; font-size: 0.875rem; }
.tool-widget input[type=number],
.tool-widget input[type=text],
.tool-widget select {
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--t);
}
.tool-widget input:focus, .tool-widget select:focus {
  outline: none;
  border-color: var(--c-accent);
}
.tool-widget input[type=range] { accent-color: var(--c-accent); cursor: pointer; }
.tool-widget button,
.tool-widget input[type=button],
.tool-widget input[type=submit] {
  background: var(--c-accent);
  color: var(--c-bg);
  border: none;
  border-radius: var(--r);
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), transform var(--t);
  font-family: inherit;
}
.tool-widget button:hover { background: var(--c-accent-h); transform: translateY(-1px); }
.tool-widget label { font-size: 0.875rem; color: var(--c-muted); }
.tool-widget a { color: var(--c-accent); }

.tool-symbol {
	max-height: 60px
}

.harnessflow_logo {
	max-height: 60px;
	width: 100%; 
	text-align: center;
}

.harnessflow_logo img {
	max-height: 60px;
}

/* 14. Contact page */
.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 3rem;
}
.contact-card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 2rem;
}
.contact-card h2 { margin-top: 0; }
.contact-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.contact-icon { font-size: 1.1rem; margin-top: 3px; flex-shrink: 0; }
.contact-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--c-muted); margin-bottom: 0.15rem; }
.contact-value { font-weight: 500; font-size: 0.95rem; }
.contact-value a { color: var(--c-text); }
.contact-value a:hover { color: var(--c-accent); }

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
  color: var(--c-muted);
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(0,194,223,0.1);
}
.form-group textarea { resize: vertical; min-height: 140px; }

/* 15. About block */
.about-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: auto 1fr;
  align-items: start;
}
.about-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid var(--c-accent);
  overflow: hidden;
  background: var(--c-surf-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  flex-shrink: 0;
}
.about-creds { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.cred-badge {
  background: rgba(0,194,223,0.08);
  border: 1px solid rgba(0,194,223,0.25);
  border-radius: var(--r);
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-accent);
}

/* 16. Footer */
.site-footer {
  background: var(--c-surf);
  border-top: 1px solid var(--c-border);
  padding: 48px 0 0;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding-bottom: 2rem;
}
.footer-brand .site-logo { margin-bottom: 0.75rem; }
.footer-tagline { color: var(--c-muted); font-size: 0.85rem; line-height: 1.6; margin-top: 0.5rem; }
.footer-contact-mini { margin-top: 1rem; font-size: 0.85rem; }
.footer-contact-mini a { color: var(--c-muted); }
.footer-contact-mini a:hover { color: var(--c-accent); }
.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-muted);
  margin: 0 0 0.9rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.45rem; }
.footer-col a { color: var(--c-muted); font-size: 0.85rem; }
.footer-col a:hover { color: var(--c-accent); }
.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--c-muted);
}
.footer-certifications { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cert-badge {
  background: var(--c-surf-2);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  color: var(--c-muted);
}

/* Light theme section pages */
body.section-tools,
body.section-emc-test-methods {
  --c-bg:       #ffffff;
  --c-surf:     #f0f5fb;
  --c-surf-2:   #e2ecf7;
  --c-accent:   #0090a8;   /* darker teal - readable on white */
  --c-accent-h: #007a90;
  --c-text:     #0d1b35;   /* the dark theme's bg colour becomes text */
  --c-muted:    #4a6080;
  --c-border:   #c8d8ec;
}

/* Keep the footer dark on light pages */
body.section-tools .site-footer,
body.section-emc-test-methods .site-footer {
  --c-bg:     #080f1e;
  --c-surf:   #0d1b35;
  --c-surf-2: #112040;
  --c-text:   #ddeaff;
  --c-muted:  #7a9bbf;
  --c-border: #1a3058;
  background: #0d1b35;
}

.download-list {
	display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.download-label {
  min-width: 180px;   /* keeps icons vertically aligned across rows */
  font-weight: 500;
  font-size: 0.95rem;
}

.download-icon {
  height: 50px;
  width: auto;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 3px;
  transition: border-color 0.15s ease;
}

.download-link:hover .download-icon {
  border-color: var(--c-accent);
}

.alignment-table {
	border: none;
  background: transparent;
  border-collapse: collapse;
}

.alignment-table td {
  border: none;
  background: transparent;
  padding: 4px 10px;
  vertical-align: middle;
}

/* Fix table striping (was a hardcoded dark rgba) */
body.section-emc-test-methods tr:nth-child(even) td {
  background: rgba(0, 144, 168, 0.06);
}

/* 17. Utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* 18. Responsive */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: var(--c-bg);
    overflow-y: auto;
    padding: 1rem 1.5rem 2rem;
    z-index: 99;
    border-top: 1px solid var(--c-border);
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
  }
  .main-nav.open {
    display: block;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-item > a {
    padding: 0.75rem 0;
    border-radius: 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 1rem;
    color: var(--c-text);
  }
  .nav-dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: none;
    padding: 0 0 0 1rem;
    border-radius: 0;
  }
  .nav-item.has-dropdown.open .nav-dropdown { display: block; }
  .nav-dropdown a {
    padding: 0.55rem 0;
    border-radius: 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(26,48,88,0.4);
  }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { margin: 0 auto; }
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px) {
  .hero { padding: 48px 0 40px; }
  .section { padding: 44px 0; }
  .page-header { padding: 32px 0 20px; margin-bottom: 28px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  h2 { font-size: 1.4rem; }
}

/* =================================================================
   HarnessFlow -- Full-Screen Application Layout
   Applied via themes/emisleuth/layouts/tools/harnessflow.html
   All rules are scoped to .hf-app or child IDs.
   Strictly ASCII only.
   ================================================================= */

/* The .hf-app is rendered directly inside <main class="site-main">
   so the only chrome above it is the sticky nav bar (--nav-h: 64px).
   The layout template omits .page-header and .page-content entirely. */

.hf-app {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--nav-h));
  min-height: 520px;
  overflow: hidden;
  background: #0c0c0c;
  border-top: 1px solid #1a1a1a;
}

/* ---- Left sidebar ---- */

.hf-sidebar {
  flex: 0 0 210px;
  min-width: 150px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  background: #0c0c0c;
  border-right: 1px solid #1c1c1c;
  overflow: hidden;
}

.hf-logo {
  flex: 0 0 auto;
  padding: 7px 10px;
  background: #080808;
  border-bottom: 1px solid #1e2e3e;
  display: flex;
  align-items: center;
}

.hf-logo img {
  display: block;
  max-height: 38px;
  width: auto;
}

#tool_menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 9px 20px;
  color: #c8d8e8;
  font-size: 0.79rem;
  line-height: 1.4;
  scrollbar-width: thin;
  scrollbar-color: #2a3a4a #0c0c0c;
}

#tool_menu::-webkit-scrollbar       { width: 5px; }
#tool_menu::-webkit-scrollbar-track { background: #0c0c0c; }
#tool_menu::-webkit-scrollbar-thumb { background: #2a3a4a; border-radius: 3px; }

.hf-menu-idle {
  display: block;
  color: #3a5060;
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.6;
  padding: 10px 0 4px;
}

/* Labels generated by generate_menu() */
#tool_menu label {
  display: block;
  color: #7aaec8;
  font-size: 0.7rem;
  font-weight: 500;
  margin: 6px 0 2px;
}

/* Text inputs: generate_menu writes <input size="20"> without a type attribute */
#tool_menu input[size],
#tool_menu input[type="text"] {
  display: block;
  background: #141414;
  color: #dce8f0;
  border: 1px solid #253545;
  border-radius: 4px;
  padding: 4px 7px;
  font-size: 0.77rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  width: calc(100% - 2px);
  max-width: 192px;
  box-sizing: border-box;
  margin-bottom: 2px;
  transition: border-color 0.14s;
}

#tool_menu input[size]:focus,
#tool_menu input[type="text"]:focus,
#tool_menu select:focus {
  outline: none;
  border-color: #00c2df;
  box-shadow: 0 0 0 2px rgba(0,194,223,0.13);
}

#tool_menu select {
  display: block;
  background: #141414;
  color: #dce8f0;
  border: 1px solid #253545;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.77rem;
  font-family: inherit;
  width: calc(100% - 2px);
  max-width: 192px;
  cursor: pointer;
  margin-bottom: 2px;
}

#tool_menu input[type="checkbox"] {
  display: inline-block;
  accent-color: #00c2df;
  width: 14px;
  height: 14px;
  cursor: pointer;
  vertical-align: middle;
  margin: 0 5px 2px 0;
}

/* Section separators: generate_menu writes <hr><br> */
#tool_menu hr {
  border: none;
  border-top: 1px solid #1c2c3c;
  margin: 10px 0 4px;
}

/* Tighten the visual gap from bare <br> tags in generate_menu output */
#tool_menu br {
  line-height: 0.4;
}

/* ---- Right workspace ---- */

.hf-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ---- Toolbar ---- */

.hf-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #111111;
  border-bottom: 2px solid #1e1e1e;
  min-height: 54px;
}

.hf-btn-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.hf-toolbar-divider {
  width: 1px;
  height: 30px;
  background: #2a2a2a;
  margin: 0 6px;
  flex-shrink: 0;
}

.hf-toolbar-spacer {
  flex: 1;
  min-width: 8px;
}

.hf-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  min-width: 44px;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}

.hf-btn img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0.82);
  transition: filter 0.12s;
}

.hf-btn-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  color: #607080;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.12s;
}

.hf-btn:hover {
  background: rgba(0,194,223,0.12);
  border-color: rgba(0,194,223,0.25);
  transform: translateY(-1px);
}

.hf-btn:hover img          { filter: brightness(1.1); }
.hf-btn:hover .hf-btn-label { color: #00c2df; }
.hf-btn:active             { transform: translateY(0); }

.hf-btn-primary {
  border-color: rgba(0,194,223,0.2);
  background: rgba(0,194,223,0.06);
}

.hf-btn-primary img          { filter: brightness(1.0); }
.hf-btn-primary .hf-btn-label { color: #3a9ab0; }
.hf-btn-primary:hover        { background: rgba(0,194,223,0.2); border-color: #00c2df; }

.hf-btn-danger:hover {
  background: rgba(200,50,50,0.15);
  border-color: rgba(200,80,80,0.4);
}

.hf-btn-danger:hover .hf-btn-label { color: #e06060; }

/* ---- Main canvas / display area ---- */

.hf-canvas {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 14px 16px;
  background: #ffffff;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  scrollbar-width: thin;
  scrollbar-color: #b0c4d8 #eef3f9;
}

.hf-canvas::-webkit-scrollbar       { width: 8px; height: 8px; }
.hf-canvas::-webkit-scrollbar-track { background: #eef3f9; }
.hf-canvas::-webkit-scrollbar-thumb { background: #b0c4d8; border-radius: 4px; }

/* Plotly renders at hardcoded 800x800; allow the canvas to scroll */
#plotly_div {
  flex-shrink: 0;
  align-self: flex-start;
}

/* ---- Examples ---- */

#examples_div h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0d1b35;
  margin: 2px 0 10px;
}

#examples_div button {
  display: block;
  background: #f0f5fb;
  color: #0d1b35;
  border: 1px solid #c8d8ec;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  max-width: 440px;
  text-align: left;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

#examples_div button:hover {
  background: rgba(0,144,168,0.1);
  border-color: #0090a8;
  color: #0090a8;
}

/* ---- Loading spinner ---- */

#loading_spinner {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100%;
}

#loading_spinner img { max-width: 60px; }

#download-status {
  font-size: 0.82rem;
  color: #4a6080;
  min-height: 1em;
}

/* ---- Simulation results ---- */

.results_report { width: 100%; }

.results_row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.results_cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.results_label {
  font-weight: 700;
  color: #0d1b35;
  font-size: 0.92rem;
  white-space: nowrap;
}

#sim_results table,
.results_table {
  border-collapse: collapse;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid #c8d8ec;
}

#sim_results td,
#sim_results th,
.results_table td,
.results_table th {
  border: 1px solid #c8d8ec;
  padding: 3px 10px;
  text-align: right;
  color: #0d1b35;
  text-transform: none;
  font-size: 0.78rem;
}

#sim_results th,
.results_table th {
  background: #e2ecf7;
  font-weight: 600;
  color: #0090a8;
}

#sim_results tr:nth-child(even) td,
.results_table tr:nth-child(even) td {
  background: #f6f9fd;
}

#sim_results h3 { color: #cc2222; font-size: 0.9rem; margin-bottom: 4px; }
#sim_results p  { font-size: 0.84rem; color: #4a6080; margin-bottom: 6px; }

/* ---- S-parameter canvas ---- */

#sparam_results { width: 100%; }

#sparam_results > b {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0d1b35;
  margin-bottom: 6px;
}

#sparam_canvas {
  display: block;
  border: 1px solid #c8d8ec;
  border-radius: var(--r);
  background: #ffffff;
  max-width: 100%;
}

/* ---- Documentation section below the app ---- */

.hf-docs {
  padding: 2.5rem 0 3rem;
}

/* ---- Print ---- */

.print_title { display: none; }

@media print {
  .print_title { display: block; }
  .hf-toolbar  { display: none !important; }
  .hf-sidebar  { display: none !important; }
  .hf-app      { height: auto !important; display: block !important; }
  .hf-canvas   { overflow: visible !important; }
}


/* Mobile warning banner shown on HarnessFlow when screen < 900px */
.hf-mobile-warning {
  display: none;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 194, 223, 0.08);
  border: 1px solid var(--c-accent);
  border-radius: var(--r);
  color: var(--c-muted);
  font-size: 0.875rem;
  margin: 0.75rem 1rem;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .hf-mobile-warning { display: block; }
}


/* Tool pages — prevent horizontal overflow on narrow screens */
@media (max-width: 580px) {
  .page-content { overflow-x: auto; }
  .page-content table,
  .page-content pre { font-size: 0.8rem; }
}
/* ---- Responsive ---- */

@media (max-width: 900px) {
  .hf-app {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - var(--nav-h));
  }
  .hf-sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid #1c1c1c;
    flex-direction: row;
  }
  .hf-logo {
    border-right: 1px solid #1e2e3e;
    border-bottom: none;
    flex-shrink: 0;
  }
  #tool_menu {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: flex-end;
    gap: 4px 14px;
    padding: 6px 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  #tool_menu br { display: none; }
  .hf-workspace { flex: 1; min-height: 480px; }
}

@media (max-width: 600px) {
  .hf-btn img       { width: 24px !important; height: 24px !important; }
  .hf-btn-label     { display: none; }
  .hf-toolbar       { min-height: 44px; padding: 4px 6px; gap: 1px; }
  .hf-toolbar-divider { margin: 0 3px; }
}