:root{
  --lab-bg:#f5f7fa;
  --lab-surface:#ffffff;
  --lab-surface-2:#eef2f6;
  --lab-line:#c7d0dc;
  --lab-line-strong:#9eabb9;
  --lab-text:#111827;
  --lab-muted:#475569;
  --lab-accent:#0b6259;
  --lab-accent-strong:#084b45;
  --lab-accent-soft:#e5f4f1;
  --lab-warm:#8a5a00;
  --lab-danger:#a61b29;
  --lab-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP","Yu Gothic UI",Meiryo,sans-serif;
}
*{box-sizing:border-box}
html{color-scheme:light}
body{font-family:var(--lab-font)}

/* Global site header */
.lab-topbar{
  position:relative!important;
  z-index:1000;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
  background:#ffffff!important;
  color:#172033!important;
  border-top:4px solid #138579!important;
  border-bottom:1px solid #cbd5e1!important;
  box-shadow:0 2px 8px rgba(15,23,42,.08)!important;
}
.lab-topbar::before,.lab-topbar::after{content:none!important;display:none!important}
.lab-nav-wrap{max-width:1800px;margin:0 auto;padding:11px 22px;display:flex;align-items:center;justify-content:space-between;gap:22px}
.lab-brand{display:flex;flex-direction:column;gap:1px;color:#0f172a!important;text-decoration:none;white-space:nowrap}
.lab-brand-main{font-size:15px;font-weight:800;letter-spacing:.01em;color:#0f172a!important}
.lab-brand-sub{font-size:9px;color:#176b63!important;font-weight:800;letter-spacing:.13em}
.lab-nav{display:flex;align-items:center;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.lab-nav a{color:#263548!important;text-decoration:none;font-size:12px;font-weight:650;border:1px solid transparent;border-radius:7px;padding:7px 10px;line-height:1.4;background:transparent!important}
.lab-nav a:hover{color:#064e46!important;border-color:#8fc7bf!important;background:#edf8f6!important}
.lab-nav a[aria-current="page"]{color:#064e46!important;border-color:#82bdb5!important;background:#dff3ef!important;font-weight:800}
.lab-brand:focus-visible,.lab-nav a:focus-visible{outline:3px solid #0b6259!important;outline-offset:2px}
.lab-site-footer{max-width:1800px;margin:28px auto 0;padding:22px;color:#526174;font-size:11px;border-top:1px solid var(--lab-line);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;line-height:1.7}
.lab-site-footer strong{color:#263548}

/* Home */
body.page-home{margin:0;background:#f5f7fa!important;color:var(--lab-text)!important;min-height:100vh}
body.page-home .home{max-width:1180px;margin:0 auto;padding:56px 22px 70px}
body.page-home .hero{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr);gap:38px;align-items:end;padding:28px 0 44px;border-bottom:1px solid var(--lab-line)}
body.page-home .eyebrow{color:var(--lab-accent-strong)!important}
body.page-home .hero h1{color:#0f172a}
body.page-home .lead{color:#334155!important}
body.page-home .hero-side{border:1px solid var(--lab-line)!important;border-radius:14px;background:#fff!important;padding:17px 18px;box-shadow:0 8px 24px #0f172a0a}
body.page-home .hero-side dt{color:#536276!important}
body.page-home .hero-side dd{color:#172033}
body.page-home .section-head h2{color:#172033}
body.page-home .section-head p{color:#536276!important}
body.page-home .card{background:#fff!important;border:1px solid #bcc7d4!important;box-shadow:0 5px 18px #0f172a08}
body.page-home .card:hover{transform:translateY(-2px);border-color:#0b6259!important;background:#f9fcfb!important;box-shadow:0 10px 26px #0f172a12}
body.page-home .type{border:1px solid #7ca69f!important;background:#e8f5f2!important;color:#084b45!important}
body.page-home .arrow{color:#526174!important}
body.page-home .card h3{color:#111827}
body.page-home .card p{color:#3d4b5e!important}
body.page-home .notice{border:1px solid #bcc7d4!important;background:#fff!important;box-shadow:0 5px 18px #0f172a08}
body.page-home .notice h2{color:#111827}
body.page-home .notice p,body.page-home .notice li{color:#3d4b5e!important}
body.page-home .notice strong{color:#172033!important}
body.page-home .copyright-box{border-color:#d2d9e2!important}

/* D=0 calculator */
body.page-d0{
  --bg:#f5f7fa;--paper:#fff;--ink:#111827;--muted:#475569;--line:#c7d0dc;--accent:#0b6259;--soft:#e8f5f2;--result:#172033;--light:#d9e2ec;--danger:#a61b29;
  background:var(--bg)!important;color:var(--ink)!important;
}
body.page-d0 .card{box-shadow:0 8px 28px #0f172a0b!important}
body.page-d0 input,body.page-d0 select{background:#fff!important;color:#111827!important;border-color:#aebac8!important}
body.page-d0 input::placeholder{color:#69778a!important}
body.page-d0 .target-options,body.page-d0 .formula{background:#eef2f6!important}
body.page-d0 thead th{background:#e7edf3!important;color:#243247!important}
body.page-d0 .reset{color:#334155!important;border-color:#aebac8!important}
body.page-d0 .reset:hover{background:#eef2f6!important;color:#111827!important}
body.page-d0 .result-panel{background:#172033!important;color:#fff!important;box-shadow:inset 0 0 0 1px #34445c}
body.page-d0 .result-caption,body.page-d0 .result-unit,body.page-d0 .result-copy,body.page-d0 .metric dt{color:#d9e2ec!important}
body.page-d0 .result-badge{background:#0e544d!important;border-color:#6eb7ad!important;color:#fff!important}
body.page-d0 .boundary,body.page-d0 .metrics{border-color:#4c5d74!important;color:#ecf2f8!important}
body.page-d0 .brief-notes,body.page-d0 .details-inner p,body.page-d0 .page-foot{color:#526174!important}
body.page-d0 a{color:#085f9f}

/* Hit rate */
body.page-hit{
  --bg:#f5f7fa;--panel:#fff;--panel2:#eef2f6;--text:#111827;--muted:#475569;--line:#c7d0dc;--accent:#0b6259;--good:#086c4f;--warn:#8a5a00;--bad:#a61b29;
  background:var(--bg)!important;color:var(--text)!important;
}
body.page-hit p,body.page-hit .note{color:#475569!important}
body.page-hit .card{background:#fff!important;border-color:#c0cad6!important;box-shadow:0 6px 20px #0f172a08}
body.page-hit input,body.page-hit select{background:#fff!important;color:#111827!important;border-color:#aebac8!important}
body.page-hit button{background:#eef2f6!important;color:#172033!important;border-color:#aebac8!important}
body.page-hit button.primary{background:#0b6259!important;color:#fff!important;border-color:#0b6259!important}
body.page-hit .metric,body.page-hit .answer{background:#f3f6f9!important;border-color:#c7d0dc!important}
body.page-hit .formula{background:#172033!important;border-color:#33445d!important;color:#f7fafc!important}
body.page-hit th{color:#334155!important}
body.page-hit th,body.page-hit td{border-color:#d4dbe4!important}
body.page-hit .tag{color:#475569!important;border-color:#aebac8!important}
body.page-hit .answer strong{color:#086c4f!important}

/* Monster database */
body.page-monsters{
  --bg:#f5f7fa;--panel:#fff;--line:#c7d0dc;--head:#243247;--head2:#34465e;--text:#111827;--muted:#475569;--accent:#0b6259;--warn:#8a5a00;
  background:var(--bg)!important;color:var(--text)!important;
}
body.page-monsters .toolbar,body.page-monsters .table-wrap,body.page-monsters .help{background:#fff!important}
body.page-monsters .toolbar input,body.page-monsters .col-filter{background:#fff!important;color:#111827!important;border-color:#9daaba!important}
body.page-monsters .toolbar input::placeholder,body.page-monsters .col-filter::placeholder{color:#657386!important;opacity:1}
body.page-monsters button{background:#f3f6f9!important;color:#172033!important;border-color:#9daaba!important}
body.page-monsters button:hover{background:#e8edf3!important}
body.page-monsters thead th{background:#243247!important;color:#fff!important;border-color:#52617a!important}
body.page-monsters thead tr.filters th{background:#34465e!important}
body.page-monsters tbody td{background:#fff!important;color:#111827!important;border-color:#dde3ea!important}
body.page-monsters tbody tr:nth-child(even) td{background:#f4f7fa!important}
body.page-monsters tbody tr:hover td{background:#e6f4f1!important}
body.page-monsters .note,body.page-monsters .help{color:#475569!important}

/* Quest guide */
body.page-quest{
  --bg:#f5f7fa;--bg2:#eef2f6;--card:#fff;--card2:#f3f6f9;--line:#c7d0dc;--text:#111827;--muted:#475569;--gold:#0b6259;--blue:#0b6697;--green:#086c4f;--orange:#8a5a00;--red:#a61b29;--code:#eef2f6;
  background:#f5f7fa!important;color:#111827!important;
}
body.page-quest .quest-hero{background:#fff!important;border-bottom:1px solid #c7d0dc!important}
body.page-quest .quest-hero:after{color:#0b62590b!important;pointer-events:none!important}
body.page-quest .quest-hero p{color:#334155!important}
body.page-quest .eyebrow{color:#0b6259!important}
body.page-quest .toolbar{background:#fff!important;border-bottom:1px solid #c7d0dc!important;backdrop-filter:none!important}
body.page-quest .toolbar input{background:#fff!important;border-color:#9daaba!important;color:#111827!important}
body.page-quest .toolbar input::placeholder{color:#657386!important;opacity:1}
body.page-quest .toolbar a{color:#334155!important;border-color:#aebac8!important;background:#f8fafc!important}
body.page-quest .toolbar a:hover{border-color:#0b6259!important;color:#084b45!important;background:#e8f5f2!important}
body.page-quest .box,body.page-quest .stage{background:#fff!important;border-color:#c7d0dc!important;box-shadow:0 6px 20px #0f172a08!important}
body.page-quest .level-card{background:#fff!important;border-color:#bcc7d4!important;color:#111827!important}
body.page-quest .level-card:hover{border-color:#0b6259!important;background:#f9fcfb!important}
body.page-quest .level-card small,body.page-quest .level-card em,body.page-quest .lead,body.page-quest .location-note,body.page-quest .stage-head p{color:#475569!important}
body.page-quest .level-title{border-color:#9eabb9!important}
body.page-quest .level-title p{color:#475569!important}
body.page-quest .meta div{color:#334155!important;background:#eef2f6!important;border-color:#c7d0dc!important}
body.page-quest .meta b{color:#526174!important}
body.page-quest .route a{background:#fff!important;border-color:#aebac8!important;color:#334155!important}
body.page-quest .route a:hover{border-color:#0b6259!important;color:#084b45!important;background:#e8f5f2!important}
body.page-quest .level-notes{background:#edf6fb!important;border-left-color:#0b6697!important;color:#334155!important}
body.page-quest .level-notes strong{color:#064f78!important}
body.page-quest .level-notes ul{color:#334155!important}
body.page-quest .panel{background:#f8fafc!important;border-color:#d0d8e2!important;color:#111827!important}
body.page-quest .panel.primary{background:#edf6fb!important;border-color:#9fc9dc!important}
body.page-quest .panel h4{color:#4a596c!important}
body.page-quest .en-task{color:#475569!important}
body.page-quest .item-chip{background:#fff!important;border-color:#c7d0dc!important}
body.page-quest .item-chip span{color:#526174!important}
body.page-quest .item-chip .qty{color:#084b45!important}
body.page-quest code{background:#eef2f6!important;border-color:#c7d0dc!important;color:#0b5179!important}
body.page-quest .tip{color:#475569!important;border-color:#c7d0dc!important}
body.page-quest .tip b{color:#0b5179!important}
body.page-quest .supplement{background:#fff8e7!important;border-color:#d7bd7b!important}
body.page-quest .supplement h3{color:#704700!important}
body.page-quest .supplement p{color:#5d4b28!important}
body.page-quest th{background:#f3ead3!important;color:#4d3b16!important}
body.page-quest th,body.page-quest td{border-color:#d9cba9!important}
body.page-quest footer{color:#526174!important;border-color:#c7d0dc!important}

@media(max-width:820px){
  .lab-nav-wrap{align-items:flex-start;flex-direction:column;gap:8px;padding:10px 14px}
  .lab-nav{justify-content:flex-start;gap:2px}
  .lab-nav a{padding:5px 7px;font-size:11px}
  .lab-site-footer{padding:18px 14px}
  body.page-home .home{padding:30px 14px 50px}
  body.page-home .hero{grid-template-columns:1fr;gap:22px;padding-top:12px}
}
