/* ПЕРЕМЕННЫЕ И ДИЗАЙН-ТОКЕНЫ */
:root {
    color-scheme: dark;
    --bg-main: #0b0f19;
    --bg-sidebar: #0f1422;
    --bg-card: rgba(23, 32, 54, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.4);
    
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    
    --font-ui: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* СБРОС И БАЗОВЫЕ СТИЛИ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* МАКЕТ ПРИЛОЖЕНИЯ */
.app-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: radial-gradient(circle at 50% -20%, rgba(139, 92, 246, 0.15) 0%, rgba(11, 15, 25, 0) 50%),
                radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.05) 0%, rgba(11, 15, 25, 0) 40%);
}

/* БОКОВАЯ ПАНЕЛЬ */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
}

/* Скроллбар сайдбара */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 8px 0 8px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.sidebar-footer .footer-built strong {
    color: var(--primary-hover);
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 16px 0 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover:not(.disabled) {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--primary-hover);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.nav-item .badge {
    position: absolute;
    right: 12px;
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
}

/* ОСНОВНАЯ ЗОНА */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 32px 24px 32px;
    overflow-y: auto; /* Enable natural vertical scrolling for the whole workspace page */
    overflow-x: hidden;
    gap: 32px;
}

/* САЙТ-ХЕДЕР (ГЛОБАЛЬНАЯ ВЕРХНЯЯ ПОЛОСА) */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    min-height: 60px;
    width: 100%;
    padding: 0 24px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.site-header .logo .logo-icon {
    font-size: 26px;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
}

.site-header .logo .logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.site-header .logo .logo-text span {
    color: var(--primary);
}

.hamburger-menu {
    display: none;
}

.mobile-logo {
    display: none;
}

/* ОВЕРЛЕЙ САЙДБАРА */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ЗАГОЛОВОК СЕРВИСА (ДЛЯ ВНУТРЕННИХ СТРАНИЦ) */
.workspace-header {
    grid-column: 1 / -1;
    margin-bottom: 8px;
    animation: fadeIn 0.4s ease-out;
}

.workspace-header h2,
.workspace-header .tool-title-element,
.workspace-header h1.tool-title-element {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.workspace-header p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto; /* Always pushes actions to the far right */
}

/* Селектор языка */
.language-selector {
    display: flex;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: var(--border-radius-sm);
    gap: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--font-ui);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.lang-btn:hover:not(.active) {
    color: var(--text-primary);
}

.lang-btn.active {
    background-color: rgba(139, 92, 246, 0.18);
    color: var(--primary-hover);
    border: 1px solid rgba(139, 92, 246, 0.15);
    pointer-events: none; /* Deactivate click and links for active language */
}

/* РАБОЧЕЕ ПРОСТРАНСТВО */
.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex-shrink: 0;
}

/* ПАНЕЛИ */
.panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: var(--transition-smooth);
}

.panel-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: visible; /* Let panels expand naturally to their full contents */
    min-height: auto;
}

.panel:hover {
    border-color: rgba(139, 92, 246, 0.15);
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(15, 20, 34, 0.3);
    flex-shrink: 0;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.panel-title i {
    font-size: 20px;
    color: var(--primary-hover);
}

/* Вкладки переключения форматов (санитайзер) */
.format-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.format-buttons {
    display: flex;
    background-color: rgba(11, 15, 25, 0.4);
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: var(--border-radius-md);
    gap: 2px;
}

.format-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-ui);
    transition: var(--transition-smooth);
}

.format-btn:hover:not(.active) {
    color: var(--text-primary);
}

.format-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* ПОЛЯ ВВОДА / ВЫВОДА */
.textarea-wrapper {
    flex-grow: 1;
    position: relative;
    padding: 16px 20px;
    background-color: rgba(11, 15, 25, 0.2);
    min-height: 250px;
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    white-space: pre-wrap;
    word-break: break-word;
}

textarea::placeholder {
    color: var(--text-muted);
}

/* Статистика внизу ввода */
.panel-footer-stats {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background-color: rgba(15, 20, 34, 0.2);
    flex-shrink: 0;
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.stat-badge {
    background-color: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.stat-badge span {
    font-weight: 600;
    color: var(--text-primary);
}

/* НАСТРОЙКИ */
.options-card {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(15, 20, 34, 0.35);
    flex-shrink: 0;
}

.options-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Кастомные чекбоксы */
.option-checkbox {
    display: block; /* Changed from flex to block to prevent vertical centering of wrapped multi-line text */
    position: relative;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-secondary);
    user-select: none;
    padding-left: 30px;
    line-height: 1.5;
    transition: var(--transition-smooth);
}

.option-checkbox:hover {
    color: var(--text-primary);
}

.option-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px; /* Adjusted to perfectly align checkbox tick box with the first line of larger line-height text */
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.option-checkbox input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.option-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.option-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Custom styled Radio indicators for .option-checkbox */
.option-checkbox input[type="radio"] ~ .checkmark {
    border-radius: 50%;
}

.option-checkbox input[type="radio"] ~ .checkmark:after {
    left: 5px;
    top: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
    border: none;
    transform: none;
}

/* КНОПКИ И ДЕЙСТВИЯ */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-text-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-text-action:hover {
    color: var(--accent-rose);
}

/* ВКЛАДКИ */
.tab-buttons {
    display: flex;
    background-color: rgba(11, 15, 25, 0.3);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: var(--border-radius-md);
    gap: 2px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.tab-content {
    display: none;
    flex-grow: 1;
    min-height: 0;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ТАБЛИЦА РЕЗУЛЬТАТОВ */
.table-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
}

#workspace-frequency .table-container {
    max-height: 480px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: rgba(0, 0, 0, 0.15);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.result-table th {
    position: sticky;
    top: 0;
    background-color: rgb(16, 23, 38);
    padding: 12px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

.result-table td {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

.result-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Пустое состояние таблицы */
.empty-placeholder td {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-ui);
    padding: 80px 20px !important;
    font-size: 14px;
}

/* ПОДВАЛ ПРАВОЙ ПАНЕЛИ */
.panel-footer-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(15, 20, 34, 0.3);
    flex-shrink: 0;
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.export-format {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

select {
    color-scheme: dark;
    background-color: rgba(255, 255, 255, 0.03);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding: 8px 12px;
    padding-right: 36px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-ui);
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--border-glow);
}

/* ПРЕДПРОСМОТР (PREVIEW) В САНИТАЙЗЕРЕ */
.preview-container h1, .preview-container h2, .preview-container h3 {
    margin-top: 16px;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 6px;
}
.preview-container h1 { font-size: 22px; }
.preview-container h2 { font-size: 18px; }
.preview-container h3 { font-size: 16px; }

.preview-container p {
    margin-bottom: 12px;
    font-size: 14.5px;
    color: #e2e8f0;
}

.preview-container strong {
    color: var(--primary-hover);
    font-weight: 600;
}

.preview-container em {
    color: var(--accent-cyan);
    font-style: italic;
}

.preview-container a {
    color: var(--primary-hover);
    text-decoration: underline;
}

.preview-container ul, .preview-container ol {
    margin-left: 24px;
    margin-bottom: 12px;
}

.preview-container li {
    margin-bottom: 4px;
    font-size: 14.5px;
}

.preview-container code {
    font-family: var(--font-mono);
    background-color: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent-cyan);
}

.preview-container pre {
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin-bottom: 12px;
}

.preview-container pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

/* УВЕДОМЛЕНИЕ (TOAST) */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background-color: var(--accent-emerald);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(100px);
    opacity: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* СТИЛИЗАЦИЯ СКРОЛЛБАРОВ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: var(--transition-smooth);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* АДАПТИВНОСТЬ ПОД МОБИЛЬНЫЕ СТАРЫЕ СТИЛИ УДАЛЕНЫ ДЛЯ ИЗБЕЖАНИЯ КОНФЛИКТОВ */

/* ================= РАБОЧАЯ ОБЛАСТЬ ГЛАВНОЙ СТРАНИЦЫ ================= */
.workspace-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from center to accommodate vertical scrolling beautifully */
    gap: 40px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
    flex-shrink: 0;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.home-hero {
    text-align: center;
    max-width: 700px;
}

.hero-dino {
    font-size: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
    animation: bounce 3s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-hero h2,
.home-hero .tool-title-element,
.home-hero h1.tool-title-element {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-hero p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    width: 100%;
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.frequency-color {
    background-color: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.sanitizer-color {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--primary-hover);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.qrcode-color {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.password-color {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.tool-card .tool-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-card p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    flex-grow: 1;
}

.tool-card .btn-primary {
    align-self: stretch;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
}

#san-content-preview {
    height: 100%;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.preview-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    background-color: rgba(11, 15, 25, 0.2);
    font-family: var(--font-ui);
    line-height: 1.6;
    color: var(--text-primary);
}

/* СТИЛИЗАЦИЯ ТАБЛИЦ В ВИЗУАЛЬНОМ ПРЕДПРОСМОТРЕ */
.preview-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 20px 0;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background-color: rgba(15, 20, 34, 0.25);
    backdrop-filter: blur(10px);
}

.preview-container th {
    background-color: rgba(15, 20, 34, 0.65);
    color: var(--primary-hover);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: left;
    font-size: 13px;
}

.preview-container th:last-child {
    border-right: none;
}

.preview-container td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 13px;
}

.preview-container td:last-child {
    border-right: none;
}

.preview-container tr:last-child td {
    border-bottom: none;
}

.preview-container tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.preview-container td p,
.preview-container th p {
    margin: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ГЛАВНЫЙ ПОДВАЛ (FOOTER) */
.main-footer {
    margin-top: auto;
    padding: 20px 0 0 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-divider {
    color: rgba(255, 255, 255, 0.1);
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.footer-right {
    font-size: 12px;
}

.footer-built strong {
    color: var(--primary-hover);
}

/* КЛИЕНТСКИЙ СЕЛЕКТОР ЯЗЫКА (ДРОПДАУН) */
.language-dropdown-container {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.lang-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--border-glow);
}

.lang-dropdown-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.language-dropdown-container.open .lang-dropdown-btn i {
    transform: rotate(180deg);
}

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 210px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-height: 320px;
    overflow-y: auto;
}

/* Скроллбар для меню выбора языков */
.language-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.language-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}
.language-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.language-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.language-dropdown-container.open .language-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.language-dropdown-menu .lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.language-dropdown-menu .lang-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.language-dropdown-menu .lang-btn.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-hover);
    border-left: 3px solid var(--primary);
}

/* Флаги языков (SVG) */
.flag-icon {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* СТИЛИ ДЛЯ ГЕНЕРАТОРА QR-КОДОВ */
.qr-options-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-with-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-with-value input[type="range"] {
    flex-grow: 1;
    accent-color: var(--primary);
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    outline: none;
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--primary-hover);
    min-width: 48px;
    text-align: right;
}

.option-color-group {
    display: flex;
    gap: 16px;
}

.color-picker-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-wrapper label {
    font-size: 13px;
    color: var(--text-secondary);
}

.color-picker-wrapper input[type="color"] {
    width: 100%;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.option-select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-slider-group label,
.bulk-generation-settings label,
.option-select-group label,
.color-picker-wrapper label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.option-select-group select,
.bulk-generation-settings select {
    width: 100%; /* Stretch options selects for a sleek full-width premium look */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.option-select-group select:focus,
.bulk-generation-settings select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--border-glow);
}

.qr-preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 300px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-lg);
    border: 1px dashed var(--border-color);
    padding: 20px;
}

.qr-canvas-container {
    padding: 16px;
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.qr-canvas-container canvas {
    max-width: 100%;
    height: auto !important;
    display: block;
}

/* СТИЛИ ДЛЯ ГЕНЕРАТОРА ПАРОЛЕЙ */
.password-settings-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.password-settings-card .options-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.bulk-generation-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 16px;
}

.passwords-output-wrapper {
    height: 100%;
    min-height: 350px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.passwords-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.password-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.password-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.password-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-strength-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.password-strength-badge.weak {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.password-strength-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.password-strength-badge.strong {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.password-strength-badge.excellent {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.password-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.password-text {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-primary);
    word-break: break-all;
    user-select: all;
}

.btn-copy-password {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.btn-copy-password:hover {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.btn-copy-password i {
    font-size: 18px;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.password-strength-bar-fill.weak {
    width: 25%;
    background-color: #f43f5e;
}

.password-strength-bar-fill.medium {
    width: 50%;
    background-color: #f59e0b;
}

.password-strength-bar-fill.strong {
    width: 75%;
    background-color: #10b981;
}

/* ================= СТИЛИ ДЛЯ ГЕНЕРАТОРА ШТРИХКОДОВ ================= */
.barcode-color { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.tone-color { background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%); }
.uuid-color { background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); }

.uuid-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
}
.uuid-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(6, 182, 212, 0.3);
}
.uuid-text-val {
    word-break: break-all;
    user-select: all;
    letter-spacing: 0.5px;
}
.btn-copy-uuid-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    padding: 6px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    margin-left: 12px;
}
.btn-copy-uuid-item:hover {
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
}

[dir="rtl"] .btn-copy-uuid-item {
    margin-left: 0;
    margin-right: 12px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: block;
}

.barcode-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 10px 14px;
    resize: vertical;
    min-height: 70px;
    transition: var(--transition-smooth);
}
.barcode-textarea:focus { outline: none; border-color: var(--border-glow); }

.styled-select {
    width: 100%;
    padding: 10px 14px;
    padding-right: 40px;
    background-position: right 14px center;
}
select option {
    background-color: #0f1422;
    color: #f8fafc;
}

.styled-range {
    width: 100%;
    accent-color: var(--primary);
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    outline: none;
}

.color-input {
    width: 100%;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 0;
}
.color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}
.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.barcode-preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    overflow: auto;
}

.barcode-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
    padding: 24px;
}

#barcode-svg {
    max-width: 100%;
    border-radius: var(--border-radius-md);
}

.barcode-empty-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 40px 20px;
    display: none;
}

/* ПОДДЕРЖКА RIGHT-TO-LEFT (RTL) ДЛЯ АРАБСКОГО ЯЗЫКА */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] body {
    direction: rtl;
}

[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .main-content {
    margin-right: 0;
}

[dir="rtl"] .language-dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .language-dropdown-menu .lang-btn {
    border-left: none;
}

[dir="rtl"] .language-dropdown-menu .lang-btn.active {
    border-right: 3px solid var(--primary);
    border-left: none;
}

[dir="rtl"] .sidebar-header {
    padding-left: 0;
    padding-right: 8px;
}

[dir="rtl"] .nav-item i {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .btn-text-action i,
[dir="rtl"] .btn-primary i {
    margin-right: 0;
    margin-left: 6px;
}

[dir="rtl"] .panel-header .panel-title i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .slider-value {
    text-align: left;
}

[dir="rtl"] .password-value-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-copy-password {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .footer-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .option-checkbox {
    padding-left: 0;
    padding-right: 28px;
}

[dir="rtl"] .option-checkbox input {
    right: 0;
    left: auto;
}

[dir="rtl"] .option-checkbox .checkmark {
    right: 0;
    left: auto;
}

[dir="rtl"] .toggle-stop-words {
    margin-right: auto;
    margin-left: 0;
}


/* ================= 12. СТИЛИ ДЛЯ КОНВЕРТЕРА ВРЕМЕНИ (TIME & EPOCH HUB) ================= */
.timestamp-color {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.timestamp-ticker-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ticker-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ticker-box {
    flex: 1;
    min-width: 180px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticker-unit {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.ticker-value {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

#ticker-sec {
    color: var(--accent-emerald);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

#ticker-ms {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.btn-copy-mini {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
}

.btn-copy-mini:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.timestamp-results-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 8px;
    gap: 16px;
}

.result-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 100px;
}

.result-val-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    overflow: hidden;
}

.result-val {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-val.font-mono {
    font-family: var(--font-mono);
    color: var(--primary-hover);
    font-size: 0.85rem;
}

.result-row .btn-copy-mini {
    position: static;
    flex-shrink: 0;
}

.timezone-grid {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
}

.timezone-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.timezone-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.timezone-card-active {
    background: rgba(139, 92, 246, 0.1) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.tz-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tz-flag {
    font-size: 1.2rem;
}

.tz-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tz-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tz-offset {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.tz-time {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-hover);
}

.timezone-card-active .tz-time {
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* RTL адаптация */
[dir="rtl"] .btn-copy-mini {
    right: auto;
    left: 10px;
}

[dir="rtl"] .result-val-wrapper {
    justify-content: flex-start;
}

[dir="rtl"] .result-val {
    text-align: left;
}

/* =====================================================================
   14. PREMIUM CUSTOM SELECT COMPONENTS
   ===================================================================== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
    font-family: var(--font-ui);
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--border-glow);
}

.custom-select-chevron {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform var(--transition-smooth);
}

.custom-select-wrapper.open .custom-select-chevron {
    transform: rotate(180deg);
    color: var(--primary-hover);
}

/* Dropdown list container */
.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(15, 20, 34, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    padding: 6px 0;
}

.custom-select-wrapper.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Individual options */
.custom-select-option {
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.custom-select-option.selected {
    background: rgba(167, 139, 250, 0.15); /* light purple accent */
    color: var(--primary-hover);
    font-weight: 500;
}

/* Dropdown scrollbar */
.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Specific styling for the inline code language selector */
div[data-select-id="ts-code-lang-select"] {
    width: 140px;
}
div[data-select-id="ts-code-lang-select"] .custom-select-trigger {
    padding: 6px 12px;
    font-size: 12px;
}
div[data-select-id="ts-code-lang-select"] .custom-select-dropdown {
    min-width: 120px;
}

/* Export format dropdown in Text Frequency tool - opens upwards to prevent clipping */
div[data-select-id="export-format-select"] .custom-select-dropdown {
    top: auto;
    bottom: calc(100% + 6px);
    transform: translateY(8px);
}

div[data-select-id="export-format-select"].open .custom-select-dropdown {
    transform: translateY(0);
}

/* Styled Premium Text Input */
.styled-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 10px 16px;
    font-size: 0.95rem;
    font-family: var(--font-mono);
    outline: none;
    transition: var(--transition-smooth);
}

.styled-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.styled-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--border-glow);
    background: rgba(0, 0, 0, 0.2);
}

/* =====================================================================
   14.5. VISUAL CRON STUDIO STYLES
   ===================================================================== */
/* Switch component */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 22px;
}

.slider-round:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.switch input:checked + .slider-round {
    background-color: var(--primary);
    border-color: var(--primary);
}

.switch input:checked + .slider-round:before {
    transform: translateX(22px);
    background-color: #fff;
}

/* Grids */
.cron-grid {
    animation: fadeIn 0.3s ease-out;
}

.cron-grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    height: 32px;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.cron-grid-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.cron-grid-item.selected {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
    color: var(--primary-hover);
    font-weight: bold;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Tabs bodies visibility */
.cron-tab-content {
    display: none;
}

.cron-tab-content.active {
    display: block;
}

/* Timeline */
.cron-timeline-hour {
    flex-grow: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    position: relative;
    transition: var(--transition-smooth);
}

.cron-timeline-hour:after {
    content: attr(data-hour);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: none;
}

.cron-timeline-hour.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Next runs list */
.cron-next-run-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.cron-next-run-item:hover {
    border-color: rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.cron-next-run-item i {
    color: var(--accent-emerald);
    font-size: 16px;
}

/* =====================================================================
   15. RESPONSIVE DESIGN (MOBILE & TABLET ADAPTATION)
   ===================================================================== */
@media (max-width: 1024px) {
    .hamburger-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
        border-radius: var(--border-radius-sm);
        transition: var(--transition-smooth);
        margin-right: 4px;
    }
    
    .hamburger-menu:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .site-header {
        justify-content: flex-start;
        gap: 12px;
        padding: 0 16px;
    }
    
    .site-header .logo .logo-icon {
        font-size: 24px;
    }
    
    .site-header .logo .logo-text {
        font-size: 18px;
    }

    .app-container {
        height: calc(100vh - 60px);
    }
    
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        width: 280px;
        transform: translateX(-100%);
        z-index: 1001;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 20px 16px 24px 16px;
        gap: 24px;
    }
    
    .workspace {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* Adjust specific tools for mobile spacing */
    .panel-header {
        padding: 12px 16px;
    }

    .textarea-wrapper {
        padding: 12px 16px;
        min-height: 200px;
    }

    .panel-footer-stats {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .options-card {
        padding: 16px;
    }

    .panel-footer-actions {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .panel-footer-actions .export-format {
        justify-content: space-between;
    }

    .panel-footer-actions button {
        width: 100%;
        justify-content: center;
    }

    .tab-buttons {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding: 3px;
    }

    .tab-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Cron visual grid mobile stacks */
    .cron-grid-60 {
        grid-template-columns: repeat(6, 1fr) !important;
    }
    .cron-grid-31 {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    .cron-grid-24 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .cron-grid-12, .cron-grid-7 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* =====================================================================
   INTERACTIVE IP & SUBNET STUDIO STYLINGS 🦖
   ===================================================================== */
.ip-binary-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.ip-octet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    transition: background 0.2s ease;
}

.ip-octet-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ip-octet-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    width: 90px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ip-octet-bits {
    display: flex;
    gap: 6px;
    flex-grow: 1;
    justify-content: flex-end;
}

.ip-bit-box {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.ip-bit-box:hover {
    transform: translateY(-2px);
    border-color: var(--primary-hover);
    color: var(--text-primary);
}

/* Mask bits: Glowing cyan */
.ip-bit-box.is-mask {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.25);
    color: rgba(34, 211, 238, 0.6);
}

.ip-bit-box.is-mask.bit-one {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.7);
    color: #22d3ee;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
    text-shadow: 0 0 4px rgba(34, 211, 238, 0.5);
}

/* Host bits: Glowing violet if set, dimmed borders otherwise */
.ip-bit-box.is-host {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.ip-bit-box.is-host.bit-one {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.6);
    color: var(--primary-hover);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

/* Upward opening dropdown for low-lying target select menu */
div[data-select-id="ip-split-cidr"] .custom-select-dropdown {
    top: auto !important;
    bottom: calc(100% + 6px) !important;
}

/* Tables visual enhancements */
#ip-subnets-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.15s ease;
}

#ip-subnets-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

#ip-subnets-table td {
    padding: 8px 12px;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .ip-octet-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ip-octet-bits {
        width: 100%;
        justify-content: space-between;
    }
    
    .ip-bit-box {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* =====================================================================
   CRYPTOGRAPHIC HASH & CIPHER HUB STYLINGS 🔐
   ===================================================================== */
.hash-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.hash-dropzone:hover {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.4);
}

.hash-dropzone.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary-hover);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
    transform: scale(1.02);
}

.hash-dropzone i {
    transition: transform 0.2s ease;
}

.hash-dropzone.active i {
    transform: translateY(-4px) scale(1.1);
    color: var(--primary-hover) !important;
}

/* Compare Row animations and styles */
.workspace-hash .panel-output span[id^="comp-"] {
    transition: color 0.15s ease;
}

.workspace-hash .tab-buttons {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.15);
    display: flex;
    gap: 4px;
    padding: 4px 8px 0 8px;
}

.workspace-hash .tab-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.workspace-hash .tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.workspace-hash .tab-btn.active {
    color: var(--primary-hover);
    border-bottom-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

/* Highlighting color themes for Hash visualizer cards */
.hash-color {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--primary-hover);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* ================= PREMIUM CSS-ONLY INTERACTIVE TOOLTIPS ================= */
.info-tooltip-trigger {
    position: relative;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.info-tooltip-trigger i {
    transition: all 0.2s ease-in-out;
    user-select: none;
    -webkit-user-select: none;
}

.info-tooltip-trigger:hover i {
    color: var(--primary-hover);
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

/* Tooltip container positioning & styling */
.info-tooltip-trigger .tooltip-card {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: rgb(30 28 59);
    color: var(--primary-hover);
    border: 1px solid rgba(139, 92, 246, 0.15);
    z-index: 9999;
    cursor: text;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    word-wrap: break-word;
    width: 250px;
    pointer-events: auto; /* MUST be auto so we can hover the tooltip itself and select/copy text! */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out, visibility 0.15s;
    transition-delay: 0.12s; /* UX Bridge: keeps tooltip open for 120ms to allow mouse crossing any gap! */
    text-align: left;
    font-family: var(--font-ui);
}

/* Invisible bridge element to ensure smooth mouse movement across any gap */
.info-tooltip-trigger .tooltip-card::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
    pointer-events: auto;
}

/* Active Hover animations */
.info-tooltip-trigger:hover .tooltip-card {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s; /* Show instantly on mouse enter! */
}

/* Adjustments for right side and left side edge boundaries if needed */
.info-tooltip-trigger.align-right .tooltip-card {
    left: auto;
    right: -10px;
    transform: translateY(4px);
}
.info-tooltip-trigger.align-right:hover .tooltip-card {
    transform: translateY(0);
    transition-delay: 0s;
}

/* ================= PREMIUM SEO REFERENCE CONTENT STYLING ================= */
.seo-content {
    padding: 32px;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 14.5px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.seo-content h2 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 4px;
    border-left: 3px solid var(--primary-hover);
    padding-left: 12px;
    line-height: 1.4;
}

.seo-content p {
    margin: 0;
    text-align: justify;
}

.seo-content ul {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.seo-content li {
    list-style-type: disc;
    color: var(--text-secondary);
}

.seo-content li::marker {
    color: var(--primary-hover);
}

.seo-content li strong {
    color: var(--primary-hover);
    font-weight: 600;
}

.seo-content .table-container {
    margin-top: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.seo-content .result-table td {
    font-family: var(--font-ui);
    font-size: 14px;
}

.seo-content .result-table tbody tr:last-child td {
    border-bottom: none;
}







