/* SIMMER — the virtual kitchen: zones drawn as real cabinets/fridges with shelves */

.kitchen-wrap { display: flex; gap: 20px; align-items: flex-start; }
.kitchen-main { flex: 1; min-width: 0; }

/* zone grid — each zone is a piece of casework */
.zones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.zone {
  background: var(--paper-2);
  border: 1px solid var(--shade-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.zone.drop { outline: 2px dashed var(--pine); outline-offset: 2px; }

/* the casework "face" — a colored header band per zone kind */
.zone-head {
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--shade-2);
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0));
}
.zone-head .zicon { font-size: 19px; line-height: 1; }
.zone-head .ztitle { flex: 1; min-width: 0; }
.zone-head h3 {
  font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zone-head .zmeta { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.zone-head .zbtns { display: flex; gap: 3px; opacity: 0; transition: opacity .12s; }
.zone:hover .zone-head .zbtns { opacity: 1; }

/* "open the door and put something in" */
.zone-scan {
  appearance: none; cursor: pointer; flex: none;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--pine); background: var(--pine); color: #fff;
  white-space: nowrap;
}
.zone-scan:hover { background: var(--pine-dk); border-color: var(--pine-dk); }
.zone-scan:active { transform: translateY(1px); }

/* the per-shelf ＋ */
.shelf-scan {
  appearance: none; cursor: pointer; flex: none;
  width: 24px; height: 24px; border-radius: 50%; padding: 0;
  border: 1px solid var(--shade-2); background: var(--paper-2); color: var(--ink-2);
  font-size: 13px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s;
}
.shelf:hover .shelf-scan { opacity: 1; }
.shelf-scan:hover { background: var(--pine); border-color: var(--pine); color: #fff; }

.shelf-scan.bulk { font-size: 11px; }
.shelf-scan.bulk:hover { background: var(--copper); border-color: var(--copper); color: #fff; }

.shelf-empty[data-scanshelf] { cursor: pointer; }
.shelf-empty[data-scanshelf]:hover { background: var(--pine-lt); color: var(--pine); font-style: normal; }

/* ---------- bulk scan ---------- */
#bk-code {
  font-family: var(--mono); font-size: 20px; letter-spacing: .05em;
  padding: 14px; text-align: center;
}
.bk-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 8px 2px 12px; min-height: 20px;
}
.bk-total { font-size: 13px; font-weight: 700; color: var(--pine); }

.bk-list {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--shade); border-radius: var(--r);
  background: var(--enamel);
}
.bk-empty { padding: 26px 14px; text-align: center; font-size: 13px; color: var(--ink-3); }

.bk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-bottom: 1px solid var(--shade); font-size: 14px;
  animation: bk-in .16s ease-out;
}
.bk-row:last-child { border-bottom: 0; }
@keyframes bk-in { from { background: var(--fresh-bg); transform: translateY(-3px); } }
.bk-row.unknown { background: var(--soon-bg); }
.bk-row.unknown .bk-name { cursor: pointer; text-decoration: underline dotted; }
.bk-ico { font-size: 17px; flex: none; }
.bk-name { flex: 1; min-width: 0; font-weight: 500; }
.bk-sub { display: block; font-size: 11px; color: #8a6a12; font-weight: 600; }
.bk-qty {
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--pine-lt); color: var(--pine);
  padding: 2px 9px; border-radius: 20px; font-size: 12.5px;
}
.bk-undo {
  appearance: none; cursor: pointer; flex: none;
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  border: 1px solid var(--shade-2); background: var(--paper-2);
  color: var(--ink-2); font-size: 15px; font-weight: 700; line-height: 1;
}
.bk-undo:hover { background: var(--expired-bg); border-color: var(--expired); color: var(--expired); }

/* the date something was put away — asked for prominently */
.lot .ladded {
  display: block;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-3); margin-top: 1px;
}

/* targeted-scan modal */
.scan-into-where {
  font-size: 15px; padding: 10px 12px; margin-bottom: 16px;
  background: var(--pine-lt); border-radius: var(--r); color: var(--pine);
}
.scan-into #si-code {
  font-family: var(--mono); font-size: 18px; letter-spacing: .05em; padding: 13px 14px;
}
.si-reader {
  margin-top: 14px; border-radius: var(--r); overflow: hidden; background: #14160f; min-height: 200px;
}
.si-reader video { width: 100% !important; display: block; }

/* touch devices have no hover — never hide the way in behind one */
@media (hover: none), (max-width: 860px) {
  .zone-head .zbtns { opacity: 1; }
  .shelf-scan { opacity: 1; }
}

/* zone kinds get distinct materials so the kitchen reads at a glance */
.zone[data-kind="fridge"]    { border-color: #B9CBD4; }
.zone[data-kind="fridge"]    .zone-head { background: linear-gradient(180deg,#E6F0F4,#D8E7ED); }
.zone[data-kind="freezer"]   { border-color: #AFC2D6; }
.zone[data-kind="freezer"]   .zone-head { background: linear-gradient(180deg,#E4EDF7,#D2E0EF); }
.zone[data-kind="pantry"]    { border-color: #D8C9A8; }
.zone[data-kind="pantry"]    .zone-head { background: linear-gradient(180deg,#F5EBD6,#EADCC0); }
.zone[data-kind="cabinet"]   { border-color: #CFC3AE; }
.zone[data-kind="cabinet"]   .zone-head { background: linear-gradient(180deg,#F2ECE0,#E5DCCB); }
.zone[data-kind="spice"]     { border-color: #DEBEA0; }
.zone[data-kind="spice"]     .zone-head { background: linear-gradient(180deg,#F8E9DA,#EFD8C2); }
.zone[data-kind="counter"]   { border-color: #C8CCC2; }
.zone[data-kind="counter"]   .zone-head { background: linear-gradient(180deg,#EDEFE9,#DFE3DA); }

.zone-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* a shelf — a physical plank with items sitting on it */
.shelf {
  border: 1px solid var(--shade);
  border-radius: var(--r);
  background: var(--enamel);
  overflow: hidden;
}
.shelf.drop { border-color: var(--pine); background: var(--pine-lt); }
.shelf-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--shade);
  cursor: pointer;
}
.shelf-head:hover { background: var(--shade); }
.shelf-head .sname { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; flex: 1; }
.shelf-head .scount {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.shelf-head .caret { font-size: 10px; color: var(--ink-3); transition: transform .15s; }
.shelf.open .shelf-head .caret { transform: rotate(90deg); }

/* items sitting on the plank */
.shelf-items { display: none; padding: 6px; gap: 4px; flex-direction: column; }
.shelf.open .shelf-items { display: flex; }
.shelf-empty { padding: 9px 10px; font-size: 12px; color: var(--ink-3); font-style: italic; }

.lot {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--r-sm);
  background: var(--paper-2);
  border-left: 3px solid var(--shade-2);
  cursor: pointer; font-size: 13px;
}
.lot:hover { background: var(--shade); }
.lot[data-fresh="fresh"]   { border-left-color: var(--fresh); }
.lot[data-fresh="soon"]    { border-left-color: var(--soon); }
.lot[data-fresh="urgent"]  { border-left-color: var(--urgent); }
.lot[data-fresh="expired"] { border-left-color: var(--expired); background: var(--expired-bg); }
.lot .lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lot .lqty { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lot .ldays {
  font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
  white-space: nowrap; background: var(--shade); color: var(--ink-3);
}
.lot[data-fresh="fresh"]   .ldays { background: var(--fresh-bg);   color: var(--fresh); }
.lot[data-fresh="soon"]    .ldays { background: var(--soon-bg);    color: #8a6a12; }
.lot[data-fresh="urgent"]  .ldays { background: var(--urgent-bg);  color: var(--urgent); }
.lot[data-fresh="expired"] .ldays { background: var(--expired);    color: #fff; }

/* zone footer: add shelf */
.zone-foot { padding: 4px 10px 10px; }
.zone-foot .btn { width: 100%; justify-content: center; font-size: 12px; padding: 5px; }

/* "add a zone" tile */
.zone-add {
  border: 2px dashed var(--shade-2); border-radius: var(--r-lg);
  background: transparent; cursor: pointer;
  min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-3); font: inherit; font-size: 13.5px; font-weight: 600;
}
.zone-add:hover { border-color: var(--pine); color: var(--pine); background: var(--pine-lt); }
.zone-add .plus { font-size: 26px; line-height: 1; }

/* ---------- the side rail: what you can cook right now ---------- */
.rail {
  width: var(--rail); flex: none;
  position: sticky; top: calc(var(--bar) + 20px);
  max-height: calc(100vh - var(--bar) - 40px);
  display: flex; flex-direction: column;
  background: var(--paper-2); border: 1px solid var(--shade);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden;
}
.rail-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--shade); }
.rail-head h3 { font-size: 15.5px; margin-bottom: 2px; }
.rail-head .sub { font-size: 11.5px; color: var(--ink-3); }
.rail-tabs { display: flex; gap: 4px; padding: 9px 12px; border-bottom: 1px solid var(--shade); }
.rail-tabs .pill { flex: 1; text-align: center; justify-content: center; font-size: 11.5px; padding: 4px 6px; }
.rail-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }

/* a recipe as a small tin card with a picture plate */
.rcard {
  display: flex; gap: 10px; align-items: center;
  padding: 7px; border-radius: var(--r);
  background: var(--enamel); border: 1px solid var(--shade);
  cursor: pointer; text-align: left;
  transition: border-color .12s, transform .06s;
}
.rcard:hover { border-color: var(--pine); box-shadow: var(--shadow-1); }
.rcard:active { transform: translateY(1px); }
.rcard .plate {
  width: 50px; height: 50px; flex: none; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; line-height: 1;
  background: var(--copper-lt); border: 1px solid var(--shade);
  overflow: hidden;
}
.rcard .plate img { width: 100%; height: 100%; object-fit: cover; }
.rcard .rinfo { flex: 1; min-width: 0; display: block; }
.rcard .rname {
  display: block;
  font-family: var(--serif); font-size: 14.5px; font-weight: 600;
  line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rcard .rmeta {
  display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rcard .rmiss {
  display: block; font-size: 11px; color: var(--copper); font-weight: 600; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rcard .fav { color: var(--copper); font-size: 13px; }

@media (max-width: 1100px) {
  .kitchen-wrap { flex-direction: column; }
  .rail { width: 100%; position: static; max-height: none; }
  .rail-list { max-height: 420px; }
}
