
        :root {
            --black: #050505;
            --black-soft: #0a0a09;
            --panel: #0f0f0e;
            --panel-light: #151513;
            --text: #f4f1eb;
            --muted: #b9b6b0;
            --muted-dark: #77746e;
            --gold: #b98449;
            --gold-bright: #c8995e;
            --gold-pale: #d7b27c;
            --line: rgba(213,184,137,.22);
            --line-soft: rgba(255,255,255,.08);
            --danger: #d67b72;
            --max: 1180px;
            --ease: cubic-bezier(.22,.61,.36,1);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        html { min-width: 320px; background: var(--black); }
        body {
            min-width: 320px;
            min-height: 100vh;
            overflow-x: hidden;
            background: var(--black);
            color: var(--text);
            font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
            -webkit-font-smoothing: antialiased;
            user-select: none;
            -webkit-user-select: none;
        }
        a { color: inherit; text-decoration: none; }
        button, input { font: inherit; }
        button { color: inherit; }

        .site-header {
            height: 122px;
            position: relative;
            z-index: 20;
            border-bottom: 1px solid #1e1d1a;
            background: rgba(5,5,5,.96);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
        }
        .header-inner {
            width: min(100%, var(--max));
            height: 100%;
            margin: 0 auto;
            padding: 0 36px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 30px;
        }
        .brand {
            display: inline-flex;
            align-items: center;
            width: fit-content;
            min-width: 350px;
        }
        .brand-mark {
            width: 77px;
            height: 78px;
            position: relative;
            display: inline-block;
            color: var(--gold-pale);
            font-family: Georgia, "Times New Roman", serif;
            flex: 0 0 auto;
        }
        .brand-mark i, .brand-mark b {
            position: absolute;
            font-style: normal;
            font-weight: 400;
            line-height: 1;
        }
        .brand-mark i { left: 0; top: 2px; font-size: 62px; }
        .brand-mark b { left: 34px; top: 30px; font-size: 53px; }
        .brand-copy { display: flex; flex-direction: column; padding-left: 9px; transform: translateY(1px); }
        .brand-copy strong { font-size: 15px; line-height: 1.2; letter-spacing: .18em; font-weight: 400; white-space: nowrap; }
        .brand-copy small { margin-top: 10px; color: var(--gold-pale); font-size: 10px; letter-spacing: .34em; white-space: nowrap; }
        .brand-copy::after {
            content: "";
            width: 250px;
            height: 1px;
            margin-top: -25px;
            margin-bottom: 23px;
            opacity: .65;
            background: linear-gradient(90deg, var(--gold), transparent);
        }
        .header-right { display: flex; align-items: center; gap: 14px; }
        .home-link, .logout-link {
            min-height: 42px;
            padding: 0 19px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            border: 1px solid rgba(185,132,73,.48);
            background: rgba(185,132,73,.055);
            color: var(--gold-pale);
            font-size: 10px;
            letter-spacing: .10em;
            transition: transform .25s var(--ease), color .25s ease, border-color .25s ease, background .25s ease;
        }
        .home-link:hover, .logout-link:hover { color: #fff; border-color: var(--gold); background: rgba(185,132,73,.14); transform: translateY(-2px); }
        .home-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
        .navbar-user { display: flex; gap: 14px; align-items: center; }
        .navbar-user > span { color: #dedbd5; font-size: 12px; letter-spacing: .04em; }

        .page {
            min-height: calc(100vh - 122px);
            position: relative;
            overflow: hidden;
            isolation: isolate;
        }
        .page::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -4;
            background:
                linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 115px 115px,
                linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px) 0 0 / 115px 115px,
                radial-gradient(circle at 50% 10%, rgba(185,132,73,.055), transparent 38%),
                #050505;
        }
        .planet {
            position: absolute;
            z-index: -3;
            border-radius: 50%;
            pointer-events: none;
            background: radial-gradient(circle at 48% 47%, #090807 0%, #090807 56%, #17100b 74%, #5f371d 92%, #b97838 99%, #12100f 100%);
            box-shadow: inset -25px -18px 80px rgba(0,0,0,.96), inset 16px 8px 55px rgba(132,72,31,.06), 0 0 42px rgba(183,109,48,.08);
            opacity: .72;
        }
        .planet-one { width: 500px; height: 500px; top: -330px; right: 4vw; }
        .planet-two { width: 470px; height: 470px; bottom: -320px; left: -90px; opacity: .48; }
        .planet::after {
            content: "";
            position: absolute;
            inset: -1px;
            border-radius: 50%;
            background: radial-gradient(circle at 50% 50%, transparent 73%, rgba(220,137,64,.22) 91%, rgba(255,177,93,.62) 99%, transparent 100%);
        }

        .container { width: min(100%, var(--max)); margin: 0 auto; padding: 58px 36px 80px; }

        /* Экран входа */
        #loginScreen { min-height: calc(100vh - 260px); display: grid; place-items: center; }
        .login-shell { width: min(100%, 1000px); display: grid; grid-template-columns: 1fr 460px; align-items: stretch; border: 1px solid var(--line-soft); background: rgba(8,8,7,.78); box-shadow: 0 32px 90px rgba(0,0,0,.42); }
        .login-intro { position: relative; overflow: hidden; padding: 66px 54px; border-right: 1px solid var(--line-soft); background: linear-gradient(145deg, rgba(185,132,73,.08), transparent 48%), #080807; }
        .login-intro::before { content: ""; position: absolute; width: 390px; height: 390px; border: 1px solid rgba(215,178,124,.16); border-radius: 50%; right: -210px; bottom: -205px; }
        .login-intro::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(215,178,124,.09); border-radius: 50%; right: -80px; bottom: -180px; }
        .eyebrow { display: inline-flex; align-items: center; gap: 14px; color: var(--gold-pale); font-size: 10px; letter-spacing: .25em; }
        .eyebrow::before { content: ""; width: 55px; height: 1px; background: var(--gold); }
        .login-intro h1 { margin: 35px 0 23px; max-width: 480px; font-size: clamp(40px, 4.4vw, 62px); line-height: 1.08; font-weight: 300; letter-spacing: -.04em; }
        .login-intro h1 span { display: block; color: var(--gold); }
        .login-intro p { max-width: 430px; color: var(--muted); font-size: 15px; line-height: 1.8; }
        .intro-note { position: absolute; left: 54px; bottom: 47px; color: #68655f; font-size: 9px; letter-spacing: .18em; }

        .login-box { padding: 64px 46px 52px; background: rgba(15,15,14,.94); display: flex; flex-direction: column; }
        .login-box h2 { font-size: 31px; line-height: 1.2; font-weight: 300; margin-bottom: 12px; }
        .login-box > p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 34px; }
        .field { display: block; margin-bottom: 23px; }
        .field > span { display: block; margin-bottom: 9px; color: #817e78; font-size: 9px; letter-spacing: .17em; }
        input {
            width: 100%;
            height: 49px;
            padding: 0 0 11px;
            border: 0;
            border-bottom: 1px solid #3d3b37;
            border-radius: 0;
            outline: none;
            background: transparent;
            color: #fff;
            font-size: 15px;
            transition: border-color .25s ease, transform .25s var(--ease);
        }
        input::placeholder { color: #605d58; }
        input:focus { border-color: var(--gold); transform: translateY(-1px); }
        .login-button {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 49px;
            margin-top: 7px;
            border: 0;
            background: linear-gradient(90deg, #b88749 0%, #c69757 100%);
            color: #fff;
            font-size: 11px;
            letter-spacing: .09em;
            text-align: center;
            text-decoration: none;
            cursor: pointer;
            transition: transform .25s var(--ease), filter .25s ease, box-shadow .25s ease;
        }
        .login-button:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 14px 34px rgba(185,132,73,.16); }
        a.login-button:link, a.login-button:visited, a.login-button:hover, a.login-button:active {
            color: #fff;
            text-decoration: none;
        }
        .error { min-height: 19px; color: var(--danger); font-size: 12px; line-height: 1.5; margin: -12px 0 14px; display: none; }
        .error.show { display: block; }
        .back-link { display: block; width: fit-content; margin: auto auto 0; padding-top: 32px; color: var(--gold-pale); font-size: 10px; letter-spacing: .09em; transition: color .25s ease, transform .25s var(--ease); }
        .back-link:hover { color: #fff; transform: translateX(-3px); }
        .reset-mfa-choice-actions { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 16px; min-height: 0; }
        .reset-mfa-choice-actions .login-button { margin-top: 0; }
        .reset-mfa-choice-actions .otp-recovery-toggle { margin-top: 0; align-self: center; }

        /* Кабинет */
        #cabinetScreen { padding-top: 18px; }
        .cabinet-head { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; padding-bottom: 38px; border-bottom: 1px solid var(--line-soft); }
        .cabinet-head h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1.05; font-weight: 300; letter-spacing: -.045em; }
        .subtitle { color: var(--gold-pale); margin-top: 13px; font-size: 12px; letter-spacing: .08em; }
        .cabinet-status { width: 300px; padding: 17px 20px; border: 1px solid var(--line); background: rgba(185,132,73,.045); }
        .cabinet-status span { display: block; color: #77736d; font-size: 9px; letter-spacing: .18em; }
        .cabinet-status strong { display: block; margin-top: 8px; color: var(--gold-pale); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
        .cabinet-personal-meta { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
        .cabinet-personal-meta > span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .02em; }
        .tabs { display: flex; gap: 10px; margin: 36px 0 32px; }
        .tab {
            width: auto;
            min-height: 43px;
            padding: 0 24px;
            border: 1px solid rgba(255,255,255,.1);
            border-radius: 0;
            background: transparent;
            color: var(--muted);
            font-size: 10px;
            letter-spacing: .12em;
            cursor: pointer;
            transition: .28s var(--ease);
        }
        .tab:hover { color: #fff; border-color: rgba(185,132,73,.55); transform: translateY(-2px); }
        .tab.active { background: var(--gold); color: #080706; border-color: var(--gold); font-weight: 600; }
        .tab-content { display: none; }
        .tab-content.active { display: block; animation: contentIn .45s var(--ease); }
        @keyframes contentIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
        #materialsList { display: grid; gap: 14px; }
        .material-card {
            min-height: 100px;
            padding: 25px 27px;
            border: 1px solid var(--line-soft);
            background: linear-gradient(105deg, rgba(185,132,73,.045), transparent 34%), var(--panel);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 24px;
            position: relative;
            overflow: hidden;
            transition: transform .32s var(--ease), border-color .32s ease, background .32s ease, box-shadow .32s ease;
        }
        .material-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gold); opacity: .55; }
        .material-card:hover { transform: translateY(-4px); border-color: rgba(185,132,73,.42); background: linear-gradient(105deg, rgba(185,132,73,.08), transparent 42%), var(--panel-light); box-shadow: 0 17px 45px rgba(0,0,0,.22); }
        .material-card h3 { color: #fff; font-size: 17px; line-height: 1.4; font-weight: 400; margin-bottom: 7px; }
        .material-card .date { color: var(--muted-dark); font-size: 10px; letter-spacing: .06em; }
        .btn-view {
            flex: 0 0 auto;
            min-width: 126px;
            min-height: 43px;
            padding: 0 18px;
            border: 1px solid var(--gold);
            border-radius: 0;
            background: transparent;
            color: var(--gold-pale);
            font-size: 10px;
            letter-spacing: .11em;
            font-weight: 500;
            cursor: pointer;
            transition: transform .25s var(--ease), background .25s ease, color .25s ease;
        }
        .btn-view:hover { transform: translateY(-2px); background: var(--gold); color: #080706; }
        .empty { min-height: 250px; display: grid; place-items: center; text-align: center; color: var(--muted-dark); padding: 55px 20px; border: 1px dashed rgba(185,132,73,.22); background: rgba(15,15,14,.58); font-size: 14px; }
        .empty.empty-with-action { align-content: center; gap: 20px; }
        .buy-materials-link { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-width: 190px; }
        .materials-toolbar { display:flex; justify-content:flex-end; margin:0 0 14px; }
        .buy-materials-button {
            min-height: 43px;
            padding: 0 18px;
            border: 1px solid var(--gold);
            background: transparent;
            color: var(--gold-pale);
            font-size: 10px;
            letter-spacing: .11em;
            font-weight: 500;
            cursor: pointer;
            text-transform: uppercase;
        }
        .buy-drawer {
            position: fixed;
            inset: 0;
            z-index: 80;
            display: grid;
            place-items: end center;
            background: rgba(5,5,5,.72);
        }
        .buy-drawer[hidden] { display: none; }
        .buy-drawer-panel {
            width: min(560px, 100%);
            max-height: 92vh;
            overflow: auto;
            background: var(--panel);
            border: 1px solid var(--line);
            padding: 28px 24px 32px;
        }
        .buy-drawer-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 16px;
        }
        .buy-drawer-head h2 {
            font-size: 22px;
            font-weight: 300;
            letter-spacing: .04em;
        }
        .buy-drawer-close {
            min-width: 40px;
            min-height: 40px;
            border: 1px solid var(--line);
            background: transparent;
            color: var(--gold-pale);
            font-size: 22px;
            cursor: pointer;
        }
        .buy-drawer-status {
            min-height: 1.4em;
            margin-bottom: 14px;
            color: var(--muted);
            font-size: 13px;
        }
        .buy-drawer-status.error { color: var(--danger); }
        .buy-drawer-kassa { margin: 0 0 14px; color: var(--gold-pale); font-size: 12px; line-height: 1.5; }
        .buy-drawer-kassa[hidden] { display: none; }
        .buy-drawer-list { display: grid; gap: 10px; margin-bottom: 18px; }
        .buy-item {
            display: flex;
            gap: 12px;
            align-items: flex-start;
            padding: 14px 16px;
            border: 1px solid var(--line-soft);
            background: rgba(15,15,14,.58);
            cursor: pointer;
        }
        .buy-item .price { margin-top: 4px; color: var(--gold-pale); font-size: 13px; }
        .buy-item-check {
            -webkit-appearance: none;
            appearance: none;
            flex: 0 0 18px;
            width: 18px;
            height: 18px;
            margin: 3px 0 0;
            padding: 0;
            border: 1px solid var(--gold);
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            transform: none;
            cursor: pointer;
        }
        .buy-item-check:checked {
            background: var(--gold);
            box-shadow: inset 0 0 0 3px var(--panel);
        }
        .buy-item-check:focus { outline: 1px solid var(--gold-pale); outline-offset: 2px; border-color: var(--gold); transform: none; }
        .buy-item:has(.buy-item-check:checked) { border-color: var(--gold); }
        .buy-consent {
            display: none;
        }
        .buy-materials-pay {
            min-width: 160px;
            min-height: 43px;
            margin-top: 8px;
            padding: 0 18px;
            border: 1px solid var(--gold);
            background: var(--gold);
            color: #1a140c;
            font-size: 10px;
            letter-spacing: .11em;
            font-weight: 600;
            text-transform: uppercase;
            cursor: pointer;
        }
        .buy-materials-pay:disabled { opacity: .45; cursor: not-allowed; }
        #buyMaterialsPayStatus { margin-top: 12px; }
        .buy-contacts { display: grid; gap: 12px; margin: 0 0 16px; }
        .buy-contacts[hidden] { display: none; }
        .buy-contacts-lead { color: var(--muted); font-size: 13px; line-height: 1.45; text-transform: none; letter-spacing: 0; }
        .buy-current-contacts { color: var(--text); font-size: 14px; line-height: 1.55; text-transform: none; letter-spacing: 0; margin: 0; white-space: pre-line; }
        .buy-change-check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; line-height: 1.4; text-transform: none; letter-spacing: 0; cursor: pointer; }
        .buy-toggle-check {
            -webkit-appearance: none;
            appearance: none;
            flex: 0 0 18px;
            width: 18px;
            height: 18px;
            margin: 3px 0 0;
            padding: 0;
            border: 1px solid var(--gold);
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            transform: none;
            cursor: pointer;
        }
        .buy-toggle-check:checked {
            background: var(--gold);
            box-shadow: inset 0 0 0 3px var(--panel);
        }
        .buy-toggle-check:focus { outline: 1px solid var(--gold-pale); outline-offset: 2px; border-color: var(--gold); transform: none; }
        .buy-email-verify { display: grid; gap: 10px; }
        .buy-email-verify[hidden] { display: none; }
        .buy-verify-btn {
            min-width: 160px;
            min-height: 40px;
            padding: 0 16px;
            border: 1px solid var(--gold);
            background: transparent;
            color: var(--gold-pale);
            font-size: 10px;
            letter-spacing: .11em;
            font-weight: 600;
            text-transform: uppercase;
            cursor: pointer;
        }
        .buy-verify-btn:disabled { opacity: .45; cursor: not-allowed; }
        .buy-contact { display: grid; gap: 6px; color: var(--gold-pale); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
        .buy-contact input {
            width: 100%;
            height: 43px;
            padding: 0 12px;
            border: 1px solid var(--line);
            border-radius: 0;
            background: rgba(15,15,14,.58);
            color: var(--text);
            font-size: 14px;
            letter-spacing: 0;
            text-transform: none;
            transform: none;
        }
        .buy-contact input:focus { outline: 1px solid var(--gold-pale); border-color: var(--gold); }
        #tab-profile .material-card { max-width: 580px; min-height: 130px; }
        #tab-profile .material-card h3 { font-size: 22px; font-weight: 300; }

        .site-footer { padding: 25px 36px 35px; color: #5f5c57; font-size: 9px; letter-spacing: .08em; text-align: center; }

        @media (hover: hover) and (pointer: fine) {
            .brand { transition: transform .28s var(--ease), filter .28s ease; }
            .brand:hover { transform: translateY(-2px); filter: brightness(1.08); }
            .login-intro h1, .login-intro p, .login-box h2, .login-box > p, .cabinet-head h1, .subtitle {
                transition: transform .28s var(--ease);
            }
            .login-intro h1:hover, .login-box h2:hover, .cabinet-head h1:hover { transform: translateY(-3px); }
            .login-intro p:hover, .login-box > p:hover, .subtitle:hover { transform: translateX(3px); }
        }

        @media (max-width: 900px) {
            .site-header { height: 100px; }
            .header-inner { padding: 0 22px; }
            .brand { min-width: 0; transform: scale(.82); transform-origin: left center; margin-right: -70px; }
            .login-shell { grid-template-columns: 1fr; max-width: 520px; }
            .login-intro { min-height: 315px; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 48px 38px; }
            .intro-note { left: 38px; bottom: 35px; }
            .login-box { padding: 48px 38px 42px; }
            .page { min-height: calc(100vh - 100px); }
        }
        @media (max-width: 620px) {
            .site-header { height: 87px; }
            .header-inner { padding: 0 16px; gap: 12px; }
            .brand { transform: scale(.67); margin-right: -112px; }
            .home-link { width: 43px; min-width: 43px; padding: 0; }
            .home-link span { display: none; }
            .navbar-user > span { display: none; }
            .logout-link { padding: 0 14px; }
            .container { padding: 28px 16px 58px; }
            #loginScreen { min-height: calc(100vh - 165px); }
            .login-intro { min-height: 285px; padding: 42px 28px; }
            .login-intro h1 { margin-top: 29px; }
            .login-intro p { font-size: 13px; }
            .intro-note { left: 28px; bottom: 28px; }
            .login-box { padding: 40px 28px 36px; }
            .cabinet-head { grid-template-columns: 1fr; }
            .cabinet-status { width: 100%; }
            .tabs { width: 100%; }
            .tab { flex: 1; padding: 0 12px; }
            .material-card { align-items: flex-start; flex-direction: column; }
            .btn-view { width: 100%; }
            .planet-one { right: -260px; }
            .site-footer { padding-left: 18px; padding-right: 18px; }
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
        }


/* P6.2 protected backend adapter. The approved landing/uat LK styles above
   are preserved verbatim; these rules only support new auth states/viewers. */
[hidden] { display: none !important; }

.adapter-security-box,
.adapter-recovery {
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(185,132,73,.06);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.adapter-security-box strong,
.adapter-security-box code,
.adapter-security-box small {
  display: block;
}
.adapter-security-box code {
  margin-top: 10px;
  color: var(--gold-pale);
  user-select: text;
}
.adapter-security-box small {
  margin-top: 8px;
  color: var(--muted-dark);
}
.adapter-recovery {
  white-space: pre-wrap;
  color: var(--gold-pale);
  user-select: text;
}

.adapter-viewer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(10px);
}
.adapter-viewer-panel {
  width: min(1280px,100%);
  height: min(92vh,900px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 38px 120px rgba(0,0,0,.62);
}
.adapter-viewer-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.adapter-viewer-header h2 {
  margin: 5px 0;
  font-size: 24px;
  font-weight: 400;
}
.adapter-viewer-header small { color: var(--muted-dark); }
.adapter-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 27px;
  cursor: pointer;
}
.adapter-viewer-error {
  padding: 12px 18px;
  color: var(--danger);
  border-bottom: 1px solid rgba(214,123,114,.25);
  background: rgba(214,123,114,.08);
}
.adapter-viewer-body { min-height: 0; overflow: hidden; }

.adapter-pdf-toolbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.adapter-pdf-toolbar button {
  min-width: 50px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--panel-light);
  color: var(--text);
  cursor: pointer;
}
.adapter-pdf-stage {
  height: calc(100% - 58px);
  padding: 22px;
  overflow: auto;
  position: relative;
  display: grid;
  place-items: start center;
  background: #222;
}
.adapter-pdf-stage img {
  max-width: min(100%,1050px);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 16px 52px rgba(0,0,0,.48);
}
.adapter-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #222;
}

.adapter-video-stage {
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: relative;
  background: #000;
}
/* G4-B9: watermark lives inside Kinescope iframe (IFrame API), not a CSS overlay */
.adapter-kinescope-player,
.adapter-kinescope-player iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
.adapter-video-shield {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
  background: #080808;
}
.adapter-video-shield span {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.6;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.adapter-video-logo {
  display: grid;
  place-items: center;
}
.adapter-video-logo-mark {
  position: relative;
  display: inline-block;
  width: 92px;
  height: 94px;
  overflow: hidden;
  color: var(--gold-pale);
  font-family: Georgia, "Times New Roman", serif;
}
.adapter-video-logo-mark i,
.adapter-video-logo-mark b {
  position: absolute;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
}
.adapter-video-logo-mark i { left: 0; top: 2px; font-size: 74px; }
.adapter-video-logo-mark b { left: 40px; top: 36px; font-size: 63px; }
.adapter-video-logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 230, 180, 0.55) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  animation: logo-shimmer 1.8s var(--ease) infinite;
  pointer-events: none;
}
@keyframes logo-shimmer {
  to { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .adapter-video-logo-mark::after { animation: none; }
}
body.adapter-viewer-open { overflow: hidden; }

@media (max-width: 640px) {
  .adapter-viewer { padding: 0; }
  .adapter-viewer-panel { width: 100%; height: 100%; }
}

/* P6.2 fullscreen protected viewer */
.adapter-viewer {
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.adapter-viewer-panel {
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.adapter-viewer-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.adapter-pdf-stage {
  min-height: 0 !important;
}

/* P6.2 compact viewer chrome + browser fullscreen */
.adapter-viewer-header {
  min-height: 0 !important;
  padding: 8px 12px !important;
  gap: 10px !important;
  align-items: center !important;
}

.adapter-viewer-header h2 {
  margin: 2px 0 0 !important;
  font-size: 20px !important;
  line-height: 1.15 !important;
}

.adapter-viewer-header .eyebrow {
  margin: 0 !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}

#viewerTrace {
  display: block;
  margin-top: 3px !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

.adapter-viewer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.adapter-fullscreen,
.adapter-close {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

/* G4-B9 cinema: hide title/trace, player fills the viewer, ↙ and × stay */
.adapter-viewer--cinema .adapter-viewer-header {
  position: absolute !important;
  inset: 0 0 auto auto !important;
  z-index: 12 !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 8px !important;
  border: 0 !important;
  background: transparent !important;
  pointer-events: none !important;
}
.adapter-viewer--cinema .adapter-viewer-header > div:first-child {
  display: none !important;
}
.adapter-viewer--cinema .adapter-viewer-actions {
  pointer-events: auto !important;
}
.adapter-viewer--cinema .adapter-viewer-body {
  position: absolute !important;
  inset: 0 !important;
  overflow: hidden !important;
}
.adapter-viewer--cinema .adapter-video-stage,
.adapter-viewer--cinema .adapter-kinescope-player,
.adapter-viewer--cinema .adapter-kinescope-player iframe {
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* G4-B9 cinema: panel follows the overlay box, not 100dvh (avoids bottom gap) */
.adapter-viewer--cinema .adapter-viewer-panel {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

.adapter-pdf-toolbar {
  min-height: 0 !important;
  padding: 7px 12px !important;
}

/* P6.2 continuous protected PDF scroll */
.adapter-viewer-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.adapter-pdf-pages {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 20px 36px;
  background: #242424;
  box-sizing: border-box;
}

.adapter-pdf-document-loading,
.adapter-pdf-page-loading {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.adapter-pdf-page {
  width: min(100%, 1180px);
  flex: 0 0 auto;
}

.adapter-pdf-page img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 10px 34px rgba(0,0,0,.28);
}

.adapter-pdf-page.is-error {
  min-height: 180px;
  border: 1px solid rgba(214,123,114,.32);
  background: rgba(214,123,114,.06);
}

.adapter-page-load-error {
  color: var(--danger);
}

@media (max-width: 640px) {
  .adapter-pdf-pages {
    gap: 10px;
    padding: 8px 0 22px;
  }

  .adapter-pdf-page {
    width: 100%;
  }
}

/* P6.2 final PDF viewer visual polish */
.adapter-viewer-header {
  min-height: 44px !important;
  padding: 5px 8px !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

.adapter-viewer-header > div:first-child {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.adapter-viewer-header .eyebrow {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  font-size: 9px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.adapter-viewer-header h2 {
  min-width: 0 !important;
  flex: 0 1 auto !important;
  margin: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 16px !important;
  line-height: 1.15 !important;
}

#viewerTrace {
  flex: 0 0 auto !important;
  display: inline-block !important;
  margin: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 10px !important;
  line-height: 1 !important;
  opacity: .72;
}

.adapter-viewer-actions {
  flex: 0 0 auto !important;
  gap: 5px !important;
}

.adapter-fullscreen,
.adapter-close {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--panel-light) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}

.adapter-fullscreen:hover,
.adapter-close:hover {
  background: #262624 !important;
}

.adapter-fullscreen:focus-visible,
.adapter-close:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 1px !important;
}

.adapter-pdf-document-loading {
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.adapter-pdf-page-loading {
  min-height: 150px !important;
  padding: 0 !important;
  color: transparent !important;
  font-size: 0 !important;
  user-select: none !important;
}

@media (max-width: 720px) {
  .adapter-viewer-header .eyebrow,
  #viewerTrace {
    display: none !important;
  }

  .adapter-viewer-header h2 {
    flex: 1 1 auto !important;
  }
}

/* P6.3 project workspace — polished client UI */
.p63-projects {
  display: grid;
  gap: 14px;
}

.p63-project-card,
.p63-project-section,
.p63-message {
  border: 1px solid rgba(48,54,61,.72);
  background: linear-gradient(105deg, rgba(185,132,73,.035), transparent 42%), var(--panel);
}

.p63-project-card {
  padding: 20px 22px;
  display: grid;
  gap: 10px;
}

.p63-project-card.p63-clickable {
  cursor: pointer;
  position: relative;
  transition: transform .28s var(--ease), border-color .28s ease, background .28s ease, box-shadow .28s ease;
}

.p63-project-card.p63-clickable::after {
  content: "→";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-pale);
  font-size: 20px;
  opacity: .65;
}

.p63-project-card.p63-clickable:hover,
.p63-project-card.p63-clickable:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(185,132,73,.48);
  background: linear-gradient(105deg, rgba(185,132,73,.075), transparent 46%), var(--panel-light);
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
  outline: none;
}

.p63-project-card.p63-clickable .p63-project-head,
.p63-project-card.p63-clickable > p,
.p63-project-card.p63-clickable > .p63-project-muted {
  padding-right: 44px;
}

.p63-project-head,
.p63-project-actions,
.p63-file-row,
.p63-section-head,
.p63-composer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.p63-project-head h3,
.p63-project-section h3 {
  margin: 0;
  color: #fff;
  font-weight: 500;
}

.p63-project-section {
  padding: 20px 22px;
  display: grid;
  gap: 14px;
}

.p63-project-section + .p63-project-section {
  margin-top: 14px;
}

.p63-project-muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.p63-project-kicker {
  color: var(--gold-pale);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.p63-project-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid rgba(185,132,73,.35);
  color: var(--gold-pale);
  font-size: 10px;
  letter-spacing: .06em;
}

.p63-message {
  padding: 13px 15px;
  display: grid;
  gap: 6px;
}

.p63-messages {
  display: grid;
  gap: 9px;
}

.p63-message.client {
  border-left: 3px solid #76a9ff;
}

.p63-message.admin {
  border-left: 3px solid var(--gold);
}

.p63-message strong {
  font-size: 12px;
  font-weight: 600;
}

.p63-control,
.p63-project-section textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 0;
  outline: none;
  background: #0a0a09;
  color: #f4f1eb;
  font: inherit;
  transition: border-color .22s ease, background .22s ease;
}

.p63-project-section textarea {
  min-height: 104px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.55;
}

.p63-project-section textarea::placeholder {
  color: #68645f;
}

.p63-control:focus,
.p63-project-section textarea:focus {
  border-color: var(--gold);
  background: #0c0b0a;
}

.p63-button,
.p63-button-secondary,
.p63-back-button,
.p63-file-picker {
  min-height: 40px;
  padding: 0 17px;
  border-radius: 0;
  font: inherit;
  font-size: 10px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .22s var(--ease), border-color .22s ease, background .22s ease, color .22s ease;
}

.p63-button {
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #080706;
  font-weight: 600;
}

.p63-button-secondary,
.p63-back-button,
.p63-file-picker {
  border: 1px solid rgba(185,132,73,.45);
  background: rgba(185,132,73,.055);
  color: var(--gold-pale);
}

.p63-button:hover,
.p63-button-secondary:hover,
.p63-back-button:hover,
.p63-file-picker:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.p63-button-secondary:hover,
.p63-back-button:hover,
.p63-file-picker:hover {
  background: rgba(185,132,73,.14);
  color: #fff;
}

.p63-back-button {
  width: fit-content;
  margin-bottom: 2px;
}

.p63-request-card {
  border: 1px solid rgba(48,54,61,.72);
  padding: 16px;
  display: grid;
  gap: 11px;
  background: rgba(255,255,255,.015);
}

.p63-request-card .p63-project-head {
  align-items: flex-start;
}

.p63-response-box {
  display: grid;
  gap: 9px;
  padding-top: 4px;
}

.p63-response-sent {
  border-left: 2px solid var(--gold);
  padding: 10px 12px;
  background: rgba(185,132,73,.045);
  display: grid;
  gap: 5px;
}

.p63-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

.p63-file-name {
  color: var(--muted-dark);
  font-size: 11px;
}

.p63-file-row {
  border: 1px solid rgba(48,54,61,.72);
  padding: 13px 15px;
  background: rgba(255,255,255,.015);
}

.p63-empty-small {
  min-height: 72px;
  display: grid;
  align-items: center;
  color: var(--muted-dark);
  font-size: 12px;
}

.p63-inline-error {
  border: 1px solid rgba(214,123,114,.45);
  background: rgba(214,123,114,.08);
  color: var(--danger);
  padding: 13px 15px;
  font-size: 12px;
  line-height: 1.5;
}

.p63-update-card {
  border: 1px solid rgba(48,54,61,.72);
  padding: 15px;
  display: grid;
  gap: 7px;
  background: rgba(255,255,255,.015);
}

@media (max-width: 720px) {
  .p63-project-card,
  .p63-project-section {
    padding: 16px;
  }
  .p63-button,
  .p63-button-secondary,
  .p63-file-picker {
    width: 100%;
  }
}


.navbar-actions { display:flex; align-items:center; gap:10px; margin-left:auto; }
.navbar-user { display:flex; align-items:center; gap:0; }
.cabinet-personal-data strong { font-size:15px; color:var(--gold-pale); }
.p63-history-toggle { margin-left:auto; white-space:nowrap; }
.p63-attachment-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.p63-attachment-button { width:auto; max-width:100%; overflow-wrap:anywhere; }
.p63-review-comment { margin-top:10px; padding:10px 12px; border-left:2px solid var(--gold); background:rgba(185,132,73,.055); }
.p63-review-comment strong { display:block; margin-bottom:5px; }
@media (max-width: 760px) { .navbar-actions { gap:6px; } .navbar-home,.navbar-logout { padding:12px 13px; font-size:10px; } .p63-section-head { align-items:flex-start; flex-wrap:wrap; } .p63-history-toggle { margin-left:0; } }


.adapter-mfa-qr{display:block;width:min(240px,100%);height:auto;background:#fff;padding:10px;border-radius:8px;margin:10px auto;}
        .mfa-code-boxes{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;}
        .mfa-code-digit{width:46px;height:52px;margin:0;padding:0;border:1px solid rgba(213,184,137,.35);border-radius:10px;background:#151513;color:#f4f1eb;text-align:center;font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;}
        .mfa-code-digit:focus{border-color:#c8995e;outline:2px solid rgba(200,153,94,.2);}
        .mfa-code-help{display:block;margin-top:8px;color:#77746e;font-size:12px;line-height:1.45;}
        .otp-recovery-toggle{margin-top:12px;border:0;background:transparent;color:#d7b27c;cursor:pointer;font:inherit;font-size:12px;letter-spacing:.08em;text-transform:uppercase;}
.otp-recovery-toggle.reset-factor-link{text-transform:none;letter-spacing:0;font-size:13px;}

.auth-step { display:block; margin-bottom:10px; color:var(--gold-pale); font-size:10px; letter-spacing:.14em; text-transform:uppercase; }
.auth-hint, .password-meter-hint { display:block; margin-top:8px; color:var(--muted-dark); font-size:12px; line-height:1.45; }
.auth-login-copy { display:block; margin:0 0 23px; }
.login-identity { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; color:var(--gold-pale); font-size:14px; }
.auth-note-list { margin:0 0 18px; padding-left:18px; color:var(--muted-dark); font-size:12px; line-height:1.45; }
.auth-note-list li { margin:0 0 8px; }
.field-input-row { display:flex; align-items:flex-end; gap:10px; }
.field-input-row input { flex:1; min-width:0; }
.field-actions { display:flex; flex-wrap:wrap; gap:6px; flex-shrink:0; padding-bottom:10px; }
.field-action { margin:0; padding:0; border:0; background:transparent; color:var(--gold-pale); cursor:pointer; font:inherit; font-size:10px; letter-spacing:.08em; text-transform:uppercase; }
.field-action:hover { color:#fff; }
.login-password-wrap { position:relative; display:block; min-width:0; max-width:100%; }
.login-password-wrap input { padding-right:42px; }
.login-password-wrap.has-tools input { padding-right:64px; }
.login-field-icon.is-copied { color:var(--gold-bright); }
.field > span.field-label-row { display:flex; align-items:center; gap:8px; }
.field-info { position:relative; }
.field-info-tip { display:none; position:absolute; left:0; right:auto; top:auto; bottom:calc(100% + 8px); z-index:8; width:min(240px, 70vw); padding:10px 12px; background:#151513; border:1px solid var(--line); color:var(--text); font-size:12px; font-weight:400; letter-spacing:0; text-transform:none; line-height:1.45; box-shadow:0 12px 28px rgba(0,0,0,.35); pointer-events:none; }
.field-info:hover .field-info-tip, .field-info:focus-visible .field-info-tip, .field-info.is-open .field-info-tip { display:block; }
.login-field-icons { position:absolute; right:0; top:0; height:38px; display:flex; align-items:center; justify-content:flex-end; gap:4px; max-width:100%; pointer-events:none; }
.login-field-icon { pointer-events:auto; flex:0 0 16px; width:16px; height:16px; margin:0; padding:0; border:0; background:transparent; color:var(--gold); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.login-field-icon svg { width:16px; height:16px; display:block; }
.login-field-icon:hover { color:var(--gold-bright); }
.login-field-icon-eye .icon-eye-off { display:none; }
.login-field-icon-eye .icon-eye-open { display:block; }
.login-field-icon-eye:hover .icon-eye-open { display:none; }
.login-field-icon-eye:hover .icon-eye-off { display:block; }
.login-field-icon-eye.is-revealed .icon-eye-open { display:none; }
.login-field-icon-eye.is-revealed .icon-eye-off { display:block; }
.login-field-icon-eye.is-revealed:hover .icon-eye-open { display:block; }
.login-field-icon-eye.is-revealed:hover .icon-eye-off { display:none; }
@media (max-width: 480px) {
  .login-password-wrap input { padding-right:42px; }
  .login-password-wrap.has-tools input { padding-right:64px; }
  .login-field-icon { flex-basis:16px; width:16px; height:16px; }
}
.field-action-block { display:block; margin:0 0 14px; }
.login-button:disabled, .login-button:disabled:hover { opacity:.45; cursor:not-allowed; transform:none; filter:none; box-shadow:none; }
.password-meter { margin:8px 0 4px; }
.password-meter-track { height:4px; background:rgba(255,255,255,.08); overflow:hidden; }
.password-meter-fill { height:100%; width:0; background:var(--gold); transition:width .2s ease, background .2s ease; }
.password-meter-fill.is-weak { background:#d67b72; }
.password-meter-fill.is-mid { background:#c8a24a; }
.password-meter-fill.is-ok { background:linear-gradient(to right, var(--gold), #4ade80); }
.password-meter-hint.is-bad { color:var(--danger); }
.password-meter-hint:empty, .password-meter-hint[hidden] { display:none; margin:0; }
.password-meter-hint.is-ok { display:none; }
.auth-guide { margin:0 0 16px; padding-left:18px; color:var(--muted); font-size:13px; line-height:1.55; }
.auth-guide li { margin:0 0 8px; }
.secret-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:10px; }
.totp-secret { margin-top:0 !important; letter-spacing:.08em; }
