/* ============================================
   IDENTITY GENERATOR STYLES
   ============================================ */
.generator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.generator-header {
    text-align: center;
    margin-bottom: 40px;
}

.generator-title {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.generator-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4a9eff 0%, #2d7cd6 100%);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(74, 158, 255, 0.3);
}

.generator-title-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.generator-title-text {
    color: #fff;
}

.generator-subtitle {
    color: #888;
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
}

/* Controls Section */
.generator-controls {
    background: #272727;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.controls-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 150px;
}

/* Compact control groups (Age, Mode, Count, Buttons) — no grow, no min-width */
.control-group[style*="flex: 0"] {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

/* Button group always stays together with history */
.controls-btn-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-shrink: 0;
}

.control-label {
    display: block;
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-select {
    width: 100%;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.control-select:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.2);
}

.generate-btn {
    background: linear-gradient(135deg, #4a9eff 0%, #2d7cd6 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 158, 255, 0.3);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    display: block;
    /* Убрали display:none — секция всегда в потоке, placeholder резервирует высоту.
       Это убирает CLS: JS только обновляет данные, а не показывает целый блок. */
}

.results-section.active {
    display: block;
    /* animation убран с initial reveal — карточка уже видна.
       Анимация refresh внутри карточки (.id-refresh) остаётся. */
}

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

/* Identity Card */
.identity-card {
    background: #272727;
    border-radius: 16px;
    border: 1px solid #333;
    overflow: hidden;
    margin-bottom: 25px;
}

.identity-header {
    background: linear-gradient(135deg, #4a9eff 0%, #2d7cd6 100%);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.identity-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.identity-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    border: 3px solid rgba(255,255,255,0.3);
}

.identity-name {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.identity-country {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    margin-top: 5px;
}

.identity-country-flag {
    font-size: 20px;
}

.identity-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: #fff;
    color: #4a9eff;
}

.action-btn.primary:hover {
    background: #f0f0f0;
}

/* Synthetic Badge */
.id-synthetic-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 3px 8px;
    pointer-events: none;
}

/* Card refresh animation */
.identity-card.id-refresh .identity-body {
    animation: idRefreshPulse 0.35s ease;
}

@keyframes idRefreshPulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Identity Body */
.identity-body {
    padding: 30px;
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.identity-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #4a9eff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

.section-title-icon {
    font-size: 18px;
}

/* Data Row */
.data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
}

.data-value {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-align: right;
}

.data-value.mono {
    font-family: 'Roboto Mono', monospace;
}

.copy-btn {
    background: rgba(74, 158, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    color: #4a9eff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(74, 158, 255, 0.2);
}

.copy-btn.copied {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

/* Full Address Block */
.full-address {
    background: #222;
    border-radius: 10px;
    padding: 12px 15px;
    margin-top: 15px;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #ccc;
    word-break: break-word;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.full-address #fullAddress {
    flex: 1;
    min-width: 0;
}

.full-address .copy-btn {
    position: static;
    flex-shrink: 0;
}

/* Gender Badge */
.gender-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.gender-badge.male {
    background: rgba(74, 158, 255, 0.2);
    color: #64B5F6;
}

.gender-badge.female {
    background: rgba(233, 30, 99, 0.2);
    color: #F48FB1;
}

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

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(74, 158, 255, 0.2);
    border-top-color: #4a9eff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #4a9eff;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Format Toggle (inline in data labels) */
.id-fmt-toggle {
    display: inline-block;
    background: rgba(74, 158, 255, 0.08);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #4a9eff;
    cursor: pointer;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    margin-left: 6px;
    vertical-align: middle;
}

.id-fmt-toggle:hover {
    background: rgba(74, 158, 255, 0.18);
    border-color: #4a9eff;
}

/* Age Range Control */
.id-age-display {
    color: #4a9eff;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

.id-age-range {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
    padding: 8px 0;
}

.id-range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.id-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.id-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.id-range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a9eff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* Consistency Matrix */
.id-consistency {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    margin-bottom: 25px;
    background: #272727;
    border-radius: 12px;
    border: 1px solid #333;
}

.id-consistency-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.id-consistency-checks {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.id-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.id-check.pass {
    color: #888;
}

.id-check.pass .id-check-icon {
    color: #4CAF50;
}

.id-check.fail {
    color: #888;
}

.id-check.fail .id-check-icon {
    color: #ff6b6b;
}

.id-check-icon {
    font-size: 13px;
    font-weight: 700;
}

/* Mode Switch */
.id-mode-switch {
    display: inline-flex;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    overflow: hidden;
}

.id-mode-btn {
    background: none;
    border: none;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.id-mode-btn:hover {
    color: #aaa;
}

.id-mode-btn.active {
    background: rgba(74, 158, 255, 0.15);
    color: #4a9eff;
}

/* Bulk Results Section */
.id-bulk-section {
    background: #272727;
    border-radius: 16px;
    border: 1px solid #333;
    overflow: hidden;
    margin-bottom: 25px;
    animation: fadeInUp 0.4s ease;
}

.id-bulk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 12px;
}

.id-bulk-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
}

.id-bulk-title-icon {
    font-size: 16px;
}

.id-bulk-badge {
    background: #4a9eff;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.id-bulk-actions {
    display: flex;
    gap: 8px;
}

.id-bulk-action-btn {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #4a9eff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.id-bulk-action-btn:hover {
    background: rgba(74, 158, 255, 0.2);
    transform: translateY(-1px);
}

.id-bulk-table-wrap {
    overflow-x: auto;
}

.id-bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.id-bulk-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
    white-space: nowrap;
    background: rgba(0,0,0,0.15);
}

.id-bulk-table tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.id-bulk-table tbody tr:hover {
    background: rgba(74, 158, 255, 0.05);
}

.id-bulk-table tbody td {
    padding: 10px 16px;
    color: #ccc;
    white-space: nowrap;
}

.id-bulk-table tbody td:first-child {
    color: #555;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
}

.id-bulk-table .bulk-name-cell {
    font-weight: 600;
    color: #fff;
}

.id-bulk-table .bulk-email-cell {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #aaa;
}

.id-bulk-table .bulk-phone-cell {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
}

.id-bulk-row-copy {
    background: rgba(74, 158, 255, 0.08);
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    color: #4a9eff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.id-bulk-row-copy:hover {
    background: rgba(74, 158, 255, 0.2);
}

/* History Button & Dropdown */
.id-history-wrapper {
    position: relative;
}

.id-history-btn {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 0 14px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
}

.id-history-btn:hover {
    border-color: #4a9eff;
    color: #4a9eff;
}

.id-history-btn.active {
    border-color: #4a9eff;
    color: #4a9eff;
    background: rgba(74, 158, 255, 0.08);
}

.id-history-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #4a9eff;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.id-history-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 100;
    overflow: hidden;
}

.id-history-dropdown.open {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.id-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.id-history-clear {
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.id-history-clear:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.id-history-list {
    max-height: 360px;
    overflow-y: auto;
}

.id-history-list::-webkit-scrollbar {
    width: 4px;
}

.id-history-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

.id-history-empty {
    padding: 24px 16px;
    text-align: center;
    color: #555;
    font-size: 13px;
}

.id-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.id-history-item:last-child {
    border-bottom: none;
}

.id-history-item:hover {
    background: rgba(74, 158, 255, 0.08);
}

.id-history-item-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #4a9eff;
    flex-shrink: 0;
}

.id-history-item-info {
    flex: 1;
    min-width: 0;
}

.id-history-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.id-history-item-meta {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.id-history-item-flag {
    font-size: 16px;
    flex-shrink: 0;
}

/* Metrics Ribbon (inside controls block) */
.id-metrics-ribbon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.id-ribbon-item {
    font-size: 12px;
    color: #555;
    letter-spacing: 0.3px;
    padding: 0 14px;
}

.id-ribbon-value {
    color: #4a9eff;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
}

.id-ribbon-dot {
    color: #3a3a3a;
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

/* ============================================
   RESPONSIVE — TABLET (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .generator-container {
        padding: 24px 16px;
    }

    .generator-header {
        margin-bottom: 24px;
    }

    .generator-title {
        font-size: 28px;
        gap: 10px;
    }

    .generator-title-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .generator-title-icon svg {
        width: 24px;
        height: 24px;
    }

    .generator-subtitle {
        font-size: 15px;
    }

    /* ── Controls: 2-column grid ── */
    .generator-controls {
        padding: 20px 16px;
    }

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

    .control-group,
    .control-group[style*="flex: 0"] {
        width: 100% !important;
        flex: unset !important;
        min-width: 0 !important;
    }

    /* Mode and Count side by side in one row */
    .controls-row > .control-group:nth-child(4) { /* Mode */
        order: 4;
    }
    .controls-row > .id-bulk-count-group { /* Count */
        order: 5;
    }

    /* Button group spans full width, always last */
    .control-group:last-child {
        grid-column: 1 / -1;
        order: 10;
    }

    .control-label {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .control-select {
        padding: 12px 14px;
        font-size: 14px;
    }

    /* Generate button full width */
    .controls-btn-group {
        width: 100%;
    }

    .generate-btn {
        flex: 1;
        justify-content: center;
        padding: 14px 16px;
        min-height: 48px;
    }

    .id-history-btn {
        min-height: 48px;
        padding: 0 16px;
    }

    /* Age range stretch */
    .id-age-range {
        min-width: 0;
    }

    /* Mode switch full width */
    .id-mode-switch {
        display: flex;
        width: 100%;
    }

    .id-mode-btn {
        flex: 1;
        text-align: center;
        padding: 12px 14px;
    }

    /* Bulk count select full width */
    .id-bulk-count-group .control-select {
        min-width: 0 !important;
    }

    /* ── Metrics Ribbon ── */
    .id-metrics-ribbon {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 0;
        padding: 12px 0 0;
        margin-top: 16px;
    }

    .id-ribbon-dot {
        display: none;
    }

    .id-ribbon-item {
        padding: 4px 12px;
        font-size: 11px;
    }

    /* ── Hero ── */
    .identity-hero {
        height: 220px;
        margin-bottom: 20px;
    }

    .hero-avatar {
        width: 64px;
        height: 64px;
        margin-bottom: 12px;
    }

    .hero-avatar-glow {
        inset: -10px;
    }

    .hero-fragment {
        font-size: 10px;
        padding: 3px 8px;
    }

    .hero-title {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .hero-subtitle {
        font-size: 11px;
        text-align: center;
        padding: 0 16px;
    }

    .hero-status {
        margin-top: 10px;
    }

    /* ── Card (keep here for tablet) ── */
    .identity-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }

    .identity-header-left {
        flex-direction: column;
    }

    .identity-avatar {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .identity-name {
        font-size: 22px;
    }

    .identity-actions {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .id-synthetic-badge {
        top: 8px;
        right: 12px;
    }

    .identity-body {
        padding: 20px 16px;
    }

    .identity-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .identity-section {
        padding: 16px;
    }

    .section-title {
        font-size: 12px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .data-row {
        padding: 10px 0;
    }

    .data-label {
        font-size: 12px;
    }

    .data-value {
        font-size: 14px;
        gap: 8px;
    }

    .copy-btn {
        min-height: 36px;
        min-width: 36px;
        padding: 6px 10px;
        justify-content: center;
    }

    .full-address {
        font-size: 13px;
        padding: 12px;
        padding-top: 40px;
    }

    /* ── Consistency Matrix ── */
    .id-consistency {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
    }

    .id-consistency-checks {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 16px;
        width: 100%;
    }

    .id-check {
        font-size: 11px;
    }

    /* ── Bulk Table ── */
    .id-bulk-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .id-bulk-title {
        font-size: 13px;
    }

    .id-bulk-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .id-bulk-action-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-height: 36px;
    }

    .id-bulk-table {
        min-width: 650px;
    }

    .id-bulk-table thead th {
        padding: 10px 12px;
        font-size: 10px;
    }

    .id-bulk-table tbody td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .id-bulk-row-copy {
        min-height: 36px;
        min-width: 36px;
        padding: 6px 10px;
    }

    /* ── Step 7: History Dropdown ── */
    .id-history-dropdown {
        width: 300px;
    }

    .id-history-list {
        max-height: 50vh;
    }

    .id-history-item {
        padding: 12px 16px;
        min-height: 48px;
    }

    .id-history-clear {
        padding: 6px 10px;
        min-height: 36px;
    }

    /* ── Step 8: Touch Targets ── */
    .id-fmt-toggle {
        padding: 4px 10px;
        font-size: 10px;
        min-height: 28px;
        display: inline-flex;
        align-items: center;
    }

    /* ── Step 9: Legal ── */
    .legal-section {
        padding: 30px 0 25px;
        margin-top: 40px;
    }

    .legal-badge {
        font-size: 11px;
        padding: 6px 16px;
    }

    .legal-block {
        padding: 20px;
    }

    .legal-block-title {
        font-size: 13px;
    }

    .legal-block-text {
        font-size: 12px;
        line-height: 1.6;
    }

    .legal-footer-note {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        padding-top: 20px;
    }
}

/* Country option with flag */
.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Highlight animation */
.highlight {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(74, 158, 255, 0.2); }
}

/* ============================================
   IDENTITY HERO — ENGINE SHOWCASE
   ============================================ */
.identity-hero {
    position: relative;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(74, 158, 255, 0.06) 0%, transparent 70%),
                linear-gradient(180deg, #1a1a1a 0%, #111 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 0 40px rgba(0, 100, 255, 0.04);
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Avatar */
.hero-avatar {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 20px;
}

.hero-avatar-svg {
    width: 100%;
    height: 100%;
    color: #4a9eff;
}

.hero-avatar-glow {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 158, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-scan-line {
    animation: heroScan 3s ease-in-out infinite;
}

@keyframes heroScan {
    0%, 100% { transform: translateY(-15px); opacity: 0.05; }
    50% { transform: translateY(15px); opacity: 0.15; }
}

/* Data Fragments */
.hero-fragments {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-fragment {
    position: absolute;
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid rgba(74, 158, 255, 0.12);
    border-radius: 6px;
    padding: 5px 12px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    color: rgba(74, 158, 255, 0.7);
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.8);
    transition: none;
    box-shadow: 0 2px 12px rgba(0, 100, 255, 0.06);
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-fragment .frag-label {
    color: #555;
    margin-right: 6px;
}

.hero-fragment .frag-value {
    color: rgba(74, 158, 255, 0.8);
}

/* Fragment spawn animation */
.hero-fragment.spawn {
    animation: fragSpawn 0.5s ease forwards;
}

@keyframes fragSpawn {
    0% { opacity: 0; transform: scale(0.7); }
    100% { opacity: 1; transform: scale(1); }
}

/* Fragment assembly (fade to subtle, JS handles transform) */
.hero-fragment.assemble {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.35;
}

/* Status */
.hero-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

.hero-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.hero-subtitle {
    font-size: 12px;
    color: #444;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.hero-subtitle.complete {
    color: #4CAF50;
}

/* Completion bar */
.hero-complete-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4a9eff, #4CAF50);
    border-radius: 0 0 16px 16px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-complete-bar.active {
    width: 100%;
}

/* ============================================
   RESPONSIVE — PHONE (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .generator-container {
        padding: 16px 12px;
    }

    .generator-title {
        font-size: 24px;
    }

    .generator-subtitle {
        font-size: 14px;
    }

    /* Controls: 2 columns (Mode+Count pair naturally) */
    .controls-row {
        grid-template-columns: 1fr 1fr;
    }

    /* Country, Gender, Age each span full width */
    .controls-row > .control-group:nth-child(1),
    .controls-row > .control-group:nth-child(2),
    .controls-row > .control-group:nth-child(3) {
        grid-column: 1 / -1;
    }

    /* When bulk mode active, Mode+Count share one row (auto 1fr 1fr) */
    /* Button group always full width */

    .generate-btn {
        font-size: 15px;
        padding: 14px;
    }

    /* Hero */
    .identity-hero {
        height: 190px;
    }

    .hero-avatar {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }

    .hero-avatar-glow {
        inset: -8px;
    }

    .hero-fragment {
        font-size: 9px;
        padding: 2px 6px;
    }

    /* Hide bottom 2 fragments on small screens to prevent overlap */
    .hero-fragment:nth-child(5),
    .hero-fragment:nth-child(6) {
        display: none;
    }

    .hero-title {
        font-size: 9px;
        letter-spacing: 0.8px;
    }

    .hero-subtitle {
        font-size: 10px;
    }

    /* Metrics tighter */
    .id-ribbon-item {
        font-size: 10px;
        padding: 3px 8px;
    }

    /* ── Card phone ── */
    .identity-header {
        padding: 16px;
    }

    .identity-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
        border-width: 2px;
    }

    .identity-name {
        font-size: 19px;
    }

    .identity-country {
        font-size: 13px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .identity-body {
        padding: 16px 12px;
    }

    .identity-section {
        padding: 14px 12px;
    }

    .data-row {
        padding: 8px 0;
        gap: 8px;
    }

    .data-label {
        font-size: 11px;
    }

    .data-value {
        font-size: 13px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .data-value.mono {
        font-size: 12px;
    }

    .copy-btn {
        min-height: 40px;
        min-width: 40px;
        padding: 8px;
    }

    .full-address {
        font-size: 12px;
        line-height: 1.6;
    }

    .action-btn {
        font-size: 12px;
        padding: 10px 12px;
        min-height: 44px;
    }

    /* ── Matrix phone: stack ── */
    .id-consistency {
        padding: 10px 12px;
        gap: 8px;
    }

    .id-consistency-label {
        font-size: 10px;
    }

    .id-consistency-checks {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* ── Bulk phone ── */
    .id-bulk-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .id-bulk-actions {
        width: 100%;
    }

    .id-bulk-action-btn {
        flex: 1;
        justify-content: center;
        min-height: 40px;
    }

    .id-bulk-table {
        min-width: 550px;
        font-size: 12px;
    }

    /* Hide Gender and City columns on phone */
    .id-bulk-table thead th:nth-child(3),
    .id-bulk-table tbody td:nth-child(3),
    .id-bulk-table thead th:nth-child(6),
    .id-bulk-table tbody td:nth-child(6) {
        display: none;
    }

    .id-bulk-row-copy {
        min-height: 40px;
        min-width: 40px;
    }

    /* ── Step 7: History Dropdown phone ── */
    .id-history-dropdown {
        width: calc(100vw - 32px);
        right: -12px;
    }

    .id-history-list {
        max-height: 45vh;
    }

    .id-history-item {
        padding: 14px 16px;
        min-height: 52px;
    }

    .id-history-item-avatar {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }

    .id-history-clear {
        padding: 8px 12px;
        min-height: 40px;
        font-size: 16px;
    }

    /* ── Step 8: Touch targets phone ── */
    .id-fmt-toggle {
        padding: 5px 12px;
        font-size: 10px;
        min-height: 30px;
    }

    /* ── Step 9: Legal phone ── */
    .legal-section {
        padding: 24px 0 20px;
        margin-top: 30px;
    }

    .legal-header {
        margin-bottom: 20px;
    }

    .legal-badge {
        font-size: 10px;
        padding: 5px 12px;
    }

    .legal-block {
        padding: 16px;
    }

    .legal-block-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 10px;
    }

    .legal-block-icon svg {
        width: 16px;
        height: 16px;
    }

    .legal-block-title {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .legal-block-text {
        font-size: 11px;
        line-height: 1.6;
    }

    .legal-block-text-muted {
        font-size: 10px;
    }

    .legal-tech-note {
        padding-top: 10px;
    }

    .tech-badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    .legal-footer-note {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        padding-top: 16px;
    }

    .legal-ref, .legal-version {
        font-size: 10px;
    }

    /* Toast mobile */
    .toast {
    bottom: 16px;
    left: 16px;
    right: 16px;
    transform: none;
    text-align: center;
    font-size: 13px;
    padding: 12px 16px;
    animation: fadeInMobile 0.3s ease;
}

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

/* ============================================
   RESPONSIVE — SMALL PHONE (≤375px)
   ============================================ */
@media (max-width: 375px) {
    .generator-controls {
        padding: 16px 12px;
    }

    .identity-hero {
        height: 170px;
    }

    .hero-avatar {
        width: 44px;
        height: 44px;
    }

    /* Show only 3 fragments */
    .hero-fragment:nth-child(4),
    .hero-fragment:nth-child(5),
    .hero-fragment:nth-child(6) {
        display: none;
    }

    /* Card smallest */
    .identity-name {
        font-size: 17px;
    }

    .identity-body {
        padding: 12px 10px;
    }

    .identity-section {
        padding: 12px 10px;
    }

    .section-title {
        font-size: 11px;
    }

    .data-value {
        font-size: 12px;
    }

    /* Bulk table even tighter */
    .id-bulk-table {
        min-width: 450px;
    }

    /* Also hide Country column */
    .id-bulk-table thead th:nth-child(7),
    .id-bulk-table tbody td:nth-child(7) {
        display: none;
    }
}

/* ============================================
   LEGAL SECTION STYLES
   ============================================ */

.legal-section {
    background: #1a1a1a;
    padding: 50px 0 40px;
    margin-top: 60px;
}

.legal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(74, 158, 255, 0.3) 50%, transparent 100%);
    margin-bottom: 40px;
}

.legal-header {
    text-align: center;
    margin-bottom: 35px;
}

.legal-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(74, 158, 255, 0.08);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #4a9eff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.legal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1100px) {
    .legal-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.legal-block {
    background: rgba(39, 39, 39, 0.5);
    border: 1px solid rgba(51, 51, 51, 0.8);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.legal-block-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(74, 158, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    color: #4a9eff;
}

.legal-block-title {
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
    margin: 0 0 12px 0;
    letter-spacing: 0.3px;
}

.legal-block-text {
    font-size: 13px;
    line-height: 1.7;
    color: #777;
    margin: 0 0 12px 0;
}

.legal-block-text:last-of-type {
    margin-bottom: 0;
}

.legal-block-text strong {
    color: #999;
    font-weight: 500;
}

.legal-block-text-muted {
    font-size: 12px;
    color: #555;
    margin-top: auto;
    padding-top: 10px;
}

.legal-highlight {
    color: #4a9eff;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    background: rgba(74, 158, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.legal-block-protocol {
    display: flex;
    flex-direction: column;
}

.legal-tech-note {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(51, 51, 51, 0.8);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(74, 158, 255, 0.08);
    border: 1px solid rgba(74, 158, 255, 0.15);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #4a9eff;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.legal-footer-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 25px;
    border-top: 1px solid rgba(51, 51, 51, 0.5);
    flex-wrap: wrap;
    gap: 15px;
}

.legal-ref {
    font-size: 11px;
    color: #555;
    font-family: 'Roboto Mono', monospace;
}

.legal-version {
    font-size: 11px;
    color: #444;
}
