/* Shared palette: page styles consume these tokens and never redefine them. */
:root {
  color-scheme: light;
  --brand-green: #93452f;
  --brand-cream: #f3efe7;
  --canvas: #f3efe7;
  --surface: #fbfaf6;
  --surface-raised: #fffdf7;
  --surface-subtle: #e9e3da;
  --ink: #201e1b;
  --muted: #6d6861;
  --line: #c9c1b6;
  --blue: #93452f;
  --blue-soft: #ead9d0;
  --green: #58705e;
  --green-soft: #dce4dc;
  --amber: #8b6329;
  --amber-soft: #eee0c8;
  --red: #9f4038;
  --red-soft: #edd7d3;
  --info: #245e78;
  --info-soft: #d9e8ee;
  --focus: #93452f;
  --strong: #25221f;
  --strong-hover: #0f0e0d;
  --on-strong: #fbf8f2;
  --rail-bg: #25221f;
  --rail-ink: #fbf8f2;
  --rail-muted: #c8c0b5;
  --rail-selected: #f3efe7;
  --rail-selected-ink: #201e1b;
  --faint: var(--muted);
  --navy: var(--strong);
  --cica-ivory: var(--on-strong);
  --cica-forest: var(--blue);
  --cica-forest-hover: var(--strong-hover);
  --cica-muted: var(--muted);
  --cica-line: var(--line);
  --auth-paper: var(--canvas);
  --auth-ink: var(--ink);
  --auth-muted: var(--muted);
  --auth-line: var(--line);
  --auth-blue: var(--blue);
  --paper: var(--surface);
  --accent: var(--blue);
  --ivory: var(--canvas);
  --ivory-strong: var(--surface-subtle);
  --forest: var(--blue);
  --forest-deep: var(--strong-hover);
  --sage: var(--blue-soft);
  --moss: var(--muted);
  --signal: var(--amber);
  --gold: var(--amber);
  --cica-ink: var(--ink);
  --cica-ink-soft: var(--muted);
  --cica-mint: var(--green);
  --cica-sand: var(--canvas);
  --cica-paper: var(--surface);
  --cica-line: var(--line);
  --cica-blue: var(--blue);
  --cica-blue-soft: var(--blue-soft);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 12px 30px rgb(0 0 0 / 12%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  --canvas: #181715;
  --surface: #211f1c;
  --surface-raised: #282521;
  --surface-subtle: #302c27;
  --ink: #f2eee7;
  --muted: #b8b0a6;
  --line: #575048;
  --blue: #df8b6f;
  --blue-soft: #3e2b24;
  --green: #91ad98;
  --green-soft: #29362d;
  --amber: #d4ab70;
  --amber-soft: #3c3122;
  --red: #e9958c;
  --red-soft: #422926;
  --info: #94c8dc;
  --info-soft: #243b44;
  --focus: #f0a082;
  --strong: #eee8de;
  --strong-hover: #ffffff;
  --on-strong: #1b1917;
  --rail-bg: #211f1c;
  --rail-ink: #f2eee7;
  --rail-muted: #b8b0a6;
  --rail-selected: #3e2b24;
  --rail-selected-ink: #f2eee7;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #181715;
  --surface: #211f1c;
  --surface-raised: #282521;
  --surface-subtle: #302c27;
  --ink: #f2eee7;
  --muted: #b8b0a6;
  --line: #575048;
  --blue: #df8b6f;
  --blue-soft: #3e2b24;
  --green: #91ad98;
  --green-soft: #29362d;
  --amber: #d4ab70;
  --amber-soft: #3c3122;
  --red: #e9958c;
  --red-soft: #422926;
  --info: #94c8dc;
  --info-soft: #243b44;
  --focus: #f0a082;
  --strong: #eee8de;
  --strong-hover: #ffffff;
  --on-strong: #1b1917;
  --rail-bg: #211f1c;
  --rail-ink: #f2eee7;
  --rail-muted: #b8b0a6;
  --rail-selected: #3e2b24;
  --rail-selected-ink: #f2eee7;
}

/* Shared controls and surfaces, applied after page styles. */
html { background: var(--canvas); accent-color: var(--blue); }
body, html body { background: var(--canvas); color: var(--ink); }
:where(h1,h2,h3,h4) { text-wrap: balance; }
:where(p,dd,td,li,.account-name) { overflow-wrap: anywhere; }
:where(button,input,select,textarea,a,summary) { touch-action: manipulation; }
:where(input,select,textarea) { color: var(--ink); background-color: var(--surface); }
html :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
html :where(input,select,textarea):focus-visible { outline: 3px solid var(--focus); }
[hidden] { display: none !important; }
:where(section[id],h2[id],details[id]) { scroll-margin-top: 100px; }
.rail { overflow-y: auto; background: var(--rail-bg); color: var(--rail-ink); }
.platform-shell .rail { background: var(--rail-bg); color: var(--rail-ink); }
.platform-shell .rail-label { color: var(--rail-muted); }
.platform-shell .system-choice input:checked ~ .system-check::after { border-color: var(--canvas); }
.rail .wordmark,.rail .rail-nav a { color: var(--rail-ink); }
.rail .rail-label { color: var(--rail-muted); }
.nav-count { background: var(--amber-soft); color: var(--amber); }
.rail .rail-nav a:hover { background: var(--strong-hover); color: var(--on-strong); }
.rail .rail-nav a[aria-current=page] { background: var(--rail-selected); color: var(--rail-selected-ink); }
.wordmark>span { background: var(--strong) !important; color: var(--on-strong) !important; }
.app-bar { background: var(--surface); border-color: var(--line); }
.workspace-panel,.auth-card,.office-list,.account-list,.modal-card,.mobile-nav { background: var(--surface); color: var(--ink); }
:where(.button,.auth-card .button,.cica-header-cta,.cica-cta,.cica-final-cta) { background: var(--strong); color: var(--on-strong); }
.button,.auth-card .button { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.button:hover,.auth-card .button:hover { background: var(--strong-hover); }
.button-quiet,.auth-card .button-quiet { background: transparent; color: var(--blue); border-color: var(--line); }
.button-quiet:hover,.auth-card .button-quiet:hover { background: var(--blue-soft); color: var(--blue); }
.button:disabled,button:disabled { cursor: not-allowed; opacity: .65; }
.operational-table th { background: var(--surface-subtle); color: var(--muted); }
.operational-table td { color: var(--ink); border-color: var(--line); }
.row-action-button { display: inline-flex; align-items: center; justify-content: center; min-width: max-content; white-space: nowrap; text-decoration: none; }
.operational-table tbody tr:hover { background: var(--surface-subtle); }
:where(.metric-grid strong,.metric-grid dd,td,.usage-row) { font-variant-numeric: tabular-nums; }
:where(.status-badge,.module-state).is-warning { color: var(--amber); background: var(--amber-soft); }
:where(.status-badge,.module-state).is-danger { color: var(--red); background: var(--red-soft); }
:where(.status-badge,.module-state).is-active { color: var(--green); background: var(--green-soft); }
.theme-picker { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.theme-picker button,.account-list .theme-picker button { flex: 1; width: auto; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.theme-picker button:hover { color: var(--ink); background: var(--surface-subtle); }
.theme-picker button[aria-pressed=true],.account-list .theme-picker button[aria-pressed=true] { color: var(--blue); background: var(--blue-soft); font-weight: 700; }
.account-list { min-width: 256px; max-width: calc(100vw - 24px); }
.account-list .theme-picker { margin-bottom: 6px; }
.auth-footer,.cica-footer { flex-wrap: wrap; gap: 20px; }
.modal-card { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal-backdrop { background: rgb(0 0 0 / 65%); }
.skip-link:focus-visible { pointer-events: auto !important; }
.skip-link { background: var(--surface-raised); color: var(--ink); }
.cica-landing .cica-skip { background: var(--surface-raised); color: var(--ink); }
.cica-header-cta,.cica-cta { background: var(--strong); color: var(--on-strong); }
.cica-final { background: var(--blue-soft); color: var(--ink); }
.cica-final .cica-kicker { color: var(--blue); }
.context-help { margin: 8px 0; color: var(--muted); font-size: 13px; }
.context-help summary { min-height: 44px; padding-block: 12px; color: var(--blue); cursor: pointer; }
.context-help p { max-width: 70ch; }
.support-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; margin-bottom: 20px; background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); border-radius: var(--radius); }
.support-banner form { margin: 0; }
.scope-search { margin-bottom: 8px; }
.scope-summary { margin: 8px 0; color: var(--muted); font-size: 12px; }
.scope-picker .scope-options { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
:where(h1,h2,h3,[id]) { scroll-margin-top: 100px; }
:where(h1,h2,h3) { text-wrap: balance; }
:where(button,a,input,select,textarea) { touch-action: manipulation; }
.sr-only { clip-path: inset(50%); margin: -1px; padding: 0; border: 0; }
.data-table-wrap { position: relative; max-width: 100%; }
input::placeholder,textarea::placeholder { color: var(--muted); opacity: 1; }
.mobile-trigger { display: none; }
.work-area { min-width: 0; }
.work-area:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.section-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.section-links a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; color: var(--blue); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.section-links a:hover { background: var(--blue-soft); }
@media (max-width: 900px) {
  .product-shell { display: block; }
  .rail { display: none; }
  .mobile-trigger { display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; margin-right: 8px; }
  .mobile-nav { position: absolute; top: 100%; left: 0; right: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; padding: 12px; gap: 6px; box-shadow: var(--shadow); }
  .mobile-nav a { white-space: normal; display: flex; align-items: center; min-height: 44px; color: var(--blue); padding: 10px; }
  .mobile-nav a[aria-current=page] { background: var(--blue-soft); }
  .app-bar { padding-inline: 16px; }
}
@media (max-width: 560px) {
  .auth-header,.auth-footer { width: calc(100% - 32px); }
  .auth-header { gap: 12px; }
  .auth-brand > span small,.cica-lockup small { max-width: 160px; font-size: 7px; }
  .auth-footer .theme-picker,.cica-footer .theme-picker { width: 100%; }
  .work-area { padding: 24px 16px 48px; }
  .workspace-panel-head { flex-wrap: wrap; gap: 12px; }
  .account-list { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* D-184 official-kit overrides after legacy page layers. */
.workspace-brand{min-width:44px;min-height:44px;color:var(--blue)}
.workspace-brand>.cica-brand-mark{display:inline-grid;width:34px;height:auto;background:transparent!important;color:inherit!important}
.wordmark>.cica-brand-lockup{background:transparent!important;color:inherit!important}
.workspace-shell .topnav-link[aria-current],.workspace-shell .topnav-group.is-current>summary,.workspace-shell .topnav-copilot{color:var(--blue)}
.workspace-shell .topnav-link[aria-current]::after,.workspace-shell .topnav-group.is-current>summary::after{background:var(--blue)}
.workspace-shell .topnav-panel a[aria-current]{background:var(--blue-soft);color:var(--blue);box-shadow:inset 3px 0 var(--blue)}
.workspace-shell .demo-office-banner{border-left-color:var(--blue);background:var(--blue-soft)}
.workspace-shell .workspace-tabs>a[aria-current]{border-bottom-color:var(--blue);color:var(--blue)}
.workspace-shell input:focus-visible,.workspace-shell select:focus-visible,.workspace-shell textarea:focus-visible{border-color:var(--focus);outline:3px solid color-mix(in srgb,var(--focus) 70%,transparent)}
.workspace-shell input:focus:not(:focus-visible),.workspace-shell select:focus:not(:focus-visible),.workspace-shell textarea:focus:not(:focus-visible){border-color:var(--control-border);outline:none}
html[data-input-modality="pointer"] .workspace-shell input:focus-visible,html[data-input-modality="pointer"] .workspace-shell select:focus-visible,html[data-input-modality="pointer"] .workspace-shell textarea:focus-visible{border-color:var(--control-border);outline:none}
.closing-coverage-gap{border-left:3px solid var(--blue);background:var(--surface-subtle)}.closing-gap-list{columns:2 260px;margin:16px 0 0;padding-left:20px;color:var(--muted)}.closing-gap-list a{color:var(--blue)}

:root,:root:has(.workspace-shell){--brand-green:#114d44;--brand-cream:#e3ddca;--canvas:#e3ddca;--surface:#f7f4eb;--surface-raised:#fffdf7;--surface-subtle:#ebe6d8;--ink:#17211f;--muted:#56635f;--line:#b8b2a3;--control-border:#8e978f;--blue:#114d44;--blue-soft:#d7e4df;--green:#246547;--green-soft:#d8e7da;--amber:#74510d;--amber-soft:#f1e3bd;--red:#92352f;--red-soft:#f3d9d5;--info:#245e78;--info-soft:#d9e8ee;--focus:#1c6a5e;--strong:#114d44;--strong-hover:#0b3b34;--on-strong:#fff;--brand:#114d44;--rail-bg:#202522;--rail-ink:#f5f0e3;--rail-muted:#c8c3b5;--rail-selected:#e3ddca;--rail-selected-ink:#17211f}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]),:root:not([data-theme="light"]):has(.workspace-shell){--canvas:#121816;--surface:#18201d;--surface-raised:#202925;--surface-subtle:#27312d;--ink:#f5f0e3;--muted:#c4bdad;--line:#4b554f;--control-border:#617069;--blue:#a8d0c4;--blue-soft:#263c36;--green:#9bcea9;--green-soft:#253b2c;--amber:#e2bd75;--amber-soft:#41351f;--red:#f0a39d;--red-soft:#492a28;--info:#94c8dc;--info-soft:#243b44;--focus:#b8ddd2;--strong:#a8d0c4;--strong-hover:#c2e2d9;--on-strong:#10221d;--brand:#a8d0c4;--rail-bg:#111614;--rail-ink:#f5f0e3;--rail-muted:#c4bdad;--rail-selected:#2b3833;--rail-selected-ink:#f5f0e3}}
:root[data-theme="dark"],:root[data-theme="dark"]:has(.workspace-shell){--canvas:#121816;--surface:#18201d;--surface-raised:#202925;--surface-subtle:#27312d;--ink:#f5f0e3;--muted:#c4bdad;--line:#4b554f;--control-border:#617069;--blue:#a8d0c4;--blue-soft:#263c36;--green:#9bcea9;--green-soft:#253b2c;--amber:#e2bd75;--amber-soft:#41351f;--red:#f0a39d;--red-soft:#492a28;--info:#94c8dc;--info-soft:#243b44;--focus:#b8ddd2;--strong:#a8d0c4;--strong-hover:#c2e2d9;--on-strong:#10221d;--brand:#a8d0c4;--rail-bg:#111614;--rail-ink:#f5f0e3;--rail-muted:#c4bdad;--rail-selected:#2b3833;--rail-selected-ink:#f5f0e3}

.cica-brand-asset{display:inline-grid;align-items:center;flex:0 0 auto;line-height:0}.cica-brand-asset>img{display:block;grid-area:1/1;width:100%;height:auto}.cica-brand-dark{visibility:hidden}.cica-brand-lockup{width:132px}.cica-brand-mark{width:32px}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .cica-brand-light{visibility:hidden}:root:not([data-theme="light"]) .cica-brand-dark{visibility:visible}}:root[data-theme="dark"] .cica-brand-light{visibility:hidden}:root[data-theme="dark"] .cica-brand-dark{visibility:visible}:root[data-theme="light"] .cica-brand-light{visibility:visible}:root[data-theme="light"] .cica-brand-dark{visibility:hidden}
/* D-397: direct-use outcomes, pending exports and readable movement columns */
.conference-outcomes{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin:16px 0 0;padding:0;list-style:none}
.conference-outcome{display:grid;gap:2px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-sm,8px);background:var(--surface)}
.conference-outcome strong{font-size:20px;line-height:1.1;color:var(--ink)}
.conference-outcome span{font-weight:700;color:var(--ink)}
.conference-outcome small{color:var(--muted);line-height:1.4}
.conference-outcome--posted,.conference-outcome--exported,.conference-outcome--confirmed{border-left:4px solid var(--green)}
.export-pending{margin:0 0 16px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm,8px);background:var(--surface)}
.export-pending-list{display:grid;gap:10px;margin:0 0 8px;padding:0;list-style:none}
.export-pending-list li{display:grid;gap:3px}
.export-pending-list span{color:var(--ink)}
.export-pending-held{color:var(--muted)}
.export-pending-held a{display:inline-flex;align-items:center;min-height:44px;font-weight:700}
.reconciliation-movement-table td[data-label="Data"],.reconciliation-movement-table td[data-label="Valor"]{white-space:nowrap}
/* D-398: simpler direct-use journey */
.direct-use-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 16px;padding:0;list-style:none;counter-reset:none}
.direct-use-steps li{display:grid;gap:3px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-sm,8px);background:var(--surface)}
.direct-use-steps strong{color:var(--ink)}
.direct-use-steps span{color:var(--muted);line-height:1.4}
.direct-use-more{position:relative}
.direct-use-more>summary{list-style:none;cursor:pointer}
.direct-use-more>summary::-webkit-details-marker{display:none}
.direct-use-more-menu{position:absolute;right:0;z-index:20;display:grid;min-width:260px;margin-top:6px;padding:6px;border:1px solid var(--line);border-radius:var(--radius-sm,8px);background:var(--surface-raised,var(--surface));box-shadow:0 10px 30px rgba(0,0,0,.18)}
.direct-use-more-menu a{display:flex;align-items:center;min-height:44px;padding:0 12px;border-radius:6px;color:var(--ink);font-weight:650;text-decoration:none}
.direct-use-more-menu a:hover,.direct-use-more-menu a:focus-visible{background:var(--surface-subtle)}
.direct-use-more-block{margin:16px 0 0}
.direct-use-more-block>summary{display:inline-flex;align-items:center;min-height:44px;cursor:pointer;font-weight:700;color:var(--ink)}
.conference-outcome a{display:grid;gap:2px;color:inherit;text-decoration:none}
.conference-outcome:has(a:hover),.conference-outcome:has(a:focus-visible){border-color:var(--strong)}
.conference-outcome--repeated{border-left:4px solid var(--green)}
.conference-outcome--repeated_missing{border-left:4px solid var(--amber)}
@media(max-width:760px){.direct-use-steps{grid-template-columns:1fr}.direct-use-more-menu{position:static;min-width:0}}
.portfolio-account-table td small,.portfolio-table td small{white-space:nowrap}
