.connection-card-opinion {
    width: max-content;
    max-width: calc(100% - 58px);
    min-height: 18px;
    height: auto;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 6px 6px 52px;
    padding: 2px 6px;
    border: 1px solid color-mix(in srgb, var(--opinion-tier-color, #aab4c0) 56%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--opinion-tier-color, #aab4c0) 12%, rgba(2, 6, 12, .88));
    color: var(--opinion-tier-color, #aab4c0);
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
}

.connection-card-opinion b {
    color: #fff;
    font-size: 10px;
}
.connection-card.has-opinion .connection-card-open {
    grid-column: 1;
    grid-row: 1;
}

.connection-card.has-opinion .connection-card-actions {
    grid-column: 2;
    grid-row: 1;
}

.connection-card-opinion:hover,
.connection-card-opinion:focus-visible {
    border-color: color-mix(in srgb, var(--opinion-tier-color, #aab4c0) 82%, #fff);
    background: color-mix(in srgb, var(--opinion-tier-color, #aab4c0) 20%, rgba(2, 6, 12, .9));
    box-shadow: 0 0 9px color-mix(in srgb, var(--opinion-tier-color, #aab4c0) 22%, transparent);
    outline: none;
}

.connection-opinion-summary-menu {
    width: min(332px, calc(100vw - 16px));
    max-height: min(520px, calc(100vh - 16px));
    gap: 0;
    padding: 7px;
    border-color: var(--nexus-border-subtle);
    border-radius: 2px;
    overflow-y: auto;
    color: var(--nexus-text-primary);
    background:
        linear-gradient(145deg, rgba(15, 21, 23, .985), rgba(6, 10, 12, .99));
    box-shadow:
        0 14px 30px rgba(0, 0, 0, .58),
        inset 0 0 18px rgba(0, 0, 0, .22);
    font-family: var(--nexus-body-font);
    scrollbar-color: var(--nexus-border-strong) transparent;
    scrollbar-width: thin;
}

.connection-opinion-summary-menu .nexus-floating-menu-item.unavailable {
    pointer-events: none;
    opacity: 1;
}

.connection-opinion-summary-menu .nexus-floating-menu-item {
    grid-template-columns: 15px minmax(0, 1fr) auto;
    grid-template-areas: "icon label status";
    min-height: 27px;
    column-gap: 7px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 2px;
    color: var(--nexus-text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
}

.connection-opinion-summary-menu .nexus-floating-menu-item i {
    color: var(--nexus-accent-bright);
    font-size: 10px;
}

.connection-opinion-summary-menu .nexus-floating-menu-item small {
    color: var(--nexus-accent-bright);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .02em;
    text-align: right;
}

.connection-opinion-summary-heading {
    min-height: 38px !important;
    margin-bottom: 5px;
    border-color: var(--nexus-border-subtle) !important;
    background: var(--nexus-accent-surface);
    color: var(--nexus-text-primary) !important;
}

.connection-opinion-summary-heading span {
    font-family: var(--nexus-heading-font);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .015em;
}

.connection-opinion-summary-heading small {
    color: var(--opinion-tier-color, var(--nexus-accent-bright)) !important;
    font-size: 11px !important;
}

.connection-opinion-summary-group {
    min-height: 29px !important;
    margin-top: 5px;
    padding-top: 7px !important;
    border-top-color: var(--nexus-border-subtle) !important;
    border-radius: 0;
    color: var(--nexus-accent-bright) !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase;
}

.connection-opinion-summary-group small {
    font-size: 9px !important;
}

.connection-opinion-summary-contribution.is-detail {
    min-height: 24px;
    padding: 3px 8px 3px 22px;
    color: var(--nexus-text-muted);
    font-size: 9px;
    font-weight: 700;
}

.connection-opinion-summary-contribution.is-detail i {
    color: var(--nexus-accent-muted);
    font-size: 4px;
}

.connection-opinion-summary-total {
    min-height: 34px !important;
    margin-top: 6px;
    border-color: var(--nexus-border-strong) !important;
    border-radius: 2px;
    color: var(--nexus-text-primary) !important;
    background: var(--nexus-accent-surface);
    font-family: var(--nexus-heading-font);
    font-size: 12px !important;
    font-weight: 800 !important;
}

.connection-opinion-summary-total small {
    color: var(--opinion-tier-color, var(--nexus-accent-bright)) !important;
    font-size: 12px !important;
}

.connection-opinion-summary-manage {
    min-height: 31px !important;
    margin-top: 6px;
    border-color: var(--nexus-border-subtle) !important;
    color: var(--nexus-accent-bright) !important;
    background: rgba(9, 13, 15, .92);
}

.connection-opinion-summary-manage:hover,
.connection-opinion-summary-manage:focus-visible {
    border-color: var(--nexus-border-strong) !important;
    color: var(--nexus-text-primary) !important;
    background: var(--nexus-accent-surface-strong) !important;
    box-shadow: var(--nexus-focus-ring);
}


.connection-opinion-editor .window-content {
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: var(--nexus-surface-base);
    color: var(--nexus-text-primary);
}

.connection-opinion-editor .window-header {
    border-bottom: 0;
    background: #090c0d;
    color: var(--nexus-text-primary);
}

.connection-opinion-content {
    height: 100%;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 12px;
    overflow: auto;
    color: var(--nexus-text-primary);
    background:
        radial-gradient(circle at 16% 8%, var(--nexus-accent-surface), transparent 32%),
        linear-gradient(145deg, rgba(15, 21, 23, .98), rgba(6, 10, 12, .99));
    font-family: var(--nexus-body-font);
    scrollbar-color: var(--nexus-border-strong) transparent;
    scrollbar-width: thin;
}

.connection-opinion-direction {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(6, 12, 14, .82);
    box-shadow: var(--nexus-shadow-panel);
}

.connection-opinion-person {
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.connection-opinion-person.is-subject {
    grid-template-columns: minmax(0, 1fr) 44px;
    text-align: right;
}

.connection-opinion-person.is-subject img,
.connection-opinion-person.is-subject > i {
    grid-column: 2;
    grid-row: 1;
}

.connection-opinion-person.is-subject span {
    grid-column: 1;
    grid-row: 1;
}

.connection-opinion-person img,
.connection-opinion-person > i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: var(--nexus-accent-surface);
    color: var(--nexus-accent-bright);
    object-fit: cover;
}

.connection-opinion-person span {
    min-width: 0;
    display: grid;
}

.connection-opinion-person small,
.connection-opinion-section header small,
.connection-opinion-base small {
    color: var(--nexus-text-muted);
    font-size: 9px;
}

.connection-opinion-person small {
    margin-bottom: 2px;
    color: var(--nexus-accent-bright);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.connection-opinion-person strong {
    overflow: hidden;
    color: var(--nexus-text-primary);
    font-family: var(--nexus-heading-font);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-opinion-direction > button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(9, 13, 15, .92);
    color: var(--nexus-accent-bright);
    box-shadow: none;
}

.connection-opinion-direction > button:hover,
.connection-opinion-direction > button:focus-visible {
    border-color: var(--nexus-border-strong);
    background: var(--nexus-accent-surface-strong);
    color: var(--nexus-text-primary);
    box-shadow: var(--nexus-focus-ring);
    outline: none;
}

.connection-opinion-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--opinion-tier-color) 46%, transparent);
    border-radius: 2px;
    background: color-mix(in srgb, var(--opinion-tier-color) 9%, rgba(7, 12, 14, .95));
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--opinion-tier-color) 78%, transparent);
}

.connection-opinion-score-value {
    color: var(--opinion-tier-color);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.connection-opinion-score > span:last-child {
    display: grid;
}

.connection-opinion-score strong {
    color: var(--opinion-tier-color);
    font-family: var(--nexus-heading-font);
    font-size: 14px;
}

.connection-opinion-score small {
    color: var(--nexus-text-muted);
    font-size: 9px;
}

.connection-opinion-base {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 76px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(7, 12, 14, .84);
}

.connection-opinion-base > i {
    color: var(--nexus-accent-bright);
    text-align: center;
}

.connection-opinion-base > span {
    display: grid;
}

.connection-opinion-base strong {
    color: var(--nexus-text-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.connection-opinion-base input {
    height: 30px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(2, 7, 10, .9);
    color: var(--nexus-text-primary);
    text-align: center;
}

.connection-opinion-base input:focus {
    border-color: var(--nexus-border-strong);
    box-shadow: var(--nexus-focus-ring);
    outline: none;
}

.connection-opinion-section {
    display: grid;
    gap: 6px;
}

.connection-opinion-section > header {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--nexus-border-subtle);
}

.connection-opinion-section > header > span {
    display: grid;
}

.connection-opinion-section > header strong {
    color: var(--nexus-accent-bright);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.connection-opinion-section > header strong i {
    width: 14px;
    text-align: center;
}

.connection-opinion-section > header button {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(9, 13, 15, .92);
    color: var(--nexus-accent-bright);
    font-size: 10px;
    font-weight: 800;
    box-shadow: none;
}

.connection-opinion-section > header button:hover,
.connection-opinion-section > header button:focus-visible {
    border-color: var(--nexus-border-strong);
    background: var(--nexus-accent-surface-strong);
    color: var(--nexus-text-primary);
    box-shadow: var(--nexus-focus-ring);
    outline: none;
}

.connection-opinion-list {
    display: grid;
    gap: 5px;
}

.connection-opinion-row,
.connection-opinion-influence {
    display: grid;
    gap: 5px;
    padding: 7px 8px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(7, 12, 14, .78);
}

.connection-opinion-row {
    grid-template-columns: minmax(0, 1fr) auto 24px;
    align-items: center;
}

.connection-opinion-row > span {
    min-width: 0;
    display: grid;
}

.connection-opinion-row > span small {
    color: var(--nexus-text-muted);
    font-size: 8px;
    text-transform: uppercase;
}

.connection-opinion-row > span strong,
.connection-opinion-influence > header strong {
    color: var(--nexus-text-primary);
    font-size: 10px;
    font-weight: 800;
}

.connection-opinion-row > b,
.connection-opinion-influence b {
    color: var(--nexus-accent-bright);
    font-size: 12px;
}

.connection-opinion-row > button {
    width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    border: 1px solid rgba(218, 83, 98, .5);
    border-radius: 2px;
    background: rgba(70, 12, 23, .72);
    color: #ff9caa;
    font-size: 9px;
}

.connection-opinion-influence > header,
.connection-opinion-influence > div > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.connection-opinion-influence > div {
    display: grid;
    gap: 3px;
    padding-top: 4px;
    border-top: 1px solid var(--nexus-border-subtle);
}

.connection-opinion-influence > div small {
    color: var(--nexus-text-secondary);
}

.connection-opinion-influence > div b {
    font-size: 10px;
}

.connection-opinion-empty,
.connection-opinion-missing {
    padding: 14px;
    border: 1px dashed var(--nexus-border-subtle);
    border-radius: 2px;
    color: var(--nexus-text-muted);
    background: rgba(7, 12, 14, .6);
    font-size: 11px;
    text-align: center;
}

.connection-opinion-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
    padding-top: 9px;
    border-top: 1px solid var(--nexus-border-subtle);
}

.connection-opinion-footer button {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-color: rgba(218, 83, 98, .48);
    border-radius: 2px;
    background: rgba(70, 12, 23, .54);
    color: #ff9caa;
    font-size: 10px;
    font-weight: 800;
    box-shadow: none;
}

.connection-opinion-footer button:hover,
.connection-opinion-footer button:focus-visible,
.connection-opinion-row > button:hover,
.connection-opinion-row > button:focus-visible {
    border-color: rgba(255, 126, 139, .76);
    background: rgba(104, 18, 32, .74);
    color: #ffd0d6;
    box-shadow: 0 0 0 1px rgba(218, 83, 98, .18);
    outline: none;
}

.connection-opinion-adjustment-prompt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 10px;
    color: var(--nexus-text-primary);
    font-family: var(--nexus-body-font);
}

.connection-opinion-adjustment-dialog .window-header {
    border-bottom: 0;
    background: #090c0d;
    color: var(--nexus-text-primary);
}

.connection-opinion-adjustment-dialog .window-content {
    padding: 0;
    background: var(--nexus-surface-base);
    color: var(--nexus-text-primary);
}

.connection-opinion-adjustment-dialog .dialog-form {
    gap: 0;
}

.connection-opinion-adjustment-dialog .dialog-content {
    padding: 14px;
    background:
        radial-gradient(circle at 16% 8%, var(--nexus-accent-surface), transparent 38%),
        linear-gradient(145deg, rgba(15, 21, 23, .98), rgba(6, 10, 12, .99));
}

.connection-opinion-adjustment-field {
    min-width: 0;
    display: grid;
    gap: 5px;
    margin: 0;
}

.connection-opinion-adjustment-field > span {
    color: var(--nexus-accent-bright);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.connection-opinion-adjustment-prompt .connection-opinion-adjustment-field input {
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(2, 7, 10, .92);
    color: var(--nexus-text-primary);
    box-shadow: none;
}

.connection-opinion-adjustment-prompt .connection-opinion-adjustment-field input:focus {
    border-color: var(--nexus-border-strong);
    box-shadow: var(--nexus-focus-ring);
    outline: none;
}

.connection-opinion-adjustment-direction {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 16px 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(7, 12, 14, .84);
    cursor: pointer;
}

.connection-opinion-adjustment-direction:hover {
    border-color: var(--nexus-border-strong);
    background: var(--nexus-accent-surface);
}

.connection-opinion-adjustment-direction input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--nexus-accent-primary);
}

.connection-opinion-adjustment-direction > i {
    color: var(--nexus-accent-bright);
    text-align: center;
}

.connection-opinion-adjustment-direction > span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.connection-opinion-adjustment-direction strong {
    color: var(--nexus-text-primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.connection-opinion-adjustment-direction small {
    color: var(--nexus-text-muted);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.25;
}

.connection-opinion-adjustment-dialog .form-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 1px solid var(--nexus-border-subtle);
    background: rgba(4, 8, 10, .96);
}

.connection-opinion-adjustment-dialog .form-footer button {
    min-height: 32px;
    margin: 0;
    border: 1px solid var(--nexus-border-subtle);
    border-radius: 2px;
    background: rgba(9, 13, 15, .92);
    color: var(--nexus-text-secondary);
    font-size: 10px;
    font-weight: 800;
    box-shadow: none;
}

.connection-opinion-adjustment-dialog .form-footer button[data-action="confirm"] {
    border-color: var(--nexus-border-strong);
    background: var(--nexus-accent-surface);
    color: var(--nexus-accent-bright);
}

.connection-opinion-adjustment-dialog .form-footer button:hover,
.connection-opinion-adjustment-dialog .form-footer button:focus-visible {
    border-color: var(--nexus-border-strong);
    background: var(--nexus-accent-surface-strong);
    color: var(--nexus-text-primary);
    box-shadow: var(--nexus-focus-ring);
    outline: none;
}
