/* Foglio personale: stesso avorio della carta, verde inchiostro per le azioni. */
#breakfast-link, .memo-save, #memo-toggle, #memo-sheet button { -webkit-tap-highlight-color: transparent; }
#breakfast-link { display:inline-flex; align-items:center; gap:9px; width:fit-content; min-height:44px; padding:0 14px; border:1px solid currentColor; border-radius:100px; color:var(--menu-mark); font-weight:600; font-size:16px; }
#breakfast-link svg, #memo-toggle svg { width:20px; height:20px; stroke:currentColor; stroke-width:1.65; fill:none; stroke-linecap:round; stroke-linejoin:round; }
#breakfast-link span { margin-left:4px; }
.menu-item:has(.memo-save) { grid-template-columns:minmax(0,1fr) auto auto; }
.menu-item:has(.memo-save) .item-category { grid-column:1/-1; }
.menu-item:has(.memo-save) p { grid-column:1/-1; }
.memo-save { grid-area:2/3; align-self:center; justify-self:end; min-height:44px; min-width:60px; padding:0 8px; border:1px solid #586f5c; border-radius:9px; background:transparent; color:#365744; font:600 13px/1 var(--sans,sans-serif); white-space:nowrap; }
.memo-save span { font-size:15px; }
.memo-save.is-saved { background:#e0e9df; color:#264c38; }
[data-evening] .memo-save { color:#e3efdc; border-color:#97af98; }
[data-evening] .memo-save.is-saved { background:#dbead9; color:#243e31; }
.group-filter { display:grid; gap:5px; margin:12px 0; color:var(--menu-muted); font-size:14px; }
.group-filter select { background:var(--menu-paper); color:var(--menu-ink); width:100%; max-width:30em; padding:9px 12px; min-height:44px; font:inherit; font-size:16px; border:1px solid var(--menu-mark); border-radius:6px; }
.group-filter[hidden], #memo-toggle[hidden] { display:none; }
#memo-toggle {
  position:fixed; z-index:56; bottom:calc(15px + env(safe-area-inset-bottom));
  right:max(18px,env(safe-area-inset-right)); display:flex; align-items:center; gap:10px;
  min-height:52px; padding:6px 9px 6px 16px; border:1px solid #fff2d8;
  border-radius:6px 17px 17px 6px; background:#a34116; color:#fff9ec;
  font:600 16px/1.25 Archivo, sans-serif; box-shadow:0 3px 0 #713216, 0 5px 15px #28231d30;
}
#memo-toggle strong {
  display:grid; place-content:center; min-width:34px; min-height:34px; padding:0 5px;
  border-radius:10px; background:#ffebce; color:#713216; font-variant-numeric:tabular-nums;
}
.has-memo .menu-main { padding-bottom:72px; }
#memo-sheet {
  --binding:#304b40; --note-ink:#382c23; --note-mark:#a34116; --note-paper:#fff6e5;
  --gutter:clamp(24px,7vw,34px);
  box-sizing:border-box; position:fixed; inset:auto 20px calc(16px + env(safe-area-inset-bottom)) auto;
  margin:0; padding:0; width:min(448px,calc(100% - 40px)); max-height:83dvh;
  overflow:auto; overscroll-behavior:contain; color:var(--note-ink); border:1px solid #b5a283;
  border-radius:12px 14px 12px 5px;
  background:linear-gradient(90deg,transparent 14px,#bf694e50 14px 15px,transparent 15px) var(--note-paper);
  box-shadow:0 3px 0 -1px #dfcfb4,0 6px 0 -2px #a9977a,0 16px 48px #201d1950;
}
#memo-sheet::backdrop { background:#221f1bb8; }
.memo-binding {
  height:24px; padding:0 12px; display:flex; justify-content:space-between;
  border-radius:10px 12px 0 0;
  background:linear-gradient(180deg,#a34721 0 9px,#803a20 9px 11px,transparent 11px);
}
.memo-binding i {
  position:relative; width:10px; height:18px; margin-top:1px; transform:rotate(-8deg);
  border:2px solid #655749; border-right-color:#b5a58a; border-radius:7px;
  box-shadow:inset 1px 0 #f6ebd7,1px 0 #d4c2a0;
}
.memo-binding i::after {
  content:""; position:absolute; bottom:-3px; left:-1px; width:8px; height:3px;
  background:#47392d; border-radius:50%;
}
#memo-sheet header {
  display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center;
  gap:8px; padding:6px 14px 2px var(--gutter);
}
#memo-sheet h2 { margin:0; font:600 clamp(27px,6vw,34px)/1.02 var(--serif); text-wrap:balance; overflow-wrap:anywhere; }
.memo-sketch { width:65px; height:54px; transform:rotate(-6deg); pointer-events:none; }
#memo-sheet button { font:inherit; color:inherit; min-height:44px; min-width:44px; cursor:pointer; }
#memo-sheet [data-close] { font:25px/1 sans-serif; border:0; border-radius:50%; background:transparent; color:#5b5046; }
.memo-content { padding:0 18px 22px var(--gutter); }
.memo-sub { max-width:36ch; margin:3px 0 13px; color:#615349; font-size:15px; line-height:1.45; }
.memo-lines { list-style:none; padding:0; margin:0; }
.memo-line { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline; gap:4px 12px; padding:11px 0 8px; border-top:1px solid #c6b9a1; }
.memo-line h3 { margin:0; font:600 22px/1.15 var(--serif); overflow-wrap:anywhere; }
.memo-line small { display:block; margin-top:3px; color:#615349; font-size:14px; }
.memo-line b,.memo-total strong,.memo-step { font-variant-numeric:tabular-nums; }
.memo-step { display:inline-flex; align-items:center; justify-self:start; gap:2px; color:var(--binding); }
.memo-step button { background:transparent; border:0; border-radius:50%; position:relative; isolation:isolate; }
.memo-step button::before { content:""; position:absolute; inset:7px; z-index:-1; border:1px solid #ad9d83; border-radius:50%; }
.memo-step span { min-width:1em; text-align:center; }
.memo-option { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; text-align:left; border:1px solid #cbb698; border-radius:7px; background:#fff9ed; padding:10px 14px; margin:7px 0; }
.memo-option strong { color:var(--note-mark); }
.memo-total { border-top:2px solid var(--binding); padding-top:12px; display:flex; align-items:baseline; justify-content:space-between; gap:8px; font-weight:600; }
.memo-total strong { font:600 28px/1.2 var(--serif); font-variant-numeric:tabular-nums; box-shadow:inset 0 -4px #e3ad73; }
.memo-pending { color:#674a2b; font-size:15px; margin-top:6px; }
#memo-toggle:focus-visible,#memo-sheet :focus-visible { outline:3px solid #974119; outline-offset:2px; }
@media (hover:hover) {
  .memo-save:hover,.memo-option:hover { background:#e0e9df; color:#264c38; }
}
@media (max-width:767px) {
  #memo-sheet { inset:auto 6px calc(6px + env(safe-area-inset-bottom)); width:calc(100% - 12px); max-width:none; max-height:88dvh; border-radius:12px 14px 12px 5px; padding-bottom:0; }
  .story-visible:not(.menu-visible) #memo-toggle { bottom:calc(var(--dock) + 8px); }
}
@media (max-width:400px) {
  .menu-item:has(.memo-save) { column-gap:5px; }
  .memo-sketch { width:44px; height:42px; }
  .memo-save { padding:0 5px; min-width:54px; }
}
@media (prefers-reduced-motion:no-preference) {
  #memo-sheet[open] { animation:memo-enter 160ms ease-out; }
  @keyframes memo-enter { from { opacity:0; transform:translateY(8px); } }
}
