/* MAX Accounts — монохромное чёрное стекло (по референсам) */
:root {
  --bg: #050506;
  --glass: rgba(20, 20, 22, .62);
  --glass-strong: rgba(30, 30, 33, .72);
  --glass-input: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .09);
  --line-hi: rgba(255, 255, 255, .22);
  /* градиентная обводка «стекло с бликом по верхней кромке» */
  --edge: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .06) 40%, rgba(255, 255, 255, .02));
  --fg: #f2f2f4;
  --dim: rgba(235, 235, 245, .62);
  --dim2: rgba(235, 235, 245, .32);
  --ok: #8ee6a8;
  --bad: #ff7a70;
  --radius: 20px;
  --blur: saturate(140%) blur(26px);
  --shadow: 0 24px 70px rgba(0, 0, 0, .72), 0 2px 10px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 50% -20%, #131316 0%, transparent 60%),
    var(--bg);
  color: var(--fg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}

/* ---------- стекло: общая заготовка ---------- */
.glass, header, .panel, .col, .cards li, .modal-box, #toast {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* тонкая градиентная обводка поверх прозрачной */
.glass::before, header::before, .panel::before, .col::before,
.cards li::before, .modal-box::before, #toast::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

header {
  position: sticky; top: 14px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 14px 16px 0; padding: 12px 22px;
}
header h1 {
  font-size: 19px; font-weight: 700; margin: 0 22px 0 0; letter-spacing: .02em;
  background: linear-gradient(180deg, #ffffff 20%, rgba(255, 255, 255, .55));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
nav { display: flex; gap: 6px; flex-wrap: wrap; }

main { max-width: 1060px; margin: 0 auto; padding: 26px 16px 64px; }
h2 { margin: 2px 0 8px; font-weight: 700; font-size: 25px; letter-spacing: -.01em; }
h3 { margin: 12px 0; font-weight: 600; font-size: 16px; }
.hint { color: var(--dim); font-size: 13px; }
.hidden { display: none !important; }

/* ---------- контролы ---------- */
textarea, input, select {
  width: 100%;
  background: var(--glass-input);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus {
  border-color: var(--line-hi);
  background: rgba(255, 255, 255, .07);
}
input::placeholder, textarea::placeholder { color: var(--dim2); }
input[type="file"] { padding: 8px; color: var(--dim); }
select option { background: #131316; color: var(--fg); }

button {
  position: relative;
  background: rgba(255, 255, 255, .07);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px; /* pill */
  cursor: pointer;
  font: inherit; font-size: 14px;
  transition: transform .12s, border-color .2s, background .2s;
}
button:hover { border-color: var(--line-hi); background: rgba(255, 255, 255, .12); }
button:active { transform: scale(.97); }
nav button {
  background: transparent; border: 1px solid transparent;
  color: var(--dim); border-radius: 999px; padding: 8px 15px;
}
nav button:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
nav button.active {
  color: var(--fg);
  background: rgba(255, 255, 255, .09);
  border-color: var(--line);
}
/* акцентная кнопка — светлое стекло (не синее) */
button.primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .76));
  border-color: transparent; color: #0a0a0c;
  font-weight: 650;
  box-shadow: 0 10px 30px rgba(255, 255, 255, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
}
button.primary:hover { background: linear-gradient(180deg, #fff, rgba(255, 255, 255, .85)); }
button.ghost { background: transparent; }
button.danger { background: transparent; border-color: rgba(255, 122, 112, .45); color: var(--bad); }
button.danger:hover { background: rgba(255, 122, 112, .1); border-color: var(--bad); }
button:disabled { opacity: .35; cursor: default; transform: none; }

.row { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
label { color: var(--dim); font-size: 13px; display: flex; gap: 6px; align-items: center; }
label select { width: auto; }

.file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px;
  font-size: 14px; color: var(--fg); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.file-btn:hover { border-color: var(--line-hi); background: rgba(255, 255, 255, .12); }

/* ---------- блоки вывода ---------- */
.out {
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  white-space: pre-wrap; word-break: break-all;
  max-height: 340px; overflow-y: auto;
  font: 13px/1.5 ui-monospace, "SF Mono", Consolas, monospace;
  color: rgba(242, 242, 244, .85);
  margin: 12px 0;
}
.out.small { max-height: 200px; }

.panel { padding: 20px 22px; margin: 18px 0; }
.progress { margin: 16px 0; }
.bar {
  height: 8px; border-radius: 4px; overflow: hidden;
  background: rgba(255, 255, 255, .07);
}
.bar > div {
  height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .45), #fff);
  transition: width .5s;
}
#check-counters, #bulk-counters { color: var(--dim); font-size: 13px; margin: 8px 0; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.col { padding: 18px; }
.col button { margin-top: 10px; }
.col h3 { margin-top: 0; }

.qr {
  display: block; margin: 14px auto 8px; max-width: 240px;
  background: #fff; padding: 10px; border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ---------- карточки аккаунтов ---------- */
.cards {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.cards li { position: relative; padding: 14px 16px; cursor: pointer; transition: transform .15s, background .2s; }
.cards li:hover { transform: translateY(-2px); background: var(--glass-strong); }
.cards li.selected { border-color: var(--line-hi); background: var(--glass-strong); }
.cards .phone { font-weight: 650; font-size: 17px; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.cards .meta { color: var(--dim2); font-size: 12px; margin-top: 5px; }
.cards .card-check {
  position: absolute; top: 10px; right: 10px; width: 18px; height: 18px;
  accent-color: #fff; cursor: pointer;
}
.cards .badge {
  display: inline-block; font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  margin-top: 7px; margin-right: 4px;
}
.cards .acc-ava {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--line); flex: none;
}
.acc-info {
  display: flex; gap: 14px; align-items: center;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
.acc-info img.acc-ava-lg { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.acc-info .rows { font-size: 13px; color: var(--dim); line-height: 1.7; }
.acc-info .rows b { color: var(--fg); }

/* ---------- модалка ---------- */
.modal {
  position: fixed; inset: 0; z-index: 10; padding: 16px;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  padding: 24px 26px;
  width: 100%; max-width: 660px; max-height: 90vh; overflow-y: auto;
  background: rgba(18, 18, 20, .8);
}

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  border-radius: 999px; padding: 11px 22px; z-index: 20; max-width: 90vw;
  font-size: 14px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  animation: rise .25s ease-out;
}
#toast.err { border-color: rgba(255, 122, 112, .5); }
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- таблица результатов чекера ---------- */
#sort-entries-box summary {
  cursor: pointer; color: var(--dim); margin: 10px 0;
  user-select: none;
}
#sort-entries-box summary:hover { color: var(--fg); }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
#sort-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: rgba(0, 0, 0, .35);
}
#sort-table th, #sort-table td {
  padding: 9px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
#sort-table th { color: var(--dim); font-weight: 500; font-size: 12px; }
#sort-table tr:last-child td { border-bottom: none; }
#sort-table td .mini {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; margin-right: 5px;
}
.tfa-ok { color: var(--ok); }
.tfa-bad { color: var(--bad); }

/* ---------- список прокси ---------- */
.plain-list {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; gap: 8px;
}
.plain-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 14px;
  font: 13px ui-monospace, "SF Mono", Consolas, monospace;
  word-break: break-all;
}
.plain-list li button { padding: 5px 12px; font-size: 12px; }
.age-ok { color: var(--ok); }
.age-bad { color: var(--bad); }

/* ---------- SVG-значки вместо эмодзи ---------- */
.ic {
  display: inline-block;
  width: 1.05em; height: 1.05em;
  vertical-align: -0.18em;
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
  flex: none;
}
.ic-repeat  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='17 1 21 5 17 9'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpolyline points='7 23 3 19 7 15'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.ic-shield  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.ic-user    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.ic-key     { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4'/%3E%3C/svg%3E"); }
.ic-sliders { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E"); }
.ic-down    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E"); }
.ic-up      { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E"); }
.ic-trash   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E"); }
.ic-plus    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E"); }
.ic-x       { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E"); }
.ic-check   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.ic-alert   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E"); }
.ic-clock   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.ic-zap     { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E"); }
.ic-logout  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); }
.ic-qr      { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Cline x1='14' y1='14' x2='14' y2='21'/%3E%3Cline x1='21' y1='14' x2='21' y2='21'/%3E%3Cline x1='14' y1='18' x2='21' y2='18'/%3E%3C/svg%3E"); }
.ic-lock    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.ic-link    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.ic-file    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E"); }
.ic-phone   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2'/%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'/%3E%3C/svg%3E"); }
.ic-msg     { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.ic-copy    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E"); }
.ic-ext     { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E"); }
.ic-send    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'/%3E%3C/svg%3E"); }
.ic-globe   { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E"); }
.ic-play    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='5 3 19 12 5 21 5 3'/%3E%3C/svg%3E"); }
.ic-stop    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3C/svg%3E"); }
.ic-folder  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.ic-rocket  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z'/%3E%3Cpath d='M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0'/%3E%3Cpath d='M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E"); }

/* ---------- ключ-гейт и админка ---------- */
.gate-box { max-width: 420px; padding: 30px 28px; }
#key-gate { z-index: 50; background: rgba(0, 0, 0, .75); }
.stats-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.stat-card {
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
}
.stat-card .num { font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.stat-card .lbl { color: var(--dim); font-size: 12px; margin-top: 3px; }
.stat-card .sub { color: var(--dim2); font-size: 11px; margin-top: 4px; }
.embed-box { max-width: 1200px; padding: 16px; }
.embed-frame {
  width: 100%; height: 72vh; border: 1px solid var(--line);
  border-radius: 14px; background: #fff;
}

/* аккуратный скроллбар */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .13); border-radius: 5px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }


/* ==================== МЕССЕНДЖЕР (чёрное матовое стекло) ==================== */
.ic-search { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
.ic-pause  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cline x1='9' y1='5' x2='9' y2='19'/%3E%3Cline x1='15' y1='5' x2='15' y2='19'/%3E%3C/svg%3E"); }
.ic-mic    { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3C/svg%3E"); }
.ic-reply  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 17 4 12 9 7'/%3E%3Cpath d='M20 18v-2a4 4 0 0 0-4-4H4'/%3E%3C/svg%3E"); }

.mx-noscroll { overflow: hidden; }
.mx-app {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
  background:
    radial-gradient(1000px 500px at 75% -10%, rgba(255, 255, 255, .045), transparent 60%),
    radial-gradient(800px 500px at 10% 110%, rgba(255, 255, 255, .03), transparent 55%),
    #030304;
  animation: mxFadeIn .18s ease;
}
@keyframes mxFadeIn { from { opacity: 0; transform: scale(1.012); } to { opacity: 1; } }

/* стеклянная заготовка для панелей мессенджера */
.mx-glass { position: relative; }
.mx-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.mx-topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 10, .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.mx-topbar-title { font-weight: 800; font-size: 15px; letter-spacing: .3px;
  display: flex; gap: 8px; align-items: center; }

.mx-body { flex: 1; display: flex; min-height: 0; }

/* --- левая колонка --- */
.mx-side {
  width: 340px; min-width: 270px; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(6, 6, 8, .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.mx-account { margin: 12px 12px 0; }
.mx-search { display: flex; align-items: center; gap: 8px; margin: 10px 12px;
  padding: 9px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  color: var(--dim); }
.mx-search input { flex: 1; background: none; border: none; color: inherit;
  outline: none; font: inherit; padding: 0; }
.mx-chats { flex: 1; overflow-y: auto; margin: 0; padding: 4px 8px 12px; list-style: none; }

.mx-chat { display: flex; gap: 11px; align-items: center; padding: 9px 10px;
  border-radius: 16px; cursor: pointer; transition: background .12s, border-color .15s;
  border: 1px solid transparent; }
.mx-chat:hover { background: rgba(255, 255, 255, .045); }
.mx-chat.active {
  background: rgba(255, 255, 255, .085);
  border-color: rgba(255, 255, 255, .13);
}
.mx-ava-wrap { position: relative; width: 48px; height: 48px; flex: none; }
.mx-ava { width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center; }
.mx-ava-letter { color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.mx-ava-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mx-chat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mx-chat-row { display: flex; align-items: center; gap: 8px; }
.mx-chat-title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.mx-chat-time { font-size: 11px; color: var(--dim2); flex: none; }
.mx-chat-last { color: var(--dim); font-size: 13px; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-unread { background: #fff; color: #050506; border-radius: 11px; font-size: 11px;
  font-weight: 700; padding: 1px 7px; min-width: 15px; text-align: center; flex: none; }

.mx-settings { display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); }
.mx-settings label { display: flex; gap: 8px; align-items: center;
  font-size: 13px; cursor: pointer; }

/* --- правая часть --- */
.mx-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mx-header { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 10, .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.mx-header-col { display: flex; flex-direction: column; min-width: 0; }
#mx-header-text { font-weight: 700; font-size: 15px; }
#mx-header-ava .mx-ava { width: 40px; height: 40px; font-size: 15px; }

.mx-messages { flex: 1; overflow-y: auto; padding: 18px 7%;
  display: flex; flex-direction: column; gap: 2px; }
.mx-empty { margin: auto; text-align: center; color: var(--dim2);
  font-size: 14px; line-height: 2.2; }
.mx-empty .ic { width: 42px; height: 42px; opacity: .3; }

.mx-day { align-self: center; margin: 16px 0 10px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--dim); font-size: 12px; border-radius: 999px; padding: 4px 14px; }

.mx-svc { align-self: center; margin: 6px 0; max-width: 86%;
  background: rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 999px; padding: 4px 14px; font-size: 12.5px;
  color: var(--dim); text-align: center; }

.mx-msg {
  max-width: min(66%, 520px); border-radius: 18px; padding: 8px 12px 6px;
  font-size: 14px; align-self: flex-start;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .075);
  -webkit-backdrop-filter: blur(18px) saturate(130%); backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
  margin-top: 10px; animation: mxMsgIn .14s ease;
}
@keyframes mxMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.mx-msg.grouped { margin-top: 3px; }
.mx-msg.out {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .10));
  border-color: rgba(255, 255, 255, .17);
}
.mx-msg.bare { background: none; border: none; box-shadow: none; padding: 2px;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.mx-msg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.mx-msg-ava { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.mx-msg-sender { font-size: 12px; font-weight: 700; color: #cfd3dc; }
.mx-msg-text { white-space: pre-wrap; word-break: break-word; line-height: 1.38; }
.mx-msg-time { font-size: 10px; opacity: .5; text-align: right; margin-top: 3px;
  display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.mx-msg.out .mx-msg-time::after { content: ""; width: 11px; height: 11px;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  background: currentColor; opacity: .8; }

/* reply-цитата внутри пузыря */
.mx-reply { display: flex; gap: 8px; align-items: center; margin: 2px 0 6px;
  padding: 4px 8px; border-left: 2px solid rgba(255, 255, 255, .45);
  border-radius: 6px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.mx-reply-text { font-size: 12.5px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }

/* фото/видео/стикеры */
.mx-att-photo { border-radius: 14px; overflow: hidden; margin: 2px 0 4px; }
.mx-att-img { max-width: 100%; max-height: 320px; border-radius: 14px;
  display: block; margin-bottom: 4px; cursor: pointer; }
.mx-att-video { background: #000; }
.mx-att-sticker { max-width: 180px; max-height: 180px; display: block; }

/* голосовое: плеер с волной */
.mx-voice { display: flex; align-items: center; gap: 10px; padding: 6px 2px;
  min-width: 210px; }
.mx-voice-play {
  width: 38px; height: 38px; min-width: 38px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; cursor: pointer; transition: background .15s, transform .1s;
}
.mx-voice-play:hover { background: rgba(255, 255, 255, .24); }
.mx-voice-play:active { transform: scale(.94); }
.mx-voice.playing .mx-voice-play { background: #fff; color: #050506; }
.mx-wave { display: flex; align-items: center; gap: 2px; height: 26px;
  flex: 1; cursor: pointer; min-width: 120px; }
.mx-wave i { flex: 1; max-width: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .32); transition: background .15s; }
.mx-wave i.on { background: #fff; }
.mx-voice-dur { font-size: 11.5px; opacity: .6; flex: none; }
.mx-voice.dead { opacity: .55; }

/* файлы, контакты, ссылки */
.mx-att-filecard {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 4px;
  padding: 9px 12px; border-radius: 12px; text-decoration: none;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .09);
  color: var(--fg); transition: background .15s, border-color .15s;
}
.mx-att-filecard:hover { background: rgba(0, 0, 0, .45); border-color: rgba(255, 255, 255, .2); }
.mx-att-filecard .ic { width: 22px; height: 22px; opacity: .8; }
.mx-att-fname { font-size: 13.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.mx-att-filecard em { font-style: normal; font-size: 11.5px; color: var(--dim2); flex: none; }
.mx-att-card {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 4px;
  padding: 8px 12px; border-radius: 12px; font-size: 13.5px;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .09);
}
.mx-att-share { flex-direction: column; align-items: flex-start; gap: 3px;
  text-decoration: none; color: var(--fg); }
.mx-att-share b { font-size: 13.5px; }
.mx-att-share span { font-size: 12px; color: var(--dim); }
.mx-att-share em { font-style: normal; font-size: 12px; color: var(--dim2); }
.mx-call-line { font-size: 12.5px; color: var(--dim); display: flex;
  align-items: center; gap: 6px; margin-top: 4px; }

/* --- композер --- */
.mx-preview { display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  border-top: 1px solid var(--line); background: rgba(8, 8, 10, .55); }
.mx-preview img { width: 46px; height: 46px; object-fit: cover;
  border-radius: 10px; background: #16161a; }
.mx-preview img[src=""] { display: none; }
.mx-preview-name { flex: 1; font-size: 13px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* бар ответа над композером */
#mx-reply { border-top: 1px solid var(--line); padding: 8px 16px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(8, 8, 10, .55); }
#mx-reply .mx-reply-bar { width: 2.5px; align-self: stretch; border-radius: 2px;
  background: rgba(255, 255, 255, .5); }
#mx-reply .mx-reply-text { flex: 1; font-size: 13px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-reply-x { padding: 6px 10px; }

.mx-input { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(8, 8, 10, .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.mx-attach { width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--dim);
  transition: background .12s, color .12s; }
.mx-attach:hover { background: rgba(255, 255, 255, .09); color: var(--fg); }
#mx-mic.rec { color: #ff7a70; background: rgba(255, 122, 112, .12);
  border-color: rgba(255, 122, 112, .4); animation: mxPulse 1.4s infinite; }
@keyframes mxPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 112, .35); }
  50% { box-shadow: 0 0 0 8px rgba(255, 122, 112, 0); }
}
.mx-input textarea { flex: 1; resize: none; max-height: 140px; border-radius: 999px;
  padding: 10px 16px; line-height: 1.35; }
.mx-send-btn { width: 42px; height: 42px; min-width: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0; }

/* --- контекстное меню --- */
.mx-menu { position: fixed; z-index: 200; display: flex; flex-direction: column;
  min-width: 200px; padding: 6px; border-radius: 16px;
  background: rgba(22, 22, 25, .78);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: var(--shadow); }
.mx-menu button { background: none; border: none; border-radius: 10px;
  text-align: left; padding: 9px 12px; display: flex; gap: 9px; align-items: center;
  font-size: 13.5px; color: var(--fg); }
.mx-menu button:hover { background: rgba(255, 255, 255, .08); }
.mx-menu button.danger { color: var(--bad); }

/* --- лайтбокс --- */
.mx-lightbox { position: fixed; inset: 0; z-index: 210; cursor: zoom-out;
  background: rgba(0, 0, 0, .88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 30px; }
.mx-lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .8); }

/* тонкие скроллбары */
.mx-chats::-webkit-scrollbar, .mx-messages::-webkit-scrollbar { width: 8px; }
.mx-chats::-webkit-scrollbar-thumb, .mx-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .09); border-radius: 4px; }
.mx-chats::-webkit-scrollbar-thumb:hover, .mx-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .16); }

/* сегментированный переключатель (вход по коду) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; }
.seg label { padding: 7px 16px; cursor: pointer; display: flex; gap: 7px;
  align-items: center; font-size: 13px; color: var(--dim);
  user-select: none; transition: background .12s; }
.seg label + label { border-left: 1px solid var(--line); }
.seg label:hover { color: #fff; }
.seg label.on { background: rgba(255, 255, 255, .13); color: #fff; }
.seg input { display: none; }

.ic-img { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E"); }

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */
@media (max-width: 720px) {
  /* шапка: компактная, вкладки — горизонтальная лента со свайпом */
  header { position: sticky; top: 0; margin: 0; padding: 10px 12px;
    border-radius: 0 0 16px 16px; gap: 8px; padding-bottom: 0; z-index: 30; }
  header h1 { font-size: 17px; margin: 0 6px 0 0; }
  header > span { display: none; }
  nav { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 6px -12px 0; padding: 0 12px 10px;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent); }
  nav::-webkit-scrollbar { display: none; }
  nav button { flex: none; white-space: nowrap; padding: 9px 13px;
    font-size: 13px; min-height: 40px; }
  #logout-btn { padding: 9px; }

  main { padding: 14px 10px calc(90px + env(safe-area-inset-bottom, 0px)); }
  h2 { font-size: 20px; }
  .panel { padding: 14px 12px; margin: 12px 0; border-radius: 16px; }
  .row { margin: 10px 0; gap: 8px; }

  /* ВСЕ поля ввода — 16px (нет автозуму iOS) и полной ширины в формах */
  textarea, input, select { font-size: 16px; }

  /* КНОПКИ: ровная сетка 2-в-ряд по всей ширине (панели и модалки) */
  .panel .row, .modal-box .row, #acc-forms .row { display: grid;
    grid-template-columns: 1fr 1fr; gap: 8px; }
  .panel .row > *, .modal-box .row > *, #acc-forms .row > * {
    width: 100%; min-width: 0; margin: 0; }
  /* строка с одним полем ввода + кнопкой — столбиком */
  .panel .row:has(input:not([type="checkbox"]):not([type="file"])) {
    grid-template-columns: 1fr; }
  .row input[type="checkbox"] { width: auto; justify-self: start; }
  .row input[type="file"] { grid-column: 1 / -1; }
  /* одиночный элемент строки — на всю ширину */
  .row > *:only-child, .row > label:only-child { grid-column: 1 / -1; }
  .row > span:only-child { grid-column: 1 / -1; }

  button { min-height: 44px; border-radius: 12px; }

  /* карточки-аккаунты и таблицы компактнее */
  .cards { gap: 10px; }
  .cards .phone { font-size: 15px; }
  .table-wrap { font-size: 12.5px; border-radius: 12px;
    -webkit-overflow-scrolling: touch; }
  .table-wrap th, .table-wrap td { padding: 8px 8px; }
  /* таблицы не сжимаем в кашу — ячейки в одну строку, скролл по горизонтали */
  #keys-table, #admin-accounts-table { white-space: nowrap; }
  /* заголовки секций в строках — на всю ширину, поля под ними */
  .row h3 { grid-column: 1 / -1; }
  .row input[style*="width"] { width: 100% !important; }

  /* модалки — почти на весь экран, шапка липкая */
  .modal-box { width: calc(100vw - 16px); max-width: 100%;
    max-height: calc(100dvh - 16px); padding: 0 0 14px; }
  .modal-box > h3, .modal-box > .row:first-child { position: sticky;
    top: 0; background: inherit; padding: 14px 14px 8px; z-index: 2;
    backdrop-filter: blur(10px); }
  .modal-box > *:not(h3):not(.row:first-child) { padding-left: 14px;
    padding-right: 14px; }

  /* шрифт статусов/вывода чуть крупнее */
  .out { font-size: 13px; }
  .hint { font-size: 12.5px; }
}

/* очень узкие экраны */
@media (max-width: 400px) {
  nav button { padding: 8px 10px; font-size: 12.5px; }
  .panel { padding: 12px 10px; }
  .panel .row, .modal-box .row, #acc-forms .row { gap: 6px; }
}
