:root {
    color-scheme: light;
    --page: #f4f6fa;
    --surface: #ffffff;
    --surface-muted: #f8f9fc;
    --ink: #172033;
    --muted: #718096;
    --line: #e7ebf1;
    --blue: #1769ff;
    --blue-dark: #0b51d3;
    --blue-soft: #eaf1ff;
    --green: #168f76;
    --coral: #e4684f;
    --shadow: 0 12px 36px rgba(26, 43, 72, .07);
    --shadow-small: 0 4px 16px rgba(26, 43, 72, .06);
    --radius: 8px;
    font-family: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(ellipse at 8% 0%, rgba(225, 235, 255, .68), transparent 30%), var(--page); color: var(--ink); font-family: 'DM Sans', sans-serif; font-size: 14px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.app-shell { max-width: 1600px; margin: 0 auto; padding: 18px clamp(14px, 3.2vw, 48px) 24px; }

.topbar { position: sticky; top: 12px; z-index: 20; display: flex; align-items: center; gap: 20px; min-height: 68px; padding: 9px 13px 9px 17px; border: 1px solid rgba(255,255,255,.8); border-radius: 16px; background: rgba(255,255,255,.83); box-shadow: 0 8px 30px rgba(33, 49, 77, .08); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); }
.brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; min-width: 145px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #2477ff, #064fce); color: #fff; font-family: 'Manrope', sans-serif; font-size: 24px; font-weight: 800; line-height: 1; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; line-height: 1; }
.brand-copy small { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.main-nav { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-link { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 39px; padding: 0 12px; border-radius: 10px; color: #536074; font-size: 12px; font-weight: 600; transition: background .18s ease, color .18s ease; }
.nav-link i { font-size: 13px; }
.nav-link:hover { background: #f1f4f9; color: var(--ink); }
.nav-link.active { background: #eaf1ff; color: #125bdc; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.is-locked .main-nav, .is-locked .top-actions { display: none; }
.icon-button, .avatar-button { display: inline-grid; flex: 0 0 auto; width: 35px; height: 35px; place-items: center; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #59667b; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.icon-button:hover { border-color: var(--line); background: var(--surface-muted); color: var(--blue); }
.icon-button.active { background: var(--blue-soft); color: var(--blue); }
.icon-button.is-favorite, .favorite-button.is-favorite { color: #f1a51c; }
.avatar-button { border: 0; background: #172b4d; color: #fff; font-size: 11px; font-weight: 700; }

.workspace { padding-top: 32px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 26px; }
.eyebrow { color: #8792a4; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Manrope', sans-serif; }
.welcome-row h1 { margin: 7px 0 4px; font-size: clamp(25px, 3vw, 34px); letter-spacing: 0; line-height: 1.15; }
.welcome-row p, .section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.welcome-actions { display: flex; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--blue); box-shadow: 0 4px 12px rgba(23,105,255,.17); color: #fff; }
.button-primary:hover { background: var(--blue-dark); }
.button-danger { border: 0; background: #d94a43; color: #fff; }
.button-danger:hover { background: #bd3833; }
.button-secondary { border-color: var(--line); background: var(--surface); color: #46536a; }
.button-secondary:hover { background: var(--surface-muted); }
.text-button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 2px; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 11px; font-weight: 700; }

.toolbar { display: flex; align-items: flex-end; gap: 10px; }
.filter-toolbar { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.83); }
.search-box { display: flex; flex: 1 1 250px; align-items: center; gap: 10px; height: 39px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: #8a95a5; }
.search-box:focus-within { border-color: #83adff; box-shadow: 0 0 0 3px rgba(23,105,255,.08); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #9aa4b2; }
.filter-field { display: grid; flex: 0 1 155px; gap: 5px; color: #667287; font-size: 10px; font-weight: 700; }
.filter-field select, .view-tools select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline-color: #83adff; background: var(--surface); color: #536074; font-size: 11px; }
.filter-toolbar > .text-button { min-height: 36px; padding: 0 3px; white-space: nowrap; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 27px 0 14px; }
.section-heading h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: 0; }
.view-tools { display: flex; align-items: center; gap: 7px; }
.view-tools select { width: auto; min-width: 126px; height: 34px; }
.muted { color: var(--muted); font-size: 11px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(26,43,72,.035); transition: box-shadow .2s ease, transform .2s ease; animation: rise-in .35s ease both; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-image { position: relative; display: block; width: 100%; aspect-ratio: 1.72; overflow: hidden; padding: 0; border: 0; background: #e8edf4; cursor: pointer; }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.project-card:hover .project-image img { transform: scale(1.035); }
.image-count { position: absolute; right: 10px; bottom: 9px; padding: 5px 8px; border-radius: 20px; background: rgba(17,29,48,.78); color: white; font-size: 10px; }
.favorite-button { position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 9px; background: rgba(255,255,255,.92); color: #67748a; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.project-card-body { padding: 13px 14px 12px; }
.tag-row, .presentation-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 8px; border-radius: 20px; background: color-mix(in srgb, var(--tag-color, var(--blue)) 10%, white); color: color-mix(in srgb, var(--tag-color, var(--blue)) 85%, #102a55); font-size: 10px; font-weight: 700; }
.tag-soft { background: #f0f2f6; color: #657186; }
.project-title { display: block; max-width: 100%; margin: 10px 0 3px; overflow: hidden; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.project-company { margin: 0; color: var(--muted); font-size: 11px; }
.project-company span { padding: 0 3px; color: #b2bac6; }
.project-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eff1f5; color: #8a95a5; font-size: 10px; }
.project-card-links, .project-detail-links, .presentation-project-links { display: flex; align-items: center; gap: 6px; }
.project-link-icon { display: inline-grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--green); transition: border-color .18s ease, background .18s ease, color .18s ease; }
.project-link-icon:hover { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); background: color-mix(in srgb, var(--green) 8%, var(--surface)); color: var(--green); }
.project-card-links { margin-right: 6px; margin-left: auto; }
.project-card-links .project-link-icon { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 50%; background: #fff; }
.round-link { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--blue); cursor: pointer; }
.list-layout { grid-template-columns: 1fr; gap: 9px; }
.list-layout .project-card { display: grid; grid-template-columns: 210px 1fr; }
.list-layout .project-image { height: 100%; aspect-ratio: auto; min-height: 145px; }
.list-layout .project-card-body { align-self: center; }
.list-layout .favorite-button { left: 165px; right: auto; }
.empty-state { display: grid; justify-items: center; padding: 56px 20px; color: var(--muted); text-align: center; }
.empty-state > i { margin-bottom: 13px; color: #91a9ce; font-size: 28px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0; font-size: 12px; }

.management-heading { margin-top: 0; margin-bottom: 20px; }
.entity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.entity-card, .surface, .stat-card, .file-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(26,43,72,.035); }
.entity-card { position: relative; min-height: 176px; padding: 17px; }
.entity-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--entity-color) 11%, white); color: var(--entity-color); }
.entity-logo { position: relative; display: grid; width: min(100%, 180px); height: 96px; place-items: center; margin: 0 auto 8px; color: var(--blue); }
.entity-logo > i { position: absolute; font-size: 48px; opacity: .16; }
.entity-logo:has(img) > i { display: none; }
.entity-logo img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.entity-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; margin-top: 13px; }
.entity-card h3 { margin: 0; font-size: 14px; }
.entity-card p { min-height: 31px; margin: 6px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.entity-actions { display: flex; justify-content: flex-end; gap: 4px; }
.danger-action:hover { border-color: #f3d7d5; background: #fff4f2; color: #d45445; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid #edf0f4; white-space: nowrap; }
th { background: var(--surface-muted); color: #68758a; font-size: 10px; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.projects-table { width: 100%; table-layout: fixed; }
.projects-table th:nth-child(1), .projects-table td:nth-child(1) { width: 21%; }
.projects-table th:nth-child(2), .projects-table td:nth-child(2) { width: 14%; }
.projects-table th:nth-child(3), .projects-table td:nth-child(3) { width: 45%; }
.projects-table th:nth-child(4), .projects-table td:nth-child(4) { width: 8%; }
.projects-table th:nth-child(5), .projects-table td:nth-child(5) { width: 12%; }
.project-services-cell { white-space: normal; }
.project-service-list { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 5px; }
.project-service-list .tag { white-space: normal; }
td .icon-button { width: 29px; height: 29px; }
.table-project { display: flex; align-items: center; gap: 9px; }
.table-project img { width: 42px; height: 32px; border-radius: 5px; object-fit: cover; }
.file-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.file-card { overflow: hidden; }
.file-preview { display: grid; height: 145px; place-items: center; overflow: hidden; background: #edf2f8; color: #4774b8; font-size: 33px; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-card-content { padding: 11px; }
.file-card-content strong, .file-card-content span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-content strong { font-size: 11px; }
.file-card-content span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.file-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.file-actions .text-button { font-size: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.stat-card { display: flex; align-items: center; gap: 13px; padding: 17px; }
.stat-icon, .settings-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-family: 'Manrope', sans-serif; font-size: 23px; }
.stat-card div > span { color: var(--muted); font-size: 11px; }
.report-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.surface { padding: 18px; }
.surface h3 { margin: 0 0 16px; font-size: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 22px; align-items: center; gap: 10px; margin: 14px 0; font-size: 10px; }
.bar-row > span { overflow: hidden; color: #5d6a7f; text-overflow: ellipsis; white-space: nowrap; }
.bar-row strong { text-align: right; }
.bar-track { height: 7px; overflow: hidden; border-radius: 8px; background: #eff2f7; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); }
.recent-list { display: grid; gap: 11px; }
.recent-item { display: flex; align-items: center; gap: 10px; }
.recent-item img { width: 48px; height: 39px; border-radius: 6px; object-fit: cover; }
.recent-item strong, .recent-item span { display: block; }
.recent-item strong { max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recent-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-card { display: flex; align-items: flex-start; gap: 13px; padding: 18px; }
.settings-card h3 { margin: 1px 0 5px; font-size: 14px; }
.settings-card p { margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.settings-password-card, .user-management-card { min-width: 0; }
.settings-password-card > .settings-card { padding: 0; }
.settings-password-form { max-width: 460px; margin-top: 18px; }
.settings-password-form select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; outline-color: #83adff; background: var(--surface); color: var(--ink); font-size: 12px; }
.user-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 22px; }
.user-list-heading h4 { margin: 0; font-size: 12px; }
.user-list { display: grid; gap: 9px; margin-top: 11px; }
.user-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); }
.user-list-identity { min-width: 0; }
.user-list-identity strong, .user-list-identity span { display: block; overflow-wrap: anywhere; }
.user-list-identity strong { font-size: 11px; }
.user-list-identity span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-list-actions { display: grid; justify-items: end; gap: 5px; flex: 0 0 auto; }
.user-role-label { color: var(--muted); font-size: 9px; }
.user-status-button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 700; }
.user-status-button.is-inactive { color: var(--green); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; font-weight: 700; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.site-footer { display: flex; justify-content: space-between; margin-top: 42px; padding: 15px 3px 0; border-top: 1px solid rgba(210,218,230,.65); color: #8b96a6; font-size: 10px; }

.auth-screen { position: relative; isolation: isolate; display: grid; min-height: calc(100vh - 150px); place-items: center; overflow: hidden; border-radius: 18px; background: radial-gradient(ellipse at 18% 12%, rgba(61,166,255,.17), transparent 35%), radial-gradient(ellipse at 85% 88%, rgba(36,198,211,.14), transparent 34%); }
.auth-screen::before, .auth-screen::after { position: absolute; z-index: -1; width: 300px; aspect-ratio: 1; border: 1px solid rgba(40,130,229,.14); border-radius: 50%; content: ''; }
.auth-screen::before { top: 8%; left: 7%; box-shadow: 0 0 0 28px rgba(40,130,229,.035), 0 0 0 58px rgba(40,130,229,.025); }
.auth-screen::after { right: 5%; bottom: -35%; width: 390px; border-color: rgba(30,177,190,.15); box-shadow: 0 0 0 32px rgba(30,177,190,.035); }
.auth-panel { position: relative; width: min(100%, 430px); padding: 34px 38px; border: 1px solid rgba(255,255,255,.82); border-radius: 14px; background: color-mix(in srgb, var(--surface) 84%, transparent); box-shadow: 0 22px 65px rgba(32,76,132,.13), inset 0 1px rgba(255,255,255,.8); backdrop-filter: blur(18px) saturate(135%); -webkit-backdrop-filter: blur(18px) saturate(135%); animation: rise-in .4s ease both; }
.auth-emblem { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 17px; border: 1px solid rgba(38,132,239,.18); border-radius: 13px; background: linear-gradient(145deg, rgba(47,139,255,.15), rgba(36,198,211,.12)); box-shadow: inset 0 1px rgba(255,255,255,.8); color: #1675df; font-size: 18px; }
.auth-panel h1 { margin: 10px 0; font-size: 27px; }
.auth-panel > p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-form, #uploadForm { display: grid; gap: 13px; margin-top: 22px; }
.auth-form label, #uploadForm label, .form-grid label { display: grid; gap: 7px; color: #59667a; font-size: 11px; font-weight: 700; }
.auth-form input, .form-grid input, .form-grid select, .form-grid textarea, #uploadForm input, #uploadForm select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; outline-color: #83adff; background: var(--surface); color: var(--ink); font-size: 12px; transition: border-color .18s ease, box-shadow .18s ease; }
.password-field { position: relative; display: block; width: 100%; }
.auth-form .password-field input { padding-right: 42px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 30px; height: 30px; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.password-toggle:hover, .password-toggle:focus-visible { background: var(--blue-soft); color: var(--blue); outline: none; }
.auth-form input:focus { border-color: #4a9bea; box-shadow: 0 0 0 3px rgba(34,139,224,.12); }
.auth-form small, .form-grid small { color: var(--muted); font-size: 10px; font-weight: 400; }
.auth-submit { width: 100%; min-height: 43px; margin-top: 5px; background: linear-gradient(105deg, #1769e8, #13a9c5); box-shadow: 0 7px 18px rgba(23,105,232,.2); }
.auth-submit:hover { background: linear-gradient(105deg, #1159ca, #078da9); }
.auth-submit:disabled { cursor: wait; opacity: .82; }
.auth-submit .fa-circle-notch { animation: auth-spin .8s linear infinite; }
.auth-progress { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 3px 10px; padding: 10px 12px; border: 1px solid rgba(48,137,218,.16); border-radius: 9px; background: linear-gradient(110deg, rgba(37,125,224,.06), rgba(25,184,194,.08)); color: #326889; font-size: 11px; font-weight: 700; animation: rise-in .2s ease both; }
.auth-progress-icon { position: relative; display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(38,132,239,.2); border-radius: 50%; background: rgba(255,255,255,.7); color: #168cce; }
.auth-progress-icon::after { position: absolute; inset: -4px; border: 2px solid transparent; border-top-color: #20aac5; border-right-color: rgba(32,170,197,.25); border-radius: 50%; animation: auth-spin .9s linear infinite; content: ''; }
.auth-progress-track { grid-column: 2; height: 3px; overflow: hidden; border-radius: 4px; background: rgba(49,137,205,.14); }
.auth-progress-track i { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #287ee8, #28c5c4); animation: auth-progress 1.2s ease-in-out infinite; }
.form-message { min-height: 18px; margin: 12px 0 0; color: #bd493e; font-size: 11px; }
.form-message.is-error { display: flex; align-items: flex-start; gap: 7px; padding: 10px 11px; border: 1px solid rgba(206,76,69,.2); border-radius: 8px; background: rgba(255,240,238,.88); color: #a93632; }
.form-message.is-error::before { flex: 0 0 auto; font-family: 'Font Awesome 6 Free'; font-weight: 900; content: '\f06a'; }

#modalRoot:empty { display: none; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; overflow: auto; padding: 22px; background: rgba(18,28,45,.48); backdrop-filter: blur(7px); animation: fade-in .18s ease; }
.form-modal, .detail-modal { position: relative; width: min(100%, 590px); max-height: min(92vh, 850px); overflow: auto; border: 1px solid rgba(255,255,255,.7); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 80px rgba(10,24,47,.22); animation: rise-in .2s ease; }
.form-modal { padding: 23px; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-heading h2, .detail-content h2 { margin: 4px 0 0; font-size: 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.project-links-field { display: grid; gap: 9px; }
.project-links-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-links-heading strong { color: var(--ink); font-size: 11px; }
.project-links-editor { display: grid; gap: 9px; }
.project-link-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr) 35px; align-items: end; gap: 8px; }
.project-link-row .icon-button { margin-bottom: 3px; }
.form-grid label:has(textarea), .form-grid .full-field { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; }
.form-grid select[multiple] { min-height: 92px; }
.form-grid input[type=color] { padding: 4px; }
.check-field { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 9px !important; }
.check-field input { width: 15px; min-height: 15px; accent-color: var(--blue); }
.check-field span { font-weight: 500; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }
.modal-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: rgba(255,255,255,.93); color: #31405a; cursor: pointer; }
.detail-modal { width: min(100%, 760px); }
.detail-cover { display: block; width: 100%; height: 260px; object-fit: cover; }
.detail-content { padding: 22px 25px 25px; }
.detail-content > p { margin: 12px 0 18px; color: #647186; font-size: 12px; line-height: 1.7; }
.detail-content h3 { margin: 18px 0 9px; font-size: 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 17px; color: #68758a; font-size: 11px; }
.detail-meta span { display: inline-flex; align-items: center; gap: 7px; }
.detail-gallery { display: flex; gap: 8px; overflow-x: auto; }
.detail-gallery img { width: 94px; height: 67px; border-radius: 6px; object-fit: cover; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.upload-note { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.upload-progress-backdrop { position: fixed; z-index: 70; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15,24,38,.62); backdrop-filter: blur(5px); animation: fade-in .18s ease; }
.upload-progress-modal { width: min(100%, 410px); padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 80px rgba(10,24,47,.28); color: var(--ink); text-align: center; animation: rise-in .2s ease; }
.upload-progress-icon { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 15px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 20px; }
.upload-progress-modal h2 { margin: 0; font-size: 19px; }
.upload-progress-name { overflow: hidden; margin: 7px 0 22px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-track { height: 8px; overflow: hidden; border-radius: 10px; background: var(--surface-muted); }
.upload-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .18s ease; }
.upload-progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 11px; }
.upload-progress-meta strong { color: var(--blue); }
.upload-progress-meta span, .upload-progress-status { color: var(--muted); }
.upload-progress-status { min-height: 18px; margin: 14px 0 0; font-size: 11px; }

.presentation-screen { position: fixed; z-index: 60; inset: 0; display: grid; grid-template-rows: 58px 1fr; overflow: auto; background: #0d121a; color: #eef2f8; animation: fade-in .22s ease; }
.presentation-bar { display: flex; align-items: center; gap: 13px; padding: 0 20px; border-bottom: 1px solid #263244; background: #121a26; }
.presentation-bar .brand { min-width: auto; margin-right: 10px; }
.presentation-bar .brand-copy strong { color: #f1f4f8; }
.presentation-bar .brand-copy small { color: #97a4b7; }
.presentation-bar .icon-button { color: #c6cfdb; }
.presentation-counter { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.presentation-position { color: #98a6b9; font-size: 10px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.presentation-nav:disabled { cursor: default; opacity: .35; }
.presentation-nav:disabled:hover { border-color: transparent; background: transparent; color: #c6cfdb; }
.presentation-content { display: grid; width: min(100%, 1500px); min-height: 0; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr); grid-template-rows: minmax(0, 1fr) 55px; gap: 0 20px; margin: 0 auto; padding: 20px 24px 12px; }
.presentation-main-image { position: relative; min-height: 280px; overflow: hidden; border-radius: 9px; background: #1d2735; }
.presentation-main-image img { width: 100%; height: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.presentation-image-label { position: absolute; right: 13px; bottom: 13px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.3); border-radius: 20px; background: rgba(18,28,45,.75); color: white; font-size: 10px; }
.presentation-details { align-self: center; max-height: calc(100vh - 115px); overflow: auto; padding: 8px 7px 8px 1px; }
.presentation-details .eyebrow { color: #83aef7; }
.presentation-details h1 { margin: 8px 0 3px; color: #f3f6fb; font-size: 30px; }
.presentation-details h2 { margin: 0 0 14px; color: #aab6c8; font-size: 15px; font-weight: 600; }
.presentation-details > p { margin: 0; color: #b2bdcb; font-size: 12px; line-height: 1.7; }
.presentation-details h3 { margin: 22px 0 10px; color: #e2e8f0; font-size: 12px; }
.presentation-facts { display: flex; gap: 18px; margin-top: 16px; color: #c0cad7; font-size: 11px; }
.presentation-facts span { display: flex; align-items: center; gap: 7px; }
.presentation-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
.presentation-gallery button { flex: 0 0 94px; height: 68px; overflow: hidden; padding: 0; border: 1px solid #303d50; border-radius: 6px; background: #1b2635; cursor: pointer; }
.presentation-gallery img { width: 100%; height: 100%; object-fit: cover; }
.presentation-caption { display: flex; grid-column: 1 / -1; align-items: center; gap: 9px; border-top: 1px solid #263244; color: #d0d8e3; font-size: 10px; }
.presentation-caption > span:first-child { font-weight: 700; }
.presentation-caption > span:nth-child(2) { color: #9ba9bc; }
.presentation-caption .button { min-height: 32px; margin-left: auto; font-size: 10px; }
.project-detail-screen { position: fixed; z-index: 60; inset: 0; overflow: auto; background: #f4f6fa; color: #172033; animation: fade-in .2s ease; }
.project-detail-bar { position: sticky; top: 0; z-index: 5; display: grid; min-height: 56px; grid-template-columns: 1fr minmax(100px, 1.4fr) 1fr; align-items: center; gap: 12px; padding: 0 20px; background: #111923; color: #f2f5fa; box-shadow: 0 3px 14px rgba(11,20,32,.18); }
.detail-back { display: inline-flex; align-items: center; gap: 10px; width: fit-content; padding: 8px 0; border: 0; background: transparent; color: #e1e7f0; cursor: pointer; font-size: 11px; }
.detail-back i { color: #aab7c8; }
.detail-bar-title { overflow: hidden; color: #aab7c8; font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.detail-bar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.detail-bar-actions .icon-button { color: #f2f5fa; }
.project-detail-body { width: min(1500px, 100%); margin: 0 auto; padding: 16px clamp(14px, 2.4vw, 28px) 24px; }
.project-detail-overview { display: grid; grid-template-columns: minmax(250px, .82fr) minmax(0, 1.55fr); grid-template-areas: "gallery gallery" "info identity" "info description" "info services"; align-items: start; gap: 10px clamp(16px, 2vw, 24px); }
.project-detail-gallery { display: grid; grid-area: gallery; grid-template-columns: minmax(0, 1.7fr) minmax(0, .92fr) minmax(70px, .42fr); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-template-areas: "main second third" "main . fourth"; height: clamp(190px, 25vw, 310px); gap: 8px; min-width: 0; }
.project-gallery-main { grid-area: main; width: 100%; height: 100%; aspect-ratio: auto; min-height: 0; }
.project-gallery-second { grid-area: second; }
.project-gallery-third { grid-area: third; }
.project-gallery-fourth { grid-area: fourth; }
.project-gallery-thumb { width: 100%; height: 100%; min-width: 0; aspect-ratio: auto; }
.project-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.project-detail-cover { position: relative; aspect-ratio: 1.65; min-height: 0; overflow: hidden; border-radius: 8px; background: #dfe5ed; }
.project-detail-cover img, .project-detail-cover video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.project-detail-cover iframe, .presentation-main-image iframe { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }
.project-detail-cover video { background: #080c12; }
.project-detail-copy { display: contents; }
.project-detail-identity { display: flex; grid-area: identity; align-items: center; gap: 10px; min-width: 0; }
.project-company-mark { display: grid; width: 58px; height: 58px; flex: 0 0 58px; place-items: center; overflow: hidden; border: 1px solid #e7ebf1; border-radius: 8px; background: #fff; color: #1769ff; font-size: 24px; font-weight: 800; object-fit: contain; }
.project-identity-copy { min-width: 0; }
.project-detail-identity .eyebrow { display: block; margin-bottom: 4px; color: #1769ff; }
.project-detail-identity h1 { margin: 0; font-size: 24px; }
.project-detail-identity h2 { margin: 2px 0 0; color: #617087; font-size: 13px; font-weight: 600; }
.project-detail-copy > p { grid-area: description; margin: 0; color: #66748a; font-size: 11px; line-height: 1.5; }
.project-facts { display: contents; }
.project-facts > section:first-child { grid-area: info; align-self: start; min-width: 0; padding: 16px; border: 1px solid #e2e8f1; border-radius: 9px; background: #edf1f7; }
.project-facts > section:last-child { grid-area: services; min-width: 0; }
.project-facts h3 { margin: 0 0 12px; color: #243149; font-size: 14px; }
.project-facts-list { display: grid; gap: 11px; }
.project-facts-list span { display: grid; grid-template-columns: 18px 72px minmax(0, 1fr); align-items: start; gap: 7px; color: #5d6a7e; font-size: 12px; line-height: 1.45; }
.project-links-fact { display: grid; grid-template-columns: 18px 72px minmax(0, 1fr); align-items: center; gap: 7px; color: #5d6a7e; font-size: 12px; }
.project-links-fact > i { width: 16px; color: #54729b; text-align: center; }
.project-links-fact > b { color: #33445e; }
.project-detail-links .project-link-icon { width: 28px; height: 28px; }
.project-facts-list b { color: #33445e; font-weight: 700; }
.project-facts-list i { width: 16px; margin-top: 2px; color: #54729b; text-align: center; }
.detail-service-list { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-service-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 7px 12px; border: 1px solid #e0eaff; border-radius: 18px; background: #edf3ff; color: #2058b7; font-size: 11px; font-weight: 700; }
.detail-service-chip i { font-size: 13px; }
.project-results { margin-top: 18px; overflow: hidden; border: 1px solid #e5eaf1; border-radius: 8px; background: #fff; }
.detail-tabs { display: flex; gap: 20px; overflow-x: auto; padding: 0 14px; border-bottom: 1px solid #e9edf3; scrollbar-width: none; }
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tab { position: relative; flex: 0 0 auto; min-height: 41px; padding: 0 2px; border: 0; background: transparent; color: #637087; cursor: pointer; font-size: 10px; font-weight: 600; }
.detail-tab.active { color: #1769ff; }
.detail-tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #1769ff; content: ''; }
.project-media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); min-height: 144px; gap: 12px; padding: 15px; }
.media-item { display: grid; align-content: start; gap: 7px; min-width: 0; color: #273449; font-size: 11px; text-align: center; }
.media-item[hidden] { display: none; }
.media-item > span { overflow: hidden; color: #34445b; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.media-thumb { position: relative; display: block; width: 100%; aspect-ratio: 1.45; overflow: hidden; padding: 0; border: 1px solid #e1e6ee; border-radius: 6px; background: #e9edf3; cursor: pointer; }
.media-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease; }
.media-thumb:hover img { transform: scale(1.04); }
.media-file-icon { display: grid; width: 100%; height: 100%; place-items: center; background: #fff; color: #64748b; font-size: 34px; }
.media-file-pdf { color: #c8323e; }
.media-thumb.active { border-color: #3780ff; box-shadow: 0 0 0 2px rgba(23,105,255,.16); }
.media-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,17,30,.2); color: white; font-size: 15px; }
.presentation-screen { grid-template-rows: 54px 1fr; overflow: hidden; }
.presentation-content { width: 100%; height: 100%; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); grid-template-rows: minmax(0, 1fr) 130px; gap: 12px 22px; padding: 17px 22px 13px; }
.presentation-main-image { min-height: 250px; align-self: stretch; }
.presentation-main-image img, .presentation-main-image video { display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; }
.presentation-main-image video { background: #05080d; }
.presentation-details { align-self: center; max-height: 100%; }
.presentation-service-type { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 6px 9px; border-radius: 16px; background: #493bd1; color: #fff; font-size: 9px; font-weight: 700; }
.presentation-details > p { margin-top: 0; }
.presentation-details h3 { margin-top: 16px; }
.presentation-project-links { margin: 12px 0 0; }
.presentation-project-links .project-link-icon { border-color: #354257; background: #1b2635; color: #8fc9ad; }
.presentation-project-links .project-link-icon:hover { border-color: #6e9f8b; background: #263b3a; color: #b2e1ca; }
.presentation-gallery { display: grid; min-width: 0; grid-column: 1 / -1; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 10px; border-top: 1px solid #263244; }
.filmstrip-arrow { display: grid; width: 30px; height: 34px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #aebacc; cursor: pointer; }
.filmstrip-arrow:hover { background: #1b2635; color: white; }
.presentation-filmstrip { display: flex; min-width: 0; gap: 11px; overflow-x: auto; padding: 8px 2px; scrollbar-width: thin; scrollbar-color: #38475c transparent; }
.presentation-filmstrip .media-item { flex-basis: 104px; gap: 5px; color: #d1d9e4; }
.presentation-filmstrip .media-thumb { aspect-ratio: 1.55; border-color: #303d50; background: #1b2635; }
.presentation-filmstrip .media-thumb.active { border-color: #8db6ff; box-shadow: 0 0 0 1px #8db6ff; }
.presentation-filmstrip .media-item > span { color: #d1d9e4; }
.presentation-filmstrip .media-play { font-size: 12px; }
.toast-region { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 230px; max-width: min(400px, calc(100vw - 40px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-size: 11px; animation: rise-in .2s ease; }
.toast i { color: var(--green); }
.toast-error i { color: #d45445; }
.innova-delete-alert { border-radius: 12px !important; font-family: 'DM Sans', sans-serif !important; }
.innova-delete-alert .swal2-title { color: var(--ink); font-family: 'Manrope', sans-serif; font-size: 20px; }
.innova-delete-alert .swal2-html-container { color: var(--muted); font-size: 12px; }
.innova-delete-alert .swal2-actions { gap: 8px; }
.innova-delete-enter { animation: delete-alert-in .24s ease-out both; }
.innova-delete-exit { animation: fade-in .12s ease-in reverse both; }

.dark-theme { color-scheme: dark; --page: #111722; --surface: #192230; --surface-muted: #202b3a; --ink: #e8edf5; --muted: #9ba8ba; --line: #2b3646; --blue-soft: #203657; --shadow: 0 12px 36px rgba(0,0,0,.24); background: radial-gradient(ellipse at 8% 0%, rgba(27,57,101,.3), transparent 30%), var(--page); }
.dark-theme .topbar { border-color: rgba(65,79,100,.7); background: rgba(25,34,48,.88); }
.dark-theme .nav-link { color: #bac4d1; }
.dark-theme .nav-link:hover, .dark-theme .nav-link.active { background: #223858; color: #91b8ff; }
.dark-theme .filter-toolbar { background: rgba(25,34,48,.88); }
.dark-theme .tag { background: color-mix(in srgb, var(--tag-color, var(--blue)) 22%, #1d2938); color: #dce7f9; }
.dark-theme .tag-soft, .dark-theme .round-link { background: var(--surface-muted); }
.dark-theme .project-card-foot, .dark-theme .presentation-caption, .dark-theme .site-footer { border-color: var(--line); }
.dark-theme .presentation-screen { background: #121a26; }
.dark-theme .presentation-bar { border-color: var(--line); background: rgba(25,34,48,.95); }
.dark-theme .presentation-main-image, .dark-theme .file-preview { background: #202b3a; }
.dark-theme .button-secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.dark-theme th { background: var(--surface-muted); }
.dark-theme td, .dark-theme th { border-color: var(--line); }
.dark-theme .bar-track { background: #2a3544; }

@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-progress { 0% { transform: translateX(-110%); } 55% { transform: translateX(95%); } 100% { transform: translateX(250%); } }
@keyframes delete-alert-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1120px) {
    .app-shell { padding-right: 20px; padding-left: 20px; }
    .topbar { gap: 11px; }
    .brand { min-width: 120px; }
    .nav-link { padding: 0 9px; }
    .nav-link span { font-size: 11px; }
    .filter-toolbar { flex-wrap: wrap; }
    .search-box { flex-basis: 100%; }
    .filter-field { flex: 1 1 145px; }
    .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) and (min-width: 761px) {
    .topbar { flex-wrap: wrap; }
    .main-nav { order: 3; flex-basis: 100%; margin: 0 -2px -3px; }
}
@media (max-width: 760px) {
    .app-shell { padding: 10px 13px 18px; }
    .topbar { top: 7px; gap: 10px; min-height: 58px; padding: 7px 9px; border-radius: 13px; }
    .brand { min-width: 105px; gap: 7px; }
    .brand-mark { width: 31px; height: 31px; font-size: 21px; }
    .brand-copy strong { font-size: 13px; }
    .brand-copy small { font-size: 7px; }
    .main-nav { order: 3; flex-basis: 100%; margin: 0 -2px -3px; }
    .topbar { flex-wrap: wrap; }
    .nav-link { min-height: 34px; padding: 0 10px; }
    .top-actions { margin-left: auto; }
    .workspace { padding-top: 24px; }
    .welcome-row { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
    .welcome-row h1 { font-size: 27px; }
    .welcome-actions { width: 100%; }
    .welcome-actions .button { flex: 1; }
    .toolbar { gap: 8px; }
    .filter-field { flex-basis: calc(50% - 5px); }
    .filter-toolbar > .text-button { margin-left: auto; }
    .section-heading { align-items: flex-start; flex-direction: column; margin-top: 22px; }
    .view-tools { width: 100%; }
    .view-tools .muted { margin-right: auto; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .project-card-body { padding: 10px; }
    .project-title { font-size: 13px; }
    .project-company { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tag { font-size: 9px; }
    .list-layout .project-card { grid-template-columns: 130px 1fr; }
    .list-layout .project-image { min-height: 125px; }
    .list-layout .favorite-button { left: 92px; }
    .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .entity-card { padding: 13px; }
    .entity-card-title { display: block; }
    .entity-card-title .muted { display: block; margin-top: 4px; }
    .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .file-preview { height: 115px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat-card { padding: 12px; }
    .report-columns, .settings-grid { grid-template-columns: 1fr; }
    .site-footer { gap: 12px; font-size: 9px; }
    .project-detail-bar { grid-template-columns: 1fr auto; min-height: 52px; padding: 0 12px; }
    .detail-bar-title { display: none; }
    .detail-bar-actions { gap: 4px; }
    .detail-bar-actions .button { min-height: 33px; padding: 0 9px; font-size: 10px; }
    .project-detail-body { padding: 12px; }
    .project-detail-overview { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "identity" "description" "info" "services"; gap: 12px; }
    .project-detail-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(150px, 1fr) 76px; grid-template-areas: "main main main" "second third fourth"; aspect-ratio: auto; gap: 7px; }
    .project-gallery-main { min-height: 0; }
    .project-detail-cover img, .project-detail-cover video { min-height: 0; }
    .project-detail-copy { padding: 2px; }
    .project-facts { margin-top: 12px; }
    .project-results { margin-top: 13px; }
    .project-media-grid { min-height: 124px; }
    .project-detail-overview { grid-template-columns: minmax(145px, .78fr) minmax(0, 1.22fr); grid-template-areas: "gallery gallery" "info identity" "info description" "info services"; gap: 9px 12px; }
    .project-detail-gallery { grid-template-columns: minmax(0, 1.7fr) minmax(0, .92fr) minmax(45px, .42fr); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-template-areas: "main second third" "main . fourth"; height: clamp(160px, 32vw, 230px); gap: 6px; }
    .project-detail-copy { display: contents; padding: 0; }
    .project-facts { display: contents; margin: 0; }
    .project-facts > section:first-child { padding: 12px; }
    .project-facts h3 { font-size: 13px; }
    .project-facts-list span { grid-template-columns: 16px 58px minmax(0, 1fr); gap: 5px; font-size: 11px; }
    .project-company-mark { width: 42px; height: 42px; flex-basis: 42px; font-size: 18px; }
    .project-detail-identity h1 { font-size: 21px; }
    .project-detail-identity h2 { font-size: 11px; }
    .project-results { margin-top: 12px; }
    .presentation-screen { grid-template-rows: 54px 1fr; }
    .presentation-bar { gap: 7px; padding: 0 10px; }
    .presentation-bar .brand { display: none; }
    .presentation-position { font-size: 9px; }
    .presentation-counter { gap: 0; }
    .presentation-counter .icon-button { width: 27px; }
    .presentation-position { font-size: 8px; }
    .presentation-bar .button { min-height: 33px; padding: 0 9px; font-size: 10px; }
    .presentation-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(190px, 38vh) minmax(170px, 1fr) 104px; gap: 10px; padding: 10px 12px; }
    .presentation-main-image { min-height: 0; }
    .presentation-main-image img, .presentation-main-image video { max-height: none; }
    .presentation-details { max-height: 100%; overflow: auto; padding: 1px 2px 6px; }
    .presentation-details h1 { font-size: 24px; }
    .presentation-details h2 { font-size: 13px; }
    .presentation-details h3 { margin: 15px 0 8px; }
    .presentation-gallery { grid-column: 1; grid-template-columns: 26px minmax(0, 1fr) 26px; gap: 4px; }
    .filmstrip-arrow { width: 26px; }
    .presentation-filmstrip { gap: 8px; }
    .presentation-filmstrip .media-item { flex-basis: 88px; }
}
@media (max-width: 430px) {
    .auth-panel { padding: 28px 22px; }
    .project-grid { grid-template-columns: 1fr; }
    .project-image { aspect-ratio: 1.9; }
    .entity-grid { grid-template-columns: 1fr; }
    .entity-card { min-height: 145px; }
    .file-grid { grid-template-columns: 1fr 1fr; }
    .form-modal { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid label:has(textarea), .form-grid .full-field, .check-field { grid-column: 1; }
    .modal-backdrop { padding: 10px; }
    .project-detail-identity h1 { font-size: 24px; }
    .project-detail-overview { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "identity" "description" "info" "services"; }
    .project-detail-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(150px, 1fr) 76px; grid-template-areas: "main main main" "second third fourth"; height: auto; }
    .project-facts { grid-template-columns: 1fr; }
    .detail-tabs { gap: 15px; padding: 0 10px; }
    .detail-tab { font-size: 9px; }
    .media-item { flex-basis: 98px; }
    .presentation-content { grid-template-rows: minmax(175px, 34vh) minmax(160px, 1fr) 100px; }
    .site-footer span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Project detail layout: hero on the left, gallery and copy on the right. */
.project-detail-overview { display: block; }
.project-detail-gallery { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); grid-template-rows: 1fr; height: clamp(260px, 28vw, 390px); gap: 12px; }
.project-detail-gallery .project-gallery-main { grid-area: auto; width: 100%; height: 100%; min-height: 0; }
.project-gallery-side { display: grid; grid-template-rows: 58% auto 1fr; gap: 9px; min-width: 0; min-height: 0; }
.project-gallery-side > .project-detail-identity, .project-gallery-side > p { grid-area: auto; }
.project-gallery-thumbs { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(70px, .8fr); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-template-areas: "second third" "second fourth"; gap: 8px; min-height: 0; }
.project-gallery-second { grid-area: second; }
.project-gallery-third { grid-area: third; }
.project-gallery-fourth { grid-area: fourth; }
.project-gallery-thumb { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.project-detail-copy { display: none; }
.project-detail-identity { display: block; min-width: 0; }
.project-detail-identity .eyebrow { margin-bottom: 3px; }
.project-detail-identity h1 { font-size: 23px; }
.project-detail-identity h2 { font-size: 12px; }
.project-gallery-side > p { margin: 0; color: #66748a; font-size: 11px; line-height: 1.45; }
.project-facts { display: grid; grid-template-columns: minmax(250px, .82fr) minmax(0, 1.55fr); gap: 12px 24px; margin-top: 12px; }
.project-facts > section:first-child, .project-facts > section:last-child { grid-area: auto; }
.project-media-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 900px; min-height: 0; gap: 9px; padding: 12px; }
.media-item { gap: 5px; font-size: 10px; }
.media-thumb { aspect-ratio: 1.45; }

@media (max-width: 760px) {
    .project-detail-gallery { grid-template-columns: minmax(0, 1.25fr) minmax(190px, 1fr); height: clamp(190px, 34vw, 300px); gap: 8px; }
    .project-gallery-side { grid-template-rows: 55% auto 1fr; gap: 6px; }
    .project-gallery-thumbs { gap: 5px; }
    .project-facts { grid-template-columns: minmax(145px, .78fr) minmax(0, 1.22fr); gap: 9px 12px; }
    .project-media-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 9px; }
    .media-item { font-size: 9px; }
}

@media (max-width: 430px) {
    .project-detail-gallery { grid-template-columns: minmax(0, 1.12fr) minmax(150px, .9fr); height: 225px; }
    .project-facts { grid-template-columns: minmax(0, 1fr); }
    .project-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
