:root{
  --tera-navy:#0b2b49;--tera-navy-2:#102f4d;--tera-navy-3:#173c61;--tera-gold:#c99721;--tera-gold-2:#e2b94f;
  --tera-ink:#0a2748;--tera-text:#31475f;--tera-muted:#66778b;--tera-line:#d6e1eb;--tera-line-strong:#b9c9d8;
  --tera-surface:#ffffff;--tera-surface-soft:#f6f9fc;--tera-surface-warm:#fffaf0;--tera-bg:#edf3f8;
  --tera-good:#127a53;--tera-warn:#a46c00;--tera-danger:#a7352d;--tera-shadow:0 14px 38px rgba(7,35,63,.10);
  --tera-shadow-soft:0 7px 22px rgba(7,35,63,.07);--tera-radius:18px;--tera-radius-sm:12px;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--tera-bg);color:var(--tera-text);font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:18px;line-height:1.55}
body[data-theme="dark"]{--tera-ink:#f4f7fb;--tera-text:#d8e4ef;--tera-muted:#a9b9c8;--tera-line:#35516c;--tera-line-strong:#496681;--tera-surface:#0c2237;--tera-surface-soft:#102a43;--tera-surface-warm:#2b2619;--tera-bg:#071828;--tera-shadow:0 16px 42px rgba(0,0,0,.28);--tera-shadow-soft:0 8px 24px rgba(0,0,0,.22)}
button,input,select,textarea{font:inherit}a{color:#0b5fa5}.hidden{display:none!important}

/* Canonical premium shell */
.brand-masthead{background:linear-gradient(108deg,#092744 0%,#0d3458 65%,#123e64 100%)!important;color:#fff!important;border-bottom:1px solid rgba(226,185,79,.75)!important;box-shadow:none!important}
.brand-masthead-inner{max-width:none!important;width:100%!important;min-height:70px!important;padding:10px 28px!important;display:grid!important;grid-template-columns:minmax(320px,1fr) auto minmax(320px,1fr)!important;align-items:center!important;gap:24px!important}
.masthead-emblem{width:46px!important;height:46px!important;border-radius:50%!important;border:2px solid var(--tera-gold-2)!important;background:#102b48!important;box-shadow:0 0 0 5px rgba(226,185,79,.08)!important;color:#f7d46f!important;display:grid!important;place-items:center!important;font-family:Georgia,serif!important;font-weight:800!important;font-size:23px!important}
.masthead-identity{display:flex!important;align-items:center!important;gap:14px!important;min-width:0!important}.masthead-title-row{display:flex!important;align-items:center!important;gap:9px!important;flex-wrap:wrap!important}.masthead-title{font-family:Georgia,"Times New Roman",serif!important;font-size:29px!important;letter-spacing:.1px!important;color:#fff!important}.masthead-subtitle{display:block!important;color:#cbd9e6!important;font-size:16px!important;white-space:nowrap!important}.version-badge,.service-badge{border-radius:999px!important;border:1px solid #67809a!important;padding:4px 9px!important;background:#173955!important;color:#eaf3f9!important;font-size:13px!important;font-weight:800!important}.service-badge.connected,.service-badge.ok{border-color:#3d8b71!important;background:#123d33!important;color:#b9f1da!important}
.masthead-context{justify-self:end!important;text-align:right!important;color:#d7e2ec!important;font-size:14px!important;line-height:1.45!important}.masthead-context strong{display:block!important;color:#f1c95a!important;font-size:14px!important}.masthead-context span{font-weight:700!important}
.product-navbar{position:sticky!important;top:0!important;z-index:60!important;background:#10263c!important;border-bottom:1px solid #2f4b65!important;box-shadow:0 8px 24px rgba(5,27,48,.12)!important}.product-navbar-inner{max-width:none!important;width:100%!important;min-height:58px!important;padding:0 28px!important}.corporate-home,.product-nav-link,.nav-utility-link{color:#edf4fa!important}.product-nav-link{min-height:58px!important;padding:0 15px!important;border:0!important;border-bottom:3px solid transparent!important;background:transparent!important;font-weight:750!important;font-size:16px!important}.product-nav-link:hover,.product-nav-link:focus{background:#173b5e!important}.product-nav-link.active{background:#132f4a!important;border-bottom-color:var(--tera-gold-2)!important;color:#fff7d5!important}.nav-primary{background:linear-gradient(180deg,#d6a91f,#bd8f11)!important;border:1px solid #e5bd4b!important;color:#10223a!important;border-radius:11px!important;min-height:42px!important;padding:0 18px!important;font-weight:850!important;box-shadow:0 6px 16px rgba(161,112,0,.20)!important}.nav-icon-button,.nav-theme-toggle,.quiet-link{min-height:40px!important;border:1px solid #45647f!important;border-radius:10px!important;background:#16334f!important;color:#eef5fb!important;padding:7px 11px!important}.nav-theme-toggle{cursor:pointer;font-weight:800!important}.language-switch button{color:#dce7f1!important}.language-switch button.active{color:#f1c75b!important}
.app-shell,.main-shell{background:var(--tera-bg)!important}.page-container{max-width:1480px!important;margin:0 auto!important;padding:34px 34px 54px!important}.view{min-height:calc(100vh - 190px)}
.page-heading{max-width:930px!important;margin-bottom:28px!important}.page-heading .eyebrow,.eyebrow,.panel-kicker{letter-spacing:1.6px!important;text-transform:uppercase!important;font-size:13px!important;font-weight:850!important;color:#a86e00!important}.page-heading h1,.hero-copy h1{font-family:Georgia,"Times New Roman",serif!important;color:var(--tera-ink)!important;letter-spacing:-.7px!important;line-height:1.04!important}.page-heading h1{font-size:48px!important;margin:8px 0 14px!important}.page-heading p,.hero-lead{font-size:19px!important;color:var(--tera-text)!important;max-width:900px!important}
.panel,.assurance-card,.document-upload-card,.choice-card,.settings-card{background:var(--tera-surface)!important;border:1px solid var(--tera-line)!important;border-radius:var(--tera-radius)!important;box-shadow:var(--tera-shadow-soft)!important}.panel{padding:24px!important}.panel h2,.panel h3{font-family:Georgia,"Times New Roman",serif!important;color:var(--tera-ink)!important}.panel h2{font-size:29px!important}.panel h3{font-size:23px!important}.boundary-box{background:var(--tera-surface-warm)!important;border:1px solid #e6cf95!important;border-left:4px solid var(--tera-gold)!important;border-radius:12px!important;color:var(--tera-text)!important;padding:16px 17px!important}.boundary-box strong{color:var(--tera-ink)!important}
.field span{font-weight:800!important;color:var(--tera-ink)!important}.field input,.field select,.field textarea{width:100%!important;min-height:52px!important;border:1px solid var(--tera-line-strong)!important;border-radius:11px!important;background:var(--tera-surface)!important;color:var(--tera-ink)!important;padding:12px 14px!important;box-shadow:inset 0 1px 1px rgba(8,40,70,.02)!important}.field input:focus,.field select:focus,.field textarea:focus{outline:none!important;border-color:#2c75b5!important;box-shadow:0 0 0 3px rgba(44,117,181,.14)!important}.button{min-height:46px!important;border-radius:11px!important;font-weight:800!important;padding:10px 18px!important}.button.primary{background:#0b3155!important;border:1px solid #0b3155!important;color:#fff!important;box-shadow:0 6px 16px rgba(10,49,85,.16)!important}.button.primary:hover{background:#123f68!important}.button.secondary{background:var(--tera-surface)!important;border:1px solid #9eb5c9!important;color:var(--tera-ink)!important}.button.ghost{background:transparent!important;border:1px solid var(--tera-line)!important;color:var(--tera-text)!important}
.footer{max-width:none!important;width:100%!important;background:#0b2742!important;color:#d8e3ed!important;border-top:1px solid rgba(226,185,79,.6)!important;padding:22px 30px!important}.footer span:last-child{color:#f0c75b!important;font-weight:800!important}

/* Profile experience */
.profile-heading{display:flex!important;justify-content:space-between!important;gap:22px!important;align-items:flex-end!important;max-width:none!important}.profile-heading-copy{max-width:820px}.profile-heading-actions{display:flex;gap:10px;flex-wrap:wrap}.profile-shell{display:grid;grid-template-columns:272px minmax(0,1fr) 306px;gap:20px;align-items:start}.profile-left-rail,.profile-right-rail{position:sticky;top:88px}.profile-main{min-width:0;display:flex;flex-direction:column;gap:18px}.profile-card{background:var(--tera-surface);border:1px solid var(--tera-line);border-radius:18px;box-shadow:var(--tera-shadow-soft);padding:22px}.profile-identity-card{text-align:center;padding:26px 20px}.profile-avatar{width:92px;height:92px;border-radius:50%;display:grid;place-items:center;margin:0 auto 14px;background:linear-gradient(145deg,#0b3155,#174f7c);border:3px solid #e5bc4c;box-shadow:0 0 0 7px rgba(229,188,76,.10);overflow:hidden;color:#fff;font-family:Georgia,serif;font-size:34px;font-weight:800}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-person-name{font-family:Georgia,"Times New Roman",serif;font-size:26px;line-height:1.15;color:var(--tera-ink);margin:8px 0 4px}.profile-person-email{color:var(--tera-muted);font-size:15px;overflow-wrap:anywhere}.profile-person-meta{color:var(--tera-text);font-size:15px;margin-top:8px}.profile-badges{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;margin:14px 0 0}.profile-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:6px 10px;font-size:13px;font-weight:800;border:1px solid var(--tera-line);background:var(--tera-surface-soft);color:var(--tera-text)}.profile-badge.connected{background:#e9f8f2;border-color:#99d5bd;color:#176348}.profile-badge.tester{background:#fff7df;border-color:#e1c46e;color:#7b5600}body[data-theme="dark"] .profile-badge.connected{background:#12382f;border-color:#326b59;color:#bcebd8}body[data-theme="dark"] .profile-badge.tester{background:#3a3119;border-color:#8d762b;color:#ffe8a0}
.profile-nav{display:flex;flex-direction:column;gap:7px;margin-top:20px}.profile-nav button{width:100%;text-align:left;border:1px solid transparent;background:transparent;border-radius:10px;padding:11px 12px;color:var(--tera-text);font-weight:750;cursor:pointer}.profile-nav button:hover,.profile-nav button.active{background:var(--tera-surface-soft);border-color:var(--tera-line);color:var(--tera-ink)}.profile-nav button.active{box-shadow:inset 3px 0 0 var(--tera-gold)}
.profile-section{scroll-margin-top:92px}.profile-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:18px}.profile-section-head h2{margin:4px 0 5px}.profile-section-head p{margin:0;color:var(--tera-muted);font-size:16px}.profile-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.profile-form-grid .full{grid-column:1/-1}.profile-save-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:18px;padding-top:18px;border-top:1px solid var(--tera-line)}.profile-save-note{font-size:14px;color:var(--tera-muted);max-width:560px}
.profile-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.profile-stat{background:var(--tera-surface-soft);border:1px solid var(--tera-line);border-radius:13px;padding:13px}.profile-stat strong{display:block;color:var(--tera-ink);font-size:25px;line-height:1}.profile-stat span{display:block;color:var(--tera-muted);font-size:13px;margin-top:7px}.profile-context-title{font-weight:850;color:var(--tera-ink);margin-bottom:10px}.profile-context-list{display:flex;flex-direction:column;gap:10px}.profile-context-item{border:1px solid var(--tera-line);border-radius:13px;background:var(--tera-surface);padding:14px}.profile-context-item strong{display:block;color:var(--tera-ink);font-size:15px;margin-bottom:4px}.profile-context-item span{display:block;color:var(--tera-muted);font-size:14px}.profile-assurance-list{display:grid;gap:8px}.profile-assurance-row{display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:start}.profile-assurance-mark{width:26px;height:26px;border-radius:50%;background:#0f684b;color:#fff;display:grid;place-items:center;font-size:13px;font-weight:900}.profile-assurance-row strong{display:block;color:var(--tera-ink);font-size:15px}.profile-assurance-row span{display:block;color:var(--tera-muted);font-size:13px}.profile-local-boundary{margin-top:12px}.profile-mini-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.profile-mini-actions .button{min-height:38px;padding:7px 11px;font-size:14px}.profile-access-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}.profile-security-card{background:var(--tera-surface-soft);border:1px solid var(--tera-line);border-radius:14px;padding:16px}.profile-security-card strong{display:block;color:var(--tera-ink);margin-bottom:5px}.profile-security-card span{display:block;color:var(--tera-muted);font-size:14px}.profile-advanced{margin-top:14px}

/* General premium refinement */
.metric-grid,.dashboard-grid,.card-grid{gap:18px!important}.hero-grid{gap:34px!important}.hero-trust-strip{border:1px solid var(--tera-line)!important;background:var(--tera-surface)!important;border-radius:15px!important;box-shadow:var(--tera-shadow-soft)!important}.hero-trust-strip span{padding:14px!important}.request-list>*{border-radius:14px!important}.table-wrap{border-radius:14px!important;overflow:auto!important}.global-notice{max-width:1480px!important;margin:14px auto 0!important;border-radius:12px!important}

/* Responsive */
@media(max-width:1250px){.brand-masthead-inner{grid-template-columns:minmax(300px,1fr) auto!important}.masthead-context{display:none!important}.profile-shell{grid-template-columns:235px minmax(0,1fr)}.profile-right-rail{display:none}.page-container{padding-left:24px!important;padding-right:24px!important}}
@media(max-width:900px){body{font-size:17px}.brand-masthead-inner{display:flex!important;padding:9px 16px!important}.masthead-subtitle{display:none!important}.desktop-product-nav{overflow-x:auto!important}.profile-shell{display:block}.profile-left-rail{position:static;margin-bottom:16px}.profile-identity-card{text-align:left;display:grid;grid-template-columns:74px 1fr;gap:14px;align-items:center}.profile-avatar{width:68px;height:68px;margin:0}.profile-identity-content{min-width:0}.profile-badges{justify-content:flex-start}.profile-nav{display:flex;flex-direction:row;overflow-x:auto;grid-column:1/-1}.profile-nav button{min-width:max-content}.profile-form-grid,.profile-access-grid{grid-template-columns:1fr}.profile-heading{display:block!important}.profile-heading-actions{margin-top:14px}.page-heading h1{font-size:40px!important}}
@media(max-width:600px){.page-container{padding:22px 14px 40px!important}.brand-masthead-inner{padding:8px 12px!important}.masthead-title{font-size:23px!important}.masthead-emblem{width:40px!important;height:40px!important}.product-navbar-inner{padding:0 12px!important}.topbar-actions{gap:6px!important}.quiet-link{display:none!important}.nav-theme-toggle{padding:6px 9px!important}.page-heading h1{font-size:34px!important}.profile-card{padding:17px}.profile-form-grid{gap:12px}.profile-stats{grid-template-columns:1fr 1fr}}

/* v0.7.5.1 canonical TeraSystemsAI premium masthead */
.brand-masthead-inner{grid-template-columns:minmax(330px,1fr) minmax(430px,1.25fr) minmax(310px,1fr)!important;}
.masthead-brand-cluster{display:flex;align-items:center;gap:14px;min-width:0}.masthead-brand-cluster .masthead-emblem{flex:0 0 auto}.masthead-brand-cluster .masthead-identity{min-width:0}
.masthead-principles{justify-self:center;display:flex;align-items:center;gap:12px;white-space:nowrap;color:#edf4fa;font-size:15px;font-weight:800}.masthead-principles strong{font-family:Georgia,"Times New Roman",serif;color:#f0c75b;font-size:18px;letter-spacing:2px}.masthead-motto{justify-self:end;white-space:nowrap;font-family:Georgia,"Times New Roman",serif;font-style:italic;font-weight:800;color:#f0c75b;font-size:17px}
body[data-theme="dark"] .brand-masthead,body[data-theme="dark"] .product-navbar{box-shadow:none!important}
@media(max-width:1350px){.brand-masthead-inner{grid-template-columns:minmax(330px,1fr) auto!important}.masthead-principles{display:none}.masthead-motto{justify-self:end}}
@media(max-width:900px){.masthead-brand-cluster{display:flex;align-items:center;gap:10px}.masthead-motto{display:none}.brand-masthead-inner{display:flex!important;justify-content:space-between!important}.masthead-title-row{gap:6px!important}}
/* Premium dark-mode coverage for legacy workflow surfaces */
body[data-theme="dark"] .assurance-method-card,body[data-theme="dark"] .technical-details,body[data-theme="dark"] .advanced-panel,body[data-theme="dark"] .request-card,body[data-theme="dark"] .document-card,body[data-theme="dark"] .partner-card,body[data-theme="dark"] .participant-card,body[data-theme="dark"] .timeline-item,body[data-theme="dark"] .verification-layer,body[data-theme="dark"] .metric-card,body[data-theme="dark"] .form-card,body[data-theme="dark"] .remote-status-card,body[data-theme="dark"] .document-review-box,body[data-theme="dark"] .document-preview-confirm{background:var(--tera-surface)!important;border-color:var(--tera-line)!important;color:var(--tera-text)!important;box-shadow:none!important}
body[data-theme="dark"] .detail-list>div,body[data-theme="dark"] .service-list>div,body[data-theme="dark"] .principle-list>div,body[data-theme="dark"] .technical-grid>*,body[data-theme="dark"] .request-card-meta,body[data-theme="dark"] .request-meta{border-color:var(--tera-line)!important;color:var(--tera-text)!important}
body[data-theme="dark"] .hero-note,body[data-theme="dark"] .small,body[data-theme="dark"] small,body[data-theme="dark"] .muted{color:var(--tera-muted)!important}
body[data-theme="dark"] .profile-security-card,body[data-theme="dark"] .profile-stat,body[data-theme="dark"] .profile-context-item{background:var(--tera-surface-soft)!important}
.admin-users-table{min-width:1280px!important}

/* v0.7.6.2 unified governance baseline */


/* v0.7.6.2 — governed theme integrity
   Brand masthead/navigation remain intentionally dark in both themes.
   All workspace surfaces, text, inputs, evidence cards, dialogs, and status
   treatments follow the selected Light/Dark theme without mixed-mode leakage. */
body[data-theme="light"]{
  --tera-ink:#0a2748;--tera-text:#31475f;--tera-muted:#66778b;--tera-line:#d6e1eb;--tera-line-strong:#b9c9d8;
  --tera-surface:#ffffff;--tera-surface-soft:#f6f9fc;--tera-surface-warm:#fffaf0;--tera-bg:#edf3f8;
}
body[data-theme="dark"]{
  --tera-ink:#f4f7fb;--tera-text:#d8e4ef;--tera-muted:#a9b9c8;--tera-line:#35516c;--tera-line-strong:#496681;
  --tera-surface:#0c2237;--tera-surface-soft:#102a43;--tera-surface-warm:#2b2619;--tera-bg:#071828;
}
html[data-theme="dark"],html[data-theme="dark"] body{background:#071828;color:#d8e4ef;color-scheme:dark}
html[data-theme="light"],html[data-theme="light"] body{background:#edf3f8;color:#31475f;color-scheme:light}

/* Workspace typography must never inherit legacy navy in Dark mode. */
body[data-theme="dark"] .view :is(h1,h2,h3,h4),
body[data-theme="dark"] .request-card-main h3,
body[data-theme="dark"] .request-card-side strong,
body[data-theme="dark"] .detail-list strong,
body[data-theme="dark"] .time-strip strong,
body[data-theme="dark"] .partner-stats strong,
body[data-theme="dark"] .timeline-item strong,
body[data-theme="dark"] .compact-row strong,
body[data-theme="dark"] .empty-state strong,
body[data-theme="dark"] .tera-commitment strong,
body[data-theme="dark"] .choice-copy strong,
body[data-theme="dark"] .hash-preview strong,
body[data-theme="dark"] .technical-details strong,
body[data-theme="dark"] .technical-grid strong,
body[data-theme="dark"] .service-list strong,
body[data-theme="dark"] .principle-list strong,
body[data-theme="dark"] .review-partner strong,
body[data-theme="dark"] .preview-placeholder strong,
body[data-theme="dark"] .access-code-card strong,
body[data-theme="dark"] .assurance-method-card strong,
body[data-theme="dark"] .supported-format-note strong,
body[data-theme="dark"] .document-upload-title,
body[data-theme="dark"] .document-preparation-heading h3,
body[data-theme="dark"] .document-preparation-summary strong,
body[data-theme="dark"] .document-word-note strong,
body[data-theme="dark"] .verification-layer>div:last-child,
body[data-theme="dark"] .field,
body[data-theme="dark"] .check-field{color:var(--tera-ink)!important}
body[data-theme="dark"] .view :is(p,li),
body[data-theme="dark"] .request-card-meta,
body[data-theme="dark"] .request-meta,
body[data-theme="dark"] .detail-list span,
body[data-theme="dark"] .time-strip span,
body[data-theme="dark"] .participant-main span,
body[data-theme="dark"] .participant-times span,
body[data-theme="dark"] .technical-details span,
body[data-theme="dark"] .technical-grid span,
body[data-theme="dark"] .service-list span,
body[data-theme="dark"] .principle-list span,
body[data-theme="dark"] .review-partner span,
body[data-theme="dark"] .access-code-card span,
body[data-theme="dark"] .assurance-method-card span,
body[data-theme="dark"] .assurance-method-card ul,
body[data-theme="dark"] .document-upload-copy,
body[data-theme="dark"] .document-upload-limit,
body[data-theme="dark"] .document-word-note span,
body[data-theme="dark"] .document-preparation-summary,
body[data-theme="dark"] .document-card .mono,
body[data-theme="dark"] .mono{color:var(--tera-muted)!important}

/* Workspace surfaces — no white/light cards in Dark mode. */
body[data-theme="dark"] :is(.panel,.assurance-card,.request-card,.document-card,.partner-card,.settings-card,.metric-card,.form-card,.choice-card,.participant-card,.remote-status-card,.document-review-box,.document-preview-confirm,.assurance-method-card,.advanced-panel,.technical-details,.verification-layer,.profile-card,.profile-context-item,.profile-security-card,.profile-stat){
  background:var(--tera-surface)!important;border-color:var(--tera-line)!important;color:var(--tera-text)!important;box-shadow:none!important
}
body[data-theme="dark"] :is(.time-strip>div,.hash-preview,.signature-context,.document-preparation,.document-preparation-summary,.document-conversion-path span,.document-format-badges strong,.document-word-note,.document-upload-dropzone,.hero-trust-strip,.access-code-card,.global-notice){
  background:var(--tera-surface-soft)!important;border-color:var(--tera-line)!important;color:var(--tera-text)!important;box-shadow:none!important
}
body[data-theme="dark"] .time-strip{background:var(--tera-line)!important;border-color:var(--tera-line)!important}
body[data-theme="dark"] .document-preview{background:var(--tera-surface-soft)!important;border-color:var(--tera-line)!important}
body[data-theme="dark"] .document-preview iframe,
body[data-theme="dark"] .document-preview img,
body[data-theme="dark"] .signature-review-image{background:#ffffff!important}
body[data-theme="dark"] .signature-dialog{background:var(--tera-surface)!important;border-color:var(--tera-line)!important;color:var(--tera-text)!important}
body[data-theme="dark"] #signatureCanvas{background:#ffffff!important}
body[data-theme="dark"] .document-upload-icon{background:#24384c!important;color:#f0c75b!important}
body[data-theme="dark"] .document-preparation-badge{background:#1a334b!important;color:#e8f0f8!important}
body[data-theme="dark"] .document-preparation-badge.ready{background:#12382f!important;color:#bcebd8!important}
body[data-theme="dark"] .document-preparation-badge.error{background:#40231f!important;color:#ffc3bc!important}

/* Connected/evidence/status treatments remain semantic but theme-correct. */
body[data-theme="dark"] .connected-banner,
body[data-theme="dark"] .finalization-card{background:#0f2e29!important;border-color:#376b5a!important;color:#d8e4ef!important}
body[data-theme="dark"] .connected-banner strong{color:#bcebd8!important}
body[data-theme="dark"] .connected-banner span{color:#c4d5de!important}
body[data-theme="dark"] .connected-banner.local{background:#332b18!important;border-color:#78642b!important}
body[data-theme="dark"] .connected-banner.local strong{color:#ffe49a!important}
body[data-theme="dark"] :is(.status.completed,.status.signed,.release-badge,.access-verified-banner,.certificate-result.ok){background:#12382f!important;color:#bcebd8!important;border-color:#376b5a!important}
body[data-theme="dark"] :is(.status.waiting,.status.pending,.certificate-result.neutral){background:#3a2d18!important;color:#ffd88a!important;border-color:#765f2b!important}
body[data-theme="dark"] :is(.status.draft){background:#173149!important;color:#c7d9e8!important;border-color:#35516c!important}
body[data-theme="dark"] :is(.certificate-result.bad){background:#40231f!important;color:#ffc3bc!important;border-color:#75443e!important}
body[data-theme="dark"] .access-verified-banner span{color:#b9d9cc!important}

/* Warm callouts use dark warm surfaces rather than pale cards. */
body[data-theme="dark"] :is(.boundary-box,.field-help,.tera-commitment){background:var(--tera-surface-warm)!important;border-color:#78642b!important;color:#e7dfc7!important}
body[data-theme="dark"] .boundary-box span,
body[data-theme="dark"] .field-help{color:#e7dfc7!important}
body[data-theme="dark"] .boundary-box strong,
body[data-theme="dark"] .tera-commitment strong{color:#ffe49a!important}
body[data-theme="dark"] .assurance-badges span{background:#332b18!important;border-color:#78642b!important;color:#ffe49a!important}

/* Controls and placeholders follow the selected theme. */
body[data-theme="dark"] :is(.field input,.field select,.field textarea,.filter-row input,.filter-row select){background:#0a2034!important;border-color:var(--tera-line-strong)!important;color:var(--tera-ink)!important}
body[data-theme="dark"] :is(input,textarea)::placeholder{color:#8fa2b5!important;opacity:1}
body[data-theme="dark"] :is(.button.secondary,.icon-button){background:var(--tera-surface)!important;border-color:var(--tera-line-strong)!important;color:var(--tera-ink)!important}
body[data-theme="dark"] .button.ghost{background:var(--tera-surface-soft)!important;color:var(--tera-text)!important;border-color:var(--tera-line)!important}
body[data-theme="dark"] .quiet-button{color:var(--tera-ink)!important;border-color:var(--tera-line)!important}

/* Inline error surfaces from the release workflow. */
body[data-theme="dark"] #releaseInlineError{background:#3b2020!important;color:#ffd8d4!important;border-color:#a85b54!important}
body[data-theme="dark"] #releaseErrorDetail{background:#2e1e1e!important;border-color:#75443e!important}
body[data-theme="dark"] #releaseErrorDetail strong{color:#ffc3bc!important}
body[data-theme="dark"] #releaseErrorMessage{color:#ffd1cc!important}
body[data-theme="dark"] #releaseErrorDetail p{color:#cdb7b4!important}

/* Light mode is equally explicit: no dark workspace leakage or white body text. */
body[data-theme="light"] .view{color:var(--tera-text)!important}
body[data-theme="light"] .view :is(h1,h2,h3,h4){color:var(--tera-ink)!important}
body[data-theme="light"] :is(.panel,.request-card,.document-card,.partner-card,.settings-card,.metric-card,.form-card,.choice-card,.participant-card,.remote-status-card,.document-review-box,.document-preview-confirm,.assurance-method-card,.technical-details,.verification-layer,.profile-card,.profile-context-item,.profile-security-card,.profile-stat,.time-strip>div,.hash-preview,.signature-context,.document-preparation){background:var(--tera-surface)!important;color:var(--tera-text)!important;border-color:var(--tera-line)!important}
body[data-theme="light"] :is(.field input,.field select,.field textarea,.filter-row input,.filter-row select){background:#fff!important;color:var(--tera-ink)!important}
body[data-theme="light"] :is(input,textarea)::placeholder{color:#76879a!important;opacity:1}

/* Keep the branded masthead/nav intentionally dark in both themes. */
.brand-masthead,.product-navbar{color:#fff!important}


/* ==========================================================
   v0.7.6.2 — Full governed theme separation
   Contract: Light is light across the complete application shell;
   Dark is dark across the complete application shell. Only actual
   document/PDF and signature-canvas surfaces may remain paper white.
   ========================================================== */

/* Theme-safe shell tokens. */
body[data-theme="light"]{
  --tera-shell-bg:#ffffff;
  --tera-shell-bg-2:#f6f9fc;
  --tera-shell-text:#0a2748;
  --tera-shell-muted:#52677d;
  --tera-shell-line:#c9d7e4;
  --tera-shell-hover:#eef4f9;
  --tera-shell-active:#fff7df;
}
body[data-theme="dark"]{
  --tera-shell-bg:#0b2b49;
  --tera-shell-bg-2:#10263c;
  --tera-shell-text:#f4f7fb;
  --tera-shell-muted:#c4d2df;
  --tera-shell-line:#35516c;
  --tera-shell-hover:#173b5e;
  --tera-shell-active:#3f351c;
}

/* Main product masthead/navigation obey the selected theme. */
body[data-theme="light"] .brand-masthead{
  background:var(--tera-shell-bg)!important;
  color:var(--tera-shell-text)!important;
  border-bottom:1px solid var(--tera-shell-line)!important;
  box-shadow:0 5px 18px rgba(7,35,63,.06)!important;
}
body[data-theme="light"] .masthead-emblem{
  background:#fffaf0!important;
  color:#8a6200!important;
  border-color:#c99721!important;
  box-shadow:0 0 0 5px rgba(201,151,33,.08)!important;
}
body[data-theme="light"] .masthead-title{color:var(--tera-shell-text)!important}
body[data-theme="light"] .masthead-subtitle,
body[data-theme="light"] .masthead-context{color:var(--tera-shell-muted)!important}
body[data-theme="light"] .masthead-context strong{color:#8a6200!important}
body[data-theme="light"] .masthead-principles{color:var(--tera-shell-text)!important}
body[data-theme="light"] .masthead-principles strong{color:#8a6200!important}
body[data-theme="light"] .version-badge,
body[data-theme="light"] .service-badge{
  background:#f6f9fc!important;border-color:#b8c9d8!important;color:#24435f!important
}
body[data-theme="light"] .service-badge.connected,
body[data-theme="light"] .service-badge.ok{
  background:#e9f8f2!important;border-color:#99d5bd!important;color:#176348!important
}
body[data-theme="light"] .product-navbar{
  background:var(--tera-shell-bg-2)!important;
  border-bottom:1px solid var(--tera-shell-line)!important;
  box-shadow:0 6px 18px rgba(7,35,63,.06)!important;
}
body[data-theme="light"] :is(.corporate-home,.product-nav-link,.nav-utility-link){color:var(--tera-shell-text)!important}
body[data-theme="light"] .product-nav-link:hover,
body[data-theme="light"] .product-nav-link:focus{background:var(--tera-shell-hover)!important;color:var(--tera-shell-text)!important}
body[data-theme="light"] .product-nav-link.active{
  background:var(--tera-shell-active)!important;border-bottom-color:#c99721!important;color:#6e4f00!important
}
body[data-theme="light"] :is(.nav-icon-button,.nav-theme-toggle,.quiet-link){
  background:#ffffff!important;border-color:#b8c9d8!important;color:var(--tera-shell-text)!important
}
body[data-theme="light"] :is(.nav-icon-button,.nav-theme-toggle,.quiet-link):hover,
body[data-theme="light"] :is(.nav-icon-button,.nav-theme-toggle,.quiet-link):focus{
  background:#eef4f9!important;border-color:#7394ad!important;color:var(--tera-shell-text)!important
}
body[data-theme="light"] .language-switch button{color:#52677d!important}
body[data-theme="light"] .language-switch button.active{color:#8a6200!important}

/* Footer is part of the governed theme, not a permanently dark brand strip. */
body[data-theme="light"] .footer{
  background:#ffffff!important;color:#52677d!important;border-top:1px solid var(--tera-shell-line)!important
}
body[data-theme="light"] .footer span:last-child{color:#8a6200!important}
body[data-theme="dark"] .footer{
  background:#0b2742!important;color:#d8e3ed!important;border-top:1px solid #35516c!important
}

/* Dark workspace: eliminate remaining legacy navy foregrounds. */
body[data-theme="dark"] :is(
  .metric-card strong,.hero-trust-strip strong,.request-card-main h3,.request-card-side strong,
  .assurance-pill,.profile-context-title,.profile-assurance-row strong,.profile-stat strong,
  .profile-person-name,.profile-security-card strong,.profile-nav button,.detail-list strong
){color:var(--tera-ink)!important}
body[data-theme="dark"] :is(
  .metric-card span,.hero-trust-strip small,.profile-assurance-row span,.profile-stat span,
  .profile-person-email,.profile-person-meta,.profile-context-item span,.profile-security-card span
){color:var(--tera-muted)!important}
body[data-theme="dark"] .hero-trust-strip{background:var(--tera-surface)!important;border-color:var(--tera-line)!important}
body[data-theme="dark"] .hero-trust-strip>span{border-color:var(--tera-line)!important}
body[data-theme="dark"] .assurance-pill{
  background:var(--tera-surface-soft)!important;border-color:var(--tera-line-strong)!important;color:var(--tera-ink)!important;box-shadow:none!important
}
body[data-theme="dark"] .assurance-card{background:var(--tera-surface)!important;border-color:var(--tera-line)!important}

/* Light workspace: reject dark-panel leakage. */
body[data-theme="light"] :is(.hero-trust-strip,.metric-card,.assurance-card,.request-card,.document-card,.partner-card,.panel,.profile-card){
  background:#ffffff!important;color:var(--tera-text)!important;border-color:var(--tera-line)!important
}
body[data-theme="light"] :is(.metric-card strong,.hero-trust-strip strong,.request-card-main h3,.request-card-side strong,.profile-assurance-row strong){color:var(--tera-ink)!important}
body[data-theme="light"] :is(.metric-card span,.hero-trust-strip small,.request-card-meta,.profile-assurance-row span){color:var(--tera-muted)!important}
body[data-theme="light"] .assurance-pill{background:#ffffff!important;color:var(--tera-ink)!important;border-color:var(--tera-line-strong)!important}

/* TERA Assurance profile rows: fixed marker column and safe inset prevent clipping. */
.profile-assurance-list{padding:2px 2px 2px 3px!important;overflow:visible!important}
.profile-assurance-row{
  grid-template-columns:34px minmax(0,1fr)!important;
  column-gap:10px!important;
  align-items:start!important;
  min-width:0!important;
  padding:2px 0!important;
}
.profile-assurance-mark{
  width:30px!important;height:30px!important;min-width:30px!important;
  margin-left:0!important;overflow:visible!important;
  font-size:14px!important;line-height:1!important
}
.profile-assurance-row>div{min-width:0!important;padding-right:2px!important}
.profile-assurance-row strong,.profile-assurance-row span{overflow-wrap:anywhere!important}

/* Actual document and signature surfaces are intentional paper-white exceptions. */
body[data-theme="dark"] :is(.document-preview iframe,.document-preview img,.signature-review-image,#signatureCanvas){background:#ffffff!important}
