/* ─────────────────────────────────────────────
   edit-dish-modal.css  —  dish-specific content styles only
   Shell chrome (backdrop, sheet, handle, header) lives in sheet-modal.css
   ───────────────────────────────────────────── */

/* ── Content tokens (dish-specific) ──────── */
[data-theme="dark"] {
  --edm-surface:      #2c2c2e;
  --edm-border:       #3a3a3c;
  --edm-text:         #f2f2f7;
  --edm-text-muted:   #8e8e93;
  --edm-input-bg:     #3a3a3c;
  --edm-input-text:   #f2f2f7;
  --edm-accent:       #0a84ff;
  --edm-accent-hover: #409cff;
  --edm-cancel-bg:    #3a3a3c;
  --edm-cancel-text:  #f2f2f7;
}
[data-theme="light"],
:root {
  --edm-surface:      #ffffff;
  --edm-border:       #d1d1d6;
  --edm-text:         #1c1c1e;
  --edm-text-muted:   #6c6c70;
  --edm-input-bg:     #ffffff;
  --edm-input-text:   #1c1c1e;
  --edm-accent:       #007aff;
  --edm-accent-hover: #0062cc;
  --edm-cancel-bg:    #e5e5ea;
  --edm-cancel-text:  #1c1c1e;
}

/* ── Dish banner ──────────────────────────── */
.edm-dish-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--edm-border);
}
.edm-dish-icon {
  color: var(--edm-accent);
  font-size: 16px;
}
.edm-dish-name-display {
  font-size: 15px;
  font-weight: 600;
  color: var(--edm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Form body padding ────────────────────── */
.edm-form {
  padding: 16px 18px 8px;
}

/* ── Section label ────────────────────────── */
.edm-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--edm-text-muted);
  margin: 16px 0 8px;
}
.edm-section-label:first-child { margin-top: 0; }

/* ── Row / Field ──────────────────────────── */
.edm-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.edm-row--sub {
  padding-left: 8px;
  border-left: 2px solid var(--edm-border);
  margin-bottom: 8px;
}
.edm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}
.edm-field--grow { flex: 1 1 160px; }
.edm-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--edm-text-muted);
}

/* ── Inputs ───────────────────────────────── */
.edm-input {
  background: var(--edm-input-bg);
  border: 1px solid var(--edm-border);
  border-radius: 9px;
  color: var(--edm-input-text);
  font-size: 14px;
  padding: 8px 10px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.edm-input--sm { max-width: 110px; }
.edm-input:focus {
  border-color: var(--edm-accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}

/* ── Select dropdown ──────────────────────── */
.edm-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238e8e93'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* ── Package size split field ─────────────── */
.edm-field--pkg { flex: 1 1 130px; }
.edm-pkg-wrap {
  display: flex;
  align-items: center;
  background: var(--edm-input-bg);
  border: 1px solid var(--edm-border);
  border-radius: 9px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.edm-pkg-wrap:focus-within {
  border-color: var(--edm-accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}
.edm-input--pkg-num {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent;
  color: var(--edm-input-text);
  font-size: 14px;
  padding: 8px 6px 8px 10px;
  flex: 1;
  min-width: 0;
  outline: none;
  -moz-appearance: textfield;
}
.edm-input--pkg-num::-webkit-outer-spin-button,
.edm-input--pkg-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.edm-pkg-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--edm-text-muted);
  padding: 0 10px 0 4px;
  white-space: nowrap;
  user-select: none;
}

/* ── Macro grid ───────────────────────────── */
.edm-macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .edm-macro-grid { grid-template-columns: repeat(2, 1fr); }
}
.edm-macro-card {
  border-radius: 12px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--edm-surface);
  border: 1.5px solid var(--edm-border);
}
.edm-macro-card--cal     { border-color: #ff6b35; }
.edm-macro-card--protein { border-color: #30d158; }
.edm-macro-card--carbs   { border-color: #ffd60a; }
.edm-macro-card--fat     { border-color: #64d2ff; }
.edm-macro-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--edm-text);
  -moz-appearance: textfield;
}
.edm-macro-input::-webkit-outer-spin-button,
.edm-macro-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.edm-macro-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--edm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Footer ───────────────────────────────── */
.edm-footer {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--edm-border);
  background: var(--sm-bg, var(--edm-surface));
}
.edm-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.edm-btn:active { transform: scale(0.97); }
.edm-btn--cancel {
  background: var(--edm-cancel-bg);
  color: var(--edm-cancel-text);
  flex: 0 0 96px;
}
.edm-btn--save {
  background: var(--edm-accent);
  color: #fff;
}
.edm-btn--save:hover { background: var(--edm-accent-hover); }