/* ============================================
   ПЕРЕМЕННЫЕ ЦВЕТОВОЙ СХЕМЫ
   ============================================ */
:root {
    --bg-page: #eef2f7;
    --bg-card: #e8edf5;
    --bg-input: #ffffff;
    --bg-url-name: #f3f8ff;
    --bg-header: #eef2f7;
    --bg-footer: #e4eaf3;

    --primary: #275dd2;
    --primary-hover: #1e4ba8;
    --primary-light: #dbeafe;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-placeholder: #94a3b8;
    --text-white: #ffffff;

    --border: #cbd5e1;
    --border-light: #d6dfeb;

    --btn-action-bg: #e2e8f0;
    --btn-action-hover: #dbeaff;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;

    --radius: 10px;
    --radius-sm: 8px;
}

/* ============================================
   СБРОС
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a { text-decoration: none; color: inherit; }

/* ============================================
   ШАПКА
   ============================================ */
.header {
    background: var(--bg-header);
    padding: 16px 0;
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */
.main {
    flex: 1;
    padding: 30px 0 60px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

/* ============================================
   ПЛАВАЮЩИЕ ЛЕЙБЛЫ — ЕДИНЫЙ СТИЛЬ
   ============================================ */
.floating-input {
    position: relative;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: border-color 0.2s;
}

.floating-input:focus-within {
    border-color: var(--primary);
}

.floating-input input,
.floating-input select {
    width: 100%;
    height: 48px;
    padding: 20px 14px 8px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
    font-family: inherit;
    line-height: 1.2;
}

.floating-input input::placeholder {
    color: transparent;
}

.floating-input label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-placeholder);
    pointer-events: none;
    transition: all 0.15s ease;
    background: transparent;
    padding: 0;
    line-height: 1;
    white-space: nowrap;
}

.floating-input.filled label,
.floating-input:focus-within label {
    top: 6px;
    transform: none;
    font-size: 11px;
    color: var(--primary);
    letter-spacing: 0.01em;
}

.floating-input.filled:not(:focus-within) label {
    color: var(--text-muted);
}

/* Для полей с нативным браузерным плейсхолдером
   (date, datetime-local, time) — лейбл ВСЕГДА поднятый,
   иначе наезжает на встроенное отображение браузера */
.floating-input.has-native-placeholder label,
.floating-input.has-native-placeholder.filled label,
.floating-input.has-native-placeholder:focus-within label {
    top: 6px;
    transform: none;
    font-size: 11px;
    letter-spacing: 0.01em;
}

.floating-input.has-native-placeholder.filled:not(:focus-within) label {
    color: var(--text-muted);
}

.floating-input.has-native-placeholder:focus-within label {
    color: var(--primary);
}

.floating-input label .required {
    color: var(--danger);
    margin-left: 2px;
}

/* ============================================
   INLINE-ВАРИАНТ (поля внутри строки URL)
   ============================================ */
.floating-input.inline {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.floating-input.inline input {
    padding: 20px 12px 8px;
}

.floating-input.inline label {
    left: 12px;
}

.floating-input.inline.url-name-field {
    max-width: 145px;
    flex: 0 0 145px;
    background: var(--bg-url-name);
    border-right: 1px solid var(--border-light);
}

/* ============================================
   КОНТЕЙНЕР ПОЛЕЙ ВВОДА В СТРОКЕ URL
   ============================================ */
.url-inputs {
    display: flex;
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: border-color 0.2s;
    height: 48px;
}

.url-inputs:focus-within {
    border-color: var(--primary);
}

/* ============================================
   ПОЛЕ ИМЕНИ КОРОТКОЙ ССЫЛКИ + ПЕРЕКЛЮЧАТЕЛЬ
   ============================================ */
.short-link-name-block {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 16px;
}

.short-link-name-block .floating-input {
    flex: 1;
    min-width: 0;
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mode-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--btn-action-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
}

.mode-btn svg {
    width: 18px;
    height: 18px;
}

.mode-btn:hover {
    background: var(--btn-action-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.mode-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.mode-btn.active:hover {
    background: var(--primary-hover);
    color: var(--text-white);
}

.mode-help {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
}

.mode-help:hover {
    background: var(--btn-action-hover);
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   СПИСОК URL-СТРОК
   ============================================ */
.url-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.url-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 8px 12px;
    transition: opacity 0.2s;
}

.url-row.paused {
    opacity: 0.55;
}

.url-row.dragging {
    opacity: 0.45;
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

/* ============================================
   БЕЙДЖ ПРИОРИТЕТА
   ============================================ */
.priority-badge {
    width: 64px;
    min-width: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: grab;
    user-select: none;
    transition: all 0.2s;
}

.priority-badge:hover {
    border-color: var(--primary);
    background: var(--btn-action-hover);
}

.priority-badge:active {
    cursor: grabbing;
}

.priority-badge .grip-icon {
    width: 14px;
    height: 18px;
    color: var(--text-placeholder);
    flex-shrink: 0;
}

.priority-badge .priority-num {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
}

/* ============================================
   ПРОЦЕНТ
   ============================================ */
.percent-badge {
    width: 76px;
    min-width: 76px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    height: 48px;
}

.percent-badge input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
    min-width: 0;
    padding: 0;
}

.percent-badge input::-webkit-outer-spin-button,
.percent-badge input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.percent-badge input[type=number] {
    -moz-appearance: textfield;
}

.percent-sign {
    color: var(--text-placeholder);
    font-size: 12px;
    flex-shrink: 0;
}

/* Переключение видимости по режиму */
.url-list.mode-priority .percent-badge {
    display: none;
}

.url-list.mode-percentage .priority-badge {
    display: none;
}

/* ============================================
   КНОПКИ ДЕЙСТВИЙ
   ============================================ */
.url-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.action-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--btn-action-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.action-btn:hover {
    background: var(--btn-action-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.action-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   БЛОК НАСТРОЕК
   ============================================ */
.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: -6px;
    display: none;
}

.settings-panel.open {
    display: block;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 22px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

.setting-label {
    font-size: 13px;
    color: var(--text-main);
    flex: 1;
    min-width: 0;
}

/* ============================================
   ПОДСКАЗКИ (CSS-тултипы)
   ============================================ */
.setting-help {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: help;
    flex-shrink: 0;
    transition: all 0.2s;
}

.setting-help:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.setting-help::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    padding: 10px 12px;
    background: var(--text-main);
    color: var(--text-white);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    border-radius: var(--radius-sm);
    white-space: normal;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.setting-help::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-main);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.setting-help:hover::after,
.setting-help:hover::before {
    opacity: 1;
    visibility: visible;
}

.setting-help.touched::after,
.setting-help.touched::before {
    opacity: 1;
    visibility: visible;
}

.setting-extra {
    display: none;
    margin-top: 8px;
    margin-left: 50px;
    margin-bottom: 12px;
}

.setting-extra.visible {
    display: block;
}

.setting-extra .floating-input {
    max-width: 280px;
}

/* ============================================
   PRELOADPAGE — ВЫБОР ТИПА (radio-карточки)
   Разнесены по вертикали с комфортными отступами,
   каждая опция — кликабельная карточка с описанием
   ============================================ */
.preload-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.preload-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.preload-card:hover {
    border-color: var(--primary);
    background: var(--bg-url-name);
}

/* Скрыть нативный radio */
.preload-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Кастомный radio-кружок */
.preload-card-radio {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    margin-top: 1px;
    position: relative;
    transition: all 0.2s;
    background: var(--bg-input);
}

.preload-card-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    transition: transform 0.2s;
}

/* Выбранное состояние — через :has и fallback-класс .selected */
.preload-card input[type="radio"]:checked ~ .preload-card-radio,
.preload-card.selected .preload-card-radio {
    border-color: var(--primary);
}

.preload-card input[type="radio"]:checked ~ .preload-card-radio::after,
.preload-card.selected .preload-card-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.preload-card:has(input[type="radio"]:checked),
.preload-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.preload-card-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.preload-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.preload-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ============================================
   НИЖНЯЯ ПАНЕЛЬ
   ============================================ */
.actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.add-url-btn {
    flex: 1;
    min-width: 0;
    padding: 14px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-url-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.create-btn-wrapper {
    flex-shrink: 0;
}

.create-btn {
    padding: 15px 36px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.create-btn:hover {
    background: var(--primary-hover);
}

/* ============================================
   ВКЛАДКИ
   ============================================ */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--border-light);
    color: var(--text-muted);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--text-white);
}

.tab-btn:not(.active):hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   ПАНЕЛЬ ФИЛЬТРОВ
   ============================================ */
.filters-panel {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text-main);
    outline: none;
    min-width: 160px;
    cursor: pointer;
}

.filter-select:focus { border-color: var(--primary); }

.filter-date {
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text-main);
    outline: none;
}

.filter-date:focus { border-color: var(--primary); }

.refresh-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.refresh-btn:hover { background: var(--primary-hover); }

/* ============================================
   ЭКСПОРТ
   ============================================ */
.export-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.export-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.export-btn:hover { color: var(--primary-hover); }

/* ============================================
   ТАБЛИЦА СТАТИСТИКИ
   ============================================ */
.stats-table-wrapper {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table thead th {
    background: var(--primary);
    color: var(--text-white);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.stats-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
}

.stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover { background: var(--primary-light); }

.chart-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

/* ============================================
   ФУТЕР
   ============================================ */
.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-light);
    padding: 16px 0;
    margin-top: auto;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-link {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-link:hover { color: var(--primary); }

.footer-copy {
    font-size: 12px;
    color: var(--text-placeholder);
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 41, 59, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: modalIn 0.2s ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--text-main); }

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
    text-align: center;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-submit-btn {
    padding: 12px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.modal-submit-btn:hover { background: var(--primary-hover); }

.modal-help {
    max-width: 520px;
}

.help-section {
    text-align: left;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.help-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.help-section-head h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.help-section-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--radius-sm);
}

.help-section-icon svg {
    width: 16px;
    height: 16px;
}

.help-section p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 6px;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section strong {
    color: var(--text-main);
    font-weight: 600;
}

.help-example {
    font-style: italic;
    color: var(--primary) !important;
}

.help-grip {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
}

.modal-help .modal-ok-btn {
    margin-top: 4px;
}

.modal-message {
    text-align: center;
    max-width: 380px;
}

.modal-message-icon {
    font-size: 42px;
    margin-bottom: 12px;
    line-height: 1;
}

.modal-message-icon.success { color: var(--success); }
.modal-message-icon.error { color: var(--danger); }
.modal-message-icon.warning { color: var(--warning); }
.modal-message-icon.info { color: var(--primary); }

.modal-message-text {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-ok-btn {
    padding: 10px 32px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-ok-btn:hover { background: var(--primary-hover); }

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

/* Планшет */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .short-link-name-block {
        flex-wrap: wrap;
    }

    .short-link-name-block .floating-input {
        flex: 1 1 100%;
    }

    .mode-selector {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }

    .url-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .url-inputs {
        width: 100%;
        order: 1;
    }

    .priority-badge {
        order: 0;
    }

    .percent-badge {
        order: 2;
        width: 72px;
        min-width: 72px;
    }

    .url-actions {
        width: 100%;
        justify-content: flex-end;
        order: 3;
    }

    .floating-input.inline.url-name-field {
        max-width: 130px;
        flex: 0 0 130px;
    }

    .actions-bar {
        gap: 10px;
    }

    .filters-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select,
    .filter-date,
    .refresh-btn {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    /* Тултипы на планшете — прижаты к правому краю */
    .setting-help::after {
        width: 220px;
        left: auto;
        right: 0;
        transform: none;
    }

    .setting-help::before {
        left: auto;
        right: 6px;
        transform: none;
    }
}

/* Мобильный */
@media (max-width: 480px) {
    .main {
        padding: 20px 0 40px;
    }

    .container {
        padding: 0 12px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .floating-input.inline.url-name-field {
        max-width: 110px;
        flex: 0 0 110px;
    }

    .action-btn,
    .mode-btn,
    .mode-help {
        width: 44px;
        height: 44px;
    }

    .priority-badge {
        width: 58px;
        min-width: 58px;
        height: 44px;
    }

    .percent-badge {
        width: 66px;
        min-width: 66px;
        height: 44px;
    }

    .url-inputs {
        height: 44px;
    }

    .floating-input.inline input {
        height: 44px;
        padding: 18px 10px 6px;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .create-btn-wrapper {
        text-align: right;
    }

    .create-btn {
        width: 100%;
    }

    /* Настройки на мобильном — компактно */
    .settings-panel {
        padding: 12px 14px;
    }

    .setting-extra {
        margin-left: 0;
    }

    .setting-extra .floating-input {
        max-width: 100%;
    }

    /* Preload-карточки на мобильном — чуть плотнее padding */
    .preload-card {
        padding: 12px 14px;
        gap: 10px;
    }

    /* Тултипы на мобильном — по центру */
    .setting-help::after {
        width: 240px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .setting-help::before {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* Очень узкие экраны (iPhone SE и т.п.) */
@media (max-width: 360px) {
    .floating-input.inline.url-name-field {
        max-width: 95px;
        flex: 0 0 95px;
    }

    .action-btn,
    .mode-btn,
    .mode-help {
        width: 40px;
        height: 40px;
    }

    .action-btn svg {
        width: 16px;
        height: 16px;
    }

    .priority-badge {
        width: 52px;
        min-width: 52px;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        max-height: 90vh;
        padding: 20px 18px;
    }

    .modal-title {
        margin-bottom: 12px;
        font-size: 16px;
    }
}