/* R13.1 — SELA Production Vault interface and mobile polish */
:root {
    --sv-bg: #08101d;
    --sv-surface: rgba(16, 28, 48, .92);
    --sv-surface-soft: rgba(22, 38, 65, .72);
    --sv-border: rgba(151, 178, 229, .15);
    --sv-border-strong: rgba(151, 178, 229, .28);
    --sv-text: #f3f7ff;
    --sv-muted: #9eaed0;
    --sv-accent: #79a7ff;
    --sv-accent-strong: #4a7ee8;
    --sv-success: #57d1a4;
    --sv-danger: #ff8f97;
    --sv-shadow: 0 16px 42px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--sv-bg); }

body.vault-body {
    min-width: 320px;
    margin: 0;
    min-height: 100vh;
    color: var(--sv-text);
    background:
        radial-gradient(circle at 0% 0%, rgba(59, 95, 179, .17), transparent 34rem),
        radial-gradient(circle at 100% 100%, rgba(54, 111, 163, .12), transparent 32rem),
        var(--sv-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}

.vault-shell { min-height: 100vh; display: flex; }

.vault-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 258px;
    height: 100vh;
    flex: 0 0 258px;
    overflow-y: auto;
    padding: 24px 14px 18px;
    background: linear-gradient(180deg, rgba(9, 18, 34, .98), rgba(10, 20, 38, .96));
    border-inline-end: 1px solid var(--sv-border);
}

.vault-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 54px;
    padding: 7px 10px 23px;
    color: var(--sv-text);
    text-decoration: none;
    letter-spacing: .04em;
}

.vault-brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(75, 124, 255, .3)); }
.vault-brand > span { line-height: 1.02; font-size: 16px; font-weight: 800; }
.vault-brand small { color: var(--sv-muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; }

.vault-nav { display: grid; gap: 4px; }
.vault-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 10px 12px;
    color: #b8c5e3;
    border: 1px solid transparent;
    border-radius: 11px;
    text-decoration: none;
    transition: .18s ease;
}
.vault-nav a > span:first-child { width: 18px; text-align: center; font-size: 18px; line-height: 1; }
.vault-nav a:hover { color: #fff; background: rgba(82, 122, 210, .12); border-color: rgba(130, 168, 255, .12); }
.vault-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(66, 112, 222, .32), rgba(66, 112, 222, .10)); border-color: rgba(126, 165, 255, .25); box-shadow: inset 3px 0 0 var(--sv-accent); }
.nav-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    margin-inline-start: auto;
    padding: 0 5px;
    color: #07101f;
    background: #ffcc70;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}
.vault-sidebar-footer { margin-top: 28px; padding: 14px 11px; color: #7185ad; border-top: 1px solid var(--sv-border); font-size: 11px; line-height: 1.55; }

.vault-main { min-width: 0; flex: 1 1 auto; }
.vault-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 84px;
    padding: 16px clamp(18px, 3vw, 42px);
    background: rgba(8, 16, 29, .78);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--sv-border);
}
.vault-topbar h1 { margin: 2px 0 0; font-size: clamp(21px, 2.2vw, 29px); line-height: 1.1; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: #7ea9ff; font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

.vault-user-menu { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.topbar-search { display: flex; align-items: center; width: min(310px, 25vw); min-width: 180px; border: 1px solid var(--sv-border); background: rgba(17, 29, 50, .86); border-radius: 10px; overflow: hidden; }
.topbar-search input { width: 100%; min-width: 0; padding: 10px 11px; color: var(--sv-text); border: 0; outline: 0; background: transparent; }
.topbar-search input::placeholder { color: #7f90b4; }
.topbar-search button { width: 38px; padding: 0; color: #bcd0ff; background: transparent; border: 0; font-size: 20px; cursor: pointer; }
.topbar-notification-link, .topbar-profile { color: var(--sv-text); text-decoration: none; }
.topbar-notification-link { position: relative; display: grid; place-items: center; width: 38px; height: 38px; color: #c7d5f7; border: 1px solid var(--sv-border); border-radius: 10px; font-size: 20px; }
.topbar-notification-link:hover { border-color: var(--sv-border-strong); background: rgba(95, 137, 228, .12); }
.topbar-notification-link span { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; color: #101929; background: #ffca78; border-radius: 50px; font-size: 9px; font-weight: 800; }
.locale-switcher { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: rgba(23, 38, 65, .8); border: 1px solid var(--sv-border); border-radius: 10px; }
.locale-switcher form { margin: 0; }
.locale-switcher button { min-width: 29px; height: 28px; padding: 0 6px; color: var(--sv-muted); background: transparent; border: 0; border-radius: 7px; font-size: 10px; font-weight: 800; cursor: pointer; }
.locale-switcher button.active { color: white; background: rgba(89, 138, 244, .5); }
.topbar-profile { display: flex; align-items: center; gap: 9px; max-width: 220px; padding: 4px 8px 4px 4px; border-radius: 10px; }
.topbar-profile:hover { background: rgba(95, 137, 228, .11); }
.vault-user-initial { display: grid; place-items: center; width: 31px; height: 31px; color: #dce8ff; background: linear-gradient(145deg, #497add, #2a476f); border-radius: 10px; font-size: 13px; font-weight: 800; }
.topbar-profile-copy { display: grid; min-width: 0; }
.topbar-profile-copy strong, .topbar-profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-profile-copy strong { color: #eef4ff; font-size: 12px; }
.topbar-profile-copy small { color: var(--sv-muted); font-size: 10px; }
.vault-user-menu > form:last-child button { padding: 9px 10px; color: #d7e0f7; background: transparent; border: 1px solid var(--sv-border); border-radius: 10px; cursor: pointer; }
.vault-user-menu > form:last-child button:hover { color: #fff; border-color: rgba(255, 143, 151, .45); background: rgba(199, 60, 79, .12); }

.vault-content { width: min(1480px, 100%); margin: 0 auto; padding: clamp(22px, 3vw, 38px); }
.page-head, .page-heading, .page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-head h2, .page-heading h1, .page-intro h2 { margin: 6px 0 8px; font-size: clamp(23px, 2.5vw, 34px); letter-spacing: -.025em; }
.page-head p, .page-heading p, .page-intro p, .muted-copy { color: var(--sv-muted); line-height: 1.7; }

.primary-link, .primary-button, .secondary-button, .secondary-link, .text-action, .text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 9px 14px;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: .18s ease;
}
.primary-link, .primary-button { color: #fff; background: linear-gradient(135deg, #4d83ed, #315cb8); border: 1px solid rgba(165, 195, 255, .35); box-shadow: 0 10px 22px rgba(40, 87, 183, .22); }
.primary-link:hover, .primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.secondary-button, .secondary-link { color: #dce8ff; background: rgba(31, 50, 83, .72); border: 1px solid var(--sv-border-strong); }
.secondary-button:hover, .secondary-link:hover { color: white; background: rgba(68, 103, 171, .55); }
.text-action, .text-link { min-height: auto; padding: 4px 0; color: #91b5ff; background: transparent; border: 0; }
.text-action:hover, .text-link:hover { color: white; }

.dashboard-hero, .panel, .vault-panel, .page-intro, .vault-workspace, .file-tree-panel, .activity-panel, .notification-item, .announcement-card {
    border: 1px solid var(--sv-border);
    box-shadow: var(--sv-shadow);
}
.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(22px, 3vw, 34px); margin-bottom: 18px; overflow: hidden; background: linear-gradient(125deg, rgba(44, 76, 142, .76), rgba(18, 33, 58, .95)); border-radius: 17px; }
.dashboard-hero h2 { margin: 10px 0 7px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.03em; }
.dashboard-hero p { max-width: 620px; margin: 0; color: #c1d2f3; line-height: 1.7; }
.hero-mark { display: grid; place-items: center; flex: 0 0 auto; width: 88px; height: 88px; color: #ddebff; background: radial-gradient(circle at 30% 25%, #6896f6, #263e70); border: 1px solid rgba(220, 234, 255, .25); border-radius: 24px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 18px 35px rgba(9,18,38,.4); font-size: 24px; font-weight: 900; letter-spacing: .08em; }
.status-pill, .small-status, .status-overlay { display: inline-flex; align-items: center; justify-content: center; width: fit-content; padding: 5px 8px; color: #bfead9; background: rgba(52, 174, 123, .14); border: 1px solid rgba(87, 209, 164, .23); border-radius: 999px; font-size: 11px; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 19px; background: linear-gradient(145deg, rgba(25, 42, 71, .96), rgba(14, 25, 44, .96)); border: 1px solid var(--sv-border); border-radius: 13px; box-shadow: var(--sv-shadow); }
.metric-card span { display: block; min-height: 34px; color: var(--sv-muted); font-size: 12px; line-height: 1.4; }
.metric-card strong { display: block; margin-top: 8px; color: #fff; font-size: clamp(28px, 3vw, 38px); line-height: 1; }
.panel-grid, .grid-two, .settings-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 18px; }
.panel, .vault-panel { padding: clamp(18px, 2.3vw, 26px); background: var(--sv-surface); border-radius: 14px; }
.panel-head, .section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel h3, .vault-panel h3, .section-title-row h3 { margin: 5px 0 0; font-size: 18px; }
.project-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; color: inherit; border-top: 1px solid rgba(151, 178, 229, .1); text-decoration: none; }
.project-row:first-of-type { border-top: 0; }
.project-row:hover { color: white; }
.project-row strong { display: block; font-size: 13px; }
.project-row small { color: var(--sv-muted); font-size: 11px; }
.project-poster-thumb, .project-poster-placeholder { width: 40px; height: 51px; border-radius: 7px; object-fit: cover; background: linear-gradient(145deg, #244773, #15263e); border: 1px solid rgba(180, 207, 255, .18); }
.project-poster-placeholder { display: grid; place-items: center; color: #dbe8ff; font-size: 11px; font-weight: 900; }
.account-list { margin: 0; }
.account-list div { display: grid; grid-template-columns: 126px minmax(0,1fr); gap: 12px; padding: 11px 0; border-top: 1px solid rgba(151,178,229,.1); }
.account-list dt { color: var(--sv-muted); font-size: 12px; }
.account-list dd { min-width: 0; margin: 0; color: #eaf1ff; overflow-wrap: anywhere; font-size: 13px; }

.filter-bar, .stack-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 14px; margin-bottom: 18px; background: rgba(17, 29, 50, .72); border: 1px solid var(--sv-border); border-radius: 13px; }
.filter-bar input { flex: 1 1 260px; }
.filter-bar select { flex: 0 1 190px; }
input, select, textarea { min-height: 40px; padding: 9px 11px; color: var(--sv-text); background: rgba(6, 15, 30, .72); border: 1px solid var(--sv-border-strong); border-radius: 9px; outline: none; font: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--sv-accent); box-shadow: 0 0 0 3px rgba(96, 146, 248, .14); }
select option { color: #17233b; }
label { display: grid; gap: 7px; color: #dbe6fa; font-size: 12px; font-weight: 700; }
.stack-form label { flex: 1 1 220px; }
.checkbox-line { display: flex; align-items: center; gap: 9px; min-height: 40px; }
.checkbox-line input { min-height: 0; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
.project-card { overflow: hidden; color: var(--sv-text); background: var(--sv-surface); border: 1px solid var(--sv-border); border-radius: 13px; text-decoration: none; box-shadow: var(--sv-shadow); transition: .2s ease; }
.project-card:hover { transform: translateY(-4px); border-color: rgba(132, 173, 255, .43); box-shadow: 0 23px 44px rgba(0,0,0,.28); }
.poster-frame { position: relative; aspect-ratio: 2 / 2.6; overflow: hidden; background: linear-gradient(150deg, #172e50, #0c182b); }
.poster-frame img { width: 100%; height: 100%; object-fit: cover; transition: .3s ease; }
.project-card:hover .poster-frame img { transform: scale(1.04); }
.poster-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: #cfe0ff; background: linear-gradient(135deg, #244978, #111f37); font-size: 30px; font-weight: 900; }
.status-overlay { position: absolute; top: 10px; inset-inline-start: 10px; backdrop-filter: blur(8px); }
.project-card-body { display: grid; gap: 6px; padding: 13px; }
.project-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.project-card-body small, .project-card-body span { color: var(--sv-muted); font-size: 11px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--sv-border); border-radius: 11px; }
.vault-table { width: 100%; min-width: 710px; border-collapse: collapse; background: rgba(8, 16, 29, .35); }
.vault-table th, .vault-table td { padding: 13px 14px; text-align: start; border-bottom: 1px solid rgba(151,178,229,.1); vertical-align: middle; }
.vault-table th { color: #aebfe3; background: rgba(25, 42, 69, .7); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.vault-table td { color: #e3ecff; font-size: 13px; }
.vault-table tr:hover td { background: rgba(67, 108, 182, .07); }
.vault-table code, .code-block { overflow-wrap: anywhere; color: #cce0ff; background: rgba(6, 15, 30, .8); border: 1px solid rgba(121, 164, 255, .15); border-radius: 7px; }
.vault-table code { padding: 4px 6px; font-size: 11px; }
.code-block { padding: 13px; direction: ltr; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.notification-item { display: flex; gap: 13px; margin-bottom: 11px; padding: 14px; color: inherit; background: var(--sv-surface); border-radius: 12px; text-decoration: none; }
.notification-item:hover { border-color: rgba(129, 170, 255, .4); background: rgba(24, 41, 70, .91); }
.notification-item.is-unread { border-inline-start: 3px solid var(--sv-accent); }
.notification-item-icon { display: grid; place-items: center; flex: 0 0 33px; width: 33px; height: 33px; color: #bcd3ff; background: rgba(64, 102, 178, .22); border-radius: 10px; }
.notification-item-content { min-width: 0; flex: 1; }
.notification-item-content > strong { display: block; margin-bottom: 4px; }
.notification-item-content > p { margin: 0; color: var(--sv-muted); line-height: 1.7; }
.notification-item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; color: #8497bf; font-size: 11px; }
.notification-bilingual-block { border-color: rgba(122,151,232,.3); background: rgba(12, 25, 46, .66); }

.alert { margin-bottom: 17px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.alert-success { color: #c8ffea; background: rgba(40, 159, 115, .16); border: 1px solid rgba(87,209,164,.25); }
.alert-error { color: #ffd9dc; background: rgba(196, 70, 79, .14); border: 1px solid rgba(255,143,151,.24); }
.empty-state { display: grid; gap: 6px; padding: 26px 14px; color: var(--sv-muted); text-align: center; }
.empty-state strong { color: #e6efff; }
.full-span { grid-column: 1 / -1; }
.pagination-wrap { margin-top: 20px; }

.vault-mobile-nav { display: none; }

@media (max-width: 1180px) {
    .vault-sidebar { width: 224px; flex-basis: 224px; }
    .topbar-profile-copy { display: none; }
    .topbar-profile { padding: 4px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .vault-sidebar { width: 74px; flex-basis: 74px; padding-inline: 9px; }
    .vault-brand { justify-content: center; padding-inline: 0; }
    .vault-brand > span, .vault-nav a > span:nth-child(2), .vault-sidebar-footer { display: none; }
    .vault-nav a { justify-content: center; padding-inline: 0; }
    .vault-nav a > span:first-child { width: auto; }
    .nav-notification-badge { position: absolute; top: 4px; inset-inline-end: 5px; }
    .topbar-search { width: min(270px, 36vw); }
    .panel-grid, .grid-two, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    body.vault-body { padding-bottom: 80px; }
    .vault-shell { display: block; }
    .vault-sidebar { display: none; }
    .vault-topbar { position: relative; min-height: 0; padding: 15px 16px; gap: 12px; align-items: flex-start; }
    .vault-topbar h1 { font-size: 21px; }
    .vault-topbar .eyebrow { max-width: 185px; font-size: 9px; }
    .vault-user-menu { flex-wrap: wrap; gap: 7px; }
    .topbar-search { order: 10; width: 100%; min-width: 100%; }
    .vault-user-menu > form:last-child, .locale-switcher { display: none; }
    .topbar-profile { display: none; }
    .vault-content { padding: 20px 14px; }
    .page-head, .page-heading, .page-intro { display: grid; gap: 12px; margin-bottom: 17px; }
    .page-head .primary-link, .page-intro .primary-button { width: 100%; }
    .dashboard-hero { align-items: flex-start; padding: 21px; border-radius: 14px; }
    .hero-mark { width: 54px; height: 54px; border-radius: 16px; font-size: 16px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .metric-card { padding: 14px; border-radius: 11px; }
    .metric-card strong { font-size: 29px; }
    .panel, .vault-panel { padding: 15px; border-radius: 12px; }
    .project-row { grid-template-columns: 40px minmax(0, 1fr); }
    .project-row .small-status { display: none; }
    .account-list div { grid-template-columns: 1fr; gap: 4px; }
    .filter-bar { padding: 11px; }
    .filter-bar input, .filter-bar select, .filter-bar button { flex: 1 1 100%; width: 100%; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .project-card-body { padding: 10px; }
    .project-card-body strong { font-size: 12px; }
    .project-card-body small, .project-card-body span { font-size: 10px; }
    .notification-item { padding: 12px; border-radius: 11px; }
    .notification-item-icon { display: none; }
    .notification-bilingual-block { padding: 9px; }
    .vault-mobile-nav {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        min-height: 65px;
        padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        background: rgba(8, 16, 29, .96);
        backdrop-filter: blur(19px);
        border-top: 1px solid var(--sv-border-strong);
        box-shadow: 0 -14px 30px rgba(0,0,0,.18);
    }
    .vault-mobile-nav a { position: relative; display: grid; place-items: center; gap: 3px; color: #91a3c7; text-decoration: none; }
    .vault-mobile-nav a > span { min-height: 19px; font-size: 19px; line-height: 1; }
    .vault-mobile-nav small { font-size: 9px; font-weight: 700; }
    .vault-mobile-nav a.active { color: #b9d2ff; }
    .vault-mobile-nav a.active::before { position: absolute; top: -7px; width: 25px; height: 2px; background: var(--sv-accent); border-radius: 50px; content: ""; }
    .mobile-nav-notification { position: relative; }
    .mobile-nav-notification b { position: absolute; top: -7px; inset-inline-end: -9px; display: grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; color: #0d1726; background: #ffd078; border-radius: 50px; font-size: 8px; }
}

@media (max-width: 390px) {
    .project-grid { grid-template-columns: 1fr 1fr; }
    .vault-topbar { padding-inline: 12px; }
    .vault-content { padding-inline: 11px; }
}

/* R13.1.1 — mobile project cards and file-vault accessibility fix */
@media (max-width: 680px) {
    /* Keep project status compact and readable above the poster. */
    .project-card .poster-frame .status-overlay {
        position: absolute !important;
        inset: 8px auto auto 8px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: calc(100% - 16px) !important;
        min-height: 0 !important;
        height: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 6px 8px !important;
        border-radius: 999px !important;
        font-size: 10px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        text-align: start !important;
        writing-mode: horizontal-tb !important;
        transform: none !important;
        overflow: hidden !important;
        backdrop-filter: blur(8px);
    }

    [dir="rtl"] .project-card .poster-frame .status-overlay {
        inset: 8px 8px auto auto !important;
    }

    /* File rows become stacked cards, so actions remain visible without horizontal swiping. */
    .file-table-wrap {
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
    }

    .file-table-wrap .file-table {
        display: block;
        width: 100%;
        min-width: 0 !important;
        background: transparent;
    }

    .file-table-wrap .file-table thead {
        display: none;
    }

    .file-table-wrap .file-table tbody {
        display: grid;
        gap: 12px;
    }

    .file-table-wrap .file-table tr {
        display: block;
        overflow: hidden;
        background: var(--sv-surface);
        border: 1px solid var(--sv-border);
        border-radius: 13px;
        box-shadow: var(--sv-shadow);
    }

    .file-table-wrap .file-table td {
        display: grid;
        grid-template-columns: minmax(106px, .72fr) minmax(0, 1.28fr);
        gap: 12px;
        padding: 11px 12px;
        border-bottom: 1px solid rgba(151, 178, 229, .1);
        text-align: start;
    }

    .file-table-wrap .file-table td::before {
        content: attr(data-label);
        color: var(--sv-muted);
        font-size: 10px;
        font-weight: 800;
        line-height: 1.5;
        letter-spacing: .02em;
    }

    .file-table-wrap .file-table td.file-primary-cell {
        display: block;
        padding: 13px 12px;
    }

    .file-table-wrap .file-table td.file-primary-cell::before {
        display: none;
    }

    .file-table-wrap .file-table td.file-primary-cell .file-name-cell {
        display: flex;
        gap: 10px;
        align-items: flex-start;
    }

    .file-table-wrap .file-table .file-name-cell strong,
    .file-table-wrap .file-table .file-name-cell small,
    .file-table-wrap .file-table td strong,
    .file-table-wrap .file-table td small {
        display: block;
        overflow-wrap: anywhere;
    }

    .file-table-wrap .file-table td.file-actions-cell {
        display: block;
        padding: 12px;
        border-bottom: 0;
    }

    .file-table-wrap .file-table td.file-actions-cell::before {
        display: block;
        margin-bottom: 9px;
    }

    .file-table-wrap .file-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .file-table-wrap .file-actions a,
    .file-table-wrap .file-actions button,
    .file-table-wrap .file-actions form {
        width: 100%;
        min-width: 0;
    }

    .file-table-wrap .file-actions a,
    .file-table-wrap .file-actions button {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 8px 7px;
        color: #dfeaff;
        background: rgba(31, 50, 83, .72);
        border: 1px solid var(--sv-border-strong);
        border-radius: 9px;
        font: inherit;
        font-size: 11px;
        font-weight: 700;
        text-align: center;
        text-decoration: none;
    }

    .file-table-wrap .file-actions .file-delete-button,
    .file-table-wrap .file-actions .file-request-archive {
        color: #ffd9dc;
        background: rgba(196, 70, 79, .14);
        border-color: rgba(255, 143, 151, .32);
    }

    .file-table-wrap .file-table .table-empty {
        display: block;
        text-align: center;
    }

    .file-table-wrap .file-table .table-empty::before {
        display: none;
    }
}


/* R13.1.2 — single-column production library cards on mobile */
.mobile-project-status { display: none; }

@media (max-width: 680px) {
    .project-library-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .project-library-grid .project-card {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        min-height: 132px;
        border-radius: 14px;
    }

    .project-library-grid .project-card .poster-frame {
        grid-column: 1;
        grid-row: 1;
        width: 108px;
        min-height: 132px;
        height: 100%;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .project-library-grid .project-card .poster-frame .status-overlay {
        display: none !important;
    }

    .project-library-grid .project-card-body {
        grid-column: 2;
        grid-row: 1;
        align-content: center;
        gap: 7px;
        padding: 15px 15px 14px;
    }

    .project-library-grid .project-card-body strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        font-size: 17px;
        line-height: 1.25;
    }

    .project-library-grid .project-card-body small,
    .project-library-grid .project-card-body > span:not(.mobile-project-status) {
        font-size: 12px;
        line-height: 1.5;
    }

    .project-library-grid .mobile-project-status {
        display: inline-flex;
        align-items: center;
        align-self: flex-start;
        max-width: 100%;
        padding: 4px 8px;
        color: #bfead9;
        background: rgba(52, 174, 123, .14);
        border: 1px solid rgba(87, 209, 164, .23);
        border-radius: 999px;
        font-size: 10px;
        font-weight: 800;
        line-height: 1.3;
    }
}

/* R13.1.3 — Desktop project status overlay restore
   R13.1 introduced a top value that combined with the older bottom inset.
   On desktop that made the status pill stretch across the poster height.
   These rules fully reset the desktop inset while preserving the mobile layout. */
@media (min-width: 681px) {
    .project-library-grid .project-card .poster-frame .status-overlay {
        position: absolute !important;
        inset: auto 11px 11px auto !important;
        top: auto !important;
        right: 11px !important;
        bottom: 11px !important;
        left: auto !important;
        z-index: 2;
        display: inline-flex !important;
        width: max-content !important;
        min-width: 0 !important;
        max-width: calc(100% - 22px) !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 5px 8px !important;
        overflow: hidden !important;
        border-radius: 999px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        writing-mode: horizontal-tb !important;
        transform: none !important;
    }

    [dir="rtl"] .project-library-grid .project-card .poster-frame .status-overlay {
        inset: auto auto 11px 11px !important;
        top: auto !important;
        right: auto !important;
        bottom: 11px !important;
        left: 11px !important;
    }
}
