/**
 * Header Tools CSS для BuyHold.ru
 * Версия 1.2 - Исправлены кнопки попапа
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* используем цветовые переменные темы, если они есть */
    --ht-accent: var(--accent-color, #95ce5a);
    --ht-accent-hover: var(--accent-hover, #78a93a);
    --ht-accent-light: rgba(149, 206, 90, 0.08);
    --ht-accent-border: rgba(149, 206, 90, 0.28);

    --ht-text: #2b2f33;
    --ht-text-muted: #6b7280;

    --ht-bg-light: #fcfcfc;
    --ht-bg-dark: #1e222d;
    --ht-border: #e5e5e5;

    --ht-radius: 10px;
    --ht-transition: 0.2s ease;
}

/* ============================================
   GLOBAL TEXT FIX - Prevent text doubling
   ============================================ */
html body .ht-popover button,
html body .ht-popover a,
html body .ht-popover [class*="btn"],
html body .ht-popover .ht-mini-fav,
html body .ht-dropdown a,
html body .ht-mobile-bar button,
html body .ht-mobile-bar a,
html body .ht-mobile-converter button,
html body .ht-mobile-converter a {
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    filter: none !important;
    text-rendering: optimizeLegibility !important;
}

/* Remove pseudo-element shadows from buttons */
html body .ht-popover button::before,
html body .ht-popover button::after,
html body .ht-popover [class*="btn"]::before,
html body .ht-popover [class*="btn"]::after,
html body .ht-mini-fav::before,
html body .ht-mini-fav::after {
    content: none !important;
    display: none !important;
    text-shadow: none !important;
}

/* Fix SVG icons doubling */
html body .ht-popover svg,
html body .ht-popover svg *,
html body .ht-dropdown svg,
html body .ht-dropdown svg * {
    filter: none !important;
    text-shadow: none !important;
}

/* ============================================
   DESKTOP: Header Tools Panel
   Мини-версия мегаменю: зелёная иконка в квадрате + подпись
   ============================================ */

/* Ничего не ломаем в хедере: фиксируем одну строку и правильное выравнивание */
html body .top-bar .top-bar-container {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 12px !important;
}

html body .top-bar .top-bar-container .top-bar-right {
    margin-left: auto !important;
}

/* Панель инструментов */
html body .top-bar .top-bar-container .ht-tools {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 0 0 10px !important;
    padding: 0 !important;
    position: relative !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

/* Элемент (ссылка/кнопка) — НЕ CTA: плоский, компактный */
html body .ht-tools .ht-tool {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 38px !important;
    padding: 0 10px !important;
    margin: 0 !important;

    color: var(--ht-text) !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: 'Roboto', Arial, sans-serif !important;

    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: var(--ht-radius) !important;

    cursor: pointer !important;
    transition: background var(--ht-transition), border-color var(--ht-transition), color var(--ht-transition) !important;

    line-height: 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Убираем системные стили кнопок (тени/объём) — важно, т.к. Конвертер и Ещё это <button> */
html body .ht-tools button.ht-tool,
html body .ht-tools button.ht-tool:active,
html body .ht-tools button.ht-tool:focus {
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    filter: none !important;
}

html body .ht-tools button.ht-tool:focus { outline: none !important; }

/* Доступный фокус только для клавиатуры */
html body .ht-tools .ht-tool:focus-visible {
    outline: 2px solid var(--ht-accent) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

/* Убираем прежнюю линию-подчёркивание (если есть) */
html body .ht-tools .ht-tool::after { content: none !important; }

/* Иконка в квадрате — как в мегаменю */
html body .ht-tools .ht-iconbox {
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
    background: var(--ht-accent) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    transition: background var(--ht-transition) !important;
}

html body .ht-tools .ht-tool-icon {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
}

/* Внутри зелёного квадрата иконка белая */
html body .ht-tools .ht-iconbox .ht-tool-icon,
html body .ht-tools .ht-iconbox svg {
    stroke: #fff !important;
    fill: none !important;
    stroke-width: 1.8 !important;
}

/* Hover — лёгкий фон и рамка, без «кнопочного» ощущения */
html body .ht-tools .ht-tool:hover {
    background: var(--ht-accent-light) !important;
    border-color: var(--ht-accent-border) !important;
    color: var(--ht-text) !important;
}

html body .ht-tools .ht-tool:hover .ht-iconbox {
    background: var(--ht-accent-hover) !important;
}

/* Active (открыт dropdown/popover) — аккуратный маркер */
html body .ht-tools .ht-tool.ht-active,
html body .ht-tools .ht-tool[aria-expanded="true"] {
    background: var(--ht-accent-light) !important;
    border-color: var(--ht-accent-border) !important;
    box-shadow: inset 0 -2px 0 var(--ht-accent) !important;
}

/* Текст */
html body .ht-tools .ht-tool .ht-tool-text { display: inline !important; }

/* Стрелка dropdown */
html body .ht-tools .ht-tool .ht-tool-arrow {
    width: 10px !important;
    height: 10px !important;
    margin-left: 2px !important;
    opacity: 0.65 !important;
    transition: transform var(--ht-transition), opacity var(--ht-transition) !important;
}

html body .ht-tools .ht-tool:hover .ht-tool-arrow { opacity: 1 !important; }

html body .ht-tools .ht-tool[aria-expanded="true"] .ht-tool-arrow {
    transform: rotate(180deg) !important;
    opacity: 1 !important;
}


/* ============================================
   POPOVER: Мини-конвертер
   ============================================ */
html body .ht-popover-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 998 !important;
    background: transparent !important;
    display: none !important;
}

html body .ht-popover-overlay.ht-open {
    display: block !important;
}

html body .ht-popover {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 0 !important;
    width: 400px !important;
    background: #1e222d !important;
    border-radius: 10px !important;
    border: 1px solid #2a2e39 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
    z-index: 1001 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.25s ease !important;
}

html body .ht-popover.ht-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Popover Header */
html body .ht-popover .ht-popover-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #2a2e39 !important;
}

html body .ht-popover .ht-popover-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 !important;
    text-shadow: none !important;
}

html body .ht-popover .ht-popover-close {
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #787b86 !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

html body .ht-popover .ht-popover-close:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

/* Popover Body */
html body .ht-popover .ht-popover-body {
    padding: 16px !important;
}

/* Mini Converter */
html body .ht-popover .ht-mini-converter {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

/* Input Row */
html body .ht-popover .ht-mini-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

html body .ht-popover .ht-mini-input-wrap {
    flex: 1 !important;
    position: relative !important;
}

html body .ht-popover .ht-mini-input {
    width: 100% !important;
    height: 46px !important;
    padding: 0 65px 0 14px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    background: #f5f5f0 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    box-sizing: border-box !important;
}

html body .ht-popover .ht-mini-input:focus {
    border-color: var(--ht-accent) !important;
    background: #fff !important;
}

html body .ht-popover .ht-mini-input::placeholder {
    color: #999 !important;
    font-weight: 400 !important;
}

/* Currency Badge */
html body .ht-popover .ht-mini-currency {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #555 !important;
    background: #e8e8e4 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-shadow: none !important;
}

html body .ht-popover .ht-mini-currency:hover {
    background: #ddd !important;
}

html body .ht-popover .ht-mini-flag {
    font-size: 14px !important;
    line-height: 1 !important;
}

/* Swap Button */
html body .ht-popover .ht-mini-swap {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #2a2e39 !important;
    border: none !important;
    border-radius: 50% !important;
    color: #d1d4dc !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

html body .ht-popover .ht-mini-swap:hover {
    background: var(--ht-accent) !important;
    color: #000 !important;
    transform: rotate(180deg) !important;
}

html body .ht-popover .ht-mini-swap svg {
    width: 16px !important;
    height: 16px !important;
}

/* Rate Info */
html body .ht-popover .ht-mini-rate {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px 0 !important;
    font-size: 12px !important;
    color: #787b86 !important;
    line-height: 1.6 !important;
}

html body .ht-popover .ht-mini-rate > span#ht-rate {
    color: #d1d4dc !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

html body .ht-popover #ht-rate-date {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 11px !important;
    color: #787b86 !important;
    margin-left: 8px !important;
}

html body .ht-popover #ht-rate-date::before {
    content: '' !important;
    display: inline-block !important;
    width: 12px !important;
    height: 12px !important;
    margin-right: 4px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23787b86' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
}

html body .ht-popover #ht-rate-source {
    font-size: 11px !important;
    color: #787b86 !important;
}

html body .ht-popover #ht-rate-source:not(:empty)::before {
    content: '·' !important;
    margin: 0 4px !important;
}

/* ============================================
   Favorites - FIXED BUTTONS
   ============================================ */
html body .ht-popover .ht-mini-favorites {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding-top: 10px !important;
    border-top: 1px solid #2a2e39 !important;
}

html body .ht-popover .ht-mini-fav {
    display: inline-flex !important;
    align-items: center !important;
    padding: 7px 12px !important;
    margin: 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    color: #9ca3b4 !important;
    background: #262b36 !important;
    border: 1px solid #2a2e39 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

html body .ht-popover .ht-mini-fav:hover {
    background: rgba(149, 206, 90, 0.15) !important;
    border-color: rgba(149, 206, 90, 0.3) !important;
    color: var(--ht-accent) !important;
}

/* ACTIVE: чёрный текст на зелёном фоне */
html body .ht-popover .ht-mini-fav.ht-active {
    background: var(--ht-accent) !important;
    border-color: var(--ht-accent) !important;
    color: #000 !important;
}

/* ============================================
   Action Buttons - FIXED
   ============================================ */
html body .ht-popover .ht-mini-actions {
    display: flex !important;
    gap: 10px !important;
    padding-top: 12px !important;
}

html body .ht-popover .ht-mini-btn {
    flex: 1 !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

html body .ht-popover .ht-mini-btn svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
}

/* Кнопка "Копировать" - обычное состояние */
html body .ht-popover .ht-mini-btn--copy {
    background: #262b36 !important;
    border: 1px solid #2a2e39 !important;
    color: #d1d4dc !important;
}

html body .ht-popover .ht-mini-btn--copy:hover {
    background: #2f3542 !important;
    border-color: rgba(149, 206, 90, 0.4) !important;
    color: #fff !important;
}

/* Кнопка "Копировать" - после копирования: чёрный текст */
html body .ht-popover .ht-mini-btn--copy.ht-copied {
    background: var(--ht-accent) !important;
    border-color: var(--ht-accent) !important;
    color: #000 !important;
}

/* Кнопка "Полная версия" - чёрный текст на зелёном */
html body .ht-popover .ht-mini-btn--full {
    background: var(--ht-accent) !important;
    border: none !important;
    color: #000 !important;
}

html body .ht-popover .ht-mini-btn--full:hover {
    background: var(--ht-accent-hover) !important;
    color: #000 !important;
}

/* Loading State */
html body .ht-popover .ht-mini-loading {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 50px 20px !important;
    color: #787b86 !important;
    font-size: 13px !important;
}

html body .ht-popover .ht-mini-loading::before {
    content: '' !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #2a2e39 !important;
    border-top-color: var(--ht-accent) !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    animation: ht-spin 0.8s linear infinite !important;
}

@keyframes ht-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   DROPDOWN: Меню "Ещё" (в стиле мегаменю)
   ============================================ */
html body .ht-dropdown {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    min-width: 260px !important;
    background: var(--ht-bg-dark) !important;
    border: 1px solid #2a2e39 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35) !important;
    z-index: 1001 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all var(--ht-transition) !important;
}

html body .ht-dropdown.ht-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

html body .ht-dropdown .ht-dropdown-section {
    padding: 10px 0 !important;
}

html body .ht-dropdown .ht-dropdown-label {
    padding: 8px 16px 6px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #9ca3b4 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    text-shadow: none !important;
}

html body .ht-dropdown .ht-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 16px !important;
    color: #d1d4dc !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: background var(--ht-transition), color var(--ht-transition) !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
}

html body .ht-dropdown .ht-dropdown-item:hover {
    background: rgba(255,255,255,0.06) !important;
    color: #ffffff !important;
}

html body .ht-dropdown .ht-dropdown-item svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

/* ============================================
   MOBILE: Bottom Navigation Bar
   ============================================ */
html body .ht-mobile-bar {
    display: none !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: #fff !important;
    border-top: 1px solid #e5e5e5 !important;
    z-index: 998 !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s ease !important;
    box-sizing: content-box !important;
}

html body .ht-mobile-bar.ht-visible {
    transform: translateY(0) !important;
}

html body .ht-mobile-bar .ht-mobile-bar-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    height: 60px !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

html body .ht-mobile-bar .ht-mobile-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    flex: 1 !important;
    height: 100% !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    -webkit-tap-highlight-color: transparent !important;
    padding: 0 !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
}

html body .ht-mobile-bar .ht-mobile-item:active,
html body .ht-mobile-bar .ht-mobile-item.ht-active {
    color: var(--ht-accent) !important;
}

html body .ht-mobile-bar .ht-mobile-item svg {
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* Mobile bar visible on small screens */
@media (max-width: 767px) {
    html body .ht-mobile-bar {
        display: block !important;
    }
    
    html body.ht-mobile-bar-active {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)) !important;
    }
}

/* ============================================
   MOBILE: Full-screen Converter
   ============================================ */
html body .ht-mobile-converter {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #1e222d !important;
    z-index: 1100 !important;
    display: none !important;
    flex-direction: column !important;
}

html body .ht-mobile-converter.ht-open {
    display: flex !important;
}

html body .ht-mobile-converter .ht-mobile-converter-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px !important;
    padding-top: calc(14px + env(safe-area-inset-top, 0)) !important;
    background: #262b36 !important;
    border-bottom: 1px solid #2a2e39 !important;
}

html body .ht-mobile-converter .ht-mobile-converter-title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #fff !important;
    text-shadow: none !important;
}

html body .ht-mobile-converter .ht-mobile-converter-close {
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #787b86 !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    padding: 0 !important;
}

html body .ht-mobile-converter .ht-mobile-converter-close:active {
    background: rgba(255,255,255,0.1) !important;
}

html body .ht-mobile-converter .ht-mobile-converter-body {
    flex: 1 !important;
    padding: 20px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

html body .ht-mobile-converter .ht-mobile-converter-footer {
    padding: 14px 16px !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0)) !important;
    border-top: 1px solid #2a2e39 !important;
}

/* Mobile converter uses same mini-converter styles */
html body .ht-mobile-converter .ht-mini-converter {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

html body .ht-mobile-converter .ht-mini-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

html body .ht-mobile-converter .ht-mini-input-wrap {
    flex: 1 !important;
    position: relative !important;
}

html body .ht-mobile-converter .ht-mini-input {
    width: 100% !important;
    height: 50px !important;
    padding: 0 70px 0 14px !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    background: #f5f5f0 !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    outline: none !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    box-sizing: border-box !important;
}

html body .ht-mobile-converter .ht-mini-input:focus {
    border-color: var(--ht-accent) !important;
    background: #fff !important;
}

html body .ht-mobile-converter .ht-mini-currency {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #555 !important;
    background: #e8e8e4 !important;
    border-radius: 5px !important;
    text-shadow: none !important;
}

html body .ht-mobile-converter .ht-mini-flag {
    font-size: 15px !important;
}

html body .ht-mobile-converter .ht-mini-swap {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #2a2e39 !important;
    border: none !important;
    border-radius: 50% !important;
    color: #d1d4dc !important;
    padding: 0 !important;
}

html body .ht-mobile-converter .ht-mini-swap svg {
    width: 18px !important;
    height: 18px !important;
}

html body .ht-mobile-converter .ht-mini-rate {
    padding: 10px 0 !important;
    font-size: 14px !important;
    color: #d1d4dc !important;
    text-align: center !important;
    text-shadow: none !important;
}

html body .ht-mobile-converter .ht-mini-favorites {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-top: 14px !important;
    border-top: 1px solid #2a2e39 !important;
}

html body .ht-mobile-converter .ht-mini-fav {
    display: inline-flex !important;
    align-items: center !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    color: #9ca3b4 !important;
    background: #262b36 !important;
    border: 1px solid #2a2e39 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Mobile: чёрный текст на зелёном */
html body .ht-mobile-converter .ht-mini-fav.ht-active {
    background: var(--ht-accent) !important;
    border-color: var(--ht-accent) !important;
    color: #000 !important;
}

html body .ht-mobile-converter .ht-mini-btn--full {
    width: 100% !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--ht-accent) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #000 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
}

/* ============================================
   RESPONSIVE: Hide desktop tools on mobile/tablet
   ============================================ */
@media (max-width: 1023px) {
    html body .top-bar .top-bar-container .ht-tools {
        display: none !important;
    }
    
    html body .ht-popover,
    html body .ht-dropdown {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE: Narrow screens - hide text, icons only
   ============================================ */
@media (min-width: 1024px) and (max-width: 1279px) {
    html body .ht-tools .ht-tool .ht-tool-text {
        display: none !important;
    }

    html body .ht-tools {
        gap: 10px !important;
    }

    html body .ht-tools .ht-tool {
        padding: 0 8px !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
html body .ht-tool:focus-visible,
html body .ht-mini-btn:focus-visible,
html body .ht-dropdown-item:focus-visible,
html body .ht-mobile-item:focus-visible {
    outline: 2px solid var(--ht-accent) !important;
    outline-offset: 2px !important;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    html body .ht-popover,
    html body .ht-dropdown,
    html body .ht-mobile-bar,
    html body .ht-mini-swap {
        transition: none !important;
    }
    
    html body .ht-mini-swap:hover {
        transform: none !important;
    }
}

/* ============================================
   CURRENCY DROPDOWN
   ============================================ */

/* Делаем currency badge кликабельным */
html body .ht-popover .ht-mini-currency {
    cursor: pointer !important;
    user-select: none !important;
}

html body .ht-popover .ht-mini-currency:hover {
    background: #d0d0c8 !important;
}

html body .ht-popover .ht-mini-currency::after {
    content: '' !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    border-top: 4px solid #888 !important;
    margin-left: 4px !important;
}

/* Dropdown container */
html body .ht-currency-dropdown {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    right: 0 !important;
    width: 280px !important;
    max-height: 320px !important;
    background: #1e222d !important;
    border: 1px solid #2a2e39 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    z-index: 1010 !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

html body .ht-currency-dropdown.ht-open {
    display: flex !important;
}

/* Search wrap */
html body .ht-currency-dropdown .ht-currency-search-wrap {
    padding: 10px !important;
    border-bottom: 1px solid #2a2e39 !important;
    flex-shrink: 0 !important;
}

html body .ht-currency-dropdown .ht-currency-search {
    width: 100% !important;
    height: 36px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-family: 'Roboto', Arial, sans-serif !important;
    color: #1a1a1a !important;
    background: #f5f5f0 !important;
    border: 2px solid transparent !important;
    border-radius: 6px !important;
    outline: none !important;
    box-sizing: border-box !important;
}

html body .ht-currency-dropdown .ht-currency-search:focus {
    border-color: var(--ht-accent) !important;
    background: #fff !important;
}

html body .ht-currency-dropdown .ht-currency-search::placeholder {
    color: #999 !important;
}

/* Currency list */
html body .ht-currency-dropdown .ht-currency-list {
    flex: 1 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding: 6px 0 !important;
}

html body .ht-currency-dropdown .ht-currency-list::-webkit-scrollbar {
    width: 6px !important;
}

html body .ht-currency-dropdown .ht-currency-list::-webkit-scrollbar-track {
    background: transparent !important;
}

html body .ht-currency-dropdown .ht-currency-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 3px !important;
}

/* Currency item */
html body .ht-currency-dropdown .ht-currency-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

html body .ht-currency-dropdown .ht-currency-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

html body .ht-currency-dropdown .ht-currency-item-flag {
    width: 24px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
}

html body .ht-currency-dropdown .ht-currency-item-code {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #fff !important;
    width: 40px !important;
    flex-shrink: 0 !important;
}

html body .ht-currency-dropdown .ht-currency-item-name {
    font-size: 12px !important;
    color: #9ca3b4 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ============================================
   FLAG IMAGES (Windows)
   ============================================ */
html body .ht-flag-img {
    width: 16px !important;
    height: 12px !important;
    vertical-align: middle !important;
    margin-right: 2px !important;
    border-radius: 1px !important;
    object-fit: cover !important;
}

html body .ht-currency-dropdown .ht-flag-img {
    width: 20px !important;
    height: 15px !important;
}

/* ============================================
   MOBILE: Currency Dropdown
   ============================================ */
@media (max-width: 767px) {
    html body .ht-currency-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 60vh !important;
        border-radius: 16px 16px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 0) !important;
    }
    
    html body .ht-currency-dropdown .ht-currency-search-wrap {
        padding: 14px 16px !important;
    }
    
    html body .ht-currency-dropdown .ht-currency-search {
        height: 44px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }
    
    html body .ht-currency-dropdown .ht-currency-item {
        padding: 14px 16px !important;
    }
    
    html body .ht-currency-dropdown .ht-currency-item-code {
        font-size: 15px !important;
    }
    
    html body .ht-currency-dropdown .ht-currency-item-name {
        font-size: 13px !important;
    }
}