.jga-calc {
  --jga-navy: #0c1624;
  --jga-orange: #ea580c;
  --jga-slate-900: #0f172a;
  --jga-slate-700: #334155;
  --jga-slate-600: #475569;
  --jga-slate-500: #64748b;
  --jga-slate-300: #cbd5e1;
  --jga-slate-200: #e2e8f0;
  --jga-slate-100: #f1f5f9;
  --jga-slate-50: #f8fafc;
  --jga-danger: #b91c1c;
  --jga-warning: #b45309;
  color: var(--jga-slate-900);
  background: #eef1f5;
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

.jga-calc *,
.jga-calc *::before,
.jga-calc *::after {
  box-sizing: border-box;
}

.jga-calc :where(h1, h2, h3, p, fieldset, legend, label, input, select, button, a) {
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.jga-calc :where(button, input, select) {
  box-shadow: none;
}

.jga-calc :where(button) {
  text-transform: none;
}

.jga-calc__hero,
.jga-map__hero {
  min-height: 220px;
  color: #fff;
  /* 写真は CSS で直接指定（SVG 背景内の外部画像はブラウザが読み込まないため） */
  background:
    linear-gradient(
      90deg,
      #0c1624 0%,
      #0c1624 42%,
      #0c1624 52%,
      #0c1624 56%,
      rgba(12, 22, 36, 0.851) 66%,
      rgba(12, 22, 36, 0.639) 76%,
      rgba(12, 22, 36, 0.439) 86%,
      rgba(12, 22, 36, 0.29) 94%,
      rgba(12, 22, 36, 0.2) 100%
    ),
    url("../img/jis-mv-hero-photo.jpg") center / cover no-repeat,
    var(--jga-navy);
}

.jga-calc__hero-inner,
.jga-map__hero-inner {
  width: min(100%, 1254px);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
  padding: 24px 40px;
}

.jga-calc__hero h1,
.jga-map__hero h1,
.jga-map__hero h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 700;
}

.jga-calc__hero p,
.jga-map__hero p {
  width: min(100%, 820px);
  margin: 0;
  color: var(--jga-slate-200);
  font-size: 12px;
  line-height: 1.45;
}

.jga-calc__body,
.jga-map__body {
  display: flex;
  justify-content: center;
  padding: 28px 44px;
}

.jga-calc--map-page {
  background: #f3f0df;
}

.jga-map {
  background: #f3f0df;
}

.jga-map__body {
  background: #fff;
  padding: 24px 32px;
}

.jga-calc__card,
.jga-map__card {
  width: min(100%, 920px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
  border-radius: 12px;
  background: #fff;
}

.jga-calc__card {
  border: 1px solid #dce3ec;
}

.jga-calc__section-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.jga-calc__section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jga-calc__section-head h2 {
  margin: 0;
  color: var(--jga-slate-900);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.jga-calc__section-head p {
  margin: 0;
  color: var(--jga-slate-500);
  font-size: 12px;
  line-height: 1.5;
}

.jga-calc__icon {
  width: 4px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 2px;
  color: transparent;
  background: var(--jga-orange);
  font-size: 0;
}

.jga-calc-form {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.jga-calc-form__section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.jga-calc-form__section + .jga-calc-form__section {
  padding-top: 28px;
}

.jga-calc-form__section h3 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--jga-orange);
  color: var(--jga-slate-900);
  font-size: 14px;
  font-weight: 700;
}

.jga-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jga-field label,
.jga-radio legend {
  margin: 0;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.jga-field__hint,
.jga-reference p,
.jga-map__hint {
  margin: 0;
  color: var(--jga-slate-500);
  font-size: 11px;
  line-height: 1.45;
}

.jga-field input,
.jga-field select {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--jga-slate-300) !important;
  border-radius: 6px !important;
  background-color: #fff !important;
  color: var(--jga-slate-900) !important;
  font: inherit !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
}

.jga-field select {
  padding-right: 36px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--jga-slate-500) 50%),
    linear-gradient(135deg, var(--jga-slate-500) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 16px,
    calc(100% - 12px) 16px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.jga-field--short input {
  width: min(100%, 200px);
}

.jga-field.is-error input,
.jga-field.is-error select {
  border-color: #dc2626 !important;
  background-color: #fffbfb !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.jga-field.is-error .jga-field__label {
  color: #b91c1c;
  font-weight: 700;
}

.jga-field__warning,
.jga-field__error {
  display: none;
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.jga-field__warning {
  color: var(--jga-warning);
}

.jga-field__error {
  color: var(--jga-danger);
}

.jga-field.has-warning .jga-field__warning,
.jga-field.is-error .jga-field__error {
  display: block;
}

.jga-reference {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.jga-reference strong {
  color: var(--jga-slate-900);
  font-size: 12px;
}

.jga-reference__table {
  display: grid;
  grid-template-columns: 300px 80px repeat(5, 80px);
  width: max-content;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--jga-slate-300);
  border-radius: 8px;
  background: #fff;
  overflow-y: hidden;
}

.jga-reference__table > * {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-right: 1px solid #e5edf6;
  border-bottom: 1px solid #e5edf6;
  color: #1e293b;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.jga-reference__region-head {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.jga-reference__splash-head {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.jga-reference__distance-head {
  grid-column: 3 / span 5;
  grid-row: 1;
}

.jga-reference__dist-coast {
  grid-column: 3;
  grid-row: 2;
}

.jga-reference__dist-01 {
  grid-column: 4;
  grid-row: 2;
}

.jga-reference__dist-025 {
  grid-column: 5;
  grid-row: 2;
}

.jga-reference__dist-05 {
  grid-column: 6;
  grid-row: 2;
}

.jga-reference__dist-10 {
  grid-column: 7;
  grid-row: 2;
}

.jga-reference__region-row--high {
  grid-column: 1;
  grid-row: 3;
}

.jga-reference__region-row--low {
  grid-column: 1;
  grid-row: 4;
}

.jga-reference__splash-value {
  grid-column: 2;
  grid-row: 3 / span 2;
}

.jga-reference__r1c1 {
  grid-column: 3;
  grid-row: 3;
}

.jga-reference__r1c2 {
  grid-column: 4;
  grid-row: 3;
}

.jga-reference__r1c3 {
  grid-column: 5;
  grid-row: 3;
}

.jga-reference__r1c4 {
  grid-column: 6;
  grid-row: 3;
}

.jga-reference__r1c5 {
  grid-column: 7;
  grid-row: 3;
}

.jga-reference__r2c1 {
  grid-column: 3;
  grid-row: 4;
}

.jga-reference__r2c2 {
  grid-column: 4;
  grid-row: 4;
}

.jga-reference__r2c3 {
  grid-column: 5;
  grid-row: 4;
}

.jga-reference__r2c4 {
  grid-column: 6;
  grid-row: 4;
}

.jga-reference__r2c5 {
  grid-column: 7;
  grid-row: 4;
}

.jga-reference__head {
  background: var(--jga-slate-200);
  font-weight: 700;
}

.jga-reference__region-row {
  justify-content: flex-start;
  gap: 12px;
  background: var(--jga-slate-50);
  text-align: left;
}

.jga-reference__region-row > span {
  flex: 0 0 72px;
  font-weight: 600;
}

.jga-reference__region-row > small {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.jga-reference__table button {
  border-width: 0 1px 1px 0 !important;
  border-style: solid !important;
  border-color: #e5edf6 !important;
  border-radius: 0 !important;
  color: #1d4ed8 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 700;
  cursor: pointer;
}

.jga-reference__table > :nth-child(8),
.jga-reference__table > :nth-child(13),
.jga-reference__table > :nth-child(19) {
  border-right: 0 !important;
}

.jga-reference__region-row--low,
.jga-reference__splash-value,
.jga-reference__r2c1,
.jga-reference__r2c2,
.jga-reference__r2c3,
.jga-reference__r2c4,
.jga-reference__r2c5 {
  border-bottom: 0 !important;
}

.jga-reference__table button:hover,
.jga-reference__table button:focus-visible {
  outline: 2px solid var(--jga-orange);
  outline-offset: -2px;
}

.jga-radio {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 0;
  padding: 0;
  border: 0;
}

.jga-radio legend {
  width: 100%;
  margin-bottom: 2px;
}

.jga-radio label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--jga-slate-900);
  font-size: 13px;
  line-height: 1.4;
}

.jga-radio input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--jga-orange);
}

.jga-radio--stack {
  flex-direction: column;
}

.jga-field select:disabled {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  opacity: 0.75;
  cursor: not-allowed;
}

.jga-field.is-disabled > label,
.jga-field.is-disabled .jga-field__hint {
  color: #94a3b8;
}

.jga-radio label:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

.jga-calc-form__actions {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.jga-calc-form__actions button {
  min-width: 160px;
  min-height: 48px;
  padding: 14px 32px;
  border: 0 !important;
  border-radius: 8px !important;
  color: #fff !important;
  background: var(--jga-orange) !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  cursor: pointer;
}

.jga-calc-form__actions button:disabled {
  background: #94a3b8 !important;
  color: #fff !important;
  opacity: 1;
  cursor: not-allowed;
  pointer-events: none;
}

.jga-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--jga-slate-300);
  border-radius: 10px;
  background: var(--jga-slate-50);
}

.jga-result h3,
.jga-result p {
  margin: 0;
}

.jga-result h3 {
  font-size: 13px;
  font-weight: 700;
}

.jga-result__message {
  color: var(--jga-slate-600);
  font-size: 12px;
  line-height: 1.45;
}

.jga-result.is-error {
  border: 2px solid #dc2626 !important;
  background: #fef2f2 !important;
  box-shadow:
    0 0 0 4px rgba(220, 38, 38, 0.12),
    0 8px 24px rgba(220, 38, 38, 0.08);
}

.jga-result.is-error.is-blocked .jga-result__message {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.jga-result.is-error .jga-result__value {
  color: #b91c1c;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.02em;
}

.jga-result.is-success {
  border-color: var(--jga-slate-300);
  background: var(--jga-slate-50);
}

.jga-result__label {
  color: var(--jga-slate-500);
  font-size: 12px;
}

.jga-result__value {
  color: var(--jga-slate-900);
  font-size: clamp(32px, 5vw, 40px);
  line-height: 1.1;
  font-weight: 700;
}

.jga-result__note {
  color: var(--jga-slate-600);
  font-size: 12px;
  line-height: 1.55;
}

.jga-map-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--jga-orange);
  border-radius: 10px;
  color: #fff;
  background: var(--jga-navy);
  text-decoration: none;
}

.jga-map-cta:hover,
.jga-map-cta:focus {
  color: #fff;
  text-decoration: none;
}

.jga-map-cta span {
  max-width: 520px;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.jga-map-cta strong {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff !important;
  background: var(--jga-orange) !important;
  font-size: 13px;
}

.jga-doc-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

.jga-doc-links a {
  color: #005088;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.jga-map__guide {
  margin: 0;
  color: var(--jga-slate-900);
  font-size: 13px;
  font-weight: 600;
}

.jga-map__canvas {
  position: relative;
  overflow: visible;
  max-width: 100%;
  background: #fff;
}

.jga-map__canvas svg,
.jga-map__canvas img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.jga-map__canvas #japan-map {
  overflow: visible;
}

.jga-map__canvas #japan-map .pref-area path {
  fill: #cdd6e2 !important;
  stroke: #fff;
  stroke-width: 1;
  transition: fill .2s ease;
}

.jga-map__canvas #japan-map #text-group path {
  fill: #334155;
}

.jga-map__canvas #japan-map .pref-area.has-data {
  cursor: pointer;
}

.jga-map__canvas #japan-map .pref-area.has-data path {
  fill: #005088 !important;
}

.jga-map__canvas #japan-map .pref-area.has-data:hover path,
.jga-map__canvas #japan-map .pref-area.has-data:focus path {
  fill: #004670 !important;
}

.jga-map__canvas #japan-map .data-text {
  fill: #fff !important;
}

.jga-map-popup {
  position: fixed;
  z-index: 9999;
  width: min(278px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid #c5d3e3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.jga-map-popup::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 16px;
  width: 246px;
  max-width: calc(100% - 32px);
  height: 4px;
  border-radius: 4px;
  background: rgba(12, 22, 36, .08);
}

.jga-map-popup.is-active {
  opacity: 1;
  pointer-events: auto;
}

.jga-map-popup__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.jga-map-popup strong {
  display: block;
  margin-bottom: 10px;
  padding-right: 24px;
  color: #005088;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.jga-map-popup ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jga-map-popup li {
  color: #15803d;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.jga-map-popup li::before {
  content: "・";
}

.jga-map-popup__empty {
  color: var(--jga-slate-500);
  font-size: 12px;
}

.jga-map-popup a {
  color: #15803d !important;
  text-decoration: none;
}

.jga-map-popup a:hover,
.jga-map-popup a:focus {
  color: #005088 !important;
  text-decoration: underline;
}

@media (max-width: 767px) {
  .jga-calc__hero-inner,
  .jga-map__hero-inner {
    padding: 24px;
  }

  .jga-calc__body,
  .jga-map__body {
    padding: 20px 16px;
  }

  .jga-calc__card,
  .jga-map__card {
    padding: 20px;
  }

  .jga-map__canvas {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .jga-map__canvas #japan-map {
    min-width: 640px;
  }

  .jga-map-popup {
    left: 16px !important;
    right: 16px;
    width: auto;
    max-width: calc(100vw - 32px);
  }

  .jga-map-cta {
    align-items: flex-start;
    flex-direction: column;
  }
}
