/* Antifrauder Mini App — компоненты и каркас. Префикс .ma- */

html,
body {
  height: 100%;
}
body {
  margin: 0;
  display: flex;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

/* ── Рамка приложения ───────────────────────────────────── */
.ma-frame {
  position: relative;
  width: var(--ma-w);
  max-width: 100vw;
  height: 100dvh;
  max-height: 844px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Панели табов ───────────────────────────────────────── */
.ma-panes {
  position: relative;
  flex: 1;
  min-height: 0;
}
.ma-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--ma-safe-top, env(safe-area-inset-top, 0px)) + 14px) var(--ma-pad)
    calc(var(--ma-tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px);
  visibility: hidden;
}
.ma-pane.active {
  visibility: visible;
}

/* ── Таб-бар ────────────────────────────────────────────── */
.ma-tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  height: calc(var(--ma-tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(13, 13, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-1);
  transition: transform var(--dur-slow) var(--ease);
}
.ma-frame.detail-open .ma-tabbar {
  transform: translateY(110%);
}
.ma-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-3);
  -webkit-tap-highlight-color: transparent;
}
.ma-tab .ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 27px;
  border-radius: var(--radius-pill);
  transition: all var(--dur-base) var(--ease);
}
.ma-tab .ic .lucide {
  width: 20px;
  height: 20px;
}
.ma-tab span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease);
}
.ma-tab.active {
  color: var(--text-1);
}
.ma-tab.active span {
  font-weight: 600;
}
.ma-tab.active .ic {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 0 14px rgba(232, 28, 116, 0.35);
}
.ma-tab:active .ic {
  transform: scale(0.92);
}

/* ── Детальный экран (push поверх табов) ────────────────── */
.ma-detail {
  position: absolute;
  z-index: 35;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--ma-safe-top, env(safe-area-inset-top, 0px)) + 14px) var(--ma-pad)
    calc(env(safe-area-inset-bottom, 0px) + 28px);
  background:
    radial-gradient(420px 300px at 12% -6%, var(--glow-magenta), transparent 70%),
    radial-gradient(380px 280px at 92% 14%, var(--glow-orange), transparent 70%), var(--bg-0);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease);
}
.ma-detail.open {
  transform: none;
}
.ma-detail.no-anim {
  transition: none;
}
.ma-detail-title {
  margin: 2px 0 14px;
}
.ma-detail-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}
.ma-detail-title span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.ma-detail-title .ma-extid {
  margin-top: 5px;
}
.ma-detail-title .ma-extid span {
  display: inline;
  margin-top: 0;
  font-size: 12px;
}
.ma-extid-none {
  color: var(--text-3);
  font-style: italic;
}

/* ── Карточки, заголовки секций ─────────────────────────── */
.ma-card {
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.ma-label {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--text-3);
}
.ma-sechead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 28px 2px 12px;
}
.ma-sechead:first-child {
  margin-top: 0;
}
/* Block spacing on the check screens: tpl-section wraps (sechead + card) in a
   div, which makes the inner sechead a :first-child (margin-top zeroed) — so the
   gap between blocks has to live on the wrapper, not the header. */
.ma-section {
  margin-top: 22px;
}
.ma-section:first-child {
  margin-top: 0;
}
.ma-sechead .more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 0;
  color: var(--text-2);
  font: 600 12.5px var(--font-body);
  cursor: pointer;
}
.ma-sechead .more .lucide {
  width: 14px;
  height: 14px;
}
.ma-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}
.ma-dim {
  color: var(--text-3);
}

/* ── Кнопки ─────────────────────────────────────────────── */
.ma-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font: 600 14.5px var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--dur-fast) var(--ease);
}
.ma-btn:active {
  transform: scale(0.97);
}
.ma-btn .lucide {
  width: 17px;
  height: 17px;
}
.ma-btn.primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--glow-brand);
}
.ma-btn.secondary {
  background: var(--surface-raised);
  color: var(--text-1);
  border-color: var(--border-1);
}
.ma-btn.danger {
  background: var(--risk-soft);
  color: var(--risk);
  border-color: var(--risk-border);
}
.ma-btn.sm {
  height: 36px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 10px;
}
.ma-btn.full {
  width: 100%;
}
.ma-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Формы ──────────────────────────────────────────────── */
.ma-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ma-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.ma-input,
.ma-select {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 13px;
  background: var(--surface-input);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font: 400 14px var(--font-body);
  outline: none;
  transition:
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.ma-input::placeholder {
  color: var(--text-3);
}
.ma-input:focus,
.ma-select:focus {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}
.ma-input.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.ma-input.error {
  border-color: var(--risk-border);
}
.ma-err {
  font-size: 12px;
  color: var(--risk);
}
.ma-hint {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.45;
}
.ma-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f6f7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.ma-select option {
  background: var(--bg-2);
}

.ma-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.ma-search .lucide {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.ma-search input {
  padding-left: 35px;
}

/* Чекбокс */
.ma-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ma-check input {
  position: absolute;
  opacity: 0;
}
.ma-check i {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  margin-top: 1px;
  border: 1px solid var(--border-2);
  background: var(--surface-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}
.ma-check i svg,
.ma-check i .lucide {
  width: 13px;
  height: 13px;
  color: #fff;
  opacity: 0;
}
.ma-check input:checked + i {
  background: var(--brand-gradient);
  border-color: transparent;
}
.ma-check input:checked + i svg,
.ma-check input:checked + i .lucide {
  opacity: 1;
}
.ma-check input:disabled + i {
  opacity: 0.4;
}
.ma-check .t {
  font-size: 13.5px;
  color: var(--text-1);
}
.ma-check .t small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}
.ma-check.disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* Тумблер */
.ma-switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 25px;
  flex: none;
  cursor: pointer;
}
.ma-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.ma-switch i {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  border: 1px solid var(--border-2);
  transition: all var(--dur-base) var(--ease);
}
.ma-switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text-2);
  transition: all var(--dur-base) var(--ease);
}
.ma-switch input:checked + i {
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(232, 28, 116, 0.25);
}
.ma-switch input:checked + i::after {
  left: 20px;
  background: #fff;
}

/* ── Hero: баланс + лимит ───────────────────────────────── */
.ma-hero .bal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ma-hero .bal b {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: var(--display-tracking);
  white-space: nowrap;
}
.ma-hero .bal small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
}
.ma-quota {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border-1);
}
.ma-quota .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ma-quota .row b {
  color: var(--text-1);
  font-weight: 600;
}
.ma-quota .row .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

/* Прогресс (квота, джобы) */
.ma-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--chart-grid);
  overflow: hidden;
  margin-top: 8px;
}
.ma-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--brand-gradient);
  transition: width 400ms var(--ease);
}
.ma-progress.full i {
  background: var(--risk);
}

/* ── Плитки типов 2×2 ───────────────────────────────────── */
.ma-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.ma-tile {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--dur-fast) var(--ease);
}
.ma-tile:active {
  background: var(--surface-card-hover);
  transform: scale(0.98);
}
.ma-tile .ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-1);
  color: var(--text-2);
}
.ma-tile .ic .lucide {
  width: 17px;
  height: 17px;
}
.ma-tile b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}
.ma-tile span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: -5px;
}

/* ── Ячейка проверки ────────────────────────────────────── */
.ma-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: var(--ma-cell-h);
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 9px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 7px;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast) var(--ease);
}
.ma-cell:active {
  background: var(--surface-card-hover);
}
.ma-cell .ic {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-1);
  color: var(--text-2);
}
.ma-cell .ic .lucide {
  width: 16px;
  height: 16px;
}
.ma-cell .mid {
  flex: 1;
  min-width: 0;
}
.ma-cell .mid .v {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ma-cell .mid .d {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
}
.ma-cell > .lucide.chev {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  flex: none;
}

/* Бейдж вердикта */
.ma-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
.ma-badge .sc {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.85;
}
.ma-badge.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
}
.ma-badge.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
}
.ma-badge.risk {
  color: var(--risk);
  background: var(--risk-soft);
  border: 1px solid var(--risk-border);
}

/* Липкий подзаголовок дня */
.ma-day {
  position: sticky;
  top: -15px;
  z-index: 5;
  margin: 4px -4px 8px;
  padding: 9px 4px 7px;
  background: rgba(9, 9, 13, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Сегмент-контрол типов ──────────────────────────────── */
.ma-segs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
  margin: 0 -2px 11px;
  scrollbar-width: none;
}
.ma-segs::-webkit-scrollbar {
  display: none;
}
.ma-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  flex: none;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-pill);
  background: var(--surface-input);
  color: var(--text-2);
  font: 600 12.5px var(--font-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--dur-fast) var(--ease);
}
.ma-seg .lucide {
  width: 14px;
  height: 14px;
}
.ma-seg:active {
  transform: scale(0.96);
}
.ma-seg.active {
  background: var(--brand-magenta-soft);
  border-color: rgba(232, 28, 116, 0.4);
  color: var(--text-1);
}

/* Чип фильтра дат */
.ma-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 13px;
  flex: none;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--surface-input);
  color: var(--text-2);
  font: 600 12.5px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.ma-chip:active {
  background: var(--surface-card-hover);
}
.ma-chip .lucide {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

/* ── Блок вердикта (деталь) ─────────────────────────────── */
.ma-verdict {
  text-align: center;
  padding: 22px 16px 20px;
  margin-bottom: 6px;
}
.ma-verdict .score {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}
.ma-verdict .score small {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.ma-verdict .ma-badge {
  margin-top: 12px;
  height: 25px;
  font-size: 12px;
  padding: 0 12px;
}
.ma-verdict.ok {
  border-color: var(--ok-border);
  box-shadow: var(--glow-ok);
}
.ma-verdict.warn {
  border-color: var(--warn-border);
  box-shadow: var(--glow-warn);
}
.ma-verdict.risk {
  border-color: var(--risk-border);
  box-shadow: var(--glow-risk);
}
.ma-verdict .score.ok {
  color: var(--ok);
}
.ma-verdict .score.warn {
  color: var(--warn);
}
.ma-verdict .score.risk {
  color: var(--risk);
}
.ma-factors {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.ma-factor {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13px;
  line-height: 1.4;
}
.ma-factor .n {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  flex: none;
  width: 34px;
  text-align: right;
}
.ma-factor.bad .n {
  color: var(--risk);
}
.ma-factor.good .n {
  color: var(--ok);
}
.ma-factor .t {
  color: var(--text-2);
}
.ma-factor-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3, var(--text-2));
  margin-top: 4px;
}
.ma-factor-head:first-child {
  margin-top: 0;
}

/* Factors accordion: summary of counts, expands to the full list. */
.ma-factors-toggle {
  width: 100%;
  margin-top: 14px;
  padding: 11px 2px 2px;
  border: none;
  border-top: 1px solid var(--border-1);
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.ma-ft-counts {
  display: flex;
  gap: 14px;
  align-items: center;
}
.ma-ft-c {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
}
.ma-ft-c i,
.ma-ft-c svg {
  width: 14px;
  height: 14px;
}
.ma-ft-c.bad {
  color: var(--risk);
}
.ma-ft-c.good {
  color: var(--ok);
}
.ma-ft-chev {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform 0.15s ease;
}
.ma-factors-toggle.open .ma-ft-chev {
  transform: rotate(180deg);
}
.ma-factors-toggle + .ma-factors {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

/* Mismatch cards: titled "что не сошлось" + two-column Заявлено / Реально. */
.ma-mm {
  margin-top: 8px;
  padding: 0;
  overflow: hidden;
}
.ma-mm-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-1);
}
.ma-mm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.ma-mm-h {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 9px 12px 3px;
}
.ma-mm-v {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 0 12px 10px;
  word-break: break-all;
}
.ma-mm-v.right {
  color: var(--risk);
}
.ma-mm-h.right,
.ma-mm-v.right {
  border-left: 1px solid var(--border-1);
}

/* Key-value строки и консенсус */
.ma-kv {
  display: flex;
  flex-direction: column;
}
.ma-kv .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border-1);
  font-size: 13px;
}
.ma-kv .row:first-child {
  border-top: none;
  padding-top: 2px;
}
.ma-kv .row:last-child {
  padding-bottom: 2px;
}
.ma-kv .k {
  color: var(--text-3);
  flex: none;
}
.ma-kv .v {
  color: var(--text-1);
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ma-kv .v .cons {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: 7px;
}
.ma-kv .v.mismatch {
  color: var(--risk);
}

/* Пилюли флагов VPN/TOR/Proxy */
.ma-flags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.ma-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font: 600 11.5px var(--font-body);
}
.ma-flag .lucide {
  width: 12px;
  height: 12px;
}
.ma-flag.on {
  color: var(--risk);
  background: var(--risk-soft);
  border: 1px solid var(--risk-border);
}
.ma-flag.off {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
}

/* ── Строки профиля ─────────────────────────────────────── */
.ma-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 8px 13px;
  margin-bottom: 7px;
  text-align: left;
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-1);
  font: 500 13.5px var(--font-body);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast) var(--ease);
  text-decoration: none;
}
.ma-row:active {
  background: var(--surface-card-hover);
}
.ma-row .lucide.lead {
  width: 17px;
  height: 17px;
  color: var(--text-2);
  flex: none;
}
.ma-row .grow {
  flex: 1;
  min-width: 0;
}
.ma-row .grow small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  font-weight: 400;
}
.ma-row .val {
  font-size: 12px;
  color: var(--text-3);
  flex: none;
}
.ma-row .lucide.chev {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  flex: none;
}

/* Пилюли статусов */
.ma-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  flex: none;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ma-pill.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
}
.ma-pill.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
}
.ma-pill.bad {
  color: var(--risk);
  background: var(--risk-soft);
  border: 1px solid var(--risk-border);
}
.ma-pill.na {
  color: var(--text-3);
  background: var(--surface-raised);
  border: 1px solid var(--border-1);
}
.ma-pill.brand {
  color: var(--brand-magenta);
  background: var(--brand-magenta-soft);
  border: 1px solid rgba(232, 28, 116, 0.35);
}

/* ── Секреты, чипы, сниппет ─────────────────────────────── */
.ma-secret {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--surface-input);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
}
.ma-secret code {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ma-secret button {
  border: none;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  padding: 4px;
}
.ma-secret button .lucide {
  width: 16px;
  height: 16px;
}
.ma-secret.fresh {
  border-color: var(--ok-border);
  box-shadow: var(--glow-ok);
}

.ma-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ma-domain {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 6px 0 11px;
  border-radius: var(--radius-xs);
  background: var(--surface-raised);
  border: 1px solid var(--border-1);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}
.ma-domain button {
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  padding: 3px;
}
.ma-domain button .lucide {
  width: 13px;
  height: 13px;
}
.ma-domain button:active {
  color: var(--risk);
}

.ma-snippet {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 12px 40px 12px 13px;
}
.ma-snippet code {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ma-snippet .copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: var(--surface-raised);
  border: 1px solid var(--border-1);
  border-radius: 7px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
}
.ma-snippet .copy .lucide {
  width: 14px;
  height: 14px;
}

/* Дроп-зона CSV */
.ma-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 22px 14px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
  transition: border-color var(--dur-fast) var(--ease);
}
.ma-drop:active {
  border-color: var(--border-focus);
}
.ma-drop .lucide {
  width: 22px;
  height: 22px;
}
.ma-drop b {
  color: var(--text-1);
  font-size: 13px;
}
.ma-drop.filled {
  border-style: solid;
  border-color: var(--border-2);
  color: var(--text-2);
}

/* ── Нижний sheet ───────────────────────────────────────── */
.ma-scrim {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: var(--surface-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.ma-scrim.open {
  opacity: 1;
}
.ma-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease);
}
.ma-sheet.open {
  transform: none;
}
.ma-sheet .grip {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-2);
  margin: 0 auto 14px;
}
.ma-sheet h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}
.ma-sheet p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.ma-sheet .acts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

/* Пресеты дат в sheet */
.ma-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}
.ma-presets button {
  height: 38px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--surface-input);
  color: var(--text-2);
  font: 600 12.5px var(--font-body);
  cursor: pointer;
}
.ma-presets button.active {
  background: var(--brand-magenta-soft);
  border-color: rgba(232, 28, 116, 0.4);
  color: var(--text-1);
}
.ma-dates2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ma-dates2 .ma-input {
  font-family: var(--font-mono);
  font-size: 12px;
  flex: 1;
}
.ma-dates2 em {
  color: var(--text-3);
  font-style: normal;
}

/* ── Тост ───────────────────────────────────────────────── */
.ma-toast {
  position: absolute;
  left: 16px;
  right: 16px;
  z-index: 60;
  bottom: calc(var(--ma-tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  animation: ma-rise var(--dur-slow) var(--ease);
}
.ma-frame.detail-open .ma-toast {
  bottom: 18px;
}
.ma-toast.ok {
  border: 1px solid var(--ok-border);
}
.ma-toast.bad {
  border: 1px solid var(--risk-border);
}
.ma-toast.neutral {
  border: 1px solid var(--border-2);
}
.ma-toast .lucide {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}
.ma-toast.ok .lucide {
  color: var(--ok);
}
.ma-toast.bad .lucide {
  color: var(--risk);
}
.ma-toast.neutral .lucide {
  color: var(--text-2);
}
.ma-toast b {
  display: block;
  font-size: 13px;
  color: var(--text-1);
}
.ma-toast small {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
@keyframes ma-rise {
  from {
    transform: translateY(10px);
  }
}

/* ── Скелетоны / пусто / ошибка ─────────────────────────── */
.ma-skel {
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--ma-skel-a) 25%,
    var(--ma-skel-b) 50%,
    var(--ma-skel-a) 75%
  );
  background-size: 200% 100%;
  animation: ma-shimmer 1.2s linear infinite;
}
@keyframes ma-shimmer {
  to {
    background-position: -200% 0;
  }
}
.ma-skel-cell {
  height: var(--ma-cell-h);
  border-radius: var(--radius-md);
  margin-bottom: 7px;
}
.ma-skel-verdict {
  height: 150px;
  border-radius: var(--radius-lg);
}

.ma-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 38px 22px;
  text-align: center;
}
.ma-empty .ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-1);
  margin-bottom: 8px;
}
.ma-empty .ico .lucide {
  width: 22px;
  height: 22px;
  color: var(--text-3);
}
.ma-empty.err .ico {
  border-color: var(--risk-border);
}
.ma-empty.err .ico .lucide {
  color: var(--risk);
}
.ma-empty b {
  font-size: 14.5px;
  color: var(--text-1);
}
.ma-empty small {
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 280px;
  line-height: 1.5;
}
.ma-empty .ma-btn {
  margin-top: 12px;
}

/* Спиннер подгрузки */
.ma-more {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}
.ma-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--brand-magenta);
  animation: ma-rot 0.7s linear infinite;
}
@keyframes ma-rot {
  to {
    transform: rotate(360deg);
  }
}

/* Разное */
.ma-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ma-foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 16px;
}
.ma-foot .ma-mono {
  font-size: 11px;
  color: var(--text-2);
}
a.ma-link {
  color: var(--brand-magenta);
  text-decoration: none;
}

/* ── Сессия устарела (401): перекрывает фрейм, блокирует взаимодействие ── */
.ma-session {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 9, 13, 0.86);
  backdrop-filter: blur(12px);
}
