body {
  font-family: 'Inter', sans-serif;
  background: #fff5f0;
  color: #333;
  margin: 0;
  padding: 0;
  text-align: center;
}

section {
  max-width: 700px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: left;
}

h1 {
  color: #ff5722;
  text-align: center;
}

label {
  display: block;
  margin: 15px 0 5px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

input[type="checkbox"],
input[type="radio"] {
  margin-right: 10px;
}

button {
  margin-top: 20px;
  background-color: #ff5722;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.button-back {
  display: inline-block;
  margin-bottom: 20px;
  background-color: #ccc;
  color: #333;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.hidden {
  display: none;
}

/* --- RUOKALISTAN OSIO --- */

#menuSection {
  margin-top: 30px;
  padding: 15px;
  background: #fffaf8;
  border-radius: 12px;
  border: 2px solid #ffd5c2;
}

#menuLists {
  margin-top: 10px;
}

.category-block {
  margin-top: 15px;
  padding-top: 5px;
  border-top: 1px dashed #ffccbc;
}

.category-block h4 {
  margin: 5px 0 8px;
}

.menuList {
  margin-top: 5px;
}

.menu-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 15px;
  margin-bottom: 10px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-item strong {
  color: #ff5722;
}

.menu-item button {
  margin-top: 0;
  background: #ccc;
  color: #333;
  padding: 6px 10px;
  font-size: 14px;
}

.menu-item button:hover {
  background: #ff5722;
  color: #fff;
}

.menu-item.dragging {
  opacity: 0.5;
}

#addMenuItemForm {
  border-top: 1px dashed #ffccbc;
  margin-top: 15px;
  padding-top: 15px;
}

#categorySettings {
  border-bottom: 1px dashed #ffccbc;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.category-row label {
  margin: 0;
  font-weight: 500;
  width: 90px;
}

.category-row input[type="text"] {
  margin: 0;
}

/* --- Aukioloaikojen grid (vanhasta CSS:stä) --- */
.hours-grid {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 6px 12px;
  margin-bottom: 15px;
}

/* --- Dialogi --- */

dialog {
  border: none;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

dialog input,
dialog textarea {
  width: 100%;
}

dialog button {
  margin-right: 10px;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

input, textarea, select {
  font-size: 16px !important; /* Safari ei zoomaa enää */
}

/* --- RESPONSIVE & SAFE DIALOG (MOBILE-FIX) --- */
dialog {
  width: 95vw;
  max-width: 450px;
  padding: 20px;
  border-radius: 12px;
  box-sizing: border-box;
  max-height: 85vh;
  overflow-y: auto;
}

dialog::backdrop {
  background: rgba(0,0,0,0.45);
}

/* Small screens */
@media (max-width: 480px) {
  dialog {
    width: 92vw;
    padding: 16px;
    max-height: 90vh;
  }

  dialog input,
  dialog textarea {
    font-size: 16px !important; /* tämä yksinään estää iPhone zoomin */
  }

  dialog button {
    font-size: 15px;
    padding: 8px 14px;
  }
}
dialog * {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}
