/* Search page — align with glass header width */

.page-shell {
    width: var(--shell-width);
    max-width: var(--shell-width);
    margin-inline: auto;
    padding: 1.5rem 0 3rem;
}

.search-layout {
    display: grid;
    grid-template-columns: 17.2rem minmax(0, 1fr);
    gap: 1.35rem;
    align-items: start;
}

.filters-backdrop {
    display: none;
}

.search-filters {
    border-radius: 0.85rem;
    padding: 0.85rem 0.9rem 1rem;
    position: sticky;
    top: 5.5rem;
    max-height: calc(100dvh - 6.5rem);
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px) saturate(1.15);
    scrollbar-width: none;
}
.search-filters::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.search-filters.filter-sidebar {
    width: 100%;
    padding: 0.65rem 0.75rem 0.85rem;
}

.filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    padding: 0.45rem 0.2rem 0.7rem;
    border-bottom: 1px solid var(--card-border);
}

.filters-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.filters-head-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.filters-reset {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-decoration: none;
    white-space: nowrap;
}

.filters-reset:hover { color: var(--brand); }

.filters-close-btn,
.filters-open-btn {
    display: none;
}

.filters-form {
    display: grid;
    gap: 0;
}

/* Jobinja-style accordion panels (search) */
.filter-panel {
    margin: 0;
    border-bottom: 1px solid rgba(28, 99, 179, 0.1);
}

.filter-panel:last-of-type {
    border-bottom: 0;
}

.filter-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0.85rem 0.15rem;
    color: var(--ink);
}

.filter-panel-toggle::-webkit-details-marker { display: none; }

.filter-panel-toggle::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    margin-inline-start: auto;
    border-inline-end: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.45;
    transition: transform 0.18s ease;
    flex-shrink: 0;
}

.filter-panel[open] > .filter-panel-toggle::after {
    transform: rotate(-135deg);
    margin-top: 0.25rem;
}

.filter-panel-title {
    font-size: 0.86rem;
    font-weight: 700;
}

.filter-panel-body {
    padding: 0 0 0.9rem;
    display: grid;
    gap: 0.55rem;
}

.filter-select {
    display: grid;
    gap: 0.45rem;
}

.filter-select-search {
    position: relative;
}

.filter-select-search .filter-list-input {
    width: 100%;
    min-height: 2.35rem;
    padding: 0.4rem 0.7rem;
    padding-inline-end: 2.1rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(28, 99, 179, 0.16);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.84rem;
    outline: none;
}

.filter-select-search.is-alone .filter-list-input {
    padding-inline-end: 2.1rem;
}

.filter-select-search .filter-list-input:focus {
    border-color: rgba(28, 99, 179, 0.45);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-select-search-icon {
    position: absolute;
    inset-inline-end: 0.65rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted);
    pointer-events: none;
    display: grid;
}

.filter-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 1.6rem;
    align-items: center;
}

.filter-select-placeholder {
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.filter-select-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.55rem;
    padding: 0.1rem 0.55rem;
    border: 1px solid rgba(28, 99, 179, 0.2);
    border-radius: 999px;
    background: rgba(28, 99, 179, 0.08);
    color: var(--brand);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.filter-select-chip::after {
    content: "×";
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
}

.filter-select-chip:hover {
    background: rgba(28, 99, 179, 0.14);
}

.filter-select-items {
    display: flex;
    flex-direction: column;
    max-height: 14.5rem;
    overflow: auto;
    border: 1px solid rgba(28, 99, 179, 0.1);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.65);
    scrollbar-width: thin;
}

.filter-select-items.is-options {
    max-height: none;
    border: 0;
    background: transparent;
    gap: 0.15rem;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(28, 99, 179, 0.06);
}

.filter-select-items.is-options .filter-check {
    border: 1px solid transparent;
    border-radius: 0.45rem;
    padding-inline: 0.35rem;
}

.filter-select-items .filter-check:last-child {
    border-bottom: 0;
}

.filter-check:hover {
    background: rgba(28, 99, 179, 0.05);
}

.filter-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-check-mark {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 0.22rem;
    border: 1.5px solid rgba(120, 132, 150, 0.55);
    background: #fff;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.filter-check-mark.is-radio {
    border-radius: 999px;
}

.filter-check-mark::after {
    content: "";
    width: 0.32rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    margin-bottom: 0.1rem;
    transition: transform 0.12s ease;
}

.filter-check-mark.is-radio::after {
    width: 0.42rem;
    height: 0.42rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    margin: 0;
}

.filter-check input:checked + .filter-check-mark {
    background: var(--brand);
    border-color: var(--brand);
}

.filter-check input:checked + .filter-check-mark::after {
    transform: rotate(45deg) scale(1);
}

.filter-check input:checked + .filter-check-mark.is-radio::after {
    transform: scale(1);
}

.filter-check-text {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
}

.filter-check-text small {
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.filter-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(28, 99, 179, 0.12);
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 800;
    margin-inline-end: 0.35rem;
}
.filter-count.is-empty { opacity: 0.4; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Legacy section cards (projects filters) */
.filter-section {
    margin: 0;
    padding: 0.85rem 0.85rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgba(28, 99, 179, 0.1);
    background: color-mix(in srgb, var(--input-bg) 72%, #fff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.filter-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin: 0 0 0.7rem;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid rgba(28, 99, 179, 0.08);
}

.filter-section-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0;
}

.filter-section-body {
    display: grid;
    gap: 0.55rem;
}

.filter-group { margin-bottom: 1.1rem; }

.filter-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.filter-label-row .filter-label { margin: 0; }

.filter-label {
    display: block;
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.filter-chips-select {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.filter-chip-toggle {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.filter-chip-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-chip-toggle span {
    display: inline-flex;
    align-items: center;
    min-height: 2.1rem;
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(28, 99, 179, 0.14);
    background: #fff;
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.filter-chip-toggle input:checked + span {
    background: linear-gradient(145deg, rgba(28, 99, 179, 0.14), rgba(61, 143, 239, 0.1));
    border-color: rgba(28, 99, 179, 0.42);
    color: var(--brand);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-chip-toggle.is-clear input:checked + span {
    background: #fff;
    border-style: dashed;
    border-color: rgba(28, 99, 179, 0.22);
    color: var(--ink-muted);
    box-shadow: none;
}

.filter-list-search {
    margin-bottom: 0;
}

.filter-list-input {
    width: 100%;
    min-height: 2.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(28, 99, 179, 0.14);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    outline: none;
}

.filter-list-input:focus {
    border-color: rgba(28, 99, 179, 0.45);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.85rem;
    min-height: 2.85rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(28, 99, 179, 0.14);
    background: #fff;
    color: var(--ink-muted);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-search:focus-within {
    border-color: rgba(28, 99, 179, 0.45);
    box-shadow: 0 0 0 3px var(--accent-soft);
    color: var(--brand);
}

.filter-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
    padding-block: 0.65rem;
}

.filter-input::placeholder { color: var(--ink-muted); opacity: 0.75; }

.check-list {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    max-height: 13.5rem;
    overflow: auto;
    padding: 0.35rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(28, 99, 179, 0.08);
    background: rgba(255, 255, 255, 0.72);
    scrollbar-width: thin;
}

.check-list-compact { max-height: 10rem; }

.check-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.check-card:hover {
    background: var(--accent-soft);
    border-color: rgba(28, 99, 179, 0.18);
}

.check-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-box {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.1rem;
    border-radius: 0.35rem;
    border: 1.5px solid rgba(176, 183, 195, 0.45);
    background: var(--input-bg);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.check-box::after {
    content: "";
    width: 0.35rem;
    height: 0.6rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
    margin-bottom: 0.1rem;
}

.check-card input:checked + .check-box {
    background: linear-gradient(145deg, var(--brand), #3d8fef);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(28, 99, 179, 0.35);
}

.check-card input:checked + .check-box::after {
    transform: rotate(45deg) scale(1);
}

.check-card input:checked ~ .check-text,
.check-card input:checked ~ .check-text strong {
    color: var(--ink);
}

.check-card input:focus-visible + .check-box {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.check-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-muted);
    line-height: 1.35;
}

.check-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--ink);
}

.check-text small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-muted);
}

.check-card-accent {
    background: rgba(28, 99, 179, 0.06);
    border-color: rgba(28, 99, 179, 0.16);
}

.filters-foot {
    position: sticky;
    bottom: 0;
    margin-top: 0.55rem;
    padding-top: 0.75rem;
    background: linear-gradient(180deg, transparent, var(--glass-strong) 38%);
}

.filters-apply {
    min-height: 2.55rem;
}

[data-theme="dark"] .filter-section {
    background: color-mix(in srgb, #112033 88%, #1a3050);
    border-color: rgba(140, 192, 247, 0.12);
    box-shadow: none;
}
[data-theme="dark"] .filter-section-head {
    border-bottom-color: rgba(140, 192, 247, 0.12);
}
[data-theme="dark"] .filter-section-title { color: #eef4fb; }
[data-theme="dark"] .filter-chip-toggle span,
[data-theme="dark"] .filter-list-input,
[data-theme="dark"] .filter-search,
[data-theme="dark"] .check-list,
[data-theme="dark"] .filter-select-search .filter-list-input,
[data-theme="dark"] .filter-select-items,
[data-theme="dark"] .filter-check-mark {
    background: #0b1524;
    border-color: rgba(140, 192, 247, 0.14);
}
[data-theme="dark"] .filter-chip-toggle.is-clear input:checked + span {
    background: #0b1524;
}
[data-theme="dark"] .filter-panel {
    border-bottom-color: rgba(140, 192, 247, 0.12);
}
[data-theme="dark"] .filter-panel-title { color: #eef4fb; }
[data-theme="dark"] .filter-check:hover {
    background: rgba(140, 192, 247, 0.06);
}
[data-theme="dark"] .filter-select-chip {
    background: rgba(90, 162, 240, 0.12);
    border-color: rgba(90, 162, 240, 0.28);
    color: #8ec5ff;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.active-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.9rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(28, 99, 179, 0.1);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(28, 99, 179, 0.18);
}

.active-chip:hover {
    background: rgba(28, 99, 179, 0.16);
    color: var(--brand);
}

.search-head {
    align-items: center;
    margin-bottom: 1.15rem;
}

.search-head-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.search-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-accent {
    position: relative;
    width: 0.3rem;
    height: 2.6rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #1578e3, rgba(21, 120, 227, 0.15));
}

.search-accent::after {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #1578e3;
    box-shadow: 0 0 0 4px rgba(21, 120, 227, 0.15);
    transform: translate(50%, -25%);
}

.search-head .section-title {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.5;
    color: #112847;
}

.search-head .section-meta {
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: #78859a;
}

.search-back {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: #e4f1ff;
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.search-back:hover { background: #d6e6f3; color: var(--brand); }

[data-theme="dark"] .search-head .section-title { color: #eef4fb; }
[data-theme="dark"] .search-head .section-meta { color: #9aadc2; }
[data-theme="dark"] .search-back {
    background: rgba(238, 244, 251, 0.08);
    color: #d5e4f2;
}
[data-theme="dark"] .search-back:hover { color: #eef4fb; }

.search-page .result-card {
    position: relative;
    display: grid;
    grid-template-columns: 11.2rem minmax(0, 1.15fr) minmax(0, 1fr) minmax(12.5rem, 14rem);
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-radius: 1.35rem;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(28, 99, 179, 0.1);
    box-shadow: 0 10px 28px rgba(17, 40, 71, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.search-page .result-card:hover {
    transform: translateY(-3px);
    border-color: rgba(28, 99, 179, 0.28);
    box-shadow: 0 18px 36px rgba(28, 99, 179, 0.14);
    color: inherit;
}

.result-side {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.85rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(180deg, #f3f8ff, #fff);
}

.result-stars {
    display: inline-flex;
    gap: 0.22rem;
    color: #f5b301;
}

.result-stars svg {
    width: 1.7rem;
    height: 1.7rem;
    fill: currentColor;
}

.result-avatar {
    width: 7.35rem;
    height: 7.35rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #1578e3, #3d8fef);
    color: #fff;
    font-weight: 800;
    font-size: 1.55rem;
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(21, 120, 227, 0.18);
}

.result-avatar img { width: 100%; height: 100%; object-fit: cover; }

.result-id {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0.28rem;
    padding: 1rem 1rem 1rem 0.4rem;
}

.result-id h3 {
    margin: 0 0 0.55rem;
    color: #112847;
    font-size: 1.08rem;
    font-weight: 800;
}

.result-roles,
.result-line {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.86rem;
    line-height: 1.6;
    font-weight: 600;
}

.result-roles {
    color: var(--brand);
    font-weight: 800;
    align-items: flex-start;
}

.result-role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    min-width: 0;
}

.result-role-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.18rem 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(28, 99, 179, 0.18);
    background: rgba(28, 99, 179, 0.08);
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
}

.result-roles svg,
.result-line svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    margin-top: 0.28rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

[data-theme="dark"] .result-role-chip {
    background: rgba(90, 162, 240, 0.12);
    border-color: rgba(140, 192, 247, 0.22);
    color: var(--brand);
}

.result-summary {
    margin: 0;
    padding: 1rem 0.95rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #3d5168;
    font-size: 0.88rem;
    line-height: 1.9;
    text-align: start;
    display: grid;
    align-content: center;
    justify-items: start;
    align-self: stretch;
}

.result-side,
.result-id {
    text-decoration: none;
    color: inherit;
}
.result-side:hover,
.result-id:hover { color: inherit; }

.result-folio {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    align-content: center;
    padding: 0.75rem 0.7rem;
    border-inline-start: 1px solid rgba(28, 99, 179, 0.08);
    background: linear-gradient(180deg, #f7fbff, #fff);
}
.result-folio-thumb {
    position: relative;
    aspect-ratio: 1;
    border: 0;
    border-radius: 0.55rem;
    overflow: hidden;
    padding: 0;
    background: #e8f1fb;
    cursor: pointer;
}
.result-folio-thumb img,
.result-folio-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.result-folio-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(17, 40, 71, 0.28);
    color: #fff;
    font-size: 0.7rem;
}
.result-folio-empty,
.result-folio-none {
    display: grid;
    place-items: center;
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-weight: 700;
}
.result-folio.is-empty {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 5.5rem;
}
.result-folio-none {
    grid-column: 1 / -1;
    margin: 0;
    min-height: 0;
    padding: 0.85rem 0.75rem;
    text-align: center;
    line-height: 1.6;
    font-size: 0.84rem;
    font-weight: 800;
    color: #7a8aa0;
}

.folio-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.folio-modal[hidden] { display: none; }
.folio-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 21, 36, 0.62);
}
[data-theme="dark"] .folio-modal-backdrop {
    background: rgba(0, 0, 0, 0.86);
}
.folio-modal-card {
    position: relative;
    z-index: 1;
    width: min(52rem, 100%);
    max-height: min(90vh, 42rem);
    overflow: auto;
    padding: 1rem 1rem 1.1rem;
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.folio-modal-close {
    position: absolute;
    top: 0.7rem;
    inset-inline-start: 0.7rem;
    z-index: 2;
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 40, 71, 0.08);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.folio-modal-media {
    border-radius: 0.9rem;
    overflow: hidden;
    background: #0b1524;
    min-height: 14rem;
}
.folio-modal-media img,
.folio-modal-media video {
    width: 100%;
    max-height: min(70vh, 34rem);
    object-fit: contain;
    display: block;
    margin-inline: auto;
}
.folio-modal-title {
    margin: 0.85rem 0 0;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}
body.folio-open { overflow: hidden; }

.infinite-sentinel {
    display: grid;
    place-items: center;
    min-height: 2.5rem;
    padding: 0.75rem 0 1.25rem;
}
.infinite-loading {
    opacity: 0;
    color: var(--ink-muted);
    font-size: 0.82rem;
    font-weight: 700;
    transition: opacity 0.2s ease;
}
.infinite-sentinel.is-loading .infinite-loading { opacity: 1; }

[data-theme="dark"] .folio-modal-card { background: #112033; }
[data-theme="dark"] .folio-modal-close { background: #1a3050; color: #eef4fb; }
[data-theme="dark"] .result-folio {
    background: linear-gradient(180deg, #17304a, #112033);
    border-inline-start-color: rgba(140, 192, 247, 0.14);
}
[data-theme="dark"] .result-folio-thumb { background: #0b1524; }
[data-theme="dark"] .result-folio-none { color: #9aadc2; }

.result-projects {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    margin: 0.35rem 0 0;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #e8f2ff, #f7fbff);
    border: 1px solid rgba(28, 99, 179, 0.16);
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: 700;
}
.result-projects b { font-size: 1rem; }
.result-projects svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}
[data-theme="dark"] .result-projects { background: #17304a; border-color: rgba(140, 192, 247, 0.2); color: #8cc0f7; }

[data-theme="dark"] .search-page .result-card {
    background: #112033;
    border-color: rgba(140, 192, 247, 0.16);
}
[data-theme="dark"] .result-side { background: linear-gradient(180deg, #17304a, #112033); }
[data-theme="dark"] .result-id h3 { color: #eef4fb; }
[data-theme="dark"] .result-summary { background: transparent; color: #d5e4f2; }
[data-theme="dark"] .result-avatar { box-shadow: 0 0 0 4px #112033, 0 0 0 6px rgba(90, 162, 240, 0.28); }

.search-page .results-grid {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 991.98px) {
    .search-back { display: none; }
    .search-layout {
        display: block;
    }

    .filters-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(11, 21, 36, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    body.filters-open .filters-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .search-filters {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(22rem, 92vw);
        max-height: none;
        z-index: 61;
        margin: 0;
        padding: 1rem 1rem 1.15rem;
        border-start-start-radius: 0;
        border-end-start-radius: 0;
        border-start-end-radius: 1.2rem;
        border-end-end-radius: 1.2rem;
        transform: translateX(110%);
        transition: transform 0.28s ease;
        overflow: auto;
        overscroll-behavior: contain;
        box-shadow: -12px 0 40px rgba(11, 21, 36, 0.22);
    }
    body.filters-open {
        overflow: hidden;
    }
    body.filters-open .search-filters {
        transform: translateX(0);
    }

    .filters-close-btn {
        display: grid;
        place-items: center;
        width: 2.2rem;
        height: 2.2rem;
        border: 0;
        border-radius: 999px;
        background: rgba(28, 99, 179, 0.1);
        color: var(--ink);
        cursor: pointer;
    }

    .filters-open-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 2.45rem;
        padding: 0.35rem 0.8rem 0.35rem 0.65rem;
        border: 1px solid rgba(28, 99, 179, 0.22);
        border-radius: 999px;
        background: #e4f1ff;
        color: var(--brand);
        font: inherit;
        font-size: 0.82rem;
        font-weight: 800;
        cursor: pointer;
    }
    .filters-badge {
        min-width: 1.35rem;
        height: 1.35rem;
        padding: 0 0.3rem;
        border-radius: 999px;
        display: inline-grid;
        place-items: center;
        background: #1c63b3;
        color: #fff;
        font-size: 0.7rem;
        font-weight: 800;
    }
    .filters-badge.is-empty { display: none; }

    [data-theme="dark"] .filters-open-btn {
        background: rgba(238, 244, 251, 0.08);
        color: #d5e4f2;
        border-color: rgba(140, 192, 247, 0.22);
    }
    [data-theme="dark"] .filters-badge { background: #5aa2f0; color: #0b1524; }

    .filters-foot {
        background: linear-gradient(180deg, transparent, var(--glass-strong) 28%);
        padding-bottom: 0.25rem;
    }

    .filters-form {
        gap: 0;
    }

    .filters-title {
        font-size: 1.15rem;
    }

    .filters-reset {
        font-size: 0.9rem;
    }

    .filter-panel-toggle {
        padding-block: 1rem;
    }

    .filter-panel-title {
        font-size: 1.05rem;
    }

    .filter-count {
        min-width: 1.45rem;
        height: 1.45rem;
        font-size: 0.8rem;
    }

    .filter-select-search .filter-list-input {
        min-height: 3rem;
        padding: 0.7rem 0.95rem;
        padding-inline-end: 2.4rem;
        border-radius: 0.65rem;
        font-size: 1.05rem;
    }

    .filter-select-placeholder {
        font-size: 0.95rem;
    }

    .filter-select-chip {
        min-height: 1.85rem;
        padding: 0.2rem 0.7rem;
        font-size: 0.88rem;
    }

    .filter-select-items {
        max-height: 18rem;
    }

    .filter-check {
        padding: 0.65rem 0.75rem;
        gap: 0.7rem;
    }

    .filter-check-mark {
        width: 1.25rem;
        height: 1.25rem;
    }

    .filter-check-text {
        font-size: 1rem;
    }

    .filter-check-text small {
        font-size: 0.82rem;
    }

    .filters-apply {
        min-height: 3rem;
        font-size: 1rem;
    }

    .filter-section {
        padding: 0.9rem 0.9rem 0.95rem;
        border-radius: 1.05rem;
    }

    .filter-section-head {
        margin-bottom: 0.75rem;
        padding-bottom: 0.6rem;
    }

    .filter-section-title {
        font-size: 0.9rem;
    }

    .filter-list-search {
        margin-bottom: 0;
    }

    .filter-list-input {
        min-height: 3rem;
        padding: 0.7rem 1rem;
        border-radius: 0.95rem;
        font-size: 1rem;
    }

    .search-page .result-card {
        grid-template-columns: minmax(0, 1fr) 7.25rem;
        grid-template-areas:
            "id side"
            "summary summary"
            "folio folio";
        align-items: stretch;
    }

    .result-id {
        grid-area: id;
        padding: 0.85rem 0.75rem 0.35rem 0.45rem;
        gap: 0.18rem;
        align-content: start;
    }
    .result-id h3 { font-size: 0.98rem; margin-bottom: 0.5rem; }
    .result-roles,
    .result-line,
    .result-projects {
        font-size: 0.76rem;
    }
    .result-projects {
        margin-top: 0.2rem;
        padding: 0.2rem 0.55rem;
        font-size: 0.72rem;
    }
    .result-projects b { font-size: 0.88rem; }

    .result-side {
        grid-area: side;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.75rem 0.9rem 0.7rem 0.35rem;
        gap: 0.55rem;
        align-self: stretch;
    }
    .result-avatar {
        width: 5.75rem;
        height: 5.75rem;
        font-size: 1.45rem;
        box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(21, 120, 227, 0.18);
    }
    .result-stars {
        gap: 0.14rem;
        margin-top: auto;
        padding-bottom: 0.1rem;
    }
    .result-stars svg {
        width: 1.35rem;
        height: 1.35rem;
    }

    .result-summary {
        grid-area: summary;
        display: block;
        overflow: visible;
        padding: 0.2rem 0.95rem 0.55rem;
        font-size: 0.8rem;
        line-height: 1.7;
        text-align: start;
        white-space: normal;
    }

    .result-folio {
        grid-area: folio;
        display: flex;
        flex-wrap: nowrap;
        gap: 0.4rem;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0.95rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-inline-start: 0;
        border-top: 1px solid rgba(28, 99, 179, 0.08);
        padding: 0.7rem 0.95rem 0.9rem;
        grid-template-columns: none;
    }
    .result-folio::-webkit-scrollbar { display: none; width: 0; height: 0; }
    .result-folio-thumb {
        /* سه مربع کامل + حدود یک‌سوم چهارمی برای حس کاروسل */
        flex: 0 0 calc((100% - 1.2rem) * 0.3);
        width: calc((100% - 1.2rem) * 0.3);
        scroll-snap-align: start;
    }
    .result-folio.is-empty {
        display: grid;
        min-height: 4.25rem;
        overflow: hidden;
    }
    .result-folio-none {
        flex: none;
        min-height: 0;
        padding: 0.75rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 767.98px) {
    .search-page .results-grid {
        grid-template-columns: 1fr;
    }

    .search-page .result-card {
        grid-template-columns: minmax(0, 1fr) 6.85rem;
    }

    .result-side {
        padding-inline-end: 0.95rem;
        padding-inline-start: 0.3rem;
    }

    .result-avatar {
        width: 5.5rem;
        height: 5.5rem;
        font-size: 1.35rem;
    }

    .result-stars svg {
        width: 1.3rem;
        height: 1.3rem;
    }

    .search-page .result-id h3,
    .search-page .project-result .result-id h3 {
        margin-bottom: 0.95rem;
        font-size: 1.08rem;
    }

    .search-page .result-roles,
    .search-page .result-line,
    .search-page .result-projects,
    .search-page .result-summary,
    .search-page .result-role-chip {
        font-size: 0.88rem;
    }
}
