.secondary-grid {
    margin-top: 25px;
}

.results-placement {
    margin-top: 25px;
}

.family-zodiac-card {
    order: 30;
}

.family-children-card {
    order: 20;
}

.family-submit-card {
    order: 40;
}

.guide-formula {
    margin-top: 8px;
}

.guide-table-block {
    margin-top: 15px;
}

.guide-table-scroll {
    max-height: 600px;
    overflow-y: auto;
}

.guide-row-column {
    width: 50px;
}

.guide-title-column {
    width: 220px;
}

.guide-list-spaced {
    margin-bottom: 12px;
}

.guide-subheading {
    margin: 12px 0 6px;
    color: var(--text-accent);
    font-weight: 700;
}

.guide-subheading-spaced {
    margin-top: 14px;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 18px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-md);
    background: rgba(6, 182, 212, 0.12);
    color: #bae6fd;
}

.notice.error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
}

.compact-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.section-description {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.quick-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.quick-selection-label {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.submit-analysis {
    margin: 0;
}

.submit-reassure {
    margin-bottom: 12px;
    color: #fcd34d;
    font-size: 0.88rem;
}

.submit-reassure.is-error {
    color: #fca5a5;
}

.field-required {
    color: #fcd34d;
    font-weight: 600;
    font-size: 0.82rem;
}

.field-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.field-hint.is-warning,
input.is-missing-required {
    color: #fcd34d;
}

input.is-missing-required {
    border-color: rgba(245, 158, 11, 0.55);
}

.name-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.name-mode-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.name-mode-btn[aria-pressed="true"] {
    color: #fff;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.28);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.name-mode-hint {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.compound-name-tools {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.45);
}

.compound-base-label {
    margin-bottom: 6px;
}

.compound-place {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.compound-place-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .family-submit-card {
        position: sticky;
        bottom: 10px;
        z-index: 15;
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
    }
}

.children-list {
    display: grid;
    gap: 12px;
}

.child-item {
    margin-bottom: 0;
}

.child-header {
    min-height: 30px;
    margin-bottom: 4px;
    color: var(--text-accent);
}

.child-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.live-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    margin-top: 7px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-variable {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.status-waiting {
    color: var(--text-muted);
}

.birth-success {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.birth-info {
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
}

.birth-danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.couple-status-card {
    display: none;
    order: 10;
}

.couple-status-card.is-visible {
    display: block;
}

.couple-compat {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.12);
}

.couple-compat p {
    margin-top: 6px;
    white-space: pre-line;
}

.couple-compat.danger {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(127, 29, 29, 0.3);
}

button.collapsible-header {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: right;
}

.collapse-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.privacy-note {
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.08);
    color: #a7f3d0;
    font-size: 0.88rem;
}

.subsection-title {
    margin-bottom: 10px;
    color: var(--text-bright);
}

.custom-status {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.db-names-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.name-db-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-accent);
    font-size: 0.82rem;
}

.btn-remove-name,
.result-actions button {
    border: 0;
    background: transparent;
    color: #f87171;
    cursor: pointer;
    font: inherit;
}

.empty-custom-names {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result-breakdown {
    margin-bottom: 25px;
}

.result-breakdown h4,
.results-heading {
    margin-bottom: 12px;
    color: var(--text-bright);
    font-size: 1.05rem;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}

.breakdown-card {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-accent);
}

.filter-banner,
.result-notice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 18px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

.result-notice {
    display: block;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.row-number {
    width: 80px;
}

.result-member {
    margin-bottom: 6px;
}

.result-name {
    color: #fff;
    font-weight: 600;
}

.result-actions {
    display: inline-flex;
    gap: 4px;
    margin-right: 5px;
}

.log-message {
    direction: rtl;
    display: inline-block;
    font-family: inherit;
}

.log-info {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.log-warn {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.log-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
}

.names-page-header {
    text-align: center;
    margin-bottom: 28px;
    padding: 30px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.names-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--amber));
}

.names-page-home {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 1;
}

.names-page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 8px;
}

.names-page-header p {
    color: var(--text-muted);
}

.names-page > .card {
    margin-bottom: 20px;
}

.names-catalog-filters {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.names-catalog-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.names-catalog-table-wrap {
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 520px;
}

.names-catalog-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.names-catalog-table th,
.names-catalog-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.names-catalog-table th {
    position: sticky;
    top: 0;
    background: rgba(26, 37, 60, 0.96);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.names-catalog-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.names-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.names-pagination-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.names-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.names-stat {
    text-align: center;
    padding: 16px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.55);
}

.names-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-accent);
    margin-bottom: 6px;
}

.names-stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.names-gender-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.names-gender-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-accent);
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-main);
    font-size: 0.85rem;
}

.names-full-list {
    max-height: 420px;
    overflow: auto;
    padding: 4px 2px;
}

.names-page-back {
    text-align: center;
    margin: 10px 0 40px;
}

.names-page-back .btn {
    min-width: 220px;
}

@media (max-width: 720px) {
    .section-heading-row,
    .log-panel-header,
    .log-title-area,
    .filter-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .child-fields {
        grid-template-columns: 1fr;
    }

    .collapse-hint {
        display: none;
    }

    .names-stats-grid {
        grid-template-columns: 1fr;
    }

    .names-catalog-filters {
        grid-template-columns: 1fr;
    }
}
