.nv {
  --nv-ink: var(--ink, #182d34);
  --nv-muted: var(--muted, #586d74);
  --nv-accent: var(--blue, var(--accent, #2454d7));
  --nv-line: #e0e6e7;
  --nv-wash: #f3f6fb;
  color: var(--nv-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  min-width: 0;
}
.nv *, .nv *::before, .nv *::after { box-sizing: border-box; }
.nv [hidden] { display: none !important; }
.nv h2, .nv h3, .nv p { margin: 0; }
.nv h2 { font: inherit; font-size: 20px; font-weight: 650; line-height: 1.35; letter-spacing: -.025em; }
.nv h3 { font: inherit; font-size: 15px; font-weight: 650; line-height: 1.45; letter-spacing: -.015em; }
.nv svg { flex: none; vertical-align: middle; }
.nv p { text-wrap: pretty; }
.nv button, .nv input, .nv select, .nv textarea { font: inherit; }
.nv button, .nv a.nv-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 14px; border: 1px solid var(--nv-line);
  border-radius: 8px; background: white; color: var(--nv-ink);
  font-size: 13px; font-weight: 600; line-height: 1.4;
  cursor: pointer; touch-action: manipulation; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.nv button:hover { background: #f5f7fa; border-color: #acbbc9; }
.nv button:disabled { cursor: wait; opacity: .55; }
.nv .nv-primary { background: var(--nv-accent); border-color: var(--nv-accent); color: white; }
.nv .nv-primary:hover { background: #1c43b4; border-color: #1c43b4; color: white; }
.nv .nv-secondary { background: #f1f5ff; color: var(--nv-accent); border-color: transparent; }
.nv .nv-secondary:hover { background: #e5edff; border-color: transparent; }
.nv .nv-quiet, .nv .nv-text-button { border-color: transparent; background: transparent; color: var(--nv-muted); }
.nv .nv-quiet:hover, .nv .nv-text-button:hover { background: #edf2f7; color: var(--nv-ink); border-color: transparent; }
.nv .nv-danger { color: #a52a39; }
.nv .nv-danger-solid { background: #ae2739; color: #fff; border-color: #ae2739; }
.nv .nv-danger-solid:hover { background: #8f1f2d; border-color: #8f1f2d; }
.nv :focus-visible { outline: 3px solid #86a7ff; outline-offset: 3px; }
.nv input, .nv textarea, .nv select { color: var(--nv-ink); background: #fff; accent-color: var(--nv-accent); }
.nv input:not([type=checkbox]):not([type=radio]), .nv textarea, .nv select {
  display: block; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
  border: 1px solid #bcc8cc; border-radius: 8px; font-weight: 400; line-height: 1.5;
}
.nv input::placeholder, .nv textarea::placeholder { color: #77858c; opacity: 1; }
.nv input[type=checkbox], .nv input[type=radio] { width: 18px; height: 18px; flex: none; margin: 0; }
.nv textarea { resize: vertical; }
.nv input:disabled, .nv select:disabled, .nv textarea:disabled { background: #f6f7f8; color: var(--nv-muted); }
.nv-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 32px; }
.nv-tabs { display: inline-flex; gap: 3px; padding: 4px; border-radius: 10px; background: #eff2f5; min-width: 0; }
.nv-tabs button { min-height: 38px; padding: 8px 15px; background: transparent; border-color: transparent; font-weight: 500; color: var(--nv-muted); border-radius: 7px; }
.nv-tabs button[aria-selected=true] { background: #fff; color: var(--nv-ink); box-shadow: 0 1px 3px #122b3a14; font-weight: 650; }
.nv-top > .nv-primary { flex-shrink: 0; }
.nv-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.nv-section-heading p { color: var(--nv-muted); margin-top: 7px; font-size: 13px; max-width: 64ch; }
.nv-count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding-inline: 6px; border-radius: 7px; background: #eff2f5; color: var(--nv-muted); font-size: 13px; font-weight: 550; vertical-align: middle; margin-left: 6px; font-variant-numeric: tabular-nums; }
.nv-recipients { border: 1px solid var(--nv-line); border-radius: 12px; background: #fff; }
.nv-recipient { display: grid; grid-template-columns: 44px minmax(100px,1fr) auto; align-items: start; gap: 16px; padding: 24px; }
.nv-recipient + .nv-recipient { border-top: 1px solid var(--nv-line); }
.nv-channel-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 11px; background: #eef3ff; color: #2454d7; flex: none; }
.nv-channel-icon.is-telegram { background: #eaf5fc; color: #1373a7; }
.nv-channel-icon.is-max { background: #f0edfd; color: #6443b8; }
.nv-channel-icon svg { width: 23px; height: 23px; }
.nv-recipient-info { min-width: 0; }
.nv-recipient-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.nv-recipient h3, .nv-address { overflow-wrap: anywhere; }
.nv-channel-name { color: var(--nv-muted); font-size: 12px; }
.nv .nv-address { color: var(--nv-muted); margin-top: 3px; font-size: 13px; }
.nv-state { display: inline-flex; align-items: center; gap: 4px; color: #65747b; font-size: 12px; font-weight: 500; margin-top: 8px; }
.nv-state svg { width: 15px; height: 15px; }
.nv-state.is-connected { color: #1c7451; }
.nv-state.is-pending, .nv-state.is-attention { color: #966015; }
.nv-recipient-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 8px; padding-top: 1px; }
.nv-recipient-actions button svg { width: 16px; height: 16px; }
.nv-helper, .nv small { display: block; color: var(--nv-muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.nv .nv-helper { margin-top: 8px; }
.nv .nv-helper:empty { display: none; }
.nv-row-result { margin-top: 10px !important; color: #285d49; font-size: 12px; max-width: 60ch; }
.nv .is-error { color: #a3283b; }
.nv-feedback { background: #edf7f2; color: #265a47; border-radius: 8px; padding: 13px 16px; margin-bottom: 20px !important; overflow-wrap: anywhere; }
.nv-feedback.is-error { background: #fff0f1; color: #a3283b; }
.nv-mode { background: #fff5e5; color: #77511c; border-radius: 8px; padding: 12px 16px; margin-bottom: 22px !important; font-size: 13px; }
.nv-attention { margin-bottom: 20px; padding: 18px 20px; border-radius: 9px; background: #fff5e8; color: #765015; }
.nv-attention p { margin-top: 6px; font-size: 13px; }
.nv-empty { display: grid; justify-items: center; padding: 52px 24px 58px; text-align: center; }
.nv-empty-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; color: #4065ae; background: #eff4ff; margin-bottom: 20px; }
.nv-empty h3 { font-size: 18px; margin-bottom: 9px; }
.nv-empty p { max-width: 48ch; color: var(--nv-muted); font-size: 13px; }
.nv-form { display: grid; gap: 20px; min-width: 0; }
.nv-label { display: grid; gap: 8px; font-size: 13px; font-weight: 550; min-width: 0; }
.nv-label small { margin-top: -2px; }
.nv-fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.nv-fieldset > legend { font-size: 14px; font-weight: 650; margin-bottom: 15px; padding: 0; }
.nv-choice, .nv-check { display: flex; align-items: flex-start; gap: 11px; min-height: 44px; cursor: pointer; font-size: 13px; }
.nv-choice { padding: 12px 0; }
.nv-choice strong { font-size: 14px; font-weight: 550; }
.nv-choice small { margin-top: 3px; max-width: 45ch; }
.nv-choice input, .nv-check input { margin-top: 2px; }
.nv-check { align-items: center; padding-block: 7px; }
.nv-check small { margin-top: 3px; }
.nv-field-choices { margin-top: 16px; padding: 16px 20px; background: #f6f8fa; border-radius: 9px; }
.nv-message-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px, .85fr); gap: clamp(28px,5vw,72px); align-items: start; }
.nv-preview { padding: 22px; border-radius: 12px; background: #edf2f8; }
.nv-preview-label { font-size: 12px; color: var(--nv-muted); margin-bottom: 14px !important; }
.nv-preview-message { background: white; padding: 22px; border-radius: 10px 10px 10px 2px; font-size: 13px; overflow-wrap: anywhere; }
.nv-preview-message > strong { font-weight: 650; font-size: 15px; }
.nv-preview-message p { margin-top: 15px; }
.nv-preview-message p span { display: block; color: var(--nv-muted); font-size: 11px; margin-bottom: 2px; }
.nv-preview-link { display: block; color: var(--nv-accent); margin-top: 20px; }
.nv-settings-section + .nv-settings-section { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--nv-line); }
.nv-settings-section > p { margin-top: 9px; max-width: 70ch; color: var(--nv-muted); font-size: 13px; }
.nv-settings-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 24px; }
.nv-number { max-width: 330px; margin-top: 24px; }
.nv-number input { max-width: 140px; font-variant-numeric: tabular-nums; }
.nv-save { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.nv-save span { font-size: 12px; color: var(--nv-muted); }
.nv-loading, .nv-unavailable { padding: 32px 0; }
.nv-unavailable p { margin-top: 12px; max-width: 60ch; }
.nv-unavailable button { margin-top: 22px; }
.nv-dialog {
  width: min(560px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto;
  padding: 28px; border: 0; border-radius: 16px; background: #fff; color: var(--nv-ink);
  box-shadow: 0 24px 90px #122b3a33; font: inherit; overscroll-behavior: contain;
}
.nv-dialog::backdrop { background: #10202e66; }
.nv-dialog-heading { display: flex; align-items: flex-start; gap: 18px; justify-content: space-between; margin-bottom: 24px; }
.nv-dialog-heading h2 { font-size: 23px; line-height: 1.3; font-weight: 650; }
.nv-dialog-heading p { margin-top: 10px; color: var(--nv-muted); font-size: 13px; }
.nv .nv-icon-button { flex: none; width: 38px; min-height: 38px; padding: 8px; background: #f3f5f7; border-color: transparent; border-radius: 50%; }
.nv-channel-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 0; margin: 0; border: 0; min-width: 0; }
.nv-channel-picker legend { font-size: 13px; font-weight: 550; margin-bottom: 10px; }
.nv-channel-picker label { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 54px; border: 1px solid var(--nv-line); border-radius: 9px; cursor: pointer; font-size: 13px; }
.nv-channel-picker label:has(:checked) { color: var(--nv-accent); background: #f1f5ff; border-color: var(--nv-accent); }
.nv-channel-picker label:has(:focus-visible) { outline: 3px solid #86a7ff; outline-offset: 3px; }
.nv-channel-picker input { position: absolute; inset: 0; z-index: 1; width: 100% !important; height: 100% !important; margin: 0; opacity: 0; cursor: pointer; }
.nv-dialog-footer { display: flex; justify-content: end; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.nv-dialog-footer button { min-height: 44px; }
.nv-edit-channel { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.nv-edit-channel .nv-channel-icon { width: 36px; height: 36px; border-radius: 9px; }
.nv-edit-extra { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; padding-top: 10px; border-top: 1px solid var(--nv-line); }
.nv-edit-extra .nv-text-button { padding-inline: 0; font-size: 12px; }
.nv-enable { padding-top: 6px; }
.nv-discard { margin-top: 22px; padding: 16px; border-radius: 9px; background: #fff5e8; }
.nv-discard p { margin-bottom: 12px; font-size: 13px; }
.nv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nv-connection-address { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--nv-wash); border-radius: 9px; overflow-wrap: anywhere; }
.nv-connection-address strong { min-width: 0; }
.nv-steps { display: grid; gap: 10px; padding-left: 22px; margin: 24px 0 16px; }
.nv-dialog > .nv-feedback { margin-top: 20px; }
.nv-bot-connect { display: grid; grid-template-columns: minmax(0,1fr) 120px; align-items: center; gap: 20px; margin-bottom: 24px; }
.nv-qr { width: 120px; background: #fff; }
.nv-qr svg { width: 100%; height: auto; }
.nv-copy { display: flex; gap: 8px; }
.nv-copy input { font-size: 12px !important; }
.nv-copy button { padding-inline: 10px; }
.nv-candidate { display: grid; gap: 12px; margin-top: 24px; padding: 18px; border-radius: 9px; background: var(--nv-wash); font-size: 13px; }
.nv-candidate strong { font-size: 17px; overflow-wrap: anywhere; }
.nv-dialog .nv-feedback { font-size: 13px; }
@media (max-width: 1000px) {
  .nv-recipient { grid-template-columns: 40px minmax(0,1fr); gap: 12px; padding: 20px; }
  .nv-recipient-actions { grid-column: 2; justify-content: start; padding-top: 3px; }
  .nv-top { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .nv { font-size: 14px; }
  .nv input:not([type=checkbox]):not([type=radio]), .nv textarea, .nv select { font-size: 16px; }
  .nv-top { gap: 18px; margin-bottom: 26px; flex-direction: column-reverse; align-items: stretch; }
  .nv-top > .nv-primary { align-self: start; }
  .nv-tabs { width: 100%; }
  .nv-tabs button { flex: 1; padding-inline: 8px; font-size: 12px; }
  .nv-section-heading { gap: 8px; margin-bottom: 18px; }
  .nv-section-heading h2 { font-size: 19px; }
  .nv-section-heading .nv-quiet { padding-inline: 6px; font-size: 12px; }
  .nv-section-heading .nv-quiet svg { display: none; }
  .nv-recipient { padding: 18px 14px; grid-template-columns: 34px minmax(0,1fr); gap: 11px; }
  .nv-channel-icon { width: 34px; height: 34px; border-radius: 9px; }
  .nv-channel-icon svg { width: 20px; height: 20px; }
  .nv-recipient h3 { font-size: 14px; }
  .nv-recipient-title { display: block; }
  .nv-channel-name { display: none; }
  .nv-recipient-actions { grid-column: 1/-1; padding-top: 8px; gap: 8px; }
  .nv-recipient-actions button { flex: 1; min-height: 44px; font-size: 12px; padding-inline: 9px; }
  .nv-empty { padding: 36px 18px; }
  .nv-empty h3 { font-size: 16px; }
  .nv-empty p { font-size: 12px; }
  .nv-message-layout, .nv-settings-grid { grid-template-columns: 1fr; gap: 20px; }
  .nv-preview { padding: 18px; }
  .nv-settings-section h2 { font-size: 19px; }
  .nv-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 22px 18px; border-radius: 13px; }
  .nv-dialog-heading { gap: 10px; }
  .nv-dialog-heading h2 { font-size: 20px; }
  .nv-channel-picker { gap: 6px; }
  .nv-channel-picker label { flex-direction: column; gap: 5px; padding: 10px 4px; font-size: 12px; }
  .nv-dialog-footer { display: grid; grid-template-columns: 1fr; }
  .nv-dialog-footer .nv-primary, .nv-dialog-footer .nv-danger-solid { grid-row: 1; }
  .nv-bot-connect { grid-template-columns: 1fr; gap: 16px; }
  .nv-qr { margin: 0 auto; }
  .nv-copy { flex-wrap: wrap; }
  .nv-copy input { flex: 1 1 100%; }
  .nv-copy button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .nv button, .nv a { transition: none; } }
