/* 太陽光・蓄電池 損益シミュレーター。共通の /assets/style.css の上に重ねる。 */
:root {
  --c-total: #2a7ea3;
  --c-solar: #c47a08;
  --c-bat: #6454b8;
  --neg: #b4472f;
  --pos: #1d6f5a;
}
.wrap.wide { max-width: 1180px; }

/* page head */
.sim-head { padding-block: 24px 20px; }
.sim-head h1 { font-size: clamp(26px, 4.2vw, 38px); margin: 0 0 14px; }
.nb { display: inline-block; }
.sim-head .lead { margin: 0; font-size: 15px; }

/* sticky summary */
.mini { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 18px; margin: 0 0 20px; box-shadow: 0 10px 24px -20px rgba(40, 90, 120, 0.5); }
.mini div { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.mini .k { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.mini b { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* layout */
.sim { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.inputs, .results { display: grid; gap: 16px; min-width: 0; }
.box { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 20px; min-width: 0; }
.box h2 { font-size: 16px; font-weight: 500; letter-spacing: 0.04em; margin: 0 0 14px; line-height: 1.5; }
.box h3 { font-size: 13px; font-weight: 500; color: var(--accent-ink); letter-spacing: 0.06em; margin: 0 0 10px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.box-head h2 { margin: 0; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.85; margin: 10px 0 0; }
.body-s { font-size: 14.5px; color: var(--muted); line-height: 1.9; margin: 10px 0 0; }
.body-s b { font-weight: 500; }
a.text { color: var(--accent-ink); border-bottom: 1px solid var(--line); }
a.text:hover { border-bottom-color: var(--accent); }

/* segmented */
.seg { display: grid; gap: 8px; }
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; transition: background .15s, border-color .15s; }
.seg b { font-weight: 500; font-size: 15px; line-height: 1.5; }
.seg small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.seg input:checked + span { background: var(--bg-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* fields */
.fld { display: grid; gap: 6px; margin: 0 0 16px; }
.fld:last-child { margin-bottom: 0; }
.lab { font-size: 13.5px; font-weight: 500; line-height: 1.6; }
.inp { display: flex; align-items: center; gap: 8px; }
.inp input, .inp select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; line-height: 1.5;
}
.inp input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
.inp input:focus, .inp select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.inp input::placeholder { color: #9fb0ba; }
.unit { flex: 0 0 auto; min-width: 4.2em; font-size: 13px; color: var(--muted); }
.inp select + .unit { display: none; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 14px; cursor: pointer; line-height: 1.7; }
.chk input { margin-top: 5px; accent-color: var(--accent-ink); width: 16px; height: 16px; }
[hidden] { display: none !important; }

/* advanced */
details.adv { padding: 0; }
details.adv > summary { list-style: none; cursor: pointer; padding: 18px 22px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary h2 { margin: 0; }
details.adv > summary::after { content: "＋"; color: var(--accent-ink); font-size: 18px; margin-left: auto; }
details.adv[open] > summary::after { content: "−"; }
.sub-s { font-size: 12.5px; color: var(--muted); flex-basis: 100%; order: 3; }
details.adv > .grp { padding: 4px 22px 6px; border-top: 1px solid var(--line); }
details.adv > .grp:first-of-type { margin-top: 0; }
details.adv > .grp { padding-top: 18px; padding-bottom: 8px; }
details.adv > .grp:last-of-type { padding-bottom: 22px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { font: inherit; font-size: 14px; font-weight: 500; color: var(--accent-ink); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; cursor: pointer; }
.btn:hover { background: var(--bg-soft); border-color: var(--accent); }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.status { font-size: 13px; color: var(--accent-ink); }
.inputs > .fine { margin-top: -6px; }

/* results */
.lead-box { background: var(--bg-soft); border-color: transparent; }
.verdict { margin: 0; font-size: 17px; line-height: 1.95; font-weight: 500; }
.warns p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.85; color: var(--neg); }
.warns:empty { display: none; }

.cards { display: grid; gap: 14px; }
.cards.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.n1 { grid-template-columns: minmax(0, 1fr); }
.card2 { background: var(--bg); border: 1px solid var(--line); border-top: 4px solid var(--c-total); border-radius: 18px; padding: 16px 18px 14px; min-width: 0; }
.card2.solar { border-top-color: var(--c-solar); }
.card2.bat { border-top-color: var(--c-bat); }
.c-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.c-big { margin: 10px 0 8px; line-height: 1.2; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.c-big .n { font-family: var(--font-latin), var(--font-body); font-size: 38px; font-weight: 400; letter-spacing: 0.01em; }
.c-big .u { font-size: 14px; color: var(--muted); }
.c-big .t { font-size: 22px; font-weight: 500; color: var(--neg); }
.card2 dl { margin: 0; display: grid; gap: 0; }
.card2 dl div { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 7px 0; font-size: 13px; line-height: 1.6; }
.card2 dt { color: var(--muted); }
.card2 dd { margin: 0; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c-total); flex: 0 0 auto; }
.dot.solar { background: var(--c-solar); }
.dot.bat { background: var(--c-bat); }

/* chart */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart svg text { user-select: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.zero { stroke: #8da3b0; stroke-width: 1.4; }
.chart .ax { font-size: 11.5px; fill: var(--muted); font-family: var(--font-latin), var(--font-body); }
.chart .ax.unit { font-size: 11px; }
.chart .ln { fill: none; stroke: var(--c-total); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.solar { stroke: var(--c-solar); }
.chart .ln.bat { stroke: var(--c-bat); }
.chart .pb { fill: #fff; stroke: var(--c-total); stroke-width: 2.4; }
.chart .pb.solar { stroke: var(--c-solar); }
.chart .pb.bat { stroke: var(--c-bat); }
.chart .endlab { font-size: 12px; font-weight: 500; fill: var(--c-total); }
.chart .endlab.solar { fill: #9a5f04; }
.chart .endlab.bat { fill: var(--c-bat); }
.chart .cross { stroke: #8da3b0; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dotp { fill: var(--c-total); stroke: #fff; stroke-width: 1.5; }
.chart .dotp.solar { fill: var(--c-solar); }
.chart .dotp.bat { fill: var(--c-bat); }
.tip { position: absolute; top: 6px; pointer-events: none; background: rgba(255, 255, 255, 0.97); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; font-size: 12.5px; line-height: 1.75; box-shadow: 0 10px 24px -14px rgba(40, 90, 120, 0.45); white-space: nowrap; }
.tip .tt { color: var(--muted); font-size: 12px; }
.tip .dot { width: 8px; height: 8px; margin-right: 6px; }
.tip b { font-weight: 500; font-variant-numeric: tabular-nums; margin-left: 4px; }

/* key-value + lists */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.kv div { background: var(--bg-soft); border-radius: 14px; padding: 12px 14px; }
.kv dt { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.kv dd { margin: 2px 0 0; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bul, .links { margin: 12px 0 0; padding-left: 1.3em; font-size: 14px; color: var(--muted); line-height: 1.9; }
.bul li, .links li { margin-bottom: 4px; }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; line-height: 1.6; vertical-align: top; }
.tbl thead th { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; vertical-align: bottom; }
.tbl th[scope="row"], .tbl thead th:first-child { text-align: left; font-weight: 500; color: var(--ink); }
.tbl tbody th[scope="row"] { font-size: 13px; }
.tbl tr.cur { background: var(--bg-soft); }
.annual-tbl th, .annual-tbl td { white-space: nowrap; }
details.annual > summary { cursor: pointer; font-size: 14px; color: var(--accent-ink); padding: 4px 0; }
details.annual[open] > summary { margin-bottom: 10px; }

/* notes */
.notes { border-top: 1px solid var(--line); padding-block: 36px 72px; max-width: 52em; }
.notes h2 { font-size: 18px; font-weight: 500; margin: 0 0 12px; }
.notes > details > summary { cursor: pointer; font-size: 14.5px; color: var(--accent-ink); }
.notes-body { margin-top: 14px; font-size: 14px; color: var(--muted); line-height: 1.95; }
.notes-body h3 { font-size: 14px; font-weight: 500; color: var(--ink); margin: 18px 0 6px; }
.notes-body ul { margin: 0; padding-left: 1.3em; }
.notes-body li { margin-bottom: 6px; }
.disclaimer { margin: 18px 0 0; font-size: 13px; color: var(--muted); line-height: 1.9; }

/* narrow */
@media (max-width: 1020px) {
  .sim { grid-template-columns: minmax(0, 1fr); }
  .cards.n3 { grid-template-columns: minmax(0, 1fr); }
  .card2 { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .sim-head { padding-block: 12px 14px; }
  .mini { padding: 8px 12px; gap: 4px; border-radius: 14px; margin-bottom: 14px; }
  .mini b { font-size: 14px; }
  .mini .k { font-size: 10.5px; }
  .box { padding: 18px 16px 16px; border-radius: 18px; }
  details.adv > summary { padding: 16px; }
  details.adv > .grp { padding-inline: 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .verdict { font-size: 15.5px; }
  .c-big .n { font-size: 34px; }
}
.fld, .chk, .inp { scroll-margin-top: 96px; }

/* ---- 見やすさの調整: 白とごく薄い水色を土台に、線と文字を少しだけ濃くする ---- */
:root { --line2: #c5d9e5; --text2: #4a5a65; --tint: #eaf4fa; }
body { background: #f3f8fb; }
.sim-head { padding-block: 40px 22px; }
.sim-head .lead { color: var(--text2); }
.box { background: #fff; border-color: var(--line2); box-shadow: 0 1px 2px rgba(40, 90, 120, 0.06), 0 8px 22px -18px rgba(40, 90, 120, 0.35); }
.box h2 { border-left: 3px solid var(--accent); padding-left: 10px; }
.box-head h2 { margin: 0; }
details.adv > summary h2 { margin: 0; }
.mini { background: rgba(255, 255, 255, 0.96); border-color: var(--line2); }
.mini .k { color: var(--text2); }
.hint, .fine, .body-s, .bul, .links, .kv dt, .card2 dt, .legend, .notes-body, .disclaimer, .unit, .seg small { color: var(--text2); }
.lab { color: var(--ink); }
.inp input, .inp select { border-color: #b7cedb; background: #fff; }
.inp input:hover, .inp select:hover { border-color: var(--accent); }
.inp input::placeholder { color: #8da2af; }
.seg span { border-color: #b7cedb; background: #fff; }
.seg input:checked + span { background: var(--tint); }
.lead-box { background: var(--tint); border: 1px solid #c3dfec; border-left: 4px solid var(--accent); }
.verdict { color: var(--ink); }
.card2 { border-color: var(--line2); border-top-color: var(--c-total); box-shadow: 0 1px 2px rgba(40, 90, 120, 0.06); }
.card2 dl div { border-top-color: var(--line2); }
.kv div { background: var(--tint); }
.tbl thead th { color: #3c4c57; background: #f1f7fb; border-bottom: 1px solid var(--line2); }
.tbl th, .tbl td { border-bottom-color: #d5e4ed; }
.tbl tr.cur { background: var(--tint); }
.chart .grid { stroke: #d5e4ed; }
.chart .ax { fill: #4a5a65; }
.btn { border-color: #b7cedb; color: var(--accent-ink); background: #fff; }
.pos { color: #14614e; }
.neg { color: #a63c27; }
details.adv > .grp { border-top-color: var(--line2); }
.notes { border-top-color: var(--line2); }
footer { border-top-color: var(--line2); }
footer, .foot a { color: var(--text2); }

.foot .copy { color: var(--accent-ink); border-bottom: 1px solid var(--line2); }
.foot .copy:hover { border-bottom-color: var(--accent); }

/* かんたん入力 */
.quick { background: var(--tint); border-radius: 16px; padding: 16px 16px 14px; margin-bottom: 20px; }
.quick h3 { margin: 0 0 6px; }
.q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-top: 10px; }
.q-grid .fld { margin-bottom: 14px; }
.lab .opt { color: var(--text2); font-weight: 400; font-size: 12px; margin-left: 4px; }
.btn.primary { background: var(--accent-ink); color: #fff; border-color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
@media (max-width: 420px) { .q-grid { grid-template-columns: minmax(0, 1fr); } }
.box .chk { margin-top: 6px; }
#acFields, #floorFields, #touFields { margin: 4px 0 16px; padding: 12px 14px 0; background: #f6fafc; border: 1px solid #d5e4ed; border-radius: 14px; }
#acFields .q-grid .fld, #floorFields .q-grid .fld { margin-bottom: 12px; }

.months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.months label { display: block; cursor: pointer; }
.months input { position: absolute; opacity: 0; pointer-events: none; }
.months span { display: block; text-align: center; font-size: 13px; line-height: 1; padding: 9px 0; border: 1px solid #b7cedb; border-radius: 10px; background: #fff; color: var(--text2); }
.months input:checked + span { background: var(--tint); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--accent); }
.months input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) { .months { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.fld.is-off .lab, .fld.is-off .hint, .fld.is-off .unit { opacity: 0.45; }
.inp input:disabled { background: #eef2f5; color: #8a9aa5; border-color: #d5e0e7; cursor: not-allowed; }

.geo { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #b7cedb; }
.geo .btn { margin-bottom: 4px; }
.geo .btn:disabled { opacity: 0.5; cursor: wait; }

.sim-head .lead { max-width: none; }
.sim-head .lead { text-wrap: pretty; }

/* 「SOLAR & BATTERY」と同じ行の右端に「その他のサイト」(共通部品 /assets/sites.js) */
.sim-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sim-top .eyebrow { margin: 0; }
.sim-top .h9s__btn { min-height: 30px; padding: 0 12px; font-size: 12px; font-weight: 400; color: var(--text2); border-color: var(--line2); }
.sim-top .h9s__btn:hover { color: var(--c-total); }
.sim-head { padding-block-start: 28px; }

/* ---- 泡の雰囲気（h9-g.com 共通の世界観。トップより色を控えめに。design/tool-sites-look.md・エコキュートと同じ値） ---- */
:root { --bub-a: rgba(120, 200, 230, 0.16); --bub-b: rgba(190, 225, 245, 0.32); --bub-ring: #d3e6f0; }
main.wrap { position: relative; isolation: isolate; }
.bubbles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
html, body { overflow-x: clip; }
.bubbles i { position: absolute; border-radius: 50%; }
.bubbles i:nth-child(1) { right: -220px; top: -240px; width: 640px; height: 640px; background: radial-gradient(closest-side, var(--bub-a), transparent); }
.bubbles i:nth-child(2) { right: 18%; top: 60px; width: 54px; height: 54px; background: radial-gradient(circle at 35% 30%, #fff, #e3f2f9); border: 1px solid var(--bub-ring); opacity: .8; }
.bubbles i:nth-child(3) { left: -180px; top: 640px; width: 440px; height: 440px; background: radial-gradient(closest-side, var(--bub-b), transparent); opacity: .7; }
@media (max-width: 860px) { .bubbles i:nth-child(2) { right: 10%; top: 120px; width: 36px; height: 36px; } }

/* 枠は線を引かず、薄い影と内側の線で浮かせる。右上にだけ小さな泡の光（グラフの吹き出しが切れないよう背景で描く） */
.box { border: 0; border-radius: 22px;
  background: radial-gradient(circle 110px at calc(100% - 20px) 20px, var(--bub-b), rgba(255, 255, 255, 0) 100%), #fff;
  box-shadow: 0 18px 40px -32px rgba(40, 110, 150, 0.45), inset 0 0 0 1px var(--line2); }
/* 見出しの左の縦線はやめて、小さな泡の丸 */
.box h2 { border-left: 0; padding-left: 0; display: flex; align-items: center; gap: 10px; }
.box h2::before { content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #a9d6ea); box-shadow: inset 0 0 0 1px #8cc3dc; }
/* 結果の文: 左の太線はやめ、淡いグラデーションと泡で目立たせる */
.lead-box { border: 0; border-radius: 22px;
  background: radial-gradient(circle 150px at calc(100% - 40px) 30px, rgba(170, 215, 238, 0.45), rgba(255, 255, 255, 0) 100%), linear-gradient(140deg, #f3f9fc 0%, #ffffff 70%);
  box-shadow: 0 22px 44px -30px rgba(40, 110, 150, 0.5), inset 0 0 0 1px #cfe4ef; }
.verdict { font-weight: 400; }
/* 3つの結果カード: 上の太い色線をやめる（色は名前の左の丸で区別） */
.card2, .card2.solar, .card2.bat { border: 0; border-radius: 20px;
  background: radial-gradient(circle 90px at calc(100% - 16px) 16px, var(--bub-b), rgba(255, 255, 255, 0) 100%), #fff;
  box-shadow: 0 18px 40px -32px rgba(40, 110, 150, 0.45), inset 0 0 0 1px var(--line2); }
.mini { border: 0; border-radius: 18px; background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px -24px rgba(40, 110, 150, 0.5), inset 0 0 0 1px var(--line2); }
.seg input:checked + span { background: #f3f9fc; }
