/* Channel Sorter 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;
  --warn: #e3a008;
  --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;
  --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);
  }
}
: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);
}

* { 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 { 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; display: flex; align-items: baseline; gap: 8px; }
.hcount { font-size: 15px; font-weight: 600; color: var(--hint); }
.hsub { color: var(--hint); font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 6px; min-height: 18px; }
.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.on { background: var(--accent); color: var(--accent-text); }
.icon-btn:disabled { opacity: 0.45; }
.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 24px; 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; }
.badge.soft { background: var(--accent); }

/* chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 8px; 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; max-width: 220px; }
.chip span.t { overflow: hidden; text-overflow: ellipsis; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.chip .n { color: var(--hint); font-weight: 600; }
.chip.on .n { color: inherit; opacity: 0.8; }
.chip .dot, .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--hint); }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sep); }

/* cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin: 0 0 10px; overflow: hidden;
  position: relative; transition: opacity 0.2s; }
.card.sel { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.chead { display: flex; align-items: center; gap: 10px; padding: 12px 12px 6px; }
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  font-weight: 600; font-size: 15px; overflow: hidden; background: #8a8f98; }
.av { position: relative; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
img.lazy { opacity: 0; transition: opacity 0.25s; }
img.lazy.loaded { opacity: 1; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.cname { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmeta { color: var(--hint); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.cmeta svg { width: 13px; height: 13px; }
.grow { flex: 1; min-width: 0; }
.open-link { color: var(--hint); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; }
.open-link svg { width: 18px; height: 18px; }
.check { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--hint); flex: none;
  display: grid; place-items: center; color: var(--accent-text); }
.check.on { background: var(--accent); box-shadow: none; }
.check svg { width: 14px; height: 14px; }

.ctext { padding: 2px 14px 8px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 15px; }
.ctext.clamp { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.more { color: var(--link); font-size: 14px; padding: 0 14px 8px; display: block; }
.ctext .b { font-weight: 700; } .ctext .i { font-style: italic; } .ctext .u { text-decoration: underline; }
.ctext .s { text-decoration: line-through; }
.ctext .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--soft-2);
  border-radius: 5px; padding: 0 4px; }
.ctext .spoiler { background: var(--hint); color: transparent; border-radius: 4px; cursor: pointer; }
.ctext .spoiler.shown { background: var(--soft-2); color: inherit; }
.ctext .bq { border-inline-start: 3px solid var(--accent); padding-inline-start: 8px; display: inline-block; }
.ctext .tag { color: var(--link); }
.empty-text { color: var(--hint); font-style: italic; }

.media { display: grid; gap: 2px; margin: 0 0 8px; }
.media.n1 { grid-template-columns: 1fr; }
.media.n2 { grid-template-columns: 1fr 1fr; }
.media.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.media.n3 .m:first-child { grid-row: span 2; }
.media.n4 { grid-template-columns: 1fr 1fr; }
.m { position: relative; background: var(--soft-2); min-height: 120px; overflow: hidden; }
.media.n1 .m { aspect-ratio: 16 / 10; max-height: 280px; }
.media.n2 .m, .media.n4 .m { aspect-ratio: 1 / 1; }
.m img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m .mbadge { position: absolute; inset-inline-start: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 12px; font-weight: 600; border-radius: 8px; padding: 2px 7px; display: flex; align-items: center; gap: 4px; }
.m .mbadge svg { width: 12px; height: 12px; }
.m .more-n { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 22px; font-weight: 700;
  display: grid; place-items: center; }
.m .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--hint); }
.m .ph svg { width: 30px; height: 30px; }
.attach { display: flex; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 10px; border-radius: 12px;
  background: var(--soft-2); font-size: 13.5px; }
.attach .ai { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; flex: none; }
.attach .ai svg { width: 18px; height: 18px; }
.attach .at { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.attach .as { color: var(--hint); font-size: 12.5px; }
.web { margin: 0 12px 8px; padding: 8px 10px; border-inline-start: 3px solid var(--accent); border-radius: 8px;
  background: var(--soft); display: flex; gap: 10px; }
.web .ws { color: var(--accent); font-weight: 600; font-size: 13px; }
.web .wt { font-weight: 600; font-size: 13.5px; }
.web .wd { color: var(--text); opacity: 0.8; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.web .wi { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; background: var(--soft-2); }
.web .wi img { width: 100%; height: 100%; object-fit: cover; }

.cfoot { border-top: 1px solid var(--sep); padding: 10px 12px 12px; }
.flabel { color: var(--hint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; background: var(--soft-2);
  font-size: 14px; font-weight: 500; max-width: 100%; }
.tchip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip.sug { background: var(--soft); color: var(--accent); font-weight: 600; }
.tchip.more { color: var(--accent); }
.tchip svg { width: 14px; height: 14px; }
.frow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.seg { display: inline-flex; background: var(--soft-2); border-radius: 10px; padding: 2px; }
.seg button { padding: 5px 10px; border-radius: 8px; font-size: 13px; 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); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.lock-note { font-size: 12.5px; color: var(--hint); display: flex; align-items: center; gap: 5px; }
.lock-note svg { width: 14px; height: 14px; }
.skip { margin-inline-start: auto; color: var(--hint); font-size: 14px; font-weight: 500; padding: 6px 4px; }

.status { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 14px; }
.status svg { width: 18px; height: 18px; flex: none; }
.status.q { background: var(--soft); color: var(--accent); }
.status.ok { color: var(--ok); }
.status.skipped { color: var(--hint); }
.status.fail { background: rgba(229, 72, 77, 0.1); color: var(--danger); align-items: flex-start; }
.status .st { flex: 1; min-width: 0; }
.status .sd { color: var(--hint); font-size: 12.5px; }
.status .act { font-weight: 600; color: var(--accent); padding: 2px 4px; }
.status.fail .act { color: var(--danger); }
.card.handled { box-shadow: none; background: transparent; border: 1px dashed var(--sep); }
.card.handled .status { padding: 9px 12px; }
.mini { color: var(--hint); font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 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; }
.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.info { background: var(--soft); box-shadow: none; }
.banner b { display: block; margin-bottom: 2px; }
.banner code { font-size: 12.5px; background: var(--soft-2); padding: 1px 5px; border-radius: 5px; }
.empty { text-align: center; padding: 48px 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; }
.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; }

.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; }

/* grouped lists (settings, channels) */
.sect { margin: 14px 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; }
.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.withav + .row.withav::before { inset-inline-start: 62px; }
.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 .rs .err { color: var(--danger); }
.row .rv { color: var(--hint); font-size: 14px; white-space: nowrap; }
.row .chev { color: var(--hint); width: 16px; height: 16px; flex: none; }
[dir="rtl"] .row .chev { transform: scaleX(-1); }
.pill { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 6px; background: var(--soft); color: var(--accent); }
.pill.w { background: rgba(227, 160, 8, 0.15); color: var(--warn); }
.pill.g { background: var(--soft-2); color: var(--hint); }
.note { color: var(--hint); font-size: 13px; padding: 6px 8px 0; }
.row.danger .rt { color: var(--danger); }
.row .rt.accent { color: var(--accent); }
.row.off .rt { color: var(--hint); }
.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); }
.row.stack { flex-direction: column; align-items: stretch; gap: 8px; }

.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); }

/* history */
.hitem { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 8px; padding: 10px 12px; }
.hitem .ht { display: flex; align-items: center; gap: 8px; }
.hitem .hx { font-size: 14px; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.hitem .hf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hitem .err { color: var(--danger); font-size: 13px; margin: 4px 0; }
.hitem .ha { margin-inline-start: auto; display: flex; gap: 6px; }

/* bottom bar for selection */
.selbar { flex: none; display: flex; align-items: center; gap: 8px; background: var(--card); border-top: 1px solid var(--sep);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.selbar .sc { flex: 1; font-weight: 600; }

/* 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: 88%; 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; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 0 12px;
  box-shadow: var(--shadow); margin-bottom: 10px; }
.search svg { width: 18px; height: 18px; color: var(--hint); flex: none; }
.search input, .field { flex: 1; border: 0; outline: 0; background: transparent; padding: 11px 0; font-size: 16px; min-width: 0; }
.field-wrap { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 0 12px; display: flex;
  align-items: center; gap: 8px; }
.colors { display: flex; gap: 10px; padding: 10px 2px; }
.color { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08); display: grid;
  place-items: center; color: #fff; }
.color svg { width: 16px; height: 16px; }
.muted { color: var(--hint); }
.center { text-align: center; }
.pad { padding: 16px; }

.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 button { color: #6cb4ff; font-weight: 700; padding: 2px 4px; }
.toast .ring { width: 22px; height: 22px; flex: none; }
.toast .ring circle { fill: none; stroke: #6cb4ff; stroke-width: 3; stroke-linecap: round; transform: rotate(-90deg);
  transform-origin: center; }
.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; }
.fade-in { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* PIN lock screen */
.lock { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; gap: 12px; padding: max(28px, 5vh) 24px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.lock-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.lock-ico { width: 64px; height: 64px; border-radius: 22px; background: var(--soft); color: var(--accent); display: grid; place-items: center; }
.lock-ico.bad { background: rgba(229, 72, 77, 0.12); color: var(--danger); }
.lock-ico svg { width: 30px; height: 30px; }
.lock h2 { margin: 6px 0 0; font-size: 21px; font-weight: 700; }
.lock-sub { margin: 0; color: var(--hint); font-size: 14px; min-height: 20px; max-width: 290px; }
.lock-sub.err { color: var(--danger); }
.pin-dots { direction: ltr; display: flex; gap: 12px; margin-top: 14px; min-height: 14px; }
.pin-dot { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--hint); transition: background 0.12s; }
.pin-dot.on { background: var(--text); box-shadow: none; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-pad { --k: min(72px, 10vh); direction: ltr; display: grid; grid-template-columns: repeat(3, var(--k)); gap: 12px 24px; justify-content: center; }
.pin-pad.off { opacity: 0.35; }
.pin-key { width: var(--k); height: var(--k); border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 27px;
  font-weight: 500; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.pin-key:active:not(:disabled) { background: var(--soft); }
.pin-key.fn { background: transparent; box-shadow: none; color: var(--hint); }
.pin-key.fn svg { width: 26px; height: 26px; }
[dir="rtl"] .pin-key.del svg { transform: scaleX(-1); }
.pin-key.go { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.pin-key:disabled { cursor: default; }
.pin-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lock-foot { margin: 0; color: var(--hint); font-size: 12px; text-align: center; max-width: 320px; min-height: 16px; overflow-wrap: anywhere; }

/* invite links */
.linkbox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--soft-2); border-radius: 10px;
  padding: 10px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; direction: ltr; text-align: left; }
.row:disabled { opacity: 0.55; }
