:root {
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
  color: #172f35;
  background: #f5f7f8;
  font-size: 1rem;
  --accent: #09695b;
  --muted: #52686d;
  --border: #d6e1e3;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 4px; }
header, footer, main { max-width: 1120px; margin: auto; }
header, footer { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header { border-bottom: 1px solid var(--border); }
.brand { color: #172f35; text-decoration: none; font-size: 1.25rem; font-weight: 800; }
header > span { color: var(--muted); font-size: 0.8125rem; }
main { padding: 28px 24px 48px; }
.eyebrow { color: var(--accent); font-size: 0.75rem; font-weight: 750; letter-spacing: .1em; margin: 0 0 8px; }
h1 { font-size: clamp(1.625rem, 4vw, 2.25rem); line-height: 1.45; letter-spacing: .01em; margin: 0 0 8px; }
h2 { font-size: 1.25rem; line-height: 1.5; margin: 0 0 8px; }
h3 { font-size: 1.0625rem; line-height: 1.6; }
p { line-height: 1.85; }
.intro > p:last-of-type { color: var(--muted); margin: 0; }
.page-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 8px 0 24px; }
.page-links a { font-size: 0.875rem; padding: 6px 0; }
.workspace { display: grid; grid-template-columns: .95fr 1.05fr; gap: 24px; align-items: start; }
.panel { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 24px; min-width: 0; }
.muted { font-size: 0.875rem; color: var(--muted); line-height: 1.8; margin: 8px 0 16px; }
fieldset { border: 0; padding: 0; margin: 24px 0; min-width: 0; }
legend { font-weight: 750; margin-bottom: 14px; padding: 0; }
legend b { font-size: 0.8125rem; color: var(--accent); margin-right: 10px; }
legend small { font-size: 0.875rem; font-weight: 400; color: var(--muted); margin-left: 8px; }
.dimensions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
label { font-size: 0.875rem; font-weight: 650; }
label > span { display: flex; align-items: center; background: #f7f9fa; border: 1px solid #aabfc4; border-radius: 8px; margin-top: 7px; padding-right: 8px; color: var(--muted); font-size: 0.8125rem; font-weight: 400; }
input[type=number] { width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.3125rem; font-weight: 600; color: #172f35; padding: 13px 4px 13px 10px; appearance: textfield; }
input::-webkit-inner-spin-button { appearance: none; }
input[type=number]:focus { outline: none; }
label > span:focus-within { outline: 3px solid #72bdb1; outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { flex-shrink: 0; width: 20px; height: 20px; accent-color: var(--accent); }
button { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; background: var(--accent); border: 0; border-radius: 8px; color: white; font: inherit; font-weight: 700; padding: 17px; cursor: pointer; }
button:hover { background: #07574c; }
:focus-visible { outline: 3px solid #cc7d14; outline-offset: 4px; }
.privacy { text-align: center; color: var(--muted); font-size: 0.75rem; margin: 16px 0 0; }
#error { font-size: 0.875rem; color: #a13524; }
#error:empty { display: none; }
.result-heading { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.result-heading h2 { margin: 0; scroll-margin-top: 20px; }
.badge { background: #e5f4ef; color: #075b4d; border-radius: 30px; padding: 6px 10px; font-size: 0.75rem; font-weight: 700; }
.badge:empty { display: none; }
.badge[data-status="ギリギリ"] { background: #fff0ce; color: #795408; }
.badge[data-status="入らない"] { background: #ffe9e5; color: #982f21; }
.recommended { background: #f0f8f6; border: 1px solid #c6dfd9; border-radius: 10px; padding: 20px; }
.card-label { font-size: 0.875rem; margin: 0; }
.total { font-size: 4rem; font-weight: 800; line-height: 1.15; letter-spacing: -.04em; margin: 8px 0; color: var(--accent); overflow-wrap: anywhere; }
.total span { font-size: 1.125rem; letter-spacing: 0; margin-left: 8px; }
.reserve-note { font-size: 0.8125rem; color: var(--muted); margin: 0 0 16px; }
.arrangement { font-weight: 750; font-size: 1rem; margin: 0; }
.arrangement > span { color: #677d82; padding: 0 2px; }
.placement { margin: 12px 0 20px; }
svg { width: 100%; display: block; max-height: 260px; }
svg text { font: 13px system-ui; fill: #405b62; }
figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
figcaption > span:last-child { margin-left: 6px; }
.legend-swatch { width: 10px; height: 10px; background: #cce8e3; border: 1px solid #227b70; }
.legend-swatch.gap { background: #edf1f2; border-color: #859ca2; margin-left: 6px; }
.orientation { font-size: 0.875rem; color: var(--muted); line-height: 1.8; margin: 0 0 14px; }
.orientation strong { color: #25464d; font-weight: 600; }
dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #c6dfd9; padding-top: 14px; gap: 8px; margin: 0; }
dt { font-size: 0.875rem; color: var(--muted); }
dd { margin: 4px 0 0; font-size: 1.375rem; font-weight: 750; overflow-wrap: anywhere; }
dd small { font-size: 0.75rem; font-weight: 400; }
.remainder-note { font-size: 0.75rem; margin: 12px 0 0; }
.theoretical { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; }
.theoretical summary { padding: 16px; font-size: 0.875rem; }
.theoretical strong { font-size: 1.25rem; margin-left: 8px; }
.detail-label { color: var(--accent); font-size: 0.75rem; margin-left: 8px; }
.theory-content { padding: 0 16px 16px; }
.result-caution { color: var(--muted); font-size: 0.8125rem; margin: 16px 0 0; }
.result-caution a { display: inline-block; }
.empty, .zero-note { font-size: 0.875rem; color: var(--muted); }
.zero-note { background: #fff3d9; color: #725419; padding: 12px; border-radius: 6px; }
.pending-result { border: 1px dashed #bacdd1; padding: 36px 20px; border-radius: 10px; text-align: center; color: var(--muted); }
.pending-result p { font-weight: 650; margin: 0 0 8px; }
.pending-result span { font-size: 0.875rem; }
.purchase-note { border-left: 3px solid #c78b31; background: #fff9ed; font-size: 0.875rem; padding: 16px 20px; margin: 24px 0 0; color: #644f2d; }
.guide, .faq { margin-top: 48px; scroll-margin-top: 24px; }
.section-heading > p:last-child { color: var(--muted); margin: 8px 0 20px; }
.measure-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: 0; gap: 16px; margin: 24px 0; }
.measure-steps li { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 22px; }
.step-number { color: var(--accent); font-size: 0.875rem; font-weight: 750; }
.measure-steps h3 { margin: 8px 0; }
.measure-steps p, .example p { color: var(--muted); margin: 0; }
.example { padding: 22px; border: 1px solid var(--border); border-radius: 10px; }
.example h3 { margin: 0 0 8px; }
.example .muted { margin-top: 8px; }
.faq { max-width: 800px; }
.faq details { border-bottom: 1px solid var(--border); }
summary { cursor: pointer; font-weight: 650; line-height: 1.8; padding: 20px 0; }
summary::marker { color: var(--accent); }
.faq details p { color: var(--muted); margin: 0 0 20px; }
footer { border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--muted); }
footer small { font-size: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 10; background: white; padding: 12px; }
.skip-link:focus { top: 12px; }
@media (max-width: 720px) {
  header, footer { padding: 16px; }
  .brand { font-size: 1.125rem; }
  main { padding: 20px 16px 36px; }
  .workspace { grid-template-columns: 1fr; gap: 20px; }
  .panel { padding: 18px; }
  .intro > p:last-of-type { font-size: 0.875rem; }
  .page-links { margin-bottom: 16px; }
  .dimensions { gap: 8px; }
  .recommended { padding: 16px; }
  .measure-steps { grid-template-columns: 1fr; gap: 12px; }
  .measure-steps li { padding: 20px; }
  .guide, .faq { margin-top: 36px; }
  footer { align-items: start; flex-direction: column; gap: 8px; }
}
@media (max-width: 360px) {
  .panel { padding: 14px; }
  input[type=number] { font-size: 1.125rem; padding-left: 6px; }
  .recommended { padding: 12px; }
  .total { font-size: 3.375rem; }
}
/* 購入前の条件選択と奥行確認 */
.orientation-options { margin-bottom: 16px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; cursor: pointer; }
.choice input { flex: 0 0 auto; width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--accent); }
.choice > span { display: block; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.choice strong { display: block; color: #25464d; font-size: .875rem; line-height: 1.6; }
.choice small { display: block; font-size: .75rem; margin-top: 3px; line-height: 1.65; }
.choice:has(input:checked) strong { color: var(--accent); }
.margin-options { margin: 0 0 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.margin-options summary { padding: 14px 0; font-size: .875rem; }
.margin-options summary span { font-size: .75rem; color: var(--muted); font-weight: 400; margin-left: 8px; }
.margin-input { display: flex; align-items: center; max-width: 160px; background: #f7f9fa; border: 1px solid #aabfc4; border-radius: 6px; padding-right: 12px; margin: 10px 0; }
.margin-input:focus-within { outline: 3px solid #72bdb1; }
.top-view { border-top: 1px solid #c6dfd9; margin: 0 0 16px; }
.top-view summary { padding: 12px 0; font-size: .875rem; color: var(--accent); }
.empty { background: #fff5e3; color: #644f2d; padding: 14px; border-radius: 6px; }
.empty p { font-size: .8125rem; margin: 8px 0 0; }
.secondary-button { background: white; border: 1px solid #aabfc4; color: var(--accent); justify-content: center; margin-top: 18px; font-size: .875rem; padding: 13px; }
.secondary-button:hover { background: #f0f8f6; }
.use-cases { margin-top: 40px; }
.use-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.use-grid h3 { margin: 12px 0 8px; }
.use-grid p { color: var(--muted); margin: 0; }
@media(max-width:720px) { .use-grid { grid-template-columns: 1fr; gap: 12px; } }
#copy-status:empty { display: none; }
#copy-text { width: 100%; margin-top: 8px; padding: 12px; border: 1px solid #aabfc4; border-radius: 8px; font: inherit; font-size: 1rem; line-height: 1.65; resize: vertical; }
#copy-result:disabled { opacity: .65; cursor: wait; }
/* 運営者ページの長い連絡先もスマホ幅に収める */
a[href^="mailto:"] { overflow-wrap: anywhere; }
footer nav { font-size: .875rem; }
