/* Menu Studio shell and role-specific layouts. The printed menu keeps its own type and palette. */
:root {
  --rail: #142d2b;
  --green: #15564a;
  --ink: #152d2a;
  --muted: #506560;
  --canvas: #f3f6f5;
  --card: #fff;
  --line: #d4dfdb;
  --sans: Inter, "Helvetica Neue", system-ui, sans-serif;
  font-family: var(--sans);
  background: var(--canvas);
}
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 20; inset: .5rem auto auto .5rem; padding: .7rem 1rem; background: white; }
.workspace main, .signin main { width: 100%; min-width: 0; padding: 1.25rem 1rem 4rem; max-width: 80rem; }
.workspace :is(h1,h2,h3), .signin h1, .dining .viewer > h1 { font-family: var(--sans); color: var(--ink); }
.workspace :is(h1,h2,h3), .signin h1 { font-weight: 700; }
.workspace main h1, .signin h1 { font-size: clamp(1.85rem,4vw,3.1rem); line-height: 1.08; letter-spacing: -.052em; margin: .35rem 0 .7rem; }
.workspace main h2 { font-size: clamp(1.22rem,2vw,1.55rem); letter-spacing: -.035em; margin: 0 0 1rem; }
.workspace main h3 { font-size: 1.08rem; letter-spacing: -.02em; }
.workspace small, .signin small { font: 650 .8rem/1.35 var(--sans); letter-spacing: .045em; color: var(--muted); }
.workspace main > section, .workspace .panel, .signin .login {
  margin: 1rem 0; padding: clamp(1rem,2.4vw,1.7rem);
  border: 1px solid var(--line); border-radius: .9rem; background: white; box-shadow: 0 2px 4px #18392d05;
}
.wordmark { display: inline-flex; gap: .64rem; align-items: center; font: 700 1.32rem/1 var(--sans); letter-spacing: -.05em; color: #f6fff7; text-decoration: none; }
.wordmark i { width: 1.62rem; height: 1.6rem; position: relative; flex: none; }
.wordmark i::before, .wordmark i::after { content: ""; position: absolute; width: 45%; height: 90%; top: 3%; background: #c6ea97; }
.wordmark i::before { left: 0; border-radius: .2rem .12rem .08rem .2rem; transform: skewY(11deg); }
.wordmark i::after { right: 0; border-radius: .12rem .2rem .2rem .08rem; transform: skewY(-11deg); }
.rail {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .65rem;
  padding: .85rem 1rem .5rem; background: var(--rail); color: white;
}
.rail-nav { grid-row: 2; grid-column: 1 / -1; display: flex; justify-content: start; gap: .15rem; flex-wrap: wrap; margin: 0; }
.rail-nav a { padding: .7rem .55rem; color: #d5e6df; font-size: .88rem; font-weight: 580; text-decoration: none; border-radius: .45rem; min-height: 44px; }
.rail-nav a[aria-current], .rail-nav a:hover { color: #efffdd; background: #34514a; }
.rail-account { grid-column: 2; grid-row: 1; display: flex; align-items: center; min-width: 0; }
.account-name, .account-avatar { display: none; }
.logout { background: transparent; color: #e0ede6; box-shadow: inset 0 0 0 1px #638078; font-size: .88rem; }
.page-heading, .panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.page-heading { margin: .45rem 0 1.25rem; }
.page-heading > div { min-width: 0; }
.panel-heading { margin-bottom: 1rem; }
.workspace .panel-heading h2 { margin: 0; }
.workspace .filter { margin: 0; flex: 0 1 17rem; }
.workspace .filter input { min-height: 2.75rem; background: #f7f9f8; }
.workspace .stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; border: 0; box-shadow: none; background: transparent; padding: 0; }
.stats a { color: var(--ink); display: grid; align-content: space-between; gap: .6rem; padding: .85rem .65rem; background: white; border: 1px solid var(--line); border-top: 3px solid #629682; border-radius: .7rem; text-decoration: none; }
.stats a:nth-child(2) { border-top-color: #ad91cb; }
.stats a:nth-child(3) { border-top-color: #d5a064; }
.stats a:hover { border-color: #80a999; }
.stats span { font-size: .86rem; font-weight: 600; color: var(--muted); }
.stats strong { font-size: clamp(1.6rem,3vw,2.55rem); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: .72rem; }
.menu-card { position: relative; display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: .65rem; }
.menu-card:focus-within, .menu-card:hover { background: #f5f9f6; border-color: #9ab5a9; }
.miniature { flex: none; width: 3.25rem; height: 4.15rem; border-radius: .14rem .32rem .32rem .14rem; color: var(--foil,#fff); background: var(--cover,#4b6158); border-left: .24rem solid #0003; box-shadow: 2px 2px 0 #c9ceca; padding: .35rem; }
.miniature i { display: block; height: 100%; position: relative; border: 1px solid currentColor; opacity: .8; }
.miniature i::before, .miniature i::after { content: ""; position: absolute; left: 15%; right: 15%; top: 39%; height: 2px; background: currentColor; }
.miniature i::after { left: 25%; right: 25%; top: 55%; height: 1px; }
.menu-entry { font-weight: 680; line-height: 1.35; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.menu-entry::after { content: ""; position: absolute; inset: 0; }
.menu-entry span, .directory-row p { display: block; margin: .28rem 0 0; color: var(--muted); font-size: .88rem; font-weight: 450; }
.directory-row { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .4rem .8rem; border-top: 1px solid var(--line); padding: .75rem 0; overflow-wrap: anywhere; }
.directory-row > a { grid-column: 2; width: fit-content; display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; }
.avatar, .account-avatar { place-items: center; width: 2.45rem; height: 2.45rem; border-radius: .65rem; background: #e5efea; color: #205948; font-weight: 700; }
.avatar { display: grid; }
.empty { margin: .75rem 0; }
.account-form { display: grid; gap: .5rem 1rem; }
.account-form button { justify-self: start; }
.section-nav { display: flex; justify-content: start; margin: 0 0 1rem; gap: .45rem; }
.section-nav a, .crumb, .workspace main > a:first-child { min-height: 44px; display: inline-flex; align-items: center; font-size: .91rem; }
.section-nav a { padding: .5rem .65rem; border: 1px solid var(--line); border-radius: .5rem; background: white; text-decoration: none; }
.page-row h3 a { display: inline-block; padding: .35rem 0; }
.workspace section, .workspace #create { scroll-margin-top: 1rem; }
.item-editor { background: #f6f9f7; }
.actions button[name=action][value="delete-page"] { color: #853e39; background: #f9efed; }
[data-activity-owner] span { margin-right: .4rem; font-weight: 650; }
.activity-table { font-size: .95rem; }
.activity-table td { overflow-wrap: anywhere; }
.activity-table td:last-child { font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 42rem) {
  .activity-table, .activity-table tbody, .activity-table tr { display: block; }
  .activity-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .activity-table tr { padding: .65rem 0; border-top: 1px solid var(--line); }
  .activity-table td { display: grid; grid-template-columns: 5rem minmax(0,1fr); gap: .05rem .6rem; border: 0; padding: .3rem 0; }
  .activity-table td::before { content: attr(data-label); font-size: .84rem; color: var(--muted); font-weight: 500; }
  .activity-table td:last-child::before { content: "Scans"; }
  .activity-table td[data-label="Restaurant"] { display: block; }
  .activity-table td[data-label="Restaurant"]::before { display: block; }
  .panel-heading .filter { flex: 1 0 100%; }
}
@media (min-width: 42.01rem) {
  .directory-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .directory-row > a { grid-column: 3; }
  .account-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-form > button { align-self: end; margin-bottom: .85rem; }
  .stats a { padding: 1.15rem 1.35rem; }
}
@media (min-width: 58rem) {
  .workspace { display: grid; grid-template-columns: 14rem minmax(0,1fr); align-items: start; }
  .rail { position: sticky; top: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: stretch; padding: 1.65rem 1rem 1rem; }
  .rail .wordmark { padding-left: .6rem; }
  .rail-nav { display: grid; margin: 2.2rem 0; gap: .35rem; }
  .rail-nav a { padding: .7rem .85rem; font-size: .95rem; }
  .rail-account { border-top: 1px solid #547069; padding-top: 1rem; margin-top: auto; display: grid; grid-template-columns: auto minmax(0,1fr); gap: .7rem; }
  .account-avatar { display: grid; background: #c8e5bf; }
  .account-name { display: block; min-width: 0; }
  .account-name strong, .account-name span { display: block; overflow-wrap: anywhere; font-size: .85rem; }
  .account-name span { margin-top: .15rem; color: #c8d8d1; font-size: .77rem; }
  .rail-account form { grid-column: 1 / -1; }
  .logout { width: 100%; }
  .workspace main { padding: clamp(1.6rem,3.5vw,3rem) clamp(1.5rem,3.4vw,3.4rem) 4rem; }
}
body > .signin-head, body > .diner-head { background: var(--rail); border: 0; min-height: 3.65rem; padding: .75rem max(1rem,5vw); }
.signin { background: linear-gradient(135deg,#e7f0e9,#f5f8f6 45%,#e9eeed); min-height: 100vh; }
.signin .login { margin: clamp(1rem,9vh,7rem) auto; width: min(100%,28rem); padding: clamp(1.35rem,4vw,2.4rem); border-top: .25rem solid #467460; }
.dining { background: #eff3ef; }
body > .diner-head { justify-content: center; background: white; border-bottom: 1px solid var(--line); }
.diner-head a { font-weight: 650; color: var(--ink); text-decoration: none; display: flex; gap: .65rem; align-items: center; overflow-wrap: anywhere; }
.diner-head img { width: 2rem; height: 2rem; object-fit: contain; border-radius: .35rem; }
.dining main { max-width: 66rem; padding: 1rem .7rem 2.5rem; }
.dining .viewer > h1 { margin: .4rem 0 1.1rem; font-size: clamp(1.65rem,4vw,2.5rem); }
.reading-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem 1rem; }
.reading-tools label { text-align: left; font-size: .88rem; margin: .35rem 0; }
.reading-tools select { max-width: min(80vw,20rem); font-size: 1rem; }
.reading-tools a, .dining nav a { display: inline-flex; min-height: 44px; align-items: center; }
@media (max-width: 23rem) {
  .rail-nav a { font-size: .81rem; padding-inline: .45rem; }
  .stats span { font-size: .8rem; }
  .workspace .portion-editor { grid-template-columns: minmax(0,1fr); }
}
/* Keep prices legible on a phone even when the book scales down. */
@media (max-width: 42rem) {
  .dining .viewer .sheet-item h3 { font-size: max(1.1rem,4.9cqw); }
  .dining .viewer .sheet-item p, .dining .viewer .sheet-portions { font-size: max(.9rem,3.3cqw); line-height: 1.35; }
  .dining .viewer .sheet-portions { gap: .3rem .85rem; }
  .dining .viewer .sheet-footer { font-size: max(.75rem,2.85cqw); }
}
