/* ===== reset / base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: #1a3a5c;
  color: #fff;
  padding: 18px 0 14px;
}
.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.site-header h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.site-header p  { font-size: 13px; opacity: .8; }
.header-receipt-link {
  margin-top: 2px;
  background: #ffffff;
  color: #1a3a5c;
}
.header-receipt-link:hover {
  background: #e4ecf9;
}

main { padding: 20px 0 40px; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 860px) {
  .content-grid { grid-template-columns: 1fr; }
  .header-top-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.side-column { display: flex; flex-direction: column; gap: 16px; }

.submit-panel h2 {
  font-size: 15px;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 4px;
}
.submit-lead {
  font-size: 12px;
  color: #4f5d75;
  margin-bottom: 10px;
}
.receipt-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 420px) {
  .receipt-grid { grid-template-columns: 1fr; }
}
textarea {
  padding: 7px 10px;
  border: 1.5px solid #d0d8e4;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1a1a2e;
  transition: border-color .15s;
  width: 100%;
  resize: vertical;
}
textarea:focus {
  outline: none;
  border-color: #2e5fa3;
}
.submit-hint {
  font-size: 11px;
  color: #6c7a95;
}
.receipt-match-box {
  border: 1px solid #e2e9f5;
  border-radius: 8px;
  padding: 8px;
  background: #2e5fa3;
}
.match-result {
  font-size: 12px;
  min-height: 16px;
  margin-top: 6px;
  color: #4f5d75;
}
.match-result.success { color: #1e8449; }
.match-result.error { color: #c0392b; }
.match-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.hidden { display: none; }
.receipt-message {
  font-size: 12px;
  min-height: 16px;
}
.receipt-message.error {
  color: #c0392b;
}
.receipt-message.success {
  color: #1e8449;
}

/* ===== panel ===== */
.panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.panel-head h2 { font-size: 15px; font-weight: 600; color: #1a3a5c; }

/* ===== search controls ===== */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.field span { font-size: 12px; font-weight: 600; color: #555; }
.field.grow { flex: 1 1 180px; }
.field.field-mid { flex: 0 0 140px; }
.field.field-small { flex: 0 0 90px; }

input[type="text"],
input[type="number"],
input[type="date"],
select {
  padding: 7px 10px;
  border: 1.5px solid #d0d8e4;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1a1a2e;
  transition: border-color .15s;
  width: 100%;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: #2e5fa3;
}
input[readonly] {
  background: #f2f5fa;
  color: #4f5d75;
}

/* ===== 地点指定エリア ===== */
.location-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef1f6;
}
.location-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}
.location-input-wrap {
  display: flex;
  gap: 6px;
  flex: 1 1 260px;
}
.location-input-wrap input {
  flex: 1;
  min-width: 0;
}
.location-hint {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

/* ===== buttons ===== */
.button {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.button:active { transform: scale(.97); }
.button.primary   { background: #2e5fa3; color: #fff; }
.button.primary:hover   { background: #1a3a5c; }
.button.secondary { background: #e8f0fb; color: #2e5fa3; }
.button.secondary:hover { background: #d0dff5; }
.button.small { padding: 7px 12px; font-size: 12px; }

/* ===== status row ===== */
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.badge {
  background: #edf2fb;
  color: #2e5fa3;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}
.message { margin-top: 8px; font-size: 13px; color: #c0392b; min-height: 18px; }

/* ===== map ===== */
#map {
  height: 460px;
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
}
@media (max-width: 860px) { #map { height: 320px; } }

.map-hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 6px;
  text-align: center;
}

/* ===== 現在地カスタムアイコン ===== */
.user-location-icon {
  width: 22px;
  height: 22px;
  background: #2e5fa3;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #2e5fa3, 0 2px 6px rgba(0,0,0,.3);
  position: relative;
}
/* 外側に広がるパルスリング */
.user-location-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border: 2px solid #2e5fa3;
  border-radius: 50%;
  opacity: 0;
  animation: location-pulse 2s ease-out infinite;
}
@keyframes location-pulse {
  0%   { width: 22px; height: 22px; opacity: .8; }
  100% { width: 48px; height: 48px; opacity: 0; }
}

/* 地図クリック起点アイコン */
.custom-point-icon {
  width: 20px;
  height: 20px;
  background: #e67e22;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #e67e22, 0 2px 6px rgba(0,0,0,.3);
}

/* ===== count / summary ===== */
.count-pill {
  background: #2e5fa3;
  color: #fff;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.summary-text { font-size: 12px; color: #888; }

/* ===== result cards ===== */
#results { display: flex; flex-direction: column; gap: 8px; }

.result-card {
  border: 1.5px solid #e8eef5;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.result-card:hover {
  border-color: #2e5fa3;
  box-shadow: 0 2px 8px rgba(46,95,163,.12);
}
.result-card.cheapest {
  border-color: #2e5fa3;
  background: #f0f6ff;
}
/* カードがアクティブ（地図フォーカス中）の状態 */
.result-card.active {
  border-color: #1a3a5c;
  background: #ddeafc;
  box-shadow: 0 2px 10px rgba(46,95,163,.22);
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.result-rank  { font-size: 13px; font-weight: 700; color: #1a3a5c; }
.result-meta  { font-size: 12px; color: #888; margin-top: 2px; }
.result-price { font-size: 16px; font-weight: 700; color: #1a3a5c; margin-top: 4px; }
.result-sub   { font-size: 11px; color: #aaa; margin-top: 2px; }
.cheapest-tag {
  background: #2e5fa3;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.empty-state { font-size: 13px; color: #999; padding: 20px 0; text-align: center; }

/* ===== hint panel ===== */
.hint-panel h2 { font-size: 14px; font-weight: 600; color: #1a3a5c; margin-bottom: 8px; }
.hint-panel ul { padding-left: 18px; }
.hint-panel li { font-size: 12px; color: #666; margin-bottom: 4px; }

.nav-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.receipt-page-main {
  max-width: 760px;
  padding-top: 20px;
}

.receipt-nav {
  margin-bottom: 12px;
}

.receipt-standalone-panel {
  margin-bottom: 24px;
}
