/* Toast & Taste admin - design system.
   The face of toast-and-taste.com: Montserrat (light for titles, bold for numbers),
   ink #393939 on #F9F9FB, brand blue #2816B9 with sky accents, pill buttons,
   soft blue-tinted shadows. Tokens first; phone rules at the bottom. */

:root {
  --blue: #2816B9;
  --blue-2: #3A2AD4;
  --blue-deep: #1A0E86;
  --sky: #A5BDFF;
  --sky-2: #7C9CFF;
  --blue-weak: rgba(40, 22, 185, .08);
  --blue-weak-2: rgba(40, 22, 185, .14);

  --bg: #F9F9FB;
  --surface: #FFFFFF;
  --surface-2: #F6F5FC;
  --ink: #393939;
  --ink-strong: #1E1B3A;
  --muted: #6E6E6E;
  --faint: #A3A1B5;
  --line: #ECEAF5;
  --field: #E2E0EF;

  --green: #12875A; --green-weak: rgba(18, 135, 90, .11);
  --red: #D23B4E;   --red-weak: rgba(210, 59, 78, .10);
  --amber: #C47A0A; --amber-weak: rgba(232, 168, 40, .17);
  --orange: #F0642D; --orange-weak: rgba(240, 100, 45, .12);
  --sky-weak: rgba(124, 156, 255, .2);
  --violet: #7A4FE0; --teal: #0E8F86;   /* lead stages «Общаемся», «Приняли» on the board */

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(26, 14, 134, .05);
  --sh-card: 0 1px 2px rgba(26, 14, 134, .04), 0 12px 32px -14px rgba(40, 22, 185, .18);
  --sh-hover: 0 2px 4px rgba(26, 14, 134, .05), 0 22px 44px -18px rgba(40, 22, 185, .32);
  --sh-btn: 0 10px 22px -10px rgba(40, 22, 185, .65);
  --sh-pop: 0 30px 80px -20px rgba(20, 12, 90, .45);

  --font: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --nav-w: 252px;
  --beta-h: 0px; /* height of the beta caution bar; every 100vh layout subtracts it */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { background:
  radial-gradient(900px 500px at 100% -8%, rgba(124, 156, 255, .18), transparent 60%),
  radial-gradient(700px 420px at 20% 108%, rgba(40, 22, 185, .07), transparent 60%),
  var(--bg); background-attachment: fixed; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-2); }
::selection { background: var(--sky); color: var(--ink-strong); }
:focus-visible { outline: 2px solid var(--sky-2); outline-offset: 2px; }
[hidden] { display: none !important; }
svg.ni, .icon-btn svg, .tabbar svg, .btn svg, .ic svg { width: 20px; height: 20px; flex: none; }

h1 { font-weight: 300; font-size: 34px; line-height: 1.1; letter-spacing: .01em; text-transform: uppercase; color: var(--ink-strong); margin: 2px 0 6px; }
h2 { font-weight: 400; font-size: 22px; color: var(--blue); margin: 28px 0 12px; letter-spacing: -.005em; }
h3 { font-weight: 600; font-size: 15px; color: var(--ink-strong); margin: 14px 0 8px; }
b, strong { font-weight: 600; }
code { font: 500 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 7px; border-radius: 8px; color: var(--blue-deep); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }

.beta-bar { display: none; background: repeating-linear-gradient(-45deg, #FFE37A, #FFE37A 14px, #FFD34D 14px, #FFD34D 28px); color: #3b2c00; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; height: var(--beta-h); line-height: var(--beta-h); padding: 0 3px; white-space: nowrap; overflow: hidden; position: relative; z-index: 60; }
/* Beta bar is switched off for now; to bring it back, uncomment both (--beta-h makes the menu and the inbox leave room for it):
   html[data-env="beta"] { --beta-h: 24px; } html[data-env="beta"] .beta-bar { display: block; } */
/* Desktop: the bar stays on top and the menu sits under it - otherwise both the menu and
   the inbox hang below the window until the page is scrolled. */
@media (min-width: 961px) { .beta-bar { position: sticky; top: 0; } }

.wordmark { font-weight: 300; font-size: 24px; letter-spacing: -.01em; color: var(--blue); white-space: nowrap; }
.wordmark i { font-style: italic; font-weight: 300; color: var(--sky-2); margin: 0 1px; }
.wordmark.big { font-size: 40px; text-align: center; margin-bottom: 4px; }

/* ---------------------------------------------------------------- login */
.login { position: relative; min-height: calc(100vh - var(--beta-h)); display: grid; place-items: center; padding: 20px; overflow: hidden;
  background: radial-gradient(1000px 600px at 80% 0%, #3A2AD4, transparent 70%), linear-gradient(160deg, #2816B9, #140A6E); }
.login-bg { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding-left: 6vw; pointer-events: none; }
.login-bg span { font-weight: 200; font-size: min(17vw, 180px); line-height: .98; text-transform: uppercase; color: rgba(255, 255, 255, .07); letter-spacing: .02em; }
.login-card { position: relative; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-radius: var(--r-lg); box-shadow: var(--sh-pop); padding: 36px 32px; width: min(400px, 100%); display: grid; gap: 14px; }

/* ---------------------------------------------------------------- shell + nav */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--beta-h)); align-content: start; }
.nav { position: sticky; top: var(--beta-h); height: calc(100vh - var(--beta-h)); display: flex; flex-direction: column; padding: 22px 14px 14px; color: #fff;
  background: radial-gradient(420px 300px at 0% 0%, rgba(124, 156, 255, .28), transparent 70%), linear-gradient(180deg, #2816B9 0%, #1D0F99 55%, #150A78 100%);
  box-shadow: 8px 0 40px -24px rgba(20, 10, 120, .6); z-index: 50; }
.nav-brand { color: #fff !important; padding: 2px 12px 18px; font-size: 25px; }
.nav-brand i { color: var(--sky); }
.nav-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; margin: 0 -6px; padding: 0 6px; }
.nav-group { margin-bottom: 14px; }
.nav-group:empty, .nav-group.empty { display: none; }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(165, 189, 255, .75); padding: 0 12px 5px; }
.nav a[data-view], .nav .linkish { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 14px; color: rgba(255, 255, 255, .84); font-weight: 400; font-size: 14px; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.nav a[data-view]:hover, .nav .linkish:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav a[data-view].on { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); }
.nav a[data-view].on .ni { color: var(--blue); }
.nav .ni { opacity: .9; }
.nav .badge { margin-left: auto; }
.badge { background: var(--orange); color: #fff; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; box-shadow: 0 4px 10px -4px rgba(240, 100, 45, .8); }
.nav-foot { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 10px; display: grid; gap: 2px; }
.nav .linkish { border: 0; background: none; width: 100%; cursor: pointer; font: inherit; color: rgba(255, 255, 255, .6); }
.me-chip .avatar, .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sky), var(--sky-2)); color: var(--blue-deep); font-size: 12px; font-weight: 700; flex: none; }

.main { padding: 32px 38px 90px; min-width: 0; max-width: 1480px; width: 100%; }
.m-top, .scrim, .tabbar { display: none; }

/* ---------------------------------------------------------------- page head */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.head > div:first-child > .muted { font-size: 14px; }
.head a.muted.small { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--blue); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid > *, label { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-card); padding: 20px 22px; min-width: 0; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
a.card { color: inherit; display: block; }
a.card:hover, .card.lift:hover { box-shadow: var(--sh-hover); transform: translateY(-2px); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.accent { border-left: 4px solid var(--orange); }

/* Stat tile: label + icon on top, the number on its own row at full width.
   The number scales with the tile (container query), so a narrow tile never
   puts the icon on top of it. */
.kpi { position: relative; overflow: hidden; container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l ic" "n n"; column-gap: 12px; align-content: start; }
/* the label always takes two lines of room: numbers in a row of cards stand on one line, short label or long */
.kpi .l { grid-area: l; align-self: center; min-height: 2.7em; display: flex; align-items: center; color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.kpi .ic { grid-area: ic; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-weak); color: var(--blue); }
.kpi .n { grid-area: n; margin-top: 10px; font-size: clamp(16px, 13cqi, 30px); font-weight: 700; letter-spacing: -.02em; color: var(--ink-strong); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 150px) { .kpi .ic { display: none; } }
.kpi.hero { background: radial-gradient(260px 180px at 100% 0%, rgba(165, 189, 255, .45), transparent 70%), linear-gradient(135deg, #3A2AD4, #2816B9 45%, #1A0E86); color: #fff; box-shadow: 0 20px 40px -18px rgba(40, 22, 185, .7); }
.kpi.hero .n, .kpi.hero .l { color: #fff; }
.kpi.hero .l { opacity: .78; }
.kpi.hero .ic { background: rgba(255, 255, 255, .16); color: #fff; }
/* "+35% vs € 2.550 за 1-3 нояб" under a dashboard KPI: its own row across the tile. */
.kpi .cmp { grid-column: 1 / -1; margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.kpi .cmp b { font-weight: 600; color: var(--ink-strong); }
.kpi .cmp b.up { color: var(--green); }
.kpi .cmp b.down { color: var(--red); }
.kpi.hero .cmp { color: rgba(255, 255, 255, .78); }
.kpi.hero .cmp b { color: #fff; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); }
/* Dashboard middle row: the chart and the "needs attention" list side by side;
   the chart grows to the list's height. Under 960px they stack, the list first. */
.dash-mid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.dash-chart { display: flex; flex-direction: column; }
.chart-box { position: relative; flex: 1; height: 240px; min-height: 240px; margin-top: 14px; }
.chart-box.is-empty { display: grid; place-items: center; }
.ghost-bars { position: absolute; inset: 22px 0 18px; display: flex; align-items: flex-end; gap: 6px; padding: 0 4px; border-bottom: 1px solid var(--line);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 55%, transparent 25%, #000 75%); mask-image: radial-gradient(ellipse 60% 70% at 50% 55%, transparent 25%, #000 75%); }
.ghost-bars i { flex: 1; max-width: 24px; margin: 0 auto; border-radius: 4px 4px 0 0; background: linear-gradient(to top, var(--blue-weak-2), var(--blue-weak)); }
.chart-empty { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 16px; }
.chart-empty .badge { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 6px; color: #fff;
  background: linear-gradient(135deg, var(--blue-2), var(--blue-deep)); box-shadow: 0 12px 26px -10px rgba(40, 22, 185, .55); }
.chart-empty .badge svg { width: 24px; height: 24px; }
.chart-empty b { font-size: 16px; font-weight: 600; color: var(--ink-strong); }
.chart-empty > span:last-child { font-size: 13px; color: var(--muted); }
.attn { padding: 18px 10px 10px; }
.attn h3 { margin: 0 12px 8px; }
.attn a { display: flex; align-items: center; gap: 11px; padding: 8px 10px 8px 12px; border-radius: 14px; color: var(--ink); font-size: 13.5px; line-height: 1.3; transition: background .15s; }
.attn a:hover { background: #F7F5FF; color: var(--ink); }
.attn .ai { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.attn .ai svg { width: 16px; height: 16px; }
.attn .warn .ai { background: var(--amber-weak); color: var(--amber); }
.attn .bad .ai { background: var(--red-weak); color: var(--red); }
.attn .tx { flex: 1; min-width: 0; }
.attn .tx b { font-weight: 700; color: var(--ink-strong); margin-right: 2px; }
.attn svg.go { flex: none; width: 16px; height: 16px; color: var(--faint); transition: transform .15s var(--ease), color .15s; }
.attn a:hover svg.go { color: var(--blue); transform: translateX(2px); }
.attn .calm { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--green); font-weight: 500; }
.attn .calm svg { width: 18px; height: 18px; }
@media (max-width: 960px) { .dash-mid { grid-template-columns: minmax(0, 1fr); } .attn { order: -1; } }
/* Upcoming event cards (dashboard): as many columns as fit, bars aligned at the bottom. */
.ev-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
a.card.ev { display: flex; flex-direction: column; gap: 14px; }
.ev-top { display: flex; gap: 14px; align-items: flex-start; }
.ev-date { flex: none; width: 52px; padding: 7px 0 6px; border-radius: 14px; background: var(--blue-weak); color: var(--blue); text-align: center; }
.ev-date b { display: block; font-size: 22px; font-weight: 700; line-height: 1; }
.ev-date span { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { font-weight: 600; color: var(--ink-strong); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.ev-foot { margin-top: auto; font-size: 12.5px; }
.ev-foot .row { justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
.ev-foot .row > span:first-child { white-space: nowrap; }
.ev-stats { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); white-space: nowrap; }
.ev-stats > span:not(.st) { display: inline-flex; align-items: center; gap: 4px; }
.ev-stats svg { width: 15px; height: 15px; }
@media (max-width: 640px) { .chart-box { height: 190px; min-height: 190px; } }


.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink); box-shadow: var(--sh-1); transition: border-color .2s, transform .2s var(--ease); }
a.chip:hover { border-color: var(--sky-2); transform: translateY(-1px); color: var(--ink); }
.chip b { font-weight: 700; }
.chip.warn { background: #FFF7E6; border-color: #F6DFAE; }
.chip.bad { background: #FFF0F2; border-color: #F6C3CB; }
.chip.good { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.sky { background: var(--blue-weak); border-color: transparent; color: var(--blue); }

.st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st.on_sale, .st.paid, .st.active, .st.valid, .st.confirmed, .st.sent, .st.done, .st.taken { background: var(--green-weak); color: var(--green); }
.st.sold_out, .st.planned, .st.offer { background: var(--blue-weak); color: var(--blue); }
.st.draft, .st.pending, .st.new, .st.invited, .st.waiting, .st.partially_refunded { background: var(--amber-weak); color: var(--amber); }
.st.cancelled, .st.refunded, .st.expired, .st.failed, .st.declined, .st.late, .st.blocked { background: var(--red-weak); color: var(--red); }

/* ---------------------------------------------------------------- controls */
.btn { appearance: none; border: 1px solid var(--field); background: var(--surface); color: var(--ink-strong); border-radius: var(--r-pill); padding: 10px 18px; font: 500 14px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s; }
.btn:hover { border-color: var(--sky-2); color: var(--blue); box-shadow: var(--sh-1); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #3A2AD4, #2816B9); border-color: transparent; color: #fff; box-shadow: var(--sh-btn); }
.btn.primary:hover { color: #fff; filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-weak); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.big { padding: 16px 22px; font-size: 16px; width: 100%; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn { border: 0; background: transparent; padding: 8px; cursor: pointer; color: var(--blue); border-radius: 12px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--blue-weak); }
.linkish { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px 12px; font: inherit; }

input, select, textarea { font: 400 14.5px var(--font); border: 1px solid var(--field); border-radius: 14px; padding: 11px 14px; background: #fff; color: var(--ink-strong); width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #CFCBEA; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky-2); box-shadow: 0 0 0 4px rgba(124, 156, 255, .22); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%232816B9' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); width: 17px; height: 17px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.form { display: grid; gap: 14px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.check input { width: auto; }

/* segmented tabs, like the pill nav of the site */
.tabs { position: relative; display: flex; gap: 4px; margin: 6px 0 20px; padding: 5px; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--sh-card); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
/* KPI cards right above the tabs (event card): same air above the bar as below it */
.grid + .tabs { margin-top: 20px; }
.tabs a { padding: 8px 16px; color: var(--muted); font-weight: 500; font-size: 13.5px; border-radius: var(--r-pill); white-space: nowrap; transition: background .25s var(--ease), color .2s; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--blue); background: var(--blue-weak); }
.tabs a.on { background: var(--blue); color: #fff; box-shadow: var(--sh-btn); }
.tabs a.on .chip { background: rgba(255, 255, 255, .2); color: #fff; border: 0; box-shadow: none; }
.tabs .chip { padding: 0 7px; font-size: 11px; }
/* Sliding pill: app.js puts one .tabs-ink under the active link and moves it, so switching
   a tab slides the pill instead of repainting the page. Without JS the a.on rule above works. */
.tabs a { position: relative; z-index: 1; }
.tabs-ink { position: absolute; left: 0; top: 0; z-index: 0; border-radius: var(--r-pill); background: var(--blue); box-shadow: var(--sh-btn); pointer-events: none;
  transition: transform .4s var(--ease), width .4s var(--ease), height .4s var(--ease); }
.tabs.has-ink a.on, .tabs.has-ink a.on:hover { background: transparent; box-shadow: none; color: #fff; }
.tabs.has-ink a { transition: background .25s var(--ease), color .35s var(--ease); }  /* label turns white as the pill arrives */

/* Slow page load: a thin running bar on top; the current page stays as it is */
body.routing::after { content: ""; position: fixed; left: 0; top: 0; z-index: 200; width: 35%; height: 3px; border-radius: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--sky-2), var(--blue)); animation: routing 1.1s var(--ease) infinite; }
@keyframes routing { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .tabs-ink { transition: none; } body.routing::after { animation-duration: 3s; } }

/* ---------------------------------------------------------------- tables & lists */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-card); }
.t th, .t td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); background: #FCFCFE; }
.t tr:last-child td { border-bottom: 0; }
.t td.m-main { font-weight: 600; color: var(--ink-strong); }
.t tr.click { cursor: pointer; transition: background .15s; }
.t tr.click:hover td { background: #F7F5FF; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.card.empty::before { content: "✦"; display: block; font-size: 22px; color: var(--sky-2); margin-bottom: 6px; }

.list { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: 16px; padding: 13px 16px; box-shadow: var(--sh-card); color: inherit; transition: box-shadow .2s, transform .2s var(--ease); }
a.item:hover, .item.click:hover { box-shadow: var(--sh-hover); transform: translateY(-1px); color: inherit; cursor: pointer; }
.item .grow { flex: 1; min-width: 0; }
.item .t1 { font-weight: 600; color: var(--ink-strong); }
.item .t2 { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.done .t1 { text-decoration: line-through; color: var(--faint); font-weight: 500; }
.tick { width: 28px; height: 28px; border-radius: 10px; border: 1.6px solid var(--field); background: #fff; cursor: pointer; flex: none; display: grid; place-items: center; font-size: 15px; color: transparent; transition: all .2s var(--ease); }
.tick:hover { border-color: var(--sky-2); }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.04); }

.bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 5px; min-width: 70px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sky-2), var(--blue)); border-radius: 99px; }
.bar > i.w { background: repeating-linear-gradient(-45deg, var(--sky), var(--sky) 5px, #c6d4ff 5px, #c6d4ff 10px); }

/* ---------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal .dow { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 0 4px; }
.cal .day { background: var(--surface); border-radius: 16px; min-height: 108px; padding: 8px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 1px solid transparent; }
.cal .day.out { opacity: .4; }
.cal .day.today { border-color: var(--sky-2); box-shadow: 0 0 0 3px rgba(124, 156, 255, .18); }
.cal .day.click { cursor: pointer; }
.cal .day.click:hover { border-color: var(--sky); }
.cal .dn { font-size: 12.5px; font-weight: 700; color: var(--ink-strong); }
.cal .pill { display: block; font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--blue-weak); color: var(--blue); }
.cal .pill.ev { background: var(--blue); color: #fff; }
.cal .pill.ev.private { background: var(--blue-deep); }
.cal .pill.pending { background: var(--amber-weak); color: var(--amber); }
.cal .pill.confirmed { background: var(--green-weak); color: var(--green); }
.cal .pill.blocked { background: repeating-linear-gradient(-45deg, var(--red-weak), var(--red-weak) 6px, #fff 6px, #fff 12px); color: var(--red); }
.cal .pill.offer { background: #fff; color: var(--blue); border: 1px dashed var(--sky-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 8px 0 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

/* ---------------------------------------------------------------- orders */
/* Event tabs scroll sideways when there are many; older events live in the «Раньше…» picker */
.o-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
.o-bar .tabs { margin: 0; flex: 0 1 auto; min-width: 0; }
.o-tabs .d { font-weight: 700; font-variant-numeric: tabular-nums; }
.o-tabs .t { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-tabs a.past:not(.on) { color: var(--faint); }
.o-old { width: auto; max-width: 260px; flex: none; border-radius: var(--r-pill); padding: 9px 38px 9px 16px; font-size: 13.5px; font-weight: 500; color: var(--ink-strong); border-color: var(--line); box-shadow: var(--sh-1); cursor: pointer; }
.o-old.on { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 3px var(--blue-weak); }
.o-list { transition: opacity .15s; }
/* Long event list scrolls inside the bar; the right edge fades so a cut tab reads as «more», not as a bug. */
.o-tabs.more { mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.o-tabs.more:hover, .o-tabs.more:focus-within { mask-image: none; }
.o-sep { flex: none; width: 1px; margin: 8px 4px; background: var(--line); }
/* «Оплачен» is the normal case: quiet text, so the coloured pills are only the ones to look at. */
.o-list .st.paid { background: none; padding-left: 0; padding-right: 0; color: var(--muted); font-weight: 500; }
.o-list .st.paid::before { background: var(--green); }
.o-list code { font-size: 12px; color: var(--muted); background: none; padding: 0; }
.o-kind { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
.o-kind.comp { background: var(--sky-weak); color: var(--blue); }
.o-kind.inv { background: var(--blue-weak); color: var(--blue); }
.o-list.busy { opacity: .55; }
@media (max-width: 640px) { .o-bar { flex-wrap: wrap; } .o-old { max-width: 100%; } }

/* ---------------------------------------------------------------- inbox */
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr); flex: 1 0 0; min-height: 440px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card); overflow: hidden; }
.inbox .threads { border-right: 1px solid var(--line); overflow: auto; }
/* Desktop: the page is a column and the inbox takes what is left of the window under the header
   and tabs. No hand-counted offset (it was 100vh - 230px and broke when the status tabs and the
   beta bar came in: the reply buttons ended up under the window edge). */
@media (min-width: 961px) {
  .main:has(> .inbox) { display: flex; flex-direction: column; min-height: calc(100vh - var(--beta-h)); padding-bottom: 28px; }
  .main:has(> .inbox) > .head { margin-bottom: 16px; } /* flex keeps margins apart: 16 + the tabs' 6 = the usual 22 */
}
.inbox .threads, .inbox .thread { transition: opacity .15s; }
.inbox .busy { opacity: .55; }
/* Tab switch: the new list fades in; the rest of the page doesn't move */
.threads.swap > .thr { animation: thr-in .28s var(--ease) both; }
.threads.swap > .thr:nth-child(2) { animation-delay: .03s; } .threads.swap > .thr:nth-child(3) { animation-delay: .06s; }
.threads.swap > .thr:nth-child(4) { animation-delay: .09s; } .threads.swap > .thr:nth-child(n+5) { animation-delay: .12s; }
@keyframes thr-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .threads.swap > .thr { animation: none; } }
.thr { display: block; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink); transition: background .15s; position: relative; }
.thr:hover { background: #F7F5FF; color: var(--ink); }
.thr.on { background: var(--blue-weak); }
.thr.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--blue); }
.thr .who { font-weight: 500; color: var(--ink-strong); }
.thr.unread .who { font-weight: 700; }
.thr.unread .who::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 9px; background: var(--orange); margin-left: 7px; box-shadow: 0 0 0 3px rgba(240, 100, 45, .18); }
.thr .pv { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.thread .th-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.thread .th-head select { width: auto; padding: 7px 32px 7px 12px; border-radius: var(--r-pill); font-size: 13px; }
.th-head > a.icon-btn { display: none; }
.thread .msgs { flex: 1; min-height: 120px; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(180deg, #FBFBFE, #F6F5FC); }
.msg { max-width: 74%; padding: 11px 15px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--sh-1); }
.msg.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.out { background: linear-gradient(135deg, #3A2AD4, #2816B9); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; box-shadow: 0 10px 22px -14px rgba(40, 22, 185, .8); }
.msg.note { background: #FFF8DC; border: 1px dashed #E8CF6A; align-self: center; font-size: 13.5px; }
.msg.system { align-self: center; color: var(--muted); font-size: 12px; background: transparent; box-shadow: none; padding: 2px 8px; }
.msg .meta { font-size: 11px; opacity: .7; margin-top: 5px; }
.msg.failed { outline: 2px solid var(--red); }
.msg .tr { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(40, 22, 185, .2); color: var(--blue-deep); font-size: 14px; }
.msg .tr::before { content: attr(data-l); display: inline-block; font-size: 12px; color: var(--blue-deep); background: var(--blue-weak-2); border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.msg.tr-only .orig { display: none; }
.composer { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; background: #fff; }
.composer textarea { min-height: 76px; border-radius: 18px; }
/* Composer: language bar on top, tools left, send buttons right (primary last) */
/* Translation bar (js/lang.js): «Клиент пишет …» + «Перевести на …»; green after translating. Inbox, lead card, offer. */
.lang-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--blue-weak); color: var(--blue-deep); font-size: 13px; }
.lang-bar .grow { flex: 1 1 240px; min-width: 0; }
.lang-bar .lb-flag { font-size: 18px; line-height: 1; }
.lang-bar .lb-ic { display: inline-grid; color: var(--green); }
.lang-bar[data-state="done"] { background: var(--green-weak); }
.lang-bar .btn.sm:not(.ghost) { background: #fff; }
.composer .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.composer .tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.composer .tools select { width: auto; padding: 6px 30px 6px 12px; border-radius: var(--r-pill); font-size: 13px; margin-right: 4px; }
.composer .sends { display: flex; gap: 8px; margin-left: auto; }
/* Translation switch in the thread header: a toggle, not a call to action */
.tr-switch { appearance: none; border: 1px solid var(--field); background: var(--surface); color: var(--muted); border-radius: var(--r-pill); padding: 5px 13px 5px 6px; font: 500 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tr-switch .knob { width: 30px; height: 18px; border-radius: 9px; background: var(--field); position: relative; transition: background .2s; flex: none; }
.tr-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.tr-switch.on { color: var(--blue); border-color: var(--sky); }
.tr-switch.on .knob { background: var(--blue); }
.tr-switch.on .knob::after { transform: translateX(12px); }
.tr-preview { background: var(--blue-weak); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--blue-deep); white-space: pre-wrap; }

@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* ---------------------------------------------------------------- recipe cards (screen preview) */
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.rcard { background: #fff; border-radius: var(--r); box-shadow: var(--sh-card); padding: 26px 26px 22px; position: relative; overflow: hidden; }
.rcard::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--sky), transparent 70%); opacity: .35; }
.rcard .course { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sky-2); }
.rcard h3 { font-size: 21px; font-weight: 300; text-transform: uppercase; color: var(--blue); margin: 14px 0 10px; line-height: 1.25; }
.rcard ul, .rcard ol { padding-left: 18px; margin: 8px 0; }
.rcard li { margin: 2px 0; }
.rcard .tip { font-style: italic; color: var(--muted); font-size: 13px; }
.rcard .intro { margin-bottom: 18px; }
.rcard .rlbl { margin-bottom: 4px; }
.rcard .rallerg { margin-top: 12px; }
.rcard .side { position: relative; }
.rcard .side.back { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.rcard .side.back .course { margin-bottom: 6px; }
.stale { background: var(--amber-weak); color: var(--ink, #15123a); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.rcard .stale { margin: 0 70px 14px 0; }
/* Flag and print icon sit on the course line, the title starts below them. */
.rcard .rflag { position: absolute; right: 0; top: 1px; line-height: 0; z-index: 1; }
.rcard .rflag svg { display: block; width: 21px; height: 14px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, .1); }
.rcard .side.back .rflag { top: 15px; }
/* Logo and site are for paper only (print.css); in the admin the card stays plain. */
.rcard .foot { display: none; }
.rcard .foot .wordmark { font-size: 18px; }
.print-solo { display: none; }
/* Reprint one card: icon next to the flag, no row of its own. */
.rcard .rprint { position: absolute; top: 19px; right: 56px; z-index: 2; padding: 6px; }
.rcard .rprint svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- toasts + modal */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; width: min(460px, 92vw); }
.toast { background: var(--ink-strong); color: #fff; padding: 13px 20px; border-radius: var(--r-pill); box-shadow: var(--sh-pop); font-size: 14px; font-weight: 500; animation: pop .25s var(--ease); text-align: center; }
.toast.err { background: var(--red); }
.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(580px, 94vw); box-shadow: var(--sh-pop); color: var(--ink); }
.modal::backdrop { background: rgba(20, 10, 90, .32); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .22s var(--ease); }
.modal #modal-body { padding: 26px; max-height: 88vh; overflow: auto; }
.modal h2 { margin-top: 0; }
.modal.xl { width: min(940px, 96vw); }

/* ---------------------------------------------------------------- laptops: icon rail */
/* Between the phone layout and a wide screen the full menu eats a quarter of the
   width, so it shrinks to icons (labels in aria-label/title, see railTips in app.js). */
@media (min-width: 961px) and (max-width: 1279px) {
  :root { --nav-w: 76px; }
  .nav { padding: 18px 10px 12px; }
  .nav-brand { font-size: 0; padding: 0 0 14px; text-align: center; }
  .nav-brand i { font-size: 32px; margin: 0; }
  .nav-scroll { margin: 0 -4px; padding: 0 4px; }
  .nav-label { display: none; }
  .nav-group { margin-bottom: 8px; }
  .nav-group + .nav-group { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 8px; }
  .nav a[data-view], .nav .linkish { position: relative; justify-content: center; padding: 11px 0; }
  .nav a[data-view] > span:not(.avatar), .nav .linkish > span { display: none; }
  .nav .badge { position: absolute; top: 3px; right: 6px; margin: 0; font-size: 10px; padding: 0 5px; min-width: 16px; }
  .main { padding: 28px 28px 80px; }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .m-top { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line); padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .m-top .wordmark { font-size: 21px; }
  .m-top .icon-btn svg { width: 24px; height: 24px; }
  .nav { position: fixed; left: 0; top: 0; height: 100%; width: 84vw; max-width: 310px; transform: translateX(-104%); transition: transform .3s var(--ease); border-radius: 0 28px 28px 0; }
  body.nav-open .nav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 10, 90, .35); backdrop-filter: blur(3px); z-index: 40; }
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 35; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.6) blur(18px); border-radius: 24px; box-shadow: 0 14px 40px -12px rgba(20, 10, 90, .35), 0 0 0 1px rgba(40, 22, 185, .06); padding: 6px; }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 18px; color: var(--muted); font: 600 10.5px var(--font); border: 0; background: none; position: relative; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--blue); background: var(--blue-weak); }
  .tabbar .badge { position: absolute; top: 2px; right: calc(50% - 22px); font-size: 10px; padding: 0 5px; min-width: 16px; }
  h1 { font-size: 27px; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; border-radius: var(--r); overflow: visible; }
  .inbox .threads { max-height: none; }
  .thread .msgs { min-height: 46vh; padding: 14px; border-radius: 0; }
  .thread .th-head select { flex: 1 1 30%; min-width: 0; }
  .composer { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 30px -18px rgba(20, 10, 90, .35); border-radius: 0 0 var(--r) var(--r); }
  .composer textarea { min-height: 64px; }
  .composer .actions .btn { padding: 8px 12px; font-size: 13px; }
  .composer .sends { width: 100%; }
  .composer .sends .btn { flex: 1; }
  .inbox.has-open .threads { display: none; }
  .inbox:not(.has-open) .thread { display: none; }
  .th-head > a.icon-btn { display: inline-grid; }
  .cal { gap: 4px; }
  .cal .day { min-height: 64px; padding: 5px; border-radius: 12px; }
  .cal .pill { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .cal .dow { letter-spacing: .04em; font-size: 10px; }
}
@media (max-width: 640px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 16px; }
  .rcard .cols { grid-template-columns: minmax(0, 1fr); }
  .tabs { width: 100%; }
  table.t.m-cards, .t.m-cards tbody, .t.m-cards tr, .t.m-cards td { display: block; }
  .t.m-cards thead { display: none; }
  .t.m-cards { background: transparent; box-shadow: none; overflow: visible; }
  .t.m-cards tr { background: var(--surface); border-radius: 18px; box-shadow: var(--sh-card); margin-bottom: 10px; padding: 10px 4px; }
  .t.m-cards td { border: 0; padding: 3px 14px; }
  .t.m-cards td[data-label]:not([data-label=""])::before { content: attr(data-label) " · "; color: var(--faint); font-size: 11.5px; font-weight: 500; }
  .t.m-cards td.m-main { font-size: 16px; }
  .t.m-cards td.m-hide { display: none; }
  .msg { max-width: 90%; }
  .item { flex-wrap: wrap; }
  .item .grow { flex-basis: 55%; }
  .btn.sm { min-width: 0; }
}

/* ---------- leads board (0018) ---------- */
.kanban { --k: var(--sky-2); display: grid; grid-template-columns: repeat(5, minmax(176px, 1fr)); gap: 14px; overflow-x: auto; padding: 2px 2px 10px; align-items: stretch; }
/* Columns: each stage has its own colour (--k), a tinted lane and a coloured top edge, so the five
   lanes read apart; cards are white on the tint. Stage colours are tokens in :root. */
.kcol { --k: var(--sky-2); background: color-mix(in srgb, var(--k) 7%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--k) 16%, transparent); border-top: 3px solid var(--k); border-radius: 18px; padding: 8px 8px 10px; min-height: 220px; min-width: 0; display: flex; flex-direction: column; transition: background .2s, box-shadow .2s, transform .2s var(--ease); }
.kcol.s-new { --k: var(--sky-2); } .kcol.s-talking { --k: var(--violet); } .kcol.s-offer { --k: var(--amber); }
.kcol.s-accepted { --k: var(--teal); } .kcol.s-paid { --k: var(--green); }
.khead { display: flex; align-items: center; gap: 8px; padding: 6px 8px 12px; font-weight: 600; color: var(--ink-strong); font-size: 14px; }
.khead .kdot { width: 9px; height: 9px; border-radius: 50%; background: var(--k); box-shadow: 0 0 0 4px color-mix(in srgb, var(--k) 18%, transparent); flex: none; }
.khead .kname { flex: 1; min-width: 0; }
.khead b { background: color-mix(in srgb, var(--k) 16%, var(--surface)); color: color-mix(in srgb, var(--k) 70%, var(--ink-strong)); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.kbody { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 10px; min-height: 60px; }
.kempty { display: grid; place-items: center; min-height: 92px; border: 1.5px dashed color-mix(in srgb, var(--k) 30%, transparent); border-radius: 14px; color: var(--faint); font-size: 12.5px; }
.kbody .lcard ~ .kempty { display: none; }
.lcard { display: block; background: var(--surface); border-radius: 16px; padding: 13px 14px; box-shadow: var(--sh-card); color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s, opacity .2s; outline-offset: 3px; }
.lcard:hover { transform: translateY(-2px); box-shadow: var(--sh-hover); color: var(--ink); }
.lcard:focus-visible { outline: 2px solid var(--k); }
/* Drag and drop (leads.js kanbanDrag) */
.kanban.can-drag .lcard { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.kanban.dragging, .kanban.dragging * { cursor: grabbing !important; }
.lcard.kdragging { opacity: .35; transform: none; box-shadow: none; outline: 1.5px dashed var(--k); }
.kghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; box-shadow: var(--sh-pop); transition: none !important; opacity: .97; }
.kcol.drop-on { background: color-mix(in srgb, var(--k) 16%, var(--surface)); box-shadow: 0 0 0 2px var(--k), var(--sh-card); transform: translateY(-2px); }
.kcol.drop-on .kempty { display: grid; border-color: var(--k); color: var(--k); }
.lcard.kland { animation: k-land .45s var(--ease); }
.lcard.kgone { animation: k-gone .35s var(--ease) forwards; }
@keyframes k-land { from { transform: scale(.96); box-shadow: 0 0 0 3px var(--k), var(--sh-hover); } }
@keyframes k-gone { to { opacity: 0; transform: scale(.9); } }
.kdock { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 999; display: flex; gap: 12px; transform: translate(-50%, 140%); opacity: 0; transition: transform .25s var(--ease), opacity .2s; pointer-events: none; }
.kdock.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.kend { --k: var(--green); display: flex; align-items: center; gap: 8px; padding: 16px 26px; border-radius: var(--r-pill); background: var(--surface); border: 2px dashed color-mix(in srgb, var(--k) 45%, transparent); color: var(--k); font-weight: 600; box-shadow: var(--sh-pop); transition: background .15s, transform .15s var(--ease); }
.kend.s-lost { --k: var(--red); }
.kend svg { width: 17px; height: 17px; }
.kend.drop-on { background: var(--k); color: #fff; border-style: solid; transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .lcard.kland, .lcard.kgone { animation: none; } .kcol.drop-on { transform: none; } }
.lcard .chip { padding: 3px 9px; font-size: 12px; box-shadow: none; }
.lcard .chip svg { width: 13px; height: 13px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lead-grid { align-items: start; }
/* lead card «Что знаем»: autosave status instead of a Save button */
.lead-head { justify-content: space-between; margin-bottom: 14px; }
.lead-st { display: inline-flex; align-items: center; gap: 4px; }
.lead-st svg { width: 14px; height: 14px; }
.lead-st.lf-bad { color: var(--red); }
/* Several values in one field (lead dates and formats): chips + the add input at the end. */
.lbl { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.mpick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 5px; border: 1px solid var(--field); border-radius: 14px; background: #fff; font-size: 14px; font-weight: 500; letter-spacing: 0; }
.mpick .chip { padding: 5px 6px 5px 12px; box-shadow: none; }
.mpick .chip[data-main] { cursor: pointer; }
.mpick .chip[data-main]:hover { border-color: var(--sky-2); }
.mpick .mp-x { border: 0; background: none; padding: 0 2px; color: inherit; opacity: .6; cursor: pointer; display: inline-grid; place-items: center; }
.mpick .mp-x:hover { opacity: 1; }
.mpick .mp-x svg { width: 13px; height: 13px; }
.mpick input, .mpick select { flex: 0 1 190px; width: auto; border: 0; padding: 6px 10px; box-shadow: none; }
.mpick select { padding-right: 32px; background-position: right 10px center; }
.mpick:focus-within { border-color: var(--sky-2); box-shadow: 0 0 0 4px rgba(124, 156, 255, .22); }
.tr-orig { font-size: 12px; color: var(--muted); white-space: pre-wrap; margin-top: -8px; }
.price { display: grid; gap: 8px; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; } .kanban.dragging { scroll-snap-type: none; } .kcol { scroll-snap-align: start; } .kdock { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* ---------- day plan / kitchen mode (0020) ---------- */
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--sh-card); }
.tl li.done { opacity: .45; }
.tl li.done .tt { text-decoration: line-through; }
.tl li.start { background: var(--blue); color: #fff; }
.tl li.start .muted { color: rgba(255, 255, 255, .75); }
.tl li.call { background: var(--blue-weak); }
.tl .tm { font-weight: 700; font-size: 17px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tl li.start .tm { color: #fff; }
.tl li.now { box-shadow: 0 0 0 3px var(--sky-2), var(--sh-card); }
body.kitchen { --beta-h: 0px; }
body.kitchen .shell > .nav, body.kitchen .m-top, body.kitchen .tabbar, body.kitchen .beta-bar { display: none !important; }
/* The nav is hidden, so the shell must collapse to one column - otherwise .main lands in the nav's narrow track. */
body.kitchen .shell { grid-template-columns: minmax(0, 1fr); }
body.kitchen .main { max-width: 1100px; margin: 0 auto; padding: 20px 24px 48px; }
body.kitchen .head { align-items: center; }
body.kitchen .tl { gap: 10px; }
body.kitchen .tl li { grid-template-columns: 100px minmax(0, 1fr) auto; gap: 18px; padding: 18px 22px; font-size: 22px; line-height: 1.3; border-radius: 20px; }
body.kitchen .tl .tm { font-size: 28px; }
body.kitchen .tl .muted.small { font-size: 15px; }
body.kitchen .tl .btn.sm { min-width: 56px; height: 56px; justify-content: center; }
body.kitchen .tl li.done { padding: 8px 22px; font-size: 16px; box-shadow: none; }
body.kitchen .tl li.done .tm { font-size: 17px; }
body.kitchen .tl li.done .muted.small { display: none; }
body.kitchen .tl li.done .btn.sm { min-width: 40px; height: 40px; }
body.kitchen .tl li.now { box-shadow: 0 0 0 4px var(--sky-2), var(--sh-card); }
.st.viewed, .st.scheduled, .st.sending { background: var(--blue-weak); color: var(--blue); }
.st.accepted, .st.synced, .st.parsed { background: var(--green-weak); color: var(--green); }
@media (max-width: 640px) {
  body.kitchen .main { padding: 12px 12px 40px; }
  body.kitchen .tl li { grid-template-columns: 62px minmax(0, 1fr) auto; padding: 14px; font-size: 18px; gap: 10px; }
  body.kitchen .tl .tm { font-size: 20px; }
  body.kitchen .tl li.done { padding: 6px 14px; font-size: 15px; }
  body.kitchen .tl li.done .tm { font-size: 15px; }
  body.kitchen .tl .btn.sm { min-width: 48px; height: 48px; }
  .tl li { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; }
  .tl select { max-width: 96px !important; }
}
@media (max-width: 640px) { .side-first > :last-child { order: -1; } }

/* ---------- customers list (0024) ---------- */
.search { position: relative; width: min(380px, 100%); }
.search > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; transition: color .15s; }
.search:focus-within > svg { color: var(--blue); }
.search input { border-radius: var(--r-pill); padding: 12px 42px 12px 44px; box-shadow: var(--sh-1); border-color: var(--line); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--faint); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.search .clear:hover { background: var(--blue-weak); color: var(--blue); }
.search .clear svg { width: 16px; height: 16px; }
.cu-head { align-items: center; }
.cu-head #cu-sum { font-size: 14px; }
.cu-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cu-bar .tabs { margin: 0; }
.cu-sort { width: auto; border-radius: var(--r-pill); padding: 9px 38px 9px 16px; font-size: 13.5px; font-weight: 500; color: var(--ink-strong); border-color: var(--line); box-shadow: var(--sh-1); cursor: pointer; }
.cu-list { transition: opacity .15s; }
.cu-list.busy { opacity: .55; }
.cu-list .t th, .cu-list .t td { padding: 12px 14px; }
.cu-list .t th { white-space: nowrap; }
.cu-list .t th:first-child, .cu-list .t td:first-child { padding-left: 20px; }
.cu-list .t th:last-child, .cu-list .t td:last-child { padding-right: 20px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .grow { min-width: 0; }
.who .nm { font-weight: 600; color: var(--ink-strong); line-height: 1.3; }
.who .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
.who .co { display: inline-flex; align-items: center; gap: 4px; }
.who .co svg { width: 13px; height: 13px; color: var(--sky-2); }
.ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; letter-spacing: .02em; background: var(--blue-weak); color: var(--blue); }
.ava.t1 { background: var(--sky-weak); color: var(--blue-deep); }
.ava.t2 { background: var(--green-weak); color: var(--green); }
.ava.t3 { background: var(--amber-weak); color: var(--amber); }
.ava.t4 { background: var(--orange-weak); color: var(--orange); }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.ct { max-width: min(240px, 20vw); }
.ct .em { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.ct .em > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct .ph { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.faint { color: var(--faint); font-size: 13px; }
.src { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 500; white-space: nowrap; }
.src svg { width: 14px; height: 14px; color: var(--blue); }
.cu-list td .n { font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.vis .when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.soon { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--blue-weak); color: var(--blue); font-size: 12px; font-weight: 600; white-space: nowrap; }
.soon svg { width: 13px; height: 13px; }
.nl { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; }
.nl svg { width: 12px; height: 12px; }
.nl.on { background: var(--green-weak); color: var(--green); }
.nl.off { background: var(--red-weak); color: var(--red); opacity: .7; }
.cu-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 0 6px; }
@media (max-width: 960px) {
  .cu-bar { flex-wrap: wrap; }
  .cu-bar .tabs { order: 2; width: 100%; }
}
@media (max-width: 640px) {
  .cu-head .search { width: 100%; }
  .cu-bar .cu-sort { margin-left: auto; }
  .cu-list .t.m-cards tr { padding: 12px 4px; }
  .cu-list .t.m-cards td { padding: 2px 14px 2px 64px; }
  .cu-list .t.m-cards td.m-main { padding: 0 14px 6px; width: auto; }
  .cu-list .t.m-cards td.num { text-align: left !important; }
  .cu-list .t.m-cards td[data-label="Контакты"]::before, .cu-list .t.m-cards td[data-label="Визиты"]::before { display: none; }
  .cu-list .ct { display: flex; flex-wrap: wrap; gap: 0 10px; max-width: none; }
  .cu-list .vis { display: inline-flex; align-items: center; gap: 8px; }
  .cu-list .ct .em { min-width: 0; }
}

/* ---------- returning guests in the guest list (0025) ---------- */
.gnotes { display: grid; gap: 4px; margin-top: 6px; min-width: 260px; max-width: 420px; }
.gnote { background: var(--amber-weak); border-radius: 10px; padding: 5px 10px; font-size: 13px; font-weight: 500; color: var(--ink-strong); line-height: 1.35; }
.gnote.here { background: var(--blue-weak); }
.gnote small { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.gnote .gx { border: 0; background: none; padding: 0 2px; margin-left: auto; color: var(--faint); cursor: pointer; display: inline-grid; place-items: center; }
.gnote .gx:hover { color: var(--red); }
.gnote .gx svg { width: 13px; height: 13px; }
.chip.visit { padding: 1px 9px; font-size: 11.5px; font-weight: 600; box-shadow: none; vertical-align: 1px; }
.chip.past { display: inline-block; min-width: 130px; max-width: 240px; border-radius: 10px; line-height: 1.35; background: transparent; border: 1px dashed var(--amber); color: var(--amber); box-shadow: none; font-size: 12px; padding: 4px 10px; }
.addnote { display: inline-flex; align-items: center; gap: 3px; margin-top: 5px; padding: 2px 8px 2px 4px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--blue); font: 500 12.5px var(--font); cursor: pointer; }
.addnote:hover { background: var(--blue-weak); }
.addnote svg { width: 14px; height: 14px; }
.btn.on { background: var(--blue); border-color: transparent; color: #fff; box-shadow: var(--sh-btn); }
.btn.on:hover { color: #fff; }
@media (max-width: 640px) { .gnotes { min-width: 0; max-width: none; } }

/* Free-text ingredient lines in the recipe editor (recipes.js addLines): one field, the preview under it. */
.ing-add { margin-top: 8px; }
.ing-add textarea { flex: 1 1 240px; min-height: 0; resize: none; overflow: hidden; }
.ing-add .list { margin-top: 8px; }
.ing-add .item { background: var(--blue-weak); box-shadow: none; } /* preview, not saved yet */
.ing-add .item.bad .t2 { color: var(--red); white-space: normal; }
.ing-hint { margin-top: 6px; }

/* ---------- inbox -> leads (0031) ---------- */
.th-lead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--blue-weak); font-size: 13.5px; }
.th-lead .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--blue); flex: none; box-shadow: var(--sh-1); }
.th-lead .ic svg { width: 16px; height: 16px; }
.th-lead .grow { flex: 1 1 220px; min-width: 0; }
.th-lead a.grow { color: var(--ink); }
.th-lead a.grow:hover b { color: var(--blue); }
.th-lead .st { margin: 0 4px; vertical-align: 1px; }
.th-lead.ask, .th-lead.hint { background: linear-gradient(90deg, #FFF7E6, var(--surface)); }
.th-lead.ask .ic, .th-lead.hint .ic { color: var(--amber); }
.lead-tag { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 1px 8px 1px 6px; border-radius: var(--r-pill); background: var(--blue-weak); color: var(--blue); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.lead-tag svg { width: 12px; height: 12px; }
.ai-note { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; background: var(--blue-weak); color: var(--blue-deep); font-size: 13px; }
.ai-note svg { width: 15px; height: 15px; flex: none; }
.ai-note.busy svg { animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .3; transform: scale(.85); } }
@media (prefers-reduced-motion: reduce) { .ai-note.busy svg { animation: none; } }
.form .ai { border-color: var(--sky-2); background: #F4F6FF; }
.lcard .wrote { margin-top: 8px; display: flex; align-items: center; gap: 5px; color: var(--amber); font-weight: 600; }
.lcard .wrote svg { width: 13px; height: 13px; flex: none; }
.st.talking { background: var(--sky-weak); color: var(--blue); }
.st.accepted { background: var(--green-weak); color: var(--green); }

/* ---------- lead feed: one window (0035, leads.js feedCard) ---------- */
.lfeed { padding: 18px 0 0; overflow: hidden; display: flex; flex-direction: column; }
.lf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0 20px; }
.lf-head h3 { margin: 0; }
.lf-tabs.tabs { margin: 0; padding: 4px; box-shadow: none; background: var(--surface-2); font-size: 13px; }
.lf-tabs .chip { padding: 0 7px; font-size: 11px; box-shadow: none; }
.lf-bar:not(:empty) { padding: 12px 20px 0; display: grid; gap: 8px; }
.lf-threads { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lf-threads > .muted { margin-right: 2px; }
.lf-th { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 11px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; transition: border-color .2s, box-shadow .2s; }
.lf-th:hover { border-color: var(--sky-2); color: var(--ink-strong); box-shadow: var(--sh-1); }
.lf-th svg { width: 13px; height: 13px; flex: none; color: var(--blue); }
.lf-th .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }
.lf-th.waits { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-weak); }
.lf-loose { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 10px 9px 14px; border-radius: 14px; background: var(--blue-weak); color: var(--blue-deep); font-size: 13px; }
.lf-loose > svg { width: 15px; height: 15px; flex: none; }
.lf-loose .grow { flex: 1 1 220px; min-width: 0; }
.lf-loose .btn.sm:not(.ghost) { background: var(--surface); }
.lf-loose .acts { display: flex; gap: 4px; margin-left: auto; }
.lf-list { margin-top: 14px; padding: 16px 20px; min-height: 170px; max-height: min(64vh, 640px); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #FBFBFE, var(--surface-2)); border-top: 1px solid var(--line); }
.lf-list[data-f="talk"] > :not(.talk), .lf-list[data-f="team"] > :not(.team) { display: none; }
.lf-empty { display: flex; gap: 12px; align-items: flex-start; margin: auto 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 13.5px; box-shadow: var(--sh-1); }
.lf-empty > svg { width: 20px; height: 20px; flex: none; color: var(--sky-2); margin-top: 1px; }
.lf-day { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.lf-day::before, .lf-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fi { min-width: 0; }
.fi .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.fi .meta svg { width: 12px; height: 12px; flex: none; }
.fi .meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--field); }
.fi .meta .err { color: var(--red); font-weight: 600; }
.fi.m { display: flex; flex-direction: column; max-width: 84%; }
.fi.m.in { align-self: flex-start; }
.fi.m.out { align-self: flex-end; align-items: flex-end; }
.fi.m .bub { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.fi.m.in .bub { background: var(--surface); border-bottom-left-radius: 6px; box-shadow: var(--sh-1); }
.fi.m.out .bub { background: linear-gradient(135deg, var(--blue-2), var(--blue)); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 10px 22px -14px rgba(40, 22, 185, .8); }
.fi.m.failed .bub { outline: 2px solid var(--red); outline-offset: 1px; }
.fi .tx.long { max-height: 13.5em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.fi .more { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fi.m.out .more { color: #fff; text-decoration: underline; }
.fi.m .tr { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--blue-weak-2); color: var(--blue-deep); font-size: 13.5px; }
.fi.m .tr::before { content: attr(data-l); display: inline-block; font-size: 11.5px; background: var(--blue-weak-2); border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.fi.m .chip.file { margin-top: 8px; padding: 3px 10px; font-size: 12px; white-space: nowrap; color: var(--ink); }
.lf-offer { display: flex; align-items: center; gap: 6px; width: max-content; max-width: 100%; margin-top: 8px; padding: 6px 12px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); color: #fff; font-size: 12.5px; font-weight: 600; white-space: normal; }
.lf-offer:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.lf-offer svg { width: 14px; height: 14px; flex: none; }
.fi.nt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--amber-weak); border: 1px dashed color-mix(in srgb, var(--amber) 40%, transparent); font-size: 13.5px; }
.fi.nt .grow { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fi.nt .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--amber); }
.fi.nt .ic svg { width: 13px; height: 13px; }
.fi.nt.call { background: var(--green-weak); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.fi.nt.call .ic { color: var(--green); }
.fi.ev { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.fi.ev svg { vertical-align: -2px; margin-right: 3px; }
.fi.ev a { color: var(--ink-strong); font-weight: 500; }
.fi.ev svg { width: 13px; height: 13px; }
.fi.ev.viewed a { color: var(--blue); }
.fi.ev.accepted a { color: var(--green); font-weight: 600; }
.fi.ev.declined a { color: var(--red); }
.lf-composer { border-top: 1px solid var(--line); padding: 12px 16px 14px; display: grid; gap: 8px; background: var(--surface); }
.lf-to { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lf-to select { width: auto; max-width: 100%; min-width: 0; padding: 6px 30px 6px 12px; border-radius: var(--r-pill); font-size: 13px; }
.lf-warn { padding: 8px 12px; border-radius: 12px; background: var(--blue-weak); color: var(--blue-deep); font-size: 12.5px; }
.lf-warn.bad { background: var(--amber-weak); color: var(--ink-strong); }
.lf-composer textarea { min-height: 70px; border-radius: 16px; resize: vertical; }
.lf-composer .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lf-composer .tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.lf-composer .sends { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 640px) {
  .lf-head, .lf-bar:not(:empty) { padding-left: 14px; padding-right: 14px; }
  .lf-list { padding: 12px 12px; max-height: 62vh; }
  .fi.m { max-width: 92%; }
  .lf-composer { padding: 10px 12px 12px; }
  .lf-composer .sends { width: 100%; }
  .lf-composer .sends .btn { flex: 1; }
}

/* ---------- recipes, menus, ingredients (0032) ---------- */
.flag { display: inline-block; flex: none; width: 21px; height: 14px; border-radius: 3px; overflow: hidden; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(30, 27, 58, .22); background: var(--surface-2); }
/* .tabs a .flag svg: beats the 15px icon size of ".tabs a svg" so the flag fills its box in tabs */
.flag svg, .tabs a .flag svg { display: block; width: 100%; height: 100%; }
.flag.none { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(from 30deg, var(--sky), var(--blue), var(--orange), var(--sky)); box-shadow: none; }
.flag.xl { width: 96px; height: 64px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(30, 27, 58, .08), 0 14px 30px -14px rgba(20, 12, 90, .45); }
.flag.xl.none { width: 64px; height: 64px; border-radius: 50%; }
.tabs a.zero { opacity: .42; }
.tabs a .flag { margin-right: 1px; }
.tabs a svg { width: 15px; height: 15px; }

.rx-head { align-items: center; }
.rx-head #rx-sum, .rx-head #mx-sum, .rx-head #ig-sum { font-size: 14px; }
.rx-tools { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.rx-tools .search { flex: 1 1 260px; width: auto; max-width: 440px; }
.rx-tools .tabs { margin: 0; }
.rx-tools .cu-sort { flex: none; }
#ig-s.search { flex-basis: 200px; }
.tabs.rx-k { margin: 0 0 10px; }
.rx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px; }
.rx-row .tabs { margin: 0; }
.tabs.rx-c { margin: 0 0 6px; padding: 4px; }
.rx-row .tabs.rx-c { margin: 0; }
.tabs.rx-c a { padding: 6px 13px; font-size: 13px; }

/* allergen picker */
.dd { position: relative; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd-btn svg { width: 16px; height: 16px; }
.dd-btn svg:last-child { width: 14px; height: 14px; opacity: .6; transition: transform .2s var(--ease); }
.dd[open] .dd-btn svg:last-child { transform: rotate(180deg); }
.dd.on .dd-btn { border-color: transparent; background: var(--blue-weak); color: var(--blue); }
.dd-pop { position: absolute; left: 0; top: calc(100% + 8px); z-index: 25; width: min(430px, 92vw); background: var(--surface); border-radius: 20px; box-shadow: var(--sh-pop); padding: 16px 18px 12px; animation: pop .18s var(--ease); }
.dd-h { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.dd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; }
.dd-grid .check { font-size: 13.5px; }
.dd-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* chips: allergens, diet, ingredient origin */
.alg { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: var(--r-pill); background: #FFF4E0; color: #94580A; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.alg svg { width: 12px; height: 12px; }
.alg.ok { background: var(--green-weak); color: var(--green); }
.alg.warn { background: var(--red-weak); color: var(--red); white-space: normal; }
.alg-t { color: #94580A; }
.diet { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.diet svg { width: 12px; height: 12px; }
.diet.vegan { background: var(--green-weak); color: var(--green); }
.diet.vegetarian { background: rgba(110, 168, 40, .14); color: #4C7A12; }
.diet.pescatarian { background: var(--sky-weak); color: var(--blue-deep); }
.o-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #3BAA5C; box-shadow: 0 0 0 3px rgba(59, 170, 92, .15); }
.o-dot.o-honey { background: #E6A817; box-shadow: 0 0 0 3px rgba(230, 168, 23, .18); }
.o-dot.o-dairy { background: #EDC25A; box-shadow: 0 0 0 3px rgba(237, 194, 90, .22); }
.o-dot.o-egg { background: #F08A3C; box-shadow: 0 0 0 3px rgba(240, 138, 60, .18); }
.o-dot.o-fish { background: #2F80ED; box-shadow: 0 0 0 3px rgba(47, 128, 237, .16); }
.o-dot.o-seafood { background: #19A7C4; box-shadow: 0 0 0 3px rgba(25, 167, 196, .16); }
.o-dot.o-meat { background: var(--red); box-shadow: 0 0 0 3px var(--red-weak); }

/* recipe cards */
.rx-group h2 { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 12px; }
.rx-group h2 span { font-size: 13px; font-weight: 600; color: var(--faint); }
.rx-group:first-child h2 { margin-top: 18px; }
.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap: 16px; }
.rc, .mc { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-card); padding: 20px 18px 14px; color: var(--ink); overflow: hidden;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.rc::before, .mc::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--rib, var(--line)); }
.rc:hover, .mc:hover { box-shadow: var(--sh-hover); transform: translateY(-2px); color: var(--ink); }
.rc-img { display: block; width: calc(100% + 36px); max-width: none; height: 150px; object-fit: cover; margin: -16px -18px 14px; }
.mc-img { display: block; width: calc(100% + 40px); max-width: none; height: 150px; object-fit: cover; margin: -16px -20px 14px; }
.rc-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.rc-k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-t { margin-top: 10px; font-size: 16.5px; font-weight: 600; line-height: 1.3; color: var(--ink-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-a { margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--blue); }
.rc-d { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-al { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 14px; }
.rc-foot, .mc-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.rc-foot svg { width: 14px; height: 14px; color: var(--sky-2); }
.rc-foot .soon { margin-left: auto; }
.rc-foot .soon svg { color: var(--blue); width: 13px; height: 13px; }

/* menu cards */
.mx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.mc { padding: 20px 20px 14px; }
.mc-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mc-top .flags { display: inline-flex; gap: 4px; }
.mc-kind { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mc-t { margin: 10px 0 12px; font-size: 21px; font-weight: 300; text-transform: uppercase; letter-spacing: .01em; line-height: 1.15; color: var(--ink-strong); }
.mc-courses { display: grid; gap: 7px; }
.mc-c { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.mc-c .cl { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sky-2); }
.mc-c .dl { font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.mc-b { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0; }
.mc-foot b { font-size: 15px; color: var(--ink-strong); }
.mc-foot .soon { margin-left: auto; }

/* one recipe / one menu */
.rp-hero { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 20px 26px 24px; margin-bottom: 16px; }
.rp-hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--rib, var(--line)); }
.rp-hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, var(--sky), transparent 70%); opacity: .25; pointer-events: none; }
.rp-nav { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-nav .back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.rp-nav .back svg { width: 16px; height: 16px; }
.rp-nav .btn svg { width: 16px; height: 16px; }
.rp-main { position: relative; z-index: 1; display: flex; gap: 24px; align-items: flex-start; margin-top: 12px; }
.rp-main .grow { flex: 1; min-width: 0; }
.rp-img { flex: none; width: 170px; height: 128px; object-fit: cover; border-radius: 18px; }
.rp-k { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sky-2); }
.rp-k i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.rp-k .tag { letter-spacing: 0; text-transform: none; }
.rp-hero h1 { position: relative; z-index: 1; margin: 8px 0 4px; }
.rp-alias { font-size: 16px; font-weight: 500; color: var(--blue); }
.rp-desc { position: relative; z-index: 1; margin: 8px 0 0; max-width: 760px; color: var(--muted); }
.rp-badges { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.rp-kpis { margin-bottom: 16px; }
.kpi .s { grid-column: 1 / -1; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero .s { color: rgba(255, 255, 255, .78); }
.rp-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.rp-sh { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rp-sh h2 { margin: 0; }
.scaler { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 13px; color: var(--muted); white-space: nowrap; }
.scaler .icon-btn { padding: 6px; border-radius: 50%; }
.scaler .icon-btn svg { width: 16px; height: 16px; }
.scaler b { font-size: 15px; color: var(--ink-strong); }
.lines { margin-top: 10px; }
.ln { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.ln .grow { flex: 1; min-width: 0; }
.ln-n { font-weight: 600; color: var(--ink-strong); line-height: 1.3; }
.ln-a { margin-top: 1px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.ln-a i { font-style: normal; color: var(--ink); }
.ln-q { font-weight: 600; color: var(--ink-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ln-c { min-width: 62px; text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ln .icon-btn, .steps .icon-btn, .md-row .icon-btn { padding: 5px; color: var(--faint); }
.ln .icon-btn:hover, .steps .icon-btn:hover, .md-row .icon-btn:hover { color: var(--red); background: var(--red-weak); }
.ln .icon-btn svg, .steps .icon-btn svg, .md-row .icon-btn svg { width: 15px; height: 15px; }
.ln-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px 0; font-size: 13px; color: var(--muted); }
.ln-total b { font-size: 16px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.rp-add { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) auto; gap: 8px; margin-top: 14px; }
.rp-add > :first-child { grid-column: 1 / -1; }
.rp-add input { padding: 9px 12px; }
.rp-add .btn { padding: 9px 12px; }
.steps { list-style: none; counter-reset: st; margin: 10px 0 0; padding: 0; }
.steps li { counter-increment: st; display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.steps li::before { content: counter(st); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-weak); color: var(--blue); font-weight: 700; font-size: 13px; margin-top: -2px; }
.steps li .grow { flex: 1; min-width: 0; }
.st-t { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.st-t > span { display: inline-flex; align-items: center; gap: 4px; }
.st-t svg { width: 13px; height: 13px; }
.rp-menus { display: flex; flex-wrap: wrap; gap: 8px; }
.mlink { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--blue-weak); color: var(--blue); font-size: 13.5px; font-weight: 500; }
.mlink:hover { background: var(--blue-weak-2); }
.mlink svg { width: 15px; height: 15px; }
.mlink small { color: var(--muted); font-size: 11px; }
.rp-evs { display: grid; margin-top: 14px; }
.rp-ev { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink); min-width: 0; }
.rp-ev:last-child { border-bottom: 0; }
.rp-ev:hover { color: var(--blue); }
.rp-ev .d { min-width: 96px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-ev .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.flat-list { padding: 6px 18px; }

.md-c h2 { margin: 24px 0 10px; }
.md-list { display: grid; gap: 8px; }
.md-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) auto auto auto; gap: 14px; align-items: center; background: var(--surface); border-radius: 16px; box-shadow: var(--sh-card); padding: 12px 16px; }
.md-t { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.md-t:hover b { color: var(--blue); }
.md-t b { font-weight: 600; color: var(--ink-strong); }
.md-t small { display: block; font-size: 12.5px; font-weight: 500; color: var(--blue); }
.md-b { display: flex; flex-wrap: wrap; gap: 4px; }
.md-pg { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.md-pg input { width: 74px; padding: 6px 10px; border-radius: 10px; text-align: right; }
.md-cost { min-width: 72px; text-align: right; font-weight: 600; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.mtx-card { padding: 0; overflow: hidden; }
.mtx-scroll { overflow-x: auto; }
table.mtx { width: 100%; border-collapse: separate; border-spacing: 0; }
.mtx th, .mtx td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.mtx th { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); background: #FCFCFE; }
.mtx th:first-child, .mtx td:first-child { text-align: left; padding-left: 20px; }
.mtx td:first-child { font-weight: 600; color: var(--ink-strong); white-space: normal; min-width: 180px; }
.mtx tr:last-child td { border-bottom: 0; }
.mtx tbody tr:hover td { background: #FBFAFF; }
.mtx-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-weak); }
.pk-list { display: grid; gap: 6px; max-height: 54vh; overflow: auto; padding: 2px; }
.pk-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 14px; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.pk-row:hover { border-color: var(--sky-2); background: #F7F5FF; }
.pk-row .grow { flex: 1; min-width: 0; }
.pk-row b { font-weight: 600; color: var(--ink-strong); }
.pk-row small { display: block; font-size: 12px; color: var(--blue); }

/* ingredients */
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: 12px; }
.ig { display: flex; flex-direction: column; gap: 4px; min-width: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--sh-card); padding: 13px 15px; transition: box-shadow .2s, transform .2s var(--ease); }
.ig.click { cursor: pointer; }
.ig.click:hover, .ig.click:focus-visible { box-shadow: var(--sh-hover); transform: translateY(-1px); }
.ig-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ig-n { flex: 1; min-width: 0; font-weight: 600; color: var(--ink-strong); line-height: 1.3; }
.ig-a { font-size: 12.5px; font-weight: 500; color: var(--blue); padding-left: 18px; }
.ig-p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ig-p b { font-size: 16px; color: var(--ink-strong); }
.ig-p > span { font-size: 12.5px; color: var(--muted); }
.ig-p .ig-pack { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.ig-m { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.ig-m .faint { font-size: 12px; }
.ig-m .low { color: var(--amber); font-weight: 600; }
.ig-al { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* price freshness (0047): when the price is from and how it moved */
.ig-pr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--faint); }
.ig-pr.old { color: var(--amber); }
.dl { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dl.up { color: var(--red); }
.dl.down { color: var(--green); }
.if-pr { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.if-np { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.if-np label { display: flex; align-items: center; gap: 6px; }
.if-np input { width: 96px; }
.if-np input[name=ns] { width: 140px; }
.if-hist { gap: 6px; max-height: 240px; overflow-y: auto; }
.if-hist .item { padding: 8px 12px; }
.sh-paid { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
/* prices from a receipt */
.rp-up { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.rp-up label:first-child { flex: 1 1 220px; }
.rp-file { position: relative; overflow: hidden; }
.rp-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rp-sub { margin: 14px 0 4px; font-size: 15px; }
.rp-wait { display: flex; align-items: center; gap: 10px; padding: 24px 0; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--blue-weak); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rp-warn { border-left: 4px solid var(--amber); }
.rp-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.rp-rows { display: grid; gap: 8px; }
.rp-row { display: grid; grid-template-columns: 24px minmax(0, 1.2fr) minmax(0, 1.7fr) 110px 100px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-card); }
.rp-row.off { opacity: .62; }
.rp-row select, .rp-row input { min-width: 0; }
.rp-t { display: grid; min-width: 0; }
.rp-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-strong); font-size: 13.5px; }
.rp-q, .rp-c { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.rp-q input, .rp-c input { width: 100%; }
.rp-p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rp-p b { font-size: 14px; color: var(--ink-strong); }
.rp-p > span { color: var(--muted); }
.rp-err { color: var(--amber); font-weight: 600; }
.rp-upd { font-size: 12.5px; white-space: nowrap; }
.rp-f { position: sticky; bottom: 0; padding-top: 10px; background: var(--surface); }
@media (max-width: 900px) {
  .rp-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
  .rp-row select, .rp-p { grid-column: 2 / -1; }
  .rp-q { grid-column: 2; } .rp-c { grid-column: 3; }
  .rp-upd { grid-column: 2 / -1; }
  .rp-row > span:last-child { display: none; }
  .rp-t b { white-space: normal; }
}
.alg-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px 14px; margin-top: 8px; }

@media (max-width: 960px) {
  .rp-cols { grid-template-columns: minmax(0, 1fr); }
  .md-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .md-row .md-b { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .rx-tools .search { flex-basis: 100%; max-width: none; }
  .rx-tools .tabs { width: 100%; }
  .rx-tools .cu-sort { flex: 1 1 40%; min-width: 0; }
  .dd { position: static; }
  .dd-pop { left: 0; right: 0; width: auto; }
  .dd-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rp-hero { padding: 18px 18px 20px; border-radius: var(--r); }
  .rp-main { gap: 14px; }
  .flag.xl { width: 54px; height: 36px; border-radius: 8px; }
  .flag.xl.none { width: 36px; height: 36px; }
  .rp-img { width: 96px; height: 80px; border-radius: 14px; }
  .ln { gap: 10px; }
  .ln-c { min-width: 0; }
  .md-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 10px; }
  .md-row .md-t, .md-row .md-b { grid-column: 1 / -1; grid-row: auto; }
  .mc-c { grid-template-columns: 72px minmax(0, 1fr); }
}

/* Events list (/events): month groups, one row per event - date tile, title + time/venue, fill bar, status. */
.evl-group h2 { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 12px; }
.evl-group h2 span { font-size: 13px; font-weight: 600; color: var(--faint); }
.evl-group:first-of-type h2 { margin-top: 8px; }
.evl { display: flex; flex-direction: column; gap: 10px; }
a.evl-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 170px 120px; align-items: center; gap: 20px; padding: 14px 22px 14px 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-card); color: var(--ink); transition: box-shadow .2s, transform .2s var(--ease); }
a.evl-row:hover { box-shadow: var(--sh-hover); transform: translateY(-1px); color: var(--ink); }
.evl-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.evl-title { font-weight: 600; font-size: 16px; color: var(--ink-strong); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--muted); }
.st.private { background: var(--surface-2); color: var(--ink); }
.st.private::before { display: none; }
.evl-fill { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.evl-num b { font-size: 15px; font-weight: 700; color: var(--ink-strong); }
.evl-bar { height: 6px; border-radius: var(--r-pill); background: var(--blue-weak); overflow: hidden; }
.evl-bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.evl-fill.full .evl-bar i { background: var(--green); }
.evl-st { justify-self: end; }
@media (max-width: 640px) {
  a.evl-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "d m m" "d f s"; gap: 10px 14px; padding: 12px 14px; }
  a.evl-row > .ev-date { grid-area: d; align-self: start; }
  .evl-main { grid-area: m; } .evl-fill { grid-area: f; } .evl-st { grid-area: s; align-self: end; }
  .evl-title { white-space: normal; }
}

/* Lead stage stepper (leads.js stepper()). Deliberately NOT a pill bar: tabs switch views,
   this changes the lead's status - so it looks like a progress line with numbered dots. */
.stepper { display: flex; align-items: center; gap: 14px; margin: 6px 0 20px; padding: 12px 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-card); }
.stepper .st-cap { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.stepper ol { display: flex; align-items: center; flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.stepper li { display: flex; align-items: center; flex: 1 1 auto; min-width: max-content; }
.stepper li:first-child { flex: none; }
.stepper li + li::before { content: ""; flex: 1; min-width: 14px; height: 2px; margin: 0 8px; background: var(--line); border-radius: 1px; }
.stepper li.past + li::before { background: var(--blue); }
.stepper li button { appearance: none; border: 0; background: none; padding: 4px; display: inline-flex; align-items: center; gap: 8px; font: 500 13.5px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.stepper li button:disabled { cursor: default; }
.stepper .dot { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--line); color: var(--faint); background: var(--surface); transition: background .2s var(--ease), border-color .2s; }
.stepper .dot svg { width: 13px; height: 13px; }
.stepper li.past .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper li.past button { color: var(--ink); }
.stepper li.now .dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--blue-weak); }
.stepper li.now button { color: var(--blue); font-weight: 700; }
.stepper li button:not(:disabled):hover .dot { border-color: var(--blue); }
.stepper li button:not(:disabled):hover { color: var(--blue); }
.stepper .ends { display: flex; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.stepper .ends .btn { color: var(--muted); }
.stepper .ends svg { width: 14px; height: 14px; }
.stepper .end-done:not(:disabled):hover, .stepper .end-done.on { border-color: var(--green); color: var(--green); background: var(--green-weak); }
.stepper .end-lost:not(:disabled):hover, .stepper .end-lost.on { border-color: var(--red); color: var(--red); background: var(--red-weak); }
.stepper.lost ol { opacity: .45; }
@media (max-width: 640px) {
  .stepper { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .stepper ol { flex-basis: 100%; order: 2; }
  .stepper li:not(.now) .lbl { display: none; }  /* phone: dots only, current stage keeps its name */
  .stepper li + li::before { min-width: 6px; margin: 0 4px; }
  .stepper li button { padding: 2px; }
  .stepper .ends { margin-left: auto; border-left: 0; padding-left: 0; }
}

/* certificates (certificates.js): search + issue in the head, KPI with a clickable «сгорает»,
   tabs with counts, table with a balance meter and «через N дней» under the date */
.ce-head { align-items: center; }
.ce-head > h1 { flex: none; }
.ce-act { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; }
.ce-act .search { flex: 0 1 300px; width: 300px; min-width: 0; }
.ce-act .btn { flex: none; }
.ce-act .btn svg { width: 16px; height: 16px; }
.ce-kpi { margin-bottom: 22px; }
a.card.kpi { display: grid; }   /* a.card is block; a clickable tile keeps the kpi grid */
.ce-kpi a.kpi { transition: box-shadow .2s, transform .2s var(--ease); }
.kpi.warn .ic { background: var(--amber-weak); color: var(--amber); }
.kpi.warn .n { color: var(--amber); }
.ce-tabs { margin: 0 0 16px; }
.ce-list { transition: opacity .15s; }
.ce-list.busy { opacity: .55; }
.ce-list .t th:first-child, .ce-list .t td:first-child { padding-left: 20px; }
.ce-list .t th:last-child, .ce-list .t td:last-child { padding-right: 20px; }
.ce-code { display: inline-flex; align-items: center; gap: 10px; }
.ce-code svg { width: 34px; height: 34px; padding: 8px; border-radius: 11px; background: var(--blue-weak); color: var(--blue); flex: none; }
.ce-code code { background: none; padding: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ink-strong); }
.ce-code + .ce-sub { padding-left: 44px; }
.ce-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.ce-who { font-weight: 600; color: var(--ink-strong); }
.ce-bal { display: inline-grid; justify-items: end; min-width: 120px; }
.ce-bal b { font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.ce-bal b.muted { color: var(--muted); }
.ce-meter { width: 100%; height: 4px; margin-top: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.ce-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sky-2), var(--blue)); }
.kpi .ce-meter { grid-column: 1 / -1; margin-top: 12px; }
.ce-meter.on-hero { background: rgba(255, 255, 255, .18); }
.ce-meter.on-hero i { background: #fff; }
.ce-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ce-left { margin-top: 2px; font-size: 12px; color: var(--muted); }
.ce-left.warn { color: var(--amber); font-weight: 600; }
.ce-left.bad { color: var(--red); font-weight: 600; }
.kpi .ce-left.cmp { grid-column: 1 / -1; }
/* on «Активные» every row is active: the status is quiet text, only deviations get colour */
.ce-list .st.active { background: none; padding-left: 0; padding-right: 0; color: var(--muted); font-weight: 500; }
.ce-list .st.active::before { background: var(--green); }
/* Fixed grid: column widths and row height don't depend on which rows a tab shows,
   so switching tabs doesn't make the table jump. Desktop only - phones get cards. */
@media (min-width: 641px) {
  .ce-list .t { table-layout: fixed; }
  .ce-list .t th:nth-child(1) { width: 28%; }
  .ce-list .t th:nth-child(2) { width: 24%; }
  .ce-list .t th:nth-child(3) { width: 16%; }
  .ce-list .t th:nth-child(4) { width: 18%; }
  .ce-list .t th:nth-child(5) { width: 14%; }
  .ce-list .t td { box-sizing: border-box; height: 80px; overflow: hidden; text-overflow: ellipsis; }
  .ce-list .t td > .ce-who, .ce-list .t td > .ce-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ce-list .ce-bal { min-width: 0; width: 100%; }
}
/* card */
/* card head: code + PIN as one ticket, meta line under it, actions centred against the block */
.ce-cardhead { align-items: center; }
.ce-ticket { display: flex; width: max-content; align-items: center; gap: 12px; margin: 10px 0 12px; padding: 8px 8px 8px 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-card); max-width: 100%; }
.ce-ticket > svg { width: 40px; height: 40px; padding: 9px; border-radius: 13px; background: linear-gradient(135deg, var(--sky), var(--sky-2)); color: var(--blue-deep); flex: none; }
.ce-ticket code { background: none; padding: 0; color: var(--ink-strong); font-weight: 700; letter-spacing: .08em; }
.ce-tk-code { font-size: 24px; }
.ce-tk-sep { align-self: stretch; width: 0; margin: 2px 2px; border-left: 2px dashed var(--line); }
.ce-tk-pin { display: inline-flex; align-items: baseline; gap: 8px; }
.ce-tk-pin code { font-size: 20px; color: var(--blue); }
.ce-tk-l { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.ce-meta { gap: 6px 10px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.ce-meta > span + span::before, .ce-meta > span + a::before { content: "·"; margin-right: 10px; color: var(--faint); }
.ce-meta > .st + span::before { content: none; }
.ce-newpin { padding: 2px 6px; color: var(--blue); font-size: 13px; font-weight: 500; }
.ce-newpin:hover { text-decoration: underline; }
.ce-acts { flex-wrap: wrap; }
.ce-copy { border: 0; background: var(--surface-2); color: var(--muted); flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.ce-copy:hover { background: var(--blue-weak); color: var(--blue); }
.ce-copy svg { width: 18px; height: 18px; }
.ce-people { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.ce-pt { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 4px; }
.ce-msg { grid-column: 1 / -1; margin: 0; padding: 12px 16px; border-left: 3px solid var(--sky-2); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-style: italic; color: var(--ink); }
.ce-person { min-width: 0; }
.ce-mail { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; margin-top: 2px; }
.ce-mail .muted { overflow-wrap: anywhere; }
.ce-mail .btn { padding: 4px 10px; font-size: 12.5px; }
.ce-mail .btn svg { width: 14px; height: 14px; }
.ce-hist .card.empty { padding: 18px 20px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; }
.ce-hist .card.empty::before { display: inline; margin: 0; font-size: 15px; }
.ce-cancel { grid-column: 1 / -1; color: var(--red); font-size: 13px; }
.ce-amt.plus { color: var(--green); }
.ce-amt.minus { color: var(--red); }
@media (max-width: 640px) {
  .ce-act { width: 100%; }
  .ce-act .search { flex: 1; width: auto; }
  .ce-people { grid-template-columns: minmax(0, 1fr); }
  .ce-tk-code { font-size: 14px; letter-spacing: .02em; }   /* TT-XXXX-XXXX-XXXX (0039) is 17 characters */
  .ce-ticket { flex-wrap: wrap; row-gap: 6px; width: auto; }
  .ce-tk-pin code { font-size: 16px; }
  .ce-ticket { gap: 7px; }
  .ce-ticket > svg { width: 34px; height: 34px; padding: 7px; }
  .ce-list .t.m-cards td.num { text-align: left !important; }  /* beats .num !important */
  .ce-bal { justify-items: start; min-width: 0; width: 160px; vertical-align: top; }
  .ce-code + .ce-sub { padding-left: 0; }
}

/* dish photo gallery (gallery.js): recipe and menu pages */
.gal-card { margin: 18px 0 16px; transition: box-shadow .2s var(--ease); }
.gal-card.gal-drop { box-shadow: 0 0 0 2px var(--sky-2), var(--sh-card); }
.gal-h { display: flex; align-items: baseline; gap: 8px; }
.gal-h h2 { margin: 0; }
.gal-add { position: relative; margin-left: auto; align-self: center; }
.gal-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gal { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 12px; margin-top: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 4px; }
.gal-i { position: relative; display: block; height: 128px; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); scroll-snap-align: start; }
.gal-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gal-i img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.gal-i:hover img { transform: scale(1.04); }
/* Edit / delete right on the card: on hover with a mouse, always on touch screens */
.gal-act { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.gal-i:hover .gal-act, .gal-i:focus-within .gal-act { opacity: 1; }
@media (hover: none) { .gal-act { opacity: 1; } }
.gal-act button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--blue); cursor: pointer; box-shadow: 0 2px 8px -2px rgba(20, 10, 60, .35); }
.gal-act button:hover { background: #fff; }
.gal-act button.del { color: var(--red); }
.gal-act svg { width: 15px; height: 15px; }
.gal-cover { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .92); color: var(--blue); font-size: 11px; font-weight: 600; }
.gal-cover svg { width: 12px; height: 12px; }
.gal-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; background: linear-gradient(transparent, rgba(20, 10, 60, .62)); color: #fff; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-busy { display: grid; place-items: center; cursor: default; color: var(--muted); font-size: 12.5px; animation: gal-pulse 1.2s var(--ease) infinite alternate; }
@keyframes gal-pulse { from { opacity: .55; } to { opacity: 1; } }
.gal-empty { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 16px; border: 1.5px dashed var(--field); border-radius: var(--r-sm); color: var(--muted); font-size: 13.5px; }
.gal-empty svg { flex: none; width: 22px; height: 22px; color: var(--sky-2); }

.modal.lb-modal #modal-body { padding: 0; overflow: hidden; }
.lb-img { position: relative; display: grid; place-items: center; background: #14102e; min-height: 240px; }
.lb-img img { display: block; max-width: 100%; max-height: 74vh; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .88); color: var(--blue); cursor: pointer; }
.lb-x { position: absolute; top: 12px; right: 12px; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .88); color: var(--blue); cursor: pointer; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px 12px 20px; }
.lb-n { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.lb-cap, .lb-capt, .lb-dish { flex: 1 1 220px; min-width: 0; }
.lb-capt { font-size: 14px; }
.lb-dish { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lb-dish svg { width: 16px; height: 16px; }
.lb-is-cover { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--blue); padding: 0 6px; }
.lb-is-cover svg { width: 15px; height: 15px; }

/* Photo editor (photo-edit.js) */
.modal.pe-modal #modal-body { padding: 18px 20px 16px; }
.pe-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pe-tools > .btn svg { width: 17px; height: 17px; }
.pe-ratio { margin: 0 0 0 auto; }
.pe-ratio a { padding: 6px 12px; font-size: 12.5px; }
.pe-ratio svg { width: 14px; height: 14px; }
.pe-stage { display: grid; place-items: center; overflow: hidden; margin-top: 12px; padding: 14px; border-radius: var(--r-sm); background: #14102e; }
.pe-wrap { position: relative; display: inline-block; touch-action: none; user-select: none; -webkit-user-select: none; line-height: 0; }
.pe-pv { display: block; max-width: 100%; max-height: 56vh; }
.pe-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(10, 6, 30, .58); outline: 1.5px solid #fff; cursor: move; }

.pe-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255, 255, 255, .45) calc(33.33% - .5px), rgba(255, 255, 255, .45) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .45) calc(66.66% - .5px), rgba(255, 255, 255, .45) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
  linear-gradient(180deg, transparent calc(33.33% - .5px), rgba(255, 255, 255, .45) calc(33.33% - .5px), rgba(255, 255, 255, .45) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .45) calc(66.66% - .5px), rgba(255, 255, 255, .45) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.pe-h { position: absolute; width: 22px; height: 22px; }
.pe-h::after { content: ""; position: absolute; inset: 6px; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.pe-h.nw { left: -11px; top: -11px; cursor: nwse-resize; } .pe-h.se { right: -11px; bottom: -11px; cursor: nwse-resize; }
.pe-h.ne { right: -11px; top: -11px; cursor: nesw-resize; } .pe-h.sw { left: -11px; bottom: -11px; cursor: nesw-resize; }
.pe-h.n, .pe-h.s { left: calc(50% - 11px); cursor: ns-resize; } .pe-h.n { top: -11px; } .pe-h.s { bottom: -11px; }
.pe-h.w, .pe-h.e { top: calc(50% - 11px); cursor: ew-resize; } .pe-h.w { left: -11px; } .pe-h.e { right: -11px; }
.pe-h.n::after, .pe-h.s::after { inset: 8px 3px; } .pe-h.w::after, .pe-h.e::after { inset: 3px 8px; }
.pe-crop.fixed .pe-h.n, .pe-crop.fixed .pe-h.s, .pe-crop.fixed .pe-h.w, .pe-crop.fixed .pe-h.e { display: none; }
.pe-adj { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin-top: 14px; }
.pe-adj input[type="range"] { padding: 0; border: 0; box-shadow: none; background: none; accent-color: var(--blue); height: 22px; }
.pe-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.pe-sp { flex: 1; }
@media (max-width: 640px) {
  .gal { grid-auto-columns: 132px; gap: 10px; }
  .gal-i { height: 104px; }
  .lb-img img { max-height: 62vh; }
  .lb-nav { width: 36px; height: 36px; }
  .lb-bar { padding: 10px 12px; }
  .modal.pe-modal #modal-body { padding: 14px 12px 12px; }
  .pe-tools > .btn span { display: none; }
  .pe-ratio { margin: 4px 0 0; }
  .pe-stage { padding: 10px; }
  .pe-pv { max-height: 42vh; }
  .pe-ratio svg { display: none; }
  .pe-adj { grid-template-columns: 1fr; gap: 2px; margin-top: 10px; }
  .pe-adj label { grid-template-columns: 96px 1fr; align-items: center; }
  .pe-foot { flex-wrap: nowrap; gap: 4px; margin-top: 10px; }
  .pe-foot .btn { padding-left: 12px; padding-right: 12px; }
}

/* Cover picture for the ticket shop (cover.js, 0041) */
.cover-f { display: grid; gap: 8px; align-content: start; }
.cover-l { font-size: 13px; font-weight: 500; color: var(--muted); }
.cover-img { width: 100%; max-width: 420px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-sm); box-shadow: var(--sh-card); }
.cover-ph { display: flex; align-items: center; gap: 10px; max-width: 420px; aspect-ratio: 3 / 1; padding: 0 16px; border-radius: var(--r-sm); border: 1.5px dashed var(--field); color: var(--muted); font-size: 13px; }
.cover-ph svg { width: 22px; height: 22px; color: var(--sky-2); flex: none; }

/* Lead card: the location block and the client's dates in the offer (0050) */
.lv .lv-row.gone { opacity: .6; }
.lv .lv-row .t1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lv .lv-busy { color: var(--amber); }
.lv .lv-warn { color: var(--red); }
.lv-ask { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 14px 0 8px; }
.lv-ask label { flex: 0 0 110px; }
.lv-ask > .btn { flex: 1 1 220px; justify-content: center; }
.lv-send { flex: 1 1 320px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lv-send > span { flex: 1 0 100%; }
.lv-send .btn { flex: 1 1 140px; justify-content: center; }
.lv-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lv-pick .chip { cursor: pointer; }
.lv .lv-head { justify-content: space-between; flex-wrap: nowrap; }
.lv .lv-head .row { flex-wrap: nowrap; }
.lv .lv-head select { width: auto; min-width: 0; padding-top: 8px; padding-bottom: 8px; }
.lv .lv-row .t2 { white-space: normal; overflow: visible; text-overflow: clip; }

/* «Воронка» (analytics.js, 0057) */
.fn-mid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-top: 16px; }
.fn { display: grid; gap: 6px; }
.fn-row { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) 44px 40px; gap: 10px; align-items: center; font-size: 14px; }
.fn-bar { height: 14px; border-radius: var(--r-pill); background: var(--bg); overflow: hidden; }
.fn-bar i { display: block; height: 100%; border-radius: inherit; background: var(--sky-2); }
.fn-row.paid .fn-bar i { background: var(--blue); }
.fn-row b { text-align: right; }
.fn-lost { font-size: 12px; color: var(--muted); padding-left: 8px; display: flex; gap: 6px; align-items: center; }
.fn-lost svg { width: 14px; height: 14px; transform: rotate(90deg); }
.fn-err { display: grid; gap: 2px; }
.fn-err > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fn-err > div:last-child { border-bottom: 0; }
.fn-split { margin-top: 16px; }
.fn-days { display: flex; gap: 2px; align-items: stretch; height: 140px; }
.fn-day { flex: 1; min-width: 0; display: grid; grid-template-rows: 1fr 16px; }
.fn-col { position: relative; display: block; }
.fn-col i { position: absolute; left: 12%; right: 12%; bottom: 0; border-radius: 4px 4px 0 0; }
.fn-col i.v, .fn-legend i.v { background: var(--sky); }
.fn-col i.p, .fn-legend i.p { background: var(--blue); }
.fn-day small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible; }
.fn-legend { display: flex; gap: 14px; margin-top: 6px; }
.fn-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.fn-path { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.fn-path li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.fn-path li time { color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-path li.bad { background: #FFF1EF; }
.fn-path li.good { background: #ECF8F1; }
@media (max-width: 960px) {
  .fn-mid { grid-template-columns: 1fr; }
  .fn-row { grid-template-columns: minmax(96px, 130px) minmax(0, 1fr) 36px 34px; font-size: 13px; }
}
.fn-mid .calm { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 500; }
.fn-mid .calm svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- developer credit */
.dev-credit { font-size: 11px; color: var(--muted); text-align: center; letter-spacing: .02em; }
.dev-credit a { color: inherit; font-weight: 600; text-decoration: none; }
.dev-credit a:hover { color: var(--blue); }
.nav .dev-credit { color: rgba(255, 255, 255, .4); padding: 8px 12px 2px; text-align: left; }
.nav .dev-credit a:hover { color: #fff; }
.vp .dev-credit { margin-top: 36px; }

/* Tooltips: x.tip() «?» and the shared bubble from initTips() in app.js */
.lt { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0; }
.qtip { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--sky); background: var(--surface); color: var(--blue); font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 1; letter-spacing: 0; text-transform: none; cursor: help; vertical-align: 1px; user-select: none; transition: background .15s, color .15s; }
.qtip:hover, .qtip:focus-visible { background: var(--blue); border-color: var(--blue); color: #fff; outline: none; }
.tip-bubble { position: fixed; z-index: 10000; max-width: min(300px, calc(100vw - 16px)); padding: 8px 11px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none; white-space: normal; box-shadow: 0 10px 28px -10px rgba(26, 14, 134, .45); pointer-events: none; }
.tip-bubble[hidden] { display: none; }
@media print { .qtip, .tip-bubble { display: none !important; } }

/* Venue page: questions and problems with the manager (0061). */
.vn-post { margin-bottom: 10px; }
.vn-post.resolved { opacity: .72; }
.vn-msg { margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: #F4F4F6; }
.vn-msg.tt { background: var(--blue-weak); }
.vn-body { white-space: pre-wrap; margin-top: 3px; color: var(--ink-strong); }
.vn-ph { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.vn-ph img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; }
.vn-compose { display: grid; gap: 8px; margin-top: 10px; }
.vn-compose textarea { width: 100%; }
