:root {
  --bg: #0f121a;
  --card: #1a1f2e;
  --accent: #00d4ff;
  --accent-dark: #00a0cc;
  --text: #e0e7ff;
  --text-muted: #94a3b8;
  --border: #334155;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 16px;
  line-height: 1.5;
}

/* Кнопка «?» справа вверху — справка / безопасность */
.multisend-help-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: background .2s, color .2s, border-color .2s;
}
.multisend-help-btn:hover {
  background: var(--accent);
  color: #0f121a;
  border-color: var(--accent);
}
.multisend-help-btn .multisend-help-btn-char {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

@media (min-width: 1024px) {
  .container { grid-template-columns: 320px 1fr 380px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

h1, h2, h3 { font-weight: 600; margin-bottom: 1rem; }
h2 { color: var(--accent); }

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}

/* Сид-фраза: блюр, когда не в фокусе и мышь не над полем */
.seed-input-wrap { position: relative; }
#seed.seed-blurred {
  filter: blur(6px);
  transition: filter 0.2s ease;
}
#seed:not(.seed-blurred) {
  filter: none;
}

/* Фиксированный размер полей — без изменения размера пользователем */
#seed,
textarea.message {
  resize: none;
  min-height: 0;
}
#seed { min-height: 7em; }
textarea.message { height: 110px; }

.message-wrapper { opacity: 0.5; pointer-events: none; transition: opacity .2s; }
.message-wrapper.message-enabled { opacity: 1; pointer-events: auto; }

.wallet-storage-note {
  display: none;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.wallet-storage-note.visible { display: block; }

/* Кошелёк: пустое состояние и ошибка с иконкой */
.wallet-address-box.wallet-address-empty {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  justify-content: center;
}
.wallet-address-box .wallet-placeholder-icon {
  width: 28px;
  height: 28px;
  opacity: 0.7;
}
.wallet-address-box .wallet-error-icon {
  flex-shrink: 0;
}

/* Модалка комиссии: блок суммы с иконкой */
.fee-amount-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.4rem;
  font-family: ui-monospace, monospace;
  margin: 20px 0;
}
.fee-amount-block .fee-amount-icon {
  width: 32px;
  height: 32px;
  color: var(--success);
}
.fee-approve-warning {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.fee-approve-warning .fee-warning-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Кастомное модальное окно (alert/confirm) */
.custom-modal-content { max-width: 400px; }
.custom-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.custom-modal-title-wrap .custom-modal-title-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.custom-modal-title-wrap.custom-modal-success .custom-modal-title-icon { color: var(--success); }
.custom-modal-title-wrap.custom-modal-error .custom-modal-title-icon { color: var(--danger); }
.custom-modal-title-wrap.custom-modal-info .custom-modal-title-icon { color: var(--accent); }
.custom-modal-body { margin: 16px 0; white-space: pre-wrap; word-break: break-word; }
.custom-modal-body.custom-modal-success { color: var(--success); }
.custom-modal-body.custom-modal-error { color: var(--danger); }
.custom-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
}
.custom-modal-actions .btn-secondary { margin-right: auto; }

#customModal .modal-content { pointer-events: auto; }
#customModal.modal.active { cursor: default; }

/* Модалка Excel: заголовок с иконкой */
.excel-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.excel-modal-title-wrap .excel-modal-title-icon { width: 24px; height: 24px; flex-shrink: 0; }
.excel-modal-title-wrap.excel-modal-success .excel-modal-title-icon { color: var(--success); }
.excel-modal-title-wrap.excel-modal-error .excel-modal-title-icon { color: var(--danger); }

.scroll-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11151f;
  margin: 8px 0;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #151b26; color: var(--text-muted); font-weight: 500; }
#recipients-table { table-layout: fixed; }
#recipients-table .num-col { width: 40px; text-align: center; }
#recipients-table .addr-col { width: auto; min-width: 0; }
#recipients-table .amount-col { width: 140px; max-width: 140px; text-align: right; font-family: ui-monospace, monospace; }
#recipients-table .amount-col input { box-sizing: border-box; max-width: 100%; }
#recipients-table .addr-col input { min-width: 0; text-align: right; direction: ltr; }
#recipients-table .btn-col { width: 52px; }
.amount-col { text-align: right; font-family: ui-monospace, monospace; }
.num-col { width: 40px; text-align: center; }

button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary  { background: var(--accent); color: #0f121a; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #334155; color: var(--text); }
.btn-secondary:hover { background: #475569; }
.btn-danger    { background: var(--danger); color: white; font-size: 0.9rem; padding: 6px 10px; }

.icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.icon-btn:hover { color: var(--accent); }

/* Кнопка удаления получателя — только красная иконка корзины (inline SVG), без фона */
#recipients-table .icon-btn.remove-row {
  padding: 4px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#recipients-table .icon-btn.remove-row:hover {
  color: #fca5a5;
}
#recipients-table .icon-btn.remove-row .remove-row-icon {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  margin: 16px 0;
  transition: .25s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.active { border-color: var(--accent); background: rgba(0,212,255,0.06); }

.file-info { margin-top: 12px; color: var(--text-muted); font-size: 0.9rem; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal.active { display: flex; }

.loader {
  border: 4px solid #334155;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.disabled { opacity: 0.5; pointer-events: none; }

/* Кошелёк: полный адрес + кнопка копирования */
.wallet-address-box {
  padding: 12px;
  background: #0d1117;
  border-radius: 8px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wallet-address-box .wallet-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.wallet-address-box .wallet-address-full {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0;
}
.wallet-address-box .wallet-copy-btn {
  flex-shrink: 0;
}
.wallet-address-box .wallet-check-icon {
  color: var(--success);
  flex-shrink: 0;
}

/* Подсказка в зоне загрузки */
.drop-zone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Кастомные скроллбары (поля ввода, списки, модалки, футер) */
.scroll-list,
.modal-content,
.multisend-footer,
textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--card);
}
.scroll-list::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.multisend-footer::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.scroll-list::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.multisend-footer::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
  background: var(--card);
  border-radius: 4px;
}
.scroll-list::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.multisend-footer::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.scroll-list::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.multisend-footer::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

.footer {
  margin-top: 40px;
  text-align: center;
  color: var(--text-muted);
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

/* Расширенный футер мультисенда */
.multisend-footer {
  text-align: left;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px 16px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.multisend-footer .footer-lead {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}
.multisend-footer .footer-section {
  margin-bottom: 16px;
}
.multisend-footer .footer-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.multisend-footer .footer-section p {
  margin: 4px 0;
}
.multisend-footer code {
  font-size: 0.8rem;
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}
.multisend-footer a {
  color: var(--accent);
  text-decoration: none;
}
.multisend-footer a:hover {
  text-decoration: underline;
}
.multisend-footer .footer-quote {
  margin-top: 20px;
  font-style: italic;
  color: var(--text-muted);
}
.multisend-footer .footer-sign {
  margin-top: 16px;
  color: var(--text-muted);
}
.multisend-footer .footer-sign strong {
  color: var(--text);
}

.multisend-tokens-section { display: none; }
.multisend-tokens-section.visible { display: block; }

.multisend-tokens-section h3 { margin: 1.6rem 0 0.8rem; }

.message-char-count { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.message-char-count.at-limit { color: var(--warning); }

@media (max-width: 1023px) {
  .container { grid-template-columns: 1fr; }
  .scroll-list { max-height: 220px; }
}

/* ——— Страница «Безопасность» мультисенда (та же тема) ——— */
.multisend-security-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px;
}
.multisend-security-page header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.multisend-security-page h1 {
  font-size: 1.75rem;
  margin-bottom: 10px;
  color: var(--accent);
}
.multisend-security-page header p {
  color: var(--text-muted);
}
.multisend-security-page .security-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.multisend-security-page .security-back:hover {
  text-decoration: underline;
}
.multisend-security-page .section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.multisend-security-page .section-card h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.multisend-security-page .section-card.checklist {
  border-left: 4px solid var(--success);
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.08) 0%, var(--card) 8%);
}
.multisend-security-page .section-card.warningbox {
  border-left: 4px solid var(--warning);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, var(--card) 8%);
}
.multisend-security-page .section-card.tipbox {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.08) 0%, var(--card) 8%);
}
.multisend-security-page .section-card.notice {
  border-left: 4px solid #6a8bff;
  background: linear-gradient(90deg, rgba(106, 139, 255, 0.08) 0%, var(--card) 8%);
}
.multisend-security-page ul, .multisend-security-page ol {
  padding-left: 24px;
  margin: 12px 0;
}
.multisend-security-page li {
  margin-bottom: 8px;
  color: var(--text);
}
.multisend-security-page a {
  color: var(--accent);
  text-decoration: none;
}
.multisend-security-page a:hover {
  text-decoration: underline;
}
.multisend-security-page footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.multisend-security-page footer a {
  color: var(--accent);
}
