.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

.menu-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s;
    text-align: left;
    min-height: 100px;
    display: flex; flex-direction: column;
    justify-content: space-between;
    font-family: inherit; color: inherit;
  }

.menu-tile:hover {
    border-color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  }

.menu-tile:active { transform: translateY(0); background: var(--accent-soft); }

.menu-tile-name { font-size: 1rem; font-weight: 600; line-height: 1.3; }

.menu-tile-price { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-top: 0.5rem; }

.menu-tile-sizes {
    display: flex; flex-wrap: wrap; gap: 0.25rem;
    margin-top: 0.3rem;
  }

.menu-tile-sizes span {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 500;
  }

.empty-menu {
    grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem;
    color: var(--text-muted); font-size: 0.9rem;
    border: 1px dashed var(--border-strong); border-radius: 10px;
  }

.manage-form {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
  }

.lib-row {
    display: grid;
    grid-template-columns: 1.4fr 110px 100px 100px auto;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    align-items: center;
  }

.lib-row .size-price-cell input { padding-left: 1.55rem; font-size: 0.88rem; padding: 0.5rem 0.7rem 0.5rem 1.55rem; }

.size-price-cell { position: relative; }

.dual-price-symbol {
    position: absolute;
    left: 0.7rem; top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--text-muted);
    pointer-events: none;
    font-weight: 500;
  }

.side-remove {
    background: transparent; border: 1px solid var(--border-strong);
    padding: 0 0.7rem; cursor: pointer;
    font-family: inherit; font-size: 0.95rem; color: var(--text-muted);
    border-radius: 6px;
    height: 100%;
    min-height: 2.2rem;
  }

.side-remove:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

@media (max-width: 720px) {
    .lib-row {
      grid-template-columns: 1fr 1fr auto;
      grid-template-areas:
        "name name remove"
        "cat  cat  cat"
        "pyg  usd  usd";
      gap: 0.6rem;
      padding: 0.85rem 0.85rem 0.95rem;
      margin-bottom: 0.75rem;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      position: relative;
    }
    .lib-row > .lib-name { grid-area: name; font-weight: 500; }
    .lib-row > .lib-cat { grid-area: cat; }
    .lib-row > .size-price-cell:nth-of-type(1) {
      grid-area: pyg;
      padding-top: 0.4rem;
      border-top: 1px dashed var(--border);
    }
    .lib-row > .size-price-cell:nth-of-type(2) {
      grid-area: usd;
      padding-top: 0.4rem;
      border-top: 1px dashed var(--border);
    }
    .lib-row > .side-remove { grid-area: remove; align-self: start; }
  }

.modal h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.2rem; }

.modal .sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.25rem; }

.edit-row { margin-bottom: 1rem; }

.edit-row label {
    display: block;
    font-size: 0.78rem; font-weight: 500;
    color: var(--text); margin-bottom: 0.4rem;
  }

.edit-hint {
    font-size: 0.72rem; color: var(--text-muted);
    margin-top: 0.35rem;
  }

.dual-price {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  }

.dual-price-cell { position: relative; }

.dual-price-cell input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 1.85rem;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    border-radius: 6px;
  }

.dual-price-cell input:focus {
    outline: none; border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  }

.size-preset-row { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; flex-wrap: wrap; }

.size-preset {
    background: var(--accent-soft);
    border: 1px solid transparent;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-family: inherit; font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }

.size-preset:hover { color: var(--text); }

.size-preset.active { background: var(--text); color: var(--bg); }

.edit-size-row {
    display: grid;
    grid-template-columns: 1fr 105px 95px auto;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    align-items: center;
  }

.edit-size-row input { padding: 0.5rem 0.7rem; font-size: 0.88rem; }

.edit-size-row .size-price-cell input { padding-left: 1.55rem; }

@media (max-width: 520px) {
    .edit-size-row {
      grid-template-columns: 1fr auto;
      grid-template-areas:
        "name remove"
        "pyg  pyg"
        "usd  usd";
      gap: 0.35rem;
    }
    .edit-size-row > input.size-name { grid-area: name; }
    .edit-size-row .size-price-cell:nth-of-type(1) { grid-area: pyg; }
    .edit-size-row .size-price-cell:nth-of-type(2) { grid-area: usd; }
    .edit-size-row > .size-remove { grid-area: remove; }
  }
/* ===== Sections management (monochrome for now) ===== */
.sections-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}
.sections-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0.25rem;
}
.section-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.section-row:last-child { border-bottom: none; }
.section-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.section-arrow {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1;
  padding: 1px 3px;
  cursor: pointer;
  border-radius: 3px;
}
.section-arrow:hover:not([disabled]) { background: var(--accent-soft); }
.section-arrow[disabled] { color: var(--text-faint); cursor: default; }
.section-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}
.section-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.section-act {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.section-act:hover { border-color: var(--text); }
.section-delete:hover { border-color: var(--danger); color: var(--danger); }
.section-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.section-add-row input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}
.section-select {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}
/* ===== Exchange rate panel ===== */
.rate-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 1.5rem;
}
.rate-current {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rate-panel-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0.7rem;
}
.rate-override-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.rate-prefix { font-weight: 600; color: var(--text-muted); }
.rate-override-row input {
  width: 120px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* Read-only USD preview in the item modal (replaces the old typed field) */
.dual-price-usd {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 0.2rem;
}
/* In the read-only USD preview there's no input to float over, so the $ sits
   inline beside the number instead of being absolutely positioned (which was
   making them overlap). */
.dual-price-usd .dual-price-symbol {
  position: static;
  transform: none;
  left: auto;
  top: auto;
}
.usd-preview {
  font-size: 1rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0;
}