/* People module */
.people-layout {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 450px;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    background: var(--surface-workspace);
}

.people-layout.preview-collapsed {
    grid-template-columns: minmax(0, 1fr) 54px;
}

.people-layout.no-preview {
    grid-template-columns: minmax(0, 1fr);
}

.people-content {
    height: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: var(--space-4);
    gap: var(--space-3);
    overflow: hidden;
}

.people-directory-controls {
    min-width: 0;
    display: grid;
    gap: var(--space-3);
}

.people-toolbar-slot {
    min-width: 0;
    min-height: 44px;
    display: grid;
    align-items: stretch;
    container-type: inline-size;
}

.people-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-3);
    align-items: center;
    min-width: 0;
}

.people-search-field {
    width: auto;
    max-width: none;
    min-width: 140px;
    flex: 1 1 220px;
}

.people-normal-toolbar > :not(.people-search-field) {
    flex: 0 0 auto;
}

.people-bulk-toolbar {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.people-bulk-summary {
    flex: 0 0 auto;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
}

.people-bulk-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.people-bulk-actions .button {
    white-space: nowrap;
}

#addPeoplePerson {
    white-space: nowrap;
    min-width: 158px;
    justify-content: center;
}

/* Shared project-wide Sort control */

.app-sort-field {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    height: 44px;

    flex: 0 1 auto;

    display: inline-flex;
    align-items: center;
}

.app-sort-trigger {
    width: fit-content;
    max-width: 100%;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease),
        box-shadow var(--ease);
}

.app-sort-trigger:hover {
    border-color: var(--border-strong);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.app-sort-trigger:focus-visible {
    outline: 0;
    border-color: color-mix(in srgb, var(--gg-primary) 55%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gg-primary) 10%, transparent);
}

.app-sort-trigger[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--gg-primary) 55%, transparent);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.app-sort-icon,
.app-sort-chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
}

.app-sort-icon svg,
.app-sort-chevron svg {
    width: 18px;
    height: 18px;
    display: block;
}

.app-sort-icon svg {
    transition: transform var(--ease);
}

.app-sort-icon.is-ascending svg {
    transform: rotate(180deg);
}

.app-sort-current {
    min-width: 0;
    flex: 0 1 auto;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    text-align: left;
}

.app-sort-chevron {
    margin-left: 0;
}

.app-sort-chevron svg {
    width: 16px;
    height: 16px;
    transform: rotate(90deg);
    transition: transform var(--ease);
}

.app-sort-trigger[aria-expanded="true"] .app-sort-chevron svg {
    transform: rotate(-90deg);
}

.app-sort-popover {
    width: min(280px, calc(100vw - 24px));
    padding: var(--space-2);
}

.app-sort-popover-section+.app-sort-popover-section {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-default);
}

.app-sort-popover-title {
    padding: 5px 10px 7px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.app-sort-popover-group {
    display: grid;
    gap: 2px;
}

.app-sort-option {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.app-sort-option:hover,
.app-sort-option:focus-visible {
    outline: 0;
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.app-sort-option[aria-checked="true"] {
    background: color-mix(in srgb, var(--gg-primary) 10%, transparent);
    color: var(--brand-green-300);
}

.app-sort-option-check {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.app-sort-option-check svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 620px) {
    .app-sort-field {
        width: 44px;
        max-width: 44px;
        flex: 0 0 44px;
    }

    .app-sort-trigger {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        padding: 0;
    }

    .app-sort-current,
    .app-sort-chevron {
        display: none;
    }
}

.search-input {
    height: 42px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--border-default);
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-3);
    color: var(--text-tertiary);
}

.search-input svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--text-tertiary);
}

.search-input input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
}

.search-input input::placeholder {
    color: var(--text-tertiary);
}

.people-filterbar {
    border: 1px solid var(--border-default);
    background: color-mix(in srgb, var(--gg-sidebar) 72%, transparent);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.filter-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-secondary);
    padding: 0 10px;
    font-weight: 700;
    font-size: 13px;
}

.filter-chip button {
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.filter-spacer {
    flex: 1;
}

.active-filter-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex: 0 0 auto;
    white-space: nowrap;
}

.people-save-view {
    min-height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    font-weight: 800;
    letter-spacing: .01em;
}

.people-save-view:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.people-nav-unavailable {
    color: var(--text-tertiary);
    opacity: .58;
    cursor: default;
}

.people-nav-unavailable:disabled:hover {
    background: transparent;
    color: var(--text-tertiary);
}

.people-nav-unavailable svg {
    color: var(--text-tertiary);
}

.people-nav-unavailable:hover {
    background: transparent;
    color: var(--text-tertiary);
}

.people-nav-unavailable:hover svg {
    color: var(--text-tertiary);
}

.people-nav-unavailable .people-review-count {
    background: color-mix(in srgb, var(--gg-primary) 10%, transparent);
    border-color: color-mix(in srgb, var(--gg-outline) 18%, transparent);
    color: var(--text-tertiary);
}

.people-review-count {
    margin-left: auto;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--gg-status-warning-subtle-container);
    border: 1px solid var(--gg-status-warning-outline);
    color: var(--gg-status-warning-accent);
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
}

.people-saved-filter-row {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease);
}

.people-saved-filter-row:hover {
    background: color-mix(in srgb, var(--gg-text) 3.5%, transparent);
}

.people-saved-filter-row.active {
    background: var(--surface-selected);
    border-color: color-mix(in srgb, var(--gg-primary) 12%, transparent);
}

.people-saved-filter-main {
    min-width: 0;
    min-height: 42px;
    flex: 1 1 auto;
    padding: 0 var(--space-3);
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-align: left;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
}

.people-saved-filter-main svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: var(--text-tertiary);
}

.people-saved-filter-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.people-saved-filter-row.active .people-saved-filter-main {
    color: var(--text-primary);
}

.people-saved-filter-row.active .people-saved-filter-main svg {
    color: var(--brand-green-300);
}

.people-saved-filter-more {
    flex: 0 0 34px;
    margin: 0 var(--space-2) 0 0;
    opacity: 0;
    transition: opacity var(--ease);
}

.people-saved-filter-row:hover .people-saved-filter-more,
.people-saved-filter-row:focus-within .people-saved-filter-more,
.people-saved-filter-row.active .people-saved-filter-more {
    opacity: 1;
}

.people-filter-delete-copy {
    padding: var(--space-4);
    border: 1px solid color-mix(in srgb, var(--gg-status-error-accent) 24%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--gg-status-error-accent) 8%, transparent);
    color: var(--gg-status-error-accent);
}

.people-delete-confirm-copy {
    display: grid;
    gap: var(--space-3);
    color: var(--text-secondary);
}

.people-delete-confirm-copy p,
.people-delete-confirm-copy ul {
    margin: 0;
}

.people-delete-confirm-copy ul {
    display: grid;
    gap: 6px;
    padding-left: 20px;
    color: var(--text-primary);
}

.people-delete-remaining {
    color: var(--text-tertiary);
    font-size: 13px;
}

.people-filter-button {
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease),
        box-shadow var(--ease);
}

.people-filter-button:hover {
    border-color: var(--border-strong);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.people-filter-button:focus-visible {
    border-color: color-mix(in srgb, var(--gg-primary) 55%, transparent);
    outline: 0;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--gg-primary) 10%, transparent);
}

.people-filter-button.active {
    border-color: color-mix(in srgb, var(--gg-primary) 38%, transparent);
    background: var(--surface-selected);
    color: var(--brand-green-300);
}

.people-filter-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
}

.people-filter-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.people-filter-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand-green-500);
    color: var(--brand-green-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.active-filter-chip {
    min-height: 34px;
    padding: 4px 5px 4px 10px;
    border-color: color-mix(in srgb, var(--gg-primary) 22%, transparent);
    background: color-mix(in srgb, var(--gg-primary) 8%, transparent);
    color: var(--text-secondary);
    gap: var(--space-2);
}

.active-filter-chip-copy {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.active-filter-chip strong {
    color: var(--text-primary);
    font-weight: 900;
}

.active-filter-chip-remove {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition:
        background var(--ease),
        color var(--ease);
}

.active-filter-chip-remove:hover {
    background: color-mix(in srgb, var(--gg-text) 7%, transparent);
    color: var(--text-primary);
}

.active-filter-chip-remove:focus-visible {
    outline: 2px solid var(--brand-green-400);
    outline-offset: 1px;
}

.active-filter-chip-remove svg {
    width: 14px;
    height: 14px;
    display: block;
}

.people-filter-popover {
    position: fixed;
    width: 360px;
    z-index: 95;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.people-filter-popover-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
}

.people-filter-popover-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.people-filter-popover-header p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

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

.people-filter-popover>.people-filter-grid {
    padding: var(--space-4);
}

.people-filter-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.people-filter-field.full {
    grid-column: 1 / -1;
}

.people-filter-footer {
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.people-add-person-compact {
    display: none;
}

.people-mobile-list {
    display: none;
}

.people-mobile-search-trigger,
.people-mobile-search-close {
    display: none;
}

.people-mobile-search-trigger:focus-visible,
.people-mobile-search-close:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

