/* Pass 12 feedback grammar. Kept separate from Pass 01-inspired screen geometry.
   One feedback channel; dialogs centred, contextual sheets bottom-anchored on phones. */
#rbNotices{
 position:fixed;z-index:var(--layer-toast);left:50%;bottom:var(--feedback-bottom);
 transform:translate(-50%,14px);opacity:0;visibility:hidden;
 width:max-content;max-width:var(--feedback-max-width);padding:12px 17px;
 background:var(--copper-strong);color:var(--white);text-align:center;
 font:600 var(--type-support)/1.65 var(--font-ui);letter-spacing:0;
 border:1px solid rgba(255,255,255,.14);border-radius:12px;
 box-shadow:0 12px 30px rgba(67,30,14,.24);
 pointer-events:none;overflow-wrap:anywhere;
 transition:opacity .2s ease,transform .2s ease,visibility .2s;
}
#rbNotices.visible{opacity:1;visibility:visible;transform:translate(-50%,0)}
#rbNotices[data-tone="success"]{background:var(--copper-strong)}
#rbNotices[data-tone="error"]{background:var(--danger)}
#rbNotices[data-tone="warning"]{background:var(--warning)}
/* Menu remains header-anchored. Toast does not obscure its actions. */
body:has(.menu-layer) #rbNotices{bottom:var(--feedback-bottom);top:auto}
/* Feedback moves to the top safe area while a bottom sheet or dialog is active. */
body.has-overlay:not(:has(.menu-layer)) #rbNotices{
 top:calc(max(12px, env(safe-area-inset-top,0px)) + 6px);
 bottom:auto;transform:translate(-50%,-10px);
}
body.has-overlay:not(:has(.menu-layer)) #rbNotices.visible{transform:translate(-50%,0)}
/* Detail/cooking has no bottom navigation; keep messages clear of the sheet actions. */
body:has(.detail-stage):not(.has-overlay) #rbNotices{
 bottom:calc(82px + env(safe-area-inset-bottom,0px));
}
/* Match the same close-button geometry and contrast in every contextual sheet. */
.modal-layer:has(.sheet) .sheet-top button[data-action="close"]{
 width:42px;height:42px;min-width:42px;display:grid;place-items:center;
 border-radius:var(--radius-input);background:var(--surface-warm);border:1px solid var(--outline);
 color:var(--text-secondary);
}
.modal-layer .modal-scrim{background:var(--feedback-scrim);backdrop-filter:none;-webkit-backdrop-filter:none}
.modal-layer.menu-layer .modal-scrim{background:transparent}
.modal-layer:has(.discovery-sheet) .modal-scrim{background:var(--feedback-scrim);backdrop-filter:none;-webkit-backdrop-filter:none}
/* Dialogs are centred in all viewport sizes, unlike contextual sheets. */
.modal-layer:has(.confirm-card),
.modal-layer:has(.completion-sheet){
 display:grid;place-items:center;align-content:center;align-items:center;
 justify-items:center;padding: max(16px,env(safe-area-inset-top,0px))
 max(14px,env(safe-area-inset-right,0px))
 max(16px,env(safe-area-inset-bottom,0px))
 max(14px,env(safe-area-inset-left,0px));
}
.modal-layer:has(.confirm-card) .confirm-card{
 width:min(100%,390px);max-height:calc(var(--sheet-viewport-height) - 60px);overflow:auto;
 margin:auto;padding:24px 21px 21px;border-radius:var(--radius-dialog);
 box-shadow:0 24px 55px rgba(45,24,13,.22);
}
.modal-layer:has(.completion-sheet) .completion-sheet{
 width:min(100%,390px);max-height:calc(var(--sheet-viewport-height) - 60px);
 border-radius:var(--radius-dialog);margin:auto;
}
.confirm-actions button:focus-visible,.confirm-card button:focus-visible{
 outline:3px solid var(--copper-strong);outline-offset:3px;
}
/* A single mobile sheet contract; global timer is intentionally excluded. */
@media(max-width:699px){
 .modal-layer:has(.sheet):not(:has(.timer-sheet)){
  display:grid;align-content:end;align-items:end;justify-items:stretch;
  padding:0;overscroll-behavior:contain;
 }
 .modal-layer:has(.sheet):not(:has(.timer-sheet))>.sheet{
  margin:0 auto;width:min(100%,540px);max-height:calc(var(--sheet-viewport-height) - 50px);
  border-radius:var(--radius-sheet-mobile) var(--radius-sheet-mobile) 0 0;border-bottom:0;
  padding-bottom:env(safe-area-inset-bottom,0px);
  overscroll-behavior:contain;
 }
 .modal-layer:has(.sheet):not(:has(.timer-sheet)) .sheet-content{
  overscroll-behavior:contain;
 }
 .modal-layer:has(.confirm-card) .confirm-content p{margin-bottom:22px}
}
@media(prefers-reduced-motion:reduce){
 #rbNotices{transition:none;transform:translate(-50%,0)!important}
 .modal-layer .sheet,.modal-layer .confirm-card{animation:none!important;transition:none!important}
}

/* The viewport below an opened mobile software keyboard. Scoped to editable sheets,
   owned by the shared overlay layer; ordinary layouts are unchanged. */
body.keyboard-overlay .modal-layer:has(.sheet){
 top:var(--sheet-viewport-top);bottom:auto;height:var(--sheet-viewport-height);
}

/* Existing shared overlay entry transitions (no layout or final-state changes). */
.modal-layer:not(.menu-layer) .sheet{animation:rb-sheet-enter var(--motion-medium) var(--motion-ease) both}
.modal-layer .confirm-card{animation:rb-dialog-enter var(--motion-medium) var(--motion-ease) both}
@keyframes rb-sheet-enter{from{opacity:.7;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes rb-dialog-enter{from{opacity:.6;transform:translateY(7px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}
