body {
  margin: 0;
  padding: 0;
  background-color: #fffef5;
  font-family: 'Arial', sans-serif;
  color: #333;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* 📱 スマホで自然な縦スクロール＆上に余白あり */
main {
  max-width: 500px;
  width: 92%;
  margin: 40px auto;
  padding: 20px;
  background-color: #fff;
  border: 2px solid #b00;
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* タイトル */
h1 {
  color: #b00;
  border-bottom: 2px solid #090;
  padding-bottom: 10px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 22px;
}

/* ラベルとチェックボックス */
.filter-options label {
  display: block;
  margin: 12px 0;
  font-size: 16px;
}

.limit-control {
  margin: 12px 0 20px;
}

.limit-mode {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.limit-mode-toggle {
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.limit-mode-toggle input {
  transform: scale(1.1);
}

.limit-type-label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

.limit-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.limit-select-row select {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#limitValueLabel {
  font-size: 16px;
  color: #333;
}

.limit-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.limit-input-row input {
  flex: 0 0 160px;
  max-width: 200px;
}

#limitUnit {
  font-weight: bold;
  color: #555;
}

.multi-limit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 20px;
  border: 1px solid #e0e0e0;
  padding: 12px 14px;
  border-radius: 6px;
  background-color: #fffdfa;
}

.multi-limit-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.multi-limit-item input[type="number"] {
  flex: 0 0 120px;
  max-width: 160px;
}

.multi-limit-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #333;
}

.multi-unit {
  font-weight: bold;
  color: #555;
}

.filter-toggle {
  margin-top: 18px;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  background-color: #fffaf0;
}

.filter-toggle summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  color: #b00;
  outline: none;
  list-style: none;
}

.filter-toggle summary::after {
  content: "（クリックで表示）";
  font-weight: normal;
  color: #555;
  margin-left: 8px;
  font-size: 14px;
}

.filter-toggle[open] summary::after {
  content: "（クリックで隠す）";
}

.filter-options {
  padding: 4px 16px 16px;
}

.region-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px 0 20px;
}

.region-switch.hidden {
  display: none;
}

.region-label {
  font-weight: bold;
  color: #777;
  transition: color 0.2s;
}

.region-label.disabled {
  color: #bbb !important;
}

.region-label[data-variant="A"].active {
  color: #b00;
}

.region-label[data-variant="B"].active {
  color: #1DA1F2;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #b00;
  border-radius: 999px;
  transition: background-color 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  top: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}


.switch input:checked + .slider {
  background-color: #1DA1F2;
}

.switch input:checked + .slider::before {
  transform: translateX(30px);
}

.switch input:disabled + .slider {
  background-color: #ccc;
  cursor: not-allowed;
}

.switch input:disabled + .slider::before {
  box-shadow: none;
}

input[type="number"] {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 8px;
  vertical-align: middle;
}

/* ボタン */
button {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  background-color: #b00;
  color: #fff;
  border: none;
  border-radius: 6px;
  margin-top: 15px;
  cursor: pointer;
}

button:hover {
  background-color: #900;
}

.secondary {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ccc;
}

.secondary:hover {
  background-color: #e8e8e8;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: space-between;
  align-items: center;
}

.action-buttons a,
.action-buttons button {
  flex: 1;
  text-align: center;
  display: block;
  width: auto;
  padding: 12px 16px;
  margin-top: 0;
  font-size: 16px;
  border-radius: 6px;
}

/* 結果枠 */
#result {
  margin-top: 30px;
  padding: 15px;
  background-color: #fefefe;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* 各メニュー */
.menu-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  column-gap: 12px;
}

.menu-code {
  background-color: #795548;
  color: #fff;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 3px;
  min-width: 60px;
  text-align: center;
  font-size: 14px;
}

.menu-name {
  font-size: 16px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-price {
  font-size: 16px;
  font-weight: bold;
  justify-self: end;
  white-space: nowrap;
}

.menu-name-text {
  display: block;
}

.menu-meta {
  font-size: 12px;
  color: #666;
}

.approx-note {
  margin-top: 8px;
  font-size: 12px;
  color: #777;
}

@media (max-width: 480px) {
  .menu-item {
    grid-template-columns: auto 1fr;
    row-gap: 4px;
  }

  .menu-price {
    grid-column: 2;
    justify-self: start;
  }

  .menu-name {
    gap: 2px;
  }

  h1 {
    font-size: 20px;
  }
}

#tweetButton {
  background-color: #1DA1F2;
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  text-decoration: none;
  transition: background-color 0.3s;
}

#tweetButton:hover {
  background-color: #0d8ddb;
}

.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-dialog {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  width: min(90%, 420px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.modal-intro {
  margin-top: 0;
  color: #555;
}

.modal-field {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: #333;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  margin-top: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

#feedbackSubmit {
  background-color: #b00;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
}

#feedbackSubmit:hover {
  background-color: #900;
}

.modal-status {
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 13px;
  color: #555;
}

.modal-status.success {
  color: #0b7d3c;
}

.modal-status.error {
  color: #b00020;
}
