/* GED client theme: shared tokens, no change to layout or workflow states. */
:root{--ged-ink:#203331;--ged-muted:#4d655b;--ged-primary:#103f38;--ged-action:#08765d;--ged-surface:#fff;--ged-background:#e7ede8;--ged-border:#73887b;--ged-control-border:#627c6d;--ged-divider:#a6b8ab;--ged-soft:#dfe9e2;--ged-focus:#246f54;--ged-panel-shadow:0 2px 5px #203d2b14,0 6px 18px #203d2b0a}
body[data-ged-theme="client"]{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px;line-height:1.5;color:var(--ged-ink);background:var(--ged-background)}
body[data-ged-theme] h1{font-size:clamp(25px,3vw,34px);line-height:1.2;letter-spacing:-.035em;color:var(--ged-ink)}
body[data-ged-theme] h2{font-size:20px;line-height:1.3;letter-spacing:-.02em;color:var(--ged-ink)}
body[data-ged-theme] h3{font-size:16px;line-height:1.4;color:var(--ged-ink)}
body[data-ged-theme] .eyebrow{color:#47776e}
body[data-ged-theme] :is(.card,.panel-card,.party,.sources,.settings-card){border-color:var(--ged-border);border-radius:12px;box-shadow:var(--ged-panel-shadow)}
body[data-ged-theme] :is(.card,.panel-card,.settings-card){background:var(--ged-surface)}
body[data-ged-theme] :is(.party,.sources){background:var(--ged-soft)}
body[data-ged-theme] :is(.meta,.subtitle,.state,.small-note){color:var(--ged-muted)}
body[data-ged-theme] :is(input,select,textarea){font:inherit;color:var(--ged-ink);border-color:var(--ged-border);border-radius:9px;accent-color:var(--ged-action)}
body[data-ged-theme] :is(input,textarea)[readonly]{background:var(--ged-soft)}
body[data-ged-theme] :is(button,.button,.btn){font:inherit;border-radius:9px}
body[data-ged-theme] :is(button.primary,a.primary,.btn-primary,button[type="submit"]){background:var(--ged-action)!important;color:#fff!important;border:1px solid var(--ged-action)!important;font-weight:700;min-height:42px;padding:9px 15px}
body[data-ged-theme] :is(button.secondary,a.secondary,.btn-secondary){background:var(--ged-surface)!important;color:#225c4e!important;border:1px solid var(--ged-border)!important;font-weight:650;min-height:42px;padding:9px 15px}
body[data-ged-theme] :is(button.primary,a.primary,.btn-primary):hover:not(:disabled){background:#075c49!important}
body[data-ged-theme] :is(button.secondary,a.secondary,.btn-secondary):hover:not(:disabled){background:var(--ged-soft)!important}
body[data-ged-theme] :is(button:disabled,[aria-disabled="true"]){opacity:.53;cursor:not-allowed}
body[data-ged-theme] :is(button,input,textarea,select,a,summary):focus-visible{outline:3px solid var(--ged-focus);outline-offset:3px}
body[data-ged-theme] :is(input,textarea,select)[aria-invalid="true"]{border-color:#b84435}
body[data-ged-theme] main a:not(.primary):not(.secondary):not(.danger){color:#136154}
body[data-ged-theme] summary{cursor:pointer;color:#1d5e4d;font-weight:650}
body[data-ged-theme] :is(.topbar,.page-banner){background:var(--ged-primary);color:#fff}
body[data-ged-theme] :is(.topbar,.page-banner) :is(h1,h2,h3,a){color:#fff}
body[data-ged-theme] nav a:not(.tab){border-color:var(--ged-border);border-radius:9px}
body[data-ged-theme] th{background:var(--ged-soft);color:#31554e}
body[data-ged-theme] td{border-bottom-color:var(--ged-divider)}
body[data-ged-theme] :is(.danger,.destructive,button[aria-pressed="true"].voice-button){background:#fde9e5!important;border-color:#d98e80!important;color:#8d2d21!important}
body[data-ged-theme] :is(.error,.warning,.conflict,.success){/* Retain each module's semantic colours and states. */border-radius:9px}
body[data-ged-workspace] header{background:var(--ged-primary);color:#fff;border-color:var(--ged-primary)}
body[data-ged-workspace] header :is(h1,.subtitle){color:#fff}
body[data-ged-workspace] .tab{color:#31554e;border-color:var(--ged-border)}
body[data-ged-workspace] .tab[aria-selected="true"]{color:var(--ged-primary);background:#d9efe5;box-shadow:inset 0 -3px var(--ged-action)}
body[data-ged-workspace] #interface-mode{background:var(--ged-action);border-color:#7cc4af;color:white}
@media(max-width:680px){body[data-ged-theme] h1{font-size:25px}body[data-ged-theme] :is(button.primary,button.secondary,a.primary,a.secondary){min-height:44px}}
@media(prefers-reduced-motion:reduce){body[data-ged-theme] :is(button,a){transition:none}}
body[data-ged-theme] > header:not(.topbar):not(.page-banner),body[data-ged-theme] main > header:not(.topbar):not(.page-banner){background:transparent;color:var(--ged-ink)}
body[data-ged-workspace] > header{background:var(--ged-primary)!important;color:white!important}
body[data-ged-workspace] nav.primary,body[data-ged-workspace] #simple-tabs{background:var(--ged-primary)}
body[data-ged-workspace] nav.primary .tab,body[data-ged-workspace] #simple-tabs .simple-tab{color:#e2f5ed;background:transparent}
body[data-ged-workspace] nav.primary .tab[aria-selected="true"],body[data-ged-workspace] #simple-tabs .simple-tab[aria-selected="true"]{background:var(--ged-action);color:white;border-bottom-color:#7cc4af}
body[data-ged-workspace] nav.secondary{background:var(--ged-soft);border-color:var(--ged-border)}
body[data-ged-workspace] nav.secondary .tab{color:#31554e}
body[data-ged-workspace] nav.secondary .tab[aria-selected="true"]{background:white;color:var(--ged-primary);border-bottom-color:var(--ged-action)}

body[data-ged-theme]:not([data-ged-workspace]) button:not([class]):not([aria-pressed="true"]){background:var(--ged-action);color:white;border-color:var(--ged-action)}
body[data-ged-workspace] header a{color:#e2f5ed!important}
body[data-ged-theme] .essential{background:var(--ged-soft);border-color:var(--ged-border)}
body[data-ged-theme] .tag{background:var(--ged-soft);color:#31554e}
body[data-ged-theme] .count{display:inline-flex;align-items:center;justify-content:center;min-width:25px;min-height:23px;padding:2px 7px;background:#d9efe5;color:#103f38!important;border:1px solid #9bcbbd;border-radius:999px;font-size:12px;font-weight:750;line-height:1}
body[data-ged-theme] .tabs[aria-label="États des actions"]{position:sticky;top:0;z-index:50;background:var(--ged-background);padding-top:8px}
body[data-ged-theme] .tabs[aria-label="États des actions"] button{background:transparent!important;color:#31554e!important;border-color:transparent!important}
body[data-ged-theme] .tabs[aria-label="États des actions"] button[aria-selected="true"]{background:white!important;color:#103f38!important;border-color:var(--ged-border)!important;border-bottom-color:white!important}

/* One contrast palette for the existing modules, including legacy embedded pages.
   Keep their layout, border widths, selection colours and document pixels intact. */
@media screen {
  body[data-ged-theme="client"],body[data-ged-theme="client"][data-ged-settings],body.gdv-page,body.gdv-settings-page {
    --line:var(--ged-border);
    --border:var(--ged-border);
    --review-line:var(--ged-border);
    --drawer-line:var(--ged-border);
    --block-line:var(--ged-border);
    --soft:var(--ged-soft);
    background-color:var(--ged-background);
  }
  body[data-ged-theme="client"] :is(
    .card,.panel-card,.settings-card,.live-module,.portal-shortcut,
    .scope-card,.fields-card,.queue-panel,.letter-card,.basket-card,
    .drawer-sidebar,.drawer-content,.spotlight-search,.messages-layout,
    .mail-layout,.block-card,.simple-card,.settings-map,.settings-module,
    .remote-library,.remote-main,.remote-context
  ):not(.error):not(.warning):not(.success):not(.conflict) {
    border-color:var(--ged-border);
    box-shadow:var(--ged-panel-shadow);
  }
  /* Only recolour borders that already exist; borderless wrappers stay borderless. */
  body[data-ged-theme="client"] :is(
    section,.panel,.party,.sources,.list-item,.person-card,.result,.result-item,
    .history-entry,.document-card,.recipient-strip,.compact-details,.scope-phrase,
    .criterion-group,.basic-search-filters,.ged-search-model-launcher,.example-panel,
    .query-summary,.ai-answer,.doc-extras,.question,.document-preview,
    .ged-groups-inline-panel,.ged-group-create,.mail-index-panel,.connect,
    .basket-source,.settings-map-link,.remote-tools,.gdv-dialog
  ):not(.error):not(.warning):not(.success):not(.conflict):not([data-state="error"]):not([aria-current="true"]):not(.is-selected) {
    border-color:var(--ged-border);
  }
  body[data-ged-theme="client"] :is(
    .essential,.scope-phrase,.criterion-group,.recipient-strip,.example-panel
  ) { background-color:var(--ged-soft); }
  body[data-ged-theme="client"] .essential {
    /* These coordinate blocks previously relied on a nearly white fill alone. */
    box-shadow:inset 0 0 0 1px var(--ged-border);
  }
  body[data-ged-theme="client"] :is(
    .identity-head,.queue-heading,.datum,.advanced,.filter-bar,.basket-detail,
    .settings-save-row,.comment-entry,.mail-item
  ) { border-color:var(--ged-divider); }
  body[data-ged-theme="client"] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
    select,textarea
  ):not([aria-invalid="true"]):not(:invalid):not(.error) {
    border-color:var(--ged-control-border);
  }
  body[data-ged-theme="client"] :is(input,textarea)::placeholder {
    color:var(--ged-muted);opacity:1;
  }
  body[data-ged-theme="client"] :is(
    .live-choice,.live-nav-button,.quiet-button,.pair-button,.icon-action
  ):not([aria-current="true"]):not([aria-pressed="true"]):not([aria-expanded="true"]):not(.basket-validate):not([data-state="error"]) {
    border-color:var(--ged-border);
  }
  body[data-ged-theme="client"] #live-audio .audio-controls {
    background-color:var(--ged-soft);border-color:var(--ged-border);
  }
  body[data-ged-theme="client"] .live-nav { background-color:var(--ged-background); }
  body[data-ged-theme="client"].video-expanded .live-nav { background-color:#10231b; }
  body[data-ged-theme="client"] :is(.live-choice,.live-nav-button):hover:not(:disabled):not([aria-current="true"]):not(.basket-validate) {
    border-color:var(--ged-action);background-color:var(--ged-soft);
  }
  body[data-ged-theme="client"] :is(.ged-search-extra fieldset,.ged-search-extra details,#action-more>details) {
    border-color:var(--ged-border);
  }
  body[data-ged-theme="client"] .grid .item { border-color:var(--ged-border); }
  body[data-ged-theme="client"] .nature-group { border-color:var(--ged-border)!important; }
  /* The viewer also serves standalone pages, without the workspace decorator. */
  body.gdv-settings-page main,.gdv-dialog,.gdv-pdf-controls,.gdv-page-header {
    border-color:var(--ged-border);
  }
  .gdv-dialog :is(input,textarea,select):not([aria-invalid="true"]),
  .gdv-pdf-controls button,.gdv-settings-editor button:not(.gdv-primary) {
    border-color:var(--ged-control-border);
  }
}
