/*
 * Mad Bull, "Market stall": the same look as the mobile app (mobile/STYLE_GUIDE.md).
 * The slots below are the app's theme slots. A restaurant's menu sets its own values for them on
 * `.menu-sheet` (restaurants/menu_theme.py), so every rule here reads the slots and never a colour.
 */
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url("fonts/Fraunces-700.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("fonts/Figtree-400.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("fonts/Figtree-600.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("fonts/Figtree-700.ttf") format("truetype"); }

:root {
    --page: #FFFFFF; --surface: #F4F4F2; --ink: #2B1D14; --ink-soft: #6B645E; --rule: #E3E2DE;
    --primary: #D9472B; --on-primary: #FFFFFF; --tint: #EFEEEB; --on-tint: #57514B;
    --estimate: #F2C14E; --on-estimate: #3A2A00;
    --chip: #FFFFFF; --chip-line: #E3E2DE; --on-chip: #2B1D14;
    --vegan: #3F7D4E; --vegan-soft: #E3EFD9; --ask: #9A6200; --ask-soft: #FBEBCB; --not-vegan: #A3271F; --not-vegan-soft: #F9DEDC;
    /* Levels: the ring around a person's picture and the bar to the next level fill in this blue. */
    --level: #2F6FDE;
    --display: "Fraunces", Georgia, serif;
    --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --r-sm: 8px; --r-md: 14px; --r-lg: 24px; --r-full: 999px;
    --float: 0 6px 18px rgba(74, 47, 20, 0.16);
    --scrim: rgba(43, 29, 20, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 15px/21px var(--body); background: var(--page); color: var(--ink); min-height: 100vh; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

/* Type: the app's named styles. */
.t-hero { font: 700 40px/44px var(--display); }
.t-display { font: 700 28px/33px var(--display); }
.t-display, h1 { font: 700 28px/33px var(--display); }
.t-title, h2 { font: 700 21px/26px var(--display); }
.t-headline, h3 { font: 600 17px/22px var(--body); }
.t-label { font: 700 13px/18px var(--body); }
.t-caption { font: 400 12px/16px var(--body); }
.soft, .text-muted { color: var(--ink-soft); }
.tabular { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }

/* The bar across the top: the bull and wordmark, then where you can go. */
.nav { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--page); }
.nav-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; margin-right: auto; min-width: 0; }
.dish-mode { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; min-height: 44px; margin-right: auto; cursor: pointer; white-space: nowrap;
    font: 700 12px/16px var(--body); }
.dish-mode input { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; }
.dish-mode:has(:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }
.dish-mode-track { display: flex; align-items: center; width: 46px; height: 26px; padding: 3px;
    background: var(--ink-soft); border-radius: var(--r-full); }
.dish-mode-track::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: white; }
.dish-mode:has(input:checked) { color: var(--primary); }
.dish-mode input:checked + .dish-mode-track { justify-content: flex-end; background: var(--primary); }
@media (min-width: 1001px) {
    .dish-mode { gap: 4px; min-height: 48px; font-size: 17px; line-height: 22px; }
    .dish-mode-track { width: 64px; height: 36px; padding: 4px; }
    .dish-mode-track::after { width: 28px; height: 28px; }
}
@media (max-width: 460px) {
    .nav .nav-brand { width: 100%; gap: 4px; }
    .nav .nav-brand > span { min-width: 0; }
    .nav .nav-brand img.wordmark { max-width: 100%; width: auto; height: auto; max-height: 27px; }
    .nav .nav-brand img.bull { width: 34px; height: 38px; object-fit: contain; }
    .nav .nav-brand small { font-size: 9px; }
}
@media (max-width: 400px) {
    .nav .nav-brand img.bull { display: none; }
    .nav .nav-brand small { font-size: 8px; }
}
.nav-brand img.bull { width: 104px; height: 104px; }
.nav-brand img.wordmark { display: block; height: 64px; width: auto; }
.nav-brand small { display: block; font: 400 22px/26px var(--body); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a, .nav-links button { font: 700 17px/22px var(--body); text-decoration: none; padding: 8px 12px; border-radius: var(--r-full); border: 0; background: none; cursor: pointer; color: var(--ink-soft); }
.nav-links a:hover, .nav-links button:hover { background: var(--tint); color: var(--ink); }
.nav-links a.is-here { color: var(--primary); }
.nav-links a.nav-join, .nav-links a.nav-join:hover { background: var(--primary); color: var(--on-primary); margin-left: 4px; padding-inline: 16px; }
/* You: the person's own picture, ringed in tomato on the You page. */
/* The person's picture in the bar: a ring around it, grey filling in blue (--level) with their progress to the next
   level, and the level's number in a small blue disc at its top left. */
.nav-links a.nav-you { position: relative; padding: 4px; margin-left: 4px; border-radius: 50%;
                       background: conic-gradient(var(--level) calc(var(--level-percent, 0) * 1%), var(--rule) 0); }
.nav-links a.nav-you .avatar { width: 48px; height: 48px; border: 2px solid var(--page); box-sizing: content-box; }
.nav-links a.nav-you:hover { filter: brightness(0.97); }
.nav-level { position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: var(--r-full);
             border: 2px solid var(--page); background: var(--level); color: #fff; font: 700 11px/16px var(--body); text-align: center; }
.nav-links .nav-staff { opacity: 0.75; }
.nav-links a svg { display: none; }
.icon-disc { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0 !important; border-radius: 50%; background: var(--tint) !important; color: var(--ink-soft); }
/* The bug button: tomato, a little apart from the person's picture, and as large as it on a desktop. */
.nav-links #bug-button { color: var(--primary); margin-left: 12px; width: 48px; height: 48px; }
.nav-links #bug-button svg { width: 26px; height: 26px; }
/* Narrower windows and tablets: the sizes in between, so the links still fit beside the brand. */
@media (max-width: 1000px) {
    .nav-brand img.bull { width: 72px; height: 72px; } .nav-brand img.wordmark { height: 44px; } .nav-brand small { font-size: 16px; line-height: 20px; }
    .nav-links a, .nav-links button { font-size: 13px; line-height: 18px; }
    .nav-links a.nav-you .avatar { width: 36px; height: 36px; }
    .nav-links #bug-button { width: 36px; height: 36px; margin-left: 8px; } .nav-links #bug-button svg { width: 20px; height: 20px; }
}
/* A phone: the links are symbols, the same ones as the app's tabs, in one row beside the brand; the words stay for screen readers.
   Staff have more of them, and theirs go on a row of their own under the brand, at the right. */
@media (max-width: 560px) {
    .nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; padding-inline: 12px; }
    .nav-brand { gap: 6px; }
    .nav-brand img.bull { width: 44px; height: 44px; } .nav-brand img.wordmark { height: 30px; } .nav-brand small { font-size: 11px; line-height: 14px; }
    .nav-links { gap: 2px; }
    .nav-links a:not(.nav-you) { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; }
    .nav-links a svg { display: block; }
    .nav-links a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .nav-links a.nav-join { margin-left: 2px; padding: 0; }
    .nav-links #bug-button { margin-left: 4px; }
}

.container { max-width: 720px; margin: 0 auto; padding: 16px; }

/* Surfaces, buttons, fields: the app's components. */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 24px; margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: var(--r-full);
       border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 700 17px/22px var(--display); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary, .btn-vegan { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-quiet, .btn-skip { background: transparent; border-color: transparent; }
.btn-danger { color: var(--not-vegan); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }

.form-group { display: grid; gap: 4px; margin-bottom: 16px; }
.form-group label { font: 700 13px/18px var(--body); }
.form-group input { height: 50px; padding: 0 24px; border-radius: var(--r-full); border: 1.5px solid var(--rule); background: var(--surface); outline: none; }
.form-group input:focus { border-color: var(--ink); }
.form-group small { font: 400 12px/16px var(--body); color: var(--ink-soft); }

.tag { display: inline-block; font: 700 13px/18px var(--body); padding: 4px 12px; border-radius: var(--r-full); background: var(--tint); color: var(--on-tint); }
.tag-leaf { background: var(--vegan-soft); color: var(--vegan); }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: var(--r-full);
        border: 1px solid var(--chip-line); background: var(--chip); color: var(--on-chip); font: 700 13px/18px var(--body); cursor: default; }
button.chip { cursor: pointer; }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-floating { border-color: transparent; box-shadow: var(--float); }

.alert { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-weight: 600; }
.alert-success { background: var(--vegan-soft); color: var(--vegan); }
.alert-error { background: var(--not-vegan-soft); color: var(--not-vegan); }

.progress { height: 8px; border-radius: var(--r-full); background: var(--rule); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: var(--r-full); background: var(--primary); }

/* A person's picture: always round. */
.avatar { display: block; border-radius: 50%; object-fit: cover; background: var(--tint); flex: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box { padding: 16px; background: var(--surface); border-radius: var(--r-lg); }
.card .stat-box { background: var(--page); }
.stat-number { font: 700 40px/44px var(--display); color: var(--primary); font-variant-numeric: tabular-nums; }
.stat-label { font: 700 13px/18px var(--body); color: var(--ink-soft); margin-top: 4px; }

/* Sheets: Mad Bull asking its own question. Always in Mad Bull's look, even over a restaurant's menu. */
dialog.sheet { margin: auto; border: 0; border-radius: var(--r-lg); padding: 24px; width: min(420px, calc(100vw - 32px));
               background: #FFFFFF; color: #2B1D14; box-shadow: var(--float); font: 400 15px/21px var(--body); }
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet .welcome-image { display: block; width: 100%; height: auto; }
dialog.sheet h2 { font: 700 21px/26px var(--display); margin-bottom: 8px; }
dialog.sheet p { color: #6B645E; }
dialog.sheet textarea { display: block; width: 100%; min-height: 88px; margin-top: 8px; padding: 12px; border-radius: var(--r-md); border: 1.5px solid #E3E2DE; background: #F4F4F2; outline: none; resize: vertical; }
dialog.sheet textarea:focus { border-color: #2B1D14; }
dialog.sheet .sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog.sheet .welcome-actions { align-items: center; justify-content: space-between; }
.welcome-actions .btn { flex: none; }
.welcome-credit { min-width: 0; }
.welcome-brand { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; contain: inline-size; }
.welcome-brand .bull { width: 36px; height: 36px; object-fit: contain; }
.welcome-brand .wordmark { width: calc(100% - 40px); height: auto; }
.welcome-credit p { font: 400 12px/16px var(--body); }
/* At this size the Figtree byline matches the width of the 12px line below it. */
.welcome-byline { font-size: 14.53px; line-height: 18px; }
.welcome-byline a { color: inherit; text-decoration: underline; }
@media (max-width: 375px) {
    dialog#map-welcome { padding-inline: 16px; }
    .welcome-actions .btn { padding-inline: 12px; }
}
/* Three choices, one under the other, the one we hope for on top. */
dialog.sheet .sheet-actions-stack { flex-direction: column; align-items: stretch; }
dialog.sheet .sheet-actions-stack .btn { text-decoration: none; }
dialog.sheet .btn { background: #F4F4F2; border-color: #E3E2DE; color: #2B1D14; }
dialog.sheet .btn-primary { background: #D9472B; border-color: #D9472B; color: #fff; }
dialog.sheet .btn-quiet { background: transparent; border-color: transparent; }
dialog.sheet .btn-danger { color: #A3271F; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }

/* Sign-in pages: "or", then Google's own button, centred under ours. */
/* Sections of a sign-up or sign-in page are set apart by a thin rule; "or" sits in the middle of one. */
.have-account { display: grid; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); text-align: center; }
.have-account .btn { text-decoration: none; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.google-button { display: flex; justify-content: center; min-height: 44px; }

/* The bug-report dialog (base.html). The trap field is for scripts, not people. */
button.icon-disc { border: 0; cursor: pointer; }
dialog.sheet .bug-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
dialog.sheet [hidden] { display: none; }
dialog.sheet .menu-upload-previews {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    max-height: 45dvh; overflow-y: auto; margin-top: 12px;
}
dialog.sheet .menu-upload-previews:empty { display: none; }
dialog.sheet .menu-upload-previews > div { min-width: 0; text-align: center; }
dialog.sheet .menu-upload-previews img {
    display: block; width: 100%; aspect-ratio: 1; object-fit: contain;
    background: #F4F4F2; border-radius: var(--r-md);
}
dialog.sheet .menu-upload-previews .btn { min-height: 44px; padding-inline: 8px; }

/* Long text pages (privacy) and the small link on account pages. */
.prose { max-width: 640px; margin: 32px auto; }
.prose h2 { font: 700 21px/26px var(--display); margin: 24px 0 8px; }
.prose p, .prose ul { margin-bottom: 12px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose a { text-decoration: underline; }
.site-footer { margin: 48px 0 24px; text-align: center; }
.site-footer a { color: var(--ink-soft); }

/* Something the person must not miss, that is not an error: a soft box in the tint. */
.notice { padding: 12px 16px; border-radius: var(--r-md); background: var(--tint); color: var(--ink); }

/* For a control that is there for the keyboard and screen readers but not drawn (a file input behind its label). */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
