:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #66757b;
  --line: #d9e1df;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --teal: #087f78;
  --teal-dark: #075d59;
  --teal-soft: #e4f2ef;
  --amber-soft: #fff4d8;
  --amber-ink: #8a5b00;
  --danger-soft: #fff0ed;
  --danger-ink: #a03d2d;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
  font-weight: 400;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--teal-dark); text-underline-offset: 3px; }
button, input, select { font: inherit; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--teal); color: white; font-size: 17px; }
.header-note { color: var(--muted); font-size: 13px; }
.intro { padding: 64px 0 34px; max-width: 720px; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.18; letter-spacing: .01em; }
h2 { margin: 0; font-size: 21px; line-height: 1.3; }
.intro-copy { margin: 0; color: var(--muted); font-size: 16px; }
.search-panel, .result-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.search-panel { padding: 28px; box-shadow: 0 8px 24px rgba(28, 57, 57, .05); }
.section-heading, .results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr .8fr; gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field span { color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { width: 100%; height: 44px; border: 1px solid #cbd6d3; border-radius: 5px; background: #fff; color: var(--ink); padding: 0 12px; outline: none; }
input::placeholder { color: #9aa7a5; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 120, .13); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; }
.form-hint { margin: 0; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { min-width: 128px; background: var(--teal); color: white; }
.button-primary:hover { background: var(--teal-dark); }
.button-arrow { font-size: 18px; line-height: 1; }
.button-quiet { background: transparent; border-color: var(--line); color: var(--muted); padding: 0 14px; min-height: 36px; }
.button-quiet:hover { color: var(--ink); border-color: #b7c5c1; background: #f7faf9; }
.results-section { padding: 56px 0 80px; }
.result-count { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.status { margin-top: 18px; padding: 16px 18px; border-radius: 6px; font-size: 14px; }
.status-idle { background: #edf3f1; color: #506560; }
.status-loading { background: var(--teal-soft); color: var(--teal-dark); }
.status-error { background: var(--danger-soft); color: var(--danger-ink); }
.status-empty { background: var(--amber-soft); color: var(--amber-ink); }
.results-list { display: grid; gap: 16px; margin-top: 16px; }
.result-card { overflow: hidden; }
.result-card-head { display: flex; justify-content: space-between; gap: 18px; padding: 21px 22px 16px; border-bottom: 1px solid var(--line); }
.facility-name { margin: 0 0 3px; font-size: 20px; line-height: 1.35; }
.operator-name { margin: 0; color: var(--muted); font-size: 14px; }
.record-meta { flex: 0 0 auto; text-align: right; color: var(--muted); font-size: 13px; }
.record-meta strong { display: block; color: var(--ink); font-size: 15px; }
.record-body { padding: 18px 22px 20px; }
.detail-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.detail-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.detail-value { display: block; overflow-wrap: anywhere; font-size: 14px; }
.missing { display: inline-block; padding: 2px 7px; border-radius: 4px; background: var(--amber-soft); color: var(--amber-ink); font-size: 12px; font-weight: 700; }
.quantity-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.quantity-table th, .quantity-table td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: right; }
.quantity-table th:first-child, .quantity-table td:first-child { text-align: left; }
.quantity-table th { color: var(--muted); font-size: 12px; font-weight: 700; }
.source-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.source-row a { overflow-wrap: anywhere; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; padding: 22px 0; color: var(--muted); font-size: 12px; }
.footer-inner p { margin: 0; }

@media (max-width: 820px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: span 2; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 58px; }
  .header-note { display: none; }
  .intro { padding: 42px 0 26px; }
  h1 { font-size: 32px; }
  .search-panel { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .field-wide { grid-column: auto; }
  .form-actions, .footer-inner { align-items: stretch; flex-direction: column; }
  .form-hint { order: 2; }
  .button-primary { width: 100%; }
  .results-section { padding-top: 42px; }
  .result-card-head { flex-direction: column; gap: 9px; padding: 18px 16px 14px; }
  .record-meta { text-align: left; }
  .record-meta strong { display: inline; margin-right: 8px; }
  .record-body { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; gap: 12px; }
  .quantity-table { display: block; overflow-x: auto; white-space: nowrap; }
  .source-row { align-items: flex-start; flex-direction: column; gap: 7px; }
}
