/* ═══════════════ RESET ═══════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f1115;
  --bg-2:       #141821;
  --card:       #1a1f2a;
  --border:     #2a3240;
  --border-2:   #384256;
  --text:       #e6e9ef;
  --muted:      #8b95a5;
  --muted-2:    #5a6478;
  --accent:     #5b8def;
  --accent-2:   #8a5bef;
  --danger:     #ef5566;
  --success:    #5cd67a;
  --warn:       #f0a93b;
  --radius:     12px;
  --radius-sm:  8px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.readonly {
  background: linear-gradient(180deg, #1a1410 0%, var(--bg) 40%);
}

a { color: var(--accent); text-decoration: none; transition: .15s; }
a:hover { color: #7ea3f5; }

/* ═══════════════ LAYOUT ═══════════════ */
#app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ═══════════════ BANNER ═══════════════ */
.banner {
  background: linear-gradient(90deg, #ef5566, #f0a93b);
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
}
.banner button {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  margin-left: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.banner button:hover { background: rgba(255,255,255,.3); }

/* ═══════════════ HEADINGS ═══════════════ */
h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 8px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}
h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: 20px 0 10px;
}

/* ═══════════════ CARD ═══════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ═══════════════ INPUTS (новая структура) ═══════════════ */
input, button, select, textarea { font: inherit; color: inherit; }

/* Обёртка — фон, рамка, скругление */
.input-wrap {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 56px;
  margin-bottom: 20px;
  transition: border-color .15s;
  overflow: hidden;
}
.input-wrap:focus-within {
  border-color: var(--accent);
}

/* Сам input — прозрачный, без рамки */
.input-wrap input,
.input-wrap textarea,
.input-wrap select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0 22px;
  margin: 0;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 54px;
  box-shadow: none !important;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  -webkit-text-fill-color: var(--text);
  transition: none;
}

/* Убиваем стили Chrome autofill полностью — фон всё равно прозрачный */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap input:-webkit-autofill:active,
.input-wrap input:-internal-autofill-selected,
.input-wrap input:-internal-autofill-previewed {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  background-color: var(--bg-2) !important;
  background: var(--bg-2) !important;
  -webkit-text-fill-color: var(--text) !important;
  color: var(--text) !important;
  caret-color: var(--text) !important;
  border: 0 !important;
  transition: background-color 9999s ease-in-out 0s !important;
}

.input-wrap input::placeholder { color: var(--muted-2); }
.input-wrap input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Группа: label + input */
.input-group {
  margin-bottom: 0;
}
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Старые input вне обёртки — оставляем поддержку */
input[type="text"]:not(.input-wrap input),
input[type="password"]:not(.input-wrap input),
input[type="email"]:not(.input-wrap input),
input[type="number"]:not(.input-wrap input) {
  width: 100%;
  height: 56px;
  padding: 0 22px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ═══════════════ BUTTONS ═══════════════ */
button {
  cursor: pointer;
  padding: 0 26px;
  height: 58px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  transition: .15s;
  box-shadow: 0 1px 3px rgba(91,141,239,.3);
}
button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(91,141,239,.4);
}
button:disabled { opacity: .5; cursor: not-allowed; }

button.secondary {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  box-shadow: none;
}
button.secondary:hover:not(:disabled) {
  background: var(--border);
  filter: none;
  transform: none;
  box-shadow: none;
  border-color: var(--accent);
}

button.danger {
  background: linear-gradient(135deg, #e54658, #c43545);
  box-shadow: 0 1px 3px rgba(229,70,88,.3);
}
button.danger:hover:not(:disabled) {
  box-shadow: 0 3px 8px rgba(229,70,88,.4);
}

/* ═══════════════ ROW / TABS ═══════════════ */
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.row > * { flex: 1; }
.row .shrink { flex: 0 0 auto; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tabs button {
  background: none;
  color: var(--muted);
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 18px;
  font-weight: 500;
  box-shadow: none;
}
.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tabs button:hover:not(.active) {
  background: transparent;
  color: var(--text);
  transform: none;
  box-shadow: none;
  filter: none;
}

/* ═══════════════ SERVICE ITEM ═══════════════ */
.service {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: .15s;
}
.service:hover {
  border-color: var(--border-2);
  background: #171b26;
}
.service .icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}
.service .info { flex: 1; min-width: 0; }
.service .id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}
.service .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.service.disabled {
  opacity: .55;
  border-style: dashed;
  border-color: var(--border-2);
}
.service.disabled .id { text-decoration: line-through; }

/* ═══════════════ TAG ═══════════════ */
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.tag.admin { background: var(--accent); color: #fff; margin-left: 8px; }
.tag.frozen { background: var(--danger); color: #fff; margin-left: 8px; }
.tag.disabled { background: var(--muted-2); color: #fff; }

/* ═══════════════ TABLE ═══════════════ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
tr:hover td { background: rgba(91,141,239,.05); }
.frozen-row { opacity: .55; }

/* ═══════════════ MESSAGES ═══════════════ */
.error, .success {
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
}
.error:not(:empty) { display: block; background: rgba(239,85,102,.1); color: #ff7c8a; border: 1px solid rgba(239,85,102,.2); }
.success:not(:empty) { display: block; background: rgba(92,214,122,.1); color: #6ee090; border: 1px solid rgba(92,214,122,.2); }

/* ═══════════════ QUICK ACCESS GRID ═══════════════ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: .15s;
}
.quick-card:hover {
  border-color: var(--accent);
  background: #171b26;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.quick-card .qicon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.quick-card .qtitle {
  font-weight: 600;
  font-size: 14px;
}
.quick-card .qdesc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ═══════════════ UTILS ═══════════════ */
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ═══ Star button — фиксированный размер, только цвет меняется ═══ */
.star-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #4a5262 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: color .15s, background .15s;
  box-shadow: none !important;
  font-weight: normal !important;
}
.star-btn:hover:not(:disabled) {
  color: #f0a93b !important;
  background: rgba(240,169,59,.1) !important;
}
.star-btn.star-on {
  color: #f0a93b !important;
  cursor: default;
}
.star-btn.star-on:hover {
  background: transparent !important;
}
.star-btn:disabled {
  opacity: 1 !important;
}

/* ═══════════════ LOGIN / REGISTER PAGE ═══════════════ */
.login-page {
  max-width: 440px;
  margin: 40px auto 0;
  padding: 0 20px;
}

.login-page .logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 280px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(91,141,239,.25));
}

.login-page h1 {
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 28px;
  letter-spacing: .2px;
}

.login-page .card {
  padding: 28px 26px 24px;
}

/* Поля формы с ритмом */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-fields label {
  margin-top: 14px;
  margin-bottom: 6px;
}
.form-fields label:first-child {
  margin-top: 0;
}
.form-fields input {
  margin-bottom: 0;
}

/* ─── Фикс autofill Chrome ─── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--text);
}
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset,
                      0 0 0 3px rgba(91,141,239,.15) !important;
}

/* ═══ Логотип и карточка на странице входа/регистрации ═══ */
.auth-logo {
  display: block;
  margin: 48px auto 28px;
  max-width: 220px;
  height: auto;
}

.auth-card {
  max-width: 660px;
  margin: 0 auto;
  padding: 36px 32px 32px;
  border-radius: 16px;
}

.auth-card label {
  font-size: 13.5px;
  margin-bottom: 10px;
  margin-top: 0;
}
.auth-card label:first-of-type {
  margin-top: 0;
}

.auth-card button {
  width: 100%;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}

.auth-card input {
  font-size: 16px;
}

/* ─── Поля в одну строку ─── */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.form-row .form-col {
  flex: 1;
  min-width: 0;
}
.form-row .input-wrap {
  margin-bottom: 0;
}

/* ═══════════════ DASHBOARD ═══════════════ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.dash-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: .15s;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .5;
}
.dash-card.accent-blue::before   { background: #5b8def; }
.dash-card.accent-green::before  { background: #5cd67a; }
.dash-card.accent-purple::before { background: #8a5bef; }
.dash-card.accent-orange::before { background: #f0a93b; }

.dash-card:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.dash-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}
.dash-body { min-width: 0; }
.dash-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 500;
}
.dash-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-top: 4px;
}
.dash-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* ─── График ─── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  margin-top: 4px;
}
.chart-bar {
  flex: 1;
  min-width: 4px;
  border-radius: 3px 3px 0 0;
  opacity: .85;
  transition: .15s;
  cursor: help;
}
.chart-bar:hover {
  opacity: 1;
}

/* ═══════════════ WELCOME ═══════════════ */
.welcome-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 28px;
}
.welcome-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
}
.welcome-row.password-row {
  border-color: rgba(240,169,59,.4);
  background: rgba(240,169,59,.05);
}
.welcome-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.welcome-info { flex: 1; min-width: 0; }
.welcome-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.welcome-jid {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-all;
}
.welcome-pass {
  font-size: 16px;
  font-weight: 600;
  color: #f0a93b;
  margin: 4px 0;
  letter-spacing: .5px;
  word-break: break-all;
}
.welcome-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.welcome-status { margin-top: 4px; }
.tag.pending {
  background: rgba(240,169,59,.15);
  color: #f0a93b;
  border: 1px solid rgba(240,169,59,.3);
}
.tag.active {
  background: rgba(92,214,122,.15);
  color: #5cd67a;
  border: 1px solid rgba(92,214,122,.3);
}
.welcome-warning {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239,85,102,.1);
  border: 1px solid rgba(239,85,102,.25);
  border-radius: 10px;
  color: #ff8a99;
  font-size: 13px;
  line-height: 1.5;
}

/* ═══════════════ QUOTA WIDGET ═══════════════ */
.quota-widget {
  margin-top: 6px;
  max-width: 320px;
}
.quota-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.quota-bar-fill {
  height: 100%;
  transition: width .3s, background .3s;
  border-radius: 2px;
}
.quota-text {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.quota-text b {
  color: var(--text);
  font-weight: 600;
}

/* ═══ Поле пароля с глазиком ═══ */
/* ═══ Модалка пароля ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.modal-password {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  color: #f0a93b;
  letter-spacing: .5px;
  word-break: break-all;
  text-align: center;
  font-weight: 600;
}

/* ═══ Credentials ═══ */
.cred-row { flex-wrap: wrap; }
.cred-row .info { flex: 1 1 300px; min-width: 0; }
.cred-pwd {
  display: inline-block;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 6px;
  color: #f0a93b;
  font-weight: 600;
  letter-spacing: .5px;
  font-size: 14px;
  word-break: break-all;
}
.cred-pwd.hidden { display: none; }

/* ═══════════════ AUTH-CARD: все поля на всю ширину ═══════════════ */
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"],
.auth-card input[type="number"] {
  width: 100% !important;
  height: 52px !important;
  padding: 0 16px !important;
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  color: var(--text) !important;
  font-size: 15px !important;
  box-sizing: border-box !important;
  margin-bottom: 0 !important;
  display: block;
}

.auth-card input[type="password"] {
  padding-right: 44px !important;
}

.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 16px;
  margin-bottom: 8px;
}

.auth-card label:first-of-type {
  margin-top: 0;
}

/* Обёртка пароля — на всю ширину */

/* ═══════════════════════════════════════════════════════════
   ГЛАЗИК В ПОЛЕ ПАРОЛЯ — финальная версия
   ═══════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════
   ГЛАЗИК — финальная версия
   ═══════════════════════════════════════════════════════════════ */
.password-wrap {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}
.password-wrap input {
  padding-right: 52px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.eye-icon {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 36px !important;
  height: 36px !important;
  transform: translateY(-50%) !important;
  -webkit-transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  line-height: 36px !important;
  cursor: pointer !important;
  z-index: 100 !important;
  opacity: .6 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px !important;
  user-select: none !important;
  filter: grayscale(1) brightness(1.4) !important;
  transition: opacity .15s, background .15s, filter .15s !important;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
}
.eye-icon:hover {
  opacity: 1 !important;
  background: rgba(255,255,255,.06) !important;
}
.eye-icon.eye-on {
  opacity: 1 !important;
  filter: grayscale(0) sepia(1) saturate(5) hue-rotate(-10deg) brightness(1.3) !important;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE-FRIENDLY — добавлено поверх, не трогает десктоп
   ═══════════════════════════════════════════════════════════════ */

/* ─── Планшеты и меньше (до 900px) ─── */
@media (max-width: 900px) {
  .quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* ─── Мобилки (до 640px) ─── */
@media (max-width: 640px) {

  /* ─── Шапка — компактнее ─── */
  .header, header {
    padding: 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header h1, header h1 {
    font-size: 20px !important;
  }

  /* ─── Карточка сервиса — в столбик ─── */
  .service {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .service .icon {
    font-size: 22px;
    align-self: flex-start;
  }
  .service .info {
    width: 100%;
    min-width: 0;
  }
  .service .id {
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.35;
  }
  .service .meta {
    font-size: 11px;
  }

  /* ─── Кнопки в карточке — в ряд, на всю ширину ─── */
  .service > button,
  .service > .star-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    font-size: 13px;
  }
  .service > .star-btn {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    align-self: flex-start;
  }

  /* ─── Вкладки — горизонтальный скролл ─── */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button {
    padding: 10px 14px !important;
    white-space: nowrap;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* ─── Quick cards — на всю ширину ─── */
  .quick-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .quick-card {
    padding: 12px;
    gap: 10px;
  }
  .quick-card .qicon { font-size: 24px; }
  .quick-card .qtitle { font-size: 14px; }
  .quick-card .qdesc  { font-size: 11px; }

  /* ─── Модалки — снизу, на всю ширину ─── */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-box {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 16px !important;
    max-height: 92vh !important;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0,0,0,.5) !important;
  }
  .modal-box h3 { font-size: 16px !important; }

  /* ─── Формы ─── */
  input, textarea, select {
    font-size: 16px !important; /* iOS не зумит на focus при 16px+ */
  }

  /* ─── Основной контейнер — меньше паддингов ─── */
  #app, .app {
    padding: 12px !important;
  }
  .card {
    padding: 14px !important;
    border-radius: 10px !important;
  }
  .card h2 {
    font-size: 16px !important;
  }

  /* ─── Таблицы — скролл ─── */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }
  table th, table td {
    padding: 8px 10px !important;
  }

  /* ─── Кнопки в шапке — компактнее ─── */
  .header button,
  header button {
    padding: 8px 12px !important;
    font-size: 12px;
    min-height: 40px;
  }
}

/* ─── Очень узкие (до 380px) ─── */
@media (max-width: 380px) {
  .header h1, header h1 { font-size: 18px !important; }
  .tabs button { padding: 8px 10px !important; font-size: 12px; }
  .service .id { font-size: 12px; }
  .card { padding: 10px !important; }
}

/* ─── Скрытие элементов на мобилке/десктопе ─── */
.hide-mobile { display: initial; }
.hide-desktop { display: none; }
@media (max-width: 640px) {
  .hide-mobile  { display: none !important; }
  .hide-desktop { display: initial !important; }
}
