:root {
  --navy: #1f3a5f;
  --navy-2: #2b4f7e;
  --ink: #1d2330;
  --sub: #5b6475;
  --line: #dfe3ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --green: #188038;
  --green-bg: #e6f4ea;
  --amber: #b06000;
  --amber-bg: #fef7e0;
  --red: #c5221f;
  --red-bg: #fce8e6;
  --blue: #1a73e8;
  --sheet-grid: #e2e2e2;
  --sheet-head: #f8f9fa;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 15px; line-height: 1.75; -webkit-text-size-adjust: 100%;
}
a { color: var(--blue); }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 860px; }

/* header */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { font-weight: 700; color: var(--navy); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; letter-spacing: .02em; }
.top nav { display: flex; gap: 18px; font-size: 14px; }
.top nav a { color: var(--sub); text-decoration: none; }
.top nav a:hover { color: var(--navy); }
@media (max-width: 760px) { .top nav { display: none; } }

/* hero */
.hero { background: linear-gradient(160deg, #1f3a5f 0%, #24476f 60%, #2d5a86 100%); color: #fff; padding: 64px 0 56px; }
.hero .eyebrow { display: inline-block; font-size: 13px; letter-spacing: .08em; background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 99px; }
.hero h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.4; margin: 16px 0 14px; font-weight: 800; }
.hero p.lead { font-size: 16px; color: #dbe6f3; max-width: 720px; margin: 0 0 26px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.badge { background: #fff; color: var(--navy); border-radius: 8px; padding: 10px 14px; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.badge small { font-weight: 500; color: var(--sub); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; padding: 11px 18px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn-primary { background: #fbbc04; color: #1d2330; }
.btn-primary:hover { background: #f9c935; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* sections */
section.block { padding: 64px 0; }
section.block.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-label { font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .06em; }
h2 { font-size: clamp(22px, 3vw, 28px); margin: 6px 0 12px; line-height: 1.45; }
h2 + p.desc { color: var(--sub); margin: 0 0 28px; max-width: 760px; }
h3 { font-size: 17px; margin: 0 0 8px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card p { margin: 0; color: var(--sub); font-size: 14px; }
.card .num { font-size: 13px; font-weight: 700; color: var(--blue); }

/* flow diagram */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; }
.flow .node { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.flow .node .ic { font-size: 28px; }
.flow .node b { display: block; margin: 6px 0 4px; }
.flow .node span { font-size: 13px; color: var(--sub); }
.flow .arrow { display: grid; place-items: center; color: var(--sub); font-size: 13px; text-align: center; }
.flow .arrow::before { content: "→"; font-size: 26px; color: var(--navy); display: block; }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr; } .flow .arrow::before { content: "↓"; } }
.note-pc { margin-top: 14px; background: var(--green-bg); color: #0d5c27; border-radius: 8px; padding: 10px 14px; font-size: 14px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.tbl th { background: #f1f4f8; font-weight: 700; white-space: nowrap; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* test results */
.test-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.test-summary .score { font-size: 34px; font-weight: 800; color: var(--green); }
.test-group { margin-top: 16px; }
.test-group h4 { margin: 0 0 6px; font-size: 14px; color: var(--navy); }
.test-item { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.test-item .ok { color: var(--green); font-weight: 700; }
.test-item .ng { color: var(--red); font-weight: 700; }
.test-item small { display: block; color: var(--sub); }

/* price */
.price { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .price { grid-template-columns: 1fr; } }
.price .card .amount { font-size: 30px; font-weight: 800; color: var(--navy); }
.price .card .amount small { font-size: 14px; color: var(--sub); font-weight: 500; }

.limits li { margin-bottom: 10px; }
.limits li b { color: var(--ink); }
.callout { background: var(--amber-bg); border-left: 4px solid #f9ab00; padding: 14px 16px; border-radius: 6px; font-size: 14px; }
.callout.info { background: #e8f0fe; border-left-color: var(--blue); }

footer { background: #16263c; color: #b9c6d8; padding: 30px 0; font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer a { color: #fff; }

/* ============ simulator ============ */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .sim { grid-template-columns: 1fr; } }
.gs { background: #fff; border: 1px solid #c9cdd4; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 24px rgba(20, 40, 70, .08); font-family: Arial, "Noto Sans JP", sans-serif; }
.gs-title { display: flex; align-items: center; gap: 10px; padding: 10px 14px 2px; }
.gs-title .doc-ic { width: 26px; height: 32px; background: var(--green); border-radius: 3px; position: relative; flex: none; }
.gs-title .doc-ic::after { content: ""; position: absolute; inset: 9px 6px; border: 2px solid #fff; border-radius: 1px; background: linear-gradient(#fff,#fff) center/2px 100% no-repeat, linear-gradient(#fff,#fff) center/100% 2px no-repeat; }
.gs-title .name { font-size: 17px; color: #202124; }
.gs-title .saved { font-size: 12px; color: #5f6368; margin-left: auto; white-space: nowrap; }
.gs-menubar { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 10px 6px 46px; font-size: 13.5px; color: #202124; position: relative; }
.gs-menubar > span { padding: 3px 7px; border-radius: 4px; cursor: default; }
.gs-menubar .custom { cursor: pointer; font-weight: 700; color: var(--navy); background: #e8f0fe; position: relative; }
.gs-menubar .custom.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(26,115,232,.5); } 50% { box-shadow: 0 0 0 6px rgba(26,115,232,0); } }
@media (max-width: 700px) { .gs-menubar > span.std { display: none; } .gs-menubar { padding-left: 10px; } }
.gs-dropdown { position: absolute; top: 100%; z-index: 30; background: #fff; border: 1px solid #dadce0; box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 6px; padding: 6px 0; min-width: 270px; display: none; font-weight: 400; color: #202124; }
.gs-dropdown.open { display: block; }
.gs-dropdown button { display: flex; width: 100%; text-align: left; background: none; border: 0; padding: 7px 18px; font: inherit; font-size: 14px; cursor: pointer; gap: 8px; align-items: center; }
.gs-dropdown button:hover { background: #f1f3f4; }
.gs-dropdown button .done { margin-left: auto; color: var(--green); font-size: 12px; }
.gs-dropdown hr { border: 0; border-top: 1px solid #e8eaed; margin: 5px 0; }
.gs-formula { display: flex; align-items: center; border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; font-size: 13px; height: 28px; color: #5f6368; }
.gs-formula .ref { width: 70px; text-align: center; border-right: 1px solid #e0e0e0; height: 100%; display: grid; place-items: center; }
.gs-formula .fx { padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-grid-wrap { overflow: auto; height: 470px; position: relative; background: #fff; }
.gs-grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; table-layout: fixed; }
.gs-grid th, .gs-grid td { border-right: 1px solid var(--sheet-grid); border-bottom: 1px solid var(--sheet-grid); height: 24px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-grid thead th { background: var(--sheet-head); color: #5f6368; font-weight: 400; position: sticky; top: 0; z-index: 3; text-align: center; }
.gs-grid tbody th { background: var(--sheet-head); color: #5f6368; font-weight: 400; width: 40px; text-align: center; position: sticky; left: 0; z-index: 2; }
.gs-grid thead th.corner { left: 0; z-index: 4; width: 40px; }
.gs-grid td.hdr { background: var(--navy); color: #fff; font-weight: 700; }
.gs-grid tr.frozen td { position: sticky; top: 25px; z-index: 1; }
.gs-grid td.bold { font-weight: 700; }
.gs-grid td.big { font-size: 15px; font-weight: 700; }
.gs-grid td.inputcell { background: #fff8dc; padding: 0; }
.gs-grid td.inputcell input[type=text] { width: 100%; height: 23px; border: 0; background: transparent; padding: 0 6px; font: inherit; color: #202124; }
.gs-grid td.inputcell input[type=text]:focus { outline: 2px solid var(--blue); background: #fff; }
.gs-grid td.cb { text-align: center; }
.gs-grid td.num { text-align: right; }
.gs-grid td.link { color: #1155cc; text-decoration: underline; cursor: pointer; }
.gs-grid td.k-new { color: var(--green); font-weight: 700; }
.gs-grid td.k-init { color: #80868b; }
.gs-grid td.lv-ERROR { color: var(--red); font-weight: 700; }
.gs-grid td.lv-WARN { color: var(--amber); font-weight: 700; }
.gs-grid td.st-err { color: var(--red); }
.gs-grid tr.flash td { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { background: #fff3b0; } 100% { background: transparent; } }
.gs-grid td.note { color: #80868b; font-size: 11.5px; }
.gs-tabs { display: flex; align-items: center; gap: 2px; background: #f1f3f4; border-top: 1px solid #dadce0; padding: 0 8px; height: 38px; overflow-x: auto; }
.gs-tabs button { border: 0; background: transparent; padding: 0 14px; height: 30px; font: inherit; font-size: 13px; color: #444; cursor: pointer; border-radius: 4px 4px 0 0; white-space: nowrap; }
.gs-tabs button.active { background: #fff; color: var(--green); font-weight: 700; box-shadow: inset 0 -3px 0 var(--green); }
.gs-tabs button.hidden-sheet { color: #9aa0a6; font-style: italic; }
.gs-tabs label { margin-left: auto; font-size: 12px; color: #5f6368; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.gs-empty { position: absolute; inset: 40px 0 0 0; display: grid; place-items: center; text-align: center; color: #5f6368; pointer-events: none; font-size: 14px; }
.gs-empty b { color: var(--navy); }
.gs-empty[hidden] { display: none; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 74px; }
@media (max-width: 1000px) { .panel { position: static; } }
.panel h3 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.clock { background: #16263c; color: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.clock small { color: #9fb3cc; display: block; font-size: 11.5px; }
.clock b { font-size: 19px; font-variant-numeric: tabular-nums; }
.clock .auto { font-size: 12px; margin-top: 2px; }
.clock .auto.on { color: #81c995; } .clock .auto.off { color: #f6aea9; }
.steps { list-style: none; margin: 0 0 14px; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 6px 0 6px 30px; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 7px; width: 20px; height: 20px; border-radius: 50%; background: #e8eaed; color: #5f6368; font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.steps li.done::before { content: "✓"; background: var(--green); color: #fff; }
.steps li.current { font-weight: 700; color: var(--navy); }
.steps li.current::before { background: var(--blue); color: #fff; }
.steps li .mini { display: inline-block; margin-left: 4px; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--blue); color: var(--blue); background: #fff; cursor: pointer; font-family: inherit; font-weight: 700; }
.pbtns { display: grid; gap: 8px; }
.pbtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 12px; text-align: left; font: inherit; font-size: 13.5px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.pbtn:hover { border-color: var(--navy-2); background: #f5f8fc; }
.pbtn.main { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.pbtn.main:hover { background: var(--navy-2); }
.pbtn small { color: inherit; opacity: .75; margin-left: auto; font-size: 11.5px; }
.pbtn:disabled { opacity: .45; cursor: not-allowed; }
.panel .sub { font-size: 12px; color: var(--sub); margin: 14px 0 6px; font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.stats div { background: var(--bg); border-radius: 6px; padding: 7px 9px; font-size: 11.5px; color: var(--sub); }
.stats b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats .good b { color: var(--green); }
.sim-note { font-size: 12.5px; color: var(--sub); margin-top: 12px; }

/* dialog & toast */
.dlg-back { position: fixed; inset: 0; background: rgba(32,33,36,.45); display: none; place-items: center; z-index: 100; padding: 16px; }
.dlg-back.open { display: grid; }
.dlg { background: #fff; border-radius: 8px; width: min(480px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.3); padding: 22px 24px 16px; font-family: Arial, "Noto Sans JP", sans-serif; }
.dlg h4 { margin: 0 0 12px; font-size: 16px; font-weight: 400; color: #202124; }
.dlg .msg { white-space: pre-wrap; font-size: 14px; color: #3c4043; max-height: 55vh; overflow: auto; }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg .acts button { border: 0; border-radius: 4px; padding: 8px 18px; font: inherit; font-size: 14px; cursor: pointer; }
.dlg .acts .ok { background: var(--blue); color: #fff; }
.dlg .acts .cancel { background: transparent; color: var(--blue); }
.dlg label { display: block; font-size: 13px; color: #5f6368; margin-top: 10px; }
.dlg input { width: 100%; border: 1px solid #dadce0; border-radius: 4px; padding: 8px 10px; font: inherit; font-size: 14px; margin-top: 4px; }
.dlg .hint { font-size: 12px; color: var(--sub); margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #202124; color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 14px; opacity: 0; transition: .25s; z-index: 120; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* manual */
.manual h2 { border-left: 5px solid var(--navy); padding-left: 12px; margin-top: 54px; }
.manual h3 { margin-top: 28px; color: var(--navy); }
.manual ol li, .manual ul li { margin-bottom: 6px; }
.manual .toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.manual .toc ol { margin: 0; padding-left: 20px; columns: 2; }
@media (max-width: 700px) { .manual .toc ol { columns: 1; } }
.manual code, .manual kbd { background: #eef1f5; border-radius: 4px; padding: 1px 6px; font-size: 13px; }
.menu-chip { display: inline-block; background: #e8f0fe; color: var(--navy); font-weight: 700; border-radius: 4px; padding: 0 7px; font-size: 13.5px; }
.shot { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13px; font-family: Arial, "Noto Sans JP", sans-serif; }
.shot .bar { color: var(--sub); font-size: 12px; margin-bottom: 6px; }
@media print { .top, footer { display: none; } section.block { padding: 24px 0; } }

@media (max-width: 600px) { .hero h1 br { display: none; } }
