:root {
  --blue: #1767a5;
  --blue-deep: #0b4f83;
  --blue-dark: #083f69;
  --blue-soft: #e6f2f8;
  --blue-label: #dff0f8;
  --teal: #079b8f;
  --teal-soft: #ddf3ef;
  --orange: #ff861d;
  --orange-deep: #dc6506;
  --bg: #f3f3f3;
  --surface: #ffffff;
  --text: #263440;
  --muted: #5f707d;
  --line: #d4dbe0;
  --danger: #c74b4b;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
}
a { color: #0b63c9; text-decoration: none; }
a:hover { text-decoration: underline; }

.page { padding: 18px 10px 54px; }
.page-inner { max-width: 1120px; margin: 0 auto; }
.page-title {
  margin: 0;
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: #111;
  line-height: 1.35;
  font-weight: 700;
}
.page-rule { margin: 10px 0 18px; border-top: 5px double #222; }
.intro-block {
  padding: 0 4px 14px;
  font-size: 1.02rem;
}
.intro-block p { margin: 0; }

.download-card {
  border: 1px solid #d0d0d0;
  background: #fff;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
.download-card-header {
  background: #efefef;
  padding: 12px 18px;
  font-weight: 700;
  color: #333;
}
.download-card-body {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.download-title { font-size: 1.05rem; font-weight: 700; }
.download-actions { display: flex; gap: 10px; align-items: center; }
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 32px;
  border-radius: 5px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.download-btn:hover { text-decoration: none; opacity: .92; }
.download-btn.pdf { background: linear-gradient(180deg, #ff8d75 0%, #d84b2e 100%); }
.download-btn.excel { background: linear-gradient(180deg, #94d26d 0%, #4aa429 100%); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin: 0 0 16px;
}
.card-title {
  margin: 0 0 16px;
  padding: 12px 14px 12px 18px;
  background: var(--blue-soft);
  border-left: 6px solid var(--blue);
  border-radius: 7px;
  color: #123f65;
  font-size: 1.5rem;
  line-height: 1.45;
  font-weight: 900;
}
.info-card, .notice-card, .success-card, .gold-card { background: #fff; }

.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid-narrow-left { grid-template-columns: minmax(220px,.75fr) minmax(0,1.5fr) !important; }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.form-group { margin: 0 0 18px; }
.form-group-spaced { margin-top: 20px; }
.form-group > label:not(.radio-card),
.form-grid > .form-group > label:not(.radio-card),
.form-group > .label {
  display: block;
  margin: 0;
  padding: 10px 14px;
  min-height: 46px;
  background: var(--blue-label);
  border: 1px solid #bfd2de;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: #214c6a;
  font-weight: 900;
}
.required { color: #c74949; font-size: .82rem; font-weight: 800; margin-left: 8px; }
.help { margin: 8px 0 0; color: var(--muted); font-size: .93rem; }
.form-control, .form-select {
  width: 100%;
  min-height: 56px;
  padding: 13px 15px;
  border: 1px solid #b9cbd8;
  border-radius: 0 0 8px 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-control:focus, .form-select:focus {
  outline: 3px solid rgba(23, 103, 165, .14);
  border-color: var(--blue);
}
.choice-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.radio-card {
  min-width: 0;
  min-height: 66px;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #c8d2d8;
  border-radius: 10px;
  background: #fff;
  color: #16486b;
  font-weight: 900;
  cursor: pointer;
}
.radio-card:has(input:checked) {
  border: 3px solid var(--teal);
  background: var(--teal-soft);
  color: #075f59;
  padding: 11px 15px;
}
.radio-card input[type="radio"] {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  accent-color: var(--teal);
}

.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.submit-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding-top: 6px;
  background: linear-gradient(180deg, rgba(243,243,243,0) 0%, rgba(243,243,243,.94) 18%, rgba(243,243,243,.94) 100%);
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  min-width: 120px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  transition: .12s ease;
}
.btn:disabled { opacity: .65; cursor: default; }
.btn-primary, .btn-orange {
  color: #fff;
  background: linear-gradient(180deg,#ff932f 0%,var(--orange) 100%);
  border: 1px solid var(--orange-deep);
  box-shadow: 0 3px 0 var(--orange-deep), 0 5px 10px rgba(220,101,6,.12);
}
.btn-secondary {
  color: var(--blue-deep);
  background: #fff;
  border: 1.5px solid #9fbfd4;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.btn-outline-primary {
  color: var(--blue-deep);
  background: #fff;
  border: 1.5px solid #a9c3d5;
}
.btn-outline-primary.btn-primary,
.btn-tool.btn-primary {
  color: #fff !important;
  background: var(--blue) !important;
  border-color: var(--blue-deep) !important;
  box-shadow: none !important;
}
.btn-danger-soft { color: #a33e3e; background: #fff; border: 1.5px solid #dfaaaa; }
.btn-submit { min-width: 260px; min-height: 52px; font-size: 1.04rem; }

.diagram-help { margin-top: -2px; margin-bottom: 10px; }
.diagram-toolbar,
.diagram-toolbar-secondary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.diagram-toolbar-primary { margin-bottom: 10px; }
.diagram-toolbar .btn,
.diagram-toolbar-secondary .btn {
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  font-size: .88rem;
  line-height: 1.2;
}
.compact-select {
  width: auto;
  min-width: 118px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: .85rem;
}
.diagram-canvas-wrap {
  width: 100%;
  padding: 6px;
  overflow: hidden;
  background: #fff;
  border: 1.5px solid #a9c7d9;
  border-radius: 10px;
}
#accidentCanvas {
  width: 100%;
  height: auto;
  display: block;
  border: 1.5px solid var(--blue-deep);
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}

.upload-zone {
  margin-top: 10px;
  padding: 14px;
  border: 1.5px solid #bfd2de;
  border-radius: 10px;
  background: #f8fcfe;
}
.upload-zone-green { border-color: #a7d5ce; background: #f4fbfa; }
.upload-zone > label {
  display: block;
  margin: 0 0 4px;
  color: #214c6a;
  font-weight: 900;
}
.upload-limit {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--blue-label);
  color: var(--blue-deep);
  font-size: .76rem;
}
.file-input {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #b9cbd8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(120px,1fr));
  gap: 10px;
  margin-top: 12px;
}
.preview-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.preview-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.preview-name { padding: 5px 7px; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-remove { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%; color: #fff; background: #b94b4b; }

.alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid transparent; font-weight: 700; }
.alert-success { background: #e3f5ef; border-color: #62b8a7; color: #176356; }
.alert-danger { background: #fff0f0; border-color: #e28a8a; color: #963838; }
.result-card { text-align: center; padding-top: 28px; padding-bottom: 28px; }
.result-icon { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 900; }
.result-icon.success { background: var(--teal-soft); color: var(--teal); border: 1px solid #79c8bc; }
.result-icon.error { background: #fff0f0; color: #b14848; border: 1px solid #e5aaaa; }
.result-card h1 { margin: 0 0 12px; color: var(--blue-deep); }
.result-card p { margin: 0 0 20px; color: var(--muted); }
.error-list { text-align: left; max-width: 700px; margin: 0 auto 22px; }
.site-footer { text-align: center; padding: 24px 12px; color: #677684; }

@media (max-width: 760px) {
  html { font-size: 15px; }
  .page { padding: 14px 8px 42px; }
  .page-rule { margin-bottom: 14px; }
  .intro-block { padding-bottom: 10px; font-size: .96rem; }
  .download-card-header { padding: 10px 12px; }
  .download-card-body { padding: 12px; }
  .card { border-radius: 10px; padding: 14px 12px; margin-bottom: 12px; }
  .card-title { margin-bottom: 14px; padding: 11px 12px 11px 14px; font-size: 1.24rem; }
  .form-grid.cols-2,
  .form-grid.cols-4,
  .form-grid-narrow-left { grid-template-columns: 1fr !important; gap: 0; }
  .span-1,.span-2,.span-3 { grid-column: span 1; }
  .form-group { margin-bottom: 15px; }
  .form-group > label:not(.radio-card),
  .form-grid > .form-group > label:not(.radio-card),
  .form-group > .label { min-height: 42px; padding: 8px 10px; font-size: .94rem; }
  .form-control,.form-select { min-height: 50px; padding: 10px 12px; }
  .choice-row { gap: 8px; }
  .radio-card { min-height: 58px; padding: 10px 8px; justify-content: center; gap: 6px; font-size: .9rem; }
  .radio-card:has(input:checked) { padding: 9px 7px; }
  .diagram-help { font-size: .82rem; line-height: 1.5; margin-bottom: 8px; }
  .diagram-toolbar,
  .diagram-toolbar-secondary {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 5px;
    margin-bottom: 7px;
    padding-bottom: 2px;
  }
  .diagram-toolbar .btn,
  .diagram-toolbar-secondary .btn {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: .75rem;
    white-space: nowrap;
  }
  .compact-select {
    flex: 0 0 auto;
    width: 106px;
    min-width: 106px;
    min-height: 32px;
    padding: 4px 6px;
    font-size: .75rem;
  }
  .diagram-canvas-wrap { padding: 4px; border-radius: 8px; }
  #accidentCanvas { border-radius: 5px; }
  .upload-zone { padding: 12px 10px; }
  .preview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .btn-submit { width: 100%; min-width: 0; min-height: 50px; font-size: 1rem; }
}

@media (max-width: 420px) {
  .choice-row { grid-template-columns: 1fr; }
  .download-actions { width: 100%; justify-content: flex-start; }
}

.choice-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.conditional-fields[hidden] { display: none !important; }
.conditional-fields { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #bfd2de; }
@media (max-width: 420px) { .choice-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ===== 受付フロー案内 ===== */
.flow-guide-link {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 18px;
  background: #eaf4fb;
  border: 1.5px solid #94bdd8;
  border-left: 6px solid var(--blue);
  border-radius: 10px;
  color: var(--blue-deep);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(23,103,165,.06);
}
.flow-guide-link:hover { background: #e1f0fa; text-decoration: none; }
.flow-guide-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
}
.flow-guide-text { display: flex; flex-direction: column; line-height: 1.4; }
.flow-guide-text strong { font-size: 1.05rem; }
.flow-guide-text small { margin-top: 3px; color: #5c7180; font-size: .86rem; }
.flow-guide-arrow { margin-left: auto; font-size: 1.8rem; line-height: 1; }

/* ===== 任意の状況図 ===== */
.diagram-optional-box {
  margin: 2px 0 14px;
  padding: 12px 14px;
  background: #f7fafc;
  border: 1px solid #cbd9e2;
  border-radius: 9px;
}
.diagram-optional-note { margin: 0 0 9px; color: #5f707d; font-size: .92rem; }
.diagram-toggle-btn {
  min-width: 250px;
  color: #fff;
  background: linear-gradient(180deg, #ffb04d 0%, #ff861d 100%);
  border: 1px solid #dc6506;
  box-shadow: 0 3px 0 #dc6506, 0 5px 10px rgba(220,101,6,.12);
}
.diagram-toggle-btn:hover,
.diagram-toggle-btn:focus {
  color: #fff;
  background: linear-gradient(180deg, #ffb65c 0%, #ff8c2d 100%);
  border-color: #dc6506;
}
.diagram-input-area { margin-top: 12px; }
.diagram-input-area[hidden] { display: none !important; }
.customer-photo-zone + .customer-photo-zone { margin-top: 12px; }

@media (max-width: 760px) {
  .flow-guide-link { padding: 12px; gap: 10px; }
  .flow-guide-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .flow-guide-text strong { font-size: .96rem; }
  .flow-guide-text small { font-size: .78rem; }
  .diagram-optional-box { padding: 10px; }
  .diagram-toggle-btn { width: 100%; min-width: 0; min-height: 42px; }
}

/* LINEで画像・動画送信 */
.btn-line {
    background-color: #06c755;
    border-color: #06c755;
    color: #fff;
    font-weight: bold;
}

.btn-line:hover,
.btn-line:focus {
    background-color: #05ad4a;
    border-color: #05ad4a;
    color: #fff;
}


/* WEBで画像送信 */
.btn-web {
    background-color: #1976d2;
    border-color: #1976d2;
    color: #fff;
    font-weight: bold;
}

.btn-web:hover,
.btn-web:focus {
    background-color: #1565c0;
    border-color: #1565c0;
    color: #fff;
}

.btn-line {
    margin-bottom: 12px;
}

.btn-web {
    margin-bottom: 18px;
}
/* ================================================================
   Google Maps 事故場所指定
   ================================================================ */
.map-location-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.map-select-btn {
  min-height: 46px;
  color: #fff;
  background: linear-gradient(180deg, #2a82d7 0%, #1767a5 100%);
  border: 1px solid #0b4f83;
  box-shadow: 0 3px 0 #0b4f83, 0 5px 10px rgba(11,79,131,.14);
}
.map-select-btn:hover,
.map-select-btn:focus {
  color: #fff;
  background: linear-gradient(180deg, #338ce1 0%, #1b6ead 100%);
  border-color: #0b4f83;
}
.map-location-status {
  color: var(--muted);
  font-size: .92rem;
}
.map-location-status.is-selected {
  color: #087b5b;
  font-weight: 700;
}

body.map-modal-open { overflow: hidden; }
.map-modal[hidden] { display: none !important; }
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.map-modal-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
}
.map-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-soft);
}
.map-modal-header h2 {
  margin: 0;
  color: #123f65;
  font-size: 1.35rem;
}
.map-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .94rem;
}
.map-modal-close {
  border: 0;
  background: transparent;
  color: #344b5b;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.map-modal-body {
  padding: 14px 18px 10px;
  overflow: auto;
}
.accident-map {
  width: 100%;
  height: min(58vh, 560px);
  min-height: 360px;
  border: 1px solid #b9cbd8;
  border-radius: 10px;
  background: #eef3f6;
}
.map-selected-info {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #c7d9e5;
  border-radius: 8px;
  background: #f5fafc;
  display: grid;
  gap: 3px;
}
.map-selected-info span { overflow-wrap: anywhere; }
.map-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .map-modal { padding: 8px; }
  .map-modal-dialog { max-height: calc(100vh - 16px); }
  .accident-map { height: 52vh; min-height: 320px; }
  .map-modal-footer .btn { flex: 1; }
  .map-location-actions .map-select-btn { width: 100%; }
}
