:root { --bg:#101b2b; --navy:#16263b; --ink:#eef3fc; --muted:#a1afc2; --amber:#eeb86b; --line:rgba(255,255,255,.12); }
* { box-sizing:border-box; }
html,body { margin:0; min-height:100%; width:100%; }
body { font-family:Arial,Helvetica,sans-serif; color:var(--ink); background:var(--bg); }
button,a { -webkit-tap-highlight-color:transparent; }
button { font-family:inherit; cursor:pointer; }
button:focus-visible,a:focus-visible { outline:4px solid var(--amber); outline-offset:4px; }
[hidden] { display:none!important; }
.shell { max-width:1540px; margin:0 auto; padding-left:5.2vw; padding-right:5.2vw; }
.library-screen { min-height:100vh; background:radial-gradient(1000px 650px at 88% 5%,rgba(67,98,143,.19),transparent 65%),linear-gradient(155deg,#14243a,#101a29 70%); }
.header { min-height:112px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); gap:22px; }
.brand { display:flex; align-items:center; gap:18px; text-decoration:none; color:var(--ink); }
.brand-mark { background:#edb66d; width:50px; height:50px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:31px; font-weight:900; color:#152139; letter-spacing:-2px; }
.brand-mark-dot { color:white; }
.brand-copy { letter-spacing:2.4px; font-size:20px; line-height:1.25; font-weight:400; }
.brand-copy strong { font-weight:800; }
.brand-copy small { display:block; font-size:9px; color:#93a6be; letter-spacing:2.2px; padding-top:5px; }
.header-right { color:#bdc8d6; display:flex; align-items:center; gap:12px; font-size:12px; letter-spacing:1.3px; font-weight:700; white-space:nowrap; }
.live-dot { height:7px; width:7px; border-radius:50%; background:#90dcbb; box-shadow:0 0 0 4px rgba(144,220,187,.12); }
.count-badge { border:1px solid rgba(255,255,255,.16); border-radius:50px; padding:11px 17px; margin-left:8px; letter-spacing:0; font-size:13px; }
.main-library { padding-top:64px; padding-bottom:68px; }
.title-row { display:flex; justify-content:space-between; align-items:end; gap:25px; margin-bottom:36px; }
.overline { font-size:12px; letter-spacing:3px; font-weight:700; color:var(--amber); margin-bottom:19px; }
h1 { font-weight:800; letter-spacing:-1.4px; font-size:clamp(34px,3.75vw,62px); margin:0; line-height:1.1; }
h1 span { color:var(--amber); }
.subtitle { color:var(--muted); margin:18px 0 0; font-size:17px; line-height:1.5; }
.action-refresh { border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.055); color:#edf3ff; border-radius:12px; padding:15px 21px; font-size:17px; font-weight:700; white-space:nowrap; transition:background .18s,transform .18s; }
.action-refresh:hover { background:rgba(255,255,255,.13); }
.file-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(310px,1fr)); gap:19px; }
.file-card { position:relative; text-align:left; min-height:215px; border:1px solid rgba(255,255,255,.13); background:linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,.025)); border-radius:18px; color:var(--ink); padding:29px 27px 25px; display:flex; flex-direction:column; align-items:flex-start; transition:border-color .18s,transform .18s,background .18s; overflow:hidden; }
.file-card:before { content:""; position:absolute; top:0; left:0; width:5px; height:100%; background:var(--amber); opacity:.85; }
.file-card:hover,.file-card:focus { border-color:var(--amber); background:rgba(238,184,107,.105); transform:translateY(-2px); }
.file-card:focus { outline:3px solid var(--amber); outline-offset:3px; }
.card-top { display:flex; align-items:center; width:100%; justify-content:space-between; margin-bottom:26px; }
.file-icon { width:47px; height:51px; border:2px solid #dca25a; border-radius:5px; position:relative; display:flex; align-items:end; padding:0 4px 5px; color:var(--amber); font-size:13px; font-weight:900; letter-spacing:1px; }
.file-icon:after { content:""; position:absolute; width:15px; height:15px; right:-2px; top:-2px; border-left:2px solid #dca25a; border-bottom:2px solid #dca25a; background:#2b3644; transform:rotate(0deg); }
.card-tag { font-size:11px; letter-spacing:1.5px; color:#aab8ca; font-weight:bold; }
.file-name { font-size:21px; line-height:1.35; overflow-wrap:anywhere; font-weight:700; margin:0 0 21px; min-height:57px; }
.card-bottom { width:100%; margin-top:auto; border-top:1px solid var(--line); padding-top:19px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.card-meta { color:#a9b6c9; font-size:13px; }
.card-open { color:var(--amber); font-size:12px; letter-spacing:1.1px; font-weight:800; white-space:nowrap; }
.status-message { color:#bcc9d8; border:1px dashed rgba(255,255,255,.2); padding:28px 24px; border-radius:13px; font-size:17px; line-height:1.6; margin:0 0 22px; }
.status-message:empty { display:none; }
.footer { display:flex; justify-content:space-between; border-top:1px solid var(--line); padding-top:25px; padding-bottom:28px; color:#8495ab; font-size:11px; letter-spacing:1.7px; }
.viewer-screen { display:flex; flex-direction:column; width:100%; height:100vh; height:100dvh; overflow:hidden; background:#0a1019; }
.viewer-top { height:71px; flex-shrink:0; display:flex; align-items:center; gap:18px; padding:10px 2.3vw; background:#162337; border-bottom:1px solid #304156; }
.control { border:1px solid rgba(255,255,255,.18); border-radius:9px; background:#26364e; color:#f5f8ff; font-size:16px; font-weight:700; padding:13px 17px; white-space:nowrap; }
.control:hover { border-color:#eeb86b; background:#32465f; }
.control:disabled { opacity:.36; cursor:default; }
.back-control { color:#ffcf88; }
.viewer-heading { min-width:0; flex:1; display:flex; flex-direction:column; gap:4px; }
.viewer-title { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:18px; font-weight:700; }
.viewer-small { font-size:11px; color:#acbfd2; letter-spacing:1px; }
.pdf-stage { flex:1; min-height:0; min-width:0; position:relative; display:flex; justify-content:center; align-items:center; overflow:auto; padding:14px 12px; background:radial-gradient(ellipse at center,#2e3641 0%,#161c26 70%); }
#pdfCanvas { display:block; background:white; box-shadow:0 11px 40px rgba(0,0,0,.48); max-width:none; flex-shrink:0; }
.loading-box { position:absolute; z-index:3; top:50%; left:50%; transform:translate(-50%,-50%); max-width:90%; text-align:center; background:#1a293d; color:#eef3ff; border:1px solid #536476; border-radius:12px; padding:22px 30px; font-size:18px; box-shadow:0 8px 30px rgba(0,0,0,.3); }
.loading-box[hidden] { display:none!important; }
.viewer-bottom { flex-shrink:0; min-height:78px; padding:9px 2.3vw; display:flex; gap:15px; justify-content:space-between; align-items:center; border-top:1px solid #304156; background:#162337; }
.page-controls,.zoom-controls { display:flex; gap:9px; align-items:center; }
.page-counter { min-width:102px; text-align:center; padding:10px 13px; font-size:20px; color:#f6c47c; font-weight:800; white-space:nowrap; }
.page-control { min-width:130px; }
.small-control { font-size:23px; padding:7px 17px; }
.fit-control { font-size:13px; padding:14px 17px; }
.viewer-hint { flex-shrink:0; height:24px; text-align:center; color:#a7b4c7; font-size:10px; letter-spacing:1.25px; background:#101a2a; display:flex; align-items:center; justify-content:center; }
@media (max-width:820px) { .header { min-height:88px; } .brand-copy { font-size:17px; } .header-right { display:none; } .main-library { padding-top:40px; } .title-row { align-items:start; } .subtitle { font-size:15px; } .file-grid { grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); } .viewer-hint { display:none; } .viewer-bottom { flex-wrap:wrap; justify-content:center; } .viewer-top { height:62px; } .control { padding:11px 12px; } }
@media (max-width:540px) { .shell { padding-left:18px; padding-right:18px; } .main-library { padding-top:28px; } h1 { font-size:38px; } .title-row { flex-direction:column; align-items:start; } .action-refresh { padding:12px 14px; } .file-grid { grid-template-columns:1fr; } .footer span:last-child { display:none; } .viewer-title { font-size:13px; } .viewer-top { padding:7px; gap:7px; } .back-control span,.fullscreen-control span { display:none; } .viewer-bottom { min-height:65px; gap:4px; padding:5px; } .page-control { min-width:80px; } .page-control span { display:none; } .page-counter { min-width:76px; font-size:16px; } .zoom-controls { gap:5px; } .small-control,.fit-control { padding:9px 11px; } }
@media (prefers-reduced-motion:reduce) { * { transition:none!important; } }
/* Keep enlarged pages scrollable from their true top-left corner. */
.pdf-stage { justify-content:flex-start; align-items:flex-start; }
#pdfCanvas { margin:auto; }

/* v2.0: apartment photograph archive and true full-viewport photo viewer. */
.photo-library { margin-top:80px; padding-top:56px; border-top:1px solid var(--line); }
.photo-library-heading { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:28px; }
.photo-library h2 { margin:0; font-size:clamp(30px,3vw,48px); letter-spacing:-.9px; line-height:1.12; }
.photo-library h2 span { color:var(--amber); }
.photo-library .subtitle { max-width:750px; font-size:16px; }
.gallery-total { background:rgba(238,184,107,.1); color:#f1c58d; border:1px solid rgba(238,184,107,.26); padding:14px 20px; font-size:14px; border-radius:100px; white-space:nowrap; font-weight:700; }
.gallery-message { color:#aab9cd; margin:0 0 18px; font-size:15px; }
.gallery-message:empty { display:none; }
.gallery-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; }
.gallery-card { position:relative; background:#263349; color:white; overflow:hidden; text-align:left; min-height:315px; width:100%; border-radius:19px; border:1px solid rgba(255,255,255,.12); padding:0; transition:transform .2s,border-color .2s,box-shadow .2s; }
.gallery-card:hover,.gallery-card:focus { transform:translateY(-3px); border-color:#f1bf79; box-shadow:0 12px 35px rgba(0,0,0,.25); }
.gallery-card:focus { outline:4px solid var(--amber); outline-offset:3px; }
.gallery-card-photo { display:block; position:absolute; inset:0; height:100%; width:100%; object-fit:cover; }
.gallery-card-shade { position:absolute; inset:0; background:linear-gradient(0deg,rgba(6,13,25,.98) 0%,rgba(7,15,28,.8) 24%,rgba(7,15,28,.08) 70%); }
.gallery-card-tag,.gallery-card-count { position:absolute; top:18px; font-size:11px; font-weight:800; letter-spacing:1px; border-radius:7px; padding:9px 12px; }
.gallery-card-tag { left:18px; background:#f0bd77; color:#16243a; }
.gallery-card-count { right:18px; background:rgba(7,13,24,.76); color:#f4f6fa; }
.gallery-card-body { display:flex; flex-direction:column; position:absolute; bottom:0; left:0; right:0; padding:20px 22px 22px; }
.gallery-card-title { font-size:21px; font-weight:800; line-height:1.25; margin-bottom:7px; }
.gallery-card-details { color:#cbd1de; font-size:14px; margin-bottom:18px; }
.gallery-card-open { color:#f2c083; border-top:1px solid rgba(255,255,255,.2); padding-top:15px; font-size:12px; letter-spacing:1px; font-weight:800; }
.gallery-is-open { overflow:hidden!important; }
.gallery-viewer { position:fixed; inset:0; width:100vw; height:100vh; height:100dvh; display:flex; flex-direction:column; background:#05080e; z-index:5000; overflow:hidden; }
.gallery-viewer[hidden],.gallery-thumb-overlay[hidden] { display:none!important; }
.gallery-viewer-top { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:82px; padding:12px clamp(15px,2.5vw,42px); background:linear-gradient(180deg,#172235,#0b121d); border-bottom:1px solid rgba(255,255,255,.12); }
.gallery-ui-btn { display:inline-flex; align-items:center; justify-content:center; min-height:50px; padding:12px 16px; border:1px solid rgba(255,255,255,.24); border-radius:11px; background:rgba(255,255,255,.08); color:#f3f6fc; font-weight:750; font-size:15px; white-space:nowrap; }
.gallery-ui-btn:hover,.gallery-ui-btn:focus { border-color:var(--amber); background:rgba(238,184,107,.17); }
.gallery-ui-btn:focus { outline:3px solid var(--amber); outline-offset:3px; }
.gallery-title { text-align:center; display:flex; flex-direction:column; gap:6px; min-width:0; }
.gallery-title strong { font-size:clamp(16px,1.5vw,25px); line-height:1.15; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.gallery-title span { color:#abb7cb; font-size:12px; }
.gallery-top-actions { display:flex; align-items:center; gap:10px; }
.gallery-viewer-stage { position:relative; flex:1 1 auto; display:flex; justify-content:center; align-items:center; min-height:0; background:#05070c; overflow:hidden; outline:none; padding:12px 78px; }
.gallery-viewer-stage:focus { outline:none; }
.gallery-photo { display:block; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; transition:opacity .1s; box-shadow:0 0 45px rgba(0,0,0,.1); }
.gallery-loading { position:absolute; z-index:1; left:50%; top:50%; transform:translate(-50%,-50%); max-width:80vw; text-align:center; padding:22px 28px; color:#fff; background:rgba(14,25,41,.85); font-size:17px; border-radius:12px; }
.gallery-side-arrow { position:absolute; z-index:2; top:50%; transform:translateY(-50%); width:60px; height:86px; border:1px solid rgba(255,255,255,.22); background:rgba(28,42,62,.58); color:white; border-radius:14px; font-size:31px; line-height:1; }
.gallery-side-arrow:hover,.gallery-side-arrow:focus { background:rgba(238,184,107,.28); border-color:var(--amber); }
.gallery-side-arrow:disabled { opacity:.2; cursor:default; }
.gallery-side-prev { left:16px; }
.gallery-side-next { right:16px; }
.gallery-viewer-bottom { display:flex; flex-direction:column; gap:11px; flex:0 0 auto; background:linear-gradient(180deg,#111b2b,#111b29); border-top:1px solid rgba(255,255,255,.12); padding:14px clamp(16px,2.5vw,42px) 16px; }
.gallery-info { display:flex; align-items:center; justify-content:center; gap:12px; min-width:0; }
.gallery-photo-label { font-size:15px; color:#f1c28b; font-weight:750; white-space:nowrap; }
.gallery-photo-name { font-size:12px; color:#96a4b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:45vw; }
.gallery-page-counter { font-weight:800; font-size:17px; color:#eef2fb; text-align:center; }
.gallery-filmstrip { display:flex; gap:9px; justify-content:safe center; max-width:100%; overflow-x:auto; padding:3px 2px 8px; scroll-behavior:smooth; }
.gallery-film-item { width:86px; height:56px; border:2px solid transparent; border-radius:8px; overflow:hidden; flex:0 0 86px; padding:0; background:#243247; opacity:.52; }
.gallery-film-item img { width:100%; height:100%; object-fit:cover; display:block; }
.gallery-film-item:hover,.gallery-film-item.is-active { opacity:1; border-color:#edb66d; }
.gallery-thumb-overlay { position:absolute; inset:0; z-index:10; overflow-y:auto; background:linear-gradient(160deg,#152238,#0a111e); padding:30px clamp(18px,5vw,76px) 50px; }
.gallery-thumbs-head { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:28px; }
.gallery-thumbs-head h2 { font-size:clamp(25px,2.6vw,39px); margin:8px 0 0; }
.gallery-thumb-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(165px,1fr)); gap:16px; }
.gallery-thumb-item { background:rgba(255,255,255,.07); border:2px solid rgba(255,255,255,.12); border-radius:13px; color:#fff; padding:0; overflow:hidden; text-align:left; min-height:164px; }
.gallery-thumb-item img { display:block; width:100%; height:142px; object-fit:cover; background:#1c2a3c; }
.gallery-thumb-caption { display:block; font-size:13px; line-height:1.3; padding:12px 12px 14px; color:#e9effb; }
.gallery-thumb-item:hover,.gallery-thumb-item:focus { border-color:#edb66d; background:rgba(238,184,107,.15); }
.gallery-thumb-item:focus { outline:3px solid var(--amber); outline-offset:3px; }
@media(max-width:950px) {
  .photo-library-heading { align-items:start; flex-direction:column; }
  .gallery-viewer-top { min-height:70px; }
  .gallery-title { flex:1 1 auto; }
  .gallery-ui-btn { min-height:46px; }
  .gallery-viewer-stage { padding:8px 52px; }
  .gallery-side-arrow { width:44px; height:66px; font-size:24px; }
  .gallery-side-prev { left:5px; }
  .gallery-side-next { right:5px; }
}
@media(max-width:560px) {
  .photo-library { margin-top:52px; padding-top:40px; }
  .gallery-card { min-height:285px; }
  .gallery-viewer-top { padding:9px 8px; gap:6px; }
  .gallery-ui-btn { padding:8px 11px; font-size:12px; min-height:43px; }
  .gallery-ui-btn span { display:none; }
  .gallery-title strong { font-size:14px; }
  .gallery-title span { font-size:10px; }
  .gallery-top-actions { gap:5px; }
  .gallery-viewer-stage { padding:4px 38px; }
  .gallery-side-arrow { width:32px; height:55px; border-radius:8px; font-size:20px; }
  .gallery-info { flex-wrap:wrap; gap:4px; }
  .gallery-photo-label { font-size:12px; }
  .gallery-photo-name { display:none; }
  .gallery-page-counter { font-size:14px; }
  .gallery-viewer-bottom { padding:9px 8px 10px; gap:7px; }
  .gallery-film-item { flex-basis:61px; width:61px; height:43px; }
  .gallery-thumb-grid { grid-template-columns:repeat(auto-fill,minmax(125px,1fr)); gap:10px; }
  .gallery-thumb-item img { height:110px; }
  .gallery-thumbs-head { flex-wrap:wrap; }
}
@media(max-height:620px) and (min-width:600px) {
  .gallery-viewer-top { min-height:60px; padding-top:6px; padding-bottom:6px; }
  .gallery-viewer-bottom { gap:5px; padding-top:7px; padding-bottom:7px; }
  .gallery-film-item { width:58px; flex-basis:58px; height:39px; }
  .gallery-info { display:none; }
}
