* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3B82F6;
    --primary-dark: #1D4ED8;
    --primary-hover: #60A5FA;
    --success: #4CAF50;
    --danger: #EF4444;
    --warning: #FF9800;
    --info: #3B82F6;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --divider: #CBD5E1;
    --tabs-sticky-top: 78px;
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-5: 2.5rem;
    --space-6: 3rem;
    --text-xs: 0.875rem;
    --text-sm: 0.95rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-width: 320px;
    font-size: var(--text-md);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 3.9vw, 2.85rem); }
h2 { font-size: clamp(1.3rem, 2.3vw, 1.78rem); }
h3 { font-size: clamp(1.06rem, 1.7vw, 1.24rem); }
p, li, .text-muted { font-size: var(--text-sm); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #0F172A;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.logo-badge {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-hover);
    opacity: 1;
}

.nav-link.active {
    text-decoration: underline;
    text-underline-offset: 5px;
}

/* Hero */
.hero {
    background: linear-gradient(145deg, #0F172A 0%, #1E293B 65%, #2563EB 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.18);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-value.stat-success {
    color: #4CAF50;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main */
.main {
    padding: var(--space-6) 0;
}

.page-hero {
    background: linear-gradient(135deg, #0F4DA3 0%, #1A73D9 100%);
    color: white;
    padding: 2.2rem 0;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.15);
}

.page-hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.page-hero-subtitle {
    font-size: 1rem;
    opacity: 0.92;
    margin-bottom: 1rem;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
    position: sticky;
    top: var(--tabs-sticky-top);
    z-index: 900;
    background: rgba(248,250,252,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem 0 0.6rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-bottom: 1px solid rgba(203,213,225,0.4);
}
[data-theme="dark"] .tabs {
    background: rgba(15,23,42,0.85);
    border-bottom-color: rgba(51,65,85,0.5);
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
    white-space: nowrap;
    flex: 1 1 0;
    min-width: 0;
}

.tab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px -8px rgb(0 0 0 / 0.15);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    animation: activeTabPulse 0.4s ease-out;
}

@keyframes activeTabPulse {
    0% { transform: translateY(0) scale(0.985); }
    60% { transform: translateY(-1px) scale(1.015); }
    100% { transform: translateY(0) scale(1); }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.22s ease-out both;
}

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

/* Card */
.card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
    margin-bottom: var(--space-4);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 18px 30px -12px rgb(0 0 0 / 0.14);
}

.card-header {
    padding: var(--space-3);
    border-bottom: 1px solid var(--divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-body {
    padding: var(--space-3);
}

.account-card {
    overflow: visible;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1rem;
}

.account-panel,
.account-limits-block,
.admin-panel {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    padding: 1rem;
}

.account-limits-block,
.admin-panel {
    margin-top: 1rem;
}

.account-section-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #1D4ED8;
    margin-bottom: 0.8rem;
}

.account-summary {
    display: grid;
    gap: 0.8rem;
}

.account-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.account-user-name,
.managed-user-name {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-primary);
}

.account-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.account-badge.guest {
    background: #E2E8F0;
    color: #334155;
}

.account-badge.user {
    background: #DBEAFE;
    color: #1D4ED8;
}

.account-badge.admin {
    background: #DCFCE7;
    color: #166534;
}

.account-meta-row,
.managed-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.account-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    background: #EFF6FF;
    color: #1E3A8A;
    font-size: 0.82rem;
    font-weight: 600;
}

.account-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.account-form {
    display: grid;
    gap: 0.9rem;
}

.account-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.limit-card {
    border: 1px solid #DBEAFE;
    border-radius: 12px;
    background: #FFFFFF;
    padding: 0.9rem;
    display: grid;
    gap: 0.45rem;
    box-shadow: 0 8px 16px -12px rgba(15, 23, 42, 0.28);
}

.limit-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.limit-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.limit-card-total,
.limit-card-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.limit-card-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0F4DA3;
}

.account-empty {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px dashed #CBD5E1;
    background: #F8FAFC;
    color: var(--text-secondary);
}

.admin-panel-head {
    margin-bottom: 1rem;
}

.admin-grid-users {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
}

.admin-user-form {
    display: grid;
    gap: 1rem;
}

.limit-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.limit-form-item {
    display: grid;
    gap: 0.35rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.limit-form-item span {
    font-weight: 600;
    color: var(--text-primary);
}

.managed-users-list {
    display: grid;
    gap: 0.9rem;
}

.managed-user-card {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    background: #FFFFFF;
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
}

.managed-user-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.managed-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.managed-user-toggle input {
    width: 16px;
    height: 16px;
}

.managed-user-password-row {
    grid-template-columns: minmax(0, 1fr);
}

.managed-user-usage {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.managed-user-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.feature-list {
    margin-top: 0.6rem;
    padding-left: 1.1rem;
}

.feature-list li + li {
    margin-top: 0.35rem;
}

.content-page h2 {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.content-page p {
    color: #2f3a47;
}

.content-page code {
    display: inline-block;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    background: #EFF4FF;
    color: #0D47A1;
    font-family: Consolas, monospace;
    font-size: 0.9rem;
}

.api-code {
    width: 100%;
    margin-top: 0.4rem;
    padding: 1rem;
    border-radius: 10px;
    background: #0D1B2A;
    color: #D8F3FF;
    overflow-x: auto;
    border: 1px solid #1B2D45;
    font-size: 0.9rem;
    line-height: 1.45;
}

.step-list {
    display: grid;
    gap: 0.85rem;
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.step-list li {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.95rem 1rem;
    position: relative;
}

.step-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
}

.knowledge-hub {
    border: 1px solid #E2E8F0;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.knowledge-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: var(--space-2);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.knowledge-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 28px -12px rgb(0 0 0 / 0.12);
}

.knowledge-card h3 {
    margin-bottom: 0.45rem;
    font-size: 1.1rem;
    color: #0D47A1;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.faq-box {
    margin-top: var(--space-2);
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: var(--space-2);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
}

.faq-box h3 {
    margin-bottom: 0.6rem;
    color: #0D47A1;
}

.faq-box details {
    border: 1px solid #E3EBF9;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    background: #FAFCFF;
}

.faq-box details + details {
    margin-top: 0.55rem;
}

.faq-box summary {
    cursor: pointer;
    font-weight: 600;
}

.faq-box details p {
    margin-top: 0.55rem;
}

.product-sections {
    border: 1px solid #E2E8F0;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.audience-card {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: var(--space-2);
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
}

.audience-card h3 {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    color: #0D47A1;
}

.formats-box {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #E1EAF7;
    background: #FFFFFF;
}

.formats-box h3 {
    margin-bottom: 0.45rem;
    color: #0D47A1;
}

.workflow-grid {
    margin-top: var(--space-2);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
}

.workflow-step {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: var(--space-2);
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.workflow-step:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 28px -12px rgb(0 0 0 / 0.12);
}

.workflow-num {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.workflow-step h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.legal-note {
    margin-top: var(--space-2);
    padding: var(--space-2);
    border-radius: 10px;
    border-left: 4px solid var(--danger);
    background: #FEF2F2;
    color: #7F1D1D;
}

.api-quickstart {
    border: 1px solid #DCE6F5;
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FCFF 100%);
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.6rem;
    border: 1px solid #DDE8F8;
    border-radius: 10px;
    overflow: hidden;
}

.simple-table th,
.simple-table td {
    border-bottom: 1px solid #E6EEF9;
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-size: 0.93rem;
}

.simple-table th {
    background: #EEF4FF;
    color: #0D47A1;
    font-weight: 700;
}

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

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.pricing-card {
    border: 1px solid #DCE6F5;
    border-radius: 12px;
    padding: 1rem;
    background: #FAFCFF;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pricing-card.active {
    border-color: #1976D2;
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.16);
}

.pricing-card h3 {
    color: #0D47A1;
    font-size: 1.15rem;
}

.pricing-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pricing-card .btn {
    margin-top: auto;
}

.run-history-list {
    display: grid;
    gap: 0.55rem;
}

.run-history-item {
    border: 1px solid #DDE8F8;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #FAFCFF;
}

.run-history-item.ok {
    border-left: 4px solid #2E7D32;
}

.run-history-item.fail {
    border-left: 4px solid #C62828;
}

.run-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.3rem;
}

.run-type {
    font-weight: 700;
    color: #0D47A1;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.run-endpoint {
    font-family: Consolas, monospace;
    font-size: 0.85rem;
}

.run-context {
    color: #516173;
    font-size: 0.85rem;
}

.run-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    font-size: 0.8rem;
    color: #596C82;
}

.admin-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.trend-block {
    margin-top: 1rem;
    border-top: 1px solid #E1EAF7;
    padding-top: 0.85rem;
}

.trend-block h3 {
    margin-bottom: 0.5rem;
    color: #0D47A1;
    font-size: 1rem;
}

.trend-bars {
    display: grid;
    gap: 0.45rem;
}

.trend-row {
    display: grid;
    grid-template-columns: 90px 1fr 42px;
    gap: 0.55rem;
    align-items: center;
}

.trend-day {
    font-size: 0.82rem;
    color: #4A5B70;
}

.trend-bar-wrap {
    width: 100%;
    background: #EDF3FB;
    border-radius: 999px;
    overflow: hidden;
    height: 10px;
}

.trend-bar {
    height: 100%;
    background: linear-gradient(90deg, #1976D2, #4CAF50);
    border-radius: 999px;
    position: relative;
}

.trend-bar-errors {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: #C62828;
}

.trend-val {
    font-size: 0.82rem;
    color: #4A5B70;
    text-align: right;
}

/* Form Elements */
.form-textarea,
.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--divider);
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-textarea::placeholder,
.form-input::placeholder {
    color: #8A8A8A;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.92rem;
    line-height: 1.35;
}

.form-textarea:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.url-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.url-input-group .form-input {
    flex: 1;
}

.url-input-group .url-field-wrap {
    flex: 1;
    min-width: 0;
}

.field-meta {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.images-batch-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--divider);
}

.images-batch-section h3 {
    margin-bottom: 0.35rem;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 16px 26px -10px rgb(0 0 0 / 0.2);
}

.btn-primary::before,
.btn-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 48%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.45s ease-out;
}

.btn-primary:hover::before,
.btn-info:hover::before {
    left: 120%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: #334155;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-info {
    background: var(--primary-dark);
    color: white;
}

.btn-primary:hover,
.btn-info:hover {
    background: var(--primary-hover);
}

/* Motion system: fade-up + stagger (Framer-like feel via CSS/JS observer) */
.reveal-item {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .tab-btn.active {
        animation: none;
    }
    .btn {
        transition: none;
    }
    .btn-primary::before,
    .btn-info::before {
        display: none;
    }
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-container {
    margin: 1rem 0;
    padding: 0.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress {
    height: 28px;
    background: #E0E0E0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    animation: progress 1.5s infinite;
    width: 100%;
    border-radius: 14px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    white-space: nowrap;
    pointer-events: none;
}

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

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.alert-info {
    background: #E3F2FD;
    color: #1976D2;
    border-left: 4px solid var(--info);
}

.alert ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

/* Results */
.results-card {
    animation: slideUp 0.3s ease-out;
}

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

.result-box {
    background: #F9F9F9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.result-status {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.result-status.success {
    background: #E8F5E9;
    color: #2E7D32;
}

.result-status.error {
    background: #FFEBEE;
    color: #C62828;
}

.violations-list {
    margin-top: 1rem;
}

.violation-section {
    margin-bottom: 1.5rem;
}

.violation-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--warning);
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-tag {
    background: #FFF3E0;
    color: #E65100;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 1.2rem;
}

/* ============================================
   УЛУЧШЕННЫЕ СТИЛИ РЕЗУЛЬТАТОВ ПРОВЕРКИ
   ============================================ */

/* Статус результата с иконкой */
.result-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.result-status .status-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.result-status .status-text h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-status .status-text p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.result-status.success {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
    border-left: 5px solid #4CAF50;
}

.result-status.error {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    color: #C62828;
    border-left: 5px solid #F44336;
}

.result-status.warning {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    color: #991B1B;
    border-left: 5px solid #EF4444;
}

/* Секции нарушений */
.violations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.violation-section {
    background: #FAFAFA;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid var(--danger);
}

.violation-section.critical {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    border-left-color: var(--danger);
}

.violation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.violation-icon {
    font-size: 1.5rem;
}

.violation-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-tag {
    background: #FFF3E0;
    color: #E65100;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.word-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.word-tag.critical {
    background: #FFEBEE;
    color: #C62828;
}

.more-words {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Сводная статистика */
.stats-summary {
    background: linear-gradient(135deg, #F5F5F5 0%, #EEEEEE 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.stats-summary h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-item .stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.url-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
    color: var(--text-secondary);
}

.url-info a {
    color: var(--primary);
    text-decoration: none;
}

.url-info a:hover {
    text-decoration: underline;
}

/* Рекомендации */
.recommendations {
    margin-top: 1.5rem;
}

.recommendations h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #F5F5F5;
}

.recommendation.critical {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
}

.recommendation.warning {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
}

.recommendation.success {
    background: #E8F5E9;
    border-left: 4px solid #4CAF50;
}

.recommendation.info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
}

.rec-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.rec-content h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.rec-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.rec-action {
    font-size: 0.9rem;
    color: var(--primary) !important;
    font-weight: 500;
}

/* Пакетная проверка */
.batch-summary {
    background: linear-gradient(135deg, #F5F5F5 0%, #EEEEEE 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-header {
    margin-bottom: 1rem;
}

.summary-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-item.success .summary-number {
    color: #4CAF50;
}

.summary-item.warning .summary-number {
    color: #FF9800;
}

.summary-item.critical .summary-number {
    color: #F44336;
}

.summary-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.batch-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.batch-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--divider);
}

.batch-item.success {
    border-left-color: #4CAF50;
}

.batch-item.warning {
    border-left-color: #FF9800;
}

.batch-item.critical {
    border-left-color: #F44336;
    background: #FFEBEE;
}

.batch-item.error {
    border-left-color: #F44336;
    background: #FFEBEE;
}

.batch-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.batch-icon {
    font-size: 1.2rem;
}

.batch-number {
    font-weight: 600;
    color: var(--text-secondary);
}

.batch-url {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.batch-url:hover {
    text-decoration: underline;
}

.batch-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.critical-badge {
    background: #F44336;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.batch-item-error {
    color: #C62828;
    font-size: 0.9rem;
}

/* ============================================
   ПАКЕТНАЯ ПРОВЕРКА - ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   ============================================ */

.batch-global-violations {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #FF9800;
}

.batch-global-violations h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #E65100;
}

.batch-violations-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.batch-violation-category {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid #FF9800;
}

.batch-violation-category.critical {
    border-left-color: #F44336;
    background: #FFEBEE;
}

.batch-violation-category h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.batch-details-btn {
    margin-left: auto;
    padding: 0.4rem 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-details-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.batch-details {
    margin-top: 1rem;
    padding: 1rem;
    background: #FAFAFA;
    border-radius: 8px;
    border-left: 3px solid var(--divider);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.batch-detail-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E0E0E0;
}

.batch-detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.batch-detail-section.critical {
    background: #FFEBEE;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #F44336;
}

.batch-detail-section h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.batch-words-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   ПРОВЕРКА СЛОВА
   ============================================ */

.word-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}

.word-input-group .form-input {
    width: 100%;
    max-width: 100%;
}

.word-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #E0E0E0;
}

.word-detail:last-child {
    border-bottom: none;
}

.word-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.word-value {
    font-weight: 600;
    color: var(--text-primary);
}

.word-value.text-success {
    color: #4CAF50;
}

.word-value.text-danger {
    color: #F44336;
}

.word-value.text-warning {
    color: #FF9800;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    :root {
        --tabs-sticky-top: 122px;
    }

    .header {
        padding: 0.65rem 0 0.55rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .logo {
        justify-content: center;
        font-size: 1.2rem;
        gap: 0.45rem;
    }

    .logo-icon {
        font-size: 1.45rem;
    }

    .logo-badge {
        display: none;
    }

    .main {
        padding: var(--space-3) 0;
    }

    .tabs {
        margin-bottom: 1rem;
        padding: 0.4rem 0 0.5rem;
    }

    .tab-btn {
        flex: 0 0 auto;
        min-width: 112px;
        padding: 0.7rem 0.85rem;
        font-size: 0.88rem;
    }

    .card {
        border-radius: 10px;
        margin-bottom: var(--space-2);
    }

    .card-header {
        padding: var(--space-2);
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }

    .card-header h2 {
        font-size: 1.15rem;
    }

    .card-body {
        padding: var(--space-2);
    }

    .knowledge-grid {
        grid-template-columns: 1fr;
    }

    .knowledge-card {
        padding: 0.85rem;
    }

    .faq-box {
        padding: 0.85rem;
    }

    .account-grid,
    .admin-grid-users,
    .account-form-row {
        grid-template-columns: 1fr;
    }

    .audience-grid {
        grid-template-columns: 1fr;
    }

    .workflow-grid {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .simple-table {
        display: block;
        overflow-x: auto;
    }

    .admin-filters {
        grid-template-columns: 1fr;
    }

    .trend-row {
        grid-template-columns: 78px 1fr 34px;
        gap: 0.4rem;
    }

    .form-textarea,
    .form-input {
        font-size: 16px;
        padding: 0.85rem;
    }

    .form-textarea::placeholder,
    .form-input::placeholder {
        font-size: 0.82rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .page-hero {
        padding: 1.3rem 0;
    }

    .page-hero-title {
        font-size: 1.45rem;
    }

    .page-hero-subtitle {
        font-size: 0.95rem;
    }
    
    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
        overflow: visible;
        white-space: normal;
        max-width: 100%;
        padding-bottom: 0;
    }

    .nav-link {
        background: rgba(255,255,255,0.16);
        border: 1px solid rgba(255,255,255,0.24);
        border-radius: 999px;
        padding: 0.32rem 0.62rem;
        font-size: 0.78rem;
        line-height: 1.2;
    }
    
    .url-input-group {
        flex-direction: column;
    }

    .word-input-group {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.55rem;
        width: 100%;
    }

    .account-inline-actions,
    .managed-user-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Маленькие кнопки в шапке результатов не растягиваем */
    .card-header .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .card-header .btn {
        width: auto;
    }
    
    .result-status {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .result-status .status-icon {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .batch-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .batch-details-btn {
        margin-left: 0;
        width: 100%;
    }
}

/* ============================================
   ГЛУБОКАЯ ПРОВЕРКА - НОВЫЕ СТИЛИ
   ============================================ */

.deep-check-results {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid #2196F3;
}

.deep-check-results h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1565C0;
}

.deep-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.deep-valid {
    color: #4CAF50;
    background: #E8F5E9;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.deep-abbr {
    color: #9C27B0;
    background: #F3E5F5;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.deep-invalid {
    color: #F44336;
    background: #FFEBEE;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.deep-section {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.deep-section:last-child {
    margin-bottom: 0;
}

.deep-section.valid {
    border-left: 3px solid #4CAF50;
}

.deep-section.abbreviation {
    border-left: 3px solid #9C27B0;
    background: #F3E5F5;
}

.deep-section.invalid {
    border-left: 3px solid #F44336;
}

.deep-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.deep-section.valid h4 {
    color: #2E7D32;
}

.deep-section.abbreviation h4 {
    color: #6A1B9A;
}

.deep-section.invalid h4 {
    color: #C62828;
}

/* Стили для слов в глубокой проверке */
.word-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 0.25rem;
    flex-wrap: wrap;
}

.word-tag.valid {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.word-tag.abbr {
    background: #F3E5F5;
    color: #6A1B9A;
    border: 1px solid #CE93D8;
}

.word-tag.invalid {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.word-reason,
.word-translation,
.word-suggestions {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.word-tag:hover .word-reason,
.word-tag:hover .word-translation,
.word-tag:hover .word-suggestions {
    color: var(--text-primary);
}

.word-translation {
    color: #9C27B0;
    font-weight: 500;
}

.word-suggestions {
    color: #FF9800;
    font-weight: 500;
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.deep-section {
    animation: fadeIn 0.3s ease-out;
}

.deep-section.batch {
    background: #FAFAFA;
    border-left-color: #2196F3;
}

.deep-section.batch h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.deep-section.batch h4 .batch-url {
    color: var(--primary);
    text-decoration: none;
}

.deep-section.batch h4 .batch-url:hover {
    text-decoration: underline;
}

.deep-subsection {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #E0E0E0;
}

.deep-subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.deep-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

/* Images OCR tab */
.images-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.images-token-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.images-token-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.images-token-status.success {
    color: #2E7D32;
}

.images-token-status.error {
    color: #C62828;
}

.image-db-summary {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #F5F8FF;
    border: 1px solid #DDE5FF;
}

#multiscan-tab .form-textarea:disabled,
#multiscan-tab .form-input:disabled {
    background: #F3F5F9;
    color: #7C8794;
    cursor: not-allowed;
}

#multiscan-tab .batch-item .word-tag {
    margin-top: 0.4rem;
}

@media (max-width: 768px) {
    .images-config-grid {
        grid-template-columns: 1fr;
    }
    .images-token-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Premium UI pass */
.header {
    background: linear-gradient(135deg, #0B1220 0%, #0F172A 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    backdrop-filter: blur(8px);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 4.2rem 0 3.3rem;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(740px 320px at 18% 20%, rgba(96, 165, 250, 0.23), transparent 68%),
        radial-gradient(680px 320px at 90% 10%, rgba(59, 130, 246, 0.20), transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, rgba(15, 23, 42, 0.36) 100%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    display: inline-block;
    max-width: 980px;
    padding: 0.35rem 0.9rem;
    border-radius: 14px;
    color: #FFFFFF;
    text-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.26), rgba(15, 23, 42, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-size: clamp(1.72rem, 3.8vw, 2.9rem);
    line-height: 1.12;
}

.hero-subtitle {
    color: #DBEAFE;
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
}

.stats-cards {
    gap: 1rem;
}

.stat-card {
    border-radius: 16px;
    box-shadow: 0 16px 30px -16px rgba(15, 23, 42, 0.65);
}

.tabs {
    padding-top: 0.35rem;
    padding-bottom: 0.7rem;
}

.tab-btn {
    border-color: #DBEAFE;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.tab-btn.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #2563EB;
}

.card-header {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.knowledge-card p,
.audience-card p,
.workflow-step p,
.faq-box p,
.legal-note {
    color: #334155;
}

.knowledge-card h3,
.audience-card h3,
.workflow-step h3,
.faq-box h3,
.formats-box h3 {
    color: #0F172A;
}

.word-tag {
    border: 1px solid #D1DDF0;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.result-status.warning,
.violation-section.critical,
.legal-note {
    border-color: #EF4444 !important;
}

@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero-title {
        padding: 0.26rem 0.62rem;
        border-radius: 12px;
        max-width: 100%;
    }

    .hero-subtitle {
        font-size: 0.94rem;
        line-height: 1.45;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* ── Спойлер в списках слов ─────────────────────────────────── */
.word-spoiler-hidden { display: inline; }

.spoiler-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.75rem;
    border-radius: 16px;
    font-size: 0.82rem;
    cursor: pointer;
    background: #f0f4ff;
    color: #3b5bdb;
    border: 1px dashed #99b0f0;
    transition: background 0.18s, border-color 0.18s;
    margin: 4px 0 0 4px;
    vertical-align: middle;
}
.spoiler-toggle-btn:hover {
    background: #dce4ff;
    border-color: #3b5bdb;
}

/* ── Кнопка и панель подсветки ─────────────────────────────── */
.highlight-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    margin: 0.85rem 0 0.25rem;
    transition: opacity 0.2s;
    font-weight: 500;
}
.highlight-btn:hover { opacity: 0.87; }

.highlight-overlay {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-top: 0.4rem;
    background: #fafafa;
    max-height: 380px;
    overflow-y: auto;
    line-height: 1.85;
}

.highlight-legend {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e8e8e8;
    font-size: 0.82rem;
}

.highlight-text {
    white-space: pre-wrap;
    font-size: 0.93rem;
    color: #333;
}

mark.hl-critical { background: #ffcdd2; color: #b71c1c; border-radius: 3px; padding: 0 2px; }
mark.hl-latin    { background: #fff3e0; color: #e65100; border-radius: 3px; padding: 0 2px; }
mark.hl-unknown  { background: #fff9c4; color: #f57f17; border-radius: 3px; padding: 0 2px; }

.hl-badge { padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.hl-critical-badge { background: #ffcdd2; color: #b71c1c; }
.hl-latin-badge    { background: #fff3e0; color: #e65100; }
.hl-unknown-badge  { background: #fff9c4; color: #f57f17; }

/* ── Улучшения в глубоком анализе ──────────────────────────── */
.deep-section { margin-bottom: 1.25rem; }
.deep-section h4 { margin-bottom: 0.6rem; font-size: 1rem; }
.word-tag.valid    { background: #e8f5e9; color: #2e7d32; }
.word-tag.invalid  { background: #fce4ec; color: #880e4f; }
.word-tag.abbr     { background: #e3f2fd; color: #0d47a1; }
.word-reason  { font-size: 0.75rem; color: #888; margin-left: 3px; }
.word-suggestions { font-size: 0.78rem; color: #2e7d32; margin-left: 4px; }

/* ── Dark Mode Toggle Button ─────────────────────────────────── */
.dark-toggle {
    background: rgba(255,255,255,0.12); border: none; border-radius: 8px;
    color: white; cursor: pointer; padding: 0.5rem 0.65rem; font-size: 1rem;
    transition: background 0.2s; margin-left: 1rem; line-height: 1;
}
.dark-toggle:hover { background: rgba(255,255,255,0.22); }

/* ── Dark Mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
    --text-primary: #F1F5F9; --text-secondary: #94A3B8;
    --background: #0F172A; --surface: #1E293B; --divider: #334155;
}
[data-theme="dark"] body { background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%); color: #F1F5F9; }
[data-theme="dark"] .card { background: var(--surface); border-color: var(--divider); }
[data-theme="dark"] .card-header { border-color: var(--divider); }
[data-theme="dark"] .account-panel,
[data-theme="dark"] .account-limits-block,
[data-theme="dark"] .admin-panel,
[data-theme="dark"] .managed-user-card,
[data-theme="dark"] .limit-card {
    background: #0F172A;
    border-color: #334155;
}
[data-theme="dark"] .account-empty {
    background: #111827;
    border-color: #334155;
    color: #94A3B8;
}
[data-theme="dark"] .account-meta-pill {
    background: #172554;
    color: #BFDBFE;
}
[data-theme="dark"] .account-badge.guest {
    background: #1E293B;
    color: #CBD5E1;
}
[data-theme="dark"] .account-badge.user {
    background: #1D4ED8;
    color: #DBEAFE;
}
[data-theme="dark"] .account-badge.admin {
    background: #14532D;
    color: #DCFCE7;
}
[data-theme="dark"] .limit-card-value,
[data-theme="dark"] .account-section-title {
    color: #93C5FD;
}
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea { background: #0F172A; color: var(--text-primary); border-color: var(--divider); }
[data-theme="dark"] .tab-btn { background: var(--surface); color: var(--text-primary); }
[data-theme="dark"] .batch-item { background: #0F172A; }
[data-theme="dark"] .batch-item.critical,
[data-theme="dark"] .batch-item.error { background: #2D0F0F; }
[data-theme="dark"] .batch-summary { background: linear-gradient(135deg,#1E293B,#162032); }
[data-theme="dark"] .summary-item, [data-theme="dark"] .summary-stat { background: #0F172A; }
[data-theme="dark"] .result-status.success { background:linear-gradient(135deg,#14532D,#166534); color:#86EFAC; }
[data-theme="dark"] .result-status.error   { background:linear-gradient(135deg,#7F1D1D,#991B1B); color:#FCA5A5; }
[data-theme="dark"] .result-status.warning { background:linear-gradient(135deg,#7C2D12,#92400E); color:#FDBA74; }
[data-theme="dark"] .word-tag          { background:#78350F; color:#FED7AA; }
[data-theme="dark"] .word-tag.critical { background:#7F1D1D; color:#FCA5A5; }
[data-theme="dark"] .word-tag.valid    { background:#14532D; color:#86EFAC; border-color:#166534; }
[data-theme="dark"] .word-tag.invalid  { background:#7F1D1D; color:#FCA5A5; border-color:#991B1B; }
[data-theme="dark"] .word-tag.abbr     { background:#4A1D96; color:#C4B5FD; border-color:#6D28D9; }
[data-theme="dark"] .highlight-overlay { background:#1E293B; border-color:#334155; }
[data-theme="dark"] .highlight-text    { color:#CBD5E1; }
[data-theme="dark"] .knowledge-card, [data-theme="dark"] .workflow-step,
[data-theme="dark"] .audience-card     { background:var(--surface); border-color:var(--divider); color:var(--text-primary); }
[data-theme="dark"] .faq-box details   { background:var(--surface); border-color:var(--divider); }
[data-theme="dark"] .run-history-item  { background:var(--surface); border-color:var(--divider); }
[data-theme="dark"] .progress          { background:#334155; }
[data-theme="dark"] .batch-global-violations,
[data-theme="dark"] .batch-detail-section { background:#0F172A; border-color:#334155; }
[data-theme="dark"] .batch-details { background:#1a2234; }
[data-theme="dark"] select.form-input option { background:#1E293B; }
[data-theme="dark"] .stats-summary { background:#1E293B; border-color:#334155; }
[data-theme="dark"] .stat-item { background:#0F172A; }
[data-theme="dark"] .stat-card { background:#1E293B; }
[data-theme="dark"] .violation-section { background:#1E293B; border-color:#334155; }
[data-theme="dark"] .recommendations { background:#1E293B; }
[data-theme="dark"] .word-spoiler-hidden .word-tag { opacity:0.9; }
[data-theme="dark"] .deep-section { color:var(--text-primary); }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color:var(--text-primary); }
[data-theme="dark"] p, [data-theme="dark"] label { color:var(--text-secondary); }
[data-theme="dark"] .nav-link { color:rgba(255,255,255,0.8); }
[data-theme="dark"] .nav-link:hover { color:#fff; }
[data-theme="dark"] .tab-btn.active { background:#3B82F6; color:#fff; }
[data-theme="dark"] .spoiler-toggle-btn { background:#1E293B; color:#94A3B8; border-color:#334155; }
[data-theme="dark"] .spoiler-toggle-btn:hover { background:#334155; }
[data-theme="dark"] .run-history-item .stat-value { color:var(--text-primary); }
[data-theme="dark"] .run-history-item .stat-label { color:var(--text-secondary); }

/* ── Toasts ──────────────────────────────────────────────────── */
#toastContainer {
    position:fixed; bottom:1.5rem; right:1.5rem; z-index:10000;
    display:flex; flex-direction:column; gap:0.5rem;
    max-width:380px; pointer-events:none;
}
.toast {
    display:flex; align-items:center; gap:0.75rem;
    padding:0.875rem 1rem; border-radius:12px;
    box-shadow:0 8px 24px rgba(0,0,0,0.2);
    background:#1E293B; color:#F1F5F9;
    font-size:0.9rem; font-weight:500;
    opacity:0; transform:translateX(20px);
    transition:opacity 0.3s ease, transform 0.3s ease;
    pointer-events:auto; max-width:100%;
}
.toast.toast-visible { opacity:1; transform:translateX(0); }
.toast-info    { border-left:4px solid #3B82F6; }
.toast-success { border-left:4px solid #4CAF50; }
.toast-error   { border-left:4px solid #EF4444; }
.toast-warning { border-left:4px solid #FF9800; }
.toast-icon { font-size:1.1rem; flex-shrink:0; }
.toast-message { flex:1; line-height:1.4; word-break:break-word; }
.toast-close {
    background:none; border:none; color:#94A3B8;
    cursor:pointer; padding:0 0.2rem; font-size:1rem; flex-shrink:0;
}
.toast-close:hover { color:#F1F5F9; }
.toast-undo-btn {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 6px;
    color: #F1F5F9;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.18rem 0.65rem;
    flex-shrink: 0;
    transition: background 0.15s;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.26); }

/* ── Compliance Gauge ────────────────────────────────────────── */
.stat-gauge { display:flex; align-items:center; justify-content:center; }

/* ── Status Badge Animation ──────────────────────────────────── */
.result-status {
    animation: fadeScaleIn 0.45s ease-out both;
}
@keyframes fadeScaleIn {
    from { opacity:0; transform:scale(0.96) translateY(8px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
}
.status-icon {
    animation: iconPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}
@keyframes iconPop {
    from { transform:scale(0); }
    to   { transform:scale(1); }
}

/* ═══════════════════════════════════════════════════════
   ── Визуальный редизайн текстовых блоков ──────────────
   ═══════════════════════════════════════════════════════ */

/* Info Boxes — горизонтальный layout, цветные акценты */
.info-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.25rem 0;
}
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-top: 3px solid #3B82F6;
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.info-box:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.info-box:nth-child(1) { border-top-color: #3B82F6; }
.info-box:nth-child(2) { border-top-color: #8B5CF6; }
.info-box:nth-child(3) { border-top-color: #F59E0B; }
.info-box:nth-child(4) { border-top-color: #10B981; }
.info-box .info-icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0;
}
.info-box:nth-child(1) .info-icon { background: linear-gradient(135deg,#EFF6FF,#DBEAFE); }
.info-box:nth-child(2) .info-icon { background: linear-gradient(135deg,#F5F3FF,#EDE9FE); }
.info-box:nth-child(3) .info-icon { background: linear-gradient(135deg,#FFFBEB,#FEF3C7); }
.info-box:nth-child(4) .info-icon { background: linear-gradient(135deg,#ECFDF5,#D1FAE5); }
.info-box-content { flex: 1; }
.info-box h3 { margin: 0 0 0.35rem; font-size: 1.05rem; color: #1E293B; }
.info-box p  { margin: 0; color: #475569; font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 640px) { .info-boxes { grid-template-columns: 1fr; } }

/* Feature list — галочки в кружках */
.feature-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.93rem;
    color: #334155;
    line-height: 1.45;
    margin-top: 0;
}
.feature-list li::before {
    content: '✓';
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #DCFCE7;
    color: #16A34A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

/* Timeline list — examples.html */
.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: tl-step;
}
.timeline-list > li {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 1.5rem;
    padding-bottom: 2rem;
    position: relative;
    border: none;
    background: none;
    border-radius: 0;
    padding-left: 0;
}
.timeline-list > li:last-child { padding-bottom: 0; }
.timeline-list > li::before {
    counter-increment: tl-step;
    content: counter(tl-step);
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976D2, #1565C0);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(25,118,210,0.35);
    align-self: start;
    position: static;
    top: auto; right: auto;
    z-index: 1;
}
.timeline-list > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 27px;
    top: 56px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #93C5FD, #E2E8F0);
    z-index: 0;
}
.timeline-list > li > div { padding-top: 0.65rem; }
.timeline-list > li > div h2 {
    font-size: 1.1rem; font-weight: 700;
    color: #1E293B; margin-top: 0; margin-bottom: 0.4rem;
}
.timeline-list > li > div p {
    color: #475569; font-size: 0.93rem;
    line-height: 1.5; margin-bottom: 0.4rem;
}
.timeline-list > li > div p:last-child { margin-bottom: 0; }

/* Audience cards — иконки + цветная левая полоса */
.audience-icon {
    font-size: 2rem;
    margin-bottom: 0.55rem;
    display: block;
    line-height: 1;
}
.audience-card { border-left-width: 4px; transition: transform 0.2s, box-shadow 0.2s; }
.audience-card:nth-child(1) { border-left-color: #3B82F6; }
.audience-card:nth-child(2) { border-left-color: #8B5CF6; }
.audience-card:nth-child(3) { border-left-color: #10B981; }
.audience-card:nth-child(4) { border-left-color: #F59E0B; }
.audience-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.1); }

/* Knowledge cards — иконки */
.knowledge-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1;
}

/* Workflow — крупные числа с градиентом */
.workflow-num {
    width: 40px; height: 40px;
    font-size: 1rem;
    background: linear-gradient(135deg, #1976D2, #1565C0);
    box-shadow: 0 4px 12px rgba(25,118,210,0.3);
    margin-bottom: 0.65rem;
}

/* Pricing cards — цветная шапка + hover */
.pricing-card {
    border-top: 4px solid #3B82F6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.13); }
.pricing-card:nth-child(1) { border-top-color: #64748B; }
.pricing-card:nth-child(2) { border-top-color: #3B82F6; }
.pricing-card:nth-child(3) { border-top-color: #8B5CF6; }
.pricing-card:nth-child(4) { border-top-color: #10B981; }

/* FAQ — плавное раскрытие + стрелка + подсветка открытого */
.faq-box details { overflow: hidden; }
.faq-box details p {
    animation: faqSlideDown 0.22s ease-out both;
}
@keyframes faqSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .faq-box details p { animation: none; }
}
.faq-box summary { list-style: none; padding-right: 2.2rem; position: relative; user-select: none; }
.faq-box summary::-webkit-details-marker { display: none; }
.faq-box summary::after {
    content: '›';
    position: absolute; right: 0.3rem; top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 1.4rem; color: #3B82F6;
    transition: transform 0.25s ease; line-height: 1;
}
.faq-box details[open] summary::after { transform: translateY(-50%) rotate(270deg); }
.faq-box details[open] { background: #F8FAFF; border-color: #BFDBFE; }

/* CTA box — градиентный фон */
.cta-box {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 1px solid #93C5FD;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}
.cta-box h3 { font-size: 1.3rem; color: #1E3A8A; margin-bottom: 0.5rem; }
.cta-box p  { color: #1D4ED8; margin-bottom: 1.25rem; opacity: 0.9; }

/* Dark mode для новых компонентов */
[data-theme="dark"] .info-box { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .info-box h3 { color: #F1F5F9; }
[data-theme="dark"] .info-box p  { color: #94A3B8; }
[data-theme="dark"] .info-box:nth-child(1) .info-icon { background: linear-gradient(135deg,#1e3a8a,#1e40af); }
[data-theme="dark"] .info-box:nth-child(2) .info-icon { background: linear-gradient(135deg,#2e1065,#4c1d95); }
[data-theme="dark"] .info-box:nth-child(3) .info-icon { background: linear-gradient(135deg,#451a03,#78350f); }
[data-theme="dark"] .info-box:nth-child(4) .info-icon { background: linear-gradient(135deg,#052e16,#14532d); }
[data-theme="dark"] .feature-list li { color: #CBD5E1; }
[data-theme="dark"] .feature-list li::before { background: #14532d; color: #86EFAC; }
[data-theme="dark"] .timeline-list > li > div h2 { color: #F1F5F9; }
[data-theme="dark"] .timeline-list > li > div p  { color: #94A3B8; }
[data-theme="dark"] .cta-box { background: linear-gradient(135deg,#1E293B,#162032); border-color: #334155; }
[data-theme="dark"] .cta-box h3 { color: #93C5FD; }
[data-theme="dark"] .cta-box p  { color: #60A5FA; }
[data-theme="dark"] .pricing-card h3 { color: #93C5FD; }
[data-theme="dark"] .audience-card { border-left-width: 4px; }

/* ═══════════════════════════════════════════════════════
   ── Визуальный редизайн — второй слой ─────────────────
   ═══════════════════════════════════════════════════════ */

/* Stat-cards — иконки + выравнивание */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1;
    opacity: 0.92;
}

/* Page-hero — радиальный гlow + лучше subtitle */
.page-hero {
    background: linear-gradient(135deg, #0D3A8C 0%, #1557C0 55%, #1565C0 100%);
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    top: -60%; right: -10%;
    width: 520px; height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.09), transparent 68%);
    pointer-events: none;
}
.page-hero::after {
    content: '';
    position: absolute;
    bottom: -40%; left: -5%;
    width: 380px; height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.12), transparent 68%);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero-title { text-shadow: 0 2px 16px rgba(0,0,0,0.25); }
.page-hero-subtitle { opacity: 0.88; max-width: 680px; }

/* content-page h2 — акцентная полоска слева */
.content-page h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid #EEF2FF;
    padding-bottom: 0.45rem;
    color: #0F172A;
}
.content-page h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.15em;
    border-radius: 2px;
    background: linear-gradient(180deg, #3B82F6, #2563EB);
    flex-shrink: 0;
}

/* API — endpoint карточки */
.endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.75rem 0 1.25rem;
}
.endpoint-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    transition: background 0.15s, border-color 0.15s;
}
.endpoint-item:hover { background: #EFF6FF; border-color: #BFDBFE; }
.method-badge {
    flex-shrink: 0;
    width: 50px;
    text-align: center;
    padding: 0.22rem 0;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-family: Consolas, monospace;
}
.method-post { background: #DBEAFE; color: #1D4ED8; }
.method-get  { background: #DCFCE7; color: #166534; }
.endpoint-path {
    font-family: Consolas, monospace;
    font-size: 0.88rem;
    color: #0D47A1;
    flex-shrink: 0;
    min-width: 200px;
}
.endpoint-desc { color: #475569; font-size: 0.88rem; line-height: 1.4; }

/* 404 / 500 — декоративный большой код */
.error-visual {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-top: 0.5rem;
}
.error-code {
    display: block;
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}
.error-emoji { font-size: 2.25rem; display: block; margin-bottom: 0.5rem; }
.error-visual + p { text-align: center; font-size: 1.05rem; color: #475569; }

/* Formats-box — цветные теги */
.formats-box .word-tag {
    background: linear-gradient(135deg, #EFF6FF, #E8F4FD);
    border-color: #BFDBFE;
    color: #1D4ED8;
    font-weight: 500;
}
.formats-box .word-tag:hover { background: #DBEAFE; border-color: #93C5FD; }

/* Pricing badge */
.pricing-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Dark mode для нового слоя */
[data-theme="dark"] .endpoint-item { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .endpoint-item:hover { background: #243050; border-color: #3B82F6; }
[data-theme="dark"] .endpoint-path { color: #93C5FD; }
[data-theme="dark"] .endpoint-desc { color: #94A3B8; }
[data-theme="dark"] .method-post { background: #1e3a8a; color: #93C5FD; }
[data-theme="dark"] .method-get  { background: #14532d; color: #86EFAC; }
[data-theme="dark"] .error-code { background: linear-gradient(135deg, #60A5FA, #A78BFA); -webkit-background-clip: text; background-clip: text; }
[data-theme="dark"] .error-visual + p { color: #94A3B8; }
[data-theme="dark"] .content-page h2 { color: #F1F5F9; border-bottom-color: #334155; }
[data-theme="dark"] .formats-box .word-tag { background: #1e3a8a; border-color: #2563EB; color: #93C5FD; }

/* ═══════════════════════════════════════════════════════
   ── Визуальный редизайн — третий слой ─────────────────
   ═══════════════════════════════════════════════════════ */

/* «Вернуться наверх» */
.back-to-top {
    position: fixed;
    bottom: 5.5rem; right: 1.5rem;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(59,130,246,0.45);
    opacity: 0;
    transform: translateY(12px) scale(0.88);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s;
    z-index: 997;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px) scale(1.08) !important;
    box-shadow: 0 8px 22px rgba(59,130,246,0.6);
}
[data-theme="dark"] .back-to-top { box-shadow: 0 4px 14px rgba(37,99,235,0.65); }

/* Кнопка копирования кода */
.api-code-wrapper { position: relative; }
.api-code-wrapper .api-code { margin-top: 0; }
.copy-code-btn {
    position: absolute;
    top: 0.55rem; right: 0.55rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    color: #93C5FD;
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 0.22rem 0.65rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1.7;
    letter-spacing: 0.02em;
}
.copy-code-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }
.copy-code-btn.copied { color: #4CAF50; border-color: rgba(76,175,80,0.55); }

/* Усиленное кольцо фокуса */
.form-textarea:focus,
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 3px rgba(96,165,250,0.28);
}

/* Акцентная линия подвала */
.footer { border-top: 3px solid var(--primary); }
.footer-section ul li { margin-bottom: 0.4rem; }
.footer-section p { margin-bottom: 0.4rem; font-size: 0.9rem; color: rgba(255,255,255,0.72); }

/* Адаптив для back-to-top */
@media (max-width: 768px) {
    .back-to-top { bottom: 4rem; right: 1rem; width: 38px; height: 38px; font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════════════
   ── Аудит тёмной темы — исправления ───────────────────
   ═══════════════════════════════════════════════════════ */

/* html bg — нет мерцания при скролле за границу */
[data-theme="dark"] html { background: #0F172A; }

/* 🔴 КРИТИЧНО: Подвал — var(--text-primary) в тёмном = #F1F5F9 (белый!) */
[data-theme="dark"] .footer { background: #020817; }
[data-theme="dark"] .footer-section h3 { color: #F1F5F9; }
[data-theme="dark"] .card:hover { box-shadow: 0 18px 30px -12px rgba(0,0,0,0.45); }

/* FAQ: контейнер + открытый элемент (перекрывает .faq-box details[open]) */
[data-theme="dark"] .faq-box { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .faq-box details[open] { background: #243050; border-color: #3B82F6; }
[data-theme="dark"] .faq-box summary { color: #F1F5F9; }
[data-theme="dark"] .faq-box details p { color: #94A3B8; }

/* Тарифные карточки */
[data-theme="dark"] .pricing-card { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .pricing-card.active { border-color: #3B82F6; box-shadow: 0 6px 20px rgba(59,130,246,0.22); }
[data-theme="dark"] .pricing-meta { color: #94A3B8; }

/* Таблица */
[data-theme="dark"] .simple-table { border-color: #334155; }
[data-theme="dark"] .simple-table th { background: #162032; color: #93C5FD; }
[data-theme="dark"] .simple-table th,
[data-theme="dark"] .simple-table td { border-bottom-color: #334155; }
[data-theme="dark"] .simple-table td { color: #CBD5E1; }
[data-theme="dark"] .simple-table tr:hover td { background: rgba(255,255,255,0.03); }

/* code-inline */
[data-theme="dark"] .content-page code { background: #162032; color: #93C5FD; }

/* step-list карточки */
[data-theme="dark"] .step-list li { background: #1E293B; border-color: #334155; color: #CBD5E1; }

/* legal-note */
[data-theme="dark"] .legal-note { background: #2D0F0F; color: #FCA5A5; border-left-color: #EF4444; }

/* formats-box */
[data-theme="dark"] .formats-box { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .formats-box h3 { color: #93C5FD; }

/* batch-violation-category */
[data-theme="dark"] .batch-violation-category { background: #1E293B; border-left-color: #FB923C; }
[data-theme="dark"] .batch-violation-category.critical { background: #2D0F0F; border-left-color: #EF4444; }
[data-theme="dark"] .batch-violation-category h5 { color: #F1F5F9; }

/* recommendation */
[data-theme="dark"] .recommendation            { background: #1E293B; }
[data-theme="dark"] .recommendation.critical   { background: #2D0F0F; border-left-color: #EF4444; }
[data-theme="dark"] .recommendation.warning    { background: #2A1A00; border-left-color: #FB923C; }
[data-theme="dark"] .recommendation.success    { background: #052e16; border-left-color: #4CAF50; }
[data-theme="dark"] .recommendation.info       { background: #0c1e3a; border-left-color: #3B82F6; }
[data-theme="dark"] .rec-content h5 { color: #F1F5F9; }

/* alert-info */
[data-theme="dark"] .alert-info { background: #0c1e3a; color: #93C5FD; border-left-color: #3B82F6; }

/* word-detail separator */
[data-theme="dark"] .word-detail { border-bottom-color: #334155; }

/* deep-check мелкий текст */
[data-theme="dark"] .word-reason      { color: #64748B; }
[data-theme="dark"] .word-suggestions { color: #4CAF50; }

/* run-history детали */
[data-theme="dark"] .run-type     { color: #93C5FD; }
[data-theme="dark"] .run-context  { color: #94A3B8; }
[data-theme="dark"] .run-meta     { color: #64748B; }
[data-theme="dark"] .run-endpoint { color: #CBD5E1; }

/* trend */
[data-theme="dark"] .trend-block              { border-top-color: #334155; }
[data-theme="dark"] .trend-block h3           { color: #93C5FD; }
[data-theme="dark"] .trend-day,
[data-theme="dark"] .trend-val                { color: #94A3B8; }
[data-theme="dark"] .trend-bar-wrap           { background: #334155; }

/* timeline — соединительная линия */
[data-theme="dark"] .timeline-list > li:not(:last-child)::after {
    background: linear-gradient(to bottom, #3B82F6, #1E293B);
}

/* violation h3 */
[data-theme="dark"] .violation-section h3 { color: #FDBA74; }
[data-theme="dark"] .violation-section.critical {
    background: linear-gradient(135deg,#2D0F0F,#3D1A1A);
    border-left-color: #EF4444;
}

/* shadows in dark mode */
[data-theme="dark"] .knowledge-card:hover,
[data-theme="dark"] .workflow-step:hover,
[data-theme="dark"] .audience-card:hover { box-shadow: 0 18px 28px -12px rgba(0,0,0,0.5); }

/* ─── Раунд 2: card-header, deep-check, highlight, misc ─── */

/* card-header: добавлен белый градиент в визуальном слое — переопределяем */
[data-theme="dark"] .card-header {
    background: linear-gradient(180deg, #1E293B 0%, #162032 100%);
    border-color: var(--divider);
}

/* tab-btn: аналогично — визуальный слой добавил белый градиент */
[data-theme="dark"] .tab-btn {
    background: linear-gradient(180deg, #1E293B 0%, #162032 100%);
    border-color: #334155;
    color: var(--text-primary);
}

/* result-box */
[data-theme="dark"] .result-box { background: #162032; }

/* Deep check */
[data-theme="dark"] .deep-check-results {
    background: linear-gradient(135deg, #0c1e3a 0%, #162032 100%);
    border-left-color: #3B82F6;
}
[data-theme="dark"] .deep-check-results h3 { color: #93C5FD; }
[data-theme="dark"] .deep-valid   { background: #052e16; color: #86EFAC; }
[data-theme="dark"] .deep-abbr    { background: #2e1065; color: #C4B5FD; }
[data-theme="dark"] .deep-invalid { background: #2D0F0F; color: #FCA5A5; }
[data-theme="dark"] .deep-section { background: #162032; }
[data-theme="dark"] .deep-section.abbreviation { background: #2e1065; border-left-color: #8B5CF6; }
[data-theme="dark"] .deep-section.batch { background: #0c1e3a; border-left-color: #3B82F6; }
[data-theme="dark"] .deep-subsection { border-bottom-color: #334155; }

/* Image db summary */
[data-theme="dark"] .image-db-summary { background: #1E293B; border-color: #334155; }

/* Задизейбленные поля в мультискане */
[data-theme="dark"] #multiscan-tab .form-textarea:disabled,
[data-theme="dark"] #multiscan-tab .form-input:disabled { background: #162032; color: #64748B; }

/* Highlight overlay legend */
[data-theme="dark"] .highlight-legend { border-bottom-color: #334155; }

/* Inline highlight marks в тёмной теме */
[data-theme="dark"] mark.hl-critical { background: #7F1D1D; color: #FCA5A5; }
[data-theme="dark"] mark.hl-latin    { background: #78350F; color: #FED7AA; }
[data-theme="dark"] mark.hl-unknown  { background: #713F12; color: #FEF08A; }
[data-theme="dark"] .hl-critical-badge { background: #7F1D1D; color: #FCA5A5; }
[data-theme="dark"] .hl-latin-badge    { background: #78350F; color: #FED7AA; }
[data-theme="dark"] .hl-unknown-badge  { background: #713F12; color: #FEF08A; }

/* ═══════════════════════════════════════════════════════
   ── Профессиональный финишный слой ────────────────────
   ═══════════════════════════════════════════════════════ */

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Выделение текста */
::selection { background: rgba(59,130,246,0.22); color: inherit; }
[data-theme="dark"] ::selection { background: rgba(96,165,250,0.3); color: inherit; }

/* Hero badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.92);
    margin-bottom: 1rem;
    backdrop-filter: blur(6px);
}

/* card-header: subtitle (p.text-muted) — на отдельную строку */
.card-header { flex-wrap: wrap; }
.card-header > p.text-muted {
    width: 100%;
    order: 9;
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    flex-shrink: 0;
}

/* Form labels */
label.text-muted {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748B;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    display: block;
}
[data-theme="dark"] label.text-muted { color: #64748B; }

/* field-meta — пилюля с счётчиком */
.field-meta {
    display: inline-flex;
    align-items: center;
    margin-top: 0.45rem;
    padding: 0.18rem 0.65rem;
    background: #F1F5F9;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    font-size: 0.76rem;
    color: #64748B;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background 0.2s;
}
[data-theme="dark"] .field-meta { background: #1E293B; border-color: #334155; color: #64748B; }

/* Textarea: лучшая читаемость */
.form-textarea { line-height: 1.7; }

/* Knowledge cards: цветные топ-акценты */
.knowledge-card:nth-child(1) { border-top: 3px solid #3B82F6; }
.knowledge-card:nth-child(2) { border-top: 3px solid #8B5CF6; }
.knowledge-card:nth-child(3) { border-top: 3px solid #10B981; }

/* Tab content: плавный fade при переключении */
.tab-content.active {
    animation: tabFadeIn 0.22s ease-out both;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .tab-content.active { animation: none; }
}

/* Loading overlay: blur backdrop */
.loading-overlay { backdrop-filter: blur(4px); }

/* Stat card: разделитель под иконкой */
.stat-icon { border-bottom: 1px solid rgba(255,255,255,0.12); padding-bottom: 0.45rem; margin-bottom: 0.65rem; width: 100%; }

/* Hero title: чуть крупнее на широких экранах */
@media (min-width: 900px) {
    .hero-title { font-size: 2.85rem; }
    .hero-subtitle { font-size: 1.15rem; }
}

/* Progress: indeterminate анимация для batch-запроса */
@keyframes progress-indeterminate {
    0%   { opacity: 0.7; width: 45%; }
    50%  { opacity: 1;   width: 75%; }
    100% { opacity: 0.7; width: 45%; }
}

/* Drag-and-drop: визуальный отклик при перетаскивании файла в textarea */
.form-textarea.drag-over {
    border-color: #3B82F6;
    background: rgba(59,130,246,0.06);
    outline: 2px dashed #3B82F6;
    outline-offset: -2px;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}
[data-theme="dark"] .form-textarea.drag-over {
    background: rgba(59,130,246,0.1);
}

/* URL поле с кнопкой очистки */
.url-field-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.url-field-wrap .form-input {
    padding-right: 2.2rem;
    width: 100%;
    box-sizing: border-box;
}
.url-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94A3B8;
    font-size: 0.85rem;
    padding: 0.15rem 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}
.url-clear-btn:hover { color: #EF4444; }
[data-theme="dark"] .url-clear-btn { color: #64748B; }
[data-theme="dark"] .url-clear-btn:hover { color: #FCA5A5; }

/* Подсказка горячей клавиши рядом с кнопкой проверки */
.kbd-hint {
    display: inline-block;
    font-size: 0.72rem;
    color: #94A3B8;
    background: rgba(0,0,0,0.06);
    border: 1px solid #CBD5E1;
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
    vertical-align: middle;
    margin-left: 0.35rem;
    letter-spacing: 0.02em;
    font-family: monospace;
}
[data-theme="dark"] .kbd-hint {
    color: #64748B;
    background: rgba(255,255,255,0.06);
    border-color: #334155;
}

/* Ghost button — прозрачный, только рамка */
.btn-ghost {
    background: transparent;
    border: 1px solid #CBD5E1;
    color: #64748B;
    box-shadow: none;
}
.btn-ghost:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
    color: #334155;
}
[data-theme="dark"] .btn-ghost {
    border-color: #334155;
    color: #64748B;
}
[data-theme="dark"] .btn-ghost:hover {
    background: #1E293B;
    border-color: #475569;
    color: #94A3B8;
}

/* Images tab: логические группы действий */
.images-action-groups {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
}
.images-action-groups .btn-group {
    margin-top: 0;
}
.images-step-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.images-step-label {
    font-size: 0.8rem;
    color: #94A3B8;
    font-style: italic;
    white-space: nowrap;
}
.images-util-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px solid #E2E8F0;
    margin-top: 0.15rem;
}
[data-theme="dark"] .images-util-group { border-color: #334155; }
[data-theme="dark"] .images-step-label { color: #475569; }

/* Empty state hint в карточках результатов */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
}
.empty-state-icon {
    font-size: 2rem;
    line-height: 1;
    opacity: 0.5;
}
.empty-state-hint {
    color: #94A3B8;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
    margin: 0;
}
[data-theme="dark"] .empty-state-hint { color: #475569; }

/* field-meta с предупреждением о длинном тексте */
.field-meta.field-meta-warn {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}
[data-theme="dark"] .field-meta.field-meta-warn {
    background: #451A03;
    border-color: #92400E;
    color: #FCD34D;
}

/* Word-tag: кликабельные — показываем указатель и hover эффект */
.word-tag {
    cursor: pointer;
}
.word-tag:hover {
    filter: brightness(0.9) saturate(1.2);
    transform: translateY(-1px);
    transition: filter 0.15s, transform 0.15s;
}

/* Danger button */
.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border-color: transparent;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

/* Loading overlay: контекстное сообщение */
.loading-overlay p {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-top: 0.75rem;
    letter-spacing: 0.02em;
}

/* Batch results: обновлённый заголовок со сводкой */
#batchResults .card-header h2,
#multiResults .card-header h2 {
    font-size: 1.05rem;
}

/* Step-group label */
.images-step-label {
    font-size: 0.78rem;
}

/* ── Batch toolbar: фильтры + expand/collapse ─────────────────── */
.batch-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    position: sticky;
    top: 72px;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .batch-toolbar {
    background: #0F172A;
    border-color: #334155;
}
.batch-filter-group,
.batch-expand-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.batch-filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.2rem;
}
.batch-filter-btn {
    background: white;
    border: 1px solid #CBD5E1;
    border-radius: 20px;
    padding: 0.28rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
    white-space: nowrap;
}
.batch-filter-btn:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
}
.batch-filter-btn.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}
.batch-filter-btn.success { border-color: #4CAF50; color: #166534; }
.batch-filter-btn.success.active { background: #4CAF50; color: white; }
.batch-filter-btn.error { border-color: #EF4444; color: #991B1B; }
.batch-filter-btn.error.active { background: #EF4444; color: white; }
[data-theme="dark"] .batch-filter-btn {
    background: #1E293B;
    border-color: #334155;
    color: #94A3B8;
}
[data-theme="dark"] .batch-filter-btn:hover {
    background: #243050;
}
[data-theme="dark"] .batch-filter-btn.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}

/* ── Print стили ──────────────────────────────────────────────── */
@page {
    size: A4;
    margin: 1.5cm 2cm;
}

@media print {
    /* Скрыть интерфейсные элементы */
    .header, .hero, .tabs, .btn-group, .batch-toolbar,
    .loading-overlay, #toastContainer, .back-to-top,
    .reveal-item:not(.is-visible), footer, .field-meta,
    .progress-container, .images-action-groups,
    .deep-check-trigger, nav, .quick-links,
    /* Скрыть все кнопки внутри результатов */
    .btn, button, .highlight-btn,
    /* Скрыть overlay подсветки */
    .highlight-overlay {
        display: none !important;
    }

    /* Сброс фона и нормальный шрифт */
    html, body {
        background: white !important;
        color: #0F172A !important;
        font-size: 10pt !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .container { max-width: 100%; padding: 0; }

    .card {
        border: 1px solid #CBD5E1;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    .card-header { background: #F8FAFC !important; }

    /* Не разрывать секции нарушений и статистику */
    .violation-section,
    .result-status,
    .stats-summary,
    .batch-item,
    .multi-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .batch-item { border: 1px solid #E2E8F0; }
    .word-tag { border: 1px solid #CBD5E1; background: #F1F5F9 !important; color: #334155 !important; }
    .result-stats-grid { grid-template-columns: repeat(3, 1fr); }

    /* Не дописывать URL рядом со ссылками */
    a[href]::after { content: none !important; }
}

/* chip-row теги в knowledge-cards — не кликабельные */
.chip-row .word-tag {
    cursor: default;
    pointer-events: none;
}
.chip-row .word-tag:hover {
    filter: none;
    transform: none;
}

/* Batch search input в toolbar */
.batch-search-group {
    flex: 1;
    min-width: 140px;
    max-width: 280px;
}
.batch-search-input {
    width: 100%;
    padding: 0.3rem 0.75rem;
    border: 1px solid #CBD5E1;
    border-radius: 20px;
    font-size: 0.85rem;
    background: white;
    color: #334155;
    outline: none;
    transition: border-color 0.15s;
}
.batch-search-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}
[data-theme="dark"] .batch-search-input {
    background: #1E293B;
    border-color: #334155;
    color: #F1F5F9;
}
[data-theme="dark"] .batch-search-input:focus {
    border-color: #3B82F6;
}

/* История недавних слов (word-tab) */
.word-history {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
}
.word-history:empty { display: none; }
.word-history-label {
    font-size: 0.78rem;
    color: #94A3B8;
    flex-shrink: 0;
}
.word-history-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.55rem;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}
.word-history-chip:hover { background: #E2E8F0; border-color: #94A3B8; }
.word-history-chip .chip-remove {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}
.word-history-chip .chip-remove:hover { color: #EF4444; }
[data-theme="dark"] .word-history-chip {
    background: #334155;
    border-color: #475569;
    color: #CBD5E1;
}
[data-theme="dark"] .word-history-chip:hover { background: #475569; }

/* Кнопка «Наверх» */
.back-to-top {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 9000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #3B82F6;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(59,130,246,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover { background: #2563EB; }

/* Batch — пустое состояние при фильтрации */
.batch-empty-state {
    display: none;
    text-align: center;
    padding: 2rem 1rem;
    color: #94A3B8;
    font-size: 0.95rem;
}
.batch-empty-state.visible { display: block; }

/* Кнопка «Очистить» в истории слов */
.word-history-clear {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    text-decoration: underline;
    transition: color 0.15s;
}
.word-history-clear:hover { color: #EF4444; }

/* История запусков — улучшенный вид */
.run-status-icon { font-size: 0.85rem; flex-shrink: 0; }
.run-type-icon   { font-size: 0.95rem; margin-right: 0.15rem; }
.run-violations  { color: #EF4444; font-weight: 600; font-size: 0.8rem; }
.run-date        { color: #94A3B8; font-size: 0.78rem; white-space: nowrap; }
.run-time        { color: #64748B; font-size: 0.78rem; }
.run-context     {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748B;
    font-size: 0.82rem;
}

/* URL input: inline валидация */
.form-input.input-invalid {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}
.form-input.input-valid {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.1);
}

/* Batch: счётчик видимых элементов */
.batch-visible-count {
    font-size: 0.82rem;
    color: #64748B;
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
    align-self: center;
    margin-left: auto;
}

/* Print: скрытие карточек при печати конкретной */
@media print {
    .print-hidden { display: none !important; }
}

/* Фильтр истории запусков */
.run-history-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.run-filter-btn {
    padding: 0.2rem 0.6rem;
    border: 1px solid #CBD5E1;
    border-radius: 20px;
    background: white;
    color: #475569;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.run-filter-btn:hover { background: #F1F5F9; border-color: #94A3B8; }
.run-filter-btn.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}
[data-theme="dark"] .run-filter-btn {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}
[data-theme="dark"] .run-filter-btn:hover { background: #334155; }
[data-theme="dark"] .run-filter-btn.active { background: #3B82F6; border-color: #3B82F6; color: white; }

/* Batch sort group */
.batch-sort-group { display: flex; align-items: center; }
.batch-sort-group select.batch-search-input {
    max-width: 160px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
}

/* Кнопка копирования URL в batch-item */
.batch-copy-url-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.25rem;
    opacity: 0.4;
    transition: opacity 0.15s;
    flex-shrink: 0;
    line-height: 1;
}
.batch-item:hover .batch-copy-url-btn,
.batch-copy-url-btn:hover { opacity: 0.9; }

/* Timestamp последней проверки */
.check-timestamp {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #94A3B8;
    margin-top: 0.1rem;
}

/* Модальное окно горячих клавиш */
.kb-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.kb-modal-overlay.kb-visible { opacity: 1; }
.kb-modal {
    background: var(--surface, white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    max-width: 480px;
    width: 92%;
    overflow: hidden;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.22s ease;
}
.kb-modal-overlay.kb-visible .kb-modal { transform: scale(1) translateY(0); }
.kb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #E2E8F0;
}
.kb-modal-header h3 { margin: 0; font-size: 1.05rem; }
.kb-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #64748B;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.kb-modal-close:hover { background: #F1F5F9; }
.kb-modal-body { padding: 1rem 1.25rem 1.25rem; }
.kb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.kb-table td { padding: 0.45rem 0.5rem; vertical-align: middle; }
.kb-table td:first-child { white-space: nowrap; padding-right: 1.25rem; }
.kb-table tr:nth-child(even) td { background: #F8FAFC; border-radius: 6px; }
.kb-table kbd {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 5px;
    font-size: 0.82rem;
    font-family: monospace;
    color: #334155;
    box-shadow: 0 1px 0 #CBD5E1;
}
.kb-modal-hint { font-size: 0.8rem; color: #94A3B8; margin: 0.75rem 0 0; }
[data-theme="dark"] .kb-modal { background: #1E293B; }
[data-theme="dark"] .kb-modal-header { border-color: #334155; }
[data-theme="dark"] .kb-table tr:nth-child(even) td { background: #0F172A; }
[data-theme="dark"] .kb-table kbd { background: #334155; border-color: #475569; color: #CBD5E1; box-shadow: 0 1px 0 #475569; }
[data-theme="dark"] .kb-modal-close:hover { background: #334155; }


/* ── Mobile UX: touch targets, nav overflow, highlight overlay ─ */

/* Touch targets: мин. 44px на мобильных для всех мелких кнопок */
@media (max-width: 768px) {
    .spoiler-toggle-btn,
    .batch-details-btn,
    .url-clear-btn,
    .dark-toggle,
    .back-to-top {
        min-height: 44px;
        min-width: 44px;
    }
    .spoiler-toggle-btn {
        padding: 0.4rem 0.9rem;
    }
}

/* Nav: горизонтальный скролл при нехватке места (< 420px) */
@media (max-width: 420px) {
    .nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav-link { flex-shrink: 0; }
}

/* highlight-overlay: не выше 70vh на мобильных */
@media (max-width: 768px) {
    .highlight-overlay {
        max-height: min(380px, 70vh);
    }
}

/* word-tag hover только на устройствах с мышью */
@media (hover: none) {
    .word-tag:hover { transform: none; box-shadow: none; }
    .word-tag:active { opacity: 0.75; }
}

/* stat-icon уменьшаем на маленьких экранах */
@media (max-width: 480px) {
    .stat-icon { font-size: 1.25rem; }
    .stat-card  { padding: 0.75rem; }
}




