* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 40px 20px;
    background: linear-gradient(135deg, #e6f0fa 0%, #f7f9fc 100%);
    color: #1a2b49;
    line-height: 1.6;
}

h1 {
    text-align: center;
    color: #1a2b49;
    font-size: 2.4rem;
    margin-bottom: 12px;
    font-weight: 800;
}

.subtitle {
    text-align: center;
    color: #5a6b88;
    font-size: 1rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    background: #ffffff;
    padding: 36px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e6e9ef;
}

.results-container { margin-top: 20px; }

/* Ширина контейнера результатов — адаптивно ~60% экрана, но не более 1200px */
.results-container {
    max-width: min(1200px, 60vw);
}

.input-section {
    margin-bottom: 20px;
}

label {
    display: inline-block;
    font-size: 0.95rem;
    color: #1a2b49;
    margin-bottom: 8px;
    font-weight: 500;
    margin-right: 15px;
}

.tld-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px 16px;
    margin-top: 6px;
}

.tld-inline { display: flex; gap: 12px; align-items: center; }
.tld-dropdown summary { cursor: pointer; color: #4a90e2; }
.tld-dropdown[open] summary { text-decoration: underline; }

textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #d4d9e2;
    border-radius: 8px;
    resize: vertical;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f9fafc;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

button.check-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.3s ease;
}

button.check-btn:hover {
    background: linear-gradient(90deg, #357abd 0%, #2a639b 100%);
    transform: translateY(-1px);
}

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

button.free-btn {
    padding: 6px 12px;
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.3s ease;
}

button.free-btn:hover {
    background: linear-gradient(90deg, #27ae60 0%, #219653 100%);
    transform: translateY(-1px);
}

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

#results {
    margin-top: 30px;
}

.results-section {
    margin-bottom: 30px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.results-section h2 {
    color: #1a2b49;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 600;
    border-left: 4px solid #4a90e2;
    padding-left: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 14px;
    text-align: left;
}

th {
    background: #4a90e2;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
}

td {
    border-bottom: 1px solid #e6e9ef;
    font-size: 0.9rem;
    color: #1a2b49;
}

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

tr:hover td {
    background: #f5f7fa;
}

.domain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.error {
    color: #d32f2f;
    font-weight: 500;
    text-align: center;
    padding: 12px;
    background: #ffebee;
    border-radius: 8px;
    font-size: 0.95rem;
}

pre {
    background: #f5f7fa;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 0.9rem;
    color: #5a6b88;
    border-left: 4px solid #e6e9ef;
}

.progress-section {
    margin-top: 20px;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.left, .right { display: block; }
.right { padding-top: 6px; }

.actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
}

.btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e6e9ef;
    background: #f7f9fc;
    color: #1a2b49;
    cursor: pointer;
    min-height: 36px;
}

.btn:hover { background: #eef3fa; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: #fff; }

.btn-primary {
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
    color: #ffffff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
}

.btn-primary:hover { background: linear-gradient(90deg, #357abd 0%, #2a639b 100%); }

.btn-square {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
}

.btn-danger:hover { background: #cf3f31; }

.mobile-cta {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #ffffff 35%);
    display: none;
}

.progress-bar {
    width: 100%;
    background: #e6e9ef;
    border-radius: 8px;
    height: 20px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
    transition: width 0.4s ease;
    position: relative;
}

#progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%);
    animation: shimmer 1.2s infinite;
}

#progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 0.95rem;
    color: #1a2b49;
}

.domains-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.domains-link:hover {
    text-decoration: underline;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Избранные домены */
.favorites-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #27ae60;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.favorites-panel {
    position: fixed;
    right: 24px;
    top: 24px;
    width: min(420px, 90vw);
    max-height: 70vh;
    overflow: auto;
    background: #eafaf1; /* светло-зелёный фон */
    border: 1px solid #e6e9ef;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 12px 34px rgba(0,0,0,0.14);
    z-index: 2001;
}

.favorites-panel.hidden { display: none; }
.favorites-header { display: flex; align-items: center; gap: 8px; }
.favorites-header .spacer { flex: 1; }
.favorites-list { list-style: none; padding: 0; margin: 10px 0 0; }
.favorites-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px; border-bottom: 1px solid #f0f2f6; }
.favorites-list li:last-child { border-bottom: none; }
.btn-small { padding: 6px 10px; border-radius: 8px; border: 1px solid #e6e9ef; background: #f7f9fc; cursor: pointer; }
.btn-ghost { background: transparent; }

/* Адаптивность: мобильные и небольшие экраны */
@media (max-width: 1024px) {
    .favorites-toggle { right: 16px; bottom: 16px; width: 60px; height: 60px; font-size: 24px; }
}

@media (max-width: 768px) {
    .favorites-toggle { right: 14px; bottom: 14px; width: 64px; height: 64px; font-size: 26px; }
    .favorites-panel {
        left: 4vw;
        right: 4vw;
        top: auto;
        bottom: 90px; /* над кнопкой */
        width: auto;
        max-height: 60vh;
        border-radius: 14px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 20px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    button.check-btn {
        padding: 10px;
    }

    button.free-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .layout { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr; }
    .mobile-cta { display: block; }
}