/* Optional parser profile editor and future React hover-card preview. */

.parser-profile-open {
    padding: calc(4px * var(--master-scale, 1)) calc(10px * var(--master-scale, 1));
    border: 1px solid rgba(0, 190, 255, 0.35);
    border-radius: var(--border-radius-sm, 6px);
    background: rgba(0, 170, 255, 0.1);
    color: var(--accent-primary, #00b7ff);
    cursor: pointer;
    font-size: calc(0.75rem * var(--master-scale, 1));
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.parser-profile-open:hover {
    background: rgba(0, 170, 255, 0.2);
    border-color: rgba(0, 190, 255, 0.75);
}

.parser-local-dev-login {
    padding: calc(4px * var(--master-scale, 1)) calc(10px * var(--master-scale, 1));
    border: 1px solid rgba(255, 186, 76, 0.55);
    border-radius: var(--border-radius-sm, 6px);
    background: rgba(255, 166, 48, 0.12);
    color: #ffd18a;
    cursor: pointer;
    font-size: calc(0.72rem * var(--master-scale, 1));
    font-weight: 700;
}

.parser-local-dev-login:hover {
    background: rgba(255, 166, 48, 0.22);
    border-color: rgba(255, 186, 76, 0.9);
}

.parser-local-dev-login:disabled {
    cursor: wait;
    opacity: 0.65;
}

.parser-profile-modal[hidden] {
    display: none;
}

.parser-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 8, 17, 0.82);
    backdrop-filter: blur(8px);
}

.parser-profile-modal-open {
    overflow: hidden;
}

.parser-profile-dialog {
    width: min(1180px, calc(100vw - 32px));
    height: min(960px, calc(100dvh - 32px));
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(93, 139, 180, 0.3);
    border-radius: 16px;
    background: #0d1420;
    color: #e8f1fc;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.parser-profile-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 30px 20px;
    border-bottom: 1px solid rgba(93, 139, 180, 0.2);
}

.parser-profile-dialog-head h2 {
    margin: 4px 0 6px;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.parser-profile-dialog-head p,
.parser-profile-preview-note {
    margin: 0;
    color: #8da0b8;
    font-size: 0.82rem;
    line-height: 1.55;
}

.parser-profile-kicker,
.parser-profile-preview-label,
.parser-profile-section-title {
    color: #21c4ff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.parser-profile-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(141, 160, 184, 0.25);
    border-radius: 50%;
    background: transparent;
    color: #a9bad0;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.parser-profile-close:hover {
    border-color: #21c4ff;
    color: #fff;
}

.parser-profile-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 26px;
    overflow: hidden;
    padding: 20px 26px 22px;
}

.parser-profile-form {
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
    display: grid;
    gap: 18px;
}

.parser-profile-section {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(93, 139, 180, 0.22);
    border-radius: 12px;
    background: rgba(19, 29, 44, 0.75);
}

.parser-profile-help,
.parser-profile-account-state small,
.parser-profile-visibility-row span {
    color: #8da0b8;
    font-size: 0.76rem;
    line-height: 1.45;
}

.parser-profile-help {
    margin: -4px 0 2px;
}

.parser-profile-account-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
}

.parser-profile-account-picker label {
    min-width: 0;
}

.parser-profile-account-picker .parser-profile-button {
    margin-bottom: 0;
    white-space: nowrap;
}

.parser-profile-link-row,
.parser-profile-preview-image-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.parser-profile-link-row input {
    flex: 1 1 230px;
}

.parser-profile-section label:not(.parser-profile-switch) {
    display: grid;
    gap: 6px;
    color: #b7c7d9;
    font-size: 0.75rem;
    font-weight: 700;
}

.parser-profile-section input:not([type="checkbox"]),
.parser-profile-section select,
.parser-profile-section textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(113, 145, 179, 0.3);
    border-radius: 7px;
    outline: 0;
    background: #0a111c;
    color: #edf5ff;
    font: inherit;
    padding: 10px 11px;
}

.parser-profile-section textarea {
    resize: vertical;
}

.parser-profile-section input:focus,
.parser-profile-section select:focus,
.parser-profile-section textarea:focus {
    border-color: #21c4ff;
    box-shadow: 0 0 0 3px rgba(33, 196, 255, 0.12);
}

.parser-profile-button {
    border: 1px solid rgba(113, 145, 179, 0.35);
    border-radius: 7px;
    background: rgba(61, 87, 115, 0.3);
    color: #dbeaff;
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 9px 12px;
    transition: 0.2s ease;
}

.parser-profile-button:hover {
    border-color: #21c4ff;
    background: rgba(33, 196, 255, 0.12);
}

.parser-profile-button.primary {
    border-color: rgba(33, 196, 255, 0.55);
    background: #087ca5;
    color: white;
}

.parser-profile-button.primary:hover {
    background: #0c9dcc;
}

.parser-profile-button.subtle {
    color: #a9bad0;
    background: transparent;
}

.parser-profile-button.danger-link {
    justify-self: start;
    border-color: rgba(245, 107, 107, 0.35);
    background: transparent;
    color: #ff9b9b;
}

.parser-profile-account-state {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(8, 17, 29, 0.7);
}

.parser-profile-account-state strong {
    color: #e9f5ff;
    font-size: 0.86rem;
}

.parser-profile-status-ok {
    color: #53e6a7;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.parser-profile-status-muted {
    color: #b7c7d9;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.parser-profile-visibility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid rgba(113, 145, 179, 0.18);
    border-radius: 8px;
}

.parser-profile-visibility-row div {
    display: grid;
    gap: 3px;
}

.parser-profile-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
}

.parser-profile-switch input {
    position: absolute;
    opacity: 0;
}

.parser-profile-switch span {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: #33465c;
    cursor: pointer;
    transition: 0.2s ease;
}

.parser-profile-switch span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d7e7f7;
    content: '';
    transition: 0.2s ease;
}

.parser-profile-switch input:checked + span {
    background: #0b9dca;
}

.parser-profile-switch input:checked + span::after {
    transform: translateX(18px);
}

.save-profile {
    justify-self: start;
    min-width: 125px;
}

.parser-profile-message {
    min-height: 18px;
    color: #9fb1c8;
    font-size: 0.78rem;
}

.parser-profile-message.success { color: #53e6a7; }
.parser-profile-message.error { color: #ff9292; }

.parser-profile-preview-column {
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    align-self: start;
    position: sticky;
    top: 0;
}

.parser-profile-preview-label {
    margin: 2px 0 10px;
    color: #8da0b8;
}

.parser-profile-preview {
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding: 18px;
    border: 1px solid rgba(33, 196, 255, 0.3);
    border-radius: 15px;
    background: radial-gradient(circle at 90% 0%, rgba(28, 112, 151, 0.34), transparent 45%), linear-gradient(145deg, #101d2e, #0a111b 72%);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.parser-profile-preview-topline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #7f9bb5;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.parser-profile-preview-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #53e6a7;
    box-shadow: 0 0 12px #53e6a7;
}

.parser-profile-preview-avatar-wrap {
    display: grid;
    place-items: center;
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
    margin: 18px auto 12px;
    overflow: hidden;
    border: 2px solid rgba(33, 196, 255, 0.7);
    border-radius: 50%;
    background: #17283a;
    box-shadow: 0 0 0 7px rgba(33, 196, 255, 0.08), 0 12px 35px rgba(0, 0, 0, 0.35);
}

.parser-profile-preview-image-actions {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: -2px 0 16px;
}

.parser-profile-preview-image-actions small {
    max-width: 240px;
    color: #8da0b8;
    font-size: 0.68rem;
    line-height: 1.4;
}

.parser-profile-preview-avatar,
.parser-profile-preview-avatar-fallback {
    display: block;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.parser-profile-preview-avatar {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
}

.parser-profile-preview-avatar[hidden],
.parser-profile-preview-avatar-fallback[hidden] {
    display: none !important;
}

.parser-profile-preview-avatar-fallback {
    display: grid;
    place-items: center;
    color: #9ddfff;
    font-size: 2rem;
    font-weight: 800;
}

.parser-profile-preview-name {
    overflow: hidden;
    color: #f2f8ff;
    font-size: 1.2rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parser-profile-field-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #7f9bb5;
    font-size: 0.68rem;
}

.parser-profile-field-meta small {
    color: inherit;
    font-size: inherit;
}

#parser-profile-bio-count {
    flex: 0 0 auto;
    color: #9ddfff;
    font-variant-numeric: tabular-nums;
}

.parser-profile-preview-divider {
    height: 1px;
    margin: 18px 0 14px;
    background: rgba(136, 169, 202, 0.2);
}

.parser-profile-preview p {
    min-height: 42px;
    margin: 0;
    color: #d6e4f3;
    font-size: 0.8rem;
    line-height: 1.5;
}

.parser-profile-preview-account {
    margin-top: 0;
    color: #7f9bb5;
    font-size: 0.68rem;
}

.parser-profile-preview-foot {
    margin-top: 22px;
    color: #557088;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.parser-profile-preview-note {
    margin-top: 12px;
}

/* Keep the desktop modal comfortable on common 1080px-tall displays while
   preserving the larger canvas available on 2K and taller screens. */
@media (min-width: 761px) and (max-height: 1100px) {
    .parser-profile-dialog-head {
        padding: 18px 24px 14px;
    }

    .parser-profile-dialog-head h2 {
        margin: 2px 0 4px;
        font-size: 1.38rem;
    }

    .parser-profile-layout {
        gap: 20px;
        padding: 16px 24px 18px;
    }

    .parser-profile-form {
        gap: 12px;
    }

    .parser-profile-section {
        gap: 9px;
        padding: 14px;
    }

    .parser-profile-help,
    .parser-profile-account-state small,
    .parser-profile-visibility-row span {
        font-size: 0.72rem;
    }

    .parser-profile-preview {
        padding: 16px;
    }

    .parser-profile-preview-avatar-wrap {
        width: 88px;
        height: 88px;
        min-width: 88px;
        min-height: 88px;
        margin: 14px auto 10px;
    }

    .parser-profile-preview-image-actions {
        margin-bottom: 12px;
    }

    .parser-profile-preview-tabs {
        margin: 14px 0 12px;
    }
}

.parser-profile-preview-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 18px 0 16px;
    padding: 4px;
    border: 1px solid rgba(136, 169, 202, 0.18);
    border-radius: 10px;
    background: rgba(5, 12, 22, 0.42);
}

.parser-profile-preview-tab {
    flex: 1 1 0;
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #8da0b8;
    background: transparent;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.parser-profile-preview-tab:hover,
.parser-profile-preview-tab.is-active {
    border-color: rgba(33, 196, 255, 0.32);
    color: #e5f7ff;
    background: rgba(33, 196, 255, 0.12);
}

.parser-profile-preview-tab[hidden] {
    display: none;
}

.parser-profile-preview-panel[hidden] {
    display: none;
}

.parser-profile-performance-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    text-align: left;
}

.parser-profile-stat-period-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 12px;
}

.parser-profile-stat-period-tab {
    flex: 1 1 0;
    min-height: 28px;
    border: 1px solid rgba(136, 169, 202, 0.18);
    border-radius: 7px;
    color: #8da0b8;
    background: rgba(5, 12, 22, 0.42);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.parser-profile-stat-period-tab:hover,
.parser-profile-stat-period-tab.is-active {
    border-color: rgba(33, 196, 255, 0.32);
    color: #e5f7ff;
    background: rgba(33, 196, 255, 0.12);
}

.parser-profile-performance-kicker,
.parser-profile-performance-label {
    color: #7f9bb5;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.parser-profile-performance-heading strong {
    display: block;
    margin-top: 3px;
    color: #f2f8ff;
    font-size: 0.95rem;
}

.parser-profile-performance-heading > span {
    color: #9ddfff;
    font-size: 0.68rem;
    white-space: nowrap;
}

.parser-profile-performance-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.parser-profile-performance-kpi {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid rgba(136, 169, 202, 0.16);
    border-radius: 8px;
    background: rgba(7, 17, 29, 0.7);
    text-align: left;
}

.parser-profile-performance-kpi span {
    color: #7f9bb5;
    font-size: 0.61rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.parser-profile-performance-kpi-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.parser-profile-performance-kpi-label img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.parser-profile-account-label {
    display: block;
    margin-top: 12px;
}

.parser-profile-field-help {
    display: block;
    margin-top: 5px;
    color: #7f9bb5;
    font-size: 0.65rem;
}

.parser-profile-performance-kpi strong {
    color: #f2f8ff;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.parser-profile-performance-section {
    margin-top: 16px;
    text-align: left;
}

.parser-profile-experimental-score {
    margin: 14px 0 16px;
    padding: 12px;
    border: 1px solid rgba(236, 184, 82, 0.32);
    border-radius: 9px;
    background: rgba(74, 51, 18, 0.18);
}

.parser-profile-score-kpi small,
.parser-profile-score-note {
    color: #8da0b8;
    font-size: 0.65rem;
}

.parser-profile-score-kpi {
    gap: 4px;
}

.parser-profile-profession-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.parser-profile-profession-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 5px 7px 5px 9px;
    border: 1px solid rgba(33, 196, 255, 0.22);
    border-radius: 999px;
    color: #d6e4f3;
    background: rgba(33, 196, 255, 0.08);
    font-size: 0.68rem;
}

.parser-profile-profession-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parser-profile-profession-chip img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.parser-profile-profession-chip b {
    display: grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    color: #06111c;
    background: #9ddfff;
    font-size: 0.62rem;
    font-variant-numeric: tabular-nums;
}

.parser-profile-badge-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.parser-profile-badge-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border: 1px solid rgba(234, 190, 92, 0.32);
    border-radius: 999px;
    color: #f5d98c;
    background: rgba(234, 190, 92, 0.1);
    font-size: 0.67rem;
}

.parser-profile-badge-chip img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

@media (max-width: 760px) {
    .parser-profile-modal { padding: 8px; }
    .parser-profile-dialog { height: auto; max-height: calc(100dvh - 16px); border-radius: 12px; }
    .parser-profile-dialog-head { padding: 20px; }
    .parser-profile-layout { grid-template-columns: 1fr; overflow: auto; padding: 18px 20px 22px; }
    .parser-profile-form { overflow: visible; padding-right: 0; }
    .parser-profile-preview-column { max-height: none; overflow: visible; position: static; order: -1; }
    .parser-profile-preview { min-height: 0; }
}
