:root {
  color-scheme: light;
  --bg-canvas: #eceeea;
  --bg-surface: #f5f6f3;
  --bg-surface-hover: #e9ece8;
  --bg-sidebar: #e3e6e2;
  --bg-header: #eef0ed;
  --bg-table-header: #e5e8e4;
  --border-default: #c7ccc7;
  --border-muted: #d9ded9;
  --text-primary: #272a2d;
  --text-secondary: #5d6364;
  --text-disabled: #6e7781;
  --accent-teal: #006b62;
  --accent-teal-muted: rgb(0 107 98 / 11%);
  --bg: var(--bg-canvas);
  --surface: var(--bg-surface);
  --surface-muted: #dfe3de;
  --surface-subtle: #e9ece8;
  --surface-hover: var(--bg-surface-hover);
  --control-bg: #eff1ee;
  --border: var(--border-default);
  --border-strong: #aeb4ae;
  --text: var(--text-primary);
  --text-muted: var(--text-secondary);
  --accent: #006b62;
  --accent-dark: #00564f;
  --accent-soft: var(--accent-teal-muted);
  --danger: #a1342e;
  --good: #11664c;
  --good-indicator: #16805f;
  --warning: #856000;
  --warning-indicator: #c28a00;
  --critical: #96332d;
  --critical-indicator: #bd4038;
  --sidebar: var(--bg-sidebar);
  --sidebar-muted: #9eaaaf;
  --sidebar-active: #f0f6f6;
  --sidebar-text: #dce2e4;
  --sidebar-border: #354146;
  --sidebar-hover: #2a353a;
  --on-accent: #ffffff;
  --dialog-overlay: rgb(24 33 38 / 45%);
  --dialog-shadow: 0 18px 60px rgb(0 0 0 / 35%);
  --shadow: 0 2px 8px rgb(24 33 38 / 5%);
  font-family:
    Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #101419;
  --bg-surface: #1e252d;
  --bg-surface-hover: #29323c;
  --bg-sidebar: #151a20;
  --bg-header: #191f26;
  --bg-table-header: #242c35;
  --border-default: #36414d;
  --border-muted: #29323c;
  --text-primary: #e3e8ee;
  --text-secondary: #a7b1bd;
  --text-disabled: #6f7b88;
  --accent-teal: #5fc8bd;
  --accent-teal-muted: rgb(95 200 189 / 13%);
  --bg: var(--bg-canvas);
  --surface: var(--bg-surface);
  --surface-muted: #28313b;
  --surface-subtle: #171d24;
  --surface-hover: var(--bg-surface-hover);
  --control-bg: #141a20;
  --border: var(--border-default);
  --border-strong: #4b5663;
  --text: var(--text-primary);
  --text-muted: var(--text-secondary);
  --accent: #5fc8bd;
  --accent-dark: #85dbd2;
  --accent-soft: var(--accent-teal-muted);
  --danger: #ff8f88;
  --good: #78d8b5;
  --good-indicator: #3fbd8e;
  --warning: #f1c75b;
  --warning-indicator: #d6a92e;
  --critical: #ff9992;
  --critical-indicator: #e7655c;
  --sidebar: var(--bg-sidebar);
  --sidebar-muted: #8f9ba8;
  --sidebar-active: #e8eef5;
  --sidebar-text: #c7d2de;
  --sidebar-border: #28313b;
  --sidebar-hover: #202730;
  --on-accent: #ffffff;
  --dialog-overlay: rgb(8 11 14 / 76%);
  --dialog-shadow: 0 20px 68px rgb(0 0 0 / 56%);
  --shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 268px;
  overflow-y: auto;
  color: var(--sidebar-text);
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  padding: 0 22px;
  font-size: 17px;
  font-weight: 650;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 750;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
}

nav {
  padding: 18px 12px 32px;
}

.nav-link,
.nav-parent,
.nav-future span,
.nav-placeholder {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--sidebar-text);
  font-size: 14px;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--sidebar-active);
  background: var(--sidebar-hover);
}

.nav-link.active {
  color: var(--sidebar-active);
  font-weight: 600;
  background: var(--accent-teal-muted);
  border-left-color: var(--accent-teal);
}

.nav-icon {
  display: inline-grid;
  width: 18px;
  place-items: center;
  color: var(--sidebar-muted);
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.nav-section-label {
  margin: 26px 12px 10px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group {
  border-bottom: 1px solid var(--sidebar-border);
  padding: 3px 0;
}

.nav-parent {
  font-weight: 600;
}

.nav-parent > span:not(.nav-icon) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-collapsible > summary {
  list-style: none;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-collapsible > summary::-webkit-details-marker {
  display: none;
}

.nav-collapsible > summary::after {
  content: "›";
  margin-left: auto;
  color: var(--sidebar-muted);
  font-size: 18px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.nav-collapsible[open] > summary::after {
  transform: rotate(90deg);
}

.nav-collapsible > summary:hover {
  color: var(--sidebar-active);
  background: var(--sidebar-hover);
}

.nav-collapsible.active-branch > summary {
  color: var(--sidebar-active);
  background: var(--accent-soft);
  border-left-color: var(--accent-teal);
}

.nav-collapsible.active-branch > summary .nav-icon {
  color: var(--accent-teal);
}

.nav-tool-groups {
  padding: 2px 0 5px;
}

.nav-tool-groups > .nav-collapsible > summary {
  padding-left: 12px;
}

.nav-section {
  margin-top: 5px;
}

.nav-disclosure-content {
  overflow: clip;
  transform-origin: top;
  animation: nav-disclosure-open 160ms ease-out;
}

@keyframes nav-disclosure-open {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-subgroup {
  margin-left: 22px;
  border-left: 1px solid var(--sidebar-border);
}

.nav-parent-small {
  min-height: 32px;
  color: var(--sidebar-text);
  font-size: 12px;
}

.nav-link-nested {
  min-height: 36px;
  padding: 7px 10px 7px 42px;
  font-size: 12px;
}

.nav-placeholder {
  min-height: 34px;
  padding: 6px 10px 6px 42px;
  color: var(--sidebar-muted);
  font-size: 12px;
  cursor: default;
}

.nav-placeholder::after {
  content: "Coming Soon";
  margin-left: auto;
  padding: 3px 7px;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
}

.nav-disclosure-content > .nav-placeholder:only-child::after {
  content: none;
}

.nav-placeholder.standards-planned::after {
  content: "Planned";
}

.nav-placeholder-list {
  margin-bottom: 10px;
}

.nav-component-groups > .nav-parent-small {
  margin-top: 7px;
}

.nav-primary-list > .nav-placeholder {
  padding-left: 42px;
}

.standards-list {
  margin-left: 30px;
}

.nav-future {
  margin-top: 12px;
}

.nav-future span {
  color: var(--sidebar-muted);
  cursor: default;
}

.nav-future span::after {
  content: "Future";
  margin-left: auto;
  color: var(--sidebar-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace {
  min-height: 100vh;
  margin-left: 268px;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  padding: 0 36px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

.topbar-context {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.topbar-context span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-context strong {
  font-size: 14px;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px 0;
  background: var(--text);
}

main {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 32px 36px 56px;
}

.page {
  width: 100%;
  margin-inline: auto;
}

.page[hidden] {
  display: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 18px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.breadcrumbs strong {
  color: var(--text);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-underline-offset: 3px;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible,
.breadcrumbs a[aria-current="page"] {
  color: var(--text);
}

.breadcrumbs a[aria-current="page"] {
  font-weight: 650;
  text-decoration: none;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 680;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 670;
}

.page-summary {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.formula-note {
  min-width: 170px;
  padding: 6px 9px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border-muted);
}

.formula-note span,
.formula-note strong {
  display: block;
}

.formula-note span {
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.formula-note strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.content-section {
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-heading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-number {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.connection-status {
  color: var(--text-muted);
  font-size: 12px;
}

.connection-status.connected::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 80px minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 24px 26px 18px;
}

.awg-conversion-layout .calculator-layout {
  grid-template-columns: minmax(0, 1fr);
}

.awg-conversion-layout {
  align-items: stretch;
  margin-bottom: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-muted);
}

.awg-conversion-layout > .input-stack,
.awg-conversion-layout > .result-stack {
  height: 100%;
}

.conversion-field label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 650;
}

.conversion-field small {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  height: 52px;
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
}

.input-with-unit:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-with-unit input {
  min-width: 0;
  padding: 0 16px;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 650;
  background: transparent;
  border: 0;
  outline: 0;
}

.input-with-unit span {
  display: grid;
  min-width: 64px;
  place-items: center;
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-muted);
  border-left: 1px solid var(--border);
}

.conversion-indicator {
  display: flex;
  align-items: center;
  color: var(--accent);
}

.conversion-indicator span {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.conversion-indicator strong {
  padding: 0 8px;
  font-size: 22px;
}

.calculator-error {
  min-height: 22px;
  margin: 0;
  padding: 0 26px 16px;
  color: var(--danger);
  font-size: 13px;
}

.search-field {
  display: grid;
  grid-template-columns: auto minmax(160px, 240px);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.search-field span {
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-field input {
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  color: var(--text);
  background: var(--control-bg);
  border: 0;
  border-left: 1px solid var(--border);
  outline: 0;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tool-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-strong);
}

.tool-tab {
  min-height: 42px;
  padding: 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tool-tab:hover {
  color: var(--text);
  background: var(--surface-muted);
}

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

.voltage-drop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
  gap: 16px;
}

.input-panel,
.result-panel {
  margin-bottom: 0;
}

.input-group {
  margin: 0;
  padding: 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.input-group legend {
  width: 100%;
  margin-bottom: 13px;
  padding: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.engineering-field {
  display: block;
  min-width: 0;
}

.engineering-field > span:first-child {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 650;
}

.input-with-unit.compact {
  display: grid;
  height: 44px;
}

.input-with-unit.compact input {
  font-size: 16px;
}

.engineering-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: 0;
}

.engineering-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
}

.form-actions > span {
  color: var(--text-muted);
  font-size: 11px;
}

.primary-button {
  min-width: 120px;
  height: 40px;
  padding: 0 18px;
  color: var(--on-accent);
  font-weight: 650;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  border-radius: 4px;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button,
.icon-button,
.row-actions button {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
}

.secondary-button {
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
}

.secondary-button:hover:not(:disabled),
.row-actions button:hover {
  border-color: var(--accent);
}

.secondary-button:disabled {
  color: var(--text-muted);
  background: var(--surface-muted);
  cursor: not-allowed;
  opacity: 0.75;
}

.primary-button:focus-visible,
.tool-tab:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.input-panel .calculator-error {
  min-height: 20px;
  padding: 0 20px 14px;
}

.assessment {
  display: flex;
  min-height: 96px;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}

.assessment-indicator {
  width: 12px;
  height: 48px;
  background: var(--border-strong);
}

.assessment > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.assessment span,
.assessment small {
  color: var(--text-muted);
  font-size: 11px;
}

.assessment strong {
  font-size: 19px;
}

.assessment.good .assessment-indicator {
  background: var(--good-indicator);
}

.assessment.good strong {
  color: var(--good);
}

.assessment.acceptable .assessment-indicator {
  background: var(--warning-indicator);
}

.assessment.acceptable strong {
  color: var(--warning);
}

.assessment.too-high .assessment-indicator {
  background: var(--critical-indicator);
}

.assessment.too-high strong {
  color: var(--critical);
}

.result-grid {
  margin: 0;
}

.result-grid > div {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.result-grid > div:last-child {
  border-bottom: 0;
}

.result-grid dt {
  color: var(--text-muted);
  font-size: 12px;
}

.result-grid dd {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.result-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.result-stack .content-section {
  margin-bottom: 0;
}

.engineering-notes ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px 20px 18px 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.engineering-notes li::marker {
  color: var(--accent);
}

.formula-details {
  margin: 0 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.content-section.formula-parent {
  margin-bottom: 16px;
  border-radius: 6px;
}

.input-stack {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.input-stack > .formula-details {
  margin-bottom: 0;
}

.formula-card-heading {
  border-top: 2px solid var(--accent);
}

.formula-details-body {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.formula-details h3 {
  margin: 0 0 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.formula-expressions {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border-left: 3px solid var(--accent);
}

.formula-expressions code {
  display: block;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.formula-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.formula-variable-table th,
.formula-variable-table td {
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  white-space: normal;
}

.formula-variable-table th:first-child,
.formula-variable-table td:first-child {
  width: 18%;
}

.formula-variable-table th:last-child,
.formula-variable-table td:last-child {
  width: 24%;
}

.formula-variable-table td:first-child code {
  color: var(--accent-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.formula-assumptions,
.formula-references {
  padding: 13px 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.formula-assumptions p,
.formula-references p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.practical-guidance p {
  margin: 0;
  padding: 16px 20px 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.related-tools-section {
  width: 100%;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--border-strong);
}

.torque-reference {
  margin-top: 26px;
}

.reference-scope {
  color: var(--text-muted);
  font-size: 11px;
}

.reference-disclaimer {
  padding: 16px 20px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--warning-indicator);
}

.reference-disclaimer strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.reference-disclaimer p {
  max-width: 1000px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.torque-reference-table {
  min-width: 900px;
}

.torque-reference-table th,
.torque-reference-table td {
  text-align: left;
  vertical-align: top;
}

.torque-reference-table th:nth-child(2),
.torque-reference-table th:nth-child(3),
.torque-reference-table td:nth-child(2),
.torque-reference-table td:nth-child(3) {
  white-space: nowrap;
}

.torque-reference-table td:nth-child(4),
.torque-reference-table td:nth-child(5) {
  min-width: 220px;
  font-family: inherit;
  line-height: 1.5;
}

.torque-reference-notes {
  padding: 17px 20px 19px;
  border-top: 1px solid var(--border);
}

.torque-reference-notes h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.torque-reference-notes ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.related-tools-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 9px;
}

.related-tools-heading h2 {
  font-size: 13px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.related-tool {
  display: flex;
  min-height: 46px;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-decoration: none;
}

.related-tool:hover {
  border-color: var(--accent);
}

.related-tool strong {
  font-size: 12px;
  line-height: 1.35;
}

.related-tool span {
  color: var(--text-muted);
  font-size: 16px;
  white-space: nowrap;
}

.related-tool.coming-soon {
  color: var(--text-muted);
  background: var(--surface-muted);
  cursor: default;
}

.related-tool.coming-soon span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.coming-soon-panel {
  min-height: 220px;
  padding: 36px 28px;
  text-align: center;
}

.coming-soon-panel h2 {
  margin: 14px 0 8px;
}

.coming-soon-panel p {
  color: var(--text-muted);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.compact-reference-module {
  width: min(100%, 680px);
}

.compact-reference-table {
  width: 100%;
}

th,
td {
  padding: 11px 20px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  background: var(--surface-subtle);
  text-transform: uppercase;
}

td {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 40px;
  color: var(--text-muted);
  font-size: 11px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.database-page-heading {
  align-items: center;
}

.database-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.database-toolbar .search-field {
  width: min(360px, 100%);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.database-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.database-filters label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.database-filters select,
.pagination-controls select {
  height: 36px;
  padding: 0 9px;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.text-button,
.sort-button {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.text-button {
  height: 36px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.database-table {
  min-width: 1180px;
}

.terminal-table {
  min-width: 1080px;
}

.database-table th,
.database-table td {
  text-align: left;
  white-space: nowrap;
}

.sort-button {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button.active::after {
  margin-left: 6px;
  content: "↑";
}

.sort-button.active[data-direction="desc"]::after {
  content: "↓";
}

.database-table td {
  font-family: inherit;
}

.database-table .mono,
.database-table td:nth-child(n + 5):nth-child(-n + 9) {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.wire-record-link,
.text-link {
  color: var(--accent);
  text-underline-offset: 3px;
}

.wire-record-link {
  text-decoration: none;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.row-actions button:last-child {
  color: var(--danger);
}

.database-list-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: 11px;
  border-top: 1px solid var(--border);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-controls button {
  height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.database-empty-state {
  padding: 54px 24px;
  text-align: center;
}

.database-empty-state h2 {
  margin: 8px 0;
}

.database-empty-state p {
  color: var(--text-muted);
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.database-empty-state .primary-button,
.database-empty-state .secondary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.wire-editor {
  width: min(940px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: var(--dialog-shadow);
}

.wire-editor::backdrop {
  background: var(--dialog-overlay);
  backdrop-filter: blur(2px);
}

.wire-editor form {
  display: flex;
  max-height: calc(100vh - 50px);
  flex-direction: column;
}

.wire-editor-header,
.wire-editor-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.wire-editor-header h2 {
  margin-top: 3px;
}

.icon-button {
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
}

.wire-editor-body {
  overflow-y: auto;
  padding: 0 20px;
}

.wire-field-group {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.wire-field-group:last-child {
  border-bottom: 0;
}

.wire-field-group legend {
  margin-bottom: 13px;
  padding: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wire-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.wire-form-grid .engineering-field > input,
.wire-form-grid .engineering-field > textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: 0;
}

.wire-form-grid textarea {
  resize: vertical;
}

.wire-form-grid .engineering-field > input:focus,
.wire-form-grid .engineering-field > textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wire-field-wide {
  grid-column: 1 / -1;
}

.wire-form-error {
  flex: 0 0 auto;
  padding: 8px 20px;
}

.wire-editor-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.compact-dialog {
  width: min(680px, calc(100% - 32px));
}

.dialog-content {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 22px 20px;
}

.file-upload-field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.file-upload-field input {
  padding: 14px;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.import-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 14px;
  background: var(--surface-subtle);
  border-left: 3px solid var(--accent);
}

.import-preview strong {
  width: 100%;
}

.validation-list {
  max-height: 180px;
  overflow-y: auto;
  color: var(--danger);
  font-size: 12px;
}

.validation-list ul {
  margin: 0;
  padding-left: 20px;
}

.request-form-grid .engineering-field input,
.request-form-grid .engineering-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.success-message {
  margin: 0;
  color: var(--good);
  font-size: 13px;
  font-weight: 650;
}

.wire-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.component-header {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr auto;
  align-items: stretch;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.component-header > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 16px;
  border-right: 1px solid var(--border);
}

.component-header > div > span:first-child {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.component-header strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.component-header .component-header-actions {
  min-width: 190px;
  align-items: stretch;
  gap: 8px;
  border-right: 0;
}

.component-header-actions .secondary-button {
  width: 100%;
}

.component-source-missing {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.compatibility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.compatibility-grid > div {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface-subtle);
}

.compatibility-grid strong {
  font-size: 13px;
}

.compatibility-grid span {
  color: var(--text-muted);
  font-size: 12px;
}

.wire-detail-grid .content-section {
  margin-bottom: 0;
}

.wire-property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 4px 20px 18px;
}

.wire-property-grid > div {
  min-width: 0;
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid var(--border);
}

.wire-property-grid dt {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.wire-property-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

tbody tr:last-child td {
  border-bottom: 0;
}

.table-message {
  height: 100px;
  color: var(--text-muted);
  font-family: inherit;
  text-align: center;
}

.table-count {
  margin: 0;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
  border-top: 1px solid var(--border);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.dashboard-section {
  margin-bottom: 30px;
}

.dashboard-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.dashboard-section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.dashboard-section-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-capabilities {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-capabilities .platform-entry {
  min-height: 180px;
}

.dashboard-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-tools .tool-entry {
  min-height: 132px;
}

.dashboard-update {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.dashboard-update .dashboard-section-heading {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.update-row,
.update-row > div {
  display: flex;
}

.update-row {
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.update-row > div {
  flex-direction: column;
  gap: 4px;
}

.update-row span {
  color: var(--text-muted);
  font-size: 13px;
}

.update-row a {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.tool-entry,
.status-panel {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.tool-entry {
  color: var(--text);
  text-decoration: none;
  border-top: 3px solid var(--accent);
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.tool-entry:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.platform-entry {
  min-height: 170px;
}

.coming-soon-entry {
  color: var(--text);
  background: var(--surface-subtle);
  border-top-color: var(--border-strong);
  cursor: default;
}

.coming-soon-entry:hover {
  background: var(--surface-subtle);
  border-color: var(--border);
  border-top-color: var(--border-strong);
  transform: none;
}

.tool-entry-kicker {
  display: flex;
  min-height: 24px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: auto;
}

.status-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--text-disabled);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface-muted);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
}

.tool-entry-type,
.status-label {
  min-height: 24px;
  margin-bottom: auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-entry-kicker .tool-entry-type {
  min-height: 0;
  margin-bottom: 0;
  white-space: nowrap;
}

.tool-entry strong {
  margin-bottom: 8px;
  font-size: 18px;
}

.tool-entry span:last-child,
.status-panel span:last-child {
  color: var(--text-muted);
  font-size: 13px;
}

.status-panel strong {
  margin-bottom: 8px;
  font-size: 36px;
  line-height: 1;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.open {
    position: fixed;
    z-index: 15;
    inset: 0;
    display: block;
    background: var(--dialog-overlay);
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    gap: 14px;
    padding: 0 20px;
  }

  .theme-toggle-label {
    display: none;
  }

  .menu-button {
    display: block;
  }

  main {
    padding: 28px 24px 48px;
  }

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

  .dashboard-capabilities,
  .dashboard-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wire-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .database-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wire-detail-grid {
    grid-template-columns: 1fr;
  }

  .component-header {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .component-header .component-header-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  main {
    padding: 24px 16px 40px;
  }

  .page-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .database-actions,
  .database-list-footer {
    width: 100%;
  }

  .database-actions > button {
    flex: 1;
  }

  .database-list-footer {
    flex-direction: column;
    gap: 4px;
  }

  .database-actions {
    flex-wrap: wrap;
  }

  .database-actions > button,
  .database-actions > a {
    flex: 1 1 140px;
  }

  .database-filters {
    grid-template-columns: 1fr;
  }

  .pagination-controls {
    flex-wrap: wrap;
  }

  .empty-state-actions {
    flex-direction: column;
  }

  .wire-property-grid {
    grid-template-columns: 1fr;
  }

  .component-header,
  .compatibility-grid {
    grid-template-columns: 1fr;
  }

  .component-header .component-header-actions {
    grid-column: auto;
  }

  .wire-form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .formula-note {
    width: 100%;
  }

  .calculator-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 18px 16px;
  }

  .conversion-indicator {
    height: 32px;
    transform: rotate(90deg);
  }

  .calculator-error {
    padding: 0 18px 16px;
  }

  .table-section-heading,
  .search-field {
    width: 100%;
  }

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

  th,
  td {
    padding: 12px 14px;
    white-space: nowrap;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-section-heading,
  .update-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-tabs {
    overflow-x: auto;
  }

  .tool-tab {
    flex: 0 0 auto;
    padding: 0 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .related-tools-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .formula-details-body {
    gap: 16px;
    padding: 16px;
  }

  .formula-expressions {
    padding: 12px 13px;
  }

  .formula-expressions code {
    font-size: 15px;
  }

  .formula-variable-table th,
  .formula-variable-table td {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* WireTool application foundation */
html {
  scroll-padding-top: 66px;
}

body {
  font-family: Georgia, "Times New Roman", serif;
}

button,
input,
select,
textarea,
.app-header,
.sidebar,
.breadcrumbs,
.topic-tabs,
.topic-overview,
.database-table,
.database-filters,
.database-list-footer,
.component-header,
.site-footer {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 252px minmax(360px, 760px) 1fr auto;
  height: 54px;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-strong);
}

.app-brand {
  color: var(--text);
  font-size: 19px;
  font-weight: 750;
  text-decoration: none;
}

.global-search {
  display: flex;
  height: 32px;
  align-items: center;
  background: transparent;
}

.global-search:focus-within {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.global-search input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-right: 0;
  outline: 0;
}

.global-search button {
  height: 32px;
  padding: 0 13px;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.global-search button:hover,
.global-search button:focus-visible {
  background: var(--surface-hover);
}

.app-header .theme-toggle {
  width: 30px;
  min-height: 30px;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: transparent;
  border-color: transparent;
}

.app-header .theme-toggle:hover,
.app-header .theme-toggle:focus-visible {
  background: var(--surface-hover);
  border-color: var(--border);
}

.app-header .theme-toggle-label {
  display: none;
}

.header-utilities {
  display: flex;
  min-width: 124px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-identity {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.admin-login-dialog {
  width: min(28rem, calc(100vw - 2rem));
}

.account-reserved {
  width: 76px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  border-left: 1px solid var(--border);
}

.app-shell {
  min-height: calc(100vh - 54px);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 54px auto 0 0;
  display: flex;
  width: 252px;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.sidebar-title {
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}

.sidebar-close {
  display: none;
  color: var(--text-muted);
  font-size: 20px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sidebar nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.sidebar .nav-group {
  margin: 0 0 1px;
  padding: 0;
  border: 0;
}

.sidebar .nav-link,
.sidebar .nav-parent {
  min-height: 28px;
  gap: 0;
  padding: 3px 8px;
  color: var(--text);
  font-size: 11px;
  border-left: 2px solid transparent;
}

.sidebar .nav-parent {
  font-weight: 600;
}

.sidebar .nav-parent-small {
  font-weight: 575;
}

.sidebar .nav-link {
  font-weight: 500;
}

.sidebar .nav-link-nested {
  padding-left: 52px;
}

.sidebar .nav-link-entity,
.sidebar .nav-numbered-list > .nav-placeholder {
  padding-left: 18px;
}

.sidebar .nav-domain-content > .nav-collapsible > .nav-parent {
  padding-left: 2px;
}

.sidebar .nav-domain-content {
  margin-left: 16px;
  border-left: 1px solid var(--border-muted);
}

.sidebar .nav-link-tool,
.sidebar .nav-domain-content .nav-placeholder {
  padding-left: 52px;
}

.sidebar .nav-placeholder {
  min-height: 25px;
  padding-block: 2px;
  color: var(--text-muted);
  font-size: 11px;
  border-left: 2px solid transparent;
  cursor: default;
}

.app-revision {
  flex: 0 0 auto;
  padding: 10px 14px 12px;
  font-family: Inter, "Segoe UI", sans-serif;
  border-top: 1px solid var(--border);
}

.app-revision strong,
.app-revision span {
  display: block;
}

.app-revision strong {
  color: var(--text);
  font-size: 10px;
}

.app-revision span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.sidebar .nav-root-link {
  margin-top: 3px;
  padding-left: 7px;
  font-weight: 700;
}

.sidebar .chapter-number {
  display: inline-block;
  width: 34px;
  flex: 0 0 34px;
  color: var(--text-disabled);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sidebar .nav-link > span:last-child,
.sidebar .nav-parent > span:last-child,
.sidebar .nav-placeholder > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar .nav-link:hover,
.sidebar .nav-collapsible > summary:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar .nav-link.active {
  color: var(--accent-dark);
  font-weight: 600;
  background: transparent;
  border-left-color: var(--accent);
}

.sidebar .nav-collapsible.active-branch > summary {
  color: var(--text);
  font-weight: 600;
  background: transparent;
  border-left-color: var(--accent);
}

.sidebar .nav-section.active-branch > summary {
  background: transparent;
}

.sidebar .nav-link.active:hover,
.sidebar .nav-collapsible.active-branch > summary:hover {
  background: var(--surface-hover);
}

.sidebar .nav-collapsible > summary::after {
  width: 6px;
  height: 6px;
  content: "";
  margin-right: 3px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(-45deg);
}

.sidebar .nav-collapsible[open] > summary::after {
  transform: rotate(45deg);
}

.workspace {
  min-height: calc(100vh - 54px);
  margin-left: 252px;
}

main {
  width: min(1580px, 100%);
  padding: 18px 20px 42px;
}

.breadcrumbs {
  min-height: 15px;
  margin-bottom: 8px;
  font-size: 11px;
}

.page-heading {
  gap: 20px;
  margin-bottom: 14px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: none;
}

h1 {
  margin-bottom: 5px;
  font-size: 28px;
  font-weight: 600;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

.page-summary {
  max-width: 760px;
  font-size: 13px;
  line-height: 1.4;
}

.content-section {
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.content-section,
.topic-overview,
.component-header {
  background: var(--surface);
}

.result-stack,
.input-stack {
  gap: 12px;
}

.result-stack .content-section {
  margin-bottom: 0;
}

.engineering-notes ul {
  gap: 6px;
  padding: 10px 12px 12px 28px;
  font-size: 12px;
}

.formula-details,
.content-section.formula-parent {
  border-radius: 0;
  box-shadow: none;
}

.formula-details {
  margin: 0;
}

.formula-card-heading {
  border-top: 0;
}

.formula-details-body {
  display: grid;
  gap: 1px;
  padding: 10px;
  background: var(--border-muted);
}

.formula-details h3 {
  margin: 0 0 5px;
  font-size: 10px;
}

.formula-expression-block,
.formula-variable-block,
.formula-assumptions,
.formula-references {
  padding: 9px 10px;
  background: var(--surface);
}

.formula-expressions {
  gap: 3px;
  padding: 9px 10px;
  background: var(--surface-subtle);
  border-left: 2px solid var(--border-strong);
}

.formula-expressions code {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.formula-assumptions,
.formula-references {
  border: 0;
}

.formula-table-wrap {
  border-color: var(--border-muted);
  border-radius: 0;
}

.formula-variable-table th,
.formula-variable-table td {
  padding: 7px 9px;
  font-size: 11px;
}

.section-heading {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-muted);
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.section-number {
  color: var(--text-disabled);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.dashboard-section {
  margin-bottom: 18px;
}

.dashboard-section-heading {
  margin-bottom: 8px;
}

.dashboard-grid {
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.library-page {
  max-width: 1360px;
}

.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 34px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
}

.library-heading h1 {
  margin: 0;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 650;
}

.library-last-workspace {
  flex: 0 0 auto;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 650;
}

.library-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  font-family: Inter, "Segoe UI", sans-serif;
}

.library-tile {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.library-tile-header {
  display: flex;
  min-height: 26px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-muted);
}

.library-tile h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.library-number {
  display: inline-grid;
  width: 22px;
  height: 18px;
  place-items: center;
  color: var(--text-disabled);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  border-right: 1px solid var(--border-muted);
}

.library-primary-action {
  display: flex;
  min-height: 30px;
  align-items: center;
  padding: 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  background: var(--surface-subtle);
  border: 1px solid var(--border-muted);
}

.library-primary-action:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.library-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.library-action-grid a,
.library-action-grid span {
  min-width: 0;
  min-height: 25px;
  padding: 5px 7px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--border-muted);
}

.library-action-grid a {
  color: var(--text);
}

.library-action-grid a:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.library-action-grid span {
  opacity: 0.72;
}

.library-standards-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-recent {
  min-height: auto;
  background: var(--surface-subtle);
  border-left: 2px solid var(--accent);
}

.tool-entry {
  min-height: 92px;
  padding: 13px;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tool-entry:hover {
  background: var(--surface-hover);
  transform: none;
}

.topic-tabs {
  display: flex;
  min-height: 36px;
  align-items: flex-end;
  margin-bottom: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-strong);
}

#wire-database-page:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  align-items: start;
  gap: 16px;
}

.topic-content {
  min-width: 0;
}

.on-page-sidebar {
  position: sticky;
  top: 72px;
  font-family: Inter, "Segoe UI", sans-serif;
}

.on-page-sidebar nav {
  padding: 0 0 12px;
  border-left: 1px solid var(--border);
}

.on-page-sidebar nav > span,
.active-context-panel > span {
  display: block;
  margin: 0 0 5px 8px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.on-page-sidebar nav a {
  display: block;
  padding: 4px 8px;
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.on-page-sidebar nav a:hover,
.on-page-sidebar nav a.active {
  color: var(--text);
  background: var(--surface-hover);
}

.on-page-sidebar nav a.active {
  font-weight: 700;
  border-left-color: var(--accent);
}

.active-context-panel {
  padding-top: 10px;
  border-top: 1px solid var(--border-strong);
}

:root[data-theme="dark"] .app-header {
  border-bottom-color: #3d4652;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 3%),
    0 10px 24px rgb(0 0 0 / 18%);
}

:root[data-theme="dark"] .sidebar {
  border-right-color: var(--sidebar-border);
  box-shadow:
    inset -1px 0 0 rgb(255 255 255 / 2%),
    10px 0 24px rgb(0 0 0 / 10%);
}

:root[data-theme="dark"] main {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 1.5%), transparent 220px);
}

:root[data-theme="dark"] .content-section,
:root[data-theme="dark"] .topic-overview,
:root[data-theme="dark"] .component-header,
:root[data-theme="dark"] .library-tile {
  border-color: var(--border-muted);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 3%),
    0 1px 0 rgb(0 0 0 / 22%);
}

:root[data-theme="dark"] .section-heading,
:root[data-theme="dark"] .topic-tabs,
:root[data-theme="dark"] .database-toolbar {
  background: #192027;
  border-color: var(--border-muted);
}

:root[data-theme="dark"] .tool-entry,
:root[data-theme="dark"] .topic-tool-grid a,
:root[data-theme="dark"] .standards-family-grid article,
:root[data-theme="dark"] .mechanical-reference-grid article,
:root[data-theme="dark"] .library-primary-action,
:root[data-theme="dark"] .library-action-grid a,
:root[data-theme="dark"] .library-action-grid span {
  background: var(--surface);
}

:root[data-theme="dark"] .tool-entry:hover,
:root[data-theme="dark"] .topic-tool-grid a:hover,
:root[data-theme="dark"] .standards-family-grid article:hover,
:root[data-theme="dark"] .mechanical-reference-grid article:hover,
:root[data-theme="dark"] .library-primary-action:hover,
:root[data-theme="dark"] .library-action-grid a:hover {
  background: var(--surface-hover);
}

:root[data-theme="dark"] .database-table,
:root[data-theme="dark"] .database-filters,
:root[data-theme="dark"] .database-list-footer {
  background-color: var(--surface);
}

:root[data-theme="dark"] .database-table th {
  background: var(--bg-table-header);
}

:root[data-theme="dark"] .database-table td {
  border-color: var(--border-muted);
}

:root[data-theme="dark"] tbody tr:hover {
  background: #273039;
}

:root[data-theme="dark"] .database-filters {
  background: #151b22;
}

:root[data-theme="dark"] .database-list-footer {
  background: #192027;
}

:root[data-theme="dark"] .global-search input,
:root[data-theme="dark"] .database-filters select,
:root[data-theme="dark"] .pagination-controls select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--control-bg);
  border-color: #46515e;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 3%),
    0 1px 0 rgb(0 0 0 / 28%);
}

:root[data-theme="dark"] .global-search button,
:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .pagination-controls button {
  border-color: #46515e;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%);
}

:root[data-theme="dark"] .sidebar .nav-link:hover,
:root[data-theme="dark"] .sidebar .nav-collapsible > summary:hover {
  background: var(--sidebar-hover);
}

:root[data-theme="dark"] .sidebar .nav-link.active,
:root[data-theme="dark"] .sidebar .nav-collapsible.active-branch > summary {
  color: var(--accent-dark);
  background: transparent;
  border-left-color: var(--accent);
}

:root[data-theme="dark"] .active-context-panel {
  padding: 10px 9px;
  background: #151b22;
  border: 1px solid #303a45;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 2%);
}

:root[data-theme="dark"] .on-page-sidebar nav {
  border-left-color: var(--border-muted);
}

.active-context-panel > span {
  margin-left: 0;
}

.active-context-panel strong,
.active-context-panel small {
  display: block;
}

.active-context-panel strong {
  margin-bottom: 4px;
  font-size: 11px;
}

.active-context-panel small {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.4;
}

.topic-tabs a {
  padding: 8px 11px 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.topic-tabs a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.topic-tabs a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.topic-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.topic-overview > div {
  padding: 8px 10px;
  border-right: 1px solid var(--border-muted);
}

.topic-overview > div:last-child {
  border-right: 0;
}

.topic-overview span,
.topic-overview strong {
  display: block;
}

.topic-overview span {
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.topic-overview strong {
  font-size: 11px;
}

.database-page-heading {
  align-items: end;
}

.component-detail-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  align-items: center;
}

.product-visual {
  display: grid;
  width: 180px;
  height: 126px;
  place-items: center;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.product-visual a,
.product-visual img {
  display: block;
  width: 100%;
  height: 100%;
}

.product-visual img {
  object-fit: contain;
  background: #fff;
}

.product-visual-placeholder {
  padding: 12px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.database-actions {
  gap: 5px;
}

.primary-button,
.secondary-button,
.pagination-controls button,
.row-actions button {
  min-height: 31px;
  padding-inline: 10px;
  font-size: 11px;
  font-weight: 650;
  border-radius: 0;
}

.revision-info {
  display: flex;
  min-width: 105px;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  margin-right: 5px;
  padding-right: 10px;
  font-family: Inter, "Segoe UI", sans-serif;
  border-right: 1px solid var(--border);
}

.revision-info strong,
.revision-info span {
  display: block;
  white-space: nowrap;
}

.revision-info strong {
  color: var(--text);
  font-size: 10px;
}

.revision-info span {
  color: var(--text-muted);
  font-size: 9px;
}

.database-toolbar {
  padding-block: 7px;
}

.database-filters {
  gap: 8px;
  padding: 8px 10px;
  background: var(--control-bg);
  border-color: var(--border-muted);
}

.database-filters select,
.database-list-footer select {
  min-height: 30px;
}

.database-table th,
.database-table td {
  padding: 7px 9px;
  font-size: 11px;
}

.database-table th {
  background: var(--bg-table-header);
}

.database-list-footer {
  min-height: 40px;
  padding: 6px 10px;
  border-color: var(--border-muted);
}

.voltage-drop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
  align-items: start;
  gap: 12px;
}

[data-page="awg-calculator"] .voltage-drop-layout,
[data-page="cable-resistance"] .voltage-drop-layout,
[data-page="wire-ampacity"] .voltage-drop-layout,
[data-page="bend-radius"] .voltage-drop-layout,
[data-page="cable-weight"] .voltage-drop-layout,
[data-page="torque-calculator"] .voltage-drop-layout {
  grid-template-columns: minmax(0, 900px);
}

[data-page="awg-calculator"] .result-stack,
[data-page="cable-resistance"] .result-stack,
[data-page="wire-ampacity"] .result-stack,
[data-page="bend-radius"] .result-stack,
[data-page="cable-weight"] .result-stack,
[data-page="torque-calculator"] .result-stack {
  max-width: 900px;
}

.input-panel,
.result-panel {
  margin-bottom: 0;
}

.input-group {
  padding: 10px;
  border-bottom: 1px solid var(--border-muted);
}

.input-group legend {
  margin-bottom: 8px;
  font-size: 10px;
}

.form-grid {
  gap: 10px;
}

.engineering-field > span:first-child,
.conversion-field label {
  margin-bottom: 6px;
  font-size: 12px;
}

.engineering-field select,
.input-with-unit.compact,
.input-with-unit {
  height: 34px;
  border-radius: 0;
}

.input-with-unit input,
.input-with-unit.compact input {
  font-size: 13px;
}

.input-with-unit > span,
.input-with-unit.compact > span {
  display: inline-flex;
  align-items: center;
  padding-inline: 9px;
  color: var(--text-muted);
  font-size: 11px;
  background: var(--surface-subtle);
  border-left: 1px solid var(--border-muted);
}

.calculator-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.awg-conversion-layout {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.form-actions {
  min-height: 42px;
  gap: 10px;
  padding: 8px 10px;
}

.form-actions > span,
.connection-status {
  font-size: 10px;
}

.input-panel .calculator-error {
  min-height: 16px;
  padding: 0 10px 8px;
}

.assessment {
  min-height: 70px;
  gap: 10px;
  padding: 10px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-muted);
}

.result-grid {
  gap: 1px;
  padding: 0;
  background: var(--border-muted);
}

.result-grid > div {
  padding: 10px;
  background: var(--surface);
}

.result-grid dt {
  margin-bottom: 4px;
  font-size: 10px;
}

.result-grid dd {
  font-size: 18px;
}

.practical-guidance p {
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.awg-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.awg-calculator-workspace {
  grid-column: 1;
}

.awg-workspace-layout .formula-details {
  grid-column: 2;
  grid-row: 1;
}

.awg-workspace-layout .engineering-notes {
  grid-column: 2;
}

.awg-workspace-layout .practical-guidance {
  grid-column: 1;
}

.simple-conversion-stack {
  display: grid;
  gap: 1px;
  padding: 0;
  background: var(--border-muted);
}

.conversion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.68fr);
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  background: var(--surface);
}

.conversion-row + .conversion-row {
  margin-top: 0;
}

.conversion-result {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-muted);
}

.conversion-result span,
.conversion-result strong {
  display: block;
}

.conversion-result span {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.conversion-result strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.awg-calculator-workspace .calculator-error {
  min-height: 18px;
  padding: 0 10px 9px;
}

.topic-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.context-workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.context-notes {
  grid-template-columns: 1fr;
}

.mechanical-reference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  font-family: Inter, "Segoe UI", sans-serif;
}

.mechanical-reference-grid article {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--border-muted);
}

.mechanical-reference-grid article:last-child {
  border-right: 0;
}

.mechanical-reference-grid span,
.mechanical-reference-grid strong {
  display: block;
}

.mechanical-reference-grid span {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 9px;
}

.mechanical-reference-grid strong {
  font-size: 11px;
}

.mechanical-reference-grid p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.panel-hole-workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  font-family: Inter, "Segoe UI", sans-serif;
}

.panel-hole-workflow > div:not(.panel-hole-workflow-actions) {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  padding: 14px 16px;
  border-right: 1px solid var(--border-muted);
}

.panel-hole-workflow > div:nth-child(3) {
  border-right: 0;
}

.panel-hole-workflow span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 10px;
}

.panel-hole-workflow p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.panel-hole-workflow strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-primary);
  font-size: 11px;
}

.panel-hole-workflow-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-muted);
}

.panel-hole-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: Inter, "Segoe UI", sans-serif;
}

.panel-hole-filters label span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.panel-hole-filters select,
.panel-hole-filters input {
  width: 100%;
}

.panel-hole-filters p {
  min-width: 105px;
  margin: 0 0 9px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
}

.panel-hole-table {
  min-width: 980px;
}

.panel-hole-table th,
.panel-hole-table td {
  text-align: left;
  vertical-align: top;
}

.panel-hole-table td:nth-child(3),
.panel-hole-table td:nth-child(4) {
  white-space: nowrap;
}

.panel-hole-table td:nth-child(2) span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.panel-hole-table td:nth-child(5) {
  min-width: 210px;
  font-family: inherit;
}

.panel-hole-source-note {
  margin: 0;
  padding: 11px 16px 13px;
  border-top: 1px solid var(--border-muted);
  color: var(--text-muted);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 10px;
  line-height: 1.5;
}

.thread-hole-table {
  min-width: 1120px;
}

.thread-hole-table th,
.thread-hole-table td {
  text-align: left;
  vertical-align: top;
}

.thread-hole-table td:nth-child(n + 2):nth-child(-n + 6) {
  white-space: nowrap;
}

.thread-hole-table td:last-child {
  min-width: 230px;
  font-family: inherit;
}

.thread-hole-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  padding: 13px 16px 15px;
  border-top: 1px solid var(--border-muted);
  color: var(--text-muted);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 10px;
  line-height: 1.55;
}

.thread-hole-notes p {
  margin: 0;
}

.thread-hole-notes > div {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
}

.certification-state {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.certification-state.verified {
  color: var(--good);
  border-color: var(--good-indicator);
  background: var(--accent-soft);
}

.certification-state.conditional,
.certification-state.manufacturer-documented {
  color: var(--warning);
  border-color: var(--warning-indicator);
  background: var(--surface-subtle);
}

.certification-type {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.standards-family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  font-family: Inter, "Segoe UI", sans-serif;
}

.standards-family-grid article {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  padding: 9px 10px;
  border-right: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}

.standards-family-grid article:nth-child(3n) {
  border-right: 0;
}

.standards-family-grid article:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.standards-family-grid strong {
  font-size: 11px;
}

.standards-family-grid span {
  color: var(--text-muted);
  font-size: 10px;
}

.standards-family-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.standards-family-group > div {
  min-width: 0;
}

.standards-pilot-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border-muted);
}

.standards-pilot-entry strong {
  color: var(--accent);
}

.standards-pilot-entry small {
  color: var(--text-muted);
  font-size: 9px;
}

.standards-family-planned {
  background: var(--surface-subtle);
}

.standards-family-planned strong,
.standards-family-planned span {
  color: var(--text-muted);
}

.standards-planned-note {
  margin: 10px 10px 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.standards-overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 18px; padding: 18px 20px 20px; }
.standards-metadata, .standards-answer-source { display: grid; gap: 8px; }
.standards-metadata div, .standards-answer-source div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.standards-metadata dt, .standards-answer-source dt { color: var(--text-muted); }
.standards-metadata dd, .standards-answer-source dd { margin: 0; }
.standards-disclaimer, .standards-answer-disclaimer { padding: 14px; border-left: 3px solid var(--warning-indicator); background: var(--surface-subtle); }
.standards-question-body { display: grid; gap: 14px; padding: 0 20px 20px; }
.standards-question form > div { display: flex; gap: 8px; margin-top: 6px; }
.standards-question input { flex: 1; }
.standards-answer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 760px) { .standards-overview-grid { grid-template-columns: 1fr; padding: 16px 18px 18px; } .standards-question-body { padding: 0 18px 18px; } }

.active-context-summary {
  color: var(--text-muted);
  font: 10px Inter, "Segoe UI", sans-serif;
}

.topic-list,
.topic-tool-grid {
  display: grid;
  font-family: Inter, "Segoe UI", sans-serif;
}

.topic-list a {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: 8px;
  padding: 8px 10px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-muted);
}

.topic-list a:last-child {
  border-bottom: 0;
}

.topic-list a:hover,
.topic-tool-grid a:hover {
  background: var(--surface-hover);
}

.topic-list strong,
.topic-tool-grid strong {
  color: var(--text);
  font-size: 11px;
}

.topic-list span,
.topic-tool-grid span {
  color: var(--text-muted);
  font-size: 10px;
}

.topic-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-notes p {
  margin: 0;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.4;
  border-right: 1px solid var(--border-muted);
}

.topic-notes p:last-child {
  border-right: 0;
}

.topic-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topic-tool-grid a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  text-decoration: none;
  border-right: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}

.topic-tool-grid a:nth-child(3n) {
  border-right: 0;
}

.topic-tool-grid a:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.ai-assistance-placeholder {
  padding: 9px 10px;
  font-family: Inter, "Segoe UI", sans-serif;
}

.ai-assistance-placeholder > label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
}

.ai-assistance-placeholder > div {
  display: grid;
  grid-template-columns: 1fr auto;
}

.ai-assistance-placeholder input,
.ai-assistance-placeholder button {
  min-height: 31px;
  padding: 5px 8px;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--border-strong);
}

.ai-assistance-placeholder button {
  border-left: 0;
}

.ai-assistance-placeholder small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.component-header.active-context::before {
  content: "ACTIVE CONTEXT";
  display: grid;
  align-items: center;
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
  writing-mode: vertical-rl;
}

.component-header {
  grid-template-columns: auto 1.1fr 1fr 1fr 1fr auto;
  margin-bottom: 14px;
  border-radius: 0;
  box-shadow: none;
}

.component-header > div {
  padding: 10px;
}

.site-footer {
  margin-left: 0;
  padding: 12px 20px;
  font-size: 10px;
}

@media (max-width: 900px) {
  .app-header {
    grid-template-columns: 40px 112px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }

  .app-header .menu-button {
    display: block;
  }

  .sidebar {
    inset: 54px auto 0 0;
    transform: translateX(-100%);
  }

  .header-utilities {
    min-width: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .workspace {
    margin-left: 0;
  }

  .sidebar-backdrop {
    top: 54px;
  }

  main {
    padding: 14px 12px 36px;
  }

  .component-detail-heading {
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .component-detail-heading .database-actions {
    grid-column: 1 / -1;
  }

  .product-visual {
    width: 160px;
    height: 112px;
  }

  .topic-knowledge-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .context-workflow-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .mechanical-reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-hole-workflow {
    grid-template-columns: 1fr;
  }

  .panel-hole-workflow > div:not(.panel-hole-workflow-actions) {
    border-right: 0;
    border-bottom: 1px solid var(--border-muted);
  }

  .panel-hole-workflow > div:nth-child(3) {
    border-bottom: 0;
  }

  .panel-hole-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-hole-filters p {
    grid-column: 1 / -1;
    margin: 0;
    text-align: left;
  }

  .standards-family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .awg-calculator-workspace,
  .awg-workspace-layout .formula-details,
  .awg-workspace-layout .engineering-notes,
  .awg-workspace-layout .practical-guidance {
    grid-column: 1;
    grid-row: auto;
  }

  .standards-family-grid article,
  .standards-family-grid article:nth-child(3n),
  .standards-family-grid article:nth-last-child(-n + 3) {
    border-right: 1px solid var(--border-muted);
    border-bottom: 1px solid var(--border-muted);
  }

  .standards-family-grid article:nth-child(2n) {
    border-right: 0;
  }

  .standards-family-grid article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .mechanical-reference-grid article:nth-child(2) {
    border-right: 0;
  }

  .mechanical-reference-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border-muted);
  }

  .component-header {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .component-header.active-context::before,
  .component-header .component-header-actions {
    grid-column: 1 / -1;
  }

  .component-header.active-context::before {
    writing-mode: horizontal-tb;
  }

}

@media (max-width: 1180px) {
  #wire-database-page:not([hidden]) {
    display: block;
  }

  .on-page-sidebar {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-header {
    grid-template-columns: 40px 1fr auto;
    height: auto;
    min-height: 54px;
    padding-block: 7px;
  }

  .component-detail-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  .component-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-visual {
    width: min(220px, 100%);
    height: 154px;
    justify-self: start;
  }

  .app-brand {
    display: none;
  }

  .global-search {
    grid-column: 2;
  }

  .theme-toggle-label {
    display: none;
  }

  .global-search {
    display: flex;
  }

  .library-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .library-index {
    grid-template-columns: 1fr;
  }

  .library-standards-list {
    grid-template-columns: 1fr;
  }

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

  .panel-hole-filters {
    grid-template-columns: 1fr;
  }

  .panel-hole-filters p {
    grid-column: 1;
  }

  .panel-hole-workflow-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .thread-hole-notes {
    grid-template-columns: 1fr;
  }

  .thread-hole-notes > div {
    grid-column: 1;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .database-page-heading {
    align-items: flex-start;
  }

  .database-actions {
    width: 100%;
  }

  .topic-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-overview > div:nth-child(2) {
    border-right: 0;
  }

  .topic-overview > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .topic-tool-grid,
  .topic-notes,
  .mechanical-reference-grid,
  .standards-family-grid {
    grid-template-columns: 1fr;
  }

  .mechanical-reference-grid article,
  .mechanical-reference-grid article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--border-muted);
  }

  .mechanical-reference-grid article:last-child {
    border-bottom: 0;
  }

  .standards-family-grid article,
  .standards-family-grid article:nth-child(2n),
  .standards-family-grid article:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--border-muted);
  }

  .standards-family-grid article:last-child {
    border-bottom: 0;
  }

  .topic-tool-grid a,
  .topic-tool-grid a:nth-child(3n),
  .topic-tool-grid a:nth-last-child(-n + 3),
  .topic-notes p {
    border-right: 0;
    border-bottom: 1px solid var(--border-muted);
  }

  .topic-tool-grid a:last-child,
  .topic-notes p:last-child {
    border-bottom: 0;
  }

  .active-context-summary {
    display: none;
  }
}
