/* TG Automation — Telegram x Apple glass design system */
:root {
  color-scheme: dark;
  --bg: #050b17;
  --bg-deep: #020711;
  --panel: rgba(14, 25, 43, .72);
  --panel2: rgba(19, 34, 57, .76);
  --glass: rgba(18, 31, 52, .58);
  --glass-heavy: rgba(9, 18, 33, .84);
  --glass-light: rgba(255, 255, 255, .055);
  --line: rgba(197, 221, 255, .14);
  --line-strong: rgba(197, 221, 255, .24);
  --text: #f6f9ff;
  --muted: #a6b6cb;
  --blue: #2aabee;
  --blue-strong: #168bd2;
  --blue-soft: rgba(42, 171, 238, .16);
  --green: #31d57c;
  --amber: #ffb648;
  --red: #ff6474;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-card: 0 16px 44px rgba(0, 5, 15, .23), inset 0 1px 0 rgba(255, 255, 255, .07);
  --shadow-float: 0 14px 38px rgba(0, 5, 15, .4), inset 0 1px 0 rgba(255, 255, 255, .09);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
}

* { scrollbar-color: rgba(148, 181, 218, .32) transparent; }

html { scroll-behavior: smooth; scroll-padding-top: 132px; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 620px at 5% -8%, rgba(42, 171, 238, .20), transparent 62%),
    radial-gradient(760px 560px at 94% 12%, rgba(93, 92, 222, .17), transparent 62%),
    radial-gradient(620px 520px at 52% 96%, rgba(49, 213, 124, .08), transparent 64%),
    linear-gradient(155deg, #07111f 0%, var(--bg) 48%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
}

body::before {
  width: 280px;
  height: 280px;
  left: -110px;
  top: 35%;
  background: rgba(42, 171, 238, .065);
  box-shadow: 0 0 120px 55px rgba(42, 171, 238, .08);
}

body::after {
  width: 240px;
  height: 240px;
  right: -100px;
  bottom: 10%;
  background: rgba(120, 106, 255, .06);
  box-shadow: 0 0 120px 55px rgba(120, 106, 255, .07);
}

::selection { background: rgba(42, 171, 238, .38); color: #fff; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 20px;
  top: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  color: #fff;
  background: #168bd2;
  box-shadow: var(--shadow-float);
  transform: translateY(-160%);
  transition: transform .2s var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

.top {
  position: sticky;
  top: 10px;
  width: min(1360px, calc(100% - 28px));
  height: 60px;
  margin: 10px auto 0;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(8, 17, 31, .64);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--shadow-float);
}

.brand { gap: 10px; }
.brand h1 { font-size: 16px; font-weight: 750; letter-spacing: -.018em; }
.brand p { color: var(--muted); font-size: 11px; letter-spacing: .01em; }

.logo {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: linear-gradient(145deg, #47c7ff 0%, #168bd2 55%, #2575dc 100%);
  box-shadow: 0 9px 26px rgba(42, 171, 238, .28), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.statusline { gap: 10px; color: var(--muted); font-size: 12px; }
.dot { width: 7px; height: 7px; background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 182, 72, .13), 0 0 16px rgba(255, 182, 72, .4); }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(49, 213, 124, .13), 0 0 16px rgba(49, 213, 124, .42); }

.tabs {
  position: sticky;
  top: 78px;
  z-index: 19;
  width: min(1360px, calc(100% - 28px));
  margin: 8px auto 0;
  padding: 5px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(8, 17, 31, .57);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
  box-shadow: 0 14px 40px rgba(0, 5, 15, .22), inset 0 1px 0 rgba(255, 255, 255, .055);
}

.tab {
  min-height: 40px;
  flex: 1 0 auto;
  justify-content: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  color: #aebcd0;
  font-size: 12px;
  font-weight: 650;
  transition: color .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .1s ease-out;
}

.tab:hover { color: #fff; background: rgba(255, 255, 255, .065); }
.tab:active { transform: scale(.97); }
.tab[aria-selected="true"] {
  color: #fff;
  border-color: rgba(120, 211, 255, .26);
  background: linear-gradient(145deg, rgba(42, 171, 238, .92), rgba(31, 128, 216, .93));
  box-shadow: 0 8px 22px rgba(42, 171, 238, .22), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.tab .icon { width: 18px; height: 18px; }

main { width: min(1360px, 100%); padding: 30px clamp(16px, 2.6vw, 32px) 72px; }

.panel { animation: materialize .38s var(--ease-out); transform-origin: 50% 0; }
@keyframes materialize {
  from { opacity: 0; transform: translateY(8px) scale(.995); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.head { align-items: flex-end; margin-bottom: 20px; }
.head > div { max-width: 850px; }
.kicker { margin-bottom: 8px; color: #65c9fb; font-size: 11px; font-weight: 780; letter-spacing: .13em; }
.head h2 { font-size: clamp(27px, 2.7vw, 36px); line-height: 1.07; letter-spacing: -.042em; font-weight: 760; }
.lead { max-width: 760px; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.52; }

.grid { gap: 14px; }

.card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(24, 41, 67, .66), rgba(9, 18, 33, .65));
  -webkit-backdrop-filter: blur(30px) saturate(145%);
  backdrop-filter: blur(30px) saturate(145%);
  box-shadow: var(--shadow-card);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  pointer-events: none;
}

.cardhead { margin-bottom: 15px; }
.card h3 { font-size: 16px; font-weight: 720; letter-spacing: -.015em; }
.sub { margin-top: 6px; color: var(--muted); line-height: 1.5; }

.metric {
  min-height: 128px;
  padding: 17px;
  isolation: isolate;
  transition: border-color .25s var(--ease-out), transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}

.metric::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 110px;
  height: 110px;
  right: -34px;
  bottom: -48px;
  border-radius: 50%;
  background: rgba(42, 171, 238, .18);
  filter: blur(22px);
}

.metric:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 28px 72px rgba(0, 6, 18, .36), inset 0 1px 0 rgba(255, 255, 255, .1); }
.metric label { color: #b4c2d6; font-size: 12px; letter-spacing: .015em; }
.metric strong { margin: 11px 0 4px; font-size: 32px; line-height: 1; font-weight: 760; letter-spacing: -.05em; }
.metric small { font-size: 12px; }

.steps { gap: 10px; }
.step {
  padding: 14px;
  border: 1px solid rgba(197, 221, 255, .11);
  border-radius: var(--radius-md);
  background: rgba(5, 13, 25, .47);
}
.step b, .flowitem b {
  background: linear-gradient(145deg, #43bff7, #168bd2);
  box-shadow: 0 7px 20px rgba(42, 171, 238, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.step h4 { margin-top: 15px; font-size: 14px; }
.step p { color: var(--muted); line-height: 1.55; }

.flow { gap: 11px; }
.flowitem {
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px;
  border-color: rgba(197, 221, 255, .11);
  border-radius: 15px;
  background: rgba(5, 13, 25, .48);
}
.flowitem b { width: 34px; height: 34px; border-radius: 11px; }
.flowitem strong { font-size: 13px; }
.flowitem p { color: var(--muted); line-height: 1.5; }

.field { margin-bottom: 13px; }
label { margin-bottom: 7px; color: #d7e1ee; font-size: 11px; font-weight: 680; letter-spacing: .01em; }
.hint { margin-top: 7px; color: #8fa2ba; }

input, select, textarea {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(197, 221, 255, .14);
  border-radius: 11px;
  color: var(--text);
  background: rgba(3, 10, 21, .70);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 1px 0 rgba(255, 255, 255, .02);
  caret-color: #58c7ff;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}

input:hover, select:hover, textarea:hover { border-color: rgba(197, 221, 255, .24); background: rgba(5, 13, 27, .79); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(75, 190, 248, .78);
  background: rgba(4, 12, 25, .92);
  box-shadow: 0 0 0 4px rgba(42, 171, 238, .14), inset 0 1px 0 rgba(255, 255, 255, .04);
}
input::placeholder, textarea::placeholder { color: #687d98; }
input:disabled { color: #9babc0; background: rgba(255, 255, 255, .035); }
textarea { min-height: 92px; }
select option { color: var(--text); background: #0b1729; }
input[type="file"] { padding: 6px 8px; }
input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 7px 11px;
  border: 1px solid rgba(197, 221, 255, .15);
  border-radius: 9px;
  color: #e8f5ff;
  background: rgba(42, 171, 238, .13);
  cursor: pointer;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out);
}
input[type="file"]::file-selector-button:hover { border-color: rgba(93, 205, 255, .4); background: rgba(42, 171, 238, .2); }

input[type="checkbox"] {
  width: 19px;
  height: 19px;
  min-height: 19px;
  accent-color: var(--blue);
}
.check { min-height: 44px; gap: 10px; }

.btn {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 11px;
  background: linear-gradient(145deg, #38b8f4, #178bcf);
  box-shadow: 0 9px 24px rgba(42, 171, 238, .21), inset 0 1px 0 rgba(255, 255, 255, .24);
  color: #fff;
  font-size: 13px;
  font-weight: 720;
  transition: filter .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .1s ease-out, opacity .2s ease;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 12px 30px rgba(42, 171, 238, .28), inset 0 1px 0 rgba(255, 255, 255, .26); }
.btn:active { transform: scale(.975); }
.btn.green { background: linear-gradient(145deg, #3abcf4, #168bd2); box-shadow: 0 10px 28px rgba(42, 171, 238, .23), inset 0 1px 0 rgba(255, 255, 255, .24); }
.btn.soft {
  color: #dce9f7;
  border-color: rgba(197, 221, 255, .14);
  background: rgba(255, 255, 255, .065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.btn.soft:hover { background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09); }
.btn.danger { color: #ffd7dc; border-color: rgba(255, 100, 116, .26); background: rgba(255, 100, 116, .12); box-shadow: none; }
.btn.small { min-height: 34px; padding: 7px 10px; border-radius: 10px; font-size: 11px; }
.btn:disabled { opacity: .42; filter: saturate(.55); box-shadow: none; }

.notice {
  padding: 14px 15px;
  border-color: rgba(76, 191, 248, .22);
  border-radius: 14px;
  background: rgba(42, 171, 238, .09);
  color: #dcefff;
}
.notice.ok { border-color: rgba(49, 213, 124, .25); background: rgba(49, 213, 124, .09); color: #c9ffe2; }
.notice.warn { border-color: rgba(255, 182, 72, .24); background: rgba(255, 182, 72, .08); color: #ffe5b6; }

.tablewrap {
  border-color: rgba(197, 221, 255, .12);
  border-radius: 16px;
  background: rgba(3, 10, 21, .35);
}
table { font-size: 11.5px; }
th, td { padding: 10px 12px; border-bottom-color: rgba(197, 221, 255, .09); }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #95a9c1;
  background: rgba(7, 15, 28, .94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(42, 171, 238, .055); }

.badge { border: 1px solid rgba(197, 221, 255, .07); background: rgba(163, 184, 211, .10); color: #d1dbea; }
.badge.active, .badge.completed, .badge.running { border-color: rgba(49, 213, 124, .16); background: rgba(49, 213, 124, .12); color: #9af1bf; }
.badge.failed, .badge.error, .badge.unauthorized { border-color: rgba(255, 100, 116, .17); background: rgba(255, 100, 116, .11); color: #ffb3bd; }
.badge.waiting, .badge.paused, .badge.limited { border-color: rgba(255, 182, 72, .17); background: rgba(255, 182, 72, .11); color: #ffd58f; }

.progress { height: 6px; background: rgba(2, 8, 17, .85); }
.progress i { background: linear-gradient(90deg, #2aabee, #31d57c); box-shadow: 0 0 12px rgba(42, 171, 238, .24); }

.drop {
  min-height: 250px;
  border-color: rgba(79, 193, 249, .42);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(42, 171, 238, .095), rgba(80, 96, 222, .055));
}
.drop:hover, .drop.drag { border-color: #52c3fa; background: linear-gradient(145deg, rgba(42, 171, 238, .14), rgba(49, 213, 124, .065)); }
.uploadicon { border: 1px solid rgba(87, 199, 252, .17); border-radius: 17px; background: rgba(42, 171, 238, .12); color: #70d0ff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.filerow { border-color: rgba(197, 221, 255, .11); border-radius: 13px; background: rgba(3, 10, 21, .6); }

.choicegrid { gap: 14px; }
.choice {
  min-height: 158px;
  padding: 18px;
  border-color: rgba(197, 221, 255, .13);
  border-radius: 18px;
  background: rgba(3, 10, 21, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: border-color .22s var(--ease-out), background .22s var(--ease-out), transform .1s ease-out, box-shadow .22s var(--ease-out);
}
.choice:hover { border-color: rgba(91, 199, 251, .45); background: rgba(8, 22, 40, .65); }
.choice:active { transform: scale(.985); }
.choice.selected {
  border-color: rgba(115, 214, 255, .62);
  background: linear-gradient(145deg, rgba(42, 171, 238, .88), rgba(54, 80, 188, .82));
  box-shadow: 0 16px 38px rgba(28, 121, 207, .22), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.choice strong { font-size: 14px; }
.choice p { margin-top: 12px; color: #aebdd1; line-height: 1.55; }
.choice .radio { border-color: #7891ad; }

.wizardsteps { gap: 8px; }
.wizardsteps span {
  padding: 10px 12px;
  border: 1px solid rgba(197, 221, 255, .07);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}
.wizardsteps span:first-child { border-color: rgba(42, 171, 238, .15); background: rgba(42, 171, 238, .12); color: #82d5ff; }

dialog {
  width: min(700px, calc(100% - 28px));
  border-color: rgba(197, 221, 255, .2);
  border-radius: 24px;
  background: rgba(10, 20, 36, .78);
  -webkit-backdrop-filter: blur(38px) saturate(155%);
  backdrop-filter: blur(38px) saturate(155%);
  box-shadow: 0 35px 110px rgba(0, 3, 11, .68), inset 0 1px 0 rgba(255, 255, 255, .11);
}
dialog[open] { animation: dialog-in .3s var(--ease-out); }
dialog::backdrop { background: rgba(0, 5, 14, .65); -webkit-backdrop-filter: blur(10px) saturate(90%); backdrop-filter: blur(10px) saturate(90%); }
@keyframes dialog-in { from { opacity: 0; transform: scale(.965) translateY(10px); filter: blur(7px); } to { opacity: 1; transform: none; filter: blur(0); } }
.dialog { padding: 24px; }
.dialoghead { align-items: flex-start; margin-bottom: 20px; }
.dialoghead h3 { font-size: 18px; letter-spacing: -.02em; }
.close { width: 44px; height: 44px; border: 1px solid transparent; border-radius: 13px; }
.close:hover { color: #fff; border-color: var(--line); background: rgba(255, 255, 255, .07); }
pre { border-color: var(--line); border-radius: 14px; background: rgba(1, 6, 14, .82); }

.toast {
  right: 22px;
  bottom: 22px;
  padding: 14px 17px;
  border-color: var(--line-strong);
  border-radius: 15px;
  background: rgba(20, 38, 62, .82);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  backdrop-filter: blur(24px) saturate(155%);
  box-shadow: var(--shadow-float);
}
.toast.show { transform: translateY(0) scale(1); }
.toast.bad { border-color: rgba(255, 100, 116, .28); background: rgba(72, 22, 35, .88); }

:where(button, input, select, textarea, a):focus-visible {
  outline: 3px solid rgba(94, 202, 255, .8);
  outline-offset: 3px;
}

.auth-screen { display: none; }
.auth-pending .auth-screen,
.auth-visible .auth-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.auth-pending > :not(.auth-screen):not(svg),
.auth-visible > :not(.auth-screen):not(svg) { display: none !important; }
.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background: rgba(8, 17, 31, .66);
  -webkit-backdrop-filter: blur(34px) saturate(165%);
  backdrop-filter: blur(34px) saturate(165%);
  box-shadow: 0 40px 120px rgba(0, 3, 12, .62), inset 0 1px 0 rgba(255, 255, 255, .11);
}
.auth-intro {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 78px);
  background:
    radial-gradient(480px 360px at 10% 12%, rgba(84, 199, 255, .22), transparent 64%),
    linear-gradient(145deg, rgba(23, 88, 157, .34), rgba(13, 25, 47, .58));
}
.auth-orb {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #4cc9ff, #178bcf 58%, #4169d8);
  box-shadow: 0 20px 55px rgba(31, 145, 216, .34), inset 0 1px 0 rgba(255, 255, 255, .34);
}
.auth-orb .icon { width: 34px; height: 34px; }
.auth-intro h1 { max-width: 600px; margin: 0; font-size: clamp(36px, 4.6vw, 62px); line-height: 1.02; letter-spacing: -.055em; }
.auth-intro > p:not(.kicker) { max-width: 580px; margin: 22px 0 0; color: #b9cae0; font-size: 16px; line-height: 1.65; }
.auth-points { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 34px; }
.auth-points span { padding: 9px 12px; border: 1px solid rgba(190, 225, 255, .14); border-radius: 999px; color: #d7e9fa; background: rgba(255, 255, 255, .055); font-size: 12px; }
.auth-card { align-self: center; padding: clamp(28px, 4vw, 48px); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 32px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 16px; }
.auth-brand small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(2, 8, 17, .48); }
.auth-switch button { min-height: 42px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; transition: color .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.auth-switch button[aria-selected="true"] { color: #fff; background: rgba(42, 171, 238, .19); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.auth-form .field { margin-bottom: 17px; }
.auth-submit { width: 100%; margin-top: 2px; }
.auth-error { min-height: 20px; margin: 15px 0 0; color: #ffb3bd; font-size: 12px; line-height: 1.5; }
.auth-note { margin: 12px 0 0; color: #8095ae; font-size: 11px; text-align: center; }

.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #dce9f7;
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
}
.icon-btn:active { transform: scale(.96); }
.menu-toggle, .nav-mobile-head, .nav-scrim { display: none; }
#token-dialog { display: none !important; }

@media (max-width: 1020px) {
  .top, .tabs { width: calc(100% - 24px); }
  .tab { padding-inline: 11px; }
  .tab span { font-size: 12px; }
  main { padding-top: 34px; }
  .auth-shell { grid-template-columns: 1fr minmax(340px, .92fr); }
  .auth-intro { padding: 42px; }
}

@media (max-width: 700px) {
  body.menu-open { overflow: hidden; }
  html { scroll-padding-top: 76px; }
  .top {
    top: 8px;
    width: calc(100% - 16px);
    height: 56px;
    margin-top: 8px;
    padding: 0 9px;
    border-radius: 16px;
  }
  .logo { width: 34px; height: 34px; border-radius: 11px; }
  .brand h1 { font-size: 14px; }
  .menu-toggle { display: grid; }
  .statusline { gap: 7px; }
  .statusline .btn { min-width: 44px; padding: 9px 11px; }
  .statusline #connection, .statusline #logout-btn span { display: none; }

  .tabs {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(84vw, 328px);
    height: 100dvh;
    margin: 0;
    padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    gap: 5px;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    border-width: 0 1px 0 0;
    border-radius: 0 24px 24px 0;
    background: rgba(7, 16, 30, .93);
    box-shadow: 24px 0 70px rgba(0, 3, 12, .52), inset 1px 0 0 rgba(255, 255, 255, .07);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    transform: translateX(-105%);
    transition: transform .28s var(--ease-out);
  }
  body.menu-open .tabs { transform: translateX(0); }
  .nav-mobile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 12px; padding: 3px 2px 14px; border-bottom: 1px solid var(--line); }
  .nav-mobile-head .brand { min-width: 0; }
  .nav-mobile-head .logo { width: 42px; height: 42px; }
  .nav-mobile-head .brand p { display: block; }
  .tab { width: 100%; min-width: 0; min-height: 50px; flex: 0 0 50px; justify-content: flex-start; padding: 0 14px; border-radius: 14px; }
  .tab .icon { width: 20px; height: 20px; }
  .tab span { display: inline; font-size: 14px; }
  .nav-scrim { position: fixed; inset: 0; z-index: 65; width: 100%; height: 100%; border: 0; background: rgba(0, 5, 14, .6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
  body.menu-open .nav-scrim { display: block; opacity: 1; pointer-events: auto; }
  main { padding: 24px 10px calc(40px + env(safe-area-inset-bottom)); }
  .head { gap: 10px; margin-bottom: 16px; }
  .head h2 { max-width: 100%; font-size: clamp(27px, 8.3vw, 31px); line-height: 1.04; letter-spacing: -.04em; }
  .kicker { margin-bottom: 6px; font-size: 10px; }
  .lead { margin-top: 7px; font-size: 12px; line-height: 1.48; }
  .head > .btn { align-self: flex-end; min-height: 40px; }
  .card { padding: 14px; border-radius: 16px; }
  .cardhead { align-items: flex-start; gap: 10px; margin-bottom: 13px; }
  .cardhead h3 { font-size: 15px; }
  .cardhead .sub { font-size: 11px; }
  .metric { min-height: 112px; padding: 14px; }
  .metric strong { margin-top: 9px; font-size: 28px; }
  .choice { min-height: 104px; padding: 14px; }
  .notice { padding: 12px; font-size: 12px; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 22px; }
  .dialog { max-height: calc(100dvh - 18px); overflow-y: auto; padding: 19px; }
  .toast { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); }

  .tablewrap { overflow: visible; border: 0; background: transparent; }
  table, thead, tbody, tr, td { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3, 10, 21, .52); }
  tbody tr:hover { background: rgba(3, 10, 21, .52); }
  tbody td, tbody tr:last-child td { display: block; min-width: 0; padding: 8px; border-bottom: 1px solid rgba(197, 221, 255, .075); overflow-wrap: anywhere; }
  tbody td:nth-child(odd):not(:last-child) { border-right: 1px solid rgba(197, 221, 255, .075); }
  tbody td:last-child { grid-column: 1 / -1; border: 0; }
  tbody td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #8298b2; font-size: 9px; font-weight: 780; letter-spacing: .075em; text-transform: uppercase; }
  tbody td .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; gap: 7px; }
  tbody td .actions > .btn { width: 100%; min-width: 0; min-height: 40px; padding-inline: 8px; white-space: nowrap; }
  tbody td .actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  tbody td[data-label="Причина"],
  tbody td[data-label="Ошибка"] { grid-column: 1 / -1; border-right: 0 !important; }

  .auth-pending .auth-screen, .auth-visible .auth-screen { align-items: center; padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); }
  .auth-shell { display: block; width: min(100%, 460px); border-radius: 24px; }
  .auth-intro { display: none; }
  .auth-card { padding: 23px 20px; }
  .auth-brand { margin-bottom: 24px; }
}

@media (max-width: 420px) {
  .statusline > .dot { display: none; }
  .top .brand { gap: 8px; }
  .card { padding: 12px; }
  .row { gap: 0; }
  .metric { min-height: 104px; }
  tbody tr { padding: 6px; }
  tbody td, tbody tr:last-child td { padding: 8px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .panel, dialog[open] { transform: none !important; filter: none !important; }
}

/* Invite task builder — dense operational form with glass hierarchy */
.invite-head { align-items: center; }
.invite-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.invite-summary span {
  min-width: 142px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.invite-summary b { color: var(--text); font-size: 15px; }
.invite-law { margin-bottom: 16px; }
.invite-law strong { color: #fff0bd; }
.invite-law span { color: #e2c979; }
.invite-builder { padding: 0; overflow: visible; }
.invite-builder::before { border-radius: inherit; }
.invite-steps {
  position: sticky;
  z-index: 8;
  top: 166px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: rgba(8, 17, 31, .88);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  backdrop-filter: blur(26px) saturate(165%);
}
.invite-steps button {
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  text-align: left;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.invite-steps button > span {
  grid-row: 1 / 3;
  align-self: center;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #d6e6f8;
  font-size: 12px;
  font-weight: 800;
}
.invite-steps button b { align-self: end; color: inherit; font-size: 13px; }
.invite-steps button small { align-self: start; margin-top: 2px; font-size: 10px; }
.invite-steps button:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.invite-steps button[aria-selected="true"] {
  color: #fff;
  border-color: rgba(99, 202, 255, .25);
  background: linear-gradient(145deg, rgba(42, 171, 238, .22), rgba(49, 112, 223, .15));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.invite-steps button[aria-selected="true"] > span { border-color: transparent; background: var(--blue); color: #fff; }
.invite-steps button:focus-visible { outline: 2px solid #78d3ff; outline-offset: 2px; }
.invite-pane { display: none; padding: 24px; }
.invite-pane.active { display: block; animation: materialize .28s var(--ease-out); }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-title > div > span { color: #65c9fb; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.section-title h3 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.025em; }
.section-title > p { max-width: 480px; margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: right; }
.source-box,
.schedule-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 12, 25, .34);
}
.source-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.source-head > div { display: flex; align-items: flex-start; gap: 12px; }
.source-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #7dd3fc; background: var(--blue-soft); }
.source-head h3,
.schedule-card h3 { margin: 0; font-size: 14px; }
.source-head p,
.schedule-card > p,
.schedule-card .field-label-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.setting-list { display: grid; gap: 9px; }
.setting-list.compact { gap: 7px; }
.setting-row {
  min-height: 60px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .035);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.setting-row:hover { border-color: rgba(99, 202, 255, .28); background: rgba(255, 255, 255, .052); }
.setting-row input[type="checkbox"] { flex: 0 0 auto; margin-top: 2px; }
.setting-row span { min-width: 0; }
.setting-row b,
.inline-setting b { display: block; color: #e8f2ff; font-size: 12px; line-height: 1.35; }
.setting-row small,
.inline-setting small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 450; line-height: 1.42; }
.nested-setting { margin: -2px 0 3px 41px; padding: 10px 12px; border-left: 2px solid rgba(42, 171, 238, .45); border-radius: 0 11px 11px 0; background: rgba(42, 171, 238, .06); }
.nested-setting.inline { display: flex; align-items: center; gap: 8px; }
.nested-setting.inline input { width: 88px; }
.nested-setting.inline span { color: var(--muted); font-size: 11px; }
.nested-setting.row { display: grid; }
.inline-setting {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .035);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.inline-setting input { width: 96px; flex: 0 0 auto; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.field-label-row label { margin: 0; }
.text-btn { min-height: 36px; padding: 6px 8px; border: 0; background: transparent; color: #75d2ff; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-btn:hover { color: #fff; }
.account-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.account-option {
  min-height: 68px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  display: grid;
  grid-template-columns: 18px 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.account-option:has(input:checked) { border-color: rgba(67, 194, 255, .55); background: rgba(42, 171, 238, .11); }
.account-option.disabled { opacity: .55; cursor: not-allowed; }
.account-option .badge { grid-column: 3; width: max-content; margin-top: -4px; }
.account-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #36bcf7, #2563d8); font-size: 13px; font-weight: 800; }
.account-copy { min-width: 0; align-self: end; }
.account-copy b,
.account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy b { color: #edf6ff; font-size: 12px; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 450; }
.empty.compact { grid-column: 1 / -1; padding: 22px 16px; }
.invite-settings-grid { margin-top: 18px; }
.schedule-card .row { margin-top: 15px; }
.schedule-card .field { margin-bottom: 0; }
.weekday-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 14px; }
.weekday-picker label { margin: 0; cursor: pointer; }
.weekday-picker input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-picker span { min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255, 255, 255, .035); font-size: 12px; font-weight: 750; transition: .18s ease; }
.weekday-picker input:checked + span { border-color: rgba(99, 202, 255, .42); color: #fff; background: rgba(42, 171, 238, .18); }
.weekday-picker input:focus-visible + span { outline: 2px solid #78d3ff; outline-offset: 2px; }
.invite-footer {
  position: sticky;
  z-index: 7;
  bottom: 12px;
  min-height: 76px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: rgba(8, 17, 31, .9);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  backdrop-filter: blur(26px) saturate(165%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.form-status { color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-status.ready { color: #8ff0bd; }
.story-footer { position: static; margin: 24px -24px -24px; }
.story-account-summary { color: var(--muted); font-size: 12px; }
.story-account-summary b { color: var(--text); font-size: 15px; }
.audience-parse-card { max-width: 1040px; }
.audience-format { margin-top: 4px; }
.audience-format code { color: #a7e1ff; overflow-wrap: anywhere; }
.profile-workspace-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 820px; margin: 0 0 20px; padding: 6px; border: 1px solid rgba(129, 180, 228, .2); border-radius: 18px; background: rgba(7, 20, 38, .58); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.profile-workspace-switch button { min-height: 74px; padding: 13px 16px; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--muted); border: 1px solid transparent; border-radius: 13px; background: transparent; cursor: pointer; transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease; }
.profile-workspace-switch button:hover { color: #eaf6ff; border-color: rgba(125, 211, 252, .18); background: rgba(255,255,255,.035); }
.profile-workspace-switch button[aria-selected="true"] { color: #fff; border-color: rgba(86, 203, 255, .5); background: linear-gradient(145deg, rgba(48, 186, 244, .92), rgba(31, 127, 207, .92)); box-shadow: 0 14px 30px rgba(23, 135, 211, .25), inset 0 1px 0 rgba(255,255,255,.28); }
.profile-workspace-switch button:active { transform: scale(.985); }
.profile-workspace-switch .icon { width: 24px; height: 24px; flex: 0 0 auto; }
.profile-workspace-switch span { display: grid; gap: 3px; }
.profile-workspace-switch b { font-size: 14px; }
.profile-workspace-switch small { color: inherit; opacity: .78; font-size: 11px; }
.profile-pane { display: none; }
.profile-pane.active { display: block; animation: profile-pane-in .2s ease; }
.compact-setting { margin: -2px 0 14px; padding: 11px 12px; }
@keyframes profile-pane-in { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }

@media (max-width: 1020px) {
  .invite-steps { top: 156px; }
  .account-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .invite-summary { width: 100%; justify-content: flex-start; }
  .invite-summary span { flex: 1; }
  .invite-steps { top: 76px; }
  .invite-steps button { min-height: 52px; grid-template-columns: 28px 1fr; padding: 8px; }
  .invite-steps button > span { width: 26px; height: 26px; }
  .invite-steps button small { display: none; }
  .section-title { flex-direction: column; gap: 7px; }
  .section-title > p { text-align: left; }
  .invite-footer { position: static; align-items: stretch; flex-direction: column; min-height: 0; padding: 12px 14px; }
  .invite-footer .actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .invite-builder { margin-inline: -2px; }
  .invite-pane { padding: 15px 12px; }
  .invite-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px; overflow: hidden; }
  .invite-steps button { min-width: 0; min-height: 54px; grid-template-columns: 24px minmax(0, 1fr); column-gap: 6px; padding: 6px; }
  .invite-steps button > span { width: 24px; height: 24px; border-radius: 8px; }
  .invite-steps button b { font-size: 10px; line-height: 1.22; overflow-wrap: anywhere; }
  .source-head { flex-direction: column; }
  .account-picker { grid-template-columns: 1fr; }
  .weekday-picker { grid-template-columns: repeat(4, 1fr); }
  .invite-footer { padding: 11px; }
  .invite-footer .actions { grid-template-columns: 1fr; }
  .profile-workspace-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 5px; padding: 5px; }
  .profile-workspace-switch button { min-height: 58px; padding: 9px 10px; gap: 8px; }
  .profile-workspace-switch .icon { width: 19px; height: 19px; }
  .profile-workspace-switch b { font-size: 11px; line-height: 1.25; }
  .profile-workspace-switch small { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .top, .tabs, .card, dialog, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top, .tabs { background: #0b1729; }
  .card { background: #101e32; }
  dialog, .toast { background: #0e1b2e; }
}

@media (prefers-contrast: more) {
  :root { --muted: #c5d1df; --line: rgba(255, 255, 255, .32); --line-strong: rgba(255, 255, 255, .52); }
  .top, .tabs, .card, dialog { background-color: rgba(5, 13, 25, .94); }
  input, select, textarea { border-width: 2px; }
}

/* Profile and channel operations: visible progress and inspectable step logs */
.loading-spinner {
  transform-box: fill-box;
  transform-origin: center;
  animation: operation-spin .82s linear infinite;
}
.btn[aria-busy="true"] {
  opacity: .78;
  cursor: progress;
  filter: saturate(.9);
}
@keyframes operation-spin { to { transform: rotate(360deg); } }

.log-toggle.active {
  border-color: rgba(83, 207, 255, .5);
  color: #e9f9ff;
  background: rgba(40, 165, 224, .16);
}
.operation-log-row:hover { background: transparent; }
.operation-log-row > td {
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 12, 25, .46);
}
.operation-log-panel { padding: 16px; }
.operation-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}
.operation-log-head b,
.operation-log-head span { display: block; }
.operation-log-head b { color: #edf7ff; font-size: 13px; }
.operation-log-head span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.operation-log-list { display: grid; gap: 8px; }
.operation-log-entry {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(153, 190, 225, .13);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}
.operation-log-mark {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #63caff;
  box-shadow: 0 0 0 4px rgba(99, 202, 255, .1);
}
.operation-log-entry.success .operation-log-mark { background: #41d695; box-shadow: 0 0 0 4px rgba(65, 214, 149, .1); }
.operation-log-entry.warning .operation-log-mark { background: #f5bc55; box-shadow: 0 0 0 4px rgba(245, 188, 85, .1); }
.operation-log-entry.error { border-color: rgba(244, 93, 121, .25); background: rgba(151, 30, 59, .1); }
.operation-log-entry.error .operation-log-mark { background: #f45d79; box-shadow: 0 0 0 4px rgba(244, 93, 121, .11); }
.operation-log-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.operation-log-meta span { color: #b9def3; font-size: 10px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.operation-log-meta time { color: #738ca7; font-size: 10px; }
.operation-log-entry p { margin: 4px 0 0; color: #dce9f7; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.operation-log-loading,
.operation-log-empty,
.operation-log-error {
  min-height: 54px;
  padding: 15px;
  border: 1px dashed rgba(141, 185, 224, .18);
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}
.operation-log-error { color: #ffb3c1; border-color: rgba(244, 93, 121, .3); }

@media (max-width: 700px) {
  tbody tr.operation-log-row { margin-top: -8px; padding: 0; border-color: rgba(99, 202, 255, .22); background: rgba(7, 20, 38, .82); }
  tbody tr.operation-log-row > td,
  tbody tr.operation-log-row:last-child > td { display: block; grid-column: 1 / -1; padding: 0; border: 0; }
  tbody tr.operation-log-row > td::before { display: none; }
  .operation-log-panel { padding: 14px; }
  .operation-log-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation: none; }
}

/* Account center: Telegram identity, limits, restrictions and lifetime history */
.logo,
.auth-orb {
  overflow: hidden;
  background: #f7f1e8;
}
.brand-logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.52);
}
.account-manager .tablewrap { border-radius: 16px; }
.account-manager table { min-width: 1160px; }
.account-manager tbody td { vertical-align: middle; }
.account-identity {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.account-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 213, 255, .32);
  border-radius: 15px;
  color: #e9f9ff;
  background: linear-gradient(145deg, rgba(51, 188, 244, .76), rgba(63, 98, 218, .74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 22px rgba(19, 131, 201, .2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .025em;
}
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-name,
.account-handle,
.account-premium { display: block; }
.account-name { color: #f2f8ff; font-size: 13px; line-height: 1.25; }
.account-handle { margin-top: 4px; color: #a9bfd7; font-size: 11px; overflow-wrap: anywhere; }
.account-premium { margin-top: 4px; color: #6f88a4; font-size: 10px; }
.account-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.spam-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(145, 173, 205, .16);
  border-radius: 999px;
  color: #b9c8da;
  background: rgba(143, 163, 190, .09);
  font-size: 10px;
  font-weight: 800;
}
.spam-pill.clear { border-color: rgba(65, 214, 149, .24); color: #88efbd; background: rgba(32, 161, 106, .12); }
.spam-pill.restricted { border-color: rgba(244, 93, 121, .3); color: #ff9caf; background: rgba(176, 35, 67, .14); }
.spam-pill.unknown { border-color: rgba(245, 188, 85, .3); color: #ffd98b; background: rgba(188, 128, 25, .13); }
.spam-pill.needs_check { border-color: rgba(245, 188, 85, .3); color: #ffd98b; background: rgba(188, 128, 25, .13); }
.account-error { display: block; max-width: 260px; margin-top: 7px; color: #ff9daf; font-size: 10px; line-height: 1.35; }
.limit-summary {
  min-width: 114px;
  padding: 8px 10px;
  border: 1px solid rgba(128, 171, 213, .18);
  border-radius: 11px;
  color: #b9cae0;
  background: rgba(2, 10, 21, .32);
  cursor: pointer;
}
.limit-summary:hover { border-color: rgba(83, 207, 255, .42); background: rgba(33, 148, 206, .1); }
.limit-summary span { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; }
.limit-summary span + span { margin-top: 5px; }
.limit-summary b { color: #edf7ff; font-size: 12px; }
.account-tenure { color: #b9cae0; font-size: 11px; white-space: nowrap; }
.account-actions { min-width: 224px; }
.account-actions .btn { min-height: 32px; }
.activity-dialog { width: min(780px, calc(100% - 28px)); }
.account-activity-list { max-height: min(68vh, 680px); overflow-y: auto; display: grid; gap: 9px; padding-right: 3px; }
.account-event {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid rgba(153, 190, 225, .13);
  border-radius: 13px;
  background: rgba(255, 255, 255, .035);
}
.account-event-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #63caff; box-shadow: 0 0 0 4px rgba(99, 202, 255, .09); }
.account-event.success .account-event-dot { background: #41d695; box-shadow: 0 0 0 4px rgba(65, 214, 149, .1); }
.account-event.warning .account-event-dot { background: #f5bc55; box-shadow: 0 0 0 4px rgba(245, 188, 85, .1); }
.account-event.error { border-color: rgba(244, 93, 121, .24); background: rgba(151, 30, 59, .1); }
.account-event.error .account-event-dot { background: #f45d79; box-shadow: 0 0 0 4px rgba(244, 93, 121, .11); }
.account-event-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.account-event-head b { color: #bfe7fb; font-size: 11px; }
.account-event-head time { color: #738ca7; font-size: 10px; white-space: nowrap; }
.account-event p { margin: 5px 0 0; color: #dce9f7; font-size: 12px; line-height: 1.48; overflow-wrap: anywhere; }
.premium-buy {
  min-width: 142px;
  border-color: rgba(250, 204, 94, .28);
  color: #fff5c8;
  background: linear-gradient(135deg, rgba(139, 92, 246, .78), rgba(42, 171, 238, .82));
  box-shadow: 0 8px 24px rgba(68, 113, 224, .18);
}
.premium-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(250, 204, 94, .28);
  border-radius: 999px;
  color: #ffe8a1;
  background: linear-gradient(135deg, rgba(137, 93, 230, .18), rgba(34, 163, 215, .16));
  font-size: 10px;
  font-weight: 850;
}
.premium-dialog { width: min(620px, calc(100% - 28px)); }
.premium-dialog .dialog { padding: clamp(18px, 4vw, 28px); }
.premium-dialog .dialoghead { align-items: flex-start; }
.premium-dialog .kicker { margin-bottom: 5px; }
.premium-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(126, 189, 229, .18);
  border-radius: 15px;
  background: rgba(5, 17, 33, .48);
}
.premium-account b,
.premium-account span { display: block; }
.premium-account b { color: #f0f8ff; font-size: 13px; }
.premium-account > div > span { margin-top: 3px; color: #89a4bf; font-size: 11px; }
.premium-security {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin-top: 13px;
  padding: 14px;
  border: 1px solid rgba(64, 211, 155, .23);
  border-radius: 14px;
  background: rgba(28, 154, 108, .09);
}
.premium-security > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #d5ffec;
  background: rgba(47, 195, 139, .2);
  font-weight: 900;
}
.premium-security b { color: #c9f8e5; font-size: 12px; }
.premium-security p { margin: 4px 0 0; color: #9bc2b5; font-size: 11px; line-height: 1.5; }
.premium-stage { margin-top: 18px; }
.premium-points { display: grid; gap: 8px; margin-bottom: 15px; }
.premium-points span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bdd0e4;
  font-size: 12px;
}
.premium-points i {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(104, 200, 244, .25);
  border-radius: 9px;
  color: #8edcff;
  background: rgba(38, 156, 215, .11);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}
.premium-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 48px;
  background: linear-gradient(135deg, #8259e8, #28aeea);
  box-shadow: 0 12px 32px rgba(54, 141, 224, .22);
}
.premium-dialog .btn[aria-busy="true"] {
  position: relative;
  overflow: hidden;
  cursor: progress;
  isolation: isolate;
}
.premium-dialog .btn[aria-busy="true"]::before {
  content: "";
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(56, 255, 157, .17);
}
.premium-dialog .btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  width: 38%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #32f497 28%, #b8ffda 66%, transparent);
  box-shadow: 0 0 12px rgba(50, 244, 151, .9), 0 -2px 10px rgba(50, 244, 151, .35);
  transform: translateX(-110%);
  animation: premium-progress-sweep 1.15s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes premium-progress-sweep {
  to { transform: translateX(370%); }
}
@media (prefers-reduced-motion: reduce) {
  .premium-dialog .btn[aria-busy="true"]::after {
    width: 100%;
    transform: none;
    animation: none;
    background: #57eea3;
    opacity: .9;
  }
}
.premium-price-card {
  padding: 18px;
  border: 1px solid rgba(112, 188, 235, .2);
  border-radius: 16px;
  text-align: center;
  background: radial-gradient(circle at 50% 0, rgba(69, 161, 226, .19), transparent 70%), rgba(4, 15, 29, .5);
}
.premium-price-card span,
.premium-price-card small { display: block; color: #8fa9c3; font-size: 11px; }
.premium-price-card strong { display: block; margin: 6px 0 4px; color: #f6fbff; font-size: 30px; letter-spacing: -.04em; }
.premium-renewal { margin: 13px 0 8px; color: #afc2d7; font-size: 11px; line-height: 1.5; }
.premium-card-form {
  display: grid;
  gap: 11px;
  margin: 14px 0 12px;
  padding: 15px;
  border: 1px solid rgba(109, 189, 237, .2);
  border-radius: 16px;
  background: rgba(4, 15, 29, .44);
}
.premium-card-form .field { margin: 0; }
.premium-card-form input {
  min-height: 48px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
}
.premium-card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
#premium-3ds { margin-top: 12px; }
.premium-client-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(91, 196, 245, .24);
  border-radius: 13px;
  color: #9ab2ca;
  background: rgba(43, 157, 218, .08);
  font-size: 11px;
  line-height: 1.45;
}
.premium-client-note b { color: #bdeaff; font-size: 12px; }
.premium-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 9px; margin-top: 16px; }
.premium-actions .btn { min-height: 46px; }
.premium-success {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid rgba(73, 221, 160, .3);
  border-radius: 15px;
  background: rgba(30, 166, 110, .12);
}
.premium-success > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #ffe69a; background: linear-gradient(135deg, rgba(130, 89, 232, .58), rgba(40, 174, 234, .58)); }
.premium-success b { color: #bdf7dd; font-size: 13px; }
.premium-success p { margin: 4px 0 0; color: #9dc8b7; font-size: 11px; line-height: 1.5; }
.premium-status { min-height: 18px; margin: 13px 0 0; color: #829ab3; font-size: 10px; line-height: 1.45; text-align: center; }

@media (max-width: 700px) {
  .account-manager table { min-width: 0; }
  .account-manager tbody td:first-child { display: none; }
  .account-manager tbody td[data-label="Аккаунт"] { display: block; grid-column: 1 / -1; border-right: 0; }
  .account-manager tbody td[data-label="Аккаунт"]::before { display: none; }
  .account-identity { min-width: 0; }
  .account-avatar { width: 44px; height: 44px; flex-basis: 44px; border-radius: 14px; }
  .account-actions { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .account-actions .btn { width: 100%; min-height: 40px; }
  .account-manager .premium-buy { width: 100%; min-width: 0; white-space: normal; }
  .account-manager .limit-summary { width: 100%; min-width: 0; }
  #proxies tbody td:first-child { display: none; }
  #proxies tbody td[data-label="Прокси"] { grid-column: 1 / -1; border-right: 0; }
  .account-event-head { flex-direction: column; gap: 3px; }
  .account-activity-list { max-height: none; }
  .premium-actions { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .account-actions { grid-template-columns: 1fr 1fr; }
  .premium-card-row { grid-template-columns: 1fr; }
}

/* Dialog inbox */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.dialogs-workspace { display: grid; grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); gap: 16px; min-height: 680px; }
.dialogs-sidebar, .dialog-thread-card { min-height: 0; padding: 0; overflow: hidden; }
.dialog-controls { padding: 18px; border-bottom: 1px solid rgba(119, 168, 215, .16); background: rgba(8, 22, 40, .42); }
.dialog-controls .field:last-child { margin-bottom: 0; }
.dialog-list { height: 548px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(90, 171, 229, .45) transparent; }
.dialog-list-loading, .dialog-messages-loading { min-height: 180px; display: grid; place-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.dialog-list-item { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border: 0; border-bottom: 1px solid rgba(119, 168, 215, .11); color: var(--text); background: transparent; text-align: left; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.dialog-list-item:hover { background: rgba(78, 171, 232, .08); }
.dialog-list-item.active { background: linear-gradient(90deg, rgba(63, 160, 226, .2), rgba(72, 106, 218, .1)); box-shadow: inset 3px 0 #4cc5ee; }
.dialog-avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid rgba(117, 190, 235, .28); border-radius: 50%; color: #d9f5ff; background: linear-gradient(145deg, rgba(53, 166, 228, .75), rgba(79, 101, 213, .62)); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.dialog-avatar .icon { width: 21px; height: 21px; }
.dialog-list-copy { min-width: 0; }
.dialog-list-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dialog-list-title b { overflow: hidden; color: #eff9ff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dialog-kind { flex: 0 0 auto; color: #75c9f1; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.dialog-preview { display: block; margin-top: 4px; overflow: hidden; color: #8199b3; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dialog-preview.out::before { content: 'Вы: '; color: #62d9a3; }
.dialog-list-meta { align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 5px; color: #738ba4; font-size: 9px; }
.dialog-unread { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; color: #061426; background: #47d6a0; font-size: 10px; font-weight: 850; }
.dialog-thread-card { display: grid; grid-template-rows: auto auto minmax(360px, 1fr) auto auto; }
.dialog-thread-head { min-height: 78px; display: flex; align-items: center; gap: 12px; padding: 16px 19px; border-bottom: 1px solid rgba(119, 168, 215, .16); background: rgba(8, 22, 40, .42); }
.dialog-thread-head h3 { margin: 0; color: #eff9ff; font-size: 15px; }
.dialog-thread-head p { margin: 4px 0 0; color: #8199b3; font-size: 11px; }
.dialog-older { padding: 9px 14px 0; text-align: center; }
.dialog-messages { min-height: 360px; max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 18px; background: radial-gradient(circle at 90% 0, rgba(48, 142, 206, .08), transparent 34%), rgba(5, 15, 29, .48); scrollbar-width: thin; scrollbar-color: rgba(90, 171, 229, .45) transparent; }
.dialog-message { max-width: min(76%, 720px); align-self: flex-start; padding: 10px 12px 8px; border: 1px solid rgba(117, 167, 213, .15); border-radius: 5px 15px 15px 15px; color: #e9f5ff; background: rgba(20, 38, 61, .96); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.dialog-message.out { align-self: flex-end; border-color: rgba(65, 205, 152, .18); border-radius: 15px 5px 15px 15px; background: linear-gradient(145deg, rgba(25, 112, 99, .96), rgba(21, 83, 91, .96)); }
.dialog-message-sender { display: block; margin-bottom: 4px; color: #6ad4f4; font-size: 10px; font-weight: 750; }
.dialog-message-text { margin: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.dialog-media-label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; color: #9ddcf5; font-size: 11px; font-weight: 700; }
.dialog-message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 5px; color: rgba(202, 223, 236, .58); font-size: 9px; }
.dialog-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 13px 15px; border-top: 1px solid rgba(119, 168, 215, .16); background: rgba(8, 22, 40, .58); }
.dialog-composer textarea { min-height: 48px; max-height: 150px; margin: 0; resize: vertical; }
.dialog-composer .btn { align-self: stretch; min-width: 126px; }
.dialog-privacy { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0 17px 13px; color: #748da7; background: rgba(8, 22, 40, .58); font-size: 9px; line-height: 1.4; }
.dialog-privacy .icon { width: 14px; height: 14px; flex: 0 0 14px; }

@media (max-width: 900px) {
  .dialogs-workspace { grid-template-columns: 1fr; gap: 12px; min-height: 0; }
  .dialog-list { height: min(40vh, 360px); }
  .dialog-thread-card { min-height: 620px; }
  .dialog-messages { max-height: 520px; }
}

@media (max-width: 620px) {
  .dialogs-workspace { margin-inline: -4px; }
  .dialog-controls { padding: 13px; }
  .dialog-controls .row { grid-template-columns: 1fr 1fr; }
  .dialog-thread-card { min-height: calc(100vh - 190px); }
  .dialog-thread-head { min-height: 70px; padding: 13px 14px; }
  .dialog-list-item { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; padding: 10px 11px; }
  .dialog-avatar { width: 40px; height: 40px; flex-basis: 40px; }
  .dialog-messages { min-height: 330px; max-height: none; padding: 13px 10px; }
  .dialog-message { max-width: 88%; }
  .dialog-composer { grid-template-columns: 1fr; padding: 10px; }
  .dialog-composer .btn { width: 100%; min-height: 42px; }
  .dialog-privacy { padding: 0 11px 11px; }
}

@media (max-width: 420px) {
  .dialog-controls .row { grid-template-columns: 1fr; gap: 0; }
  .dialog-list { height: 300px; }
}

/* Product Design mobile pass — fewer nested frames, clearer hierarchy */
@media (max-width: 700px) {
  body {
    background-attachment: scroll;
    background:
      radial-gradient(520px 360px at 8% -4%, rgba(42, 171, 238, .14), transparent 68%),
      linear-gradient(165deg, #081525 0%, #050c18 48%, #030914 100%);
  }

  .top {
    top: 0;
    width: 100%;
    height: 60px;
    margin: 0;
    padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    border-width: 0 0 1px;
    border-radius: 0;
    background: rgba(7, 16, 30, .9);
    box-shadow: 0 10px 32px rgba(0, 4, 13, .22);
  }

  main { padding: 22px 0 calc(42px + env(safe-area-inset-bottom)); }
  .panel > .head { padding-inline: 16px; }
  .panel > .head h2 { text-wrap: balance; }
  .panel > .head .lead { max-width: 34rem; }

  #overview > .grid,
  #proxies > .grid,
  #audiences > .grid,
  #profile .profile-pane > .grid {
    gap: 12px;
    padding-inline: 12px;
  }

  #overview > .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
  #overview .metric.s3 { grid-column: span 6; min-height: 100px; }
  #overview .metric strong { font-size: 26px; }
  #overview > .grid > .s12 { grid-column: 1 / -1; }

  /* These are page shells, not content cards. On phones they become full-width sections. */
  #accounts > .account-manager,
  #jobs > article.card,
  #invite > .invite-builder,
  #stories > article.card,
  #audience-parse > article.card,
  #proxies > .grid > article.card,
  #audiences > .grid > article.card,
  #profile .profile-pane > .grid > article.card,
  #dialogs .dialogs-sidebar,
  #dialogs .dialog-thread-card {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(11, 24, 43, .5);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  #accounts > .account-manager,
  #jobs > article.card,
  #invite > .invite-builder,
  #stories > article.card,
  #audience-parse > article.card {
    padding-inline: 16px;
  }

  #accounts > .account-manager,
  #jobs > article.card,
  #stories > article.card,
  #audience-parse > article.card { border-color: rgba(197, 221, 255, .11); }

  #accounts > .account-manager .cardhead,
  #jobs > article.card .cardhead { margin-bottom: 12px; }

  input, select, textarea {
    min-height: 46px;
    padding: 10px 12px;
    border-color: rgba(197, 221, 255, .16);
    border-radius: 12px;
    background: rgba(3, 11, 23, .78);
  }
  textarea { min-height: 96px; }
  label { margin-bottom: 6px; font-size: 11px; }
  .hint { margin-top: 5px; line-height: 1.45; }

  .notice { border-radius: 13px; background: rgba(42, 171, 238, .075); }
  .notice.warn { background: rgba(255, 182, 72, .065); }

  /* Mobile data cards: use spacing instead of a spreadsheet-like cage. */
  tbody { gap: 12px; }
  tbody tr {
    gap: 6px;
    padding: 10px;
    border-color: rgba(197, 221, 255, .13);
    border-radius: 16px;
    background: rgba(3, 11, 23, .66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  }
  tbody tr:hover { background: rgba(3, 11, 23, .66); }
  tbody td,
  tbody tr:last-child td {
    padding: 8px 9px;
    border: 0 !important;
    border-radius: 10px;
    background: rgba(255, 255, 255, .027);
  }
  tbody td::before { margin-bottom: 6px; color: #7890aa; font-size: 8px; letter-spacing: .09em; }
  tbody td:last-child,
  tbody td[data-label="Действия"] { padding: 4px 0 0; background: transparent; }
  tbody td[data-label="Причина"],
  tbody td[data-label="Ошибка"] { background: rgba(255, 100, 116, .035); }
  tbody td .actions { gap: 8px; }
  tbody td .actions > .btn { min-height: 44px; }

  .badge {
    width: max-content;
    max-width: 100%;
    min-height: 24px;
    align-items: center;
    padding: 4px 8px;
    line-height: 1.2;
    white-space: normal;
  }
  .premium-buy {
    width: max-content !important;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 9px;
  }
  .limit-summary { border-radius: 10px; background: rgba(255, 255, 255, .025); }

  .account-manager tbody td[data-label="Аккаунт"] {
    padding: 3px 3px 10px;
    background: transparent;
  }
  .account-manager tbody td[data-label="Состояние"],
  .account-manager tbody td[data-label="Premium"] { align-content: start; }
  .account-manager .account-actions .btn { min-height: 44px; }

  #proxies > .grid > article:first-child > .row:not(:first-child),
  #stories > article.card .row,
  #profile .profile-pane .row,
  #audience-parse > article.card .row,
  .schedule-card .row,
  #invite-connect-options.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #proxies > .grid > article:first-child > .row:not(:first-child) .field,
  #stories > article.card .row .field,
  #profile .profile-pane .row .field,
  #audience-parse > article.card .row .field,
  .schedule-card .row .field { min-width: 0; }

  #jobs tbody td[data-label="Задача"] b { font-size: 13px; line-height: 1.25; }
  #jobs tbody td[data-label="Прогресс"] .progress { margin-top: 8px; }

  .invite-law { margin-inline: 12px; }
  .invite-summary { padding-inline: 0; }
  .invite-summary span { min-width: 0; border-radius: 12px; }
  .invite-steps {
    top: 60px;
    margin-inline: -16px;
    padding-inline: 12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(7, 17, 31, .94);
    box-shadow: 0 8px 24px rgba(0, 4, 13, .18);
  }
  .invite-pane { padding: 18px 0; }
  .invite-pane .section-title { padding-inline: 0; }
  .invite-footer {
    margin-inline: -16px;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
    border-radius: 0;
  }
  .source-box,
  .setting-list,
  .schedule-card { border-radius: 14px; }

  .profile-workspace-switch { margin-inline: 12px; width: calc(100% - 24px); }
  .dialogs-workspace { margin-inline: 0; gap: 12px; }

  dialog {
    width: 100%;
    max-height: 94dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }
  .dialog {
    max-height: 94dvh;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  #overview .metric.s3 { grid-column: span 6; }
  #overview .metric { padding: 12px; }
  #overview .metric label,
  #overview .metric small { font-size: 10px; }
  .panel > .head { padding-inline: 14px; }
  #accounts > .account-manager,
  #jobs > article.card,
  #invite > .invite-builder,
  #stories > article.card,
  #audience-parse > article.card { padding-inline: 14px; }
  .invite-steps { margin-inline: -14px; padding-inline: 10px; }
  .invite-footer { margin-inline: -14px; padding-inline: 14px; }
}

/* Responsive v4 — compact mobile records and an explicit desktop mode. */
@media (max-width: 700px) {
  /* A record is one card. Its fields are rows, not nested cards. */
  #accounts tbody tr,
  #jobs tbody tr {
    gap: 0;
    padding: 12px;
  }

  #accounts tbody td,
  #accounts tbody tr:last-child td,
  #jobs tbody td,
  #jobs tbody tr:last-child td {
    min-width: 0;
    padding: 9px 5px;
    border: 0 !important;
    border-top: 1px solid rgba(197, 221, 255, .085) !important;
    border-radius: 0;
    background: transparent;
  }

  #accounts tbody td:nth-child(-n + 2),
  #jobs tbody td:nth-child(-n + 2) {
    border-top: 0 !important;
  }

  #accounts tbody td::before,
  #jobs tbody td::before {
    margin-bottom: 5px;
    font-size: 7.5px;
  }

  #accounts tbody td[data-label="Аккаунт"] {
    grid-column: 1 / -1;
    padding: 2px 3px 11px;
    border-top: 0 !important;
  }

  #accounts tbody td[data-label="Состояние"] {
    grid-column: 1 / -1;
  }

  #accounts tbody td[data-label="Premium"],
  #accounts tbody td[data-label="Прокси"],
  #accounts tbody td[data-label="Лимиты"],
  #accounts tbody td[data-label="В сервисе"] {
    align-content: start;
  }

  #accounts .limit-summary {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #accounts tbody td[data-label="Действия"],
  #jobs tbody td[data-label="Действия"] {
    grid-column: 1 / -1;
    padding: 10px 0 0;
    border-top: 1px solid rgba(197, 221, 255, .085) !important;
  }

  #accounts .account-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }

  #accounts .account-actions .btn {
    grid-column: span 2;
    min-width: 0;
    min-height: 40px;
    padding: 7px 5px;
    font-size: 10.5px;
    line-height: 1.15;
  }

  #accounts .account-actions .btn:nth-child(n + 4) {
    grid-column: span 3;
  }

  #jobs tbody td[data-label="Причина"],
  #jobs tbody td[data-label="Ошибка"] {
    grid-column: 1 / -1;
    background: transparent;
  }

  #jobs tbody td .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  #jobs tbody td .actions > .btn {
    flex: 1 1 88px;
    min-width: 0;
    min-height: 40px;
    padding: 7px 8px;
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }
}

@media (min-width: 701px) {
  /* Desktop/tablet must never inherit the mobile drawer or card-table layout. */
  .menu-toggle { display: none !important; }
  .nav-mobile-head,
  .nav-scrim { display: none !important; }

  .tabs {
    position: sticky;
    inset: auto;
    top: 78px;
    z-index: 19;
    width: min(1360px, calc(100% - 28px));
    height: auto;
    margin: 8px auto 0;
    padding: 5px;
    transform: none !important;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(8, 20, 36, .78);
    box-shadow: var(--shadow-soft);
  }

  .tabs.open { transform: none !important; }
  .tabs .tab { flex: 1 0 auto; }

  table { display: table; width: 100%; }
  thead { display: table-header-group; }
  tbody { display: table-row-group; }
  tr { display: table-row; }
  th,
  td { display: table-cell; }
}

/* Activity planner */
.activity-policy { margin-bottom: 18px; }
.activity-layout { align-items: start; }
.activity-builder { overflow: hidden; }
.activity-picker {
  max-height: 310px;
  min-height: 180px;
  overflow: auto;
  padding-right: 4px;
}
.activity-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.activity-action {
  display: grid;
  grid-template-columns: 20px 1fr 62px;
  gap: 10px;
  align-items: center;
  min-height: 78px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 16, 31, .58);
}
.activity-action:has(input[type="checkbox"]:checked) {
  border-color: rgba(59, 130, 246, .7);
  background: rgba(37, 99, 235, .1);
}
.activity-action > input[type="number"] {
  min-height: 38px;
  padding: 6px;
  text-align: center;
}
.activity-action span b,
.activity-action span small { display: block; }
.activity-action span b { color: var(--text); font-size: 13px; }
.activity-action span small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.activity-scope {
  display: inline-flex;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.activity-draft {
  display: block;
  max-width: 360px;
  margin-top: 5px;
  color: #cfe0f5;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .activity-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .activity-actions-grid { grid-template-columns: 1fr; }
  .activity-picker { min-height: auto; max-height: 280px; }
  .activity-action { grid-template-columns: 20px 1fr 56px; }
}

/* Soft Ledger — selected light product direction, 2026-08-23. */
:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg-deep: #eef3f9;
  --panel: #ffffff;
  --panel2: #f5f8fc;
  --glass: #ffffff;
  --glass-heavy: #ffffff;
  --glass-light: #f7f9fc;
  --line: #dfe6f0;
  --line-strong: #cbd7e7;
  --text: #10213d;
  --muted: #71809a;
  --blue: #1769ff;
  --blue-strong: #0d55dd;
  --blue-soft: #edf4ff;
  --green: #16a56a;
  --amber: #d98b17;
  --red: #d84b63;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-card: 0 1px 2px rgba(27, 53, 88, .035), 0 12px 34px rgba(77, 102, 136, .055);
  --shadow-float: 0 16px 48px rgba(49, 73, 107, .14);
  --shadow-soft: 0 1px 2px rgba(27, 53, 88, .035), 0 8px 24px rgba(77, 102, 136, .045);
  font-family: Inter, "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Native select menus must follow the light product theme as well. */
select { color-scheme: light; }
select option,
select optgroup {
  color: #10213d;
  background: #ffffff;
}
select option:disabled { color: #8a98ad; }

.activity-channel-search {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #dce7f5;
  border-radius: var(--radius-md);
  background: #f7faff;
}
.activity-channel-results { display: grid; gap: 8px; margin-top: 12px; }
.channel-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.channel-candidate b,
.channel-candidate small { display: block; }
.channel-candidate b { color: var(--text); font-size: 13px; }
.channel-candidate small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 11px;
}
.section-divider::before,
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.activity-account-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.activity-account-card + .activity-account-card { margin-top: 8px; }
.activity-account-card .account-option { border: 0; border-radius: 0; }
.activity-account-card details { border-top: 1px solid var(--line); }
.activity-account-card summary {
  padding: 9px 12px;
  color: #45617f;
  background: #f7f9fc;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}
.activity-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}
.activity-profile-grid > label {
  margin: 0;
  color: #50627a;
  font-size: 10px;
}
.activity-profile-grid input,
.activity-profile-grid select,
.activity-profile-grid textarea {
  min-height: 36px;
  margin-top: 5px;
  padding: 7px 9px;
  font-size: 12px;
}
.activity-profile-grid textarea { min-height: 62px; }
.profile-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.profile-persona { grid-column: 1 / -1; }
.profile-picker { max-height: 580px; }

@media (max-width: 700px) {
  .activity-profile-grid { grid-template-columns: 1fr 1fr; }
  .channel-candidate { align-items: flex-start; }
}

* { scrollbar-color: #c3cfdd transparent; }
html { scroll-padding-top: 88px; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
}
body::before,
body::after { display: none; }
::selection { color: #fff; background: rgba(23, 105, 255, .78); }

body.authenticated { padding-top: 72px; }
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  width: 100%;
  height: 72px;
  margin: 0;
  padding: 0 30px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}
.brand { min-width: 214px; gap: 12px; }
.brand h1 { color: #10213d; font-size: 18px; font-weight: 790; letter-spacing: -.035em; }
.brand p { margin-top: 2px; color: #8a97ab; font-size: 11px; }
.logo {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(63, 103, 160, .09);
}
.brand-logo-image { width: 100%; height: 100%; object-fit: cover; }
.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 42vw);
  min-height: 42px;
  margin: 0 auto;
  padding: 0 13px;
  border: 1px solid #e0e7f0;
  border-radius: 13px;
  color: #7d8aa0;
  background: #f7f9fc;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.global-search:focus-within {
  border-color: #8fb7ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, .09);
}
.global-search .icon { flex: 0 0 auto; width: 18px; height: 18px; }
.global-search input {
  min-height: 38px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}
.global-search input:focus { border: 0; box-shadow: none; }
.global-search kbd {
  padding: 2px 6px;
  border: 1px solid #dfe6ef;
  border-radius: 7px;
  color: #93a0b4;
  background: #fff;
  font: 600 10px/1.4 inherit;
  white-space: nowrap;
}
.statusline { min-width: 214px; justify-content: flex-end; color: var(--muted); }
.dot { width: 8px; height: 8px; background: var(--amber); box-shadow: 0 0 0 4px rgba(217, 139, 23, .11); }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(22, 165, 106, .1); }
.top-help { color: #53647c; }

@media (min-width: 821px) {
  .menu-toggle,
  .nav-mobile-head,
  .nav-scrim { display: none !important; }
  .tabs {
    position: fixed;
    inset: 72px auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: 80px;
    height: auto;
    margin: 0;
    padding: 18px 10px;
    gap: 8px;
    overflow: visible;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, .94);
    box-shadow: none;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .tabs .tab {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    min-height: 48px;
    padding: 0;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #60718a;
    background: transparent;
    box-shadow: none;
  }
  .tabs .tab:hover { color: var(--blue); background: #f1f5fa; }
  .tabs .tab[aria-selected="true"] {
    color: var(--blue);
    border-color: #dce8ff;
    background: #edf4ff;
    box-shadow: none;
  }
  .tabs .tab .icon { width: 20px; height: 20px; }
  .tabs .tab span {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    z-index: 50;
    width: max-content;
    max-width: 210px;
    padding: 8px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 9px;
    color: #243750;
    background: #fff;
    box-shadow: var(--shadow-float);
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity .15s ease, transform .15s ease;
  }
  .tabs .tab:hover span,
  .tabs .tab:focus-visible span { opacity: 1; transform: translate(0, -50%); }
  main {
    width: calc(100% - 80px);
    max-width: none;
    min-height: calc(100vh - 72px);
    margin: 0 0 0 80px;
    padding: 36px clamp(28px, 2.8vw, 64px) 64px;
  }
}

@media (min-width: 1180px) {
  .btn { flex: 0 0 auto; white-space: nowrap; }
  .tablewrap table { width: max(100%, max-content); }
  .tablewrap td .actions {
    flex-wrap: nowrap;
    align-items: center;
  }
  #proxies .tablewrap table { min-width: 980px; }
  #accounts .tablewrap table { min-width: 1380px; }
  #jobs .tablewrap table { min-width: 1180px; }
}

@media (min-width: 1560px) {
  #proxies > .grid,
  #activity > .activity-layout {
    grid-template-columns: minmax(480px, 4fr) minmax(760px, 8fr);
  }
  #proxies > .grid > .s5,
  #proxies > .grid > .s7,
  #activity > .activity-layout > .s5,
  #activity > .activity-layout > .s7 {
    grid-column: auto;
  }
}

.panel { animation: softLedgerIn .25s ease-out; }
@keyframes softLedgerIn { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.head { align-items: center; margin-bottom: 24px; }
.head > div { max-width: 900px; }
.kicker { margin-bottom: 8px; color: #4f7fcf; font-size: 11px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.head h2 { color: #10213d; font-size: clamp(34px, 3.3vw, 50px); line-height: 1.04; letter-spacing: -.052em; font-weight: 780; }
.lead { max-width: 820px; margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.grid { gap: 18px; }
.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.card::before { display: none; }
.cardhead { margin-bottom: 18px; }
.card h3 { color: #172941; font-size: 17px; font-weight: 740; letter-spacing: -.025em; }
.sub { color: var(--muted); font-size: 13px; }
.metric {
  min-height: 116px;
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.metric::after { display: none; }
.metric label,
.metric small { color: var(--muted); }
.metric strong { color: #132641; }

label { color: #41516a; font-size: 12px; font-weight: 680; }
input,
select,
textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dce4ef;
  border-radius: 11px;
  color: #152842;
  background: #fbfcfe;
  box-shadow: none;
}
input::placeholder,
textarea::placeholder { color: #9aa7b9; }
input:hover,
select:hover,
textarea:hover { border-color: #c5d2e3; }
input:focus,
select:focus,
textarea:focus { border-color: #79a8ff; background: #fff; box-shadow: 0 0 0 4px rgba(23, 105, 255, .085); }
input[type="checkbox"] { accent-color: var(--blue); }

.btn {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--blue);
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  box-shadow: none;
  font-weight: 720;
}
.btn:hover { filter: none; border-color: var(--blue-strong); background: var(--blue-strong); box-shadow: 0 8px 20px rgba(23, 105, 255, .14); }
.btn.green { border-color: var(--blue); background: var(--blue); box-shadow: none; }
.btn.green:hover { border-color: var(--blue-strong); background: var(--blue-strong); }
.btn.soft {
  color: #3c4d65;
  border-color: #d9e2ed;
  background: #fff;
  box-shadow: none;
}
.btn.soft:hover { color: #132641; border-color: #becbda; background: #f6f8fb; box-shadow: none; }
.btn.danger { color: #c73e58; border-color: #f0ccd3; background: #fff5f7; }
.btn.danger:hover { color: #ad3049; border-color: #e9aeb9; background: #fff0f3; box-shadow: none; }
.btn.small { min-height: 36px; border-radius: 10px; font-size: 12px; }
.icon-btn { color: #52637b; border-color: #dce4ee; background: #fff; }
.icon-btn:hover { color: var(--blue); background: #f4f7fb; }

.notice {
  color: #31557e;
  border-color: #cfe0f6;
  border-radius: 13px;
  background: #f4f8fe;
}
.notice.ok { color: #176d4d; border-color: #c6eadb; background: #f1fbf6; }
.notice.warn { color: #80591a; border-color: #efdfbc; background: #fffaf0; }
.hint,
.muted { color: var(--muted); }
a.link,
.text-btn { color: var(--blue); }

.drop {
  border-color: #a9c8ff;
  border-radius: 16px;
  background: #f7faff;
}
.drop.drag { border-color: var(--blue); background: #edf4ff; }
.uploadicon { color: var(--blue); background: #eaf2ff; }
.filerow { border-color: var(--line); background: #f8fafc; }

.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { color: #273951; font-size: 13px; }
th,
td { padding: 13px 14px; border-bottom: 1px solid #e7ecf3; }
th { color: #697a92; background: #f8fafc; font-size: 10px; font-weight: 760; letter-spacing: .055em; }
tbody tr:hover { background: #f8fbff; }
.badge { color: #5d6d84; background: #f0f3f7; }
.badge.active,
.badge.completed,
.badge.running { color: #12764e; background: #e9f8f1; }
.badge.failed,
.badge.error,
.badge.unauthorized { color: #c73e58; background: #fff0f3; }
.badge.waiting,
.badge.paused,
.badge.limited { color: #996315; background: #fff6e5; }
.badge.created,
.badge.uploading_avatar,
.badge.avatar_set,
.badge.creating_channel,
.badge.channel_created,
.badge.channel_public,
.badge.post_published { color: #245fc1; background: #edf4ff; }
.premium-pill,
.premium-pill.active {
  border-color: #ded4ff;
  color: #6e43d6;
  background: #f2efff;
}
.premium-buy {
  border-color: #ded4ff;
  color: #6e43d6;
  background: #f7f4ff;
  box-shadow: none;
}
.premium-buy:hover { border-color: #c9baff; color: #5930c6; background: #efeaff; }
.empty { color: var(--muted); }
.empty strong { color: #263951; }
.progress { background: #e8edf4; }
.progress i { background: var(--blue); }

.account-summary-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.account-summary-strip > span { min-width: 0; padding: 16px 20px; border-right: 1px solid #e8edf4; }
.account-summary-strip > span:last-child { border-right: 0; }
.account-summary-strip small,
.account-summary-strip b { display: block; }
.account-summary-strip small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-strip b { margin-top: 7px; color: #172b49; font-size: 24px; letter-spacing: -.035em; }
.account-summary-strip > span:nth-child(2) b,
.account-summary-strip > span:nth-child(6) b { color: var(--green); }
.account-summary-strip > span:nth-child(4) b { color: #7551d7; }
.account-summary-strip > span:nth-child(7) b { color: #c73e58; }
.account-head-actions { flex-wrap: nowrap; }
.account-trash-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #c73e58;
  background: #fff0f3;
  font-size: 11px;
  font-weight: 800;
}
#account-view-toggle.active { color: #1769ff; border-color: #a9c7ff; background: #eef5ff; }
.archive-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 5px 12px;
  min-width: 190px;
  color: var(--muted);
  font-size: 11px;
}
.archive-stat-grid span { display: flex; justify-content: space-between; gap: 10px; }
.archive-stat-grid b { color: #203652; }
.account-manager { padding: 0; overflow: hidden; }
.account-manager .tablewrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.account-manager table { min-width: 1120px; }
.filter-hidden { display: none !important; }
.account-manager tbody tr { cursor: default; transition: background .16s ease, box-shadow .16s ease; }
.account-manager tbody tr.account-row-selected { background: #f0f6ff; box-shadow: inset 3px 0 0 var(--blue); }
.account-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px 170px auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
}
.account-toolbar select { min-height: 42px; }
.account-filter-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #dce4ef;
  border-radius: 11px;
  color: #7a899f;
  background: #fbfcfe;
}
.account-filter-search .icon { flex: 0 0 auto; width: 17px; height: 17px; }
.account-filter-search input { min-height: 38px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.account-filter-search:focus-within { border-color: #79a8ff; box-shadow: 0 0 0 4px rgba(23, 105, 255, .085); }
.account-filter-search input:focus { border: 0; box-shadow: none; }
.account-identity { gap: 11px; }
.account-avatar { border: 1px solid #dbe5f0; background: #edf4ff; color: var(--blue); box-shadow: none; }
.account-name { color: #1f324d; }
.account-handle { color: #7b8ba2; }
.account-premium { color: #7254c7; }
.account-error { color: #c73e58; }
.account-tenure { color: #6f8097; }
.limit-summary { border-color: #dfe6ef; background: #f8fafc; }
.limit-summary:hover { border-color: #afc7ec; background: #f2f7ff; }

.steps,
.flow,
.setting-list,
.source-box,
.schedule-card,
.activity-action,
.account-option,
.choice,
.profile-workspace-switch,
.invite-builder,
.dialogs-workspace,
.dialog-sidebar,
.dialog-thread { color: var(--text); }
.step,
.flowitem,
.setting-list,
.source-box,
.schedule-card,
.activity-action,
.account-option,
.choice,
.profile-workspace-switch,
.dialog-sidebar,
.dialog-thread {
  border-color: var(--line);
  background: #fbfcfe;
}
.step b,
.flowitem b { background: var(--blue); }
.step h4,
.flowitem strong,
.account-copy b,
.activity-action span b { color: #243750; }
.step p,
.flowitem p,
.account-copy small,
.activity-action span small { color: var(--muted); }
.account-option:has(input:checked),
.activity-action:has(input[type="checkbox"]:checked) { border-color: #9fc1ff; background: #f1f6ff; }
.choice.selected { color: #143e83; border-color: #8db5ff; background: #edf4ff; box-shadow: none; }
.choice.selected p { color: #4a6692; }
.choice .radio { border-color: #9aa9bd; }
.choice.selected .radio { border-color: var(--blue); }
.choice.selected .radio::after { background: var(--blue); }
.wizardsteps span { color: var(--muted); background: #f2f5f9; }
.wizardsteps span:first-child { color: #245fc1; background: #edf4ff; }
.invite-steps { border-color: var(--line); background: #f8fafc; }
.invite-steps button { color: #63748b; border-color: transparent; background: transparent; }
.invite-steps button[aria-selected="true"] { color: #1c4f9f; border-color: #b8d1ff; background: #edf4ff; }
.invite-steps button:hover { color: #294a75; background: #f1f5fa; }
.invite-steps button > span { color: #62758e; border-color: #ced9e6; background: #fff; }
.invite-steps button[aria-selected="true"] > span { color: #fff; border-color: var(--blue); background: var(--blue); }
.invite-pane,
.invite-footer { border-color: var(--line); background: #fff; }
.invite-footer { box-shadow: 0 -10px 30px rgba(66, 91, 126, .06); }
.invite-law strong { color: #755016; }
.invite-law span { color: #8e6a2e; }
.source-icon { color: var(--blue); background: #edf4ff; }
.setting-row,
.inline-setting,
.nested-setting { border-color: #e2e8f0; background: #fff; }
.setting-row:hover { border-color: #b9cce5; background: #f8fbff; }
.setting-row b,
.inline-setting b { color: #263951; }
.setting-row small,
.inline-setting small { color: var(--muted); }
.weekday-picker span { color: #64758d; border-color: #dce4ed; background: #fff; }
.weekday-picker input:checked + span { color: #174f9f; border-color: #9fc1ff; background: #edf4ff; }

.profile-workspace-switch button { color: #60718a; background: transparent; }
.profile-workspace-switch button[aria-selected="true"] { color: #174f9f; background: #edf4ff; }
.dialog-list-item { color: #283b56; border-color: #e5ebf2; background: transparent; }
.dialog-list-item:hover,
.dialog-list-item.active { background: #f0f6ff; }
.dialog-message.in { color: #283b56; background: #f1f4f8; }
.dialog-message.out { color: #fff; background: var(--blue); }
.dialog-composer { border-color: var(--line); background: #fff; }
.dialog-avatar { color: #245fc1; background: #eaf2ff; }
.dialog-unread { color: #fff; background: var(--blue); }
.dialog-controls,
.dialog-thread-head,
.dialog-composer,
.dialog-privacy { border-color: var(--line); background: #fff; }
.dialog-thread-head h3,
.dialog-list-title b { color: #253850; }
.dialog-thread-head p,
.dialog-preview,
.dialog-list-meta,
.dialog-privacy { color: var(--muted); }
.dialog-kind,
.dialog-message-sender,
.dialog-media-label { color: #2d6ecf; }
.dialog-preview.out::before { color: var(--green); }
.dialog-messages { background: #f5f8fc; }
.dialog-message { color: #283b56; border-color: #dde5ef; background: #fff; box-shadow: 0 5px 16px rgba(57, 77, 104, .06); }
.dialog-message.out { color: #fff; border-color: var(--blue); background: var(--blue); }
.dialog-message-meta { color: #8290a3; }
.dialog-message.out .dialog-message-meta { color: rgba(255, 255, 255, .72); }

.activity-draft { color: #49617f; }
.activity-scope { color: var(--muted); }
.premium-buy { color: #6f50be !important; border-color: #ded5f5 !important; background: #f8f5ff !important; }
.premium-buy:hover { color: #5d3fa8 !important; border-color: #cbbced !important; background: #f4efff !important; }

dialog {
  color: var(--text);
  border-color: #d8e1ec;
  background: #fff;
  box-shadow: 0 30px 90px rgba(35, 54, 81, .22);
}
dialog::backdrop { background: rgba(32, 46, 66, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.close { color: #6d7e94; }
.close:hover { background: #f1f4f8; }
pre { color: #dce8fa; border-color: #203753; background: #0e1c30; }
.toast { color: #263951; border-color: #d5dfeb; background: #fff; box-shadow: var(--shadow-float); }
.toast.bad { color: #b73750; border-color: #efc4cd; background: #fff5f7; }
.operation-log,
.operation-log-loading { border-color: #dfe6ef; background: #f8fafc; color: #314761; }
.operation-log-error { border-color: #f0ccd3; background: #fff5f7; color: #b73750; }
.account-event { border-color: #e1e8f0; background: #fbfcfe; }
.account-event-head b { color: #335d92; }
.account-event-head time { color: #8997aa; }
.account-event p { color: #314761; }
.account-event.error { border-color: #efccd3; background: #fff6f8; }

.auth-screen { color: var(--text); background: #f7f9fc; }
.auth-shell {
  border-color: #dfe6ef;
  background: #fff;
  box-shadow: 0 28px 80px rgba(44, 65, 92, .14);
}
.auth-intro,
.auth-card { border-color: var(--line); background: #fff; box-shadow: var(--shadow-card); }
.auth-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.auth-intro h1,
.auth-card strong { color: #132641; }
.auth-intro p,
.auth-note,
.auth-card small { color: var(--muted); }
.auth-orb { border-color: #dfe7f1; background: #fff; box-shadow: var(--shadow-soft); }
.auth-points span { color: #3d5777; border-color: #dfe7f1; background: #f7f9fc; }
.auth-switch { border-color: #e1e8f0; background: #f3f6fa; }
.auth-switch button { color: #6f8097; }
.auth-switch button[aria-selected="true"] { color: #174f9f; background: #fff; box-shadow: 0 3px 12px rgba(63, 83, 110, .08); }

@media (max-width: 1100px) and (min-width: 821px) {
  .global-search { width: min(360px, 34vw); }
  .statusline #connection { display: none; }
  .account-summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-summary-strip > span:nth-child(3) { border-right: 0; }
  .account-summary-strip > span:nth-child(-n + 3) { border-bottom: 1px solid #e8edf4; }
}

@media (max-width: 820px) {
  body.authenticated { padding-top: 64px; }
  .top {
    height: 64px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .97);
  }
  .top .brand { min-width: 0; gap: 9px; }
  .top .brand p,
  .global-search,
  .top-help,
  .statusline #connection { display: none; }
  .top .brand h1 { font-size: 16px; }
  .top .logo { width: 38px; height: 38px; }
  .statusline { min-width: 0; margin-left: auto; gap: 9px; }
  .statusline .dot { margin-right: 2px; }
  #logout-btn { width: 42px; min-height: 42px; padding: 0; }
  #logout-btn span { display: none; }
  .menu-toggle { display: grid; width: 42px; height: 42px; }
  .tabs {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(304px, 86vw);
    height: 100dvh;
    margin: 0;
    padding: 14px;
    gap: 5px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0 20px 20px 0;
    background: #fff;
    box-shadow: var(--shadow-float);
  }
  .tabs .nav-mobile-head { margin-bottom: 10px; padding: 0 0 13px; border-bottom: 1px solid var(--line); }
  .tabs .tab {
    width: 100%;
    min-height: 44px;
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 9px 12px;
    border-radius: 11px;
    color: #5f718a;
    background: transparent;
  }
  .tabs .tab:hover { color: var(--blue); background: #f4f7fb; }
  .tabs .tab[aria-selected="true"] { color: var(--blue); border-color: #dce8ff; background: #edf4ff; box-shadow: none; }
  .tabs .tab span { display: inline; }
  .nav-scrim { z-index: 65; background: rgba(31, 45, 65, .36); }
  main { width: 100%; margin: 0; padding: 24px 14px 48px; }
  .panel > .head { padding: 0; margin: 0 0 18px; }
  .head { align-items: flex-start; gap: 16px; }
  .head h2 { font-size: clamp(30px, 10vw, 40px); }
  .lead { margin-top: 7px; font-size: 13px; }
  .head > .btn,
  .head > .actions { align-self: stretch; width: 100%; }
  .head > .btn { justify-content: center; }
  .grid { gap: 12px; }
  .card { padding: 16px; border-radius: 16px; }
  .account-summary-strip {
    display: flex;
    margin: 0 -14px 14px;
    padding: 0 14px 3px;
    gap: 9px;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: none;
  }
  .account-summary-strip::-webkit-scrollbar { display: none; }
  .account-summary-strip > span {
    flex: 0 0 132px;
    padding: 12px 13px;
    border: 1px solid var(--line) !important;
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  .account-summary-strip small { font-size: 10px; }
  .account-summary-strip b { margin-top: 5px; font-size: 21px; }
  .account-manager { padding: 0; }
  #accounts > .account-manager {
    padding-inline: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  #jobs > article.card,
  #stories > article.card,
  #audience-parse > article.card,
  #proxies > .grid > article.card,
  #audiences > .grid > article.card,
  #profile .profile-pane > .grid > article.card,
  #dialogs .dialogs-sidebar,
  #dialogs .dialog-thread-card {
    border-color: var(--line);
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  .account-toolbar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .account-filter-search { grid-column: 1 / -1; }
  .account-toolbar .btn { grid-column: 1 / -1; width: 100%; }
  .account-manager .tablewrap { border-top: 1px solid var(--line); }
  .account-manager table { min-width: 0; }
  tbody tr {
    border-color: var(--line);
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  tbody tr:hover { background: #fff; }
  tbody td,
  tbody tr:last-child td {
    border-color: #edf1f5 !important;
    background: transparent;
  }
  tbody td::before { color: #8795a8; }
  tbody td[data-label="Причина"],
  tbody td[data-label="Ошибка"] { background: transparent; }
  #accounts tbody td,
  #accounts tbody tr:last-child td,
  #jobs tbody td,
  #jobs tbody tr:last-child td { border-top-color: #edf1f5 !important; }
  #accounts .account-actions .btn,
  #jobs tbody td .actions > .btn { min-height: 40px; color: #354960; border-color: #d8e1ec; background: #fff; }
  #accounts .account-actions .btn:hover,
  #jobs tbody td .actions > .btn:hover { color: var(--blue); background: #f3f7fe; }
  #accounts .limit-summary { background: transparent; }
  .invite-law { margin-inline: 0; }
  #invite > .invite-builder {
    padding-inline: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }
  .invite-steps {
    top: 64px;
    margin-inline: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 8px 22px rgba(66, 91, 126, .08);
  }
  .invite-footer {
    margin-inline: -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-radius: 0;
    background: rgba(255, 255, 255, .97);
  }
  .profile-workspace-switch { width: 100%; margin-inline: 0; }
  .dialogs-workspace { margin-inline: 0; }
  dialog { color: var(--text); border-color: #dbe3ed; background: #fff; }
  .dialog { background: #fff; }
}

@media (max-width: 480px) {
  main { padding-inline: 12px; }
  .panel > .head { padding-inline: 0; }
  .head h2 { font-size: 32px; line-height: 1.07; }
  .card { padding: 14px; }
  .account-summary-strip { margin-inline: -12px; padding-inline: 12px; }
  .account-toolbar { grid-template-columns: 1fr; }
  .account-filter-search,
  .account-toolbar .btn { grid-column: auto; }
  #proxies > .grid > article:first-child > .row:not(:first-child),
  #stories > article.card .row,
  #profile .profile-pane .row,
  #audience-parse > article.card .row,
  .schedule-card .row,
  #invite-connect-options.row { grid-template-columns: 1fr; }
  .invite-steps button { min-width: 132px; }
  .invite-footer { margin-inline: -14px; padding-inline: 14px; }
}

.bulk-profile-card { padding: 0; overflow: hidden; }
.bulk-profile-head { padding: 22px 24px 18px; }
.bulk-profile-head .actions { flex-wrap: wrap; justify-content: flex-end; }
.bulk-profile-guide {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 10px;
  padding: 0 24px 18px;
  color: var(--muted);
  font-size: 12px;
}
.bulk-profile-guide span { display: flex; align-items: center; gap: 7px; }
.bulk-profile-guide span::before {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #eaf2ff;
  font-weight: 800;
  content: counter(profile-step);
  counter-increment: profile-step;
}
.bulk-profile-guide { counter-reset: profile-step; }
.bulk-profile-list { border-block: 1px solid var(--line); }
.bulk-profile-row {
  display: grid;
  grid-template-columns: 54px minmax(190px, 1.25fr) repeat(3, minmax(145px, 1fr)) minmax(190px, 1.15fr) 112px;
  gap: 12px;
  align-items: end;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background .18s ease, box-shadow .18s ease;
}
.bulk-profile-row:last-child { border-bottom: 0; }
.bulk-profile-row.changed { background: #f8fbff; }
.bulk-profile-row.running { box-shadow: inset 3px 0 0 #2789ff; }
.bulk-profile-row.completed { box-shadow: inset 3px 0 0 #22b875; }
.bulk-profile-row.failed { box-shadow: inset 3px 0 0 #e25568; }
.bulk-profile-select {
  display: grid;
  align-self: center;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}
.bulk-profile-select input { width: 18px; height: 18px; }
.bulk-profile-account { display: flex; min-width: 0; align-self: center; align-items: center; gap: 10px; }
.bulk-profile-account .account-avatar { flex: 0 0 auto; }
.bulk-profile-account div { min-width: 0; }
.bulk-profile-account b,
.bulk-profile-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-profile-account small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.bulk-profile-field { display: grid; min-width: 0; gap: 6px; }
.bulk-profile-field > span,
.bulk-profile-clear > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .02em; }
.bulk-profile-field input { min-width: 0; height: 42px; }
.bulk-profile-avatar input[type="file"] { padding: 7px; font-size: 11px; }
.bulk-profile-avatar input[type="file"]::file-selector-button {
  margin-right: 7px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  color: #31506f;
  background: #edf3fa;
  font-weight: 700;
}
.bulk-profile-clear { display: flex; min-height: 42px; align-items: center; gap: 7px; }
.bulk-profile-clear input { width: 17px; height: 17px; }
.bulk-profile-status {
  grid-column: 2 / -1;
  display: none;
  color: var(--muted);
  font-size: 11px;
}
.bulk-profile-row.running .bulk-profile-status,
.bulk-profile-row.completed .bulk-profile-status,
.bulk-profile-row.failed .bulk-profile-status,
.bulk-profile-row.skipped .bulk-profile-status { display: flex; align-items: center; gap: 6px; }
.bulk-profile-row.completed .bulk-profile-status { color: #168558; }
.bulk-profile-row.failed .bulk-profile-status { color: #c73f55; }
.bulk-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px 22px;
  background: #fbfcfe;
}
.bulk-profile-footer b,
.bulk-profile-footer small { display: block; }
.bulk-profile-footer small { margin-top: 4px; color: var(--muted); }
.bulk-profile-footer .btn { min-width: 260px; }

@media (max-width: 1180px) {
  .bulk-profile-row { grid-template-columns: 44px minmax(180px, 1.2fr) repeat(2, minmax(140px, 1fr)); }
  .bulk-profile-row > .bulk-profile-field:nth-child(5) { grid-column: 2; }
  .bulk-profile-row > .bulk-profile-avatar:nth-child(6) { grid-column: 3; }
  .bulk-profile-row > .bulk-profile-clear:nth-child(7) { grid-column: 4; }
  .bulk-profile-status { grid-column: 2 / -1; }
}

@media (max-width: 700px) {
  .account-head-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .account-head-actions .btn { width: 100%; min-width: 0; }
  .archive-stat-grid { min-width: 0; }
  .bulk-profile-head { display: block; padding: 18px 16px 14px; }
  .bulk-profile-head .actions { display: grid; width: 100%; margin-top: 14px; grid-template-columns: 1fr 1fr; }
  .bulk-profile-head .actions .btn:first-child { grid-column: 1 / -1; }
  .bulk-profile-guide { display: none; }
  .bulk-profile-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px 10px;
    padding: 16px;
  }
  .bulk-profile-select { grid-row: 1; grid-column: 1; }
  .bulk-profile-account { grid-row: 1; grid-column: 2; }
  .bulk-profile-row > .bulk-profile-field:nth-child(3),
  .bulk-profile-row > .bulk-profile-field:nth-child(4),
  .bulk-profile-row > .bulk-profile-field:nth-child(5),
  .bulk-profile-row > .bulk-profile-avatar:nth-child(6) { grid-column: 2; }
  .bulk-profile-row > .bulk-profile-clear:nth-child(7) { grid-column: 2; min-height: auto; }
  .bulk-profile-status { grid-column: 2; }
  .bulk-profile-footer { position: sticky; bottom: 0; z-index: 3; align-items: stretch; flex-direction: column; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .bulk-profile-footer .btn { width: 100%; min-width: 0; }
}
