.food-main { position: relative; }
.hide-picker {
  display: inline-flex;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid #aeb6b0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 3px 10px #26352c20;
}
.hide-picker button {
  width: 29px;
  height: 25px;
  padding: 0;
  border: 0;
  background: #fff;
  color: #405048;
  font-size: 11px;
  font-weight: 800;
}
.hide-picker button + button { border-left: 1px solid #cbd0cc; }
.hide-picker button:hover,
.hide-picker button:focus-visible { background: #e7eee8; }
@media print { .hide-picker { display: none !important; } }

/* Compact spreadsheet density. */
.meal-sheet tbody th,
.meal-sheet tbody td { height: 23px; }
.meal-sheet .category-row th,
.meal-sheet .category-row td { height: 22px; }
.meal-sheet .hidden-row td,
.meal-sheet .add-row td { height: 20px; }
.meal-sheet .mark-cell { font-size: 18px; }
.meal-sheet .recency { width: 13px; height: 13px; flex-basis: 13px; font-size: 6px; }
.meal-sheet .row-action { padding-top: 1px; padding-bottom: 1px; }
.meal-sheet .add-toggle { width: 23px; height: 20px; font-size: 16px; }
@media (max-width: 760px) {
  .meal-sheet tbody th,
  .meal-sheet tbody td { height: 26px; }
}

/* Planner title and period controls share one compact bar. */
body.compact-header .app-header { display:flex; height:50px; min-height:50px; gap:6px; padding-top:5px; padding-bottom:5px; }
body.compact-header .app-header .period-toolbar { display:contents; }
body.compact-header .app-header .spacer,
body.compact-header .app-header .save-hint { display:none; }
body.compact-header .app-header .date-title { min-width:152px; width:auto; order:0; font-size:15px; white-space:nowrap; }
body.compact-header .app-header .setting { margin-left:auto; white-space:nowrap; }
body.compact-header .app-header #account { margin-left:2px; }
body.compact-header .planner { height:calc(100vh - 50px); }
@media (max-width: 900px) {
  body.compact-header .app-header { overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap; }
  body.compact-header .app-header .brand { flex:0 0 auto; }
  body.compact-header .app-header .view-switch { display:flex; flex:0 0 auto; width:auto; order:0; }
  body.compact-header .app-header .setting { margin-left:0; }
  body.compact-header .app-header #account { flex:0 0 auto; }
}
@media print { body.compact-header .app-header { display:none!important; } }

.meal-label {
  display:inline-grid;
  place-items:center;
  width:25px;
  height:25px;
  padding:0;
  border:2px solid transparent;
  border-radius:50%;
  background:transparent;
  color:inherit;
  font-size:10px;
  font-weight:800;
}
.meal-label.set { border-color:#26342c; color:#19241e; background:#fff; }
.meal-label:disabled { opacity:.65; }

.history-sheet-view { height:calc(100vh - 58px); display:flex; flex-direction:column; padding:10px 12px 16px; }
.history-sheet-title { display:flex; align-items:baseline; gap:12px; padding:0 2px 8px; }
.history-sheet-title strong { font:700 18px ui-serif,Georgia,serif; }
.history-sheet-title span,.history-sheet-title i { color:var(--muted); font-size:11px; font-style:normal; }
.history-sheet-title i { margin-left:auto; display:flex; align-items:center; gap:4px; }
.legend { display:inline-block; width:10px; height:10px; margin-left:7px; border-radius:2px; }
.legend.planned,.history-cell.planned { background:#9ca2a0; }
.legend.eaten,.history-cell.eaten { background:#163fce; }
.history-sheet-wrap { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; border:1px solid var(--line-strong); background:#fff; }
.history-sheet { width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.history-sheet th,.history-sheet td { height:12px; padding:0; border-right:1px solid #e5e7e5; border-bottom:1px solid #d8dbd8; }
.history-sheet thead th { position:sticky; top:0; z-index:4; height:19px; background:#f3f1ea; font-size:8px; font-weight:700; text-align:center; }
.history-sheet thead tr+tr th { top:19px; height:14px; color:#747a76; font-size:7px; }
.history-sheet .history-food-head,.history-sheet tbody th { width:155px; min-width:155px; max-width:155px; position:sticky; left:0; z-index:3; padding:0 5px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; text-align:left; background:#fff; font-size:8px; }
.history-sheet .history-food-head { z-index:7; background:#f3f1ea; font-size:10px; }
.history-category th,.history-category td { height:15px; background:#dfe4df!important; border-top:1px solid #4c554f; font-size:8px!important; font-weight:800; text-transform:uppercase; }
.history-food.band-0 th { background:var(--band-a); }
.history-food.band-1 th { background:var(--band-b); }
.history-day-end { border-right-color:#aeb4b0!important; }
@media(max-width:760px){.history-sheet-view{height:calc(100vh - 102px);padding:7px 6px}.history-sheet .history-food-head,.history-sheet tbody th{width:110px;min-width:110px;max-width:110px}.history-sheet-title span{display:none}}
