/* License: MIT (see ../license.txt); alternatively GPL v3.0. (c) 2026 ISSP Software und Service GmbH */
/* cloccojs theme tokens + accessibility layer. Loaded last: every surface reads these variables, so each theme
   (blue, pink, green, dark, contrast) recolors navigation, panels, chat, grids and overlays consistently. */
:root{
  --muted:#566176;--surface:#fff;--input-bg:#fff;--hover-bg:#edf3ff;--tag-bg:#e6efff;--tag-ink:#1f4aa8;--bubble:#eef2f7;--bubble-me:#dfe9ff;--on-blue:#fff;--focus:#1a56db;
  --navy:#10243d;--nav-hover:#213a5b;--nav-ink:#cdd8e8;--nav-muted:#9db4d3;--brand-accent:#74a3ff;
  --overlay-bg:var(--surface);--pop-bg:var(--surface);--pop-ink:var(--ink);
}
:root[data-theme="pink"]{--navy:#3d1229;--nav-hover:#5e2142;--nav-ink:#f1d6e3;--nav-muted:#e0b2c9;--brand-accent:#ff9cc8;--hover-bg:#ffeaf3;--tag-bg:#fde3ee;--tag-ink:#8a2150;--bubble-me:#fbdbe9;--focus:#a3225a}
:root[data-theme="green"]{--navy:#0e2e24;--nav-hover:#1c4c3b;--nav-ink:#d3ebe0;--nav-muted:#a3d1bd;--brand-accent:#6fd3a8;--hover-bg:#e6f6ee;--tag-bg:#dcf2e7;--tag-ink:#17603f;--bubble-me:#d3efe1;--focus:#17603f}
:root[data-theme="dark"]{--surface:#2a3544;--input-bg:#1f2937;--hover-bg:#364560;--tag-bg:#35527f;--tag-ink:#e3edff;--bubble:#384659;--bubble-me:#2f4d7c;--on-blue:#0b1220;--focus:#9ec1ff;--navy:#0b1119;--nav-hover:#1c2736;--nav-ink:#d2dbe8;--nav-muted:#9fb0c6;--brand-accent:#79a6ff}
:root[data-theme="contrast"]{--ink:#fff;--muted:#e6e6e6;--line:#fff;--soft:#000;--blue:#ffd400;--on-blue:#000;--surface:#000;--input-bg:#000;--hover-bg:#222;--tag-bg:#000;--tag-ink:#ffd400;--bubble:#1a1a1a;--bubble-me:#00306b;--focus:#ffd400;--navy:#000;--nav-hover:#333;--nav-ink:#fff;--nav-muted:#e6e6e6;--brand-accent:#ffd400;--overlay-line:#fff}
body{background:var(--soft);color:var(--ink)}
/* Navigation follows the theme */
.sidebar{background:var(--navy);color:var(--nav-ink)}
nav a{color:var(--nav-ink)}nav a:hover,nav a.active{background:var(--nav-hover);color:#fff}
nav a.active{box-shadow:inset 3px 0 0 var(--brand-accent)}
.brand span{color:var(--brand-accent)}.tagline,.switchbox-label{color:var(--nav-muted)}
.nav-about{border-top-color:#ffffff33!important}.nav-about small{background:var(--nav-hover);color:var(--nav-ink)}
.round-btn.is-active{box-shadow:0 0 0 2px var(--brand-accent)}
.eyebrow{color:var(--blue)}
:root[data-theme="dark"] .eyebrow,:root[data-theme="contrast"] .eyebrow{color:var(--brand-accent)}
/* Surfaces */
.panel,.overview-card,.mail-layout,dialog,.ai-popup,.attachment,.attachment-actions,.dz-item{background:var(--surface);color:var(--ink)}
.overview-card:hover{background:var(--hover-bg)}
.icon-button,.tool,.code-button{background:var(--surface);color:var(--ink);border-color:var(--line)}
.primary,.ai-launcher,.ai-popup form button{background:var(--blue);color:var(--on-blue)}
.field input,.field select,.field textarea,.form-row input,.form-row select,.toolbar input,.chat-form input,.ai-popup input,#searchPanel input,.gridjs-input{background:var(--input-bg)!important;color:var(--ink)!important;border-color:var(--line)}
.tag-cloud,.dp-field,.ic-field{background:var(--input-bg)!important;border-color:var(--line)}
.tag{background:var(--tag-bg);color:var(--tag-ink)}
.mail-item.active{background:var(--hover-bg)}.mail-item,.mail-list{border-color:var(--line)}
.attachment-actions button,.attachment-actions a{color:var(--ink)}.attachment-actions button:hover,.attachment-actions a:hover{background:var(--hover-bg)}
.dropzone:hover,.dropzone.is-dragging,.upload-zone:hover,.upload-zone.is-dragging{background:var(--hover-bg)}
.upload-zone,.seg{background:var(--input-bg)}
td,th{border-color:var(--line)}td{color:var(--ink)}th{color:var(--muted)}
.subtext,.hint{color:var(--muted)}
.status{background:#e8f7ef;color:#0f5c37}
main select{background:var(--input-bg);color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:8px}
/* Chat */
.bubble,.mini-chat p{background:var(--bubble);color:var(--ink)}.bubble.me{background:var(--bubble-me);color:var(--ink)}
.mini-chat{color:var(--ink)}.ai-popup-head{background:var(--navy);color:#fff}
/* Overlays, pickers */
.overlay-panel,.dp-pop,.ic-list,.ti-list{background:var(--surface);color:var(--ink)}
.overlay-head,.overlay-foot,.overlay-tablist{border-color:var(--line)}
.overlay-tab[aria-selected=true]{color:var(--blue);border-bottom-color:var(--blue)}
:root[data-theme="dark"] .overlay-tab[aria-selected=true],:root[data-theme="contrast"] .overlay-tab[aria-selected=true]{color:var(--brand-accent);border-bottom-color:var(--brand-accent)}
.dp-day.is-selected{background:var(--blue);color:var(--on-blue)}
.seg input:checked+span{background:var(--blue);color:var(--on-blue)}
.overlay-head-extra select{background:var(--surface);color:var(--ink)}
/* Grid.js (its stylesheet hard-codes white) */
.gridjs-container,table.gridjs-table{color:var(--ink)}
.gridjs-wrapper{border-color:var(--line)!important;box-shadow:none!important}
td.gridjs-td{background:var(--surface)!important;color:var(--ink)!important}
th.gridjs-th{background:var(--soft)!important;color:var(--muted)!important}
th.gridjs-th-sort:hover,th.gridjs-th-sort:focus{background:var(--hover-bg)!important}
tr.gridjs-tr:hover td.gridjs-td{background:var(--hover-bg)!important}
.gridjs-footer{background:var(--surface)!important;border-color:var(--line)!important}
.gridjs-summary,.gridjs-pagination{color:var(--muted)!important}
.gridjs-pagination .gridjs-pages button,.gridjs-pagination button{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important;box-shadow:none!important}
.gridjs-pagination .gridjs-pages button:hover:not(:disabled){background:var(--hover-bg)!important}
.gridjs-pagination .gridjs-pages button:disabled{color:var(--muted)!important;opacity:.6}
.gridjs-pagination .gridjs-pages button.gridjs-currentPage{background:var(--hover-bg)!important;color:var(--ink)!important;font-weight:700}
.gridjs-sort{filter:none!important;color:var(--ink)!important}
.gridjs-sort svg,.gridjs-sort svg path{fill:currentColor!important;stroke:currentColor!important}
.inline-input{background:var(--input-bg);color:var(--ink)}
/* Accessibility */
.skip-link{position:fixed;left:12px;top:-60px;z-index:2000;background:var(--blue);color:var(--on-blue);padding:10px 16px;border-radius:8px;font-weight:700;text-decoration:none;transition:top .12s}
.skip-link:focus{top:12px}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.sidebar :focus-visible,.overlay-panel .code-wrap :focus-visible{outline-color:#fff}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
[tabindex="-1"]:focus{outline:none}
h1[tabindex="-1"]:focus-visible{outline:3px solid var(--focus)}
.overview-card[role=button],.mail-item[role=button]{outline-offset:-3px}
.rating button{background:none;border:0;font:inherit;color:inherit;cursor:pointer;padding:0 1px}
.viewer-toolbar span,#viewerStatus,.annotation-toolbar #toolStatus{font-size:12px}
.viewer-toolbar button:focus-visible,.annotation-toolbar button:focus-visible{outline-color:#fff}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media(forced-colors:active){.round-btn,.dp-day,.seg span{border:1px solid ButtonText}.round-btn.is-active,.dp-day.is-selected,.seg input:checked+span{outline:3px solid Highlight;forced-color-adjust:none;background:Highlight;color:HighlightText}}
/* Accent colour for text on light surfaces: darker than --blue where needed for 4.5:1 contrast */
:root{--accent-text:#1a56db}
:root[data-theme="pink"]{--accent-text:#a3225a}
:root[data-theme="green"]{--accent-text:#17603f}
:root[data-theme="dark"]{--accent-text:#9ec1ff}
:root[data-theme="contrast"]{--accent-text:#ffd400}
.view-tab[aria-selected=true],.overlay-tab[aria-selected=true],.eyebrow,.notes a,.dp-link,.ti-option.is-new,.about-foot a{color:var(--accent-text)!important}
.view-tab[aria-selected=true],.overlay-tab[aria-selected=true]{border-bottom-color:var(--accent-text)!important}
/* Close buttons: a native <button> would otherwise keep the dark UA text colour on a dark surface */
.close,.overlay-close,.info-close{color:var(--ink)!important;opacity:1}
.close:hover,.overlay-close:hover{background:var(--hover-bg);border-radius:6px}
.overlay-close{min-width:32px;min-height:32px}
