/* Insights Mini App. Colors follow the Telegram theme; the fb-* values are used outside Telegram. */
:root {
  --fb-bg: #f0f1f4; --fb-card: #ffffff; --fb-text: #111418; --fb-hint: #8a8f98; --fb-link: #2a82d6;
  --fb-accent: #2a82d6; --fb-accent-text: #ffffff; --fb-sep: rgba(17, 20, 24, 0.08); --fb-danger: #e5484d;

  --bg: var(--tg-theme-secondary-bg-color, var(--fb-bg));
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-card)));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --link: var(--tg-theme-link-color, var(--fb-link));
  --accent: var(--tg-theme-button-color, var(--fb-accent));
  --accent-text: var(--tg-theme-button-text-color, var(--fb-accent-text));
  --sep: var(--tg-theme-section-separator-color, var(--fb-sep));
  --danger: var(--tg-theme-destructive-text-color, var(--fb-danger));
  --head: var(--tg-theme-section-header-text-color, var(--hint));
  --ok: #2fa84f;
  --up: #1f8a3a;
  --down: #d03b3b;
  --warn: #c98500;
  --soft: rgba(42, 130, 214, 0.12);
  --soft-2: rgba(127, 127, 127, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.05);
  --r: 16px;
  /* chart tokens (validated categorical slots; the colour follows the platform) */
  --c-facebook: #2a78d6; --c-instagram: #eb6834; --c-tiktok: #1baf7a; --c-youtube: #eda100;
  --grid: rgba(127, 127, 127, 0.18); --axis: rgba(127, 127, 127, 0.38);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", Tahoma, sans-serif;
}
@supports (color: color-mix(in srgb, red 10%, transparent)) {
  :root { --soft: color-mix(in srgb, var(--accent) 13%, transparent); --soft-2: color-mix(in srgb, var(--hint) 16%, transparent); }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fb-bg: #0f1115; --fb-card: #1b1e24; --fb-text: #eef0f3; --fb-hint: #8b929c; --fb-link: #62a8f0;
    --fb-accent: #3d8fe0; --fb-sep: rgba(255, 255, 255, 0.08); --fb-danger: #ff6369;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --c-facebook: #3987e5; --c-instagram: #d95926; --c-tiktok: #199e70; --c-youtube: #c98500; --up: #3fbf5f; --down: #ff6b6b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fb-bg: #0f1115; --fb-card: #1b1e24; --fb-text: #eef0f3; --fb-hint: #8b929c; --fb-link: #62a8f0;
  --fb-accent: #3d8fe0; --fb-sep: rgba(255, 255, 255, 0.08); --fb-danger: #ff6369; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --c-facebook: #3987e5; --c-instagram: #d95926; --c-tiktok: #199e70; --c-youtube: #c98500; --up: #3fbf5f; --down: #ff6b6b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
a { color: var(--link); text-decoration: none; }

#app { height: var(--tg-viewport-stable-height, 100vh); display: flex; flex-direction: column; }
.app-header { flex: none; background: var(--bg); padding: 10px 16px 6px; }
.hrow { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.htitle { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.hsub { color: var(--hint); font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 6px; min-height: 18px; }
.hsub .bad { color: var(--danger); }
.hsub svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--accent);
  background: var(--card); box-shadow: var(--shadow); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:disabled { opacity: 0.45; }
.back-btn { color: var(--accent); display: inline-flex; align-items: center; gap: 2px; font-size: 16px; font-weight: 500;
  margin-inline-start: -6px; padding: 4px 6px; }
.back-btn svg { width: 20px; height: 20px; transform: scaleX(-1); }
[dir="rtl"] .back-btn svg { transform: none; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 28px; overscroll-behavior: contain; }
.tabbar { flex: none; display: flex; background: var(--card); border-top: 1px solid var(--sep);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--hint);
  padding: 2px 0; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.badge { position: absolute; top: -2px; inset-inline-start: calc(50% + 6px); background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: grid; place-items: center; }

/* chips (period filter) */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); color: var(--text); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.chip svg { width: 14px; height: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--hint); }
.dot.facebook { background: var(--c-facebook); } .dot.instagram { background: var(--c-instagram); } .dot.tiktok { background: var(--c-tiktok); }
.dot.youtube { background: var(--c-youtube); }

/* cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin: 0 0 10px; overflow: hidden; position: relative; }
.card.tap { cursor: pointer; }
.card.tap:active { opacity: 0.85; }
.bcard { padding: 12px 14px 12px; }
.bhead { display: flex; align-items: center; gap: 12px; }
.logo { width: 46px; height: 46px; border-radius: 13px; flex: none; overflow: hidden; display: grid; place-items: center;
  font-weight: 700; font-size: 20px; color: #fff; position: relative; background: var(--soft-2); }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo.lg { width: 60px; height: 60px; border-radius: 16px; font-size: 26px; }
.logo.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.bname { font-weight: 700; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsub { color: var(--hint); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.bsub .pf { display: inline-flex; align-items: center; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; margin-top: 12px; }
.kpi .kl { color: var(--hint); font-size: 12px; }
.kpi .kv { font-size: 18px; font-weight: 700; line-height: 1.25; }
.kpi .kd { font-size: 12px; font-weight: 600; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--hint); }
.spark { margin-top: 10px; height: 34px; }
.spark svg { width: 100%; height: 34px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.tile { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px 11px; min-width: 0; }
.tile.wide { grid-column: span 2; display: flex; align-items: center; gap: 12px; }
.tile .tl { color: var(--hint); font-size: 12.5px; }
.tile .tv { font-size: 21px; font-weight: 700; line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .td { font-size: 12px; margin-top: 2px; color: var(--hint); }
.tile .td b { font-weight: 600; }

.av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  font-weight: 600; font-size: 15px; overflow: hidden; position: relative; background: #8a8f98; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av .pfb { position: absolute; bottom: -1px; inset-inline-end: -1px; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--card); }
img.lazy { opacity: 0; transition: opacity 0.25s; }
img.lazy.loaded { opacity: 1; }

/* account rows inside a brand */
.arow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; position: relative; width: 100%; text-align: start; }
.arow + .arow::before { content: ""; position: absolute; top: 0; inset-inline-start: 64px; inset-inline-end: 0; height: 1px; background: var(--sep); }
.arow .an { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow .as { color: var(--hint); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.arow .aval { text-align: end; flex: none; }
.arow .aval b { display: block; font-size: 15px; }
.arow .aval span { font-size: 12px; }
.err-text { color: var(--danger); }

/* charts */
.chartcard { padding: 10px 10px 8px; }
.chartcard .ct { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; font-size: 13px; color: var(--hint); flex-wrap: wrap; }
.chartcard .ct .ttl { color: var(--text); font-weight: 600; font-size: 14px; flex: 1; min-width: 0; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--hint); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart { position: relative; touch-action: pan-y; direction: ltr; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .tk { font-size: 10px; fill: var(--hint); }
.chart .pk { font-size: 10px; fill: var(--text); font-weight: 600; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .cross { stroke: var(--hint); stroke-width: 1; opacity: 0.6; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--card); color: var(--text); border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18); padding: 7px 9px; font-size: 12.5px; white-space: nowrap; z-index: 2; direction: inherit; }
.tip .td { color: var(--hint); font-size: 11.5px; margin-bottom: 2px; }
.tip .tr { display: flex; align-items: center; gap: 6px; }
.tip .tr b { margin-inline-start: auto; padding-inline-start: 10px; font-variant-numeric: tabular-nums; }
.mchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 4px 8px; }
.mchips::-webkit-scrollbar { display: none; }
.mchip { flex: none; padding: 5px 10px; border-radius: 9px; background: var(--soft-2); font-size: 13px; font-weight: 500; }
.mchip.on { background: var(--soft); color: var(--accent); font-weight: 600; }
.sharebar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 4px 2px; }
.sharebar i { display: block; height: 100%; }
.tablelink { font-size: 12.5px; color: var(--accent); padding: 4px; margin-inline-start: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 6px; }
table.data th { color: var(--hint); font-weight: 600; text-align: start; padding: 4px 6px; border-bottom: 1px solid var(--sep); }
table.data td { padding: 4px 6px; border-bottom: 1px solid var(--sep); }
table.data td.n, table.data th.n { text-align: end; }

/* posts */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ptile { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--soft-2); }
.ptile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ptile .pm { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; color: #fff; font-size: 12px; font-weight: 700;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62)); display: flex; align-items: center; gap: 4px; }
.ptile .pm svg { width: 13px; height: 13px; }
.ptile .pk { position: absolute; top: 5px; inset-inline-start: 5px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 10.5px;
  font-weight: 600; border-radius: 6px; padding: 1px 5px; }
.ptile .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--hint); padding: 8px; text-align: center; font-size: 11px; }
.prow { display: flex; gap: 10px; padding: 10px 12px; position: relative; }
.prow + .prow::before { content: ""; position: absolute; top: 0; inset-inline-start: 12px; inset-inline-end: 0; height: 1px; background: var(--sep); }
.prow .pth { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--soft-2); position: relative; flex: none; }
.prow .pth img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prow .pc { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.prow .pmeta { color: var(--hint); font-size: 12px; }
.prow .pnums { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; margin-top: 3px; color: var(--hint); }
.prow .pnums b { color: var(--text); font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent);
  color: var(--accent-text); font-weight: 600; border-radius: 12px; padding: 11px 18px; font-size: 15px; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.soft { background: var(--soft); color: var(--accent); }
.btn.danger { background: rgba(229, 72, 77, 0.12); color: var(--danger); }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; }
.btn svg { width: 18px; height: 18px; }
.btnrow { display: flex; gap: 8px; margin: 10px 0; }
.btnrow .btn { flex: 1; }

/* grouped lists */
.sect { margin: 16px 0 6px; padding: 0 6px; color: var(--head); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.sect .sa { margin-inline-start: auto; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent); }
.group { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 48px; width: 100%; text-align: start; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; inset-inline-start: 14px; inset-inline-end: 0; height: 1px; background: var(--sep); }
.row .rt { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rs { color: var(--hint); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row .rv { color: var(--hint); font-size: 14px; white-space: nowrap; }
.row .chev { color: var(--hint); width: 16px; height: 16px; flex: none; }
[dir="rtl"] .chev { transform: scaleX(-1); }
.arow .chev, .chev { color: var(--hint); width: 16px; height: 16px; flex: none; }
.row.danger .rt { color: var(--danger); }
.row .rt.accent { color: var(--accent); }
.row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.pill { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 6px; background: var(--soft); color: var(--accent); white-space: nowrap; }
.pill.w { background: rgba(227, 160, 8, 0.16); color: var(--warn); }
.pill.bad { background: rgba(229, 72, 77, 0.13); color: var(--danger); }
.pill.ok { background: rgba(47, 168, 79, 0.14); color: var(--ok); }
.pill.g { background: var(--soft-2); color: var(--hint); }
.note { color: var(--hint); font-size: 13px; padding: 6px 8px 0; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 12px; }
.opt { padding: 6px 12px; border-radius: 10px; background: var(--soft-2); font-size: 14px; font-weight: 500; }
.opt.on { background: var(--accent); color: var(--accent-text); }
.seg { display: flex; background: var(--soft-2); border-radius: 10px; padding: 2px; }
.seg button { flex: 1; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--hint); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--soft-2); position: relative; flex: none; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(18px); }
[dir="rtl"] .switch.on::after { transform: translateX(-18px); }

/* logins */
.login { padding: 12px 14px; }
.login .lh { display: flex; align-items: center; gap: 10px; }
.login .li { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; font-weight: 800; }
.login .li.meta, .li.meta, .li.facebook { background: var(--c-facebook); } .login .li.instagram, .li.instagram { background: var(--c-instagram); }
.login .li.tiktok, .li.tiktok { background: var(--c-tiktok); } .login .li.youtube, .li.youtube { background: var(--c-youtube); }
.login .lt { font-weight: 700; font-size: 15.5px; }
.login .ls { color: var(--hint); font-size: 12.5px; }
.conn { display: flex; align-items: center; gap: 8px; padding: 8px 0 0; font-size: 13.5px; flex-wrap: wrap; }
.conn + .conn { border-top: 1px solid var(--sep); margin-top: 8px; }
.conn .cn { font-weight: 600; }
.linkbtn { color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 4px 2px; }
.linkbtn.danger { color: var(--danger); }

/* banners & empty states */
.banner { border-radius: var(--r); padding: 12px 14px; margin: 0 0 10px; display: flex; gap: 10px; background: var(--card);
  box-shadow: var(--shadow); font-size: 14px; align-items: flex-start; }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner.bad { background: rgba(229, 72, 77, 0.1); color: var(--danger); box-shadow: none; }
.banner.warn { background: rgba(227, 160, 8, 0.13); box-shadow: none; }
.banner.info { background: var(--soft); box-shadow: none; }
.banner b { display: block; margin-bottom: 2px; }
.banner .ba { margin-top: 8px; }
.banner code, .code { font-size: 12.5px; background: var(--soft-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty { text-align: center; padding: 44px 24px; color: var(--hint); }
.empty .ei { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; background: var(--soft); color: var(--accent);
  display: grid; place-items: center; }
.empty .ei svg { width: 32px; height: 32px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 0 16px; }
.steps { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 0; margin-bottom: 10px; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 14px; width: 100%; text-align: start; }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid;
  place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.step.done .num { background: var(--ok); color: #fff; }
.step .num svg { width: 16px; height: 16px; }
.guide { font-size: 14px; }
.guide ol { padding-inline-start: 20px; margin: 6px 0 10px; }
.guide li { margin: 5px 0; }
.guide h4 { margin: 14px 0 4px; font-size: 15px; }
.copyrow { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 8px 10px;
  box-shadow: var(--shadow); margin: 6px 0; }
.copyrow .code { flex: 1; min-width: 0; background: none; padding: 0; }
.copyrow button { color: var(--accent); flex: none; }
.copyrow button svg { width: 18px; height: 18px; }

/* sheets */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 20; opacity: 0; transition: opacity 0.2s; }
.scrim.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--bg); border-radius: 18px 18px 0 0;
  max-height: 90%; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.25s ease;
  padding-bottom: env(safe-area-inset-bottom); }
.sheet.show { transform: none; }
.sgrip { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 8px auto 2px; flex: none; }
.shead { display: flex; align-items: center; gap: 10px; padding: 6px 16px 10px; flex: none; }
.shead h2 { font-size: 18px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbody { overflow-y: auto; padding: 0 12px 16px; flex: 1; }
.sfoot { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--sep); display: flex; gap: 8px; }
.sfoot .btn { flex: 1; }
.field-wrap { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 0 12px; display: flex;
  align-items: center; gap: 8px; margin-bottom: 8px; }
.field { flex: 1; border: 0; outline: 0; background: transparent; padding: 11px 0; font-size: 16px; min-width: 0; }
textarea.field { resize: vertical; min-height: 84px; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.flabel { color: var(--hint); font-size: 12.5px; font-weight: 600; margin: 12px 4px 6px; display: flex; align-items: center; gap: 6px; }
.colors { display: flex; gap: 10px; padding: 4px 2px 8px; flex-wrap: wrap; align-items: center; }
.color { width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08); display: grid;
  place-items: center; color: #fff; position: relative; }
.color svg { width: 16px; height: 16px; }
.color input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.color.pick { background: conic-gradient(#e34948, #eda100, #1baf7a, #2a78d6, #4a3aa7, #e87ba4, #e34948); }
.logo-edit { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
.muted { color: var(--hint); }
.small { font-size: 12.5px; }
.center { text-align: center; }
input[type="date"].field { padding: 9px 0; }
.daterow { display: flex; gap: 8px; }
.daterow .field-wrap { flex: 1; }

.toast { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30;
  background: rgba(30, 32, 36, 0.94); color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center;
  gap: 12px; font-size: 14.5px; transform: translateY(20px); opacity: 0; transition: all 0.2s; pointer-events: none; }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast .tt { flex: 1; min-width: 0; }
.toast.err { background: rgba(200, 50, 55, 0.95); }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--hint); }
.loading svg { width: 28px; height: 28px; }
.dim { opacity: 0.55; transition: opacity 0.2s; }
.fade-in { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.progress { height: 3px; background: var(--soft-2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }

/* PIN lock screen */
.lockscreen { display: flex; flex-direction: column; align-items: center; padding: 34px 12px 20px; gap: 6px; }
.lockscreen h2 { margin: 6px 0 0; font-size: 20px; }
.lockicon { width: 64px; height: 64px; border-radius: 22px; background: var(--soft); color: var(--accent); display: grid; place-items: center; }
.lockicon svg { width: 32px; height: 32px; }
.pindots { display: flex; gap: 12px; margin: 14px 0 18px; min-height: 14px; }
.pindots i { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--hint); }
.pindots i.on { background: var(--accent); box-shadow: none; }
.shake .pindots { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; direction: ltr; }
.pinpad .pk { width: 72px; height: 72px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 26px;
  font-weight: 500; display: grid; place-items: center; }
.pinpad .pk:active { background: var(--soft); }
.pinpad .pk.fn { background: transparent; box-shadow: none; color: var(--hint); }
.pinpad .pk.ok { background: var(--accent); color: var(--accent-text); }
.pinpad .pk:disabled { opacity: 0.4; }
.pinpad .pk svg { width: 26px; height: 26px; }

/* People (Settings) */
.row.person { gap: 10px; flex-wrap: wrap; }
.row.person .grow { min-width: 120px; }
.row.person .av svg { width: 18px; height: 18px; }
.row.person.pending { background: color-mix(in srgb, var(--c-instagram) 8%, transparent); }
.row.person .rights-line { color: var(--accent, #2a78d6); white-space: normal; }
