/* ===== リセット & 基本 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:        #1a73e8;
  --primary-dark:   #1558b0;
  --bg:             #f0f4f8;
  --surface:        #ffffff;
  --text:           #202124;
  --text-secondary: #5f6368;
  --border:         #e0e0e0;
  --success:        #1e8e3e;
  --warning:        #e65100;
  --error:          #c5221f;
  --star-color:     #f9ab00;
  --radius:         8px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:      0 2px 6px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.10);
}

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== ヘッダー ===== */
.header {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
  padding: 16px 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.header-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.2px;
}

.header-subtitle {
  font-size: .85rem;
  opacity: .85;
  margin-top: 4px;
}

/* ===== メインコンテンツ ===== */
.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* ===== 検索バー ===== */
.search-bar {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-btn {
  align-self: flex-start;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .2s, transform .1s, box-shadow .2s;
}

.search-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.search-btn:active:not(:disabled) {
  transform: scale(.98);
}

.search-btn:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== ステータスメッセージ ===== */
.status-msg {
  font-size: .875rem;
  min-height: 1.4rem;
  padding: 2px 0;
}

.status-info    { color: var(--primary); }
.status-success { color: var(--success); }
.status-warning { color: var(--warning); }
.status-error   { color: var(--error); }

/* ===== コンテンツエリア（マップ + リスト）===== */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== マップ ===== */
.map-container {
  width: 100%;
  height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #dce8f8;
}

/* ===== 結果パネル ===== */
.results-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-title {
  font-size: .95rem;
  font-weight: 600;
}

.result-count {
  font-size: .82rem;
  color: var(--text-secondary);
}

.station-list {
  overflow-y: auto;
}

/* ===== プレースホルダー ===== */
.placeholder-text {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: .875rem;
  line-height: 1.8;
}

/* ===== ガソリンスタンドカード ===== */
.station-card {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}

.station-card:last-child {
  border-bottom: none;
}

.station-card:hover {
  background: #f5f8ff;
}

.card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 700;
  margin-top: 2px;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.card-address {
  font-size: .78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.card-rating {
  font-size: .8rem;
  margin-bottom: 6px;
}

.rating-stars {
  color: var(--star-color);
  letter-spacing: 1px;
}

.rating-value {
  color: var(--text-secondary);
  font-size: .75rem;
}

.no-rating {
  color: var(--text-secondary);
  font-size: .75rem;
}

.card-link {
  display: inline-block;
  font-size: .78rem;
  color: var(--primary);
  text-decoration: none;
  padding: 2px 0;
}

.card-link:hover {
  text-decoration: underline;
}

/* ===== InfoWindow ===== */
.info-window {
  font-size: .83rem;
  line-height: 1.6;
  max-width: 210px;
}

.info-window strong {
  display: block;
  margin-bottom: 3px;
  font-size: .9rem;
}

.info-window p {
  margin: 2px 0;
}

/* ===== フッター ===== */
.footer {
  text-align: center;
  padding: 12px;
  font-size: .73rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

/* ===== デスクトップ (768px 以上) ===== */
@media (min-width: 768px) {
  .header-title {
    font-size: 1.75rem;
  }

  .search-bar {
    flex-direction: row;
    align-items: center;
  }

  .status-msg {
    padding: 0;
  }

  .content-area {
    flex-direction: row;
    align-items: stretch;
    height: 600px;
  }

  .map-container {
    flex: 6;
    height: 100%;
  }

  .results-panel {
    flex: 4;
    height: 100%;
  }

  .station-list {
    flex: 1;
    overflow-y: auto;
  }
}

@media (min-width: 1024px) {
  .main {
    padding: 20px 24px;
  }
}

/* ===== 検索ボタングループ（2ボタン対応）===== */
.search-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.search-buttons .search-btn {
  width: 100%;
  align-self: auto;
  min-height: 48px; /* スマホでのタップしやすさ */
}

@media (min-width: 768px) {
  .search-buttons {
    flex-direction: row;
    width: auto;
  }

  .search-buttons .search-btn {
    width: auto;
    min-height: auto;
  }
}

/* ===== ENEOSボタン ===== */
.search-btn--eneos {
  background: #1a8a40;
}

.search-btn--eneos:hover:not(:disabled) {
  background: #136130;
  box-shadow: var(--shadow-md);
}

/* ===== ENEOSモードのカード（左に緑のアクセントライン）===== */
.station-card--eneos {
  border-left: 3px solid #1a8a40;
}

/* ===== FSカード注意書きバナー ===== */
.fscard-notice {
  padding: 10px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  font-size: .75rem;
  color: #5d4300;
  line-height: 1.55;
}

/* ===== FSカードセクション（カード内）===== */
.fscard-section {
  margin: 6px 0 8px;
  padding: 8px 10px;
  background: #f8faf8;
  border: 1px solid #d4e8d8;
  border-radius: 6px;
}

.fscard-label {
  font-size: .72rem;
  font-weight: 600;
  color: #2a6637;
  margin-bottom: 6px;
  letter-spacing: .2px;
}

/* ===== FSカードトグルボタン ===== */
.fscard-buttons {
  display: flex;
  gap: 5px;
  margin-bottom: 7px;
}

.fscard-btn {
  flex: 1;
  min-height: 40px; /* タップしやすいサイズ */
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  padding: 4px 2px;
  line-height: 1.2;
}

.fscard-btn:hover {
  background: #f0f0f0;
}

.fscard-btn--active {
  border-color: transparent;
  color: #ffffff;
}

.fscard-btn--unconfirmed {
  background: #757575;
}

.fscard-btn--ok {
  background: #1a8a40;
}

.fscard-btn--ng {
  background: #c5221f;
}

/* ===== メモ入力欄 ===== */
.memo-input {
  width: 100%;
  padding: 6px 8px;
  font-size: .78rem;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
}

.memo-input:focus {
  outline: none;
  border-color: #1a8a40;
  box-shadow: 0 0 0 2px rgba(26,138,64,.15);
}

/* ===== ソートバー ===== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sort-label {
  font-size: .75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sort-select {
  font-size: .75rem;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== デモ価格表示 ===== */
.card-demo-price {
  font-size: .78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.card-demo-price strong {
  color: #1a6e30;
  font-weight: 700;
}

/* ===== 距離バッジ ===== */
.card-dist {
  display: inline-block;
  font-size: .72rem;
  color: var(--text-secondary);
  background: #f0f4f8;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
}

/* ===== InfoWindowのデモ価格 ===== */
.info-demo-price {
  margin-top: 4px;
  color: #1a6e30;
  font-weight: 600;
  font-size: .82rem;
}

/* ===== アプリ注意書き ===== */
.app-notice {
  margin: 14px 0 0;
  padding: 10px 14px;
  background: #fff8e1;
  border-left: 3px solid #f9ab00;
  border-radius: 0 4px 4px 0;
  font-size: .75rem;
  color: #5d4300;
  line-height: 1.65;
}

.app-notice strong {
  font-weight: 700;
}
