/* Nova modal styles */
.nv-modal .nv-modal-content{
	background: linear-gradient(180deg, rgba(20,20,32,.96), rgba(10,10,16,.96));
	border: 1px solid rgba(124,58,237,.25);
	border-radius: 18px;
	box-shadow: 0 20px 60px rgba(0,0,0,.5);
	color: #e7e7f7;
}

/* removed generic .nv-thead styles to avoid conflicts with table layouts */

.nv-modal .nv-modal-header{
	display:flex;align-items:center;justify-content:space-between;
	padding:16px 20px;border-bottom:1px solid rgba(255,255,255,.06);
}
.nv-modal .nv-modal-title{font-weight:600;letter-spacing:0.2px;display:flex;gap:10px;align-items:center}
.nv-modal .nv-modal-title i{color:#8b5cf6}
.nv-modal .nv-modal-close{appearance:none;border:0;background:transparent;color:#cfcfee;font-size:22px;line-height:1;cursor:pointer;opacity:.7}
.nv-modal .nv-modal-close:hover{opacity:1}
.nv-modal .nv-modal-body{padding:18px 20px}
.nv-modal .nv-modal-footer{display:flex;justify-content:flex-end;gap:12px;padding:16px 20px;border-top:1px solid rgba(255,255,255,.06)}

/* Nova form controls */
.nv-field{margin-bottom:14px}
.nv-label{display:block;margin-bottom:8px;color:#c7c7dd;font-size:14px}
.nv-input{width:100%;padding:12px 14px;border-radius:12px;background:#121222;color:#eaeaf9;border:1px solid rgba(255,255,255,.08)}
.nv-input:focus, .nv-select:focus, .nv-textarea:focus, .nv-cselect-trigger:focus {outline:none;border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(139,92,246,.2)}

/* Nova buttons */
.nv-btn-primary{background:linear-gradient(135deg,#7c3aed,#22d3ee);color:#fff;border:0;border-radius:12px;padding:10px 16px;font-weight:600}
.nv-btn-primary:hover{filter:brightness(1.06)}
.nv-btn-ghost{background:transparent;color:#cfcfee;border:1px solid rgba(255,255,255,.14);border-radius:12px;padding:10px 16px}
.nv-btn-ghost:hover{border-color:#8b5cf6;color:#fff}

/* Iframe wrapper */
.nv-iframe{background:#0c0c14}
.modal-backdrop{background:rgba(5,6,10,.72)!important;}
.modal-backdrop.show{opacity:1!important}
/* Блокировка скролла для body, когда открыты модальные окна */
body.no-scroll { overflow: hidden; touch-action: none; overscroll-behavior: contain; }
/* Raise z-index to stay above sticky header (header z-index ~1030) */
.token-modal { display:none; position: fixed; inset: 0; z-index: 2000; opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility .28s ease; align-items: center; justify-content: center; }
.token-modal .token-modal-backdrop { position:absolute; inset:0; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); opacity: 0; transition: opacity .28s ease; }
/* Unified modal scrollbar styles are provided by nova/css/modal.css */
.token-modal .token-modal-content { position: relative; z-index:1; width: 100%; max-width: 540px; max-height: 85vh; margin: 0 auto; background: linear-gradient(180deg, rgba(18,18,28,.92), rgba(10,10,16,.92)); border:1px solid rgba(139,92,246,.28); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); transform: translateY(16px) scale(.96); transition: transform .28s ease; }
.token-modal-header { display:flex; align-items:center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--nv-border); }
.token-modal-title { display:flex; align-items:center; gap: 10px; font-weight: 700; }
	/* Modal scrollbar styles centralized in nova/css/modal.css */
/* Close button base + hover */
/* Make token-modal close button consistent with other Nova modals */
.token-modal-close{ appearance:none; border:0; background:transparent; color:#cfcfee; font-size:22px; line-height:1; cursor:pointer; opacity:.7; transition: opacity .18s ease, color .18s ease; }
.token-modal-close:hover{ opacity:1; color:#fff; }
.token-modal-close:focus{ outline:none; box-shadow: 0 0 0 3px rgba(139,92,246,.25); border-radius:10px; }
/* Show state */
.token-modal.active { display:flex; opacity: 1; visibility: visible; }
.token-modal.active .token-modal-backdrop{ opacity: 1; }
.token-modal.active .token-modal-content{ transform: translateY(0) scale(1); }
/* Состояние закрытия: обратная анимация */
.token-modal.closing { opacity: 0; visibility: hidden; }
/* Ensure content animates back on close when both active+closing classes present */
.token-modal.closing .token-modal-content{ transform: translateY(16px) scale(.96); }
.token-modal.closing .token-modal-backdrop{ opacity: 0; }
	/* removed: track styles moved to nova/css/modal.css */
body.modal-open { overflow: hidden; }

/* Token modal body and section layouts */
.token-modal-body{ padding: 12px 16px 16px; max-height: calc(85vh - 58px); overflow: auto; position: relative; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
	/* removed: thumb styles moved to nova/css/modal.css */
.token-search-container{ position: sticky; z-index: 5; background: linear-gradient(180deg, rgba(18,18,28,.96) 60%, rgba(18,18,28,0)); }
.token-search-input-wrapper{ display:flex; align-items:center; gap:8px; background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:10px 12px; }
.token-search-input{ flex:1; background: transparent; border: none; color: #fff; outline: none; font-size: 14px; min-width: 0; }
.token-search-input:focus{ outline:none; }
.token-search-input::placeholder{ color: rgba(255,255,255,.55); }
.token-search-input-wrapper .search-icon{ color: rgba(255,255,255,.6); }
.search-clear{ display:flex; align-items:center; justify-content:center; width: 28px; height: 28px; margin-left: 6px; border: none; background: transparent; color: rgba(255,255,255,.75); border-radius: 8px; cursor: pointer; }
.search-clear:hover{ background: rgba(255,255,255,.08); color: #fff; }
	/* removed: hover styles moved to nova/css/modal.css */
.popular-tokens-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.popular-token-card{ display:flex; align-items:center; gap:8px; background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius: 12px; padding:10px; cursor:pointer; transition: transform .12s ease, border-color .15s ease }
.popular-token-card:hover{ transform: translateY(-1px); border-color:#8b5cf6 }
.popular-token-card .token-logo img{ width:24px; height:24px; border-radius:50% }

    /* removed specific widths; unified width is 5px in nova/css/modal.css */
.section-header{ display:flex; align-items:center; justify-content: space-between; margin: 8px 0 10px; padding: 0 7px; min-height: 32px; }
/* Увеличенные отступы только для секций Nova */
.popular-tokens-section .section-header, .tokens-display-section .section-header{ margin: 20px 0 10px; }
/* input scrollbars unchanged here; modal scrollbars unified elsewhere */
.token-count-badge{ background:#8b5cf6; color:#fff; font-size:12px; border-radius:10px; padding:2px 8px }

.tokens-container{ display:flex; flex-direction:column; gap:8px }
.token-item{ display:grid; grid-template-columns: 40px minmax(0,1fr) auto; gap:10px; align-items:center; background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:10px; cursor:pointer; min-height: 56px; }
.token-item__icon{ width:28px; height:28px; border-radius:50% }
.token-item__network-icon{ position:absolute; right:-4px; bottom:-4px; background:#0ea5e9; color:#fff; font-size:10px; border-radius:999px; padding:0 4px; border:2px solid rgba(10,10,16,1) }
.token-item__icon-wrap{ position:relative; display:flex; align-items:center; justify-content:center }
.token-item__title{ font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.token-item__subtitle{ color: var(--nv-text-2); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.token-item__info{ min-width:0 }
.token-item__usd-value{ color: var(--nv-text-2); font-weight:600; justify-self:end; text-align:right; white-space:nowrap; margin-left:12px }

/* Expand per token networks */
.token-networks-expand{ background: rgba(255,255,255,.02); border:1px dashed rgba(255,255,255,.08); border-radius:12px; padding:10px; margin: -6px 0 2px; overflow: hidden; max-height: 0; opacity: 0; transition: max-height .25s ease, opacity .18s ease; display: none; }
.token-networks-expand.open{ display:block; max-height: var(--exp-h, 1200px); opacity: 1; }
.network-balance-item{ display:flex; justify-content: space-between; align-items:center; padding:8px 6px; border-radius:10px }
.network-item{ display:flex; align-items:center; gap:8px; cursor:pointer }	
.network-item .network-icon{ width:18px; height:18px; border-radius:50% }

/* Keyboard focus & a11y visuals */
.token-item:focus{ outline: 2px solid rgba(139,92,246,.6); outline-offset: 2px; }
.token-item.kbd-focus{ box-shadow: 0 0 0 2px rgba(139,92,246,.6) inset; }
.network-item:focus{ outline: 2px solid rgba(34,211,238,.6); outline-offset: 2px; border-radius: 8px; }
.selector-option:focus{ outline: 2px solid rgba(139,92,246,.6); outline-offset: 2px; }
.popular-network-option:focus{ outline: 2px solid rgba(139,92,246,.6); outline-offset: 2px; border-radius: 10px; }

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce){
	.popular-tokens-section,
	.token-item,
	.popular-token-card,
	.no-tokens-message,
	.no-tokens-found{
		transition: none !important;
		animation: none !important;
	}
}

/* Smooth show/hide for token items in search */
.tokens-container .token-item{ transition: opacity .18s ease, transform .18s ease; will-change: opacity, transform; }
.tokens-container .token-item.anim-out{ opacity: 0; transform: translateY(4px); }
.tokens-container .token-item.anim-in{ opacity: 1; transform: none; }

/* No results helper */
.no-tokens-found{ margin: 8px 0 0; padding: 12px; color: var(--nv-text-2); text-align: center; border: 1px dashed var(--nv-border); border-radius: 12px; display:none; }

/* Inline networks modal */
.token-networks-modal .modal-content{ width:100%; max-width:520px; margin: 10vh auto; background: rgba(18,18,28,.96); border:1px solid rgba(139,92,246,.28); border-radius:16px; overflow:hidden }
.token-networks-modal .modal-header{ display:flex; align-items:center; justify-content: space-between; padding: 12px 16px; border-bottom:1px solid rgba(255,255,255,.06) }
.token-networks-modal .modal-body{ padding: 12px 16px; }
.network-item.disabled{ opacity:.45; pointer-events:none; cursor:not-allowed }
.networks-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px }
.networks-grid .network-item{ background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:10px }

/* Network selector header and dropdown inside modal */
/* На Nova скрываем селектор сетей (оставим только в Bitflow для уникальности) */
.network-selector-container{ display: none !important; }
.network-selector-container{ padding: 0 18px; margin-bottom: 8px }
.selector-trigger{ display:flex; align-items:center; justify-content: space-between; gap:10px; background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:10px; cursor:pointer }
.trigger-content{ display:flex; align-items:center; gap:10px }
.trigger-icons{ display:flex; align-items:center; gap:6px }
.network-icons-stack{ position:relative; width:48px; height:20px }
.network-icons-stack .stack-icon{ position:absolute; width:18px; height:18px; border-radius:50%; object-fit:cover; box-shadow:0 2px 6px rgba(0,0,0,.25) }
.network-icons-stack .icon-1{ left:0; z-index:3 }
.network-icons-stack .icon-2{ left:12px; z-index:2 }
.network-icons-stack .icon-3{ left:24px; z-index:1 }
.network-icons-stack .stack-count{ position:absolute; left:38px; top:2px; font-size:11px; color: var(--nv-text-2) }
.selector-dropdown{ margin-top:6px; background: rgba(0,0,0,.5); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:10px }
.selector-dropdown .selector-search{ position:relative; }
.selector-dropdown .selector-search input{ width:100%; padding:8px 30px 8px 30px; background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); border-radius:10px; color:#fff }
.selector-dropdown .selector-search i{ position:absolute; left:10px; top:50%; transform: translateY(-50%); color: rgba(255,255,255,.6) }
.selector-options{ display:flex; flex-direction:column; max-height:220px; overflow:auto }
.selector-option{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; cursor:pointer; color:#fff }
.selector-option .option-icon{ width:18px; height:18px; border-radius:50% }
.selector-option:hover{ background: rgba(255,255,255,.08) }

/* Pretty scrollbars moved to nova/css/modal.css */

@media (max-width: 576px){
	/* Учитываем iPhone safe-area и используем dvh для устойчивой высоты */
	.token-modal{ padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
	.token-modal .token-modal-content{
		max-width: 94vw;
		margin: 0 auto;
		max-height: min(86dvh, 720px);
	}
	.token-modal-body{ max-height: calc(min(86dvh, 720px) - 58px); }
	.token-search-input{ font-size: 15px; }
	.token-item{ padding: 12px; grid-template-columns: 40px minmax(0,1fr) auto; gap: 10px; }
	.token-item__title{ font-size: 15px; }
	.token-item__subtitle{ font-size: 12px; opacity: .85; }
	.token-item__usd-value{ font-size: 13px; }
	.network-balance-item{ padding: 10px 8px; }
	.network-item{ padding: 6px 4px; gap: 10px; }
	.popular-tokens-grid{ grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.popular-token-card{ padding: 12px; }
	/* Mobile scrollbar width now unified in nova/css/modal.css */
}

/* Deposit modal */
.nv-dep-grid{ display:grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr); gap: 18px; align-items: start; }
/* When left side (QR/requisites) is hidden, collapse to single column to avoid empty space */
.nv-dep-grid.nv-dep-single{ grid-template-columns: 1fr; }
@media (max-width: 992px){ .nv-dep-grid{ grid-template-columns: 1fr; } }
	.nv-dep-summary .nv-dep-line{ .nv-dep-summary .nv-dep-line {
		display: flex;
		gap: 10px;
		margin-bottom: 12px;
		min-width: 0;
		flex-direction: column;
	}
}
@media (max-width: 576px){
	.nv-dep-summary .nv-dep-line{ grid-template-columns: 1fr; align-items: stretch; }
	.nv-dep-label{ margin-bottom:6px; }
}
.nv-dep-label{ color:#c7c7dd; font-size:14px }
.nv-dep-value{ 
	display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    margin-top: 10px;
    margin-bottom: 15px; 
}
.nv-input-affix{ position: relative; flex: 1 1 auto; min-width: 0; }
.nv-input.affixed{ padding-right: 64px; }
.nv-input-suffix{ position:absolute; right:8px; top:50%; transform: translateY(-50%); background: rgba(255,255,255,.06); color:#fff; border:1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 4px 8px; font-weight: 700; font-size: 12px; line-height: 1; pointer-events: none; max-width: 56px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-dep-value .nv-input{ flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.nv-dep-value .nv-input::-webkit-scrollbar{ height: 8px }
.nv-dep-value .nv-input::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.18); border-radius: 8px }

/* Срединное сокращение адреса: теперь показываем укороченный текст прямо в value, а полный адрес — в data-full и title */
.nv-input.mid-ellipsis{ position: relative; color: inherit; caret-color: auto; }
.nv-input.mid-ellipsis::before{ content: none; }
.nv-input.mid-ellipsis::placeholder{ color: inherit; }
.nv-dep-qr{ display:flex; align-items:center; justify-content:center; background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 14px; margin-top: 6px; }
.nv-dep-qr-canvas{ width: clamp(140px, 36vw, 220px); height: clamp(140px, 36vw, 220px); }
.nv-copy-btn{ padding: 10px 12px }
.nv-dep-hint{ display:flex; gap:10px; align-items:center; color:#c7c7dd; font-size: 13px; margin-top: 10px; }
.nv-dep-hint .nv-asset-logo, .nv-dep-hint .nv-chain-logo{ width:18px; height:18px; border-radius:50%; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.nv-dep-expire{ display:flex; gap:10px; align-items:center; color:#e7e7f7; font-weight:600; margin-top: 8px; }
.nv-dep-info{ background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:12px }
.nv-dep-info-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 0; border-bottom:1px dashed rgba(255,255,255,.06) }
.nv-dep-info-row:last-child{ border-bottom:none }
.nv-dep-actions{ display:flex; gap:10px; margin-top: 12px; justify-content: flex-end }

/* Значения в правом блоке: не даём им расталкивать лэйаут, обрезаем с троеточием */
.nv-dep-info-row .nv-k{ flex: 0 0 auto; }
.nv-dep-info-row .nv-v{ flex: 1 1 auto; min-width: 0; display:flex; align-items:center; justify-content: flex-end; }
/* Сам текст внутри значения может быть в span — его и обрезаем */
.nv-dep-info-row .nv-v > span{ min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Иконка токена рядом с текстом */
.nv-dep-info-row .nv-v .nv-asset-logo{ flex: 0 0 auto; }

.nv-dep-summary {
    margin-bottom: 15px;
}
/* Copy success highlight */
.nv-copy-btn.copied{ border-color: rgba(34,211,238,.6); background: rgba(34,211,238,.08); box-shadow: 0 0 0 3px rgba(34,211,238,.16); color: #e0fbff; }
.nv-input.copied{ animation: nvFlash 900ms ease; border-color: rgba(139,92,246,.8) !important; box-shadow: 0 0 0 3px rgba(139,92,246,.2) !important; }
@keyframes nvFlash{ 0%{ filter: brightness(1); } 40%{ filter: brightness(1.25); } 100%{ filter: brightness(1); } }
