/* 回路計算帖：全ページ共通 */
:root {
  --bg: #f7f5ef;
  --panel: #ffffff;
  --text: #242424;
  --muted: #666;
  --line: #d9d5ca;
  --accent: #2f5d50;
  --accent-soft: #e7efe9;
  --warn-soft: #fff6df;
  --shadow: 0 8px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  border-bottom: 1px solid var(--line);
  background: rgba(247,245,239,.96);
}

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

.site-head { padding: 18px 0 14px; }
.site-name { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: .05em; }
.site-tagline { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }

.page-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 64px;
}

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

.site-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  border-right: 1px solid var(--line);
  padding-right: 22px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.nav-home {
  display: block;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  margin-bottom: 18px;
}

.nav-group { margin: 0 0 18px; }
.nav-group-title {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list li { margin: 2px 0; }

.nav-link,
.nav-coming {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: .9rem;
  line-height: 1.35;
}
.nav-link { color: var(--text); text-decoration: none; }
.nav-link:hover { background: #efede7; }
.nav-link.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.nav-coming { color: #999; }
.nav-coming small { margin-left: 5px; font-size: .72rem; }

.menu-toggle {
  display: none;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 8px;
}

.lead { margin: 0 0 24px; color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin: 18px 0;
}

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

.field { display: flex; flex-direction: column; gap: 5px; }
label { font-weight: 700; font-size: .93rem; }

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

select {
  width: 84px;
  font-family: Arial, "Segoe UI Symbol", "Segoe UI", sans-serif;
}

input:focus, select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.primary {
  margin-top: 18px;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.result {
  background: var(--accent-soft);
  border: 1px solid #cbd9cf;
  border-radius: 14px;
  padding: 18px;
  margin-top: 18px;
}

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

.result-box {
  background: rgba(255,255,255,.7);
  border-radius: 10px;
  padding: 14px;
}

.result-label { color: var(--muted); font-size: .86rem; }

.result-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
  font-family: Arial, "Segoe UI Symbol", "Segoe UI", sans-serif;
}

.sub { margin-top: 12px; color: var(--muted); font-size: .94rem; }

.circuit-figure {
  margin: 18px 0 6px;
  text-align: center;
}

.circuit-placeholder {
  min-height: 220px;
  border: 1px dashed #b8b2a7;
  border-radius: 14px;
  background: #fbfaf7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--muted);
}

.circuit-placeholder strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.circuit-image {
  display: none;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.figure-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: .88rem;
}

.warning {
  background: var(--warn-soft);
  border: 1px solid #ead8a4;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}

details {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}
summary { cursor: pointer; font-weight: 700; }

.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f4f4f2;
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}

.error {
  margin-top: 12px;
  font-weight: 700;
  color: #8b2f2f;
}

footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  font-size: .9rem;
}

@media (max-width: 780px) {
  .page-shell {
    display: block;
    padding-top: 18px;
  }
  .menu-toggle {
    display: block;
    margin-bottom: 12px;
  }
  .site-sidebar {
    display: none;
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 22px;
    background: #fff;
  }
  .site-sidebar.is-open { display: block; }
  .grid, .result-main { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}


/* Ωなどの単位記号は欧文フォントの字形を優先 */
h1,
.nav-link,
.nav-coming {
  font-family: Arial, "Segoe UI Symbol", "Yu Gothic UI", "Meiryo", sans-serif;
}
