:root {
  /* ===================================================================
     EXPERIMENT — "Chef-to-Table" light theme.
     Warm rust primary on cream/pale-blue surfaces, Montserrat. Legible in
     daylight (the neon-noir theme washed out outdoors). Tokens keep their old
     names so existing rules flip in place; values are the light palette.
     =================================================================== */
  --accent:    #a43700;   /* primary (rust) */
  --accent-hi: #cd4700;   /* primary-container (brighter rust) */
  --secondary: #924700;   /* tertiary (warm brown-orange) */
  --marker:    #a43700;   /* map markers = rust */
  --panel:     #ffffff;   /* panels / sheets / controls */
  --map-bg:    #e3f0f8;   /* light map background */
  --text-2:    #5a4138;   /* secondary text (on-surface-variant) */

  --bg: #f4faff;          /* app background (cream-blue) */
  --surface: #ffffff;     /* cards / sheets */
  --surface-2: #e9f6fd;   /* subtle raised surface */
  --ink: #111d23;         /* primary text (on-background) */
  --muted: #5a4138;       /* secondary text */
  --outline: #8f7066;     /* borders / hairlines */
  /* Legacy aliases repointed to warm tones so old rules stay coherent. */
  --gold: var(--accent);
  --gold-soft: #cd4700;
  --cyan: #7a5a4e;        /* was neon cyan — now a warm neutral for dots/lines */
  --cyan-soft: #a43700;
  --coral: #ba1a1a;       /* error */
  --accept: #2e7d32;
  --reject: #ba1a1a;
  --flag: #b75b00;
}
* { box-sizing: border-box; }
/* --- Splash / loading screen (covers the bootstrap gap) --- */
.splash {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: flex-end; justify-content: center;
  /* Hero art fills the screen; the constellation sits in the upper-middle and the
     bottom is clear for the logo + rotating tips. */
  background: var(--bg) url("splash.jpg") no-repeat center / cover;
  padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 8vh);
  transition: opacity .45s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; max-width: 460px; }
.splash-art { display: none; } /* the whole background IS the art now */
.splash-logo { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 28px; color: var(--accent); letter-spacing: .01em; text-shadow: 0 1px 8px rgba(244,250,255,.9); }
.splash-tip {
  font-size: 15px; line-height: 1.5; color: var(--muted); min-height: 3em; font-weight: 500;
  text-shadow: 0 1px 6px rgba(244,250,255,.9);
  transition: opacity .3s ease;
}
.splash-tip.fade { opacity: 0; }
.splash-ver {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); opacity: .7;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(244,250,255,.9);
}
/* [hidden] must win over .modal/.sheet display rules */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "Montserrat", -apple-system, system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none; /* kill pull-to-refresh during swipe gestures */
}
.material-symbols-outlined { font-size: 26px; line-height: 1; }

/* --- Cosmic overlay: OFF in the light theme (the nebula only reads on black) --- */
#stars { display: none; }
#stars.__off { position: fixed; inset: 0; z-index: 5; pointer-events: none;
  mix-blend-mode: screen; opacity: .65; background:
  radial-gradient(120% 80% at 28% 18%, rgba(0, 240, 255, .16), transparent 55%),
  radial-gradient(120% 90% at 74% 62%, rgba(182, 0, 248, .20), transparent 55%),
  radial-gradient(100% 70% at 52% 96%, rgba(164, 55, 0, .10), transparent 50%);
}
#stars::before, #stars::after {
  content: ""; position: absolute; inset: -50%; background-repeat: repeat;
  animation: twinkle 7s ease-in-out infinite alternate;
}
#stars::before {
  background-image:
    radial-gradient(1px 1px at 30px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 90px, rgba(255,255,255,.75), transparent),
    radial-gradient(1.4px 1.4px at 80px 160px, var(--cyan-soft), transparent),
    radial-gradient(1px 1px at 190px 60px, #fff, transparent),
    radial-gradient(1.4px 1.4px at 210px 200px, var(--gold-soft), transparent),
    radial-gradient(1px 1px at 250px 120px, rgba(255,255,255,.6), transparent);
  background-size: 280px 280px; opacity: .7;
}
#stars::after {
  background-image:
    radial-gradient(1.6px 1.6px at 60px 50px, #fff, transparent),
    radial-gradient(2px 2px at 180px 140px, var(--gold-soft), transparent),
    radial-gradient(1.6px 1.6px at 320px 220px, var(--cyan-soft), transparent),
    radial-gradient(1.6px 1.6px at 400px 90px, #fff, transparent);
  background-size: 460px 460px; opacity: .55; animation-duration: 11s;
}
@keyframes twinkle { 0% { opacity: .35; } 100% { opacity: .8; } }

/* --- Live map (light basemap) --- */
#map { position: fixed; inset: 0; z-index: 1; background: var(--map-bg); }
.leaflet-container { background: var(--map-bg); }
/* Light tiles need no lift; a touch of warmth to sit under the cream UI */
.leaflet-tile { filter: saturate(1.02); }

/* --- Star markers (chefs) --- */
.sn-star { border-radius: 50%; animation: star-pulse 3s ease-in-out infinite alternate; }
.sn-star.cyan { background: var(--cyan-soft); color: var(--cyan-soft); box-shadow: 0 0 12px rgba(164, 55, 0, .7); }
.sn-star.gold { background: var(--gold-soft); color: var(--gold-soft); box-shadow: 0 0 14px rgba(164, 55, 0, .85); }
.sn-star.coral { background: var(--coral); color: var(--coral); box-shadow: 0 0 12px rgba(255, 180, 171, .7); }
.sn-star.me { background: var(--gold); color: var(--gold); box-shadow: 0 0 20px rgba(164, 55, 0, .95); }
@keyframes star-pulse {
  0% { transform: scale(.9); filter: drop-shadow(0 0 6px currentColor); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 16px currentColor); }
}
/* Expanding rings for own star / authors */
.sn-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid currentColor; animation: pulse-ring 4s cubic-bezier(.215,.61,.355,1) infinite; }
.sn-ring.d { animation-delay: 1.2s; }
/* "Table" center node — the shared point stars radiate from (module 07 §6) */
.sn-table-center { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px rgba(17,29,35,.35); }
/* Dashed leader from a fanned "table" member back to the shared point. */
/* A fanned "table" member drops its own coordinate dot — the shared centre dot owns it. */
.sn-av-wrap.fanned .sn-av-dot { display: none; }
@keyframes pulse-ring { 0% { transform: scale(.8); opacity: .6; } 80%, 100% { transform: scale(3.4); opacity: 0; } }

/* Constellation = thin SOLID neon lines (asterism). NO stroke-dash (it made short
   map lines vanish for half the cycle). Gentle opacity "breathe" for life — it
   never reaches 0, so the lines are always visible. */
.const-line {
  filter: drop-shadow(0 0 2px var(--cyan-soft));  /* thin hairline + subtle halo */
  animation: const-breathe 4s ease-in-out infinite alternate;
}
@keyframes const-breathe { from { opacity: .6; } to { opacity: 1; } }
.const-label { display: inline-block; transform: translate(-50%, -120%); white-space: nowrap; color: var(--accent); font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(255,255,255,.95), 0 0 6px #fff, 0 0 6px #fff; pointer-events: auto; cursor: pointer; }
.const-label:hover { text-decoration: underline; }

/* Reach circle (long-press a cook) — a glowing brightness→radius ring. */
.reach-ring { filter: drop-shadow(0 0 6px currentColor); animation: reach-breathe 3s ease-in-out infinite alternate; }
@keyframes reach-breathe { from { opacity: .7; } to { opacity: 1; } }
.reach-label {
  display: inline-block; transform: translate(-50%, -160%); white-space: nowrap;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); color: var(--accent); font-weight: 600;
  font-family: "Montserrat", sans-serif; font-size: 12px;
  border: 1px solid var(--outline); box-shadow: 0 2px 10px rgba(17,29,35,.18);
}
.const-popup .leaflet-popup-content-wrapper, .leaflet-popup-content-wrapper { background: var(--surface); color: var(--ink); border: 1px solid var(--outline); box-shadow: 0 8px 24px rgba(164,55,0,.15); }
.const-popup .leaflet-popup-tip, .leaflet-popup-tip { background: var(--surface); }
.popup-bell { margin-top: 8px; padding: 7px 12px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
/* Dish photo in a star popup — the "what's cooking" payoff. */
.popup-photo { display: block; width: 220px; max-width: 60vw; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin: 0 0 8px; background: var(--surface-2); }
.popup-dishes { display: flex; gap: 8px; overflow-x: auto; margin-top: 6px; max-width: 60vw; }
.popup-dish { margin: 0; flex: 0 0 auto; }
.popup-dish .popup-photo { width: 140px; margin-bottom: 4px; }
.popup-dish figcaption { font-size: 12px; color: var(--ink); text-align: center; max-width: 140px; }

/* --- Toast / banner --- */
.toast {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 2500; background: rgba(255, 255, 255, .92); color: var(--ink); border: 1px solid rgba(255,255,255,.1);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; max-width: 88vw; text-align: center;
  font-family: "Montserrat", sans-serif; backdrop-filter: blur(8px);
}
.toast.err { color: var(--coral); }
.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1400; text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  font-size: 12px; color: var(--gold-soft);
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px);
  border-bottom: .5px solid rgba(164, 55, 0, .25);
  width: 100%; cursor: pointer; font-family: inherit;
}
.banner u { text-underline-offset: 2px; }
/* Key-expiry warning banner: warm alert strip, admin-only. */
.banner.keywarn { color: #fff; background: var(--accent); border-bottom-color: var(--accent-hi); font-weight: 600; font-size: 13px; }

/* Sign-in modal (leave demo) */
.signin-body { text-align: center; padding: 6px 6px 4px; }
.signin-emoji { font-size: 34px; color: var(--gold); text-shadow: 0 0 18px rgba(164, 55, 0,.6); }
.signin-title { font-family: "Montserrat", sans-serif; font-size: 22px; margin: 8px 0 6px; color: var(--ink); }
.signin-text { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 auto 16px; max-width: 320px; }
.gsi-button { display: flex; justify-content: center; min-height: 44px; }
.signin-msg { margin-top: 10px; font-size: 13px; color: var(--cyan-soft); min-height: 16px; }

/* --- Bottom nav --- */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 24px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(24px);
  border-top: .5px solid var(--outline); border-radius: 28px 28px 0 0;
  box-shadow: 0 -4px 20px rgba(164, 55, 0, .08);
}
.nav-btn {
  width: 60px; height: 60px; border: none; background: transparent; cursor: pointer;
  color: var(--muted); opacity: .65; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, opacity .2s, color .2s;
}
.nav-btn:active { transform: scale(1.12); }
.nav-btn.active { opacity: 1; color: var(--gold-soft); }
.nav-cam {
  width: 66px; height: 66px; border-radius: 50%; border: none; cursor: pointer;
  position: relative; top: -16px;
  background: var(--gold); color: #ffffff;
  box-shadow: 0 0 24px rgba(164, 55, 0, .6); display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, opacity .2s;
}
.nav-cam .material-symbols-outlined { font-size: 32px; font-variation-settings: 'FILL' 1; }
.nav-cam:active { transform: scale(1.08); }
.nav-cam:disabled { opacity: .5; }

/* --- Camera modal --- */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 14px; backdrop-filter: blur(4px); }
.modal-card { position: relative; width: 100%; max-width: 460px; max-height: 90dvh; overflow-y: auto; background: var(--surface); border: .5px solid rgba(164, 55, 0,.2); border-radius: 20px; padding: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .7); }
.done-btn { margin-top: 14px; width: 100%; padding: 14px; font-size: 16px; font-weight: 700; font-family: "Montserrat", sans-serif; color: #ffffff; background: var(--gold); border: none; border-radius: 14px; cursor: pointer; }
.modal-close, .sheet-close { background: transparent; border: none; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; }
.modal-close { position: absolute; top: 8px; right: 10px; z-index: 2; }
.camera-wrap { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; background: #000; }
video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; font-size: 12px; color: #cfe; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
/* The live viewfinder shows only the CENTRE (zoomed in) — what becomes the dish
   photo. The full sensor frame is wider than this and is captured silently for
   authenticity analysis (a re-shot screen's bezel sits in the unseen margin).
   Kept invisible on purpose: revealing a guide would tell a spoofer to fill it. */
.camera-wrap video { transform: scale(1.176); transform-origin: center center; } /* = 1/MEAL_CROP (0.85) */
.shoot { margin-top: 14px; width: 100%; padding: 16px; font-size: 17px; font-weight: 700; font-family: "Montserrat", sans-serif; color: #ffffff; background: var(--gold); border: none; border-radius: 14px; cursor: pointer; }
.shoot:active { transform: scale(.98); }
.shoot:disabled { opacity: .4; }
/* Frozen still shown over the live view while the user decides. */
.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 1; }
/* Confirm bar: explicit "use this photo?" before anything is sent. */
.confirm-bar { margin-top: 14px; }
.confirm-q { text-align: center; font-size: 14px; color: var(--gold-soft); font-family: "Montserrat", sans-serif; letter-spacing: .04em; margin-bottom: 10px; }
.confirm-actions { display: flex; gap: 10px; }
.btn-use, .btn-retake { flex: 1; padding: 16px; font-size: 16px; font-weight: 700; font-family: "Montserrat", sans-serif; border: none; border-radius: 14px; cursor: pointer; }
.btn-use { color: #ffffff; background: var(--gold); }
.btn-retake { color: var(--cyan-soft); background: rgba(164, 55, 0, .1); border: 1px solid rgba(164, 55, 0, .35); }
.btn-use:active, .btn-retake:active { transform: scale(.98); }

.result { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
/* When a focused field is scrolled up above the keyboard, leave a little gap on top. */
.modal-card input, .modal-card textarea, .sheet input, .sheet textarea { scroll-margin-top: 16px; }
/* Recognition progress steps (advance on a timer until Sonnet replies). */
@keyframes rec-spin { to { transform: rotate(360deg); } }
.rec-steps { display: flex; flex-direction: column; gap: 10px; padding: 6px 4px; }
.rec-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); transition: color .2s; }
.rec-step.active { color: var(--ink); font-weight: 600; }
.rec-step.done { color: var(--accent); }
.rec-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--outline); flex: none; position: relative; box-sizing: border-box; }
.rec-step.active .rec-dot { border-color: rgba(164, 55, 0, .22); border-top-color: var(--accent); animation: rec-spin .8s linear infinite; }
.rec-step.done .rec-dot { background: var(--accent); border-color: var(--accent); }
.rec-step.done .rec-dot::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.result .big { font-size: 18px; font-weight: 700; font-family: "Montserrat", sans-serif; }
.result.accepted { border-left: 4px solid var(--accept); }
.result.flagged { border-left: 4px solid var(--flag); }
.result.rejected { border-left: 4px solid var(--reject); }
.tag { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #2a2f3a; color: var(--muted); margin: 4px 4px 0 0; font-family: "Montserrat", sans-serif; }
.correct { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.correct input { flex: 1; min-width: 160px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--outline); background: #fff; color: var(--ink); font-size: 13px; }
.correct button { padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; background: #fff; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; }
.correct button:active { transform: scale(.96); }
.correct #correct-msg, .correct #recipe-msg { flex-basis: 100%; font-size: 12px; color: var(--muted); }
#recipe-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
#recipe-form input, #recipe-form textarea { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--outline); background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
#recipe-form textarea { min-height: 72px; resize: vertical; }
#recipe-form #recipe-submit { padding: 11px; border: none; border-radius: 10px; background: var(--gold-soft); color: #ffffff; font-weight: 700; font-family: "Montserrat", sans-serif; cursor: pointer; }

/* --- Bottom sheets --- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(20px);
  border-radius: 22px 22px 0 0; border-top: .5px solid rgba(164, 55, 0, .25);
  padding: 16px 18px calc(env(safe-area-inset-bottom, 0px) + 96px);
  max-height: 64vh; overflow: auto; box-shadow: 0 -8px 30px rgba(0, 0, 0, .6);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-family: "Montserrat", sans-serif; font-size: 16px; font-weight: 600; color: var(--gold-soft); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 9px 11px; background: rgba(255,255,255,.04); border-radius: 12px; }
.feed .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; box-shadow: 0 0 8px var(--gold); }
.feed .meta { color: var(--muted); font-size: 12px; margin-left: auto; font-family: "Montserrat", sans-serif; }

/* --- "Что приготовить" — lively suggestion cards --- */
.rec-lead { background: transparent !important; padding: 2px 2px 6px !important; color: var(--muted); font-size: 13px; }
.rec {
  flex-direction: column; align-items: stretch !important; gap: 0 !important; padding: 12px !important;
  background: var(--surface) !important; border: 1px solid rgba(164,55,0,.14);
  box-shadow: 0 2px 10px rgba(17,29,35,.06); position: relative; overflow: hidden;
}
.rec-top { display: flex; align-items: center; gap: 12px; }
.rec-thumbs { display: flex; gap: 6px; margin-top: 10px; }
.rec-thumb {
  flex: 1 1 0; min-width: 0; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 9px; cursor: pointer; background: var(--surface-2);
  border: 1px solid rgba(164,55,0,.12); transition: transform .12s ease;
}
.rec-thumb:active { transform: scale(.95); }
.rec::before { /* a soft accent spine on the left */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rec-c, var(--accent));
}
.rec-ic {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--rec-c, var(--accent)) 14%, #fff);
  color: var(--rec-c, var(--accent));
}
.rec-ic .material-symbols-outlined { font-size: 24px; font-variation-settings: 'FILL' 1; }
.rec-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-title { font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.2; }
.rec-sub { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.rec-kind {
  align-self: flex-start; margin-top: 3px; font-size: 10px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--rec-c, var(--accent));
  background: color-mix(in srgb, var(--rec-c, var(--accent)) 12%, transparent);
  padding: 2px 7px; border-radius: 999px; font-weight: 600;
}
.rec-reward {
  flex: none; margin-left: auto; align-self: center;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--rec-c, var(--accent));
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--rec-c, var(--accent)) 40%, transparent);
}
.rec-dish   { --rec-c: #a43700; }
.rec-cuisine{ --rec-c: #b75b00; }
.rec-const  { --rec-c: #cd4700; }
.rec-empty { flex-direction: column; align-items: center !important; text-align: center; gap: 8px !important; padding: 22px 14px !important; color: var(--muted); background: transparent !important; }
.rec-empty .material-symbols-outlined { font-size: 34px; color: var(--accent); opacity: .7; }
.rec-group { margin-bottom: 12px; } .rec-group b { font-size: 13px; color: var(--gold-soft); font-family: "Montserrat", sans-serif; }

/* --- Avatar star markers (a face over the point — the "hvástovство") --- */
/* A circular avatar with a colored ring and a small cyan anchor-dot beneath,
   so the dot sits on the real (coarsened) coordinate while the face floats above. */
.sn-av-wrap { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: opacity .25s ease, filter .25s ease; }
/* Focus spotlight: non-members of the tapped constellation fade back. */
.sn-av-wrap.dimmed { opacity: .16; filter: grayscale(.55); }
.sn-av {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; /* center initials */
  background-size: cover; background-position: center; background-color: var(--surface-2);
  border: 3px solid #fff; box-shadow: 0 4px 12px rgba(17, 29, 35, .28);
}
.sn-av.me   { border-color: var(--accent);  box-shadow: 0 4px 14px rgba(164, 55, 0, .45); }
.sn-av.gold { border-color: var(--accent);  box-shadow: 0 4px 12px rgba(164, 55, 0, .35); }
.sn-av.cyan { border-color: #fff;           box-shadow: 0 4px 12px rgba(17, 29, 35, .28); }
.sn-av-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 5px;
  background: var(--accent); box-shadow: 0 1px 4px rgba(17, 29, 35, .35);
}
.resto-av-btn { width: 100%; margin: 8px 0 0; font-size: 13px; }

/* Same-point restaurant prompt in the capture result. */
.resto-prompt { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid rgba(164,55,0,.2); font-size: 14px; color: var(--ink); text-align: left; }
.resto-actions { display: flex; gap: 8px; margin-top: 10px; }
.resto-actions button { flex: 1; }
#resto-msg { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Restaurants = stationary cooks → SQUARE markers (rounded corners, not circles). */
.sn-av.resto { border-radius: 22%; }
.sn-av.resto.initials .av-ini { font-weight: 700; }
.sn-av-wrap.resto .sn-av-dot { border-radius: 3px; } /* square anchor too */

/* --- Profile chip (top-left) --- */
.profile-btn {
  position: fixed; z-index: 1400;
  top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px;
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
}
.profile-av {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: rgba(255, 255, 255, .82); backdrop-filter: blur(8px);
  border: 2px solid rgba(164, 55, 0, .55); color: var(--gold-soft);
  box-shadow: 0 0 14px rgba(0, 0, 0, .5);
}
.profile-av .material-symbols-outlined { font-size: 24px; }

/* --- Settings sheet --- */
.settings-body { display: flex; flex-direction: column; gap: 12px; }
.settings-av-block { display: flex; align-items: center; gap: 14px; }
.settings-av {
  display: flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%; flex: none;
  background-size: cover; background-position: center; background-color: var(--surface-2);
  border: 2px solid var(--gold-soft); color: var(--muted);
}
.settings-av .material-symbols-outlined { font-size: 34px; }
.settings-handle { font-family: "Montserrat", sans-serif; font-size: 17px; font-weight: 600; color: var(--ink); }
.settings-btn {
  padding: 13px; border-radius: 12px; border: none; cursor: pointer;
  font-family: "Montserrat", sans-serif; font-size: 15px; font-weight: 600;
  color: #ffffff; background: var(--gold);
}
.settings-btn.ghost { color: var(--cyan-soft); background: rgba(164, 55, 0, .1); border: 1px solid rgba(164, 55, 0, .35); }
.settings-btn.danger { color: #b3261e; background: rgba(179, 38, 30, .08); border: 1px solid rgba(179, 38, 30, .4); }
.settings-btn.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.settings-btn:active { transform: scale(.98); }
.settings-msg { font-size: 13px; color: var(--cyan-soft); min-height: 16px; }

/* GDPR block in Settings */
.privacy-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--outline); display: flex; flex-direction: column; gap: 8px; }
.privacy-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.privacy-note { margin: 0 0 4px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.privacy-note b { color: var(--ink); }

/* Home-mask toggle + decoy picker */
.mask-toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.mask-toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.mask-card { width: min(560px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.mask-pick-head { font-weight: 700; font-size: 16px; color: var(--ink); }
.mask-pick-note { font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.mask-map { height: min(46vh, 380px); border-radius: 12px; overflow: hidden; border: 1px solid var(--outline); }
.mask-dist { min-height: 18px; font-size: 13px; font-weight: 600; color: var(--accent); text-align: center; }
.name-edit { display: flex; gap: 8px; }
.name-edit .name-input {
  flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--outline);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.name-edit .settings-btn { flex: none; }
.settings-bright { font-family: "Montserrat", sans-serif; }
.meta { color: var(--muted); font-size: 12px; }

/* --- Gallery (all of a cook's dishes) --- */
.gallery-card { max-width: 520px; }
.gallery-head { display: flex; align-items: center; gap: 12px; margin: 2px 28px 14px 0; }
.gallery-av {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background-size: cover; background-position: center; background-color: var(--surface-2);
  border: 2px solid var(--gold-soft); color: var(--muted);
}
.gallery-av .material-symbols-outlined { font-size: 26px; }
.gallery-handle { font-family: "Montserrat", sans-serif; font-size: 18px; font-weight: 600; color: var(--ink); }
/* Constellation card */
.const-badge { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.const-badge .material-symbols-outlined { font-size: 26px; }
.const-stars { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; }
.const-stars-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--secondary); margin-bottom: 4px; }
.const-star {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px;
  border: none; background: none; cursor: pointer; border-radius: 8px; text-align: left;
}
.const-star:active { background: var(--surface-2); }
.const-star .cs-bayer { width: 18px; color: var(--muted); font-weight: 700; }
.const-star .cs-name { flex: 1; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.const-star .cs-b { color: var(--secondary); font-weight: 600; font-size: 13px; }
/* Overlap chooser: pick which asterism when several cover the tap */
.const-choose { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.const-choose .cc-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 1px solid var(--outline); border-radius: 10px; background: #fff; cursor: pointer;
  font-family: "Montserrat", sans-serif; font-size: 14px; font-weight: 600; color: var(--ink);
  text-align: left;
}
.const-choose .cc-item:active { transform: scale(.97); }
.const-choose .cc-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.const-choose .cc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Follow bell in a cook's gallery header */
.gallery-bell {
  margin-left: auto; flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--outline); background: #fff; color: var(--secondary);
}
.gallery-bell .material-symbols-outlined { font-size: 22px; }
.gallery-bell.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.gallery-bell:active { transform: scale(.94); }
/* Notifications inbox list */
.notif-list { display: grid; gap: 8px; }
.notif-row {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--outline); border-radius: 12px; background: var(--surface);
}
.notif-row .notif-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.notif-row .notif-text { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); line-height: 1.35; }
.notif-row .notif-text b { font-weight: 700; }
.notif-row .notif-sub { color: var(--text-2); font-size: 12px; }
.notif-row .notif-open { flex: none; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--accent); background: #fff; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; }
.notif-row .notif-open:active { transform: scale(.96); }
.notif-row.tap { cursor: pointer; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-cell { position: relative; margin: 0; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #000; }
/* Dishes that put the cook in the active-mode asterism — ringed in its colour. */
.gallery-cell--hl { outline: 3px solid var(--hl); outline-offset: -3px; box-shadow: 0 0 0 1px var(--hl), 0 2px 10px color-mix(in srgb, var(--hl) 40%, transparent); }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-cell figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 5px;
  font-size: 11px; color: #fff; line-height: 1.2;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 0; }

/* Avatar lightbox — big, for recognition */
.avatar-zoom {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(244, 250, 255, .94); backdrop-filter: blur(8px);
  animation: zoom-in .18s ease-out;
}
@keyframes zoom-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.zoom-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; text-align: center; }
.zoom-av {
  width: min(72vw, 340px); height: min(72vw, 340px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center; background-color: var(--surface-2);
  border: 3px solid var(--accent); box-shadow: 0 8px 32px rgba(164, 55, 0, .25);
}
.zoom-av .av-ini { font-size: 33vw; }
@media (min-width: 480px) { .zoom-av .av-ini { font-size: 150px; } }
.zoom-av .material-symbols-outlined { font-size: 30vw; }
.zoom-name { font-family: "Montserrat", sans-serif; font-size: 26px; font-weight: 700; color: var(--ink); }
.zoom-sub { font-size: 14px; color: var(--text-2); font-family: "Montserrat", sans-serif; }
.zoom-motif {
  margin-top: 2px; padding: 5px 12px; border-radius: 999px;
  background: rgba(143, 112, 102, .1); border: 1px solid rgba(143, 112, 102, .28);
  color: var(--secondary); font-family: "Montserrat", sans-serif; font-size: 12px;
}

/* Per-dish shine badge: brightness (★) + decay meter (fill = freshness left) */
.dish-badge {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  display: flex; flex-direction: column; gap: 3px; padding: 4px 7px 5px;
  border-radius: 9px; background: rgba(11, 14, 20, .58); backdrop-filter: blur(3px);
}
.dish-badge.sameday {
  padding: 4px 8px; font-family: "Montserrat", sans-serif; font-weight: 600;
  font-size: 11px; line-height: 1; color: var(--text-2); white-space: nowrap;
}
.db-star { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 12px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.db-meter { position: relative; width: 44px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.db-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); box-shadow: 0 0 6px rgba(164, 55, 0, .55); }

/* Shine line inside the dish card */
.dish-shine { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; flex-wrap: wrap; }
.ds-star { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.ds-meter { position: relative; width: 90px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.ds-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); box-shadow: 0 0 8px rgba(164, 55, 0, .5); }
.ds-note { font-size: 12px; color: var(--text-2); font-family: "Montserrat", sans-serif; }
.ds-sameday { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 15px; color: var(--text-2); }

/* Dish classification (cuisine + vector-linked canonical dish + descriptors) */
.dish-class {
  margin: 4px 0 6px; padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06);
  display: flex; flex-direction: column; gap: 8px;
}
.dc-title { font-family: "Montserrat", sans-serif; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.dc-row { display: flex; align-items: baseline; gap: 10px; }
.dc-k { flex: none; min-width: 96px; font-size: 12px; color: var(--text-2); }
.dc-cuisine { font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 15px; color: var(--accent); text-transform: capitalize; }
.dc-v { font-size: 14px; color: var(--ink); }
.dc-v.dc-kcal { display: inline-flex; align-items: center; gap: 4px; color: #d2691e; font-weight: 600; }
.dc-v.dc-kcal .material-symbols-outlined { font-size: 16px; }
.dc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-tag {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(143, 112, 102, .1); color: var(--secondary);
  border: 1px solid rgba(143, 112, 102, .25); font-family: "Montserrat", sans-serif;
}
/* "Постное" (vegan) tag in the dish classification + chip on the gallery cell. */
.dc-tag.lenten { color: #2e7d32; background: rgba(46, 125, 50, .1); border-color: rgba(46, 125, 50, .35); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.dc-tag.lenten .material-symbols-outlined { font-size: 15px; }
.lenten-chip {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(46, 125, 50, .92); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.lenten-chip .material-symbols-outlined { font-size: 15px; }
/* Gallery filter row (постное toggle) */
.gallery-filters { display: flex; gap: 8px; margin: 0 0 10px; }
.gfilter {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, .4); background: #fff; color: #2e7d32; cursor: pointer;
  font-family: "Montserrat", sans-serif; font-size: 13px; font-weight: 600;
}
.gfilter .material-symbols-outlined { font-size: 17px; }
.gfilter.on { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.gfilter:active { transform: scale(.96); }

/* Secondary cuisines: accent-tinted to read as "same family as the primary". */
.dc-tag.alt {
  background: rgba(164, 55, 0, .1); color: var(--accent);
  border-color: rgba(164, 55, 0, .3); text-transform: capitalize;
}
/* Per-dish "ask for the recipe" control (a scroll, not a bell).
   Flat neon HUD: solid panel disc, single accent-colored flat-vector icon,
   glow OUTWARD only — no gradient, no bevel, no border. */
.gallery-recipe {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .9); /* --panel */
  color: var(--accent); cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(164, 55, 0, .45));
  transition: transform .12s ease, filter .2s ease;
}
.gallery-recipe svg { width: 18px; height: 18px; display: block; }
.gallery-recipe:active { transform: scale(.9); }
.gallery-recipe.done { color: var(--secondary); filter: drop-shadow(0 0 7px rgba(143, 112, 102, .5)); }
.gallery-recipe:disabled { cursor: default; }


.cc-cancel, .cc-del {
  padding: 8px 14px; border: none; border-radius: 10px; cursor: pointer;
  font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 13px;
}
.cc-cancel { background: rgba(255, 255, 255, .12); color: var(--ink); }
.cc-del { background: var(--coral); color: #3a0d09; }
.cc-cancel:active, .cc-del:active { transform: scale(.96); }

/* --- Dish card (long-press a dish on my wall) --- */
.dish-detail { display: flex; flex-direction: column; }
/* Swipe deck: the ghost neighbour is clipped to the deck; the current card
   (slide) follows the finger. Only transform is animated (compositor-only). */
.dish-deck { position: relative; overflow: hidden; touch-action: pan-y; }
.dish-slide { position: relative; transform-origin: center center; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Rotate-my-photo control, floating on the photo's top-right (own dishes only). */
.dish-rotate {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .9); color: var(--accent);
  box-shadow: 0 2px 8px rgba(17, 29, 35, .25); backdrop-filter: blur(4px);
}
.dish-rotate:active { transform: scale(.92); }
.dish-rotate:disabled { opacity: .5; }
.dish-rotate .material-symbols-outlined { font-size: 22px; }
.dish-ghost {
  position: absolute; top: 0; left: 0; width: 100%; pointer-events: none;
  transform-origin: center center;
}
.dish-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dish-back {
  margin: 0 0 0 -4px; padding: 4px;
  background: transparent; border: none; color: var(--text-2); cursor: pointer; line-height: 1;
}
.dish-nav {
  font-family: "Montserrat", sans-serif; font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
  /* Sit next to the back arrow, clear of the modal's close (×) at top-right. */
  margin-left: 2px;
}
.dish-photo {
  width: 100%; max-height: 46dvh; object-fit: cover;
  border-radius: 14px; background: #000; display: block;
}
.dish-name { font-family: "Montserrat", sans-serif; font-size: 20px; font-weight: 600; color: var(--ink); margin: 12px 0 4px; }
.dish-cookedby { font-size: 13px; color: var(--text-2); margin: -2px 0 6px; }

/* Attribution ("who cooked it") form */
.dish-attr {
  margin-top: 10px; padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07);
  display: flex; flex-direction: column; gap: 10px;
}
.dish-attr-q { font-family: "Montserrat", sans-serif; font-size: 14px; font-weight: 600; color: var(--ink); }
.dish-attr-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.attr-choice {
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid rgba(255, 255, 255, .18);
  color: var(--text-2); font-size: 13px; font-family: "Montserrat", sans-serif;
}
.attr-choice.sel { color: #ffffff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.attr-choice:active { transform: scale(.96); }
.dish-attr input {
  padding: 11px; border-radius: 10px; border: 1px solid var(--outline);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14px;
}
.dish-attr-actions { display: flex; gap: 8px; }
.dish-attr-actions .settings-btn { flex: 1; }
.dish-attr-actions .cc-cancel { flex: none; padding: 12px 16px; }
.dish-recipe { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dish-recipe-label { font-family: "Montserrat", sans-serif; font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.dish-recipe input, .dish-recipe textarea {
  padding: 11px; border-radius: 10px; border: 1px solid var(--outline);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14px;
}
.dish-recipe textarea { min-height: 110px; resize: vertical; }
.dish-delete {
  margin-top: 16px; padding: 12px; border: 1px solid rgba(255, 180, 171, .4);
  border-radius: 12px; background: transparent; color: var(--coral); cursor: pointer;
  font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 15px;
}
.dish-delete:active { transform: scale(.99); }
/* Centered confirm overlay — visible immediately, no scrolling to find it. */
#mask-off-confirm { z-index: 6000; } /* above the settings sheet */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px);
}
.confirm-dialog {
  width: 100%; max-width: 320px; padding: 22px 20px;
  background: var(--surface); border: 1px solid rgba(255, 180, 171, .3);
  border-radius: 16px; text-align: center; box-shadow: 0 16px 44px rgba(0, 0, 0, .7);
}
.dish-del-q { font-family: "Montserrat", sans-serif; font-size: 17px; font-weight: 600; color: var(--ink); }
.confirm-sub { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.dish-del-actions { display: flex; gap: 10px; margin-top: 18px; }
.dish-del-actions .cc-cancel, .dish-del-actions .cc-del { flex: 1; padding: 12px; }

/* --- Incoming recipe requests: HUD button (top-right) + badge --- */
.hud-btn {
  position: fixed; z-index: 1400;
  top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px;
  width: 46px; height: 46px; padding: 0; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .9); /* --panel */
  color: var(--accent); cursor: pointer;
  filter: drop-shadow(0 0 8px rgba(164, 55, 0, .4));
}
.hud-btn:active { transform: scale(.94); }
.hud-btn.stack2 { top: calc(env(safe-area-inset-top, 0px) + 66px); } /* second HUD button, below the first */
.hud-icon { display: flex; }
.hud-icon svg { width: 24px; height: 24px; display: block; }
.hud-icon .material-symbols-outlined { font-size: 24px; }
/* Admin constellation build-mode switcher (below the HUD buttons) */
.mode-btn {
  position: fixed; z-index: 1400;
  top: calc(env(safe-area-inset-top, 0px) + 120px); right: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 6px 12px; border: none; border-radius: 12px;
  background: rgba(255, 255, 255, .9); color: var(--secondary); cursor: pointer;
  font-family: "Montserrat", sans-serif; backdrop-filter: blur(8px);
  border: 1px solid rgba(143, 112, 102, .3);
}
.mode-btn .mode-k { font-size: 9px; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; }
.mode-btn .mode-v { font-size: 13px; font-weight: 600; }
.mode-btn:active { transform: scale(.96); }
.mode-btn:disabled { opacity: .5; }

.hud-badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px;
  padding: 0 5px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #ffffff;
  font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 11px;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 8px rgba(164, 55, 0, .55);
}

/* --- Requests sheet list --- */
.requests-list { display: grid; gap: 8px; }
.request-row {
  display: flex; align-items: center; gap: 12px; padding: 8px;
  background: rgba(255, 255, 255, .04); border-radius: 12px;
}
.request-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #000; flex: none; }
.request-info { flex: 1; min-width: 0; }
.request-dish { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-count { font-size: 12px; color: var(--text-2); font-family: "Montserrat", sans-serif; }
.request-give {
  flex: none; padding: 8px 12px; border: none; border-radius: 10px;
  background: var(--accent); color: #ffffff; cursor: pointer;
  font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 13px;
}
.request-give:active { transform: scale(.96); }

/* --- Recipe compose modal --- */
.compose-body { display: flex; flex-direction: column; gap: 10px; }
.compose-title { font-family: "Montserrat", sans-serif; font-size: 20px; margin: 2px 28px 0 0; color: var(--ink); }
.compose-dish { margin-bottom: 2px; }
.compose-body input, .compose-body textarea {
  padding: 11px; border-radius: 10px; border: 1px solid var(--outline);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14px;
}
.compose-body textarea { min-height: 96px; resize: vertical; }

/* --- Base avatar: initials on a colored background (shown until a photo is set) --- */
.initials { background-color: var(--av-bg) !important; background-image: none !important; }
.av-ini {
  /* Space Grotesk for the HUD look; system-ui last so Cyrillic never falls back
     to a mismatched face. Weight 600 (700 turns to mush on small disks). */
  font-family: "Space Grotesk", "Geist", system-ui, -apple-system, sans-serif;
  font-weight: 600; letter-spacing: .02em; line-height: 1; user-select: none;
  font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums;
  color: var(--av-ink, #fff);
  /* Halo as insurance — legible even if the label grazes the disk edge. */
  text-shadow: 0 0 2px var(--av-halo, rgba(0,0,0,.4)), 0 1px 1px var(--av-halo, rgba(0,0,0,.4));
}
.profile-av .av-ini { font-size: 16px; }
.settings-av .av-ini { font-size: 26px; }
.gallery-av  .av-ini { font-size: 19px; }
.sn-av .av-ini { font-size: 15px; } /* ~0.72·radius for a 40px map bubble */
