:root {
  --primary: #4a90e2;
  --primary-dark: #357abd;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e0e0e0;
  --badge-primary: #4a90e2;
  --badge-middle: #50c878;
  --badge-high: #ff6b6b;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 16px;
}
.container {
  max-width: 600px;
  margin: 0 auto;
}
header {
  text-align: center;
  margin-bottom: 24px;
}
header h1 {
  font-size: 1.8rem;
  color: var(--primary);
}
.search-group {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
#schoolNameInput {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}
#schoolNameInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
#searchSchoolBtn {
  padding: 12px 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
#searchSchoolBtn:hover {
  background-color: var(--primary-dark);
}
.hidden { display: none !important; }
#loading {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-weight: 500;
}
#error {
  padding: 12px;
  margin-bottom: 16px;
  background-color: #ffebee;
  color: #c62828;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
}
#schoolListContainer {
  margin-bottom: 20px;
}
#schoolList {
  list-style: none;
}
.school-item {
  background: var(--card-bg);
  padding: 16px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.school-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.school-info {
  flex: 1;
}
.school-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 4px;
}
.school-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
  margin-left: 8px;
}
.badge-primary { background-color: var(--badge-primary); }
.badge-middle { background-color: var(--badge-middle); }
.badge-high { background-color: var(--badge-high); }

#mealInfoContainer {
  margin-top: 20px;
}
#backBtn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0 12px 0;
  font-weight: bold;
}
#backBtn:hover { text-decoration: underline; }
#selectedSchoolName {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--text);
}
.meal-card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.meal-header {
  background: #f8f9fa;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.meal-date {
  font-weight: bold;
  color: var(--primary);
}
.meal-type {
  font-size: 0.8rem;
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
}
.meal-body {
  padding: 16px;
}
.dish-item {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #eee;
}
.dish-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.dish-name {
  font-weight: 500;
  margin-bottom: 2px;
}
.dish-cal {
  font-size: 0.8rem;
  color: var(--text-light);
}
@media (min-width: 600px) {
  body { padding: 24px; }
  .container { max-width: 700px; }
}
