/* Ben: карти за отстъпки. Дизайн в духа на shadcn/ui: неутрални сиви тонове, заоблени
   повърхности, ясни бутони; цветът идва от самите карти. Първо за телефон. */

@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(fonts/onest-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(fonts/onest-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(fonts/onest-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(fonts/onest-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Fluent 2 (Microsoft): неутрални сиви, синьо на марката, леки сенки, заобляне 4/8/12px */
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #F5F5F5;
  --border: #E0E0E0;
  --text: #242424;
  --muted: #616161;
  --faint: #9E9E9E;
  --primary: #0F6CBD;
  --primary-hover: #115EA3;
  --on-primary: #FFFFFF;
  --accent: #0F6CBD;
  --accent-soft: #EBF3FC;
  --danger: #C50F1F;
  --danger-soft: #FDF3F4;
  --ok: #107C10;
  --ok-soft: #F1FAF1;
  --warn: #8A5A00;
  --warn-soft: #FFF9F5;
  --shadow: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14);
  --shadow-lg: 0 0 8px rgba(0,0,0,.12), 0 14px 28px rgba(0,0,0,.14);
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 48px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
/* тъмна тема: по настройката на телефона, освен ако човек не е избрал светла; или по избор */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1F1F;
    --surface: #292929;
    --surface-2: #333333;
    --border: #3D3D3D;
    --text: #FFFFFF;
    --muted: #D6D6D6;
    --faint: #ADADAD;
    --primary: #115EA3;
    --primary-hover: #0F6CBD;
    --on-primary: #FFFFFF;
    --accent: #479EF5;
    --accent-soft: #082338;
    --danger: #DC626D;
    --danger-soft: #3B1418;
    --ok: #54B054;
    --ok-soft: #0E2A0E;
    --warn: #F4BF8B;
    --warn-soft: #3A2A10;
    --shadow: 0 0 2px rgba(0,0,0,.24), 0 2px 4px rgba(0,0,0,.28);
    --shadow-lg: 0 0 8px rgba(0,0,0,.24), 0 14px 28px rgba(0,0,0,.28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1F1F1F;
  --surface: #292929;
  --surface-2: #333333;
  --border: #3D3D3D;
  --text: #FFFFFF;
  --muted: #D6D6D6;
  --faint: #ADADAD;
  --primary: #115EA3;
  --primary-hover: #0F6CBD;
  --on-primary: #FFFFFF;
  --accent: #479EF5;
  --accent-soft: #082338;
  --danger: #DC626D;
  --danger-soft: #3B1418;
  --ok: #54B054;
  --ok-soft: #0E2A0E;
  --warn: #F4BF8B;
  --warn-soft: #3A2A10;
  --shadow: 0 0 2px rgba(0,0,0,.24), 0 2px 4px rgba(0,0,0,.28);
  --shadow-lg: 0 0 8px rgba(0,0,0,.24), 0 14px 28px rgba(0,0,0,.28);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
/* по-голям текст: всичко (и бутоните) става с 15% по-едро */
:root[data-text="large"] body { zoom: 1.15; }
/* екранът с кода е едър и така; без увеличение, за да се събират кодът и номерът */
:root[data-text="large"] .show { zoom: calc(1 / 1.15); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 16px/1.5 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
a { color: var(--accent); }
.ico { width: 22px; height: 22px; flex: none; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 28px; height: 28px; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- основна рамка ---------- */
.shell { max-width: 1100px; margin: 0 auto; padding: calc(var(--safe-t) + 4px) 12px calc(var(--safe-b) + var(--nav-h) + 16px); }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.topbar .count { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.3px; margin-right: auto; min-width: 0; line-height: 1.15; }
.brandmark img { width: 32px; height: 32px; border-radius: 8px; }
.brandmark small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: 1.2; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--text); flex: none; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; text-transform: uppercase;
}
.dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }

.h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.8px; margin: 14px 0 4px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }

/* ---------- търсене ---------- */
.search {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px 0 14px; min-height: 50px;
  box-shadow: var(--shadow);
}
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; height: 48px; font-size: 16px; }
.search .ico { color: var(--muted); }
.search:focus-within { box-shadow: inset 0 -2px 0 var(--accent), var(--shadow); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
/* на телефон: един ред с плъзгане и избледняване вдясно, докато има още; на компютър: пренасят се на нов ред */
.chips.more-right { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.chips.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 82%, transparent); }
.chips.more-left:not(.more-right) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%); mask-image: linear-gradient(90deg, transparent, #000 12%); }
@media (hover: hover) and (pointer: fine), (min-width: 900px) {
  .shell .chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 600; min-height: 38px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .ico { width: 14px; height: 14px; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---------- мрежата с карти ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; font-weight: 700; font-size: 15px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card-tile {
  position: relative; aspect-ratio: 1.586; border-radius: var(--radius); border: 0; padding: 12px;
  background: var(--c, #3F3F46); color: #fff; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 18px -6px var(--c-shadow, rgba(0,0,0,.35));
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 45%, rgba(0,0,0,.12));
}
.card-tile:active { transform: scale(.97); }
.card-tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
/* мястото, където картата ще падне: празна рамка с пунктир, ясно различна от другите карти */
.card-tile.drag-source { background: var(--accent-soft) !important; box-shadow: none !important; outline: 3px dashed var(--accent); outline-offset: -3px; transform: none; transition: none; }
.card-tile.drag-source > *, .card-tile.drag-source::after { visibility: hidden; }
.card-tile.drag-source { animation: slot-in .18s ease-out; }
@keyframes slot-in { from { opacity: .3; } }
.grid:has(.drag-source) .card-tile:not(.drag-source) { opacity: .85; }
.drag-ghost { position: fixed !important; z-index: 70; pointer-events: none; margin: 0; opacity: .9; transform: translateY(-28px) scale(.8) rotate(-2deg); transform-origin: 50% 100%; box-shadow: 0 16px 40px rgba(0,0,0,.35) !important; transition: none !important; will-change: left, top, transform; }
body.dragging { -webkit-user-select: none; user-select: none; }
@media (hover: hover) { .card-tile:hover { transform: translateY(-2px); } }
/* кутията на логото е с фиксирана височина, а ширината следва самото лого:
   широките логота стават широки, квадратните остават малки и името винаги се вижда */
.card-tile .logo-box {
  height: 44px; max-width: 72%; align-self: flex-start; background: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 5px 8px; position: relative; z-index: 1;
}
.card-tile .logo-box.square { padding: 4px; }
.card-tile .logo-box img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
.card-tile .logo-box .monogram { width: 34px; }
.card-tile .name {
  position: relative; z-index: 1; font-weight: 700; font-size: 15px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.card-tile .meta { position: relative; z-index: 1; font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 4px; min-width: 0; }
.card-tile .meta.expiry { font-weight: 700; opacity: 1; }
.card-tile .meta.expiry .ico { width: 14px; height: 14px; }
.card-note.expiry-note { display: flex; align-items: center; justify-content: center; gap: 6px; }
.card-note.expiry-note.soon { color: #8A5A00; font-weight: 700; }
/* избор от няколко (тема, размер на текста): сегменти на един ред */
.seg { display: flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.seg button { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 4px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; font-weight: 600; line-height: 1.2; }
.seg button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.card-tile .meta.holder { opacity: .95; font-weight: 600; }
.card-tile .meta .ico { width: 13px; height: 13px; flex: none; }
.show-sub { display: flex; align-items: center; gap: 6px; min-width: 0; color: #71717A; font-size: 13px; }
.holder-pill { display: inline-flex; align-items: center; gap: 4px; background: #EBF3FC; color: #0F6CBD; border-radius: 999px; padding: 2px 10px 2px 7px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.holder-pill .ico { width: 14px; height: 14px; }
.holder-add { display: inline-flex; align-items: center; gap: 2px; border: 1px dashed #BDBDBD; background: transparent; color: #616161; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; min-height: 26px; }
.holder-add .ico { width: 13px; height: 13px; }
.card-tile .fav { position: absolute; top: 10px; right: 10px; z-index: 1; width: 18px; height: 18px; opacity: .95; }
.card-tile.light { color: #18181B; }
.card-tile.light .name { text-shadow: none; }

.monogram {
  width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px;
  color: var(--c, #3F3F46); font-size: 17px; line-height: 1; text-transform: uppercase;
}

.empty {
  text-align: center; padding: 42px 20px; border: 1px dashed var(--faint); border-radius: 12px; margin-top: 20px;
  background: var(--surface);
}
.empty .art { width: 84px; height: 84px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h2 { margin: 0 0 6px; font-size: 20px; }
.empty p { margin: 0 0 18px; color: var(--muted); }

/* закованата лента долу */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: stretch; justify-content: space-around;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 4px var(--safe-b); background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.nav-item {
  flex: 1 1 0; min-width: 0; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; position: relative; padding: 0 2px;
}
/* без интернет: функциите, които искат сървъра, са бледи и не се натискат */
.is-offline [data-online] { opacity: .38; filter: grayscale(1); cursor: not-allowed; }
.is-offline [data-online]:active { background: none; transform: none; }
.nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.on { color: var(--accent); }
.nav-item.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.nav-item:active { background: var(--surface-2); }
.nav-add {
  flex: 1 1 0; min-width: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; font-weight: 700; color: var(--accent); padding: 0;
}
.nav-add .ico { width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); margin-top: -14px; }
.nav-add:active .ico { transform: scale(.94); }
@media (min-width: 700px) { .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 100%); border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; } }

/* плаващ бутон за добавяне, удобен за палеца */
.fab {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 20px); z-index: 20;
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px;
  background: var(--primary); color: var(--on-primary); padding: 0 24px 0 18px; height: 58px;
  font-weight: 600; font-size: 17px; box-shadow: var(--shadow-lg);
}
.fab:active { transform: translateX(-50%) scale(.96); }

/* ---------- бутони и полета ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 0 18px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 16px;
  background: var(--primary); color: var(--on-primary); text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
@media (hover: hover) { .btn:not(.secondary):not(.outline):not(.ghost):not(.danger):hover { background: var(--primary-hover); } .btn.secondary:hover, .btn.outline:hover { background: var(--border); } }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; max-width: 100%; min-width: 0; white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px 2px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin: 6px 2px 0; white-space: pre-line; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; border-radius: 6px; border: 1px solid var(--border); border-bottom-color: #8A8A8A; background: var(--surface);
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--border); border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.input.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .5px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw .eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 10px; }
.pw .eye:hover { color: var(--text); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.note { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; background: var(--surface-2); }
.note.error { background: var(--danger-soft); color: var(--danger); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note p { margin: 0; }
.note p + p { margin-top: 4px; }

/* ---------- вход и регистрация ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 24px) 16px calc(var(--safe-b) + 24px); }
.auth-box { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero img { width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 12px 30px -10px rgba(15,108,189,.55); }
.auth-hero h1 { font-size: 30px; margin: 14px 0 4px; letter-spacing: -.8px; }
.auth-hero p { margin: 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; min-height: 46px; font-weight: 600; color: var(--muted); position: relative; }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 10px 4px; min-height: 44px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- листове (цял екран на телефон, прозорец на компютър) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(9,9,11,.45); animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 100dvh; background: var(--bg); border-radius: 12px 12px 0 0;
  display: flex; flex-direction: column; animation: up .22s cubic-bezier(.2,.8,.2,1); overflow: hidden;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet.full { height: 100dvh; border-radius: 0; max-width: none; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 12px; max-height: calc(100dvh - 48px); box-shadow: var(--shadow-lg); }
  .sheet.full { height: auto; max-width: 560px; border-radius: 12px; }
  .sheet.wide { max-width: 1000px; }
}
.sheet-head { display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-t) + 6px) 8px 6px; min-height: 60px; border-bottom: 1px solid var(--border); background: var(--bg); }
@media (min-width: 700px) { .sheet-head { padding-top: 6px; } }
.sheet-head h2 { margin: 0; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet-foot { padding: 12px 16px calc(var(--safe-b) + 12px); border-top: 1px solid var(--border); background: var(--bg); }

/* ---------- скенер ---------- */
.scanner {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 240px; border-radius: 18px; overflow: hidden;
  background: #09090B; color: #fff; margin-bottom: 14px;
}
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 14% 12%; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.scanner .frame::before, .scanner .frame::after { content: ""; position: absolute; left: 8%; right: 8%; height: 2px; top: 50%; background: #479EF5; box-shadow: 0 0 12px #479EF5; animation: scanline 1.8s ease-in-out infinite; }
.scanner .frame::after { display: none; }
@keyframes scanline { 0%, 100% { transform: translateY(-40px); } 50% { transform: translateY(40px); } }
.scanner .corner { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; }
.scanner .c1 { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.scanner .c2 { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.scanner .c3 { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.scanner .c4 { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.scanner .tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 2; }
.scanner .tools button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.scanner .tools button[aria-pressed="true"] { background: #FFB900; color: #000; }
.scanner .msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; font-size: 14px; background: #09090B; }
.scanner .msg .btn { margin-top: 10px; }
.scanner .hint { position: absolute; left: 10px; top: 8px; z-index: 2; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 999px; }
.scanner.found .frame { box-shadow: 0 0 0 999px rgba(22,163,74,.35); }
.scanner.found .frame::before { background: #4ADE80; box-shadow: 0 0 12px #4ADE80; animation: none; }

.detected { display: flex; align-items: center; gap: 10px; background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.mode-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.mode-switch .btn { padding: 0 6px; gap: 6px; white-space: normal; line-height: 1.15; text-align: center; font-size: 13px; }

/* избор на верига (autocomplete) */
.brand-pick { position: relative; }
.brand-pick .selected { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 6px 10px; text-align: left; }
.suggest { margin-top: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); max-height: 320px; overflow-y: auto; box-shadow: var(--shadow); }
.suggest button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 8px 12px; min-height: 56px; text-align: left; border-bottom: 1px solid var(--border); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.active { background: var(--surface-2); }
.suggest .cat { font-size: 12px; color: var(--muted); display: block; }
.suggest .add-new { color: var(--accent); font-weight: 700; }
.blogo { width: 44px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex: none; padding: 3px; }
.blogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.blogo .monogram { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--border); }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.colors input[type=color] { width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0; background: none; }

/* ---------- показване на касата ---------- */
.show { position: fixed; inset: 0; z-index: 80; background: #FFFFFF; color: #09090B; display: flex; flex-direction: column; animation: fade .15s ease; color-scheme: light; }
/* визитката се отваря от листа на профила: над листовете, под известията */
.show.over { z-index: 95; }
.show-head { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 10px) 12px 10px 16px; }
.show-head .blogo { width: 48px; height: 48px; border-color: #E4E4E7; }
.show-head h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.show-head p { margin: 0; color: #71717A; font-size: 13px; }
.show-head .icon-btn { color: #09090B; background: #F4F4F5; }
/* средата: центрирана, но ако не се побира, се превърта (не прелива върху заглавието и бутоните) */
.show-head, .show-foot { flex: none; }
.show-code { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 10px 18px; gap: 18px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.show-code > * { flex-shrink: 0; }
.shared-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid #E4E4E7; background: #F4F4F5; color: #3F3F46; font-size: 14px; font-weight: 600; }
.shared-pill .ico { width: 16px; height: 16px; }
.share-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 60px; }
.share-row .grow { min-width: 0; }
.share-row small { display: block; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; flex: none; }
.code-box { width: 100%; max-width: 520px; display: grid; place-items: center; background: #fff; padding: 14px; border-radius: 18px; }
.code-box svg, .code-box canvas, .code-box img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.code-box.qr svg, .code-box.qr canvas, .code-box.twod svg, .code-box.twod canvas { width: min(78vw, 46vh, 360px); }
.code-box.bar svg { max-height: 34vh; }
.code-text {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: clamp(20px, 6.4vw, 30px); font-weight: 700;
  letter-spacing: 1.5px; text-align: center; word-break: break-all; line-height: 1.35; max-width: 560px; user-select: all;
}
.code-text.fit { white-space: nowrap; word-break: normal; overflow: hidden; width: 100%; }
.code-text.long { font-size: 15px; letter-spacing: .3px; font-weight: 600; max-height: 22vh; overflow-y: auto; }
.code-kind { font-size: 13px; color: #71717A; font-weight: 600; text-align: center; }
.show-foot { padding: 8px 12px calc(var(--safe-b) + 12px); }
.show-foot .btn { flex: 1 1 100px; max-width: 200px; }
.show-foot .btn.secondary { background: #F4F4F5; color: #09090B; }
.bright-tip { background: #FFFBEB; color: #92400E; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 16px; display: flex; gap: 10px; align-items: flex-start; }
.bright-tip button { margin-left: auto; border: 0; background: transparent; color: inherit; font-weight: 700; min-height: 32px; }
.card-note { margin: 0 16px; font-size: 14px; color: #52525B; text-align: center; white-space: pre-line; }

.share-actions { display: grid; gap: 8px; margin-bottom: 14px; }
.show-actions { --cols: 3; --gap: 8px; display: flex; justify-content: center; gap: var(--gap); width: 100%; max-width: 520px; margin: 0 auto; }
.show-actions > .act { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.show-actions .act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px;
  border: 0; border-radius: 12px; background: #F5F5F5; color: #242424; text-decoration: none; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.15;
}
.show-actions .act:active { background: #E0E0E0; }
.show-actions.brand-row { margin-top: var(--gap); }
.show-actions.brand-row .act { background: #EBF3FC; color: #0F6CBD; }
.show-actions .act span { max-width: 100%; overflow-wrap: anywhere; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-slot { display: flex; flex-direction: column; gap: 6px; }
.photo-pick { border: 1px dashed var(--faint); background: var(--surface-2); border-radius: 8px; padding: 0; aspect-ratio: 1.586; overflow: hidden; color: var(--muted); }
.photo-thumb { width: 100%; height: 100%; display: grid; place-items: center; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-view { display: grid; place-items: center; }
.photo-view img { max-width: 100%; max-height: calc(100dvh - 180px); border-radius: 12px; box-shadow: var(--shadow); }
.row > .grow { flex: 1 1 180px; }
.btn.viber { background: #7360F2; color: #fff; }
.link-page { position: static; min-height: 100dvh; }

/* ---------- тост ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + var(--nav-h) + 14px); transform: translate(-50%, 20px); z-index: 100;
  background: #292929; color: #FFFFFF; padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast { white-space: pre-line; }
.share-how { background: var(--accent-soft); color: var(--text); margin-top: -4px; }
.share-how p { display: block; }
.share-how p:first-child { display: flex; align-items: center; gap: 6px; color: var(--accent); margin-bottom: 4px; }
#toast.error { background: #C50F1F; color: #fff; }

/* ---------- профил и меню ---------- */
.menu-list { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.menu-list > button, .menu-list > a, .menu-list > .menu-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; background: transparent;
  text-align: left; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); font-weight: 600;
}
.menu-list > :last-child { border-bottom: 0; }
.menu-list > button:hover, .menu-list > a:hover { background: var(--surface-2); }
.menu-list .val { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; }
.menu-list .danger { color: var(--danger); }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 22px; }
.profile-head h3 { margin: 0; font-size: 20px; }
.profile-head p { margin: 0; color: var(--muted); font-size: 14px; word-break: break-all; }
.switch { margin-left: auto; width: 50px; height: 30px; border-radius: 999px; background: var(--border); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(20px); }

/* ---------- сгъваеми секции ---------- */
details.fold { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 58px; cursor: pointer; font-weight: 700; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold > summary small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
details.fold > .fold-body { padding: 0 16px 16px; }

/* ---------- админ ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.5px; }
.stat span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.nw { white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.log-item .top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-item .when { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.log-item .who { font-weight: 700; word-break: break-all; }
.log-item .info { color: var(--muted); font-size: 13px; margin-top: 4px; word-break: break-word; }
.log-item details { margin-top: 6px; }
.log-item summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.log-item pre { background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.filters .input { min-height: 46px; padding: 10px 12px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.admin-tabs .chip { flex: 1 1 auto; justify-content: center; }
.admin-tabs::-webkit-scrollbar { display: none; }
.kv { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 13px; word-break: break-all; margin-bottom: 12px; }
.linkbox span { flex: 1; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.link-page .show-foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.link-page .show-foot .btn { flex: 1 1 140px; max-width: 260px; }
.fb-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.fb-type { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; font-size: 12px; font-weight: 600; padding: 6px 2px; }
.fb-type[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fb-pick { width: 120px; aspect-ratio: 3 / 4; }
.fb-text { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.fb-reply { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 13px; }
.fb-img { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.probe-preview { max-width: 220px; margin-bottom: 14px; }
.probe-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.probe-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 4px; min-height: 96px; color: #242424; }
.probe-logo img { max-width: 100%; height: 48px; object-fit: contain; }
.probe-logo .monogram { height: 48px; }
.probe-logo small { font-size: 11px; color: #616161; text-align: center; line-height: 1.2; }
.log-item .info.geo { display: flex; align-items: center; gap: 4px; }
.log-item .info.geo .ico { width: 14px; height: 14px; flex: 0 0 auto; }
/* списък за пазаруване */
.shop-add { display: flex; gap: 8px; margin-bottom: 12px; }
.shop-add .input { flex: 1 1 auto; min-width: 0; }
.shop-add .btn { flex: 0 0 auto; min-width: 48px; padding: 0 12px; }
.shop-list { display: flex; flex-direction: column; gap: 2px; }
.shop-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 2px 4px; border-bottom: 1px solid var(--border); }
.shop-item .grow { min-width: 0; overflow-wrap: anywhere; }
.shop-item .tick { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--faint); background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--on-primary); padding: 0; }
.shop-item.done .tick { background: var(--primary); border-color: var(--primary); }
.shop-item.done .grow span { text-decoration: line-through; color: var(--muted); }
.show-actions .act.follow[aria-pressed="true"] { background: #0F6CBD; color: #FFFFFF; }
/* карти наблизо: лента най-отгоре на началния екран */
.nearby { display: flex; align-items: center; gap: 4px; margin: 8px 0 4px; padding: 4px 4px 4px 0; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); }
.nearby-go { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 10px; border: 0; background: transparent; color: var(--text); text-align: left; min-height: 56px; }
.nearby-go .blogo { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px; }
.nearby-go .blogo img { max-width: 100%; max-height: 100%; }
.nearby-go .grow { min-width: 0; }
.nearby-go b, .nearby-go small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-go small { color: var(--accent); font-weight: 600; }
.wallet-btn { display: inline-flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 10px 16px; min-height: 44px; border-radius: 22px; border: 0; background: #1F1F1F; color: #FFFFFF; font-weight: 600; font-size: 14px; }
.ok-text { color: var(--ok); white-space: pre-line; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin: 4px 0; }
/* ръководство */
.help-hero { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 14px; border-radius: var(--radius); color: #FFFFFF;
  background: linear-gradient(135deg, #479EF5 0%, #0F6CBD 55%, #0C3B5E 100%); }
.help-hero img { border-radius: 14px; flex: 0 0 auto; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.help-hero b { display: block; font-size: 18px; line-height: 1.25; }
.help-hero p { margin: 4px 0 0; opacity: .9; font-size: 14px; }
.help-list { display: flex; flex-direction: column; gap: 8px; }
.help-steps { margin: 0; padding-left: 22px; }
.help-steps li { margin: 0 0 10px; line-height: 1.5; }
.help-steps li::marker { color: var(--accent); font-weight: 700; }
/* визитка */
.vcard-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.vcard-card .avatar { flex: 0 0 auto; }
.vcard-card .grow { min-width: 0; }
.vcard-card b { display: block; font-size: 18px; line-height: 1.25; }
.vcard-card small { display: block; color: var(--muted); margin-top: 2px; }
.vcard-card .vline { margin-top: 6px; font-size: 15px; overflow-wrap: anywhere; }
.vphoto { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.vphoto.sm { width: 48px; height: 48px; }
.vphoto.lg { width: 128px; height: 128px; box-shadow: var(--shadow-lg); }
.vphoto-row { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.vphoto-row small { display: block; }
.vphoto-btn { padding: 0; border: 0; background: none; border-radius: 50%; }
.vphoto-pick { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 2px dashed var(--border); color: var(--muted); }
.vphoto-pick img { width: 100%; height: 100%; object-fit: cover; }
.linkish { border: 0; background: none; padding: 6px 10px 6px 0; color: var(--accent); font-weight: 600; min-height: 36px; }
.linkish.danger { color: var(--danger); }
.vpage { max-width: 440px; margin: 0 auto; padding: calc(var(--safe-t) + 32px) 16px 32px; }
.vhead { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 20px; }
.vhead h1 { margin: 16px 0 4px; font-size: 26px; line-height: 1.2; }
.vhead p { margin: 0; }
.avatar.lg { width: 128px; height: 128px; font-size: 44px; }
.vrows { margin-top: 16px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 52px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.vrow:last-child { border-bottom: 0; }
.vrow .ico { color: var(--accent); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 340px) { .two-col { grid-template-columns: 1fr; } }
.show-head .avatar { width: 48px; height: 48px; flex: 0 0 auto; }
/* NFC */
.nfc-wait { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 0 10px; }
.nfc-wait b { font-size: 18px; }
.nfc-wait p { margin: 0; }
.nfc-ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 8px; animation: nfcpulse 1.4s ease-out infinite; }
.nfc-ring .ico { width: 44px; height: 44px; }
.nfc-ring.ok { color: #fff; background: var(--ok); animation: none; }
.nfc-ring.bad { color: var(--danger); background: var(--danger-soft); animation: none; }
@keyframes nfcpulse { 0% { box-shadow: 0 0 0 0 rgba(71,158,245,.5); } 100% { box-shadow: 0 0 0 26px rgba(71,158,245,0); } }
@media (prefers-reduced-motion: reduce) { .nfc-ring { animation: none; } }
/* внос */
.imp-way { display: flex; gap: 14px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.imp-way .grow { min-width: 0; }
.imp-way b { font-size: 17px; }
.imp-way p { margin: 4px 0 8px; }
.imp-ic { width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.imp-list { display: flex; flex-direction: column; gap: 10px; }
.imp-row { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.imp-row.bad { opacity: .7; }
.imp-top { display: flex; align-items: center; gap: 12px; }
.imp-top .grow { min-width: 0; }
.imp-top b { display: block; overflow-wrap: anywhere; }
.imp-top small { display: block; }
.imp-top input[type=checkbox] { width: 26px; height: 26px; flex: none; accent-color: var(--primary); }
.imp-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
/* търсене и подредба, често ползвани */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .search { flex: 1 1 auto; min-width: 0; }
.sort-btn { flex: none; width: 48px; height: 48px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; }
.top-row[hidden] { display: none; }
.freq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.freq-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--radius); border: 0; background: var(--c); color: #fff; font-size: 13px; font-weight: 700; min-width: 0; box-shadow: var(--shadow); }
.freq-card .blogo { width: 40px; height: 40px; }
.freq-card .ellipsis { max-width: 100%; }
.freq-card small { font-size: 11px; font-weight: 600; opacity: .9; margin-top: -4px; }
.freq-card.light { color: #242424; }
/* „Още“ и колата */
.more-list { display: flex; flex-direction: column; gap: 10px; }
.more-tile { display: flex; align-items: center; gap: 14px; padding: 14px; min-height: 76px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--shadow); }
.more-tile .grow { min-width: 0; }
.more-tile b { display: block; font-size: 17px; }
.more-tile small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-tile.warn small { color: #B26A00; font-weight: 700; }
.more-tile.bad small { color: var(--danger); font-weight: 700; }
.more-ic { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #479EF5, #0F6CBD); }
.cars { display: flex; flex-direction: column; gap: 14px; }
.car { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; box-shadow: var(--shadow); }
.car-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.car-head .grow { min-width: 0; }
.car-head b { display: block; }
.car-head small { display: block; }
.plate { display: inline-flex; align-items: stretch; height: 36px; border: 2px solid #1b1b1f; border-radius: 6px; overflow: hidden; background: #fff; color: #111; flex: none; }
.plate .eu { background: #003399; color: #FFCC00; font-size: 9px; font-weight: 800; width: 20px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 3px; color: #fff; }
.plate .eu i { color: #FFCC00; font-style: normal; font-size: 10px; line-height: 1; margin-bottom: 2px; }
.plate b { padding: 0 8px; display: flex; align-items: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .5px; white-space: nowrap; }
.car-row { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--border); font-size: 15px; }
.car-row .grow { min-width: 0; }
.due { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.due.ok { background: var(--ok-soft); color: var(--ok); }
.due.warn { background: #FFF4CE; color: #8A5A00; }
.due.bad { background: var(--danger-soft); color: var(--danger); }
.due.none { color: var(--faint); font-weight: 600; }
.car-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.car-actions .btn { flex: 1 1 140px; }
.plate-input { text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; }
.empty.small { padding: 20px 0; text-align: center; }
/* остатък и печати (на белия екран с кода) */
.counters { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.counters .bal, .counters .stamps { border: 1px solid #E4E4E7; border-radius: 14px; padding: 10px 12px; background: #FAFAFA; color: #242424; }
.counters .bal { display: flex; align-items: center; gap: 8px; }
.counters .bal .grow { min-width: 0; }
.counters .bal small { display: block; color: #71717A; font-size: 12px; }
.counters .bal b { font-size: 20px; }
.counters .bal .btn.secondary { background: #EFEFF1; color: #242424; }
.counters .icon-btn { color: #242424; background: #EFEFF1; }
.sdots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.sdot { width: 30px; position: static; height: 30px; border-radius: 50%; border: 2px dashed #BDBDBD; display: grid; place-items: center; color: #0F6CBD; }
.sdot.on { border: 2px solid #0F6CBD; background: #EBF3FC; }
.sdot.last { border-color: #FFB900; color: #B26A00; }
.sdot .ico { width: 16px; height: 16px; }
.stamp-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.stamps.full { border-color: #FFB900; background: #FFF8E1; }
.amount-input { font-size: 28px; font-weight: 700; text-align: center; }
/* бележки и гаранции */
.rc-list { display: flex; flex-direction: column; gap: 8px; }
.rc-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 64px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; }
.rc-item .grow { min-width: 0; }
.rc-item b, .rc-item small { display: block; }
.rc-ic { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; color: var(--accent); padding: 3px; }
.rc-ic img { max-width: 100%; max-height: 100%; }
.rc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; max-width: 45%; }
.rc-right .due { white-space: normal; text-align: right; font-size: 11px; }
.rc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rc-facts > div { padding: 10px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.rc-facts small { display: block; color: var(--muted); font-size: 12px; }
.rc-facts .due { display: inline-block; margin-top: 2px; white-space: normal; }
.rc-note { margin: 0 0 12px; }
.rc-photo img { width: 100%; height: auto; border-radius: 10px; display: block; }
.rc-pick { width: 100%; margin-bottom: 12px; }
.rc-shot { width: 100%; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.rc-shot img { width: 100%; height: 100%; object-fit: cover; }
.rc-years { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 8px; }
.share-actions.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* вход с Google */
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.google-btn .ico { color: #4285F4; }
.email-pick { display: flex; gap: 8px; align-items: stretch; }
.email-pick .input { flex: 1 1 auto; min-width: 0; }
.email-pick .contact-pick { flex: 0 0 auto; min-height: 44px; padding: 0 12px; }
.share-preview img { display: block; width: 100%; height: auto; border-radius: 12px; margin: 0 0 14px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 18px -8px rgba(0,0,0,.3); }
.probe-upload { border-style: dashed; color: var(--accent); background: var(--surface); }
.probe-upload .ico { width: 36px; height: 36px; margin-top: 6px; }
.probe-logo[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.dynamic-note { background: #FFF9F5; color: #8A5A00; border-radius: 8px; padding: 8px 12px; font-size: 13px; max-width: 440px; }

/* Двустранно подравняване на текстовете от няколко реда (с пренасяне по български правила,
   за да няма празнини). Центрираните и едноредовите остават както са. */
.sheet-body p:not(.center):not(.card-note), .panel p:not(.center), .note p, .field small, .fb-text, .fb-reply .fb-text,
.dynamic-note, .bright-tip span, .empty p, .log-item .fb-text {
  text-align: justify; text-align-last: left; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word;
}
.empty p, .center, .auth-hero p { text-align: center; text-align-last: center; }
.dynamic-note { text-align-last: center; }
.scanner .rescan {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px; background: rgba(255,255,255,.95); color: #0F6CBD; font-weight: 700; font-size: 14px; padding: 0 16px; min-height: 42px; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

/* старата инсталация: екранът „Ben се премести“ */
.mv-steps { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.mv-steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.mv-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent, #0F6CBD); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.moved .btn { margin-top: 10px; }
