/* Melo Compass: global design tokens (light + dark), loaded after all other admin CSS.
   Light is the default. Dark is <html data-theme="dark">, chosen by melo-compass-theme.js (inline in the layout head): ?theme=dark|light|auto,
   the saved choice (localStorage "mc-theme") or, for "auto", the system. Nothing is dark by itself yet: the old pages are not all ready for it. These are variables and opt-in helper classes only: nothing here
   restyles an existing element, so a page looks the same until its components use the variables.
   Names are the ones of the Compass handbook (melo-compass.zip) so its markup can be used as it is. */

:root {
  /* --font (Heading Font) and --font-table (Text Font) are set from Contents > Fonts: App\Support\PlatformFonts prints them in the head of every layout */

  --bg: #fff;
  --fg: #111;
  --text-grey: #5a5a5a;
  --icon-grey: #7a7a7a;
  --grey: #5a5a5a;
  --red: #E50505;
  --line: #D9D9D9;
  --panel: #fff;
  --field: #fff;
  --field-line: #D9D9D9;
  --hover: rgba(0, 0, 0, .04);
  --hov: #F2F2F2;
  --row-hover: #FCF0F0;
  --focus: #FB927F;
  --stripe: #F5F5F5;
  --dash: #BDBDBD;

  --th: #EFF5FF;
  --th-text: #5a5a5a;

  /* tints: header of a card, tabs, status chips */
  --blue: #C6D5E8;
  --cream: #F5F4DE;
  --peach: #F8EBE0;
  --mauve: #E1D8E1;
  --rose: #FCF0F0;
  --actions: #E1D8E1;
  --all: #C6D5E8;
  --pending: #FCF0F0;
  --downloaded: #F5F4DE;
  --expired: #ECECEC;
  --act-tab: #F3FCE9;
  --cls-tab: #ECECEC;
  --dis: #F0F0F0;
  --no-bg: #FDDDD6;
  --no-text: #9C3A2A;
  --ok: #2f7d4f;
  --ok-bg: #E3F1E8;
  --off: #6b6b6b;
  --off-bg: #ECECEC;
  --foot: #EAEAEA;

  --tab-h: 43px;
  --tab-w: 190px;
}

:root[data-theme="dark"] {
  --bg: #17181a;
  --fg: #f2f2f2;
  --text-grey: #b5b5b5;
  --icon-grey: #9a9a9a;
  --grey: #b5b5b5;
  --line: #3a3b3e;
  --panel: #1e1f22;
  --field: #1e1f22;
  --field-line: #3a3b3e;
  --hover: rgba(255, 255, 255, .06);
  --hov: #2a2b2e;
  --stripe: #26272a;
  --dash: #5a5b5e;
  --th: #23304a;
  --th-text: #b5b5b5;
  --blue: #37465c;
  --cream: #46452f;
  --peach: #4b3f35;
  --mauve: #3b3440;
  --rose: #3a2c2c;
  --actions: #3b3440;
  --all: #37465c;
  --pending: #4d2b26;
  --downloaded: #46452f;
  --expired: #2e2f32;
  --act-tab: #1f3322;
  --cls-tab: #2e2f32;
  --dis: #26272a;
  --no-text: #f4b5a9;
  --ok: #7fd1a0;
  --ok-bg: #1f3a2b;
  --off: #c0c0c0;
  --off-bg: #2e2f32;
  --foot: #2c2d30;
}

/* NOT set yet on purpose: `color-scheme: dark` (Compass sets it). It would turn the native controls and
   scrollbars of every old page dark while its backgrounds are still white. Add it with the page shell. */

/* "melo shadow standard": the one shadow for cards, panels and bars. Wrap the block in <div class="lw">.
   (Compass wraps .actions, .panel, .card and .tb with a small script; that script is added together
   with the components, because Bootstrap's own .card would be wrapped too.) */
.lw {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}
.lw > * { margin: 0 !important; flex: 1 1 auto; }
.lw:has(> [hidden]) { display: none; }
.lw::after,
.lw::before {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.lw::after {
  left: -18px; right: -18px; bottom: -4.38px; height: .88px;
  background: linear-gradient(90deg, rgba(94, 94, 94, 0), rgba(94, 94, 94, .95) 5%, rgba(94, 94, 94, .95) 95%, rgba(94, 94, 94, 0));
  filter: blur(2.5px);
}
.lw::before {
  left: -30px; right: -30px; bottom: -4.55px; height: 2.55px;
  background: linear-gradient(90deg, rgba(94, 94, 94, 0), rgba(94, 94, 94, .28) 3%, rgba(94, 94, 94, .28) 97%, rgba(94, 94, 94, 0));
  filter: blur(7px);
}
.lw:hover,
.lw:focus-within,
.lw:has([data-tip]:hover) { z-index: 30; }
@media print { .lw::before, .lw::after { display: none; } }

/* Keyboard-only focus rings and tooltip balloons on top. Opt-in: put class "mc" on <body> of a page that
   has been moved to the new design (a script adds "kbd" to <body> while the keyboard is used). */
body.mc:not(.kbd) :focus,
body.mc:not(.kbd) :focus-visible { outline: none !important; }
body.mc [data-tip]::after,
body.mc [data-tip]::before { z-index: 2147483647 !important; }

@media (prefers-reduced-motion: reduce) {
  body.mc * { transition: none !important; }
}

/* tokens that single pages of the handbook define for themselves (help, letterhead, letters, verify): the same values here, so a converted page has them */
:root { --bad-bg: #F0D0D0; --hide-line: #F2A9A9; --hint: #8e8e8e; --lb: #b5b5b5; --ph: #b5b5b5; --teal: #009991; --tealb: #00796f; }
:root[data-theme="dark"] { --bad-bg: #4a2c2c; --hide-line: #7a3a3a; --hint: #8a8a8a; --ph: #6c6c6c; }

/* Icons by ID (Compass Convention, section 2): colour = the file as an image; grey and white = the same file as a mask over a flat colour. */
.ic{display:inline-block;vertical-align:middle;height:var(--ic-h,24px);width:auto;flex:none}
.ic-colour{object-fit:contain}
.ic-grey,.ic-white{-webkit-mask:var(--ic-url) center/contain no-repeat;mask:var(--ic-url) center/contain no-repeat}
.ic-grey{background-color:#7a7a7a}
.ic-white{background-color:#fff}

