:root {
  --ink: #162033;
  --muted: #606b7e;
  --line: #e3e7ee;
  --paper: #ffffff;
  --soft: #f7f8fa;
  --navy: #142a46;
  --blue: #315d92;
  --cyan: #5ea9b8;
  --gold: #c9a24b;
  --gold-soft: #f4ead3;
  --green: #3b8f69;
  --shadow: 0 16px 36px rgba(22, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Yu Gothic", "Meiryo", serif;
  font-size: 14px;
  line-height: 1.75;
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(840px, calc(100% - 32px));
  margin: 0 auto;
}

.container.wide {
  width: min(1080px, calc(100% - 32px));
}

.narrow {
  width: min(840px, calc(100% - 32px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner,
.footer-inner,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-inner {
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.brand-logo {
  display: block;
  width: 116px;
  max-width: 100%;
  height: auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: #31405c;
  font-size: 14px;
  font-weight: 600;
}

.site-nav a:hover,
.text-link:hover,
.footer-inner a:hover {
  color: var(--blue);
}

.hero {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 0;
  padding: 0;
  overflow: visible;
  inline-size: 100%;
  background: var(--soft);
}

.hero-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  background: var(--soft);
  overflow: visible;
}

.hero-background {
  display: block;
  width: 80%;
  height: auto;
  max-width: 100%;
}

.hero-grid,
.two-column,
.company-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: block;
  align-self: center;
  grid-area: 1 / 1;
}

.home-info {
  background: var(--soft);
}

.home-intro {
  max-width: 820px;
  margin-bottom: 16px;
}

.home-intro .lead {
  margin-bottom: 0;
}

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

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

h1 {
  margin-bottom: 10px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

h2 {
  margin-bottom: 10px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
}

.lead {
  color: #3b4658;
  font-size: 14px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 34px 0 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--navy);
}

.button.secondary {
  color: #fff;
  background: var(--gold);
}

.button.ghost {
  color: var(--navy);
  background: #fff;
  border-color: var(--line);
}

.hero .button.primary {
  background: rgba(20, 42, 70, 0.94);
  box-shadow: 0 10px 28px rgba(12, 24, 40, 0.18);
}

.hero .button.ghost {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(20, 42, 70, 0.18);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.hero-stats div,
.service-card,
.explain-card,
.contact-card,
.tips-card,
.article-block,
.note-card,
.company-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.hero-stats div {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(20, 42, 70, 0.12);
  padding: 16px;
}

.hero-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-stats dd {
  margin: 0;
  font-weight: 700;
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 999px;
}

.substation-illustration {
  position: relative;
  height: 350px;
  margin-top: 22px;
  background:
    linear-gradient(#eef4fb 1px, transparent 1px),
    linear-gradient(90deg, #eef4fb 1px, transparent 1px);
  background-size: 28px 28px;
  border-radius: 4px;
}

.pole {
  position: absolute;
  left: 70px;
  bottom: 42px;
  width: 22px;
  height: 230px;
  background: var(--navy);
  border-radius: 4px 4px 0 0;
}

.pole::before {
  position: absolute;
  top: 32px;
  left: -42px;
  width: 106px;
  height: 14px;
  content: "";
  background: var(--navy);
  border-radius: 999px;
}

.cable {
  position: absolute;
  height: 3px;
  background: var(--cyan);
  transform-origin: left center;
}

.cable-one {
  top: 105px;
  left: 94px;
  width: 205px;
  transform: rotate(8deg);
}

.cable-two {
  top: 136px;
  left: 94px;
  width: 178px;
  transform: rotate(16deg);
}

.cubicle {
  position: absolute;
  right: 58px;
  bottom: 42px;
  width: 185px;
  height: 210px;
  background: linear-gradient(180deg, #f9fbff, #dfe8f2);
  border: 3px solid var(--navy);
  border-radius: 4px;
}

.meter {
  position: absolute;
  top: 28px;
  left: 26px;
  width: 54px;
  height: 54px;
  background: #fff;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.meter::after {
  position: absolute;
  right: 12px;
  bottom: 16px;
  width: 20px;
  height: 3px;
  content: "";
  background: var(--blue);
  transform: rotate(-28deg);
}

.door-line {
  position: absolute;
  top: 18px;
  left: 94px;
  width: 2px;
  height: 174px;
  background: #b9c7d9;
}

.cubicle span {
  position: absolute;
  right: 22px;
  width: 48px;
  height: 10px;
  background: var(--gold);
  border-radius: 999px;
}

.cubicle span:first-of-type {
  top: 50px;
}

.cubicle span:last-of-type {
  top: 74px;
}

.check-card {
  position: absolute;
  right: 28px;
  bottom: 20px;
  width: 210px;
  padding: 16px;
  background: var(--navy);
  color: #fff;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.check-card strong,
.check-card small {
  display: block;
}

.check-card small {
  color: #dbeafe;
}

.section {
  padding: 36px 0;
}

.muted {
  background: var(--soft);
}

.two-column {
  align-items: start;
}

.contact-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: #31405c;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
}

textarea {
  resize: vertical;
}

.notice-link {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 16px;
  background: #fbf7ee;
  border: 1px solid #ead9b4;
  border-radius: 4px;
}

.notice-link span {
  align-self: start;
  padding: 4px 10px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  background: var(--gold-soft);
  border-radius: 999px;
}

.notice-link p {
  margin: 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

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

.service-card {
  padding: 24px;
}

.service-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--navy);
  font-weight: 700;
  background: var(--gold-soft);
  border: 1px solid rgba(201, 162, 75, 0.42);
  border-radius: 4px;
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 26px;
}

.explain-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: center;
  padding: 24px;
}

.mini-illustration {
  position: relative;
  height: 120px;
  background: #edf6ff;
  border-radius: 4px;
}

.mini-illustration span {
  position: absolute;
  display: block;
  background: var(--blue);
  border-radius: 4px;
}

.monthly span:nth-child(1) {
  left: 24px;
  bottom: 24px;
  width: 28px;
  height: 70px;
}

.monthly span:nth-child(2) {
  left: 62px;
  bottom: 24px;
  width: 28px;
  height: 48px;
  background: var(--cyan);
}

.monthly span:nth-child(3) {
  right: 24px;
  bottom: 24px;
  width: 28px;
  height: 88px;
  background: var(--gold);
}

.annual span:nth-child(1) {
  left: 24px;
  top: 28px;
  width: 90px;
  height: 14px;
}

.annual span:nth-child(2) {
  left: 24px;
  top: 56px;
  width: 64px;
  height: 14px;
  background: var(--cyan);
}

.annual span:nth-child(3) {
  left: 24px;
  top: 84px;
  width: 104px;
  height: 14px;
  background: var(--gold);
}

.app-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  padding: 34px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #203b5c);
  border-radius: 4px;
}

.app-band .eyebrow,
.app-band p {
  color: #dbeafe;
}

.app-band h2 {
  color: #fff;
}

.tips-grid,
.note-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.tips-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
}

.tips-card strong {
  color: var(--navy);
  font-size: 18px;
}

.tips-card span,
.service-card p,
.explain-card p,
.article-block p,
.note-card p,
.company-layout p {
  color: var(--muted);
}

.company-layout {
  align-items: start;
}

.company-list dd .company-main-note {
  color: var(--ink);
}

.company-rule {
  margin-top: 0.875em;
}

.app-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
}

.app-icon-row figure {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: 132px;
  margin: 0;
}

.app-icon-row img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(22, 32, 51, 0.16);
}

.app-icon-row figcaption {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.representative-profile {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: start;
}

.representative-profile img {
  width: 132px;
  height: 156px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(22, 32, 51, 0.14);
}

.representative-profile p {
  margin: 0;
}

.company-list {
  margin: 0;
  overflow: hidden;
}

.company-list div {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--line);
}

.company-list div:last-child {
  border-bottom: 0;
}

.company-list dt,
.company-list dd {
  margin: 0;
  padding: 16px 18px;
}

.company-list dt {
  color: var(--navy);
  font-weight: 700;
  background: var(--soft);
}

.site-footer {
  padding: 30px 0;
  color: #dbeafe;
  background: var(--ink);
}

.footer-inner p {
  margin: 0;
}

.page-hero {
  padding: 28px 0 20px;
  background: linear-gradient(135deg, #f7f8fa, #ffffff);
  border-bottom: 1px solid var(--line);
}

.page-toc-band {
  padding: 18px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page-toc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.page-toc a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  align-items: center;
  color: var(--navy);
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(22, 32, 51, 0.06);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.page-toc a:hover {
  color: var(--navy);
  background: #fff;
  border-color: rgba(49, 93, 146, 0.45);
  box-shadow: 0 18px 38px rgba(22, 32, 51, 0.1);
  transform: translateY(-2px);
}

.toc-icon {
  position: relative;
  display: block;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: var(--gold-soft);
  border: 1px solid rgba(201, 162, 75, 0.38);
  border-radius: 4px;
}

.toc-icon span {
  position: absolute;
  display: block;
  background: var(--navy);
}

.toc-icon-overview span:nth-child(1) {
  top: 10px;
  left: 12px;
  width: 22px;
  height: 28px;
  background: #fff;
  border: 2px solid var(--navy);
  border-radius: 2px;
}

.toc-icon-overview span:nth-child(2),
.toc-icon-overview span:nth-child(3) {
  left: 17px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
}

.toc-icon-overview span:nth-child(2) {
  top: 18px;
}

.toc-icon-overview span:nth-child(3) {
  top: 26px;
}

.toc-icon-business span {
  bottom: 10px;
  width: 8px;
  border-radius: 2px 2px 0 0;
}

.toc-icon-business span:nth-child(1) {
  left: 11px;
  height: 14px;
  background: var(--blue);
}

.toc-icon-business span:nth-child(2) {
  left: 20px;
  height: 24px;
  background: var(--navy);
}

.toc-icon-business span:nth-child(3) {
  left: 29px;
  height: 19px;
  background: var(--gold);
}

.toc-icon-profile span:nth-child(1) {
  top: 10px;
  left: 17px;
  width: 12px;
  height: 12px;
  background: var(--navy);
  border-radius: 999px;
}

.toc-icon-profile span:nth-child(2) {
  bottom: 9px;
  left: 12px;
  width: 22px;
  height: 16px;
  background: var(--blue);
  border-radius: 12px 12px 4px 4px;
}

.company-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(247, 248, 250, 0.94), rgba(247, 248, 250, 0.52)),
    url("assets/company-bg.jpg") center / cover no-repeat;
}

.company-hero .container {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 4px;
  box-shadow: 0 18px 42px rgba(12, 24, 40, 0.16);
  backdrop-filter: blur(6px);
}

.work-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.toc a {
  padding: 10px 12px;
  color: #31405c;
  font-weight: 700;
  border-radius: 4px;
}

.toc a:hover {
  background: #fff;
}

.article-stack {
  display: grid;
  gap: 20px;
}

.company-card-stack {
  display: grid;
  gap: 22px;
}

.company-index-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.company-index-layout .page-toc {
  position: sticky;
  top: 100px;
}

.article-block {
  padding: 28px;
  overflow: hidden;
}

.article-block ul {
  margin-bottom: 0;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.filter-row button {
  padding: 9px 14px;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.note-grid {
  grid-template-columns: repeat(3, 1fr);
}

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

.note-card {
  display: grid;
  gap: 8px;
  padding: 24px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

a.note-card:hover {
  border-color: rgba(49, 93, 146, 0.45);
  box-shadow: 0 18px 38px rgba(22, 32, 51, 0.1);
  transform: translateY(-2px);
}

.note-card span {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  background: var(--gold-soft);
  border-radius: 999px;
}

.note-card h2 {
  font-size: 21px;
}

.relay-simulator {
  display: grid;
  gap: 22px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.sim-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.sim-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sim-status {
  margin: 0;
  padding: 6px 12px;
  color: var(--navy);
  font-weight: 700;
  background: var(--gold-soft);
  border-radius: 999px;
  white-space: nowrap;
}

.sim-mode-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sim-mode-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sim-mode-tabs button {
  min-height: 42px;
  padding: 0 18px;
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.sim-mode-tabs button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.sim-mode-panel {
  display: grid;
  gap: 18px;
}

.mode-warning-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.mode-warning {
  margin: 0;
  padding: 12px 14px;
  color: #9b3c28;
  font-weight: 700;
  background: #fbf1ed;
  border: 1px solid #efc6b8;
  border-radius: 4px;
}

.power-toggle {
  display: grid;
  grid-template-rows: 1fr 1fr;
  justify-items: center;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  background: linear-gradient(180deg, #f7f8fa, #e1e6ee);
  border: 1px solid #c6d0dd;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}

.power-toggle span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  font-size: 12px;
}

.power-toggle.active {
  border-color: #24466f;
  box-shadow: 0 0 14px rgba(49, 93, 146, 0.18);
}

.power-toggle .power-on {
  background: #dbe6f5;
  color: #315d92;
  border-bottom: 1px solid #c6d0dd;
}

.power-toggle .power-off {
  background: #315d92;
  color: #fff;
}

.power-toggle.active .power-on {
  color: #fff;
  background: #315d92;
}

.power-toggle.active .power-off {
  background: #eef1f5;
  color: #6b7688;
}

.sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-areas:
    "relay relay"
    "tester graph";
  gap: 18px;
  align-items: start;
}

.sim-panel,
.sim-log {
  padding: 20px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.sim-panel h3,
.sim-log h3 {
  margin-bottom: 16px;
  color: var(--navy);
  font-size: 19px;
}

.relay-panel {
  grid-area: relay;
}

.tester-panel {
  grid-area: tester;
}

.sim-graph-panel {
  grid-area: graph;
}

.wiring-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.wiring-diagram-panel {
  min-width: 0;
}

.wiring-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.wiring-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.wiring-row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wiring-row span {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.wiring-row select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
  border: 1px solid #cfd8e4;
  border-radius: 4px;
}

.wiring-connection-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.wiring-diagram-frame {
  position: relative;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wiring-diagram-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.wiring-diagram-frame svg rect,
.wiring-diagram-frame svg path,
.wiring-diagram-frame svg text,
.wiring-terminal-dot {
  pointer-events: none;
}

.wiring-terminal-hit {
  cursor: pointer;
  pointer-events: all;
  touch-action: none;
}

.wiring-hit-layer {
  position: absolute;
  inset: 12px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--wiring-hit-columns, 72), minmax(0, 1fr));
  grid-template-rows: repeat(var(--wiring-hit-rows, 52), minmax(0, 1fr));
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.001);
}

.wiring-hit-cell {
  min-width: 0;
  min-height: 0;
}

.wiring-hit-layer.is-pending {
  cursor: pointer;
}

.wiring-code-destinations {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wiring-code-destinations h4 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: var(--navy);
  font-size: 14px;
}

.wiring-code-destinations button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.wiring-code-destinations button strong {
  color: var(--blue);
  font-size: 11px;
}

.wiring-code-destinations button.active {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

.wiring-target-panel {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 10px;
  width: min(300px, 46%);
  margin-top: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 16px 34px rgba(22, 32, 51, 0.16);
  transform: translate(16px, -50%);
}

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

.wiring-target-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wiring-target-panel strong {
  color: var(--navy);
}

.wiring-target-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wiring-target-options button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.wiring-target-options button:hover,
.wiring-target-options button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.wiring-issues {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.wiring-issues li {
  color: #31405c;
}

.wiring-check-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.relay-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}

.curve-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 0;
  flex: 0 0 132px;
}

.curve-selector button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.curve-selector button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.relay-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.indicator-group {
  display: flex;
  gap: 10px;
}

.indicator-window {
  display: grid;
  place-items: center;
  width: 52px;
  aspect-ratio: 1;
  background: #23262d;
  border: 2px solid #555d6a;
  border-radius: 999px;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.45);
}

.indicator-window span {
  color: #f5f7fb;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.indicator-window.active {
  background: #ea8c3e;
  border-color: #f1b06e;
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.18),
    0 0 18px rgba(234, 140, 62, 0.5);
}

.reset-lever {
  min-height: 38px;
  padding: 0 12px;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(180deg, #fbf7ee, #ead7a7);
  border: 1px solid #c9a24b;
  border-radius: 999px;
  cursor: pointer;
}

.lock-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 0;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex: 1 1 180px;
  min-width: 180px;
}

.lock-switch span,
.lock-switch strong {
  font-size: 13px;
  font-weight: 700;
}

.lock-switch span {
  color: var(--navy);
}

.lock-switch strong {
  margin-left: auto;
  color: var(--muted);
}

.lock-switch input {
  position: relative;
  width: 46px;
  height: 24px;
  padding: 0;
  appearance: none;
  background: #d4dbe5;
  border: 1px solid #bcc6d4;
  border-radius: 999px;
  cursor: pointer;
}

.lock-switch input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  content: "";
  background: #fff;
  border-radius: 999px;
  transition: transform 0.16s ease;
}

.lock-switch input:checked {
  background: #cc7454;
  border-color: #cc7454;
}

.lock-switch input:checked::after {
  transform: translateX(22px);
}

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

.setting-dial {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.setting-dial h4 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.setting-dial h4 span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.setting-dial p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.setting-dial p strong {
  color: var(--navy);
  font-size: 20px;
}

.dial-face {
  --dial-angle: 0deg;
  position: relative;
  width: 136px;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at center, #fff 0 27%, transparent 28%),
    radial-gradient(circle at center, #eef3f8 0 62%, #dde7f1 63% 100%);
  border: 1px solid #cfd8e4;
  border-radius: 999px;
  box-shadow: inset 0 0 0 8px #fff;
}

.dial-face:focus {
  outline: 2px solid rgba(49, 93, 146, 0.45);
  outline-offset: 3px;
}

.dial-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 44px;
  background: var(--blue);
  border-radius: 999px;
  transform: translate(-50%, -95%) rotate(var(--dial-angle));
  transform-origin: 50% 95%;
  transition: transform 0.16s ease;
}

.dial-arrow::after {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 0;
  height: 0;
  content: "";
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--blue);
  border-left: 6px solid transparent;
  transform: translateX(-50%);
}

.dial-value {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--navy);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: #fff;
  border: 1px solid #cfd8e4;
  border-radius: 999px;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.dial-value.active {
  color: #fff;
  background: var(--gold);
  border-color: var(--gold);
}

.current-control-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: start;
}

.current-control {
  display: grid;
  gap: 10px;
}

.current-control label,
.actual-current-display {
  display: grid;
  gap: 4px;
}

.current-control label span,
.actual-current-display span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.current-control strong {
  color: var(--navy);
  font-size: 32px;
  line-height: 1.2;
}

.actual-current-display strong {
  font-size: 24px;
}

.current-control input[type="range"] {
  width: 100%;
  padding: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.current-step-grid {
  display: grid;
  gap: 10px;
}

.current-step-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.current-step-control span {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.current-step-control div {
  display: flex;
  gap: 8px;
}

.step-button {
  min-width: 44px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--navy);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.step-button:hover {
  border-color: rgba(49, 93, 146, 0.45);
  background: #eef4fb;
}

.control-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tester-meter-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 0;
}

.tester-meter-row .phase-selector {
  min-height: 58px;
  margin-top: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.tester-elapsed {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 58px;
  margin-left: auto;
  padding: 8px 10px 8px 14px;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.tester-elapsed strong {
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
}

.counter-readout {
  display: grid;
  gap: 3px;
  justify-items: end;
  line-height: 1;
}

.counter-label {
  color: var(--muted);
  font-size: 12px;
}

.counter-reset-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.sim-status-store {
  display: none;
}

.phase-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.phase-selector span {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.phase-toggle {
  display: inline-flex;
  gap: 8px;
}

.phase-toggle button {
  min-width: 58px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.phase-toggle button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.graph-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.graph-frame {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.graph-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.sim-actions .button {
  min-width: 132px;
}

.sim-actions #start-sim {
  color: #fff;
  background: #b33a3a;
  border-color: #b33a3a;
}

.sim-actions #start-sim:hover,
.sim-actions #start-sim.is-running {
  background: #c93f3f;
  border-color: #c93f3f;
}

.sim-actions #start-sim:disabled {
  background: #d7a8a8;
  border-color: #d7a8a8;
  cursor: not-allowed;
  box-shadow: none;
}

.sim-actions #start-sim.is-running {
  box-shadow:
    0 0 0 4px rgba(201, 63, 63, 0.16),
    0 0 26px rgba(201, 63, 63, 0.5);
}

.sim-actions #stop-sim {
  color: #fff;
  background: #3b8f69;
  border-color: #3b8f69;
}

.sim-actions #stop-sim:hover {
  background: #45a178;
  border-color: #45a178;
}

.dial-progress {
  margin-top: 16px;
}

.dial-progress p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.dial-progress p strong {
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.sim-meter {
  display: grid;
  gap: 10px;
  margin: 0;
}

.sim-meter div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.sim-meter div:last-child {
  border-bottom: 0;
}

.sim-meter dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sim-meter dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.trip-progress {
  height: 12px;
  margin-top: 18px;
  overflow: hidden;
  background: #e7ecf3;
  border-radius: 999px;
}

.trip-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.12s ease;
}

.sim-log ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.25em;
  color: var(--muted);
}

.search-panel {
  margin-bottom: 28px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.search-box span {
  padding-left: 14px;
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.search-box input {
  padding-left: 0;
  background: transparent;
  border: 0;
}

.search-box input:focus {
  outline: none;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.search-result-block {
  padding: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.search-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.search-result-heading h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.search-result-heading a {
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.search-result-list {
  display: grid;
  gap: 10px;
}

.search-result-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.search-result-item:hover {
  border-color: rgba(49, 93, 146, 0.45);
}

.search-result-item strong {
  color: var(--navy);
}

.search-result-item span,
.search-empty {
  color: var(--muted);
}

.search-empty {
  margin: 0;
}

.full-results {
  max-width: 860px;
}

.back-link {
  margin-bottom: 18px;
}

.back-link a {
  color: var(--blue);
  font-weight: 700;
}

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

.data-tool {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.data-tool .section-heading {
  align-items: flex-start;
  margin-bottom: 22px;
}

.data-tool h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: -1px;
}

.tool-tabs button {
  min-height: 72px;
  padding: 14px 16px;
  color: var(--navy);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
  box-shadow: none;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.tool-tabs button.active {
  position: relative;
  z-index: 2;
  color: var(--navy);
  background: #fff;
  border-color: var(--line);
  border-bottom-color: #fff;
  box-shadow: 12px 0 22px rgba(22, 32, 51, 0.1);
  transform: translateY(1px);
}

.tool-tabs button:not(.active) {
  color: #536173;
  background: var(--soft);
}

.tool-tabs button:not(.active):hover {
  color: var(--navy);
  border-color: rgba(49, 93, 146, 0.45);
}

.tool-tab-panel {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 4px 4px;
}

.capacity-calculator {
  display: grid;
  grid-template-columns: minmax(220px, 320px) repeat(2, minmax(220px, 1fr));
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.capacity-calculator.single-result {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px);
}

.capacity-result {
  display: grid;
  align-content: center;
  min-height: 82px;
  padding: 14px 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.capacity-result span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.capacity-result strong {
  color: var(--navy);
  font-size: 30px;
  line-height: 1.2;
}

.formula-list {
  display: grid;
  gap: 6px;
  margin: 0 0 28px;
  padding: 16px 18px;
  color: #31405c;
  background: #fbf7ee;
  border: 1px solid #ead9b4;
  border-radius: 4px;
}

.formula-list p {
  margin: 0;
}

.separate-formula {
  margin-bottom: 0;
  background: #f7fbff;
  border-color: #d8e6f5;
}

.withstand-calculator {
  display: grid;
  gap: 18px;
  margin: 18px 0 30px;
}

.component-calculator {
  display: grid;
  gap: 18px;
  margin: 18px 0 30px;
  min-width: 0;
}

.component-form {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-sizing: border-box;
}

.component-controls,
.component-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
  min-width: 0;
}

.component-detail-fields {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.component-add-button {
  justify-self: start;
}

.component-note {
  display: grid;
  align-content: center;
  min-height: 48px;
  padding: 12px 14px;
  color: #31405c;
  font-weight: 700;
  background: #fbf7ee;
  border: 1px solid #ead9b4;
  border-radius: 4px;
}

.component-total {
  max-width: 420px;
}

.component-preview,
.component-total,
.component-breakdown,
.cable-chart-section,
.formula-list,
.reference-data {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.component-table {
  min-width: 820px;
}

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

.component-table th:nth-child(4),
.component-table td:nth-child(4) {
  text-align: right;
}

.component-table .empty-row {
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.reference-data {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.reference-data summary {
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.reference-data h3 {
  margin: 18px 0 10px;
}

.compact-reference-table {
  min-width: 420px;
}

.ocr-tool .section-heading {
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.ocr-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.35fr);
  gap: 22px;
  align-items: start;
}

.ocr-form {
  display: grid;
  gap: 18px;
}

.ocr-controls {
  display: grid;
  gap: 18px;
  align-self: start;
}

.ocr-form fieldset {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.ocr-form legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 700;
}

.ocr-site-card label {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr);
  gap: 14px;
  align-items: center;
}

.ocr-grid,
.ocr-relay-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ocr-relay-list {
  display: grid;
  gap: 14px;
}

.ocr-relay-control {
  display: grid;
  gap: 14px;
}

.ocr-add-relay-card {
  margin-top: 0 !important;
  padding: 16px !important;
  border-style: dashed !important;
  background: #fbfcfd;
}

.ocr-add-relay-card legend {
  color: #59697a;
}

.ocr-add-relay-card input::placeholder {
  color: #98a4b0;
  opacity: 1;
}

.ocr-add-relay-card select:invalid,
.ocr-add-relay-card select option[value=""] {
  color: #98a4b0;
}

.ocr-add-relay-card .button {
  width: 100%;
}

.ocr-relay-row {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  will-change: transform;
}

.ocr-relay-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.ocr-relay-header strong {
  color: var(--navy);
}

.ocr-relay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ocr-step-field {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 6px;
  align-items: center;
}

.ocr-step-field .small-button {
  min-height: 44px;
  padding: 0;
}

.ocr-relay-row input[type="color"] {
  min-height: 46px;
  padding: 4px;
}

.ocr-relay-row .small-button:disabled {
  color: #94a0ad;
  cursor: not-allowed;
  background: #f3f5f8;
}

.ocr-preview {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ocr-preview canvas {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 32px rgba(22, 32, 51, 0.08);
}

.ocr-summary {
  display: grid;
  gap: 12px;
}

.ocr-summary article {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  will-change: transform;
}

.ocr-summary-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.ocr-summary-actions {
  display: flex;
  gap: 6px;
}

.ocr-summary-actions .small-button {
  min-height: 34px;
  padding: 6px 10px;
}

.ocr-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ocr-summary strong {
  color: var(--navy);
  font-size: 24px;
}

.chart-scroll {
  overflow-x: auto;
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-sizing: border-box;
}

.withstand-chart {
  display: block;
  min-width: 820px;
  width: 100%;
  height: auto;
  background: #fff;
}

.chart-title {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.chart-grid {
  stroke: rgba(22, 32, 51, 0.32);
  stroke-width: 0.8;
}

.chart-grid.major {
  stroke: rgba(22, 32, 51, 0.7);
  stroke-width: 1.2;
}

.chart-frame {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.cable-line {
  stroke: #3d4656;
  stroke-width: 1.8;
}

.cable-line.selected {
  stroke: #d64040;
  stroke-width: 4;
}

.chart-line-label,
.chart-size-label,
.chart-axis-label,
.chart-axis-title {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.chart-size-label.selected {
  fill: #d64040;
  font-size: 16px;
}

.chart-axis-title {
  font-size: 17px;
}

.chart-table-cell {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 1;
}

.chart-table-cell.header {
  fill: #f7f8fa;
}

.chart-table-cell.selected {
  fill: #fde7e7;
}

.chart-table-text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.result-marker {
  fill: #d64040;
  stroke: var(--navy);
  stroke-width: 3;
}

.source-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.transformer-calculators {
  display: grid;
  gap: 18px;
}

.transformer-card {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.table-scroll {
  overflow-x: auto;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-sizing: border-box;
}

.capacity-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.capacity-table th,
.capacity-table td {
  padding: 10px 12px;
  text-align: right;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.capacity-table th {
  color: var(--navy);
  font-size: 13px;
  background: var(--soft);
}

.capacity-table th:nth-child(2n + 1),
.capacity-table td:nth-child(2n + 1) {
  color: #31405c;
  font-weight: 700;
  background: #fbfcfd;
}

.capacity-table th:nth-child(2n),
.capacity-table td:nth-child(2n) {
  border-right-width: 2px;
}

.capacity-table th:last-child,
.capacity-table td:last-child {
  border-right: 0;
}

.capacity-table tr:last-child td {
  border-bottom: 0;
}

.site-shell {
  display: block;
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.side-nav .brand {
  flex: 0 0 auto;
  min-width: 280px;
}

.side-nav nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.side-nav nav a,
.side-nav nav summary {
  position: relative;
  padding: 8px 10px;
  color: #31405c;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}

.side-nav nav a:hover,
.side-nav nav a.active,
.side-nav nav summary:hover,
.side-nav nav .nav-dropdown.active > summary,
.side-nav nav .nav-dropdown[open] > summary {
  color: var(--navy);
  background: var(--soft);
}

.side-nav nav .nav-dropdown {
  position: relative;
}

.side-nav nav summary {
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

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

.side-nav nav summary::after {
  width: 6px;
  height: 6px;
  content: "";
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.side-nav nav .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 280px;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 42, 70, 0.12);
  border-radius: 6px;
  box-shadow: 0 16px 34px rgba(20, 42, 70, 0.16);
}

.side-nav nav .dropdown-menu a {
  padding: 9px 10px;
  font-size: 12px;
}

.side-nav nav a.login-link {
  margin-left: 6px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
}

.side-nav nav a.login-link:hover {
  color: #fff;
  background: #1f3b5e;
}

.side-nav nav a.login-link::before {
  display: none;
}

.side-nav nav a.active::before,
.side-nav nav .nav-dropdown.active > summary::before {
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 2px;
  content: "";
  background: var(--gold);
  border-radius: 999px;
}

.side-note {
  display: none;
}

.page-main {
  min-width: 0;
}

@media (max-width: 640px) {
  .side-nav {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .side-nav nav {
    justify-content: flex-start;
  }

  .side-nav nav .dropdown-menu {
    position: static;
    min-width: min(100%, 260px);
    margin-top: 4px;
    box-shadow: none;
  }

  .ocr-grid,
  .ocr-relay-fields,
  .ocr-site-card label,
  .representative-profile,
  .ocr-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .header-inner,
  .hero-grid,
  .two-column,
  .company-layout,
  .work-layout,
  .app-band {
    grid-template-columns: 1fr;
  }

  .header-inner,
  .app-band,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 22px;
  }

  .service-grid,
  .explain-grid,
  .tips-grid,
  .note-grid,
  .note-grid.compact-grid,
  .sim-grid,
  .current-control-layout,
  .dial-grid,
  .wiring-layout,
  .wiring-connection-layout,
  .search-results-grid,
  .company-index-layout,
  .page-toc,
  .ocr-layout {
    grid-template-columns: 1fr;
  }

  .sim-header,
  .ocr-tool .section-heading {
    flex-direction: column;
  }

  .sim-grid {
    grid-template-areas:
      "relay"
      "tester"
      "graph";
  }

  .sim-mode-tabs,
  .sim-mode-header,
  .wiring-check-header,
  .wiring-row,
  .relay-toolbar,
  .relay-topline,
  .indicator-group {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-warning-stack {
    justify-items: stretch;
  }

  .power-toggle {
    min-height: 56px;
  }

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

  .indicator-group {
    justify-content: center;
  }

  .company-index-layout .page-toc {
    position: static;
  }

  .explain-card {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .capacity-calculator {
    grid-template-columns: 1fr;
  }

  .capacity-calculator.single-result {
    grid-template-columns: 1fr;
  }

  .component-controls,
  .component-detail-fields {
    grid-template-columns: 1fr;
  }

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

  .tool-tabs button {
    min-height: 72px;
    border-radius: 4px;
  }

  .tool-tabs button.active {
    border-bottom-color: var(--line);
    box-shadow: 0 10px 18px rgba(22, 32, 51, 0.08);
    transform: none;
  }

  .tool-tab-panel {
    border-radius: 4px;
  }
}

.quote-intro {
  max-width: none;
  margin-bottom: 16px;
}

.quote-intro p {
  margin-top: 0;
}

.quote-form {
  display: grid;
  gap: 16px;
  max-width: none;
}

.quote-form section {
  display: grid;
  gap: 14px;
}

.quote-form h2,
.quote-form h3 {
  margin: 0;
  color: var(--navy);
}

.quote-form h2 {
  font-size: 18px;
}

.quote-form h3 {
  font-size: 16px;
}

.quote-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-mode-tabs button {
  min-height: 42px;
  color: #536173;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.quote-mode-tabs button.active {
  color: var(--navy);
  background: #fff;
  border-color: var(--navy);
}

.quote-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.quote-form [data-estimate-section][hidden],
.quote-form [data-estimate-field][hidden],
.quote-form [data-inquiry-section][hidden] {
  display: none;
}

.quote-fields label {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}

.required-text,
.unfilled-text {
  color: #b42318;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.required-note {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

.input-suffix-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-suffix-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.input-suffix {
  flex: 0 0 auto;
  color: var(--navy);
  font-weight: 700;
}

.stacked-field {
  display: grid;
  gap: 8px;
}

.quote-equipment-card {
  gap: 16px;
}

.quote-annual-group {
  display: grid;
  gap: 12px;
}

.quote-annual-title {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.quote-price-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quote-price-cell {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.quote-price-cell > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-price-cell select,
.quote-price-cell input {
  width: 100%;
  min-height: 0;
  padding: 2px 0 4px;
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d5dbe4;
  border-radius: 0;
}

.quote-price-cell select:focus,
.quote-price-cell input:focus {
  outline: none;
  border-bottom-color: var(--navy);
}

.quote-estimate-result {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.estimate-result-title {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

.estimate-total-block {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(20, 42, 70, 0.06);
}

.estimate-total-block:first-child {
  border-top: 4px solid var(--navy);
}

.estimate-total-block:last-child {
  border-top: 4px solid var(--gold);
}

.estimate-total-cell {
  padding: 22px 18px 18px;
  background: linear-gradient(180deg, #f7f8fa 0%, #fff 100%);
}

.estimate-total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.estimate-total-label {
  color: var(--navy);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

.estimate-breakdown {
  display: grid;
  flex: 1 1 auto;
  gap: 0;
  padding: 6px 8px 10px;
  background: #f4f7fa;
}

.estimate-breakdown-title {
  padding: 8px 10px 6px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.estimate-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-top: 1px solid #e3e8ef;
}

.estimate-breakdown-row > span {
  color: #536173;
  font-size: 13px;
}

.estimate-breakdown-note {
  padding: 10px 10px 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  border-top: 1px solid #e3e8ef;
}

.estimate-amount {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.estimate-total-cell .estimate-total-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  color: var(--navy);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

.estimate-total-cell .estimate-total-yen {
  font-size: inherit;
}

.estimate-total-cell .estimate-total-tax {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.estimate-notes,
.muted-note {
  color: var(--muted);
  font-size: 13px;
}

.missing-required {
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

.missing-required span {
  display: inline-block;
  margin: 4px 10px 0 0;
}

.char-counter {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.char-counter.over {
  color: #b42318;
  font-weight: 700;
}

.quote-actions {
  display: grid;
  gap: 8px;
}

.privacy-consent {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.privacy-consent label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.6;
}

.privacy-consent input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--navy);
}

.privacy-consent a {
  color: inherit;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.policy-document {
  max-width: 860px;
}

.policy-document > h2 {
  margin: 0 0 24px;
  padding-bottom: 14px;
  color: var(--navy);
  font-size: 22px;
  border-bottom: 2px solid var(--accent);
}

.policy-document h3 {
  margin: 38px 0 12px;
  color: var(--navy);
  font-size: 18px;
}

.policy-document h4 {
  margin: 28px 0 10px;
  color: var(--navy);
  font-size: 16px;
}

.policy-document p,
.policy-document li,
.policy-document dd {
  line-height: 1.9;
}

.policy-document ol,
.policy-document ul {
  display: grid;
  gap: 8px;
  padding-left: 1.5em;
}

.policy-document ol ol {
  margin-top: 10px;
}

.policy-document a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.analytics-preference {
  margin: 16px 0 24px;
  padding: 14px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.analytics-preference label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.analytics-preference input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: #c81920;
}

.analytics-preference [data-analytics-status] {
  margin: 8px 0 0;
  font-size: 12px;
  color: #555;
}

.policy-contact {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
}

.policy-contact dt,
.policy-contact dd {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.policy-contact dt {
  color: var(--navy);
  font-weight: 700;
  background: var(--soft);
}

.policy-date {
  margin-top: 36px;
  color: var(--muted);
  text-align: right;
}

.quote-actions small {
  color: var(--muted);
}

@media (max-width: 900px) {
  .quote-mode-tabs,
  .quote-fields,
  .estimate-totals,
  .quote-price-grid {
    grid-template-columns: 1fr;
  }

  .estimate-total-label,
  .estimate-total-cell .estimate-total-value {
    font-size: 22px;
  }

  .policy-contact {
    grid-template-columns: 1fr;
  }

  .policy-contact dt {
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .policy-contact dd {
    padding-top: 4px;
  }
}

/* Compact, scrollable policy immediately before explicit consent. */
.contact-card.contact-privacy {
  width: 80%;
  min-width: 0;
  justify-self: center;
  margin-inline: auto;
  padding: 16px;
  background: #f4f6f8;
  border: 1px solid #d4dce3;
  border-radius: 8px;
  box-shadow: none;
}
.contact-card.contact-privacy > h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  color: #344653;
  font-size: 16px;
}
.contact-privacy-body {
  box-sizing: border-box;
  max-width: none;
  height: 150px;
  overflow-y: auto;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #dce2e7;
  border-radius: 4px;
  color: #46535e;
  font-size: 14px;
  line-height: 1.8;
  scrollbar-color: #9aaab7 #edf1f4;
  scrollbar-width: thin;
  overflow-wrap: anywhere;
  scroll-margin-top: 24px;
}
.contact-privacy-body:focus-visible {
  outline: 2px solid #627d91;
  outline-offset: 3px;
}
.contact-privacy-body > p:first-child { margin-top: 0; }
.contact-privacy-body p,
.contact-privacy-body li,
.contact-privacy-body dd { font-size: 14px; line-height: 1.8; }
.contact-privacy-body h3 { margin-top: 20px; color: #344653; font-size: 15px; }
.contact-privacy-body h4 { color: #344653; font-size: 14px; }
.contact-privacy-body a { color: #315b76; }
@media (max-width: 600px) {
  .contact-card.contact-privacy { padding: 12px; }
  .contact-privacy-body { padding-inline: 10px; }
  .contact-privacy-body .policy-contact { grid-template-columns: 1fr; }
}

.contact-privacy > .privacy-consent {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d4dce3;
}
