:root{font-family:system-ui,-apple-system,"Microsoft YaHei",sans-serif;color:#1c2937;background:#f2f5f8}*{box-sizing:border-box}body{margin:0}header{background:#172f49;color:white;padding:20px 20px}.header-inner{max-width:1100px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px}.header-inner b{font-size:19px}.header-actions{display:flex;align-items:center;gap:12px}.header-actions small{opacity:.8}.subhead{font-size:12px;opacity:.75;margin-top:4px}main{max-width:1100px;margin:24px auto;padding:0 18px}.card{background:#fff;border:1px solid #dfe6ed;padding:25px;border-radius:14px;box-shadow:0 5px 22px #18293b09}.login{max-width:530px;margin:70px auto}.eyebrow{color:#748399;font-size:11px;font-weight:700;letter-spacing:.15em}h1{font-size:25px}h2{font-size:20px;margin:0 0 9px}h3{font-size:16px;margin:0 0 10px}.heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}.heading h2{margin-bottom:5px}.muted{color:#617285;font-size:13px;line-height:1.6}nav{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:16px}button{background:white;color:#19314d;border:1px solid #b9c8d8;border-radius:8px;cursor:pointer;padding:9px 14px;font:inherit}button:hover{background:#eef4fa}button:disabled{opacity:.45;cursor:not-allowed}button.active,.primary{background:#19314d;color:white;border-color:#19314d}.primary:hover{background:#294a70}#logout{background:transparent;border-color:#8ba1ba;color:white}input,select{width:100%;padding:10px 12px;border-radius:7px;border:1px solid #bccad8;font:inherit;color:#19314d;background:#fff;margin:6px 0 14px}label,.formlabel{display:block;font-size:13px;font-weight:650}.filters{display:grid;grid-template-columns:1fr 1fr;gap:14px}.pill{display:inline-block;white-space:nowrap;font-size:11px;color:#55708a;background:#ecf1f7;padding:5px 8px;border-radius:20px}.error{color:#ad3030}.notice{font-size:13px;color:#214c73;white-space:pre-wrap}.var{border-bottom:1px solid #e7edf2;padding:14px 0}.var .vartitle{font-size:14px;font-weight:650}.var .meta{font-size:12px;color:#637587;margin-top:5px;overflow-wrap:anywhere}.var code{display:inline-block;background:#ecf1f6;color:#255071;padding:3px 6px;margin-top:6px;border-radius:5px}.var button{font-size:12px;padding:5px 9px;margin-top:7px}.pagination{display:flex;align-items:center;justify-content:center;gap:15px;padding:16px}.job,.keyrow{border:1px solid #e1e7ed;border-radius:9px;padding:15px;margin-top:12px}.job strong{display:block;margin:5px 0}.job small,.keyrow small{display:block;color:#687787;overflow-wrap:anywhere}.job button,.keyrow button{margin:9px 7px 0 0}.status{color:#226b4c;font-weight:700;font-size:12px}.checkgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:6px 12px;margin:8px 0 17px}.checkrow{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:400;line-height:1.4}.checkrow input{width:auto;margin:0;flex-shrink:0}.permissions-tree{border:1px solid #e4eaf0;border-radius:9px;padding:13px;max-height:360px;overflow:auto;margin:9px 0 18px}.group{padding:9px 3px;border-bottom:1px solid #eef1f5}.group>strong{font-size:13px}.group-children{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:7px;padding:10px 8px 4px}.adminform{border:1px solid #e2e9f0;border-radius:10px;padding:17px;background:#fbfcfe}.separator-title{padding-top:22px;margin-top:18px;border-top:1px solid #e6ebf0}.secret{padding:14px;background:#fff9e8;border:1px solid #e4d4a4;border-radius:8px;margin-top:13px;overflow-wrap:anywhere;font-size:13px}.secret code{display:block;margin:8px 0;word-break:break-all}.danger{color:#aa3232;border-color:#d7adad}.warn{color:#8b5c15}.empty{padding:20px 0;color:#6c7e90;font-size:13px}footer{text-align:center;color:#738294;font-size:12px;padding:35px 15px}#submitMessage{white-space:pre-wrap}@media(max-width:650px){main{margin:12px auto}.card{padding:16px}nav button{flex:1 1 35%;font-size:13px}.filters{grid-template-columns:1fr}.heading{flex-wrap:wrap}.group-children{grid-template-columns:1fr}}

/* V3 questionnaire section hierarchy */
.permissions-tree details.group{padding:12px;margin:8px 0;border:1px solid #d9e2ec;border-radius:9px;background:#f8fafc}
.permissions-tree details.group > summary{cursor:pointer;font-weight:700;color:#183250;padding:3px 0}
.permissions-tree details.section-group{margin:8px 0 8px 10px;padding:8px 12px;border-left:3px solid #a1b6ce;background:white;border-radius:4px}
.permissions-tree details.section-group > summary{cursor:pointer;font-weight:600;color:#38516c}
.submit-section{border:1px solid #dbe3ec;border-radius:8px;padding:12px;margin-bottom:9px}
.submit-section > strong{display:block;margin-bottom:8px;color:#254462}

/* V3.2 item-scoped permissions */
.module-grant{padding:9px 10px;margin:8px 0;border:1px solid #e5ebf1;border-radius:7px;background:#fff}
.module-grant .item-grant-details{padding-left:20px;margin:5px 0}
.item-grant-details>summary,.question-grant>summary,.submit-section details>summary{cursor:pointer;font-size:13px;color:#45627f;padding:6px 0}
.item-grant-list{max-height:420px;overflow:auto;padding:6px 4px}
.question-grant{border-top:1px solid #eaf0f5;margin-top:4px;padding:5px 3px}
.question-children{padding:6px 0 9px 17px;display:grid;gap:7px}
.question-children .checkrow{font-size:12px;font-weight:400;overflow-wrap:anywhere}
.question-children .checkrow span{overflow-wrap:anywhere}
.submit-question{padding:7px 10px;border-top:1px solid #e7edf2}
.submit-question strong{font-size:12px;color:#516780}
.permissions-tree{max-height:540px}
.filters{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}

/* V3.3: full Stata value-label display (DOM-only, no HTML interpolation) */
.variable-id{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:4px}
.variable-id code{margin-top:0}
.values-detail{margin-top:10px;border:1px solid #dce5ed;border-radius:7px;padding:8px 12px;background:#fafbfd}
.values-detail summary,.stata-example summary{cursor:pointer;font-size:13px;color:#2b526f}
.values-scroll{max-height:330px;overflow:auto;margin:10px 0 1px}
.values-table{width:100%;border-collapse:collapse;font-size:12px;background:white}
.values-table td,.values-table th{text-align:left;padding:7px 9px;border-bottom:1px solid #e7edf2;overflow-wrap:anywhere}
.values-table th{position:sticky;top:0;background:#f1f5f9;color:#43566b}
.values-table td:first-child,.values-table th:first-child{width:140px;white-space:nowrap;font-variant-numeric:tabular-nums}
.variable-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:7px 0 0}
.stata-example{flex:1 1 230px}
.stata-code{white-space:pre-wrap;overflow-wrap:anywhere;background:#f0f4f8;border-radius:6px;padding:10px;font-size:12px}
@media(max-width:650px){.values-table td:first-child,.values-table th:first-child{width:90px}}

/* V3.4 audit-aligned codebook notice */
.usage-note{margin:11px 0 17px;padding:11px 13px;border:1px solid #d9e3ed;border-left:3px solid #7894ae;background:#f8fafc;border-radius:5px;color:#44596c;font-size:12px;line-height:1.65}

/* V3.5: administration-only code-based permission assistant */
.code-grant-panel{border:1px solid #c7d7e5;background:#f5f9fc;border-radius:10px;padding:15px;margin:12px 0 18px}
.code-grant-panel h4{font-size:14px;margin:0 0 7px;color:#1c3a59}
.code-grant-panel textarea{width:100%;min-height:96px;resize:vertical;border:1px solid #bacbd9;border-radius:7px;padding:10px 12px;font:13px/1.5 ui-monospace,Consolas,monospace;background:#fff;color:#19314d;margin:6px 0 13px}
.code-grant-actions{display:flex;gap:10px;flex-wrap:wrap}
.grant-preview{font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.grant-preview ul{margin:5px 0 10px;padding-left:18px;max-height:190px;overflow:auto}
.grant-success{color:#226b4c;font-weight:650}

/* V3.6: admin permission overview + SMTP notification status */
.overview-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:12px 0 16px}
.overview-controls label{flex:1 1 260px;margin:0}
.overview-user,.overview-dataset,.overview-block{border:1px solid #d7e2eb;border-radius:8px;margin:9px 0;background:white}
.overview-user>summary,.overview-dataset>summary,.overview-block>summary{cursor:pointer;padding:12px 14px;font-weight:650;color:#274765}
.overview-content{padding:5px 15px 15px}
.overview-dataset{margin-left:8px}.overview-block{margin:8px 12px;background:#f9fbfd}
.overview-variables{padding:0 16px 12px;max-height:280px;overflow:auto}
.overview-line{font-size:12px;color:#455a6d;padding:5px 0;border-bottom:1px solid #edf2f6;overflow-wrap:anywhere}
.overview-keys{padding:10px 0 14px}
.mail-record{border:1px solid #e0e7ee;border-radius:8px;padding:12px 15px;margin:9px 0;display:flex;flex-direction:column;align-items:start;gap:5px}
.mail-record small{font-size:12px;color:#64748b;overflow-wrap:anywhere}

/* V3.7: accessible submission, permissions applications and key lifecycle */
textarea{width:100%;padding:10px 12px;border-radius:7px;border:1px solid #bccad8;font:inherit;color:#19314d;background:#fff;margin:6px 0 14px;resize:vertical;line-height:1.55}
.req{color:#a73232;font-weight:700}
.checkrow{cursor:pointer}.checkrow input[type=checkbox]{width:17px;height:17px;flex-shrink:0}
.module-choices{padding:10px 12px;max-height:210px;overflow:auto;border:1px solid #bccad8;border-radius:8px;margin:6px 0 14px;display:grid;gap:9px}.module-choices .checkrow{padding:4px 0}
#requestForm .muted{margin-top:0}
.request-record{border:1px solid #dbe4ee;border-radius:9px;padding:16px;margin:12px 0;background:#fff}
.request-record .meta{font-size:12px;color:#64758a;margin:5px 0;word-break:break-word}
.request-record strong{display:block;margin-bottom:5px}
.request-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
.request-record code{white-space:normal;overflow-wrap:anywhere;font-size:12px;color:#234c70}
.key-manage-grid{display:grid;grid-template-columns:minmax(190px,2fr) minmax(110px,1fr);gap:10px;margin-top:12px}
.key-manage-grid label{margin:0}
.key-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.key-actions button{margin:0}
.key-meta{font-size:12px;color:#63748a;margin:5px 0;overflow-wrap:anywhere}
.key-status-active{color:#166f4d}.key-status-expiring{color:#9a5b12}.key-status-revoked{color:#9a3535}
.key-secret{border:1px solid #d1ae70;background:#fff8e9;border-radius:7px;padding:12px;margin-top:12px}
.key-secret code{display:block;overflow-wrap:anywhere;margin:10px 0}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #5a8db5;outline-offset:2px}
@media(max-width:650px){.key-manage-grid{grid-template-columns:1fr}.module-choices{max-height:190px}}

/* V3.8: production copy and review workbench */
body{background:#f4f6f9;color:#263647}main{max-width:1220px}header{background:#18354f}.card{box-shadow:0 4px 22px rgba(14,38,65,.05);border-color:#e2e8ef}nav{border-bottom:1px solid #dce5ef;padding-bottom:12px;gap:6px}nav button{border-color:transparent;background:transparent;padding:10px 13px;font-size:13px;font-weight:600;color:#49617c}nav button:hover{background:#edf3f8}nav button.active{color:#fff;background:#183b5b;border-color:#183b5b}input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid #3e749f;outline-offset:2px}
.dictionary-guide{font-size:12px;line-height:1.6;color:#465d73;margin:9px 0 13px}.question-heading{border-left:3px solid #577b9c;background:#f0f5f9;margin:18px 0 1px;padding:11px 13px;border-radius:4px;font-size:14px;line-height:1.5}.var{padding:13px 14px;border-bottom:1px solid #e7ecf1}.var:hover{background:#fcfdff}.var .vartitle{font-size:14px;line-height:1.6}.var .meta{line-height:1.6}
.dashboard-metrics{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:10px;margin:16px 0 22px}.metric-card{display:flex;align-items:flex-start;flex-direction:column;gap:7px;background:#f9fbfd;border:1px solid #dbe5ef;padding:17px;text-align:left}.metric-card strong{font-size:27px;line-height:1.1;font-variant-numeric:tabular-nums;color:#244764}.metric-card span{font-size:12px;color:#50667b}.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.dashboard-section{border:1px solid #dce6ef;border-radius:11px;background:#fbfcfe;padding:16px;min-width:0}.dashboard-section .heading{align-items:center;margin-bottom:8px}.dashboard-section h3{margin:0;font-size:15px}.dashboard-section .heading button{font-size:12px;padding:6px 10px}.work-item{background:#fff;border:1px solid #e4ebf2;border-radius:9px;padding:12px;margin:9px 0;overflow-wrap:anywhere}.work-item strong{font-size:13px;line-height:1.6}.work-meta{font-size:12px;color:#596d83;line-height:1.55;margin:6px 0;overflow-wrap:anywhere}.work-actions{display:flex;flex-wrap:wrap;gap:7px}.work-item button,.work-actions button{font-size:12px;padding:6px 10px;margin-top:6px}.empty-state{font-size:13px;color:#65798d;padding:7px 0}.audit-history{margin-top:20px;border-top:1px solid #e2eaf2;padding-top:14px}.audit-history>summary{cursor:pointer;font-weight:650;color:#38536e}.toolbar{display:flex;gap:14px;flex-wrap:wrap}.toolbar label{flex:1 1 190px}.dashboard-section .request-record{padding:12px}.dashboard-section .request-record .request-actions button{font-size:12px;padding:7px}.dashboard-section .request-record details{max-height:200px;overflow:auto}
@media(max-width:940px){.dashboard-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}}@media(max-width:600px){.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card{padding:12px}.metric-card strong{font-size:23px}.card{padding:15px}.question-heading{font-size:13px}nav button{flex:1 1 auto}}

/* V3.9 Authorized questionnaire export */
.preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;border:1px solid #dce6ef;border-radius:9px;padding:13px 16px;background:#f8fafc;margin:13px 0}
.preview-toolbar strong{font-size:14px;color:#19314d}
.preview-toolbar .muted{margin:5px 0 0}
.preview-toolbar button{flex-shrink:0}
.key-preview{border-top:1px solid #e6ebf0;margin-top:13px;padding-top:13px}
.key-preview>summary{font-weight:650;cursor:pointer;color:#254462}
.key-preview label{margin-top:12px}
.key-preview select{max-width:370px}
@media(max-width:650px){.preview-toolbar{align-items:stretch;flex-direction:column}.preview-toolbar button{width:100%}}

/* V3.11 data provenance table */
.data-source-table{overflow-x:auto;margin:12px 0 24px}.data-source-table .values-table{min-width:820px;width:100%}

/* V3.12 reviewed aggregates */
.export-actions{display:flex;gap:8px;flex-wrap:wrap}.distribution-slot{padding:12px;margin:10px 0;border-radius:9px;border:1px solid #dbe5ef;background:#f9fbfd}.stat-numbers{font-size:12px;color:#36536d}.stat-bars{display:grid;gap:8px;margin:12px 0}.stat-row{display:grid;grid-template-columns:minmax(100px,1.5fr) minmax(60px,2fr) minmax(115px,1fr);gap:8px;align-items:center;font-size:12px}.stat-name{overflow-wrap:anywhere}.stat-track{background:#e6edf4;height:15px;border-radius:3px;overflow:hidden}.stat-fill{height:100%;display:block;background:#6a89a5}.stat-value{text-align:right;font-variant-numeric:tabular-nums}.visibility-audit{max-height:250px;overflow:auto;border:1px solid #e0e8f0;border-radius:7px;padding:8px 12px}.audit-record{font-size:12px;border-bottom:1px solid #eef2f6;padding:7px 0}.export-actions button{white-space:nowrap}@media(max-width:620px){.stat-row{grid-template-columns:1fr 1fr;gap:5px}.stat-track{grid-column:1 / 3;grid-row:2}.stat-value{text-align:right}}

.admin-stat-preview{margin:16px 0}.aggregate-preview-list{max-height:480px;overflow:auto}.aggregate-preview-list details{border:1px solid #dce5ef;padding:11px;margin:8px 0;border-radius:7px}.aggregate-preview-list details summary{cursor:pointer;font-size:13px}.aggregate-preview-list .values-table{font-size:12px;margin-top:10px}

/* V3.13 · CDERC professional research service identity */
:root{
  --ink:#183149;--navy:#152b43;--navy-2:#203b53;--soft:#eef3f6;
  --line:#dce4eb;--muted:#596d7e;--teal:#547c80;
}
[hidden]{display:none!important}
body{background:#f5f7f8;color:#22384b;min-height:100vh;display:flex;flex-direction:column;font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
.site-header{background:var(--navy);padding:0 26px;border-bottom:3px solid #96aaa6}
.site-header .header-inner{max-width:1220px;min-height:110px;display:flex;align-items:center;gap:24px}
.brand-lockup{display:flex;align-items:center;gap:17px;min-width:0}
.brand-mark{height:61px;width:61px;min-width:61px;border:1px solid rgba(229,237,238,.57);display:flex;align-items:center;justify-content:center;position:relative;color:#ecf1ef;background:rgba(255,255,255,.045)}
.brand-mark:after{content:"";position:absolute;inset:4px;border:1px solid rgba(229,237,238,.19)}
.brand-mark span{font-family:"Songti SC","Noto Serif CJK SC","SimSun",serif;font-size:29px;font-weight:700;line-height:1}
.brand-copy{display:flex;flex-direction:column;gap:5px;min-width:0}
.brand-copy .org-name{font-size:12px;font-weight:650;letter-spacing:.13em;color:#c6d4dc}
.brand-copy .site-name{font-size:20px;line-height:1.4;font-weight:700;letter-spacing:.045em;color:#fff}
.brand-copy .english-name{font-size:10px;color:#afc1cc;letter-spacing:.055em}
.site-header .header-actions{display:flex;align-items:center;gap:12px;margin-left:auto;flex-shrink:0}
.site-header .header-actions button{margin:0;border:1px solid rgba(210,226,234,.38);background:transparent;color:#edf5f7;padding:9px 13px;border-radius:5px;font-size:12px}
.site-header .header-actions button:hover{background:rgba(255,255,255,.12)}
.site-header .identity{font-size:12px;color:#d0dce5;max-width:180px;overflow-wrap:anywhere}
main{flex:1;width:100%;max-width:1220px;margin:28px auto 45px;padding:0 24px}
.access-landing{display:grid;grid-template-columns:minmax(0,1fr) minmax(350px,430px);align-items:stretch;gap:52px;margin:56px 0 90px;min-height:470px}
.access-intro{padding:20px 18px 18px 0;display:flex;flex-direction:column;align-items:flex-start}
.intro-rule{width:48px;height:4px;background:#51777b;margin:4px 0 31px}
.access-kicker{font-size:11px;font-weight:700;letter-spacing:.16em;color:#58737d;margin:0 0 24px}
.access-intro h1{font-family:"Songti SC","Noto Serif CJK SC","SimSun",serif;font-size:clamp(32px,3.2vw,45px);font-weight:600;letter-spacing:.025em;line-height:1.5;margin:0;color:#20394c}
.access-summary{margin:24px 0 30px;font-size:14px;line-height:2.05;color:#576b79;max-width:520px}
.access-services{display:flex;flex-direction:column;width:100%;max-width:470px;border-top:1px solid #dbe3e9}
.access-services>div{display:flex;align-items:center;gap:22px;padding:13px 2px;border-bottom:1px solid #dbe3e9;font-size:13px;font-weight:550;letter-spacing:.02em}
.service-no{font:600 13px Georgia,serif;color:#6a8b8f;letter-spacing:.07em}
.access-audience{color:#667e85;font-size:12px;margin-top:auto;padding-top:23px}
.card{border-color:#e2e8ed;border-radius:9px;box-shadow:0 9px 32px rgba(19,46,68,.045)}
.access-card{padding:47px 42px 36px;align-self:center;box-shadow:0 14px 48px rgba(19,46,68,.08);border-top:4px solid #486c78;border-radius:7px}
.access-card .eyebrow{font-size:10px;color:#667f87;letter-spacing:.16em;margin-bottom:12px}
.access-card h2{font-family:"Songti SC","Noto Serif CJK SC","SimSun",serif;font-weight:650;font-size:27px;margin:0 0 15px;color:#20394c}
.access-card .muted{font-size:13px;line-height:1.85;margin:0 0 35px}
.access-card label{font-size:12px;color:#3d5262;letter-spacing:.03em;margin-bottom:6px}
.access-card input{font-size:14px;height:48px;background:#fafcfd;border-color:#cbd6de;border-radius:5px;margin:0 0 17px}
.access-card input:focus{border-color:#537984;outline:2px solid #dbe9ec}
.login-submit{border-radius:5px;width:100%;height:47px;display:flex;align-items:center;justify-content:center;gap:20px;background:#24475d;border-color:#24475d;font-weight:650}
.login-submit:hover{background:#35596d}
.access-help{margin-top:25px;border-top:1px solid #e5eaee;padding-top:19px;font-size:12px;color:#667b8a;line-height:1.6}
.text-link{border:0;background:transparent;color:#26556c;padding:0 0 1px;border-radius:0;border-bottom:1px solid #93aab7;font-size:12px;font-weight:650}
.text-link:hover{background:transparent;color:#132f45}
#appSection nav{padding:0 0 16px;margin-bottom:23px;border-bottom:1px solid #dbe4e8;gap:6px}
#appSection nav button{border:1px solid transparent;font-size:12px;color:#3f5b6d;padding:9px 12px;border-radius:5px}
#appSection nav button.active{color:#fff;background:#23455c;border-color:#23455c}
#appSection .card{padding:28px 32px}
#appSection .heading h2{color:#243d4e;font-family:"Songti SC","Noto Serif CJK SC","SimSun",serif;font-size:23px;font-weight:650}
#appSection .heading .muted{max-width:810px}
.site-footer{background:#f1f4f5;border-top:1px solid #dce4e8;padding:30px 24px;font-size:12px;color:#5c7280}
.footer-inner{max-width:1220px;margin:0 auto;display:flex;gap:18px;align-items:center;justify-content:space-between;text-align:left}
.footer-inner>div{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.footer-inner strong{font-size:13px;color:#2a4556;font-weight:700}
.footer-contact{font-size:12px;color:#3e6274;background:transparent;border:0;border-bottom:1px solid #aabdc7;border-radius:0;padding:2px}
.footer-contact:hover{background:transparent;color:#153248}
.footer-inner small{font-size:11px;color:#80939f}
.contact-dialog{border:1px solid #dee6ec;border-radius:10px;padding:0;box-shadow:0 25px 85px rgba(14,31,47,.25);width:min(570px,calc(100vw - 28px));max-height:90vh;overflow-y:auto;color:#233d51;background:white}
.contact-dialog::backdrop{background:rgba(15,32,50,.55)}
.contact-dialog-head{display:flex;justify-content:space-between;gap:15px;padding:28px 32px 10px}
.contact-dialog-head h2{font-family:"Songti SC","Noto Serif CJK SC","SimSun",serif;font-size:25px;margin:9px 0}
.contact-dialog-head .muted{margin:0;line-height:1.7}
.contact-dialog .dialog-close{font-size:24px;line-height:1;width:33px;height:33px;border:0;background:#f2f5f6;color:#405c70;padding:0;flex:0 0 33px}
.contact-dialog form{padding:12px 32px 30px}
.contact-dialog label{font-weight:620;color:#324d5f;font-size:12px}
.contact-dialog input,.contact-dialog select,.contact-dialog textarea{border-radius:5px;border-color:#cbd8df;font-size:13px}
.contact-two-col{display:grid;grid-template-columns:1fr 1fr;gap:15px}
.contact-privacy{font-size:12px;line-height:1.7;color:#657d88;border-top:1px solid #e5ecf0;padding-top:15px;margin-top:3px}
.contact-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
.contact-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:17px}
.contact-actions button{border-radius:5px}
.contact-inbox-item{padding:17px 20px;border:1px solid #dde7ec;border-radius:7px;margin:12px 0;background:#fff}
.contact-inbox-head{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.contact-inbox-head strong{font-size:14px;color:#274459}
.contact-inbox-head small{font-size:11px;color:#6c8190}
.contact-inbox-item .muted{margin:9px 0;font-size:12px}
.contact-inbox-item details>summary{cursor:pointer;font-size:12px;color:#376378}
.contact-inbox-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.contact-message-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.85;background:#f6f9fa;border:1px solid #e6eef1;padding:14px;border-radius:5px}
@media(max-width:950px){.access-landing{gap:26px;grid-template-columns:1fr minmax(330px,405px)}.access-intro h1{font-size:32px}.access-card{padding:34px 30px}.site-header .header-inner{min-height:96px}}
@media(max-width:720px){.site-header{padding:0 14px}.site-header .header-inner{min-height:92px;gap:9px}.brand-lockup{gap:10px}.brand-mark{width:43px;height:43px;min-width:43px}.brand-mark span{font-size:23px}.brand-copy .org-name{font-size:10px}.brand-copy .site-name{font-size:14px;line-height:1.3}.brand-copy .english-name{font-size:8px}.site-header .header-actions{gap:6px}.site-header .header-actions .identity{display:none}.site-header .header-actions button{padding:7px 9px;font-size:11px}.access-landing{margin:22px 0 43px;grid-template-columns:1fr;gap:20px}.access-intro{padding:15px 5px}.intro-rule{margin-bottom:19px}.access-intro h1{font-size:31px}.access-summary{margin:15px 0}.access-audience{padding-top:6px}.access-card{width:100%}.footer-inner,.footer-inner>div{align-items:flex-start;flex-direction:column;gap:9px}.contact-two-col{grid-template-columns:1fr;gap:0}#appSection .card{padding:18px 16px}}
@media(max-width:410px){.site-header .header-inner{flex-wrap:wrap;padding:10px 0}.site-header .header-actions{width:100%;justify-content:flex-end}.access-intro h1{font-size:28px}.contact-dialog-head{padding:20px 19px 8px}.contact-dialog form{padding:10px 19px 23px}}


/* V3.13.1 - Beida Red academic visual system
   Official Beida Red web color #94070A; related tints are UI derivatives.
   This is a site color theme, NOT an official Peking University seal or endorsement.
   CSS-only: no authentication / field-visibility / API changes. */
:root {
  --beida-red: #94070a;
  --beida-dark: #6d0b13;
  --beida-hover: #ac2630;
  --beida-light: #fcf0ef;
  --beida-muted: #a65b5f;
  --academic-gold: #b89d75;
  --ink: #29272b;
  --navy: #94070a; /* compatible with V3.13 brand-variable selectors */
  --navy-2: #6d0b13;
  --soft: #fbf8f5;
  --line: #e8dfda;
  --muted: #746e6a;
  --teal: #9e5051;
  --surface: #ffffff;
}
html { color-scheme: light; }
body {
  background: #fbf9f6;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
::selection { background: #ead0cc; color: #5c1017; }
.site-header {
  padding: 0 26px;
  background: linear-gradient(116deg,#760811 0%,#94070a 57%,#a51f23 100%);
  border-bottom: 3px solid var(--academic-gold);
  box-shadow: 0 4px 20px rgba(66,12,17,.075);
}
.site-header .header-inner { min-height: 104px; }
.brand-mark {
  width: 60px; height: 60px; min-width:60px;
  border: 1px solid rgba(255,242,226,.68);
  border-radius: 50%;
  background: rgba(255,255,255,.055);
  color: #fffaf4;
}
.brand-mark:after { inset: 5px; border: 1px solid rgba(255,244,226,.3);border-radius: 50%; }
.brand-mark span { font-size: 27px; letter-spacing: -.07em; }
.brand-copy .org-name { color: #f5ded6; font-weight: 650; letter-spacing: .19em; }
.brand-copy .site-name { color: #fffaf5; letter-spacing:.055em; font-weight:700; }
.brand-copy .english-name { color: #f1d6d0; letter-spacing:.075em; }
.site-header .identity { color: #f5dfdd; }
.site-header .header-actions button {
  color: #fff7f2;
  border: 1px solid rgba(255,232,225,.55);
  border-radius: 5px;
  background: rgba(255,255,255,.03);
}
.site-header .header-actions button:hover { background: rgba(255,255,255,.16); }
.site-header .header-actions button:focus-visible {outline-color: #f9d9b0;}
main { margin-top: 32px; }
/* Landing: editorial typography, subtle parchment, and clear institutional hierarchy. */
.access-landing { gap: clamp(32px,5.6vw,78px); margin-top: 57px; }
.access-intro { padding-top: 30px; }
.intro-rule { width: 51px; height: 3px; background: var(--beida-red); margin-bottom: 29px; }
.access-kicker { color:#9a4144; font-size:11px;letter-spacing:.17em; margin-bottom:21px; }
.access-intro h1 {
  color: #322629;
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-weight: 600;
  letter-spacing:.012em;
  line-height:1.48;
}
.access-summary { color:#615b5a; font-size:14px; line-height:2.04; }
.access-services { border-top: 1px solid #e7dcd6; }
.access-services>div { border-bottom: 1px solid #e7dcd6; color:#453e3d; }
.service-no { color:#9b2b32; font-size:14px; font-variant-numeric:tabular-nums; }
.access-audience { color:#7c716d; }
.card { border-color:#ece3de; background:#fff; box-shadow:0 7px 29px rgba(77,39,36,.045); }
.access-card {
  border-top: 4px solid var(--beida-red);
  border-radius: 7px;
  padding:45px 42px 38px;
  box-shadow: 0 16px 44px rgba(81,39,37,.09);
}
.access-card .eyebrow { color:#9a5555; }
.access-card h2 { color:#3e292a; }
.access-card .muted { color:#736b69; }
.access-card label { color:#4e4342; }
.access-card input {
  background:#fdfbf9;
  color:#332c2b;
  border-color:#ded3cc;
}
.access-card input:focus { border-color:#9c1720; outline:2px solid #f3dcd9; }
.login-submit { background:var(--beida-red); border-color:var(--beida-red); color:#fff; letter-spacing:.04em; }
.login-submit:hover { background:var(--beida-dark); border-color:var(--beida-dark); }
.access-help { color:#77706c; border-top-color:#eee5df; }
.text-link { color:var(--beida-red); border-bottom-color:#d7a3a1; }
.text-link:hover { color:var(--beida-dark); }
/* Global controls and accessible focus: themed consistently, never severity status. */
button { color:#603037; border-color:#d9c6c1; background:#fff; }
button:hover:not(:disabled) { background:#fdf2f0; border-color:#caa7a1; }
button.active, .primary { color:#fff; background:var(--beida-red); border-color:var(--beida-red); }
button.primary:hover:not(:disabled), button.active:hover:not(:disabled) { background:var(--beida-dark); border-color:var(--beida-dark); color:#fff; }
button:disabled { opacity:.48; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline:2px solid #ad4243; outline-offset:3px;
}
input,select,textarea { border-color:#d9ccc6; color:#413b3b; }
input:focus,select:focus,textarea:focus { border-color:#b95d5b; }
.checkrow input[type=checkbox], input[type=radio] { accent-color:var(--beida-red); }
.pill { color:#7f3237; background:#faefed; }
.error,.danger,.req { color:#a11f2b; }
/* Authenticated researcher and admin navigation: restrained tabs, visible current location. */
#appSection nav { border-bottom:1px solid #e7d9d4; gap:3px 5px; }
#appSection nav button {
  color:#685451;
  font-weight:620;
  border-radius:5px 5px 0 0;
  border-bottom:3px solid transparent;
  padding:10px 12px 9px;
}
#appSection nav button:hover { background:#f7eeeb; color:#7e151d; }
#appSection nav button.active {
  color:var(--beida-red);
  background:#fff;
  border:1px solid #eee0dd;
  border-bottom:3px solid var(--beida-red);
  box-shadow:0 -1px 0 #fff inset;
}
#appSection .card { border:1px solid #eee5e0; }
#appSection .heading h2 { color:#3a292a; }
#appSection .heading .muted,.muted { color:#726a67; }
h1,h2,h3 { text-wrap:pretty; }
.eyebrow { color:#9a5352; }
.separator-title { border-top-color:#eaded8; }
/* Codebook browse: question-level hierarchy and subdued variable cards. */
.question-heading {
  color:#6c1720;
  border-left:3px solid var(--beida-red);
  background:#fbf1ef;
}
.var { border-bottom:1px solid #eee7e2; }
.var:hover { background:#fdfaf8; }
.var .vartitle { color:#302c2b; }
.var .meta,.key-meta,.request-record .meta {color:#79726d;}
.var code,code:not(pre code) { background:#f7eeea; color:#78343b; }
.variable-id code { color:#79353d; }
.values-detail,.distribution-slot { border-color:#eadfd9; background:#fefbf9; }
.values-detail summary,.stata-example summary { color:#7b252b; }
.values-table th { background:#f8f1ec; color:#5b3838; }
.values-table td,.values-table th { border-bottom:1px solid #eee4df; }
.stata-code { background:#f8f3ef; color:#5b4441; }
.preview-toolbar { background:#fcf8f5; border-color:#eaded9; }
.preview-toolbar strong { color:#4d2a2d; }
.usage-note { background:#fbf8f3; color:#665a57; border-color:#e9dfd6; border-left-color:#ad7b6c; }
/* Distribution charts: the same Beida Red family, without traffic-light semantics. */
.stat-numbers { color:#5d4441; }
.stat-track { background:#f2e7e1; border-radius:4px; }
.stat-fill { background:linear-gradient(90deg,#9a1b24,#c75f60);border-radius:4px; }
.stat-value { color:#5b3335; }
/* Administrative tables and metrics use the same quiet palette. */
.adminform,.dashboard-section,.metric-card,.code-grant-panel {
  background:#fdfaf8;
  border-color:#e9ddd7;
}
.metric-card strong { color:#8b141c; }
.metric-card span { color:#746762; }
.work-item,.request-record,.mail-record,.job,.keyrow,.contact-inbox-item { border-color:#e8ddd7; }
.audit-history { border-top-color:#e9ddd7; }
.audit-history>summary { color:#71353a; }
.permissions-tree,.module-choices { border-color:#e7d9d3; }
.permissions-tree details.group { border-color:#e9dad5; background:#fdfaf8; }
.permissions-tree details.group > summary { color:#6b2830; }
.permissions-tree details.section-group { border-left-color:#c98480; }
.permissions-tree details.section-group > summary { color:#7b4849; }
.module-grant,.submit-section { border-color:#eaded9; }
.item-grant-details>summary,.question-grant>summary,.submit-section details>summary { color:#84565a; }
.overview-user,.overview-dataset,.overview-block { border-color:#e9dcd7; }
.overview-user>summary,.overview-dataset>summary,.overview-block>summary { color:#6b2931; }
.overview-block { background:#fdfaf8; }
.overview-line { border-bottom-color:#f0e8e3; }
.code-grant-panel h4,.key-preview>summary { color:#6b2931; }
.code-grant-panel textarea { color:#453537; border-color:#decfc9; }
.aggregate-preview-list details { border-color:#e9ddd7; }
/* Leave green success, orange warning, and red destructive status semantics intact. */
/* Contact form and footer: consistent red accents without decorative clutter. */
.site-footer { background:#f7f2ee; color:#736963; border-top:1px solid #e8ddd7; }
.footer-inner strong { color:#683037; }
.footer-contact { color:#85262e; border-bottom-color:#c58e87; }
.footer-contact:hover { color:#5f111a; }
.footer-inner small { color:#93857f; }
.contact-dialog { border-color:#e9d9d2; color:#3a2e2d; box-shadow:0 24px 70px rgba(57,17,19,.22); }
.contact-dialog::backdrop { background:rgba(36,17,17,.56); }
.contact-dialog-head { border-top:4px solid var(--beida-red); }
.contact-dialog .dialog-close { background:#f9efed; color:#72343b; }
.contact-dialog label,.contact-inbox-head strong { color:#5c3133; }
.contact-dialog input,.contact-dialog select,.contact-dialog textarea { border-color:#ded0c9; }
.contact-privacy { color:#796c67; border-top-color:#eee4df; }
.contact-inbox-item details>summary { color:#7f3438; }
.contact-message-body { background:#fdf8f4; border-color:#eee1dc; }
/* Narrow viewports: retain logo legibility and prevent cramped action labels. */
@media (max-width:720px) {
  .site-header {padding:0 14px;}
  .site-header .header-inner {min-height:94px;}
  .brand-mark {width:43px;min-width:43px;height:43px;}
  .brand-mark span {font-size:22px;}
  .access-landing {margin-top:26px;}
  .access-intro {padding-top:11px;}
  .access-card {padding:30px 24px;}
  #appSection nav button {padding:9px 10px;}
}
@media (max-width:410px) {
  .brand-copy .site-name {font-size:13px;}
  .brand-copy .english-name {font-size:7.5px;}
  .site-header .header-actions button {padding:7px 9px;}
  .access-intro h1 {font-size:29px;}
  .access-card {padding:27px 20px;}
}
@media (prefers-reduced-motion: no-preference) {
  button,input,select,textarea,.var,.card {transition:background-color .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease;}
}

/* V3.15: single-reading-line variable cards and a dedicated download library. */
.var .variable-id { margin-top:7px; }
.var .variable-id code { font-size:13px;font-weight:650;padding:4px 8px; }
.var .vartitle { margin-bottom:5px;font-size:13px;font-weight:500; }
.values-direct { margin-top:10px;padding-top:9px;border-top:1px solid #eee7e1; }
.values-direct>strong,.distribution-slot>strong,.stata-example-direct>strong { display:block;font-size:12px;font-weight:650;color:#6a383b; }
.values-direct .values-scroll { max-height:235px; margin:4px 0 0; }
.values-direct .values-table { width:100%;font-size:12px; }
.values-direct .values-table th { width:108px;font-weight:500;text-align:left;white-space:nowrap; }
.values-direct .values-table td { line-height:1.5; }
.stata-example-direct { margin-top:9px; }
.stata-example-direct .stata-code { margin:5px 0 0;padding:9px 11px;font-size:12px;line-height:1.55; }
.distribution-slot { margin:10px 0 0; }
.distribution-slot .stat-bars { max-height:350px;overflow-y:auto; }
.downloads-library { display:grid;gap:14px;margin-top:15px; }
.download-dataset { border:1px solid #e9ddd7;border-radius:10px;padding:17px 20px;background:#fffdfa; }
.download-dataset h3 { color:#683037;margin:0 0 3px; }
.download-dataset p { margin:4px 0 13px; }
.download-items { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
.download-item { display:flex;flex-direction:column;align-items:flex-start;gap:5px;border-top:1px solid #eee4df;padding-top:10px; }
.download-item button { font-size:13px;line-height:1.4;text-align:left;white-space:normal; }
.download-item small { font-size:12px;line-height:1.45;color:#80736e; }
.synthetic-admin { margin-top:27px;border-top:1px solid #e8ddd6;padding-top:20px; }
.synthetic-admin label { margin-bottom:10px; }
.sample-admin-item { border:1px solid #e8ddd6;border-radius:8px;padding:10px 13px;margin-top:8px;display:flex;align-items:center;gap:13px;justify-content:space-between;flex-wrap:wrap; }
.sample-admin-item strong { font-size:13px;font-weight:500; }
.code-preflight { margin:18px 0;padding:15px 18px;border:1px solid #e8d9d2;border-radius:9px;background:#fdfaf8; }
.code-preflight h3 { margin:0 0 3px; }
.code-preflight .muted { margin:4px 0 10px; }
.code-preflight textarea { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.preflight-results { margin-top:8px;font-size:13px; }
.preflight-results p { margin:7px 0; }
@media(max-width:820px){.download-items { grid-template-columns:1fr;gap:5px; }}
/* Published stats and value definitions should be readable in one viewport. */
@media(min-width:920px){
 .var.has-approved-stats {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 18px;align-items:start}
 .var.has-approved-stats>.vartitle,.var.has-approved-stats>.variable-id,.var.has-approved-stats>.meta,
 .var.has-approved-stats>.stata-example-direct {grid-column:1/-1}
 .var.has-approved-stats>.values-direct {grid-column:1;grid-row:auto}
 .var.has-approved-stats>.distribution-slot {grid-column:2;grid-row:auto;margin-top:10px}
 .var.has-approved-stats .stat-row {grid-template-columns:minmax(80px,1.45fr) minmax(45px,1fr) minmax(100px,.9fr)}
}

/* V3.16 compatibility tester */
.compat-actions{display:flex;flex-wrap:wrap;gap:9px;margin:10px 0;}
.compat-actions button{flex:0 1 auto;}
.compat-result-log{max-height:380px;overflow:auto;white-space:pre;max-width:100%;font-size:12px;line-height:1.6;background:#f6f6f6;padding:12px;border:1px solid #ddd;border-radius:6px;}
@media(max-width:600px){.compat-actions button{flex:1 1 100%;}}

/* V3.17.1: download year navigation and admin-only synthetic workflow */
.download-filter-bar{margin:14px 0 10px;padding:15px 17px;background:#fbf9f7;border:1px solid #e9ddd7;border-radius:10px}
.download-filter-heading{display:flex;gap:10px;align-items:baseline;margin:0 0 10px;font-weight:600;font-size:14px}
.download-year-tabs{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.download-year-tab{padding:7px 12px;min-height:34px;border-radius:7px;background:#fff;border:1px solid #e3d8d1;color:#63383b;font-size:13px;font-weight:500}
.download-year-tab.active,.download-year-tab[aria-pressed="true"]{background:#713f43;color:white;border-color:#713f43}
.download-year-tab:focus-visible{outline:2px solid #35688a;outline-offset:2px}
.download-secondary-filter{margin-top:13px;display:flex;align-items:center;gap:10px;font-size:13px}
.download-secondary-filter label{margin:0;flex:none;font-weight:500}
.download-secondary-filter select{max-width:205px;min-width:160px;margin:0}
.downloads-library{gap:18px}
.download-year-group{display:grid;gap:10px}
.download-year-heading{display:flex;align-items:baseline;gap:12px;border-bottom:1px solid #e9ddd7;padding:10px 0 6px}
.download-year-heading h3{margin:0;color:#683037;font-size:19px}
.download-year-cards{display:grid;gap:12px}
.download-dataset h4{color:#683037;margin:0 0 4px;font-size:16px}
.download-empty{background:#fbf9f7;border:1px dashed #e0d1ca;padding:20px;border-radius:10px;color:#715e56}
.synthetic-admin{margin-top:0;border-top:0;padding-top:0}
@media(max-width:520px){.download-filter-bar{padding:12px}.download-year-tab{font-size:12px;padding:6px 10px}.download-items{gap:11px}.download-secondary-filter{flex-wrap:wrap}}

/* V3.17.2 — clear site-wide navigation and separated code workflows */
[hidden] { display:none !important; }
.portal-nav-shell {
  position:sticky;top:0;z-index:20;
  background:rgba(251,249,246,.98);
  border:1px solid #e8ded7;
  border-radius:8px;
  margin-bottom:18px;
  padding:9px 13px 6px;
  box-shadow:0 4px 16px rgba(61,32,31,.045);
}
.portal-main-bar {display:flex;align-items:center;gap:13px;min-width:0;}
.portal-nav-kicker {font-size:12px;font-weight:650;color:#91716b;white-space:nowrap;letter-spacing:.07em;}
#appSection #primaryNav {
  display:flex;flex:1;min-width:0;flex-wrap:nowrap;gap:4px;
  margin:0;padding:0;border:0;overflow-x:auto;scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
#appSection #primaryNav button {flex:none;white-space:nowrap;border-radius:6px;padding:9px 14px;margin:0;font-size:13px;}
#appSection #primaryNav button.active {border:1px solid #b98a82;background:#94070a;color:white;box-shadow:none;}
#appSection #primaryNav button:hover:not(.active) {background:#f6edeb;color:#7e151d;}
.admin-nav-group {margin:9px 0 0;border-top:1px solid #e9ddd7;}
.admin-nav-group>summary {
  width:max-content;cursor:pointer;list-style:none;user-select:none;
  padding:8px 12px 7px;font-size:12px;color:#674c4a;font-weight:700;
  border-radius:5px;
}
.admin-nav-group>summary::-webkit-details-marker{display:none;}
.admin-nav-group>summary span {font-size:12px;margin-left:4px;color:#9a827c;}
.admin-nav-group.admin-current>summary{color:#94070a;}
#appSection #adminNav {display:flex;flex-wrap:wrap;gap:3px;margin:0;padding:4px 0 7px;border:0;}
#appSection #adminNav button {border-radius:5px;padding:8px 12px;font-size:12px;}
#appSection #adminNav button.active {background:#f9ecea;color:#8b1019;border:1px solid #e9cbc6;box-shadow:none;}
.workflow-steps {display:grid;gap:14px;max-width:950px;}
.workflow-step {border:1px solid #e9dfd9;background:#fffefd;padding:19px 21px;border-radius:9px;min-width:0;}
.workflow-step-heading {display:flex;align-items:center;gap:10px;margin:0 0 14px;}
.workflow-step-heading h3 {margin:0;font-size:16px;color:#463234;}
.workflow-step-num {display:inline-flex;align-items:center;justify-content:center;flex:none;width:25px;height:25px;border-radius:50%;background:#f7e8e5;color:#911a22;font:700 12px Georgia,serif;}
.workflow-step>label {font-weight:550;}
.workflow-step select {max-width:560px;}
.compact-help {margin:0 0 7px;font-size:12px;line-height:1.7;}
.compat-input-switch {display:flex;gap:6px;border-bottom:1px solid #e9ddd7;padding-bottom:9px;margin-bottom:15px;}
#appSection .compat-input-switch button {padding:8px 15px;color:#654c4b;border-color:#e9dcd8;}
#appSection .compat-input-switch button.active {background:#94070a;color:white;border-color:#94070a;}
#compatText {width:100%;min-height:170px;resize:vertical;box-sizing:border-box;font:13px/1.75 ui-monospace,SFMono-Regular,Consolas,monospace;}
#compatFile {max-width:620px;}
.compat-primary-actions {margin:3px 0 12px;}
.compat-result-box:not(:empty){border:1px solid #e7d9d3;border-radius:7px;background:#fbf7f3;padding:11px 14px;margin-top:9px;overflow-wrap:anywhere;}
.compat-result-box .compat-result-log {margin:7px 0 4px;}
.compat-alternative {display:flex;align-items:center;gap:18px;justify-content:space-between;padding:19px 21px;background:#faf7f4;border:1px solid #e9ded8;border-radius:9px;margin:17px 0 10px;}
.compat-alternative h3 {margin:0 0 6px;color:#493133;}
.compat-alternative p {margin:0;max-width:700px;}
.compat-alternative button {flex:none;}
.compat-help {padding:9px 2px;margin:0 0 12px;color:#6b5351;font-size:12px;}
.compat-help>summary {cursor:pointer;font-weight:650;}
.compat-help p {padding:5px 0;}
.workflow-next,.formal-route-note {display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:15px 0 0;border-top:1px solid #eaddd7;padding:17px 2px 0;font-size:13px;color:#645452;}
.workflow-next button,.formal-route-note button {margin-left:auto;}
.formal-route-note {margin:0 0 20px;padding:15px 18px;border:1px solid #e5d9d2;border-left:3px solid #a66e67;background:#fbf7f3;border-radius:6px;}
.formal-route-note strong {font-size:13px;color:#513a3c;}
.formal-route-note span {font-size:12px;color:#746a66;}
.formal-submit-form {max-width:950px;}
.formal-submit-form .form-section-divider {padding-top:19px;margin-top:17px;border-top:1px solid #e8dfdc;}
.formal-confirm {margin:15px 0 17px;padding:12px 14px;background:#faf6f2;border-radius:6px;}
@media(max-width:780px) {
 .portal-nav-shell{top:0;padding:8px 10px 5px;}
 .portal-main-bar{display:block;}
 .portal-nav-kicker{display:block;margin:0 0 6px 5px;font-size:11px;}
 #appSection #primaryNav button{font-size:12px;padding:9px 12px;}
 .workflow-step{padding:15px 14px;}
 .compat-alternative{display:block;padding:16px;}
 .compat-alternative button{margin-top:13px;max-width:100%;white-space:normal;}
 .formal-route-note button,.workflow-next button{margin-left:0;}
}


/* ================================================================
   V3.17.3 — Editorial Academic Typography & Unified Visual System
   Visual-only release: no changes to JS, permissions, server or data.
   No web-font downloads: licensed fonts are resolved on the client.
   Latin: Candara first; Chinese display: serif; Chinese body: sans.
   ================================================================ */
:root {
  --type-body: "Candara", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --type-display: "Candara", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --type-mono: "Cascadia Code", "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
  --ui-text: #332f2f;
  --ui-heading: #302427;
  --ui-subtle: #69615e;
  --ui-border: #e9e1da;
  --ui-background: #faf8f5;
  --ui-panel: #ffffff;
  --ui-wash: #fcfaf8;
  --ui-focus: #94070a;
  --ui-radius: 12px;
}
html {font-size:16px; scroll-behavior:smooth;}
body { font-family:var(--type-body); font-size:14px; line-height:1.7; color:var(--ui-text); background:var(--ui-background); text-rendering:optimizeLegibility; }
button, input, select, textarea, option {font-family:var(--type-body);}
button, input, select, textarea {font-size:13.5px;}
button {font-weight:600; line-height:1.35; min-height:37px; border-radius:8px;}
button:not(:disabled):active {transform:translateY(1px);}
input, select, textarea {line-height:1.55; min-height:41px; border-radius:8px; background-color:#fff;}
input::placeholder,textarea::placeholder {color:#948883;opacity:1;}
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,summary:focus-visible {
 outline:2px solid var(--ui-focus); outline-offset:2px; box-shadow:0 0 0 4px rgba(148,7,10,.07);
}
label,.formlabel {color:#4b4140; font-weight:600; font-size:13px; letter-spacing:.008em;}
.muted {font-size:13px;line-height:1.75;color:var(--ui-subtle);}
.eyebrow,.access-kicker,.portal-nav-kicker {font-family:var(--type-body);font-weight:700;letter-spacing:.115em;}
h1,h2 {font-family:var(--type-display);font-weight:600;letter-spacing:.012em;line-height:1.43;color:var(--ui-heading);}
h3,h4 {font-family:var(--type-body);font-weight:700;letter-spacing:.018em;line-height:1.5;color:#4a3336;}
h1 {font-size:clamp(28px,3vw,38px);}
h2 {font-size:clamp(21px,2vw,25px);}
h3 {font-size:17px;}
p {line-height:1.8;}
code,pre,.stata-code,.compat-result-log,#compatText,.code-grant-panel textarea {font-family:var(--type-mono)!important;font-variant-ligatures:none;font-size:12.5px;}
code {overflow-wrap:anywhere;}
.tabular-nums,.stat-value,.stat-numbers,.metric-card strong,.service-no {font-variant-numeric:tabular-nums;}

/* Institutional masthead: the same Beida-red brand, clearer bilingual typography. */
.site-header {background:linear-gradient(108deg,#750711 0%,#900a13 56%,#a21d23 100%);border-bottom-width:2px;}
.site-header .header-inner {max-width:1190px;min-height:94px;}
.brand-copy {gap:3px;}
.brand-copy .org-name {font-size:12px;letter-spacing:.12em;font-family:var(--type-body);font-weight:650;}
.brand-copy .site-name {font-family:var(--type-display);font-size:21px;font-weight:650;line-height:1.35;letter-spacing:.018em;}
.brand-copy .english-name {font-family:var(--type-body);font-size:11px;letter-spacing:.055em;opacity:.94;}
.brand-mark span {font-family:var(--type-display);}
.site-header .header-actions button {min-height:35px;font-family:var(--type-body);font-size:12px;}
.site-header .identity {font-family:var(--type-body);}

/* Site containers and whitespace rhythm: one consistent reading width. */
main {max-width:1190px;margin:30px auto 0;padding:0 22px;}
.card {border:1px solid var(--ui-border);border-radius:var(--ui-radius);box-shadow:0 8px 27px rgba(59,34,29,.038);}
#appSection>.card {padding:32px clamp(20px,3vw,38px);}
#appSection>.card>section>.heading {margin-bottom:23px;padding-bottom:15px;border-bottom:1px solid #eee6e0;}
#appSection>.card>section>.heading h2 {font-size:24px;margin:0 0 7px;color:var(--ui-heading);}
#appSection>.card>section>.heading .muted {margin:3px 0 0;max-width:900px;line-height:1.8;}
#appSection .heading>button {flex-shrink:0;}
.separator-title {margin-top:27px;padding-top:24px;}

/* Navigation: stable, calm active state and discoverable keyboard focus. */
.portal-nav-shell {top:8px;padding:9px 14px 7px;background:rgba(253,251,248,.985);border-radius:10px;margin-bottom:19px;box-shadow:0 7px 23px rgba(81,46,38,.052);}
.portal-main-bar {gap:12px;}
.portal-nav-kicker {font-size:11px;white-space:nowrap;color:#88625f;}
#appSection #primaryNav {gap:4px;border:0;}
#appSection #primaryNav button {font-size:13.5px;padding:10px 15px;line-height:1.25;min-height:41px;font-weight:600;border:1px solid transparent;background:transparent;color:#594a48;border-radius:7px;}
#appSection #primaryNav button:hover:not(.active) {background:#f4ebe7;color:#811e25;}
#appSection #primaryNav button.active {background:#f4e9e6!important;color:#810e17!important;border:1px solid #ead1cc!important;border-bottom:2px solid #94070a!important;box-shadow:none;}
.admin-nav-group {margin-top:7px;border-top:1px solid #efe6e0;}
.admin-nav-group>summary {font-size:12px;font-weight:650;}
#appSection #adminNav button {font-size:12.5px;min-height:36px;}

/* Landing page keeps editorial serif headline, improves readable measures. */
.access-landing {margin:50px 0 70px;gap:clamp(30px,5vw,74px);}
.access-intro h1 {font-family:var(--type-display);font-weight:600;line-height:1.46;font-size:clamp(31px,3.3vw,44px);}
.access-summary {font-size:14.5px;line-height:2;max-width:540px;}
.access-services>div {font-size:14px;}
.access-card {border-radius:11px;padding:42px clamp(24px,3.3vw,44px);}
.access-card h2 {font-family:var(--type-display);font-weight:600;font-size:28px;}
.access-card input {font-family:var(--type-body);font-size:15px;}
.access-card .muted {line-height:1.85;}

/* Research dictionary: clear question hierarchy, low-friction scanning. */
.question-heading {padding:12px 15px;border-left-width:3px;border-radius:0 8px 8px 0;color:#78252b;}
.var {padding:17px 5px;border-bottom:1px solid #eee8e2;}
.var:hover {background:#fdfbf9;}
.var .vartitle {font-family:var(--type-body);font-size:14px;line-height:1.8;font-weight:600;}
.var .variable-id {margin-top:6px;gap:8px;}
.var .variable-id code {font-family:var(--type-mono)!important;letter-spacing:.015em;font-size:12px;}
.var .meta {font-size:12px;line-height:1.7;}
.values-direct,.distribution-slot {border-color:var(--ui-border);}
.values-direct>strong,.distribution-slot>strong,.stata-example-direct>strong {font-family:var(--type-body);font-size:12.5px;color:#714046;}
.values-table {font-family:var(--type-body);font-size:12.5px;}
.values-table td,.values-table th {padding:9px 11px;line-height:1.6;}
.values-table tbody tr:nth-child(even) {background:#fdfbf9;}
.values-table tbody tr:hover {background:#fbf2ed;}
.stat-row {font-family:var(--type-body);line-height:1.6;}
.stata-example-direct .stata-code {background:#f7f6f4;padding:12px 14px;line-height:1.65;border:1px solid #eee9e4;}

/* Download library: restrained year headings and consistent cards. */
.download-filter-bar {background:#faf7f3;border-color:#e9e0d8;border-radius:10px;padding:17px 19px;}
.download-filter-heading {font-size:14px;font-weight:700;}
.download-year-tabs {gap:8px;}
.download-year-tab {font-family:var(--type-body);font-weight:600;min-height:37px;padding:8px 13px;}
.download-year-tab.active,.download-year-tab[aria-pressed="true"] {background:#94070a;color:#fff;border-color:#94070a;}
.download-year-heading {padding:13px 0 8px;border-bottom:1px solid #e9ddd6;}
.download-year-heading h3 {font-family:var(--type-display);font-size:22px;font-weight:600;}
.download-dataset {background:#fff;border:1px solid var(--ui-border);border-radius:10px;padding:19px 21px;box-shadow:0 2px 12px rgba(80,50,40,.018);}
.download-dataset:hover {border-color:#d9c4bd;}
.download-dataset h4,.download-dataset h3 {font-family:var(--type-body);font-size:16px;font-weight:700;}
.download-item {gap:7px;}
.download-item button {font-size:13px;line-height:1.55;text-align:left;}
.download-item small {font-size:12px;}

/* Code validation steps, formal application and state panels. */
.workflow-steps {gap:14px;}
.workflow-step {background:#fff;border:1px solid var(--ui-border);border-radius:10px;padding:21px 23px;}
.workflow-step-heading {margin-bottom:15px;gap:11px;}
.workflow-step-heading h3 {font-family:var(--type-body);font-size:16px;font-weight:700;letter-spacing:.01em;}
.workflow-step-num {background:#f7ebe7;color:#84202a;font-family:var(--type-body);font-weight:700;}
.workflow-step label {font-size:13px;}
.compact-help {line-height:1.85;}
.compat-input-switch button {font-size:13px;}
#compatText {font:13px/1.75 var(--type-mono);background:#fffefd;min-height:172px;}
.compat-result-box:not(:empty) {background:#faf7f3;border-radius:9px;}
.compat-alternative {background:#fbf8f5;border-radius:10px;}
.compat-alternative h3 {font-size:15px;font-family:var(--type-body);}
.formal-route-note {border-left-color:#a75a59;}

/* Administration: give density without flattening hierarchy. */
.dashboard-section,.metric-card,.adminform,.code-grant-panel {border-radius:10px;background:#fefcfb;}
.dashboard-section h3,.adminform h3 {font-family:var(--type-body);font-size:16px;font-weight:700;}
.job,.keyrow,.request-record,.mail-record,.sample-admin-item,.overview-user,.overview-dataset,.overview-block {border-radius:9px;}
.permissions-tree details.group {border-radius:8px;}
.overview-user>summary,.overview-dataset>summary,.overview-block>summary {font-family:var(--type-body);font-weight:650;}
.contact-dialog h2 {font-family:var(--type-display);}
.site-footer {margin-top:36px;padding:29px 24px;}
.footer-inner {max-width:1190px;}
.footer-inner strong {font-family:var(--type-body);font-weight:700;}

/* Readability on medium/small screens. No sideways scrolling of the page. */
@media (max-width:920px) {
  #appSection>.card {padding:24px 21px;}
  #appSection>.card>section>.heading h2 {font-size:22px;}
  .portal-nav-shell {top:0;}
  .site-header .header-inner {min-height:88px;}
}
@media (max-width:720px) {
  body {font-size:14px;}
  main {margin:15px auto 0;padding:0 12px;}
  #appSection>.card {padding:21px 16px;}
  #appSection>.card>section>.heading {gap:10px;}
  .brand-copy .site-name {font-size:14px;}
  .brand-copy .english-name {font-size:9px;}
  .access-intro h1 {font-size:31px;}
  .access-landing {margin:25px 0 45px;}
  .portal-nav-shell {padding:8px 9px 6px;}
  #appSection #primaryNav button {font-size:12.5px;min-height:37px;padding:8px 11px;}
  .workflow-step {padding:16px 14px;}
  .download-filter-bar {padding:13px 12px;}
  .download-dataset {padding:15px;}
}
@media (max-width:420px) {
  .site-header .header-inner {min-height:72px;}
  .brand-copy .site-name {font-size:13px;letter-spacing:0;}
  .brand-copy .english-name {font-size:8px;}
  .brand-copy .org-name {font-size:10px;}
  .access-card {padding:29px 22px;}
  #appSection>.card>section>.heading h2 {font-size:20px;}
  .workflow-step-heading h3 {font-size:15px;}
}
@media (prefers-reduced-motion: reduce) {html {scroll-behavior:auto;}button:not(:disabled):active {transform:none;}}


/* V3.17.4 | Institutional user guide: guidance before complexity, without obstructing research work. */
.guide-overline {margin:0 0 9px;color:#9c4249;font-family:var(--type-body);font-size:11px;font-weight:700;letter-spacing:.13em;}
#guidePanel .guide-page-heading {margin-bottom:18px;}
.guide-introduction {max-width:920px;margin:0 0 24px;}
.guide-introduction h3 {font-family:var(--type-display);font-size:20px;font-weight:600;color:#432f31;margin:0 0 6px;}
.guide-introduction p {margin:0;color:#695d59;max-width:880px;font-size:13.5px;line-height:1.95;}
.guide-service-steps {list-style:none;counter-reset:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0;padding:0;}
.guide-service-steps>li {min-width:0;display:flex;gap:16px;background:#fff;border:1px solid #ebe2dc;border-radius:10px;padding:20px 20px 17px;}
.guide-service-steps>li:nth-child(5) {grid-column:1 / -1;}
.guide-step-mark {font-family:var(--type-body);font-size:17px;color:#a45b60;line-height:1.55;font-weight:700;min-width:25px;font-variant-numeric:tabular-nums;}
.guide-step-text {min-width:0;display:flex;align-items:flex-start;flex-direction:column;}
.guide-step-text h3 {font-size:16px;font-weight:700;margin:0 0 7px;color:#423434;}
.guide-step-text p {font-size:13px;line-height:1.85;color:#716862;margin:0 0 12px;}
#appSection .guide-link {border:0;border-bottom:1px solid #d7bcb5;border-radius:0;padding:4px 0;margin-top:auto;min-height:29px;background:transparent;color:#891922;font-size:12.5px;text-align:left;font-weight:700;}
#appSection .guide-link:hover {background:transparent;color:#5d0b12;border-color:#821722;}
.guide-step-actions {display:flex;align-items:center;gap:17px;flex-wrap:wrap;}
.guide-boundary {border-top:1px solid #eee4df;margin:27px 0 0;padding:20px 0 5px;}
.guide-boundary h3 {font-size:15px;margin:0 0 7px;}
.guide-boundary p {font-size:13px;color:#716560;line-height:1.9;margin:0;}
.guide-faq {margin:25px 0 0;max-width:960px;}
.guide-faq h3 {font-size:15px;margin:0 0 10px;}
.guide-faq details {border-top:1px solid #eee5df;padding:10px 0;}
.guide-faq summary {cursor:pointer;color:#493737;font-size:13.5px;font-weight:600;}
.guide-faq details p {color:#736864;font-size:13px;line-height:1.8;margin:7px 0 2px;}
.portal-guide-teaser {display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 17px;margin-bottom:22px;border:1px solid #ede2db;border-radius:9px;background:#fcfaf7;}
.portal-guide-teaser-copy {display:flex;gap:7px;align-items:baseline;flex-wrap:wrap;line-height:1.75;}
.portal-guide-teaser-copy strong {font-size:13px;color:#503b3e;white-space:nowrap;}
.portal-guide-teaser-copy span {font-size:12.5px;color:#756861;}
#appSection #openGuideFromDictionary {flex:none;border:1px solid #e4c9c2;color:#841720;border-radius:6px;background:#fff;padding:7px 12px;min-height:34px;font-size:12px;}
#appSection #openGuideFromDictionary:hover {background:#f9eeea;}
@media (max-width:780px) {
  .guide-service-steps {grid-template-columns:1fr;}
  .guide-service-steps>li:nth-child(5) {grid-column:auto;}
}
@media (max-width:560px) {
  .guide-service-steps>li {padding:16px 13px;gap:10px;}
  .guide-step-text h3 {font-size:15px;}
  .portal-guide-teaser {align-items:flex-start;flex-direction:column;gap:9px;padding:12px 13px;}
  .guide-introduction h3 {font-size:18px;}
}

/* V3.17.5 Content management: text-only, desktop and mobile responsive. */
.cms-announcement{padding:15px 19px;border:1px solid #e7d2c4;border-left:4px solid #94070a;border-radius:10px;background:#fffaf2;margin:14px 0 0;box-shadow:0 2px 8px rgba(93,29,30,.03)}
.cms-announcement strong{color:#862326;font-size:15px}.cms-announcement p{margin:7px 0 0;color:#514a4b;font-size:13px;line-height:1.85;white-space:pre-line}
#cmsHomeTitle{white-space:pre-line}
.cms-layout{display:grid;grid-template-columns:minmax(190px,230px) minmax(0,1fr);gap:26px;align-items:start;margin-top:20px}
.cms-sidebar{padding:18px;background:#f9f6f2;border:1px solid #eae2db;border-radius:12px;position:sticky;top:126px}
.cms-sidebar h3{font-size:15px;margin:0 0 14px}.cms-sidebar select{width:100%}.cms-sidebar label{font-weight:600}
.cms-editor-help{font-size:12px;color:#6d6663;line-height:1.8;margin-top:17px}
.cms-editor{min-width:0}.cms-editor form>label{display:block}.cms-editor textarea{min-height:112px;white-space:pre-wrap}
.cms-editor label input,.cms-editor label textarea{width:100%}
.cms-actions,.cms-items-header{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.cms-actions{justify-content:flex-start;margin-top:14px}.cms-actions button:disabled{opacity:.52;cursor:not-allowed}
.cms-item{border:1px solid #e3e3df;background:#fcfbf8;border-radius:9px;padding:14px 16px;margin:12px 0}
.cms-item label{font-weight:600;font-size:12px;display:block}.cms-item input{font-weight:400}.cms-item textarea{min-height:66px;font-weight:400}
.cms-remove-item{border-color:#d9b8b8;color:#8c3b3b}
.cms-preview,.cms-history{margin-top:26px;border-top:1px solid #e6e0d9;padding-top:18px}
.cms-preview h3{font-family:'Noto Serif CJK SC','Songti SC','SimSun',serif;font-size:19px;margin:14px 0}
.cms-preview p,.cms-preview-item p{font-size:13px;line-height:1.85;white-space:pre-line}
.cms-preview-item{margin-top:12px;border-left:2px solid #cfb7b0;padding:3px 0 3px 12px}
.cms-preview-item strong{font-size:13px}
.cms-history-row{border-bottom:1px solid #ebe6df;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;font-size:12px;color:#746965}
.cms-history-row button{font-size:12px;white-space:nowrap}
#cmsVersion{margin-top:14px;font-size:12px}
#cmsVisibleWrap{margin-top:14px;font-weight:600}
@media(max-width:850px){.cms-layout{grid-template-columns:1fr;gap:16px}.cms-sidebar{position:static;padding:13px 15px}}
@media(max-width:550px){.cms-actions button{flex:1}.cms-history-row{align-items:flex-start;flex-direction:column}.cms-history-row button{width:100%}}

/* V3.17.6 · Administrator-published accessible typography presets. */
:root[data-font-theme="classic"], .cms-font-sample[data-font-theme="classic"]{
 --type-body:"Candara","Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif;
 --type-display:"Candara","Source Han Serif SC","Noto Serif CJK SC","Songti SC","SimSun",serif;
}
:root[data-font-theme="balanced"], .cms-font-sample[data-font-theme="balanced"]{
 --type-body:"Candara","Segoe UI","PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
 --type-display:"Candara","Microsoft YaHei UI","PingFang SC","Noto Sans CJK SC",sans-serif;
}
:root[data-font-theme="modern"], .cms-font-sample[data-font-theme="modern"]{
 --type-body:"Segoe UI","Candara","PingFang SC","Microsoft YaHei",sans-serif;
 --type-display:"Segoe UI","Candara","PingFang SC","Microsoft YaHei",sans-serif;
}
/* Code stays monospaced regardless of global theme. */
.login-method{display:flex;gap:6px;margin:16px 0 20px;border-bottom:1px solid #eadfda}
.login-method button{flex:1;background:transparent;border:0;border-bottom:3px solid transparent;color:#695d59;border-radius:0;padding:10px 6px}
.login-method button.selected{border-bottom-color:#94070a;color:#94070a;font-weight:700}
#emailLoginForm label,#resetForm label{display:block;margin:10px 0 7px}
#emailLoginForm input,#resetForm input{width:100%;margin:0 0 10px}
#emailLoginForm .text-link{margin-top:12px}
.reset-inline{margin-top:16px;border-top:1px solid #eadfda;padding-top:16px}
#accountPanel{max-width:900px}
#accountPanel form{max-width:720px;margin:14px 0 25px}
#accountPanel label{display:block;margin-bottom:12px}
#accountPanel label input,#accountPanel label select{display:block;width:100%;margin-top:7px}
.account-fields{display:grid;grid-template-columns:1fr 2fr;gap:16px}
.account-summary{background:#f9f4f1;border-left:3px solid #94070a;padding:12px 16px;line-height:1.8;margin:12px 0 20px}
.account-password{padding:16px;border:1px solid #e9dcd5;border-radius:10px;margin:22px 0}
.account-password summary{cursor:pointer;font-weight:650}
.account-verify{padding:14px;border:1px solid #e7dbd3;border-radius:9px}
.cms-font-sample{padding:15px;background:#f9f6f1;border-radius:8px;border:1px solid #eadfd7}
.cms-font-sample h3{font-family:var(--type-display);font-size:21px}
.cms-font-sample p{font-family:var(--type-body)}
@media(max-width:600px){.account-fields{grid-template-columns:1fr}.login-method button{font-size:12px}}

/* Keep visual headings in the chosen preset despite legacy selector overrides. */
h1,h2,.access-intro h1,.access-card h2,.brand-copy .site-name,#appSection .heading h2,
.guide-introduction h3,.contact-dialog-head h2,.cms-preview h3{font-family:var(--type-display)!important}


/* V3.17.7 · Administratively controlled, strictly bounded custom typography.
   All fallbacks are system fonts. No arbitrary CSS from the CMS is injected.
   Presets from V3.17.6 are unchanged. */
.cms-font-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;margin:15px 0}
.cms-font-field{display:block;font-size:12px;font-weight:600}
.cms-font-field select,.cms-font-field input{display:block;width:100%;margin:6px 0 0;background:#fff}
.cms-font-custom{padding:15px 18px;border:1px solid #e8ded7;background:#fbf9f6;border-radius:10px;margin:10px 0 16px}
.cms-font-custom .muted{margin:8px 0}
.cms-font-custom button{margin-top:6px}
.cms-font-sample h2{font-family:var(--type-display)!important;font-size:24px;margin:0 0 9px}
.cms-font-sample h3{font-family:var(--type-display)!important}
.cms-font-preview-nav{border-top:1px solid #e9dcd5;border-bottom:1px solid #e9dcd5;padding:12px 0;font-size:13px;margin-top:14px}
.cms-font-preview-table{font-size:13px;padding:9px 12px;margin:12px 0;background:#fff;border:1px solid #e8ded7;border-radius:7px}
.cms-font-preview-control{margin:6px 0;background:#f4e8e6;color:#78232b}
@media(max-width:700px){.cms-font-fields{grid-template-columns:1fr}}
/* Preview and published site share the same CSS variables. */
:root[data-font-theme="custom"] body {font-family:var(--type-body);font-size:var(--custom-body-size,15px);font-weight:var(--custom-body-weight,400);line-height:var(--custom-body-leading,1.8)}
:root[data-font-theme="custom"] p,:root[data-font-theme="custom"] .muted{line-height:var(--custom-body-leading,1.8)}
:root[data-font-theme="custom"] h1,:root[data-font-theme="custom"] .access-intro h1{font-family:var(--type-display)!important;font-size:var(--custom-h1-size,34px);font-weight:var(--custom-title-weight,600);line-height:var(--custom-heading-leading,1.45);letter-spacing:var(--custom-letter-space,.1px)}
:root[data-font-theme="custom"] h2,:root[data-font-theme="custom"] .brand-copy .site-name,:root[data-font-theme="custom"] #appSection .heading h2{font-family:var(--type-display)!important;font-size:var(--custom-h2-size,24px);font-weight:var(--custom-title-weight,600);line-height:var(--custom-heading-leading,1.45);letter-spacing:var(--custom-letter-space,.1px)}
:root[data-font-theme="custom"] h3,:root[data-font-theme="custom"] h4{font-family:var(--type-display)!important;font-size:var(--custom-h3-size,17px);font-weight:var(--custom-title-weight,600);line-height:var(--custom-heading-leading,1.45)}
:root[data-font-theme="custom"] .portal-nav-shell button,:root[data-font-theme="custom"] #appSection #primaryNav button,:root[data-font-theme="custom"] #appSection #adminNav button{font-family:var(--type-body);font-size:var(--custom-nav-size,14px)}
:root[data-font-theme="custom"] table,:root[data-font-theme="custom"] th,:root[data-font-theme="custom"] td{font-family:var(--type-body);font-size:var(--custom-table-size,13px)}
:root[data-font-theme="custom"] button,:root[data-font-theme="custom"] input,:root[data-font-theme="custom"] select,:root[data-font-theme="custom"] textarea,:root[data-font-theme="custom"] label{font-family:var(--type-body);font-size:var(--custom-control-size,14px)}
/* Preview mirrors the editable categories without affecting the live page. */
.cms-font-sample[data-font-theme="custom"] {font-family:var(--type-body);font-size:var(--custom-body-size,15px);font-weight:var(--custom-body-weight,400);line-height:var(--custom-body-leading,1.8)}
.cms-font-sample[data-font-theme="custom"] h2{font-size:var(--custom-h1-size,34px);font-weight:var(--custom-title-weight,600);line-height:var(--custom-heading-leading,1.45);letter-spacing:var(--custom-letter-space,.1px)}
.cms-font-sample[data-font-theme="custom"] h3{font-size:var(--custom-h3-size,17px);font-weight:var(--custom-title-weight,600);line-height:var(--custom-heading-leading,1.45)}
.cms-font-sample[data-font-theme="custom"] .cms-font-preview-nav{font-family:var(--type-body);font-size:var(--custom-nav-size,14px)}
.cms-font-sample[data-font-theme="custom"] .cms-font-preview-table{font-family:var(--type-body);font-size:var(--custom-table-size,13px)}
.cms-font-sample[data-font-theme="custom"] .cms-font-preview-control{font-family:var(--type-body);font-size:var(--custom-control-size,14px)}
/* Monospaced code is never subject to the custom typography. */
:root[data-font-theme="custom"] pre,:root[data-font-theme="custom"] code,:root[data-font-theme="custom"] .stata-code,:root[data-font-theme="custom"] .compat-result-log,:root[data-font-theme="custom"] #compatText,:root[data-font-theme="custom"] .code-grant-panel textarea{font-family:var(--type-mono)!important}

/* V3.17.8 restricted cleanup controls */
.cleanup-controls,.cleanup-user-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 0}
.cleanup-controls small,.cleanup-user-actions small{line-height:1.5}
.overview-line .cleanup-mini{padding:4px 9px;margin:0 0 0 10px;font-size:12px}
.overview-line small{display:block;line-height:1.5;margin-top:4px}
.cleanup-user-actions button{font-size:12px}
@media(max-width:600px){.cleanup-controls,.cleanup-user-actions{display:block}.cleanup-user-actions button{margin-bottom:7px}}

/* V3.17.10 explicit, masked administrator credential reconfirmation */
.admin-reauth-dialog{border:1px solid #d6d0cc;border-radius:12px;max-width:min(92vw,480px);width:100%;padding:22px;background:#fff;color:#233}.admin-reauth-dialog::backdrop{background:rgba(20,25,33,.55)}
.admin-reauth-dialog label{line-height:1.6}.admin-reauth-dialog input{margin-top:12px;width:100%}
.key-disclosure{overflow-wrap:anywhere}
