/* ============================================================
   ABillS — Modern Client Cabinet theme
   Standalone override loaded after client.css.
   No Perl interpolation here (static file).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --mc-bg: #eef2f7;
  --mc-surface: #ffffff;
  --mc-surface-2: #f8fafc;
  --mc-text: #0f172a;
  --mc-muted: #64748b;
  --mc-border: #e6e9f0;
  --mc-primary: #6366f1;
  --mc-primary-2: #8b5cf6;
  --mc-accent: #06b6d4;
  --mc-ok: #10b981;
  --mc-warn: #f59e0b;
  --mc-danger: #f43f5e;
  --mc-radius: 20px;
  --mc-radius-sm: 14px;
  --mc-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
  --mc-shadow-sm: 0 4px 14px -6px rgba(15, 23, 42, 0.18);
  --mc-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 120%);
}

/* ---------- Resets over legacy client.css ---------- */
html {
  min-width: 0 !important;
}
body {
  margin: 0 !important;
  padding: 0 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
  font-size: 15px;
  line-height: 1.55;
  color: var(--mc-text);
  background: var(--mc-bg);
  background-image:
    radial-gradient(900px 500px at 100% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(800px 500px at -10% 0%, rgba(6, 182, 212, 0.16), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.page_wrap,
.inner_wrap {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  background: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

a {
  color: var(--mc-primary);
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}
a:hover { color: var(--mc-primary-2); }

/* ---------- App bar (form_client_start) ---------- */
.mc-appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.mc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: clamp(16px, 2.5vw, 20px);
  letter-spacing: -0.02em;
  color: var(--mc-text);
}
.mc-brand-title {
  font-weight: 800;
  font-size: inherit;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}
.mc-brand-dash {
  color: var(--mc-muted);
  font-weight: 600;
  margin: 0 0.15em;
}
.mc-brand-accent {
  color: var(--mc-primary);
  font-weight: 800;
  letter-spacing: 0.01em;
}
.mc-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--mc-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--mc-shadow-sm);
}
.mc-brand small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mc-muted);
}
.mc-appbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mc-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px clamp(14px, 4vw, 36px) 60px;
  text-align: left;
}

/* ---------- Next-fee notice banner ---------- */
.mc-notice {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
  row-gap: 6px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(6, 182, 212, 0.10));
  border: 1px solid var(--mc-border);
  color: var(--mc-text);
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--mc-shadow-sm);
}
.mc-notice::before {
  content: '\1F4C5';
  font-size: 20px;
  line-height: 1;
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  margin-top: 2px;
}
.mc-notice-main {
  grid-column: 2;
  line-height: 1.45;
}
.mc-notice-sub {
  grid-column: 2;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mc-muted);
  line-height: 1.5;
}
.mc-notice-sub strong {
  color: var(--mc-text);
  font-weight: 800;
  font-size: 15px;
}
.mc-notice-detail {
  font-size: 12px;
  font-weight: 500;
  color: var(--mc-muted);
}
.mc-notice-ok {
  color: #047857 !important;
  font-weight: 600 !important;
}
.mc-notice.is-warn {
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(244, 63, 94, 0.40);
  color: #be123c;
}
.mc-notice.is-warn::before { content: '\26A0'; }

/* Active expected payment — soft amber notice instead of red alert */
.mc-notice.is-credit-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(251, 191, 36, 0.10));
  border-color: rgba(245, 158, 11, 0.42);
  color: #92400e;
  font-weight: 600;
}
.mc-notice.is-credit-active::before { content: '\23F3'; }
.mc-notice.is-credit-active .mc-notice-main b {
  color: #b45309;
  font-weight: 800;
}

/* Neg-deposit banner: action buttons side by side */
.mc-notice.mc-neg-deposit {
  grid-template-columns: 28px 1fr;
  row-gap: 12px;
}
.mc-notice.mc-neg-deposit .mc-notice-main {
  grid-column: 2;
  grid-row: 1;
}
.mc-notice.mc-neg-deposit .mc-neg-deposit-actions {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  align-items: stretch;
}
.mc-notice.mc-neg-deposit .mc-neg-deposit-actions .link_button,
.mc-notice.mc-neg-deposit .mc-neg-deposit-actions .mc-btn {
  flex: 1 1 200px;
  width: auto !important;
  max-width: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 !important;
  padding: 11px 16px !important;
  line-height: 1.3 !important;
  white-space: normal;
}
.mc-notice.mc-neg-deposit .mc-neg-deposit-actions .mc-btn--solid {
  background: var(--mc-grad) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: var(--mc-shadow-sm) !important;
}
.mc-notice.mc-neg-deposit .mc-neg-deposit-actions .mc-btn--ghost {
  background: #fff !important;
  color: var(--mc-primary) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  box-shadow: var(--mc-shadow-sm) !important;
}
@media (min-width: 640px) {
  .mc-notice.mc-neg-deposit .mc-neg-deposit-actions .link_button,
  .mc-notice.mc-neg-deposit .mc-neg-deposit-actions .mc-btn {
    flex: 1 1 0;
  }
}

/* ---------- Top info chips (form_client_main) ---------- */
.mc-topinfo {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.mc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--mc-muted);
  box-shadow: var(--mc-shadow-sm);
}
.mc-chip b { color: var(--mc-text); font-weight: 600; }
.mc-chip .mc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mc-ok);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}
.mc-chip.is-off .mc-dot { background: var(--mc-danger); box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.16); }

/* ---------- App layout: sidebar + content ---------- */
.mc-shell { width: 100%; }
.mc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.mc-sidebar { position: sticky; top: 84px; }
.mc-body { min-width: 0; }
.mc-menu-summary { display: none; }

/* ---------- Navigation menu (vertical sidebar) ----------
   The legacy menu renders as #kabinet-menu > li.inner_menu-item > a.link_button.
   We override the legacy green (#006600 / #007700) theme here. */
.mc-nav {
  display: block;
  padding: 8px;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 18px;
  box-shadow: var(--mc-shadow-sm);
  overflow: hidden;
}
.mc-nav .menu_top,
.mc-nav .menu_bot { display: none !important; }

/* Neutralize the legacy left-column/list chrome */
.mc-nav #kabinet-left_col,
.mc-nav .inner-left_col {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.mc-nav #kabinet-menu,
.mc-nav .inner_menu {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  list-style: none !important;
  background: none !important;
}

/* List items */
.mc-nav #kabinet-menu .inner_menu-item,
.mc-nav #kabinet-menu .inner_sub_menu-item,
.mc-nav .inner_menu-item,
.mc-nav .inner_sub_menu-item,
.mc-nav li {
  list-style: none !important;
  margin: 2px 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 11px !important;
  background: none !important;
  overflow: hidden;
}

/* Links (kill radiobutton icon + legacy borders) */
.mc-nav #kabinet-menu .inner_menu-item a,
.mc-nav #kabinet-menu .inner_sub_menu-item a,
.mc-nav .inner_menu-item a,
.mc-nav .inner_sub_menu-item a,
.mc-nav li > a {
  display: block !important;
  padding: 11px 14px !important;
  margin: 0 !important;
  border: 1px solid transparent !important;
  border-top: none !important;
  border-radius: 11px !important;
  background: none !important;
  background-image: none !important;
  color: var(--mc-text) !important;
  font: 600 14px 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
  text-decoration: none !important;
  transition: background .12s ease, color .12s ease;
}
.mc-nav #kabinet-menu .inner_menu-item:first-child a { border: 1px solid transparent !important; }

/* Hover — soft neutral (NOT green) */
.mc-nav #kabinet-menu .inner_menu-item:hover,
.mc-nav #kabinet-menu .inner_menu-item.hovered,
.mc-nav #kabinet-menu .inner_sub_menu-item:hover,
.mc-nav #kabinet-menu .inner_sub_menu-item.hovered,
.mc-nav .inner_menu-item:hover,
.mc-nav .inner_sub_menu-item:hover {
  background: var(--mc-surface-2) !important;
}
.mc-nav #kabinet-menu .inner_menu-item:hover a,
.mc-nav #kabinet-menu .inner_sub_menu-item:hover a,
.mc-nav .inner_menu-item:hover a {
  background: var(--mc-surface-2) !important;
  background-image: none !important;
  color: var(--mc-primary) !important;
  border-top: none !important;
}

/* Active — brand gradient (NOT green) */
.mc-nav #kabinet-menu .inner_menu-item.active,
.mc-nav #kabinet-menu .inner_sub_menu-item.active,
.mc-nav .inner_menu-item.active,
.mc-nav .inner_sub_menu-item.active {
  background: var(--mc-grad) !important;
}
.mc-nav #kabinet-menu .inner_menu-item.active a,
.mc-nav #kabinet-menu .inner_sub_menu-item.active a,
.mc-nav .inner_menu-item.active a {
  background: transparent !important;
  background-image: none !important;
  color: #fff !important;
  border-top: none !important;
}

/* The button() link inside menu is a .link_button — strip its legacy green */
.mc-nav .link_button,
.mc-nav a.link_button {
  display: block !important;
  background: none !important;
  background-image: none !important;
  color: inherit !important;
  box-shadow: none !important;
  border: none !important;
}
.mc-nav .inner_menu-item.active .link_button,
.mc-nav .inner_menu-item.active a.link_button { color: #fff !important; }
.mc-nav .link_button:hover { background: none !important; background-image: none !important; }

/* ---------- Dashboard grid + cards ---------- */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.mc-card {
  grid-column: span 4;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 22px;
  box-shadow: var(--mc-shadow-sm);
}
.mc-card.span-6 { grid-column: span 6; }
.mc-card.span-8 { grid-column: span 8; }
.mc-card.span-12 { grid-column: span 12; }

.mc-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mc-muted);
  margin-bottom: 12px;
}
.mc-card-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mc-text);
}
.mc-card-sub { margin-top: 6px; font-size: 13px; color: var(--mc-muted); }

/* Hero balance */
.mc-hero {
  grid-column: span 5;
  position: relative;
  overflow: hidden;
  background: var(--mc-grad);
  color: #fff;
  border: none;
  border-radius: var(--mc-radius);
  padding: 26px;
  box-shadow: var(--mc-shadow);
}
.mc-hero::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}
.mc-hero-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.92;
}
.mc-hero-balance {
  margin: 10px 0 4px;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.mc-hero-balance .cur { font-size: 20px; font-weight: 700; opacity: 0.9; margin-left: 6px; }
.mc-hero-sub { font-size: 13.5px; opacity: 0.92; }
.mc-hero-sub:empty { display: none; }
.mc-hero-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.mc-side { grid-column: span 7; display: grid; grid-template-columns: 1fr; gap: 18px; }
.mc-side .mc-card { grid-column: auto; }
.mc-user-status {
  font-weight: 600;
}
.mc-user-status font,
.mc-user-status span { font-weight: inherit; }

/* Badges */
.mc-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.mc-badge--ok { background: rgba(16, 185, 129, 0.12); color: #047857; }
.mc-badge--off { background: rgba(244, 63, 94, 0.12); color: #be123c; }
.mc-badge .mc-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Buttons (force-override legacy input[type=submit] / .link_button styles) */
.mc-btn,
.mc-login input[type='submit'],
.mc-login button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  width: auto;
  height: auto !important;
  min-height: 0 !important;
  padding: 13px 20px !important;
  line-height: 1.25 !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  border: 1px solid transparent !important;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.mc-btn:hover,
.mc-login input[type='submit']:hover { transform: translateY(-1px); opacity: 0.96; }
.mc-btn--primary { background: #fff !important; color: #4f46e5 !important; box-shadow: var(--mc-shadow-sm); }
.mc-btn--ghost { background: rgba(255, 255, 255, 0.18) !important; color: #fff !important; border-color: rgba(255,255,255,0.45) !important; }
.mc-btn--solid,
.mc-login input[type='submit'] {
  background-image: var(--mc-grad) !important;
  background-color: #6366f1 !important;
  color: #fff !important;
  box-shadow: var(--mc-shadow-sm);
}
.mc-btn--soft { background: var(--mc-surface-2) !important; color: var(--mc-text) !important; border-color: var(--mc-border) !important; }

/* Section title */
.mc-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--mc-text);
}
.mc-section-title .ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(99, 102, 241, 0.12); color: var(--mc-primary);
  font-size: 16px;
}

/* Chart card */
.mc-chart-card { grid-column: span 12; }
.mc-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mc-chart-title { font-size: 16px; font-weight: 800; color: var(--mc-text); }
.mc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--mc-muted); }
.mc-legend span { display: inline-flex; align-items: center; gap: 7px; }
.mc-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.mc-legend .lg-pay { background: #6366f1; }
.mc-legend .lg-fee { background: #06b6d4; }
.mc-legend .lg-bal { background: #10b981; }
.mc-chart-wrap { position: relative; height: 300px; width: 100%; }
.mc-empty {
  display: grid; place-items: center; height: 280px;
  color: var(--mc-muted); font-size: 14px; text-align: center;
}

/* Range tabs (24h / 7d / month) */
.mc-tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--mc-surface-2);
  border: 1px solid var(--mc-border);
  border-radius: 12px;
}
.mc-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mc-muted);
  font: 600 13px/1 'Inter', sans-serif;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s ease;
}
.mc-tabs button:hover { color: var(--mc-text); }
.mc-tabs button.is-active {
  background: var(--mc-grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
}

/* Stat summary chips */
.mc-stat-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 4px 0 18px;
}
.mc-stat-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--mc-border);
  border-radius: 12px;
  background: var(--mc-surface-2);
}
.mc-stat-chip .k { font-size: 12px; color: var(--mc-muted); }
.mc-stat-chip .v { font-size: 17px; font-weight: 800; color: var(--mc-text); letter-spacing: -0.01em; }
@media (max-width: 720px) {
  .mc-stat-chips { grid-template-columns: repeat(2, 1fr); }
}

/* Current session (online/offline) under the load chart */
.mc-online {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--mc-border);
  border-radius: 14px;
  background: var(--mc-surface-2);
}
.mc-online-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14px;
  color: var(--mc-text);
}
.mc-online .mc-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.mc-online.is-online {
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .08);
}
.mc-online.is-online .mc-dot {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .18);
}
.mc-online.is-offline .mc-dot { background: #94a3b8; }
.mc-online.is-offline { color: var(--mc-muted); }
.mc-online .mc-rows { margin-top: 10px; }

/* Definition rows */
.mc-rows { display: flex; flex-direction: column; gap: 2px; }
.mc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--mc-border);
}
.mc-row:last-child { border-bottom: none; }
.mc-row .k { color: var(--mc-muted); font-size: 13.5px; }
.mc-row .v { font-weight: 600; color: var(--mc-text); text-align: right; }

/* Generic styling for legacy tables appended below (Dv info / Docs) */
.mc-legacy { margin-top: 26px; }
.mc-legacy table.form,
.mc-legacy table.list {
  width: 100% !important;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-sm);
  overflow: hidden;
  box-shadow: var(--mc-shadow-sm);
}
.mc-legacy table th { background: var(--mc-surface-2); color: var(--mc-text); padding: 11px 14px; text-align: left; }
.mc-legacy table td { padding: 10px 14px; border-top: 1px solid var(--mc-border); }
.mc-legacy h3 { text-align: left; color: var(--mc-text) !important; font-style: normal !important; }

/* Key-value table (personal details / info fields) */
.mc-kv { width: 100%; border-collapse: collapse; margin: 0; }
.mc-kv tr td { padding: 10px 2px !important; border-bottom: 1px dashed var(--mc-border); font-size: 14px; vertical-align: top; }
.mc-kv tr:last-child td { border-bottom: none; }
.mc-kv tr td:first-child { color: var(--mc-muted); width: 42%; }
.mc-kv tr td:last-child { color: var(--mc-text); font-weight: 600; }

/* Hero action buttons (legacy ABillS buttons inherit a clean look) */
.mc-hero .mc-hero-actions a,
.mc-hero .mc-hero-actions input,
.mc-hero .mc-hero-actions button,
.mc-hero .mc-hero-actions .link_button {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px !important;
  height: auto !important;
  line-height: 1.25 !important;
  border-radius: 12px !important;
  background: #fff !important;
  background-image: none !important;
  color: #4f46e5 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  border: none !important;
  cursor: pointer;
  box-shadow: var(--mc-shadow-sm);
  text-decoration: none;
}
.mc-hero .mc-hero-actions a:hover,
.mc-hero .mc-hero-actions .link_button:hover { transform: translateY(-1px); opacity: 0.96; }
.mc-hero-sub a, .mc-hero-sub input { color: #fff !important; }
.mc-hero-sub .link_button,
.mc-hero-sub .mc-open-credit-popup {
  display: inline-flex !important;
  margin-top: 8px;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-decoration: none !important;
}
.mc-hero-sub .link_button:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}
.mc-hero-sub b {
  font-weight: 800;
  color: #fff;
}

/* Credit advance popup — override legacy client.css #open_popup_block_middle { z-index:10 } */
#open_popup_block_middle.mc-popup,
.mc-credit-popup#open_popup_block_middle {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9100 !important;
  width: min(440px, 92vw) !important;
  margin: 0 !important;
  padding: 26px !important;
  overflow: visible !important;
  border: 1px solid var(--mc-border) !important;
  border-radius: 20px !important;
  background: var(--mc-surface) !important;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.45) !important;
}
#open_popup_block_middle.mc-popup #close_popup_window,
.mc-credit-popup#open_popup_block_middle #close_popup_window {
  background: none !important;
  border-radius: 0 !important;
  color: var(--mc-muted) !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
  position: absolute !important;
  right: 16px !important;
  top: 12px !important;
}
#open_popup_block_middle.mc-popup #popup_window_content,
.mc-credit-popup#open_popup_block_middle #popup_window_content {
  font: inherit !important;
  padding: 0 !important;
}
.mc-popup {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9100;
  width: min(440px, 92vw);
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.45);
}
.mc-popup-close {
  position: absolute;
  right: 16px; top: 12px;
  font-size: 22px;
  color: var(--mc-muted);
  cursor: pointer;
  text-decoration: none;
}
.mc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.45);
}
#mc-phone-verify-modal.mc-phone-modal {
  z-index: 9200 !important;
}
.mc-credit-popup { z-index: 9100 !important; }
.mc-phone-modal { z-index: 9200 !important; }
.mc-credit-popup-title,
.mc-phone-modal-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--mc-text);
}
.mc-credit-popup-text,
.mc-phone-modal-text {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--mc-muted);
}
.mc-credit-accept {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  font-size: 13.5px;
  cursor: pointer;
}
.mc-credit-accept input { margin-top: 3px; flex-shrink: 0; }
.mc-credit-submit,
.mc-phone-modal-ok { width: 100%; margin-top: 8px; }
.mc-credit-phone {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.mc-credit-phone-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--mc-text);
}
.mc-credit-phone-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--mc-muted);
  line-height: 1.45;
}
.mc-credit-phone-err,
.mc-credit-phone-warn {
  margin: 10px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #e11d48;
}
.mc-credit-phone-warn {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
}
.mc-phone-verify-err {
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #e11d48;
}

/* Neutralize legacy tpl_show wrappers inside the cabinet body */
.mc-body .table_top,
.mc-body .table_bot { display: none !important; }
.mc-body .table_cont {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
}

/* Modernize any legacy tables that get appended below the dashboard */
.mc-body table.list,
.mc-body table.form {
  width: 100% !important;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--mc-shadow-sm);
  margin: 12px 0;
}
.mc-body table.list th,
.mc-body table.form th {
  background: var(--mc-surface-2);
  padding: 11px 14px;
  text-align: left;
  color: var(--mc-text);
}
.mc-body table.list td,
.mc-body table.form td {
  padding: 10px 14px;
  border-top: 1px solid var(--mc-border);
}
.mc-body h3 { text-align: left; }
#dv_user_info h3 { color: var(--mc-text) !important; font-style: normal !important; margin: 8px 0 !important; }

/* Unify EVERY action button inside the cabinet content (kill legacy green). */
.mc-body .link_button,
.mc-body input[type='submit'],
.mc-body input[type='button'],
.mc-body input[type='reset'],
.mc-body button:not(.mc-btn--clear-mac),
.mc-body .button,
.mc-body .change {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  width: auto;
  height: auto !important;
  min-height: 0 !important;
  padding: 9px 16px !important;
  line-height: 1.25 !important;
  border-radius: 10px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  border: 1px solid var(--mc-border) !important;
  background: var(--mc-surface-2) !important;
  background-image: none !important;
  color: var(--mc-primary) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  cursor: pointer;
  text-decoration: none !important;
  vertical-align: middle;
  transition: background .12s ease, transform .12s ease, opacity .12s ease;
}
.mc-body .link_button:hover,
.mc-body input[type='submit']:hover,
.mc-body input[type='button']:hover,
.mc-body button:not(.mc-btn--clear-mac):hover,
.mc-body .button:hover,
.mc-body .change:hover {
  background: #eef2ff !important;
  transform: translateY(-1px);
}
/* Primary submit actions get the brand gradient (still never green). */
.mc-body input[type='submit']:not(.mc-btn--clear-mac),
.mc-body button[type='submit']:not(.mc-btn--clear-mac) {
  background-image: var(--mc-grad) !important;
  background-color: #6366f1 !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: var(--mc-shadow-sm) !important;
}
.mc-body input[type='submit']:not(.mc-btn--clear-mac):hover,
.mc-body button[type='submit']:not(.mc-btn--clear-mac):hover { opacity: 0.95; background-image: var(--mc-grad) !important; }

/* ---------- Support / Messages page (legacy Msgs) in modern style ---------- */
.mc-body input[type='text'],
.mc-body input[type='email'],
.mc-body input[type='password'],
.mc-body input[type='number'],
.mc-body input[type='file'],
.mc-body textarea,
.mc-body select {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  max-width: 100%;
  padding: 10px 13px !important;
  border: 1px solid var(--mc-border) !important;
  border-radius: 11px !important;
  background: var(--mc-surface-2) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  color: var(--mc-text) !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.mc-body textarea { width: 100%; min-height: 130px; line-height: 1.5; resize: vertical; }
.mc-body input[type='text']:focus,
.mc-body textarea:focus,
.mc-body select:focus {
  outline: none;
  border-color: var(--mc-primary) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
.mc-body input[type='file'] { padding: 8px 10px !important; background: var(--mc-surface) !important; }

/* Table captions become modern section headers */
.mc-body table.list caption,
.mc-body table.form caption,
.mc-body .caption,
.mc-body caption {
  caption-side: top;
  text-align: left;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--mc-text);
  padding: 0 0 12px;
}

/* Status filter bar (#rules) — wrap cleanly as a row of pills */
.mc-body #rules { width: 100% !important; }
.mc-body #rules ul { margin: 0; padding: 0; list-style: none; }
.mc-body #rules li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}
.mc-body #rules .link_button {
  margin: 0 !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  font-size: 12.5px !important;
}

.mc-body blink { animation: none; font-weight: 700; color: #f59e0b; }

/* Make legacy fixed-width tables fluid (send form 500px, show sidebar 200px) */
.mc-body table[width] { width: 100% !important; max-width: 100% !important; }
.mc-body td[width], .mc-body th[width] { width: auto !important; }

/* Neutralize nested legacy tables so the thread reads as clean blocks */
.mc-body table.form table,
.mc-body table.list table {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.mc-body table.form table th,
.mc-body table.form table td,
.mc-body table.list table th,
.mc-body table.list table td {
  border: 0 !important;
  background: transparent !important;
  padding: 4px 6px !important;
}

/* Thread: each message / reply is a clean stacked card */
.mc-body table.form { margin: 14px 0 !important; }
.mc-body table.form > tbody > tr > th.even {
  background: var(--mc-surface-2) !important;
  padding: 10px 14px !important;
  text-align: left;
}
/* Author label = role badge (Оператор / Користувач) */
.mc-body .title_color {
  display: inline-block;
  font-weight: 800 !important;
  font-size: 12.5px;
  letter-spacing: .01em;
  color: var(--mc-primary) !important;
  background: transparent !important;
}
.mc-body .form_title {
  font-size: 15px; font-weight: 800; color: var(--mc-text) !important;
  background: transparent !important; padding: 6px 0 10px !important;
}
.mc-body .medium { color: var(--mc-muted) !important; font-size: 12px; }

/* Message body (main message + each reply) reads as a soft bubble */
.mc-body table.form > tbody > tr > td.odd,
.mc-body table.form > tbody > tr > td.even {
  background: var(--mc-surface-2) !important;
  border-radius: 10px !important;
  padding: 13px 15px !important;
  line-height: 1.6;
  color: var(--mc-text) !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* The submit band in the send / reply forms */
.mc-body table.form > tbody > tr > th.even:last-child { border-radius: 10px !important; }

/* Mobile: stack the two-column message view and shrink list density */
@media (max-width: 720px) {
  .mc-body table.list th, .mc-body table.list td,
  .mc-body table.form th, .mc-body table.form td { padding: 8px 9px; font-size: 13px; }
  .mc-body table.form textarea { min-height: 150px; }
  /* msgs_show outer 2-col layout -> stack */
  .mc-body table.form > tbody > tr > td[valign='top'] { display: block; width: 100% !important; }
  /* Wide ticket list scrolls horizontally inside its own box (no page overflow) */
  .mc-body table.list {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- Login ---------- */
/* Fit login in viewport — no page scroll */
.page_wrap:has(.mc-login) {
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inner_wrap:has(.mc-login) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.page_wrap:has(.mc-login) .mc-appbar {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(226, 232, 240, 0.9);
}
.page_wrap:has(.mc-login) .mc-page {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  padding: 0 !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page_wrap:has(.mc-login) .mc-page > #info_message {
  width: 100%;
  max-width: 320px;
  flex: 0 0 auto;
  margin: 0 16px 12px !important;
}

.mc-login {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(139, 92, 246, 0.08), transparent 50%),
    var(--mc-bg);
}
.mc-login-card {
  width: 100%;
  max-width: 320px;
  background: var(--mc-surface);
  border: 1px solid var(--mc-border);
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  text-align: center;
}
.mc-login-mark {
  width: 48px; height: 48px; margin: 0 auto 12px;
  border-radius: 13px;
  background: var(--mc-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 24px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}
.mc-login-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.mc-login-sub { color: var(--mc-muted); font-size: 13px; margin-bottom: 18px; line-height: 1.4; }

.mc-login-notice {
  margin: -6px 0 16px;
  padding: 11px 14px 11px 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  position: relative;
}
.mc-login-notice::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px;
}
.mc-login-notice--info {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.mc-login-notice--info::before {
  background-color: #10b981;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}
.mc-login-notice--err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.mc-login-notice--err::before {
  background-color: #ef4444;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M12 8v5M12 16h.01'/%3E%3C/svg%3E");
}

.mc-login form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mc-login .mc-field {
  text-align: left;
  width: 18ch;
  min-width: 168px;
  max-width: 100%;
  margin-bottom: 12px;
}
.mc-login .mc-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-muted);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.mc-login .mc-input {
  width: 100% !important;
  box-sizing: border-box;
  height: 38px !important;
  padding: 0 12px !important;
  border: 1px solid var(--mc-border) !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-family: inherit !important;
  line-height: normal !important;
  color: var(--mc-text) !important;
  background: var(--mc-surface-2) !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.mc-login .mc-input:focus {
  outline: none;
  border-color: var(--mc-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.mc-login .mc-btn,
.mc-login input[type='submit'] {
  width: 18ch !important;
  min-width: 168px !important;
  max-width: 100% !important;
  justify-content: center;
  padding: 10px 16px !important;
  font-size: 14.5px !important;
  margin-top: 6px;
  border-radius: 10px !important;
}
.mc-login-foot { margin-top: 20px; font-size: 13px; color: var(--mc-muted); }
.mc-login-foot a { font-weight: 600; }
.mc-contact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--mc-border);
  font-size: 12px;
  color: var(--mc-muted);
  line-height: 1.45;
}

@media (max-width: 560px) {
  .mc-brand-title { white-space: normal; }
  .page_wrap:has(.mc-login) { max-height: none; min-height: 100dvh; overflow: auto; }
  .inner_wrap:has(.mc-login) { overflow: visible; }
  .page_wrap:has(.mc-login) .mc-page { overflow: visible; }
}

.mc-body > br { display: none !important; }

/* ---------- System notices (info / error from $html->message) ---------- */
body .page_wrap .inner_wrap #info_message,
body .page_wrap .inner_wrap .mc-body #info_message,
.mc-page #info_message,
.mc-body #info_message {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  text-align: left !important;
  position: static !important;
  border: 1px solid var(--mc-border) !important;
  border-radius: 14px !important;
  background: var(--mc-surface) !important;
  box-shadow: var(--mc-shadow-sm) !important;
  overflow: hidden;
  display: flex !important;
  align-items: stretch;
}

.mc-body #info_message br,
.mc-page #info_message + br,
.mc-body #info_message + br { display: none; }

.mc-body #info_message > div,
.mc-page #info_message > div {
  padding: 0 !important;
  margin: 0 !important;
}

/* Hide legacy caption row ("Інформація" / "Помилка") — the text body is enough */
.mc-body #info_message .info_message,
.mc-body #info_message .err_message,
.mc-page #info_message .info_message,
.mc-page #info_message .err_message {
  display: none !important;
  height: auto !important;
  background: transparent !important;
  color: inherit !important;
}

/* Main notice text row */
.mc-body #info_message > div:last-child,
.mc-page #info_message > div:last-child {
  flex: 1 1 auto;
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 13px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  color: var(--mc-text) !important;
}

.mc-body #info_message > div:last-child img,
.mc-page #info_message > div:last-child img {
  display: none !important;
}

/* Info / success variant */
.mc-body #info_message:has(.info_message),
.mc-page #info_message:has(.info_message) {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}
.mc-body #info_message:has(.info_message) > div:last-child::before,
.mc-page #info_message:has(.info_message) > div:last-child::before {
  content: '';
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* Error variant */
.mc-body #info_message:has(.err_message),
.mc-page #info_message:has(.err_message) {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}
.mc-body #info_message:has(.err_message) > div:last-child,
.mc-page #info_message:has(.err_message) > div:last-child {
  color: #991b1b !important;
}
.mc-body #info_message:has(.err_message) > div:last-child::before,
.mc-page #info_message:has(.err_message) > div:last-child::before {
  content: '';
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M12 8v5M12 16h.01'/%3E%3C/svg%3E") center/14px no-repeat;
}

.message, .msg, .error, .info { border-radius: var(--mc-radius-sm) !important; }

/* ---------- Select box (language) ---------- */
.mc-select {
  padding: 9px 12px;
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  background: var(--mc-surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--mc-text);
}

/* ---------- Responsive ---------- */
/* Desktop: sidebar is forced open via JS; hide the mobile toggle and
   guarantee the nav is visible even if the <details> stays closed. */
@media (min-width: 901px) {
  .mc-menu-summary { display: none !important; }
  details.mc-sidebar > .mc-nav,
  details.mc-sidebar:not([open]) > .mc-nav { display: block !important; }
  details.mc-sidebar::details-content { display: block !important; content-visibility: visible !important; }
}

@media (max-width: 960px) {
  .mc-card, .mc-hero, .mc-side, .mc-card.span-6, .mc-card.span-8 { grid-column: span 12; }
  .mc-side { grid-template-columns: 1fr; }
}

/* Tablet / mobile: single column, collapsible menu */
@media (max-width: 900px) {
  .mc-layout { grid-template-columns: 1fr; gap: 14px; }
  .mc-sidebar { position: static; }
  .mc-menu-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    padding: 13px 16px;
    border-radius: 14px;
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    box-shadow: var(--mc-shadow-sm);
    font-weight: 700;
    color: var(--mc-text);
    -webkit-user-select: none;
    user-select: none;
  }
  .mc-menu-summary::-webkit-details-marker { display: none; }
  .mc-menu-summary::before { content: '\2630'; font-size: 18px; color: var(--mc-primary); }
  details.mc-sidebar[open] .mc-menu-summary { margin-bottom: 10px; }
  .mc-page { padding: 18px 14px 48px; }
  .mc-chart-wrap { height: 240px; }
}

@media (max-width: 560px) {
  .mc-side { grid-template-columns: 1fr; }
  .mc-hero-balance { font-size: 36px; }
  .mc-brand { font-size: 16px; }
  .mc-card { padding: 18px; }
  .mc-hero { padding: 22px; }
  .mc-appbar { padding: 12px 16px; }
  .mc-topinfo { gap: 7px; }
  .mc-chip { font-size: 12px; padding: 6px 11px; }
  .mc-chart-wrap { height: 220px; }
}

/* ============================================================
   Messages — modern chat (Starlink-like, light theme)
   ============================================================ */
.mc-msgs { display: block; }
.mc-msgs-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.mc-msgs-title { font-size: 20px; font-weight: 800; color: var(--mc-text); }

.mc-msgs-search { margin-bottom: 12px; }
.mc-msgs-search input {
  width: 100%; box-sizing: border-box;
  padding: 11px 14px; border: 1px solid var(--mc-border);
  border-radius: 12px; background: var(--mc-surface);
  font-family: inherit; font-size: 14px; color: var(--mc-text);
}
.mc-msgs-search input:focus {
  outline: none; border-color: var(--mc-primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}

.mc-msgs-filter {
  display: flex; gap: 8px; margin-bottom: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.mc-msgs-filter::-webkit-scrollbar { height: 0; }
.mc-pill {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--mc-border); background: var(--mc-surface);
  color: var(--mc-muted); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; transition: all .15s;
}
.mc-pill:hover { color: var(--mc-text); border-color: var(--mc-primary); }
.mc-pill.is-active {
  background: var(--mc-primary); color: #fff; border-color: var(--mc-primary);
}

.mc-msgs-list { display: flex; flex-direction: column; gap: 10px; }
.mc-msgs-empty {
  padding: 34px 20px; text-align: center; color: var(--mc-muted);
  border: 1px dashed var(--mc-border); border-radius: 16px; background: var(--mc-surface);
}

.mc-msg-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--mc-border);
  border-radius: 16px; background: var(--mc-surface);
  text-decoration: none; box-shadow: var(--mc-shadow-sm);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.mc-msg-card:hover {
  transform: translateY(-1px); border-color: var(--mc-primary);
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.mc-msg-card.is-unread { border-left: 4px solid var(--mc-primary); }
.mc-msg-card-body { flex: 1 1 auto; min-width: 0; }
.mc-msg-card-subj {
  font-weight: 700; color: var(--mc-text); font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-msg-card.is-unread .mc-msg-card-subj { font-weight: 800; }
.mc-msg-card.is-closed {
  opacity: 0.72;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.mc-msg-card.is-closed:hover {
  opacity: 0.85;
  border-color: #cbd5e1;
  transform: none;
  box-shadow: var(--mc-shadow-sm);
}
.mc-msg-card.is-closed .mc-msg-card-subj { color: var(--mc-muted); font-weight: 600; }
.mc-msg-card.is-closed .mc-status-dot { background: #94a3b8 !important; }
.mc-msg-card-sub {
  margin-top: 4px; font-size: 12.5px; color: var(--mc-muted);
  display: flex; align-items: center; gap: 6px;
}
.mc-status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: #94a3b8; }
.mc-status-dot.st0, .mc-status-dot.st6 { background: #f59e0b; }
.mc-status-dot.st1 { background: #ef4444; }
.mc-status-dot.st2 { background: #22c55e; }
.mc-status-dot.st3 { background: #3b82f6; }
.mc-status-dot.st4 { background: var(--mc-primary); }
.mc-status-dot.st5 { background: #94a3b8; }
.mc-msg-card-aside {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  color: var(--mc-muted); font-size: 12.5px;
}
.mc-chevron { font-size: 22px; color: #cbd5e1; line-height: 1; }

/* ---------- Chat thread ---------- */
.mc-chat { display: flex; flex-direction: column; }
.mc-chat-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.mc-chat-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}
.mc-close-form { margin: 0; display: inline; }
.mc-close-form .mc-btn--soft {
  padding: 7px 12px; font-size: 12.5px; white-space: nowrap;
}
.mc-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--mc-primary); text-decoration: none;
  padding: 6px 0; font-size: 14px;
}
.mc-back:hover { text-decoration: underline; }
.mc-chat-status {
  flex: 0 0 auto; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: #eef2ff; color: var(--mc-primary);
}
.mc-chat-status.st0, .mc-chat-status.st6 { background: #fef3c7; color: #b45309; }
.mc-chat-status.st1 { background: #fee2e2; color: #b91c1c; }
.mc-chat-status.st2 { background: #dcfce7; color: #15803d; }
.mc-chat-status.st3 { background: #dbeafe; color: #1d4ed8; }
.mc-chat-subject {
  font-size: 19px; font-weight: 800; color: var(--mc-text);
  margin: 4px 0 16px; line-height: 1.3;
}

.mc-chat-stream {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px; background: #f1f5f9; border-radius: 18px;
  border: 1px solid var(--mc-border);
}
.mc-msg { display: flex; flex-direction: column; max-width: 82%; }
.mc-msg--op   { align-self: flex-start; align-items: flex-start; }
.mc-msg--user { align-self: flex-end;   align-items: flex-end; }
.mc-msg-meta { font-size: 11.5px; color: var(--mc-muted); margin: 0 6px 4px; font-weight: 600; }
.mc-bubble {
  padding: 11px 15px; border-radius: 18px; font-size: 14px; line-height: 1.5;
  word-break: break-word; overflow-wrap: anywhere; box-shadow: var(--mc-shadow-sm);
}
.mc-msg--op .mc-bubble {
  background: #fff; color: var(--mc-text);
  border: 1px solid var(--mc-border); border-bottom-left-radius: 6px;
}
.mc-msg--user .mc-bubble {
  background: var(--mc-primary); color: #fff; border-bottom-right-radius: 6px;
}
.mc-msg--user .mc-bubble a { color: #fff; text-decoration: underline; }
.mc-bubble-att { margin-top: 8px; font-size: 13px; }
.mc-chat-closed {
  margin-top: 14px; padding: 12px 16px; text-align: center;
  background: var(--mc-surface); border: 1px solid var(--mc-border);
  border-radius: 14px; color: var(--mc-muted); font-size: 13px; font-weight: 600;
}

/* ---------- Composer / new request form ---------- */
.mc-composer {
  display: flex; flex-direction: column; gap: 10px; margin-top: 14px;
  padding: 14px; background: var(--mc-surface);
  border: 1px solid var(--mc-border); border-radius: 16px;
}
.mc-composer textarea,
.mc-newform textarea,
.mc-newform input[type=text] {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 11px 14px; border: 1px solid var(--mc-border); border-radius: 12px;
  background: #fff; font-family: inherit; font-size: 14px; color: var(--mc-text);
}
.mc-composer textarea:focus,
.mc-newform textarea:focus,
.mc-newform input[type=text]:focus {
  outline: none; border-color: var(--mc-primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}
.mc-composer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.mc-file { font-size: 13px; color: var(--mc-muted); }
.mc-file input { font-size: 13px; max-width: 200px; }

.mc-newform {
  display: flex; flex-direction: column; gap: 14px; margin-top: 4px;
}
.mc-fld { display: flex; flex-direction: column; gap: 6px; }
.mc-fld > span { font-size: 13px; font-weight: 700; color: var(--mc-text); }
.mc-newform select {
  padding: 11px 14px; border: 1px solid var(--mc-border); border-radius: 12px;
  background: #fff; font-family: inherit; font-size: 14px; color: var(--mc-text);
}

/* Solid action button (reuse base .mc-btn if present) */
.mc-btn--solid {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--mc-primary); color: #fff !important;
  font-family: inherit; font-size: 14px; font-weight: 700; text-decoration: none;
  transition: filter .15s, transform .12s;
}
.mc-btn--solid:hover { filter: brightness(1.07); transform: translateY(-1px); }

@media (max-width: 560px) {
  .mc-msg { max-width: 90%; }
  .mc-chat-subject { font-size: 17px; }
  .mc-chat-stream { padding: 12px; }
  .mc-msgs-head { flex-direction: column; align-items: stretch; }
  .mc-msgs-head .mc-btn--solid { width: 100%; }
  .mc-composer-row { flex-direction: column; align-items: stretch; }
  .mc-composer-row .mc-btn--solid { width: 100%; }
  .mc-chat-actions { width: 100%; justify-content: space-between; }
  .mc-close-form .mc-btn--soft { flex: 1; text-align: center; }
}

/* ============================================================
   Finance — last payment banner
   ============================================================ */
.mc-finance-lastpay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.22);
  font-size: 14px;
  line-height: 1.4;
}
.mc-finance-lastpay-label {
  font-weight: 700;
  color: #047857;
}
.mc-finance-lastpay-val {
  font-weight: 600;
  color: var(--mc-text);
}
.mc-finance-lastpay-sep {
  color: var(--mc-muted);
}
.mc-finance-lastpay-sum {
  font-weight: 800;
  color: var(--mc-text);
}

/* ============================================================
   Top-up / Payment (Поповнення рахунку)
   ============================================================ */
.mc-pay { margin-top: 4px; }
.mc-pay-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  align-items: stretch;
}
.mc-pay-bank,
.mc-pay-online {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mc-pay-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.mc-pay-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}
.mc-pay-icon--bank {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(6,182,212,.12));
}
.mc-pay-icon--card {
  background: linear-gradient(135deg, rgba(16,185,129,.14), rgba(99,102,241,.12));
}
.mc-pay-hint {
  margin-top: 3px;
  font-size: 13px;
  color: var(--mc-muted);
  line-height: 1.4;
}
.mc-pay-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mc-pay-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--mc-border);
}
.mc-pay-row:first-child { padding-top: 0; }
.mc-pay-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mc-pay-row dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mc-pay-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--mc-text);
  line-height: 1.45;
  word-break: break-word;
}
.mc-pay-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.mc-pay-row--purpose dd { color: var(--mc-primary); }
.mc-pay-purpose {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
}
.mc-pay-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mc-surface-2);
  border: 1px dashed var(--mc-border);
  font-size: 13px;
  color: var(--mc-muted);
  line-height: 1.5;
}
.mc-pay-note b { color: var(--mc-text); }

.mc-pay-cardlink {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1 1 auto;
  margin-top: 4px;
  padding: 22px 18px 18px;
  border-radius: 16px;
  border: 1px solid var(--mc-border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  text-decoration: none !important;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.mc-pay-cardlink:hover {
  transform: translateY(-2px);
  border-color: var(--mc-primary);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}
.mc-pay-cards {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
}
.mc-pay-cardtitle {
  font-size: 17px;
  font-weight: 800;
  color: var(--mc-text);
  text-align: center;
  line-height: 1.3;
}
.mc-pay-cardsub {
  font-size: 13px;
  font-weight: 600;
  color: var(--mc-muted);
  text-align: center;
}
.mc-pay-gobtn {
  margin-top: 8px;
  width: 100%;
  max-width: 240px;
  pointer-events: none;
}

@media (max-width: 860px) {
  .mc-pay-grid { grid-template-columns: 1fr; }
  .mc-pay-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
  .mc-pay-bank, .mc-pay-online { padding: 18px 16px; }
  .mc-pay-cardlink { padding: 18px 14px; }
}

/* Hide legacy promo clutter that breaks the clean look (kept accessible) */
#siteheart_button_231651 { display: none !important; }

/* ============================================================
   Television (Iptv2 — ITV / OmegaTV)
   ============================================================ */
.mc-tv { margin-top: 4px; }
.mc-tv-trial {
  margin: 0 0 16px;
  padding: 13px 18px;
  border-radius: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #047857;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.28);
  line-height: 1.45;
}
.mc-tv-trial strong { font-weight: 800; }
.mc-tv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
.mc-tv-main,
.mc-tv-apps {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.mc-tv-logo-wrap {
  display: block;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.06));
  border: 1px solid var(--mc-border);
  transition: transform .15s, box-shadow .15s;
}
.mc-tv-logo-wrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.mc-tv-logo {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}
.mc-tv-heading {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mc-text);
}
.mc-tv-sub {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--mc-muted);
  line-height: 1.45;
  max-width: 280px;
}
.mc-tv-reg {
  width: 100%;
  max-width: 260px;
  justify-content: center;
}
.mc-tv-apps {
  justify-content: center;
}
.mc-tv-apps .mc-card-label {
  margin-bottom: 8px;
  font-size: 16px;
}
.mc-tv-apps-hint {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--mc-muted);
  line-height: 1.45;
  max-width: 300px;
}
.mc-tv-store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.mc-tv-store {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--mc-border);
  background: #fff;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  line-height: 0;
}
.mc-tv-store:hover {
  transform: translateY(-2px);
  border-color: var(--mc-primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
}
.mc-tv-store img {
  display: block;
  width: auto;
  max-width: 160px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

/* Legacy Iptv module: channels table in cabinet */
.mc-body #IPTV_CHANNELS,
.mc-body table.list caption {
  text-align: left;
}
.mc-body #IPTV_CHANNELS img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .mc-tv-grid { grid-template-columns: 1fr; }
  .mc-tv-main, .mc-tv-apps { padding: 22px 18px; }
  .mc-tv-store img { max-width: 140px; }
}

/* ============================================================
   Change password (client cabinet)
   ============================================================ */
.mc-passwd-card {
  max-width: 420px;
  padding: 24px 22px;
}
.mc-passwd-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.mc-passwd-fields .mc-fld { margin: 0; }
.mc-passwd-fields .mc-input {
  width: 100% !important;
  box-sizing: border-box;
  height: 40px !important;
  padding: 0 12px !important;
  border: 1px solid var(--mc-border) !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-family: inherit !important;
  background: var(--mc-surface-2) !important;
  color: var(--mc-text) !important;
}
.mc-passwd-fields .mc-input:focus {
  outline: none;
  border-color: var(--mc-primary) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.mc-passwd-actions { margin-bottom: 16px; }
.mc-passwd-actions .mc-btn--solid {
  width: 100%;
  justify-content: center;
  cursor: pointer;
}
.mc-passwd-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mc-surface-2);
  border: 1px solid var(--mc-border);
  font-size: 13px;
  color: var(--mc-muted);
  line-height: 1.55;
}

/* ============================================================
   Settings (password, router, help)
   ============================================================ */
.mc-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}
.mc-settings-card {
  padding: 22px 22px 20px;
}
.mc-settings-h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mc-text);
}
.mc-settings-intro {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--mc-muted);
  line-height: 1.45;
}
.mc-settings-intro strong {
  color: var(--mc-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.mc-fld--wide { max-width: none; }

/* MAC input — visually separated from format hint */
.mc-mac-field {
  margin-bottom: 4px;
}
.mc-mac-field-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--mc-text);
}
.mc-mac-input-wrap {
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(99, 102, 241, 0.35);
  background: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}
.mc-mac-input {
  display: block;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--mc-text) !important;
  letter-spacing: 0.02em;
}
.mc-mac-input:focus {
  outline: none;
}
.mc-mac-input-wrap:focus-within {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.mc-mac-format-hint {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--mc-muted);
  line-height: 1.45;
  border-radius: 8px;
  background: var(--mc-surface-2);
  border-left: 3px solid rgba(99, 102, 241, 0.45);
}
.mc-mac-format-hint code {
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #fff;
  border: 1px solid var(--mc-border);
  color: var(--mc-text);
}

.mc-fld--wide .mc-input {
  width: 100% !important;
  max-width: 340px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px !important;
}
.mc-settings-hint {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--mc-muted);
  line-height: 1.5;
}
.mc-settings-hint code {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--mc-surface-2);
  border: 1px solid var(--mc-border);
}
.mc-settings-actions--dual {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--mc-border);
}
.mc-settings-actions--dual .mc-btn--save-mac {
  flex: 1 1 160px;
  min-width: 148px;
}
.mc-settings-actions--dual .mc-btn--clear-mac {
  flex: 1 1 160px;
  min-width: 148px;
}

/* Phone confirmation for weak passwords */
.mc-phone-verify {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.mc-phone-verify--warn {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.06);
}
.mc-phone-verify-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--mc-text);
}
.mc-phone-verify-fld {
  display: block;
  margin: 0;
}
.mc-phone-verify-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-text);
}
.mc-phone-verify-input {
  width: 100% !important;
  max-width: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em;
  text-align: center;
}
.mc-phone-verify-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--mc-muted);
  line-height: 1.45;
}
.mc-popup .mc-phone-verify {
  margin-top: 10px;
}

/* Current MAC badge */
.mc-mac-current {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.18);
}
.mc-mac-current-k {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mc-muted);
}
.mc-mac-current-v {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--mc-text);
  word-break: break-all;
}

/* Two scenario cards */
.mc-settings-scenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.mc-scenario {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--mc-border);
  background: var(--mc-surface-2);
}
.mc-scenario--dhcp { border-color: rgba(99, 102, 241, 0.22); background: rgba(99, 102, 241, 0.04); }
.mc-scenario--pppoe { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.06); }
.mc-scenario-num {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: var(--mc-grad);
}
.mc-scenario--pppoe .mc-scenario-num {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.mc-scenario-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--mc-text);
  margin-bottom: 4px;
}
.mc-scenario-body p {
  margin: 0;
  font-size: 12.5px;
  color: var(--mc-muted);
  line-height: 1.5;
}

/* Clear MAC — visible, overrides global submit gradient */
.mc-clear-mac-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
}
.mc-clear-mac-text {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.45;
}
.mc-clear-mac-text strong {
  font-size: 14px;
  color: #78350f;
}
.mc-clear-mac-text span {
  font-size: 12.5px;
  opacity: 0.92;
}
.mc-settings .mc-btn--clear-mac,
.mc-settings input.mc-btn--clear-mac,
.mc-settings input[type='submit'].mc-btn--clear-mac,
.mc-body .mc-router-form input.mc-btn--clear-mac {
  flex: 0 0 auto;
  background: #fff !important;
  background-image: none !important;
  color: #b45309 !important;
  border: 2px solid #f59e0b !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25) !important;
  font-weight: 800 !important;
  padding: 12px 22px !important;
  font-size: 14px !important;
  min-height: 44px !important;
}
.mc-settings .mc-btn--clear-mac:hover,
.mc-settings input.mc-btn--clear-mac:hover,
.mc-settings input[type='submit'].mc-btn--clear-mac:hover,
.mc-body .mc-router-form input.mc-btn--clear-mac:hover {
  background: #fef3c7 !important;
  background-image: none !important;
  border-color: #d97706 !important;
  color: #92400e !important;
  transform: translateY(-1px);
}
.mc-settings .mc-btn--save-mac {
  min-width: 160px;
}

.mc-settings-form {
  margin: 0;
}
.mc-settings-help-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--mc-muted);
  line-height: 1.6;
}
.mc-settings-help-list li { margin-bottom: 6px; }
.mc-settings-help-list li:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .mc-settings-scenarios { grid-template-columns: 1fr; }
  .mc-clear-mac-box { flex-direction: column; align-items: stretch; }
  .mc-settings .mc-btn--clear-mac { width: 100%; }
}

.mc-settings-help {
  padding: 22px;
}
.mc-settings-help-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mc-settings-help-item p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--mc-muted);
  line-height: 1.55;
}
.mc-settings-help-k {
  font-size: 13px;
  font-weight: 800;
  color: var(--mc-text);
}
.mc-settings-help-item code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--mc-surface-2);
  border: 1px solid var(--mc-border);
}

/* ============================================================
   Speedtest iframe — seamless embed (no scroll, no frame look)
   ============================================================ */
.mc-body .table_cont:has(.mc-speedtest) {
  margin: 0 !important;
}
.mc-speedtest {
  margin: 0;
  padding: 0;
  line-height: 0;
}
.mc-speedtest-iframe {
  display: block;
  width: 100%;
  height: 900px;
  border: none !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--mc-bg);
  vertical-align: top;
}
@media (max-width: 768px) {
  .mc-speedtest-iframe { height: 1200px; }
}
@media (max-width: 420px) {
  .mc-speedtest-iframe { height: 1400px; }
}
