* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #222;
  background: #f7f7f5;
}

/* ログイン画面 */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  width: 320px;
  text-align: center;
}
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p { color: #666; font-size: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login-card input { padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.login-card button { padding: 10px; border: none; border-radius: 8px; background: #d94f45; color: #fff; font-weight: bold; cursor: pointer; }

/* ヘッダー */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
.app-header h1 { font-size: 18px; margin: 0; }
.header-actions { display: flex; gap: 12px; align-items: center; }

.primary-btn {
  background: #d94f45;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}
.primary-btn:hover { background: #c43e35; }
.text-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
}

/* メインレイアウト */
.app-main {
  display: flex;
  height: calc(100vh - 61px);
}
#map { flex: 1; }
.shop-list {
  width: 320px;
  background: #fff;
  border-left: 1px solid #e5e5e5;
  padding: 16px;
  overflow-y: auto;
}
.shop-list h2 { font-size: 15px; margin: 0 0 12px; }

.shop-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}
.shop-card:hover { background: #fafafa; }
.shop-card .shop-name { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.shop-card .shop-meta { font-size: 12px; color: #777; }
.shop-card .shop-menu { font-size: 12px; color: #d94f45; margin-top: 4px; }
.shop-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.delete-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}
.delete-btn:hover { color: #d94f45; background: #fff0ef; }

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay[hidden] {
  display: none;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: #999;
}
.modal h2 { margin-top: 0; font-size: 18px; }
.form-section { margin-bottom: 20px; }
.form-section h3 { font-size: 14px; margin: 0 0 10px; }
.form-section label { display: block; font-size: 13px; color: #555; margin: 8px 0 4px; }
.form-section input[type="text"],
.form-section input[type="number"] {
  width: 100%;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.search-row button {
  padding: 9px 14px;
  border: none;
  background: #333;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.result-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  cursor: pointer;
}
.result-item:hover { background: #fafafa; }
.result-item.selected { border-color: #d94f45; background: #fff5f4; }
.result-item .r-name { font-weight: bold; font-size: 13px; }
.result-item .r-meta { font-size: 12px; color: #777; }

#detail-preview { font-size: 13px; line-height: 1.6; }
#detail-preview .photos { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
#detail-preview .photos img { width: 90px; height: 70px; object-fit: cover; border-radius: 6px; }
.hint { font-size: 12px; color: #999; margin-top: 6px; }

.error-msg { color: #d94f45; font-size: 13px; margin-top: 8px; }

/* 情報ウィンドウ */
.iw-content { font-size: 13px; line-height: 1.5; max-width: 240px; }
.iw-content .iw-name { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.iw-content a { color: #1a73e8; }
.iw-content .iw-menu { color: #d94f45; margin-top: 6px; }
.iw-delete-btn {
  display: block;
  margin-top: 10px;
  border: 1px solid #eee;
  background: #fff;
  color: #999;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.iw-delete-btn:hover { color: #d94f45; border-color: #d94f45; background: #fff0ef; }
