/* alwaysdata intranet — base stylesheet */

/*
 * Brand typefaces: Archivo for headings, Open Sans for body copy, as set out
 * in the alwaysdata identity. Both are variable fonts under the SIL Open Font
 * License; see fonts/README.md. The latin-ext face is only downloaded if a
 * character outside Latin-1 is actually rendered.
 */

@font-face {
  font-family: Archivo;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/archivo-latin.cd56e2ec63d7.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Archivo;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.c5e41aa17045.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/opensans-latin.dcf31ebe1074.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/opensans-latin-ext.062c1f2aaf2d.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  /* alwaysdata brand. #E9568E is the historical colour, reserved for the
     logo; #E21D69 is the UI colour and everything else derives from it. */
  --brand: #E21D69;
  --brand-dark: #B91855;
  --brand-darker: #8C1241;
  --brand-soft: #FFE4EE;
  --brand-text: #B91855;
  /* Text drawn on top of --brand, and the hover shade underneath it. */
  --brand-on: #ffffff;
  --brand-hover: #B91855;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #f0f2f5;
  --border: #dfe3e8;
  --border-strong: #c4cad2;

  --text: #16191d;
  --text-muted: #61686f;
  --text-faint: #8b929a;

  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;

  /* Timeline layers, from background band to foreground bar. */
  --planned: #d5dae1;
  --presence: #8fa3bc;
  --counted: var(--brand);
  /* Calendar events: a pale fill per calendar, ink dark enough to read on it,
     and a stronger edge for the left border and the initials badge. The
     default tone is the company calendar. */
  --event-bg: #eef1f6;
  --event-edge: #c3cddb;
  --event-ink: #3c4a5c;
  --event-stripe: rgba(16, 24, 40, .06);
  /* The brand pink belongs to the company calendar alone, and carries further
     than the pastels the accounts pick from. */
  --event-company-bg: #ffdcea;
  --event-company-edge: #e9568e;
  --event-company-ink: #a3164f;
  /* Emphasis chart: the highlighted part in the accent, the rest as context.
     Pair validated for colour-blind and normal vision in both themes. */
  --chart-part: var(--brand);
  --chart-rest: #9aa3ad;
  /* Second series of a line chart, beside --chart-part; the pair is validated the same way. */
  --chart-second: #2563eb;
  /* Third series, after --chart-second, in the green of success; the three are validated together in both themes. */
  --chart-third: var(--ok);

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);

  --font: 'Open Sans', system-ui, sans-serif;
  --font-title: Archivo, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #E9568E;
    --brand-dark: #E21D69;
    --brand-darker: #B91855;
    --brand-soft: #412a37;
    --brand-text: #F58BB4;
    --brand-on: #14171a;
    /* Lighter on hover here: on a dark ground, darker reads as disabled. */
    --brand-hover: #F58BB4;

    --bg: #14171a;
    --surface: #1c2024;
    --surface-alt: #23282d;
    --border: #2f353b;
    --border-strong: #454c54;

    --text: #e8eaed;
    --text-muted: #a2abb4;
    --text-faint: #79828b;

    --ok: #4ade80;
    --ok-soft: #14351f;
    --warn: #fbbf24;
    --warn-soft: #3a2c0c;
    --bad: #f87171;
    --bad-soft: #3d1717;

    --planned: #3d444c;
    --presence: #54687f;
    --event-bg: #262c33;
    --event-edge: #3f4a57;
    --event-ink: #c4cfda;
    --event-stripe: rgba(255, 255, 255, .06);
    --event-company-bg: #45262f;
    --event-company-edge: #e9568e;
    --event-company-ink: #f7b6ce;
    --chart-rest: #4b535c;
    --chart-second: #3b82f6;
    /* --ok is too light for a bar. */
    --chart-third: #16a34a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  margin: 0 0 .4em;
  font-family: var(--font-title);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

/* ---------- Layout ---------- */

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
}

.main { min-width: 0; }

.page {
  max-width: 1120px;
  padding: 1.75rem 1.5rem 4rem;
}

/* For a page whose content gains from the whole screen, such as the calendar. */
.page--wide { max-width: none; padding-bottom: 1.75rem; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  max-height: 100vh;
  /* A screen shorter than the menu scrolls it, down to the logout. */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.1rem .75rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  padding: .2rem .6rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.sidebar__nav { display: grid; gap: 2px; align-content: start; }

/* A panel of its own: the clock is information, not a menu entry. */
.clock {
  display: grid;
  padding: .55rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  line-height: 1.25;
}
.clock__time {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.clock__date { font-size: .8rem; color: var(--text-muted); }

.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
}
.nav-link:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.nav-link__icon { width: 18px; height: 18px; flex: none; }
.nav-link__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Marks what only the staff sees, so they know it is not shown to everyone. */
.nav-link__restricted { display: inline-flex; flex: none; margin-left: auto; color: var(--text-faint); }
.nav-link__restricted svg { width: 16px; height: 16px; }
.nav-link.is-active .nav-link__restricted { color: var(--brand-text); }

/* Read out, never shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sidebar__foot { margin-top: auto; display: grid; gap: .75rem; }

.sidebar__user {
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: .1rem;
  font-size: .85rem;
}
.sidebar__name { padding: .2rem .6rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; }
.sidebar__name:hover { background: var(--surface-alt); color: var(--brand-text); text-decoration: none; }
.sidebar__user .button--link { justify-self: start; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    padding: .55rem .9rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar__nav { grid-auto-flow: column; gap: .25rem; }
  .sidebar__group { grid-auto-flow: column; align-items: center; gap: .25rem; }
  .sidebar__heading { display: none; }
  .clock { padding: .2rem .5rem; }
  .clock__time { font-size: 1rem; }
  .clock__date { display: none; }
  .nav-link span { white-space: nowrap; }
  .sidebar__foot {
    margin-top: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  .sidebar__user {
    padding-top: 0;
    border-top: 0;
    display: flex;
    align-items: center;
  }
  .sidebar__name { display: none; }
  .page { padding: 1.25rem 1rem 3rem; }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head p { margin: .15rem 0 0; color: var(--text-muted); font-size: .9rem; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card,
form + .card { margin-top: 1.25rem; }
.card__head {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card__head h2 { margin: 0; }
.card__body { padding: 1.1rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Buttons and forms ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
}
.button:hover { background: var(--surface-alt); text-decoration: none; }

/* Each variant restates its own background on hover: `.button:hover` is more
   specific than `.button--primary`, so without this the primary button would
   revert to the neutral surface and keep its light text — white on white. */
.button--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.button--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--brand-on);
}

.button--link { border: 0; background: none; color: var(--text-muted); padding: .2rem .6rem; }
.button--link:hover { background: none; color: var(--text); text-decoration: underline; }

.button--block { width: 100%; justify-content: center; }

/* A main action, its others in the menu beside it. */
.split-button { position: relative; display: inline-flex; }
.split-button > .button { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-button__more > summary {
  height: 100%;
  padding: .45rem .5rem;
  border-left-color: color-mix(in srgb, var(--brand-on) 35%, var(--brand));
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  list-style: none;
}
.split-button__more > summary::-webkit-details-marker { display: none; }
.split-button__more > summary .button__icon { transform: rotate(90deg); transition: transform .15s; }
.split-button__more[open] > summary .button__icon { transform: rotate(-90deg); }
.split-button__menu {
  position: absolute;
  top: calc(100% + .3rem);
  right: 0;
  z-index: 20;
  min-width: 100%;
  margin: 0;
  padding: .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 6px 20px rgb(0 0 0 / .12);
  list-style: none;
  white-space: nowrap;
}
.split-button__menu a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .875rem;
  text-decoration: none;
}
.split-button__menu a:hover { background: var(--surface-alt); }
/* Every action behind one button, in the same menu. */
.action-menu { position: relative; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary .button__icon { transform: rotate(90deg); transition: transform .15s; }
.action-menu[open] > summary .button__icon { transform: rotate(-90deg); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.field input, .field select, .field textarea, .period-nav select,
table.data input:not([type='checkbox']), table.data select, table.data textarea {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
}
.field input:focus, .field select:focus, .field textarea:focus, .period-nav select:focus,
table.data input:focus, table.data select:focus, table.data textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}
.field .helptext { display: block; margin-top: .25rem; font-size: .8rem; color: var(--text-faint); }
.field input:disabled, .field select:disabled, .field textarea:disabled {
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: not-allowed;
}
.field .errorlist { margin: .3rem 0 0; padding: 0; list-style: none; color: var(--bad); font-size: .82rem; }

.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.25rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.tab {
  margin-bottom: -1px;
  padding: .5rem .85rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand-text); border-bottom-color: var(--brand); }

.preferences { max-width: 760px; }
.preferences__note { margin: 0 0 .8rem; font-size: .9rem; color: var(--text-muted); }

/* Each choice is drawn as the event it will produce. */
/* One colour per line, its holders beside it. The margin keeps the ring of the
   chosen one clear of the label above. */
.samples { display: flex; flex-direction: column; gap: .6rem; margin-top: .9rem; }
.sample { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.sample__taken { font-size: .78rem; color: var(--text-faint); }
.sample input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sample__chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-width: 9rem;
  padding: .45rem .8rem;
  border: 1px solid var(--event-edge);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--event-bg);
  color: var(--event-ink);
  font-size: .85rem;
  font-weight: 500;
  opacity: .75;
}
/* The tick has its slot from the start, so nothing moves when it appears. */
.sample__chip::before { content: ''; width: .8rem; font-weight: 700; }
.sample:hover .sample__chip { opacity: 1; }
.sample input:checked + .sample__chip {
  border-color: var(--event-ink);
  border-left-width: 6px;
  font-weight: 700;
  opacity: 1;
}
.sample input:checked + .sample__chip::before { content: '✓'; }
.sample input:focus-visible + .sample__chip { outline: 2px solid var(--brand); outline-offset: 2px; }

.fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.fieldset + .fieldset { margin-top: .25rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
/* Floated, so the legend lays out like a heading instead of cutting the border. */
.fieldset legend {
  float: left;
  width: 100%;
  margin-bottom: .75rem;
  padding: 0;
  font-family: var(--font-title);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.form-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 1rem;
}
.field--wide { grid-column: 1 / -1; }
/* One field per line, with room between them. */
.form-grid--stacked { grid-template-columns: minmax(0, 1fr); }
.form-grid--stacked .field { margin-bottom: 1.4rem; }
/* A button closing a row of fields, level with their inputs. */
.form-grid__action { align-self: end; }

.messages { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .5rem; }
.messages li {
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .9rem;
}
.messages li.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.messages li.error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
  padding: .6rem .75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
}
table.data tbody tr:hover { background: var(--surface-alt); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--border-strong);
  border-bottom: 0;
  background: var(--surface-alt);
}
td.strong, th.strong { font-weight: 650; color: var(--text); }
td.muted { color: var(--text-muted); }
.person { display: flex; flex-direction: column; }
.person__name { font-weight: 600; }
.person__login { font-size: .78rem; color: var(--text-faint); }

.balance { font-weight: 600; }
.balance--over { color: var(--ok); }
.balance--under { color: var(--bad); }
.balance--even { color: var(--text-muted); }

.meter {
  width: 80px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
/* A block, or the span would ignore its width. */
.meter__fill { display: block; height: 100%; background: var(--brand); }

/* ---------- Period navigation ---------- */

.range-nav { display: grid; gap: 1.1rem; }
.range-nav h3 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  margin-bottom: .4rem;
}
.range-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.range-nav a {
  display: block;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .85rem;
}
.range-nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.range-nav a.is-active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

.range-steps { display: flex; align-items: center; gap: .35rem; }

/* ---------- Daily timeline ---------- */

.worktime-stats { margin-bottom: 1.25rem; }

.timeline { display: grid; gap: 2px; }

.timeline__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 76px;
  align-items: center;
  gap: .75rem;
  padding: .3rem .25rem;
  border-radius: var(--radius-sm);
}
.timeline__row:hover { background: var(--surface-alt); }
.timeline__row--weekend .timeline__day { color: var(--text-faint); }

.timeline__day { font-size: .85rem; color: var(--text-muted); }
.timeline__day b { color: var(--text); font-weight: 600; }

.timeline__track {
  position: relative;
  height: 22px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.timeline__bar { position: absolute; border-radius: 3px; }
.timeline__bar--planned { top: 3px; height: 16px; background: var(--planned); }
.timeline__bar--presence { top: 7px; height: 8px; background: var(--presence); }
.timeline__bar--counted { top: 7px; height: 8px; background: var(--counted); }

.timeline__total { text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; }

.timeline__axis {
  position: relative;
  height: 18px;
  margin: .35rem 0 0;
  grid-column: 2;
}
.timeline__tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: .7rem;
  color: var(--text-faint);
}

.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 18px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- Details ---------- */

details.periods { margin-top: .35rem; }
details.periods > summary {
  cursor: pointer;
  font-size: .82rem;
  color: var(--text-muted);
  padding: .2rem 0;
}
details.periods > summary:hover { color: var(--text); }
details.periods ul {
  margin: .4rem 0 .6rem;
  padding-left: 1.1rem;
  font-size: .82rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: .85rem 1rem; }
.stat__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.stat__value {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: .15rem;
}

.empty { color: var(--text-muted); font-size: .9rem; padding: 1.5rem 0; text-align: center; }

.badge {
  display: inline-block;
  padding: .05rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--muted { background: var(--surface-alt); color: var(--text-muted); }

/* ---------- Login ---------- */

.login {
  width: 100%;
  max-width: 340px;
  margin: 12vh auto;
  padding: 0 1.25rem;
}
.login h1 { font-size: 1.25rem; text-align: center; margin-bottom: 1.25rem; }
.login__hint { margin-top: 0; color: var(--text-muted); }
.login__hint:last-child { margin-bottom: 0; }
.login__link { margin-top: 1rem; text-align: center; font-size: .875rem; }

/* ---------- Brand marks ---------- */

.brand { display: flex; align-items: center; gap: .55rem; }
.brand__mark { width: 26px; height: auto; flex: none; }

.login__logo { display: block; width: 190px; height: auto; margin: 0 auto 1.25rem; }

/* ---------- Icon-only buttons ---------- */

.button--icon { padding: .4rem; }
.button__icon { width: 16px; height: 16px; flex: none; }

/* ---------- Sidebar groups ---------- */

.sidebar__group { display: grid; gap: .3rem; }

.sidebar__heading {
  margin: 0;
  padding: 0 .6rem;
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
}


/* ---------- Team directory ---------- */

.team-group + .team-group { margin-top: 1.9rem; }
.team-group__title {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: 0 0 .6rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -.015em;
}
.team-group__count {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.member {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.member__portrait { position: relative; flex: none; }

.member__photo,
.member__initials {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-alt);
}

.member__initials {
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.member__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--text-faint);
}
.member__dot--online { background: var(--ok); }
.member__dot--dnd { background: var(--bad); }
.member__dot--away { background: var(--warn); }
.member__dot--offline { background: var(--border-strong); }

.member__body { min-width: 0; }
.member__name { margin: 0; font-size: 1rem; }
.member__handle,
.member__status,
.member__email { margin: .1rem 0 0; font-size: .82rem; color: var(--text-muted); }
.member__handle { font-family: var(--mono); color: var(--text-faint); }
.member__email a { overflow-wrap: anywhere; }

/* ---------- Impersonation ---------- */

.impersonation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid var(--warn);
  font-size: .85rem;
}
.impersonation b { font-weight: 650; }
.impersonation form { margin: 0; }

.button--small { padding: .25rem .6rem; font-size: .8rem; }

/* Pushed to the far edge of the card, clear of the text. */
.member__impersonate { margin-left: auto; flex: none; }
.member__impersonate .button { color: var(--text-faint); }
.member__impersonate .button:hover { color: var(--brand-text); border-color: var(--brand); }

/* ---------- Tools ---------- */

.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li + li { border-top: 1px solid var(--border); }
.tool-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .9rem 1.25rem;
}
.tool-item__name {
  font-family: var(--font-title);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.tool-item__name:hover {
  color: var(--brand-text);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
.tool-item__name:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.tool-item__desc {
  margin: .2rem 0 0;
  max-width: 62ch;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.tool-item__date {
  flex: none;
  font-family: var(--font-title);
  font-size: .78rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Outside its card, so a category reads as a section rather than a row. */
.tool-category + .tool-category { margin-top: 1.9rem; }
.tool-category__title {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: 0 0 .6rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -.015em;
}
.tool-category__count {
  font-size: .8rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

/* ---------- Agenda ---------- */

.agenda { margin-bottom: 1.5rem; }
.agenda__links { display: flex; justify-content: flex-end; gap: .6rem; margin: 0 0 .75rem; }
.agenda [hidden], .agenda-dialog [hidden] { display: none !important; }

:is(.agenda, .leave-calendar) .fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface-alt);
  --fc-list-event-hover-bg-color: var(--surface-alt);
  /* A faint brand tint: grey marks the leave days, and each other hue an account. */
  --fc-today-bg-color: color-mix(in srgb, var(--brand) 6%, var(--surface));
  --fc-now-indicator-color: var(--brand);
  --fc-button-text-color: var(--text);
  --fc-button-bg-color: var(--surface);
  --fc-button-border-color: var(--border-strong);
  --fc-button-hover-bg-color: var(--surface-alt);
  --fc-button-hover-border-color: var(--border-strong);
  --fc-button-active-bg-color: var(--brand-soft);
  --fc-button-active-border-color: var(--brand);
  font-size: .88rem;
}
:is(.agenda, .leave-calendar) .fc .fc-toolbar-title { font-family: var(--font-title); font-size: 1.15rem; font-weight: 600; }
:is(.agenda, .leave-calendar) .fc .fc-button { font-size: .82rem; }
:is(.agenda, .leave-calendar) .fc .fc-button-primary:not(:disabled).fc-button-active { color: var(--brand-text); }
:is(.agenda, .leave-calendar) .fc .fc-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
/* Today stands out: its date in a brand disc, its column headed in brand text. */
:is(.agenda, .leave-calendar) .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  display: grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  margin: .2rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-on);
  font-weight: 700;
}
:is(.agenda, .leave-calendar) .fc .fc-col-header-cell.fc-day-today,
:is(.agenda, .leave-calendar) .fc .fc-list-day.fc-day-today .fc-list-day-cushion { box-shadow: inset 0 3px 0 var(--brand); }
:is(.agenda, .leave-calendar) .fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion,
:is(.agenda, .leave-calendar) .fc .fc-list-day.fc-day-today .fc-list-day-cushion a { color: var(--brand-text); font-weight: 700; }
/* Every event opens its details; FullCalendar only shows a pointer on some of them. */
:is(.agenda, .leave-calendar) .fc .fc-event { cursor: pointer; }

:is(.agenda, .leave-calendar) .fc .fc-event {
  background: var(--event-bg);
  border: 1px solid var(--event-edge);
  border-left-width: 3px;
}
:is(.agenda, .leave-calendar) .fc .fc-event .fc-event-main { color: var(--event-ink); }
/* The company calendar wears the brand pink, and a heavier edge with it. */
:is(.agenda, .leave-calendar) .fc .agenda-event--company {
  --event-bg: var(--event-company-bg);
  --event-edge: var(--event-company-edge);
  --event-ink: var(--event-company-ink);
  border-left-width: 4px;
}
:is(.agenda, .leave-calendar) .fc .agenda-event--company .agenda-event__title { font-weight: 600; }

/* One hue per account, evenly spaced around the wheel. The pink band is left
   out: it belongs to the company calendar. */
[class*='agenda-tone-'], [class*='leave-event--'] {
  --s: 62%;
  --event-bg: hsl(var(--h) var(--s) 93%);
  --event-edge: hsl(var(--h) var(--s) 66%);
  --event-ink: hsl(var(--h) var(--s) 29%);
}
@media (prefers-color-scheme: dark) {
  [class*='agenda-tone-'], [class*='leave-event--'] {
    --event-bg: hsl(var(--h) calc(var(--s) / 2.5) 16%);
    --event-edge: hsl(var(--h) calc(var(--s) / 1.8) 36%);
    --event-ink: hsl(var(--h) var(--s) 76%);
  }
}
.agenda-tone-1 { --h: 15; }
.agenda-tone-2 { --h: 35; }
.agenda-tone-3 { --h: 55; }
.agenda-tone-4 { --h: 75; }
.agenda-tone-5 { --h: 100; }
.agenda-tone-6 { --h: 130; }
.agenda-tone-7 { --h: 155; }
.agenda-tone-8 { --h: 175; }
.agenda-tone-9 { --h: 195; }
.agenda-tone-10 { --h: 215; }
.agenda-tone-11 { --h: 235; }
.agenda-tone-12 { --h: 255; }
.agenda-tone-13 { --h: 275; }
.agenda-tone-14 { --h: 295; }
/* Nearly grey, for whoever would rather not carry a colour. */
.agenda-tone-15 { --h: 215; --s: 12%; }
/* Leave calendar: the colour says the status, and own leave reads apart from the team's. */
.leave-event--approved { --h: 215; }
.leave-event--approved.leave-event--mine { --h: 150; }
.leave-event--pending { --h: 35; }
.leave-calendar .fc .leave-event--pending { border-style: dashed; }
/* Nothing to open on a colleague's absence. */
.leave-calendar .fc .leave-event--closed { cursor: default; }
.leave-event { display: flex; align-items: center; gap: .3rem; min-width: 0; padding-left: .25rem; }
.leave-event__badge {
  flex: none;
  padding: .1rem .3rem;
  border-radius: 4px;
  background: var(--event-edge);
  color: var(--event-ink);
  font-size: .7rem;
  font-weight: 700;
}
.leave-event__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leave-event__document { flex: none; margin-left: auto; color: inherit; }
.leave-event__document svg { width: 14px; height: 14px; }

/* The details of one absence, in the colour of its kind. */
.leave-dialog {
  width: min(460px, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--event-edge);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
}
.leave-dialog::backdrop { background: rgba(16, 24, 40, .35); }
.leave-dialog h2 { margin: 0 0 .5rem; color: var(--event-ink); }
.leave-dialog__owner {
  display: inline-block;
  margin: 0 0 1rem;
  padding: .15rem .45rem;
  border-radius: var(--radius-sm);
  background: var(--event-bg);
  color: var(--event-ink);
  font-size: .85rem;
}
.leave-dialog__facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; margin: 0 0 1.25rem; }
.leave-dialog__facts dt { color: var(--text-muted); font-size: .85rem; }
.leave-dialog__facts dd { margin: 0; }

/* Own events read first. */
:is(.agenda, .leave-calendar) .fc .agenda-event--mine .agenda-event__title { font-weight: 600; }
/* Days another application puts on the calendar: read-only, hence set apart. */
:is(.agenda, .leave-calendar) .fc .agenda-event--leave {
  --event-bg: var(--surface-alt);
  --event-edge: var(--border-strong);
  --event-ink: var(--text-muted);
  border-left-style: dashed;
}
:is(.agenda, .leave-calendar) .fc .agenda-event--private {
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--event-stripe) 6px 12px);
}

/* One line per event: the initials of its calendar, the time, then the title. */
.agenda-event { display: flex; align-items: baseline; gap: .3rem; min-width: 0; padding-left: .25rem; }
.agenda-event__badge {
  flex: none;
  align-self: center;
  padding: .1rem .3rem;
  border-radius: 4px;
  background: var(--event-edge);
  color: var(--event-ink);
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
}
.agenda-event__avatar {
  flex: none;
  align-self: center;
  width: var(--avatar-size, 18px);
  height: var(--avatar-size, 18px);
  border-radius: 50%;
  object-fit: cover;
  background: var(--event-edge);
}
/* The company's brand mark: whole, not cropped round like a face. */
.agenda-event__avatar--logo { border-radius: 0; object-fit: contain; background: none; }
/* The list view has room to spare. */
:is(.agenda, .leave-calendar) .fc-list-event .agenda-event__avatar { --avatar-size: 22px; }
.agenda-event__time { flex: none; font-size: .72rem; opacity: .8; font-variant-numeric: tabular-nums; }
.agenda-event__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agenda-dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
}
.agenda-dialog::backdrop { background: rgba(16, 24, 40, .35); }
.agenda-dialog h2 { margin: 0 0 .75rem; }
.agenda-dialog__owner { margin: -.4rem 0 .75rem; font-size: .85rem; color: var(--text-muted); }
.agenda-dialog__errors { margin: 0 0 .75rem; padding-left: 1.1rem; color: var(--bad); font-size: .85rem; }

/* The dialog wears the colour of the calendar it is about. */
.agenda-dialog { border-top: 4px solid var(--event-edge); }
.agenda-dialog h2 { color: var(--event-ink); }
.agenda-dialog__owner {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: var(--radius-sm);
  background: var(--event-bg);
  color: var(--event-ink);
}
.agenda-dialog--company {
  --event-bg: var(--event-company-bg);
  --event-edge: var(--event-company-edge);
  --event-ink: var(--event-company-ink);
}
.agenda-dialog__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.agenda-dialog__check { display: flex; align-items: center; gap: .45rem; margin: 0 0 1rem; font-size: .9rem; }
.agenda-dialog__note { margin: -.5rem 0 1rem; font-size: .8rem; color: var(--text-faint); }
/* The description as Markdown renders it. */
.agenda-dialog__description {
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.agenda-dialog__description > :first-child { margin-top: 0; }
.agenda-dialog__description > :last-child { margin-bottom: 0; }
.agenda-dialog__description :is(p, ul, ol, pre, table) { margin: 0 0 .5rem; }
.agenda-dialog__description :is(ul, ol) { padding-left: 1.2rem; }
.agenda-dialog__description pre { overflow-x: auto; }
.agenda-dialog__description img { max-width: 100%; }
.agenda-dialog__session { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 1rem; font-size: .85rem; color: var(--text-muted); }
/* Tinted with the calendar's colour, so the reminders read apart from the event
   fields; grey is for what cannot be edited. */
.agenda-dialog__reminders {
  margin: 0 0 1rem;
  padding: .75rem .85rem .5rem;
  border: 1px solid var(--event-edge);
  border-radius: var(--radius-sm);
  background: var(--event-bg);
}
.agenda-dialog__reminders legend {
  float: left;
  width: 100%;
  margin-bottom: .5rem;
  padding: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--event-ink);
}
.agenda-dialog__reminders [data-reminders] { clear: both; }
.agenda-reminder {
  display: grid;
  gap: .4rem;
  margin-bottom: .6rem;
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
/* Cancels the link buttons' own padding, whichever of them is shown first. */
.agenda-reminder__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-left: -.6rem; }
.agenda-reminder__line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.agenda-reminder textarea { resize: vertical; }
.agenda-reminder [data-send]:disabled { opacity: .5; }
.agenda-reminder__status { font-size: .8rem; color: var(--text-muted); }
.agenda-reminder select,
.agenda-reminder textarea {
  padding: .4rem .5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
}
.agenda-dialog__delete { margin-left: auto; color: var(--bad); }
.agenda-dialog :disabled { cursor: default; }

@media (max-width: 520px) {
  .agenda-dialog__row { grid-template-columns: 1fr; }
}

/* ---------- Page actions and year navigation ---------- */

.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
/* Year links, and the year-or-month select the leave tables are browsed with. */
.period-nav { display: flex; align-items: center; gap: .35rem; }
.period-nav select { width: auto; }
.leave-toolbar { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
table.data td.leave-position input { width: 5rem; }
/* The days taken per kind, read after the total. */
.leave-detail { font-size: .82rem; }
.leave-detail span + span::before { content: ' · '; }
.year-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.year-nav a { padding: .3rem .6rem; border-radius: var(--radius-sm); color: var(--text-muted); font-size: .85rem; }
.year-nav a:hover { background: var(--surface-alt); text-decoration: none; }
.year-nav a.is-active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

/* ---------- Column chart ---------- */

.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .5rem; font-size: .8rem; color: var(--text-muted); }
.chart-legend__key::before {
  content: '';
  display: inline-block;
  width: .7rem;
  height: .7rem;
  margin-right: .4rem;
  border-radius: 2px;
  vertical-align: -1px;
  background: var(--key);
}
.chart-legend__key--part { --key: var(--chart-part); }
.chart-legend__key--rest { --key: var(--chart-rest); }

.chart { position: relative; }
.chart__scroll { overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 560px; height: auto; }
.chart__grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart__tick,
.chart__label { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart__hit { fill: transparent; }
.chart__seg--part { fill: var(--chart-part); }
.chart__seg--rest { fill: var(--chart-rest); }
.chart__column { cursor: default; outline: none; }
.chart__column:hover .chart__hit,
.chart__column:focus-visible .chart__hit { fill: var(--surface-alt); }
.chart__column:focus-visible .chart__hit { stroke: var(--brand); stroke-width: 1.5; }

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 11rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.chart-tooltip p { margin: 0; }
.chart-tooltip__total { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tooltip__label { margin-bottom: .3rem !important; font-size: .8rem; color: var(--text-muted); }
.chart-tooltip__row { font-size: .82rem; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tooltip__row::before {
  content: '';
  display: inline-block;
  width: .8rem;
  height: 2px;
  margin-right: .45rem;
  vertical-align: middle;
  background: var(--key);
}
.chart-tooltip__row--part { --key: var(--chart-part); }
.chart-tooltip__row--rest { --key: var(--chart-rest); }

/* Grouped column chart of _grouped_chart.html: series by slot. */
.grouped-chart--first { --series: var(--chart-part); }
.grouped-chart--second { --series: var(--chart-second); }
.grouped-chart--third { --series: var(--chart-third); }
.grouped-chart svg { min-width: 0; }
.grouped-chart__bar { fill: var(--series); }
.grouped-chart__band { outline: none; }
.grouped-chart__band:hover .chart__hit,
.grouped-chart__band:focus-visible .chart__hit { fill: var(--surface-alt); }
.grouped-chart__band:focus-visible .chart__hit { stroke: var(--brand); stroke-width: 1.5; }
.chart-tooltip__row.grouped-chart--first,
.chart-tooltip__row.grouped-chart--second,
.chart-tooltip__row.grouped-chart--third { --key: var(--series); }

/* ---------- AI usage ---------- */

.aiusage-total__label { margin: 0; font-size: .85rem; color: var(--text-muted); }
.aiusage-total__value {
  margin: .1rem 0 0;
  font-family: var(--font-title);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.aiusage-total__mine { margin: .2rem 0 1.25rem; font-size: .9rem; color: var(--text-muted); }
.aiusage-total__value span { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.aiusage-hint { margin: 0 0 1rem; font-size: .8rem; color: var(--text-faint); }
.aiusage-entry__actions { text-align: right; }
.aiusage-entry__actions form { margin: 0; }
.aiusage-dialog {
  width: min(420px, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
}
.aiusage-dialog::backdrop { background: rgba(16, 24, 40, .35); }
.aiusage-dialog h2 { margin: 0 0 .75rem; }
.aiusage-data { margin-top: 1rem; }
.aiusage-data > summary { cursor: pointer; font-size: .85rem; color: var(--text-muted); }
.aiusage-data > summary:hover { color: var(--text); }

/* ---------- Leave ---------- */

.leave-stats { margin-bottom: 1.25rem; }
.leave-stats__note { margin-top: .1rem; font-size: .8rem; color: var(--text-muted); }
.leave-inbox {
  margin: 0 0 1.25rem;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .9rem;
}
.leave-inbox a { color: inherit; font-weight: 600; }
.leave-form { max-width: 560px; }
.leave-note { margin: 0 0 1rem; font-size: .9rem; color: var(--text-muted); }
.leave-actions, .row-actions { display: flex; align-items: center; justify-content: flex-end; gap: .1rem; }
.leave-actions form, .row-actions form { margin: 0; }
.leave-actions .button--icon:hover, .row-actions .button--icon:hover { color: var(--brand-text); }
.leave-actions .leave-actions__cancel:hover, .row-actions .row-actions__danger:hover { color: var(--bad); }
.leave-comment, .leave-reason { white-space: normal; font-size: .82rem; }
table.data td.leave-reason { max-width: 22rem; }
.leave-decision { display: flex; align-items: center; gap: .4rem; }
.leave-decision textarea {
  width: 12rem;
  padding: .3rem .5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  resize: vertical;
}

/* ---------- Bug bounty ---------- */

.bounty-stats { margin-bottom: 1.25rem; }
.bounty-due { color: var(--warn); }
.bounty-stats__note { margin-top: .1rem; font-size: .8rem; color: var(--text-muted); }

.bounty-table td { vertical-align: top; }
/* The report column takes the room left by the others, sized to their content. */
table.data td.bounty-table__report { width: 100%; min-width: 20rem; white-space: normal; }
.bounty-table__title { font-weight: 600; color: var(--text); }
.bounty-table__title:hover { color: var(--brand-text); }
.bounty-table__meta { margin-top: .15rem; font-size: .8rem; color: var(--text-muted); }
.bounty-table__notes {
  margin-top: .4rem;
  padding-left: .6rem;
  border-left: 2px solid var(--border);
  font-size: .8rem;
  color: var(--text-faint);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.bounty-table__date { margin-top: .2rem; font-size: .78rem; color: var(--text-faint); }
.bounty-table .muted { color: var(--text-faint); }

.bounty-badge {
  display: inline-block;
  padding: .05rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.6;
}
.bounty-badge--paid { background: var(--ok-soft); color: var(--ok); }
.bounty-badge--due { background: var(--warn-soft); color: var(--warn); }
/* The payment waits on the hunter's name or customer account. */
.bounty-badge--missing {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .3rem;
  background: var(--bad);
  /* The page colour: white on the light theme's deep red, dark on the dark theme's pale one. */
  color: var(--surface);
  white-space: nowrap;
}
.bounty-badge__icon { width: 14px; height: 14px; }
table.data tbody tr.bounty-table__row--missing { background: var(--bad-soft); }
table.data tbody tr.bounty-table__row--missing td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.bounty-missing { color: var(--bad); }

.bounty-form { max-width: 760px; }
/* A shortcut filling the report fields, not a field of its own: set apart from the fieldsets. */
.field.bounty-shortcut {
  margin-bottom: 1.4rem;
  padding: .8rem 1rem .85rem;
  border: 1px dashed var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}
.bounty-shortcut label { color: var(--brand-text); }
.bounty-shortcut .helptext { color: var(--text-muted); }
.bounty-form .form-actions { padding-top: 1.1rem; border-top: 1px solid var(--border); }
.bounty-notice {
  margin: 0 0 1.1rem;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .88rem;
}

/* ---------- Seminars ---------- */

.seminar-form { max-width: 760px; }
table.data td.seminar-table__name { width: 100%; white-space: normal; }
.seminar-table__meta { margin-top: .15rem; font-size: .8rem; color: var(--text-faint); }
/* Going over the budget is allowed, and shown. */
.seminar-over { color: var(--bad); font-weight: 600; }
.seminar-filter { display: flex; align-items: center; gap: .5rem; }
.seminar-filter select {
  padding: .4rem .6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
}
.seminar-notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 1rem;
  margin: 0 0 1.25rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .9rem;
}
.seminar-notice p { margin: 0; }
.seminar-notice a { color: inherit; font-weight: 600; }
/* As bank statements tell them apart. */
table.data td.seminar-debit { color: var(--bad); }
table.data td.seminar-credit { color: var(--ok); }
/* Green within the budget, orange close to it, red past it. */
.seminar-level--ok { --level: var(--ok); }
.seminar-level--warn { --level: var(--warn); }
.seminar-level--bad { --level: var(--bad); }
.seminar-meter .meter__fill { background: var(--level); }
/* A small heading above the title, saying what kind of page this is. */
.page-head p.seminar-head__eyebrow {
  margin: 0 0 .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.seminar-facts { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: .5rem 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: .88rem; }
.seminar-facts li { display: inline-flex; align-items: center; gap: .35rem; }
.seminar-facts svg, .seminar-map__foot svg { width: 16px; height: 16px; color: var(--text-faint); }

.seminar-overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
/* Budget, categories, then a small map, all as tall: the expenses below get the room.
   The categories get more, so their names keep to one line. */
.seminar-overview--three { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
@media (max-width: 1000px) {
  .seminar-overview--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seminar-overview--three .seminar-map { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .seminar-overview, .seminar-overview--three { grid-template-columns: 1fr; }
}
.seminar-overview .card + .card { margin-top: 0; }

.seminar-map { display: flex; flex-direction: column; overflow: hidden; }
.seminar-map__frame { display: block; flex: 1; width: 100%; min-height: 160px; border: 0; }
.seminar-map__foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.1rem; border-top: 1px solid var(--border); font-size: .85rem; }
.seminar-map__foot span { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-muted); }
.seminar-map__none { display: grid; place-items: center; gap: .5rem; flex: 1; min-height: 120px; padding: 1rem; color: var(--text-muted); text-align: center; background: var(--surface-alt); }
.seminar-map__none svg { width: 28px; height: 28px; color: var(--text-faint); }
.seminar-map__none p { margin: 0; font-size: .88rem; }

.seminar-budget__label { margin: 0 0 .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.seminar-budget__spent { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.seminar-budget__spent strong { font-family: var(--font-title); font-size: 1.9rem; line-height: 1.1; }
.seminar-budget__spent span { color: var(--text-muted); }
.seminar-budget__bar { height: 8px; border-radius: 4px; background: var(--surface-alt); overflow: hidden; }
.seminar-budget__bar span { display: block; height: 100%; border-radius: 4px; background: var(--level); }
.seminar-budget__foot { display: flex; justify-content: space-between; gap: 1rem; margin: .55rem 0 0; font-size: .82rem; color: var(--text-muted); }

.seminar-split { display: flex; align-items: center; gap: 1.25rem; }
.seminar-pie { width: 96px; height: 96px; flex: none; }
.seminar-legend { flex: 1; border-collapse: collapse; font-size: .85rem; }
.seminar-legend td { padding: .2rem .4rem; }
.seminar-legend td:not(:first-child) { text-align: right; white-space: nowrap; }
.seminar-swatch { display: inline-block; width: .7rem; height: .7rem; margin-right: .45rem; border-radius: 2px; vertical-align: -1px; }

.seminar-surprise .card__body { display: grid; justify-items: center; gap: .3rem; padding: 2.5rem 1rem; text-align: center; }
.seminar-surprise svg { width: 44px; height: 44px; margin-bottom: .5rem; color: var(--brand-text); }
.seminar-surprise p { margin: 0; }
.seminar-table__surprise a { display: inline-flex; align-items: center; gap: .35rem; }
.seminar-table__surprise svg { width: 16px; height: 16px; color: var(--brand-text); }
/* A gap the colour of the card between slices, so neighbours read apart. */
.seminar-slice { stroke: var(--surface); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
table.data td.seminar-colour input[type='color'] { width: 3rem; height: 2.1rem; padding: .15rem; }

/* ---------- Expenses ---------- */

.expense-decision { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.expense-decision input { min-width: 12rem; }
.expense-reimburse { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.expense-reimburse .field { margin-bottom: 0; }

/* ---------- Documents ---------- */

.document-generators { margin: 0; padding: 0; list-style: none; }
.document-generators li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; }
.document-generators li + li { border-top: 1px solid var(--border); }
.document-generators div { display: flex; flex-direction: column; gap: .15rem; }
.document-decision { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.document-decision input { min-width: 12rem; }
.document-settings { max-width: 720px; }
.document-signature { display: block; max-width: 240px; max-height: 90px; margin-bottom: 1rem; }
.document-grants { margin: 0 0 1rem; padding: 0; border: 0; }
.document-grants legend { margin-bottom: .4rem; font-weight: 600; }
.document-grants div { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.document-grants label { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }

/* ---------- CRM ---------- */

.crm-tabs { margin-top: -.25rem; }
/* Under the tabs: what the tab shows, and its own actions. */
.crm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.crm-toolbar p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.crm-toolbar .button, .crm-board .card__head .button, .crm-bulk .button { border-color: var(--brand-soft); background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.crm-toolbar .button { margin-left: auto; }
.crm-toolbar .button:hover, .crm-board .card__head .button:hover, .crm-bulk .button:not(:disabled):hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.crm-toolbar .button::before { content: '+'; font-size: 1.1rem; line-height: 1; }
.crm-tabs .tab:hover { text-decoration: none; }
.crm-head__back { display: inline-block; margin-bottom: .2rem; font-size: .85rem; color: var(--text-muted); }
.crm-head__back::before { content: '‹ '; }
.crm-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
/* What the page is about: a prospect or a case. */
.crm-type {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}
.crm-type svg { width: 1rem; height: 1rem; }
.crm-head h1 .badge, .crm-type { font-family: var(--font); letter-spacing: normal; }
.page-actions form { margin: 0; }

/* A kind of exchange: its icon on a disk tinted with its colour. */
.crm-kind {
  --kind: var(--text-faint);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kind) 16%, var(--surface));
  color: var(--kind);
}
.crm-kind svg { width: 1.05rem; height: 1.05rem; }

.crm-status { background: var(--surface-alt); color: var(--text-muted); }
button.crm-status { border: 0; font-family: inherit; cursor: pointer; }
button.crm-status:hover { box-shadow: 0 0 0 2px currentColor; }
.crm-dialog {
  width: min(380px, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
}
.crm-dialog::backdrop { background: rgba(16, 24, 40, .35); }
.crm-dialog h2 { margin: 0 0 .25rem; }
.crm-dialog [hidden] { display: none; }
.crm-dialog .crm-dialog__check { display: flex; align-items: center; gap: .45rem; margin-top: .5rem; font-size: .85rem; font-weight: 400; }
.crm-dialog .crm-dialog__check input { width: auto; margin: 0; padding: 0; accent-color: var(--brand); }
.crm-bulk { justify-content: flex-start; flex-wrap: wrap; gap: .6rem; }
.crm-bulk__all { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 600; }
.crm-bulk__count { margin-right: auto; font-size: .82rem; color: var(--text-muted); }
.crm-bulk input, .crm-table__pick input { width: 1rem; height: 1rem; accent-color: var(--brand); }
.crm-table__pick { width: 1px; padding-right: 0; }
.crm-status--open { background: var(--brand-soft); color: var(--brand-text); }
.crm-status--won { background: var(--ok-soft); color: var(--ok); }
.crm-status--closed { background: var(--bad-soft); color: var(--bad); }

/* An entry of an admin list, its icon before its name. */
.crm-choice { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.crm-choice + .crm-choice { margin-left: .75rem; }
.crm-choice svg { width: .95rem; height: .95rem; flex: none; color: var(--text-muted); }

img.crm-person { padding: 0; object-fit: cover; background: var(--surface-alt); }
.crm-person {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.crm-done { margin: 0; }
.crm-done__button {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  cursor: pointer;
}
.crm-done__button svg { width: 1rem; height: 1rem; }
.crm-done__button:hover { border-color: var(--ok); color: var(--ok); }
.crm-done__button.is-done { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.crm-done__button.is-done:hover { border-color: var(--border-strong); color: var(--text-muted); }
.crm-done__button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.crm-switch { display: flex; padding: .15rem; border-radius: 999px; background: var(--surface-alt); font-size: .8rem; }
.crm-switch a { padding: .2rem .7rem; border-radius: 999px; color: var(--text-muted); white-space: nowrap; }
.crm-switch a:hover { color: var(--text); text-decoration: none; }
.crm-switch a[aria-current] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* ----- Contact requests ----- */

.crm-requests { display: grid; gap: .75rem; margin: 0; padding: 1rem 1.1rem; list-style: none; }
.crm-request { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.crm-requests-card .card__head { flex-wrap: wrap; gap: .5rem; }
.crm-request:target { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.crm-request__head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.crm-request__head .badge--muted { background: var(--surface); }
/* Given to an agent: marked, and named in the head. */
.crm-request--assigned { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); border-left: 4px solid var(--brand); }
.crm-request--assigned .crm-request__head { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.crm-request__agent { display: inline-flex; align-items: center; gap: .4rem; padding: .1rem .6rem .1rem .15rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--brand); color: var(--brand-text); font-size: .82rem; font-weight: 600; }
/* Kept apart from grey backgrounds. */
.crm-request__head .badge--warn, .badge.crm-count { box-shadow: inset 0 0 0 1px var(--warn); }
/* The icon of a CRM object: a building for a prospect, a briefcase for a case, a bubble for an exchange,
   an envelope for a contact request, a server for a host; a person for a contact, a globe for a site. */
.crm-object { width: 1em; height: 1em; margin-right: .4rem; vertical-align: -.15em; }
h2 .crm-object { color: var(--text-muted); }
.crm-request__body { padding: .1rem 1rem .9rem; }
.crm-request__date { margin-left: auto; color: var(--text-faint); font-size: .85rem; }
/* A long message shows its first lines, the rest on demand. */
.crm-request__message { max-height: 7.75em; margin: .6rem 0 0; overflow: hidden; }
.crm-request__message.is-clamped { mask-image: linear-gradient(#000 55%, transparent); }
.crm-request__message.is-open { max-height: none; mask-image: none; }
.crm-request__more { margin-top: .3rem; padding-left: 0; color: var(--brand-text); font-weight: 600; }
.crm-request__more::after { content: ' ▾'; }
.crm-request__more[aria-expanded='true']::after { content: ' ▴'; }
.crm-request__more[hidden] { display: none; }
.crm-request__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .8rem; }
.crm-request__actions form { margin: 0; }
.crm-request__assign { display: flex; gap: .4rem; }
/* Apart from the select it acts on. */
.crm-request__give { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand-text); }
.crm-request__give:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
.crm-request__actions .crm-request__dismiss { color: var(--bad); }

/* ----- Dashboard ----- */

.crm-board .card__head { flex-wrap: wrap; gap: .5rem; }
.crm-case-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--border); }
.crm-case-stats > div { padding: .6rem 1.1rem; }
.crm-case-stats > div + div { border-left: 1px solid var(--border); }
.crm-case-stats dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.crm-case-stats dd { margin: 0; font-family: var(--font-title); font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-case-stats dd.crm-case-stats__note { font-family: inherit; font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.crm-activity__legend { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-bottom: .75rem; }
.crm-activity__series { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: baseline; }
.crm-activity__series::before { content: ''; width: .9rem; height: 3px; border-radius: 2px; background: var(--series); align-self: center; }
.crm-activity__name { font-size: .85rem; color: var(--text-muted); }
.crm-activity__total { grid-column: 2; font-family: var(--font-title); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-activity__before { grid-column: 2; font-size: .8rem; color: var(--text-muted); }
.crm-board { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.crm-board .card + .card { margin-top: 0; }
.crm-board__wide { grid-column: 1 / -1; }
.crm-new-requests .crm-cases__prospect { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1040px) {
  .crm-board { grid-template-columns: minmax(0, 1fr); }
}

.crm-cases { margin: 0; padding: .35rem 0; list-style: none; }
.crm-cases li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: 'title odds person' 'prospect odds person';
  align-items: center;
  gap: 0 .75rem;
  padding: .55rem 1.1rem;
}
.crm-cases li + li { border-top: 1px solid var(--border); }
.crm-cases__title { grid-area: title; font-weight: 600; color: var(--text); }
.crm-cases__prospect { grid-area: prospect; font-size: .82rem; color: var(--text-muted); }
.crm-cases__odds { grid-area: odds; display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.crm-cases .crm-person { grid-area: person; }

/* ----- Prospect ----- */

.crm-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2.25rem;
  margin: -.25rem 0 1.5rem;
}
.crm-facts dt { font-size: .78rem; color: var(--text-faint); }
.crm-facts dd { margin: .1rem 0 0; font-size: .92rem; }
/* A customer's profile at alwaysdata, a link out. */
.crm-client {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .15rem;
  padding: .3rem .75rem .3rem .55rem;
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface));
  color: var(--brand-text);
  font-size: .85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.crm-client:hover { border-color: var(--brand); text-decoration: none; }
.crm-client svg { width: 1.15rem; height: 1.15rem; color: var(--brand); }
.crm-client__go { color: var(--text-muted); font-weight: 400; }
.card .crm-facts { display: grid; gap: .75rem; margin: 0; }
.crm-flag { font-family: 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

.crm-sheet { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.crm-sheet__side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.crm-sheet .card + .card { margin-top: 0; }
@media (max-width: 1040px) {
  .crm-sheet { grid-template-columns: minmax(0, 1fr); }
}

/* The exchanges on a rail: dates on the left, the latest on top, today marked. */
.crm-timeline {
  --date: 4.2rem;
  --node: 2rem;
  position: relative;
  margin: 0;
  padding: 1rem 1.1rem 1.25rem;
  list-style: none;
}
.crm-timeline::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: calc(1.1rem + var(--date) + .9rem + var(--node) / 2 - 1px);
  width: 2px;
  background: var(--border);
}
.crm-moment {
  position: relative;
  display: grid;
  grid-template-columns: var(--date) var(--node) minmax(0, 1fr);
  column-gap: .9rem;
  padding: .6rem 0;
}
.crm-moment__date {
  display: grid;
  justify-items: end;
  align-content: start;
  margin: -.35rem -.4rem;
  padding: .45rem .4rem .35rem;
  border-radius: var(--radius-sm);
  line-height: 1.15;
  text-align: right;
  color: var(--text);
  transition: background-color .15s;
}
.crm-moment__date time { display: contents; }
.crm-moment__date:hover, .crm-moment__date:focus-visible { background: color-mix(in srgb, var(--brand) 8%, transparent); text-decoration: none; }
.crm-moment__date:hover .crm-moment__day, .crm-moment__date:focus-visible .crm-moment__day { color: var(--brand-text); }
/* An exchange linked to stands out. */
.crm-moment:target {
  --target: color-mix(in srgb, var(--brand) 5%, var(--surface));
  scroll-margin-top: 6rem;
  border-radius: var(--radius);
  background: var(--target);
  box-shadow: 0 0 0 .4rem var(--target);
}
.crm-moment:target .crm-moment__node .crm-kind, .crm-moment:target .crm-moment__node .crm-person { box-shadow: 0 0 0 4px var(--target); }
.crm-moment:target .crm-moment__node .crm-person + .crm-kind { box-shadow: 0 0 0 2px var(--target); }
.crm-moment__day { font-family: var(--font-title); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-moment__month { font-size: .75rem; color: var(--text-muted); }
.crm-moment__time { margin-top: .15rem; font-size: .72rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.crm-moment__node { position: relative; height: var(--node); }
.crm-moment__node .crm-kind, .crm-moment__node .crm-person { box-shadow: 0 0 0 4px var(--surface); }
/* The agent, and the kind as an exponent of theirs. */
.crm-moment__node .crm-person { width: var(--node); height: var(--node); }
.crm-moment__node .crm-person + .crm-kind {
  position: absolute;
  top: -.35rem;
  right: -.5rem;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--kind);
  color: var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
}
.crm-moment__node .crm-person + .crm-kind svg { width: .72rem; height: .72rem; }
.crm-moment__head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: .82rem; color: var(--text-muted); }
.crm-moment__body { position: relative; padding-right: 4.75rem; }
/* Room for a third action, the reply. */
.crm-moment__body:has(.crm-moment__reply) { padding-right: 6.75rem; }
/* Pinned top right, so the head wraps beside them rather than under. */
.crm-moment__actions { position: absolute; top: -.2rem; right: 0; display: flex; align-items: center; gap: .1rem; }
.crm-moment .crm-markdown { margin-top: .25rem; }
.crm-moment__prospect { font-weight: 650; color: var(--text); }
.crm-moment__summary { margin: .2rem 0 0; font-size: .9rem; color: var(--text-muted); }
/* A case transformed: a milestone on the rail, in the colour of success. */
/* A case transformed: a milestone, set apart from the exchanges around it. */
.crm-moment--won { padding: .85rem 0; }
.crm-moment__node .crm-kind--won {
  width: 2.4rem;
  height: 2.4rem;
  margin-left: -.2rem;
  background: var(--ok);
  color: var(--surface);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--ok-soft);
}
.crm-kind--won svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.crm-moment--won .crm-moment__day { color: var(--ok); }
.crm-won {
  padding: .7rem .9rem;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  border-radius: var(--radius);
  background: var(--ok-soft);
}
.crm-won p { margin: 0; }
.crm-won__title { font-family: var(--font-title); font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--ok); }
.crm-won__case { margin-top: .1rem; font-size: 1rem; font-weight: 600; }
.crm-won__case a { color: var(--text); }
.crm-won__meta { margin-top: .15rem; font-size: .85rem; color: var(--text-muted); }
/* A case given up or closed: a quieter end than a transformed one. */
.crm-moment--closed { padding: .85rem 0; }
.crm-moment--closed .crm-moment__day { color: var(--text-muted); }
.crm-moment__node .crm-kind--closed {
  width: 2.4rem;
  height: 2.4rem;
  margin-left: -.2rem;
  background: var(--text-muted);
  color: var(--surface);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--surface-alt);
}
.crm-kind--closed svg { width: 1.1rem; height: 1.1rem; }
.crm-closed {
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}
.crm-closed p { margin: 0; }
.crm-closed__title { font-family: var(--font-title); font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--text-muted); }
.crm-closed__case { margin-top: .1rem; font-size: 1rem; font-weight: 600; }
.crm-closed__case a { color: var(--text); }
.crm-closed__meta { margin-top: .15rem; font-size: .85rem; color: var(--text-muted); }
.crm-head-actions { display: flex; align-items: center; gap: .6rem; }
.crm-moment.is-todo .crm-moment__day, .crm-moment.is-late .crm-moment__day { color: var(--brand-text); }
.crm-moment.is-late .crm-moment__day { color: var(--bad); }
.crm-timeline__today {
  position: relative;
  display: grid;
  grid-template-columns: var(--date) var(--node) auto minmax(0, 1fr);
  column-gap: .9rem;
  align-items: center;
  margin: .4rem 0;
  color: var(--brand-text);
  font-size: .78rem;
  font-weight: 600;
}
/* A dot on the rail, the word, then a line to the edge. */
.crm-timeline__today::before {
  content: '';
  grid-column: 2;
  justify-self: center;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--surface);
}
.crm-timeline__today span { grid-column: 3; }
.crm-timeline__today::after { content: ''; grid-column: 4; height: 2px; border-radius: 2px; background: var(--brand); }
@media (max-width: 560px) {
  .crm-timeline { --date: 2.6rem; }
  .crm-moment__month, .crm-moment__time { font-size: .68rem; }
}

.crm-case { padding: .8rem 1.1rem; border-left: 3px solid var(--brand); }
.crm-case + .crm-case { border-top: 1px solid var(--border); }
.crm-case--won { border-left-color: var(--ok); }
.crm-case--dropped { border-left-color: var(--border-strong); }
.crm-case--closed { border-left-color: var(--bad); }
.crm-case header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.crm-case header a { font-weight: 600; color: var(--text); }
.crm-case[aria-current] { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.crm-case__actions { display: flex; flex: none; align-items: center; gap: .25rem; }
/* A case's probability, as a ring filled that much, and its duration, tinted as an open case drags on. */
.crm-pace { display: inline-flex; align-items: center; gap: .65rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.crm-pace__odds, .crm-pace__age { display: inline-flex; align-items: center; gap: .3rem; }
.crm-pace__age svg { width: .85rem; height: .85rem; }
.crm-pace__age--late { color: var(--warn); }
.crm-pace__age--old { color: var(--bad); }
.crm-ring {
  width: .9rem;
  height: .9rem;
  border-radius: 50%;
  background: conic-gradient(var(--brand) var(--odds), var(--border-strong) 0);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%);
  mask: radial-gradient(circle, transparent 42%, #000 44%);
}
.crm-case-filter select, .crm-request__assign select {
  max-width: 18rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
}
.crm-case-filter select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.crm-case__meta { display: flex; align-items: center; gap: .5rem; margin: .35rem 0 0; font-size: .8rem; color: var(--text-muted); }
.crm-tech { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.crm-tech li { padding: .1rem .5rem; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: .75rem; color: var(--text-muted); }
.crm-tech .crm-choice svg { width: .8rem; height: .8rem; }

.crm-contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; padding: .7rem 1.1rem; font-size: .88rem; }
.crm-contact > :not(.crm-contact__actions) { grid-column: 1; }
.crm-contact + .crm-contact { border-top: 1px solid var(--border); }
.crm-contact__actions { grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: flex-start; gap: .1rem; }

/* Mails sent from the CRM, or read back: their direction and subject head the exchange. */
.crm-mail { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; min-width: 0; }
.crm-mail__subject { color: var(--text); font-weight: 600; }
.crm-contact__name { font-weight: 600; color: var(--text); }
.crm-contact__role { font-size: .8rem; color: var(--text-muted); }
.crm-sheet .empty, .crm-board .empty { padding: 1.25rem 1rem; }

.crm-markdown { font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.crm-markdown > :first-child { margin-top: 0; }
.crm-markdown > :last-child { margin-bottom: 0; }
.crm-markdown :is(p, ul, ol, pre, table) { margin: 0 0 .5rem; }
.crm-markdown :is(ul, ol) { padding-left: 1.2rem; }
.crm-markdown pre { overflow-x: auto; }
.crm-case .crm-markdown { margin-top: .5rem; font-size: .85rem; color: var(--text-muted); }

/* ----- Lists ----- */

.crm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: .75rem;
  border: 1px solid var(--brand-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface));
}
.crm-filters input, .crm-filters select {
  padding: .45rem .6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
}
.crm-filters__search { flex: 1 1 16rem; }
.crm-filters :is(input, select):focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.crm-table__name { font-weight: 600; color: var(--text); }
table.crm-table :is(th, td) { text-align: left; }
table.crm-table .crm-table__number { text-align: right; }
.crm-sort { color: inherit; }
.crm-sort:hover { color: var(--text); text-decoration: none; }
.crm-sort.is-desc::after { content: ' ↓'; }
.crm-sort.is-asc::after { content: ' ↑'; }
.crm-table__place { display: block; font-size: .8rem; color: var(--text-muted); }
table.crm-table td.crm-table__choices { white-space: normal; font-size: .85rem; color: var(--text-muted); }
.crm-table__cases { display: flex; flex-wrap: wrap; gap: .3rem; }
.crm-table__cases .badge:hover { text-decoration: none; filter: brightness(.95); }
.crm-pages { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 1.1rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted); }
.crm-pages__list { display: flex; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.crm-pages__list :is(a, span) {
  display: grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .4rem;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.crm-pages__list a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.crm-pages__list [aria-current] { background: var(--brand); color: var(--brand-on); font-weight: 600; }
.crm-pages__list span[aria-hidden] { opacity: .35; }
.crm-pages__gap { min-width: 1.2rem; }

/* ----- Host ----- */

.crm-outreach { display: grid; gap: 1.25rem; }
.crm-outreach .card + .card { margin-top: 0; }
.crm-outreach__bar { justify-content: flex-start; flex-wrap: wrap; gap: .6rem; }
.crm-outreach__all { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 600; }
.crm-outreach__count { margin-right: auto; font-size: .82rem; color: var(--text-muted); }
.crm-outreach [aria-disabled='true'] { opacity: .5; pointer-events: none; }
.crm-reach { margin: 0; padding: 0; list-style: none; }
.crm-reach li {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr) minmax(0, 2fr);
  gap: .9rem;
  align-items: start;
  padding: .75rem 1.1rem;
}
.crm-reach li + li { border-top: 1px solid var(--border); }
.crm-reach li:has(input:checked) { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.crm-reach__pick input { width: 1rem; height: 1rem; margin-top: .2rem; accent-color: var(--brand); }
.crm-reach__who { display: grid; justify-items: start; gap: .25rem; }
.crm-reach__site { font-size: .85rem; color: var(--text-muted); overflow-wrap: anywhere; }
.crm-reach__contacts { display: grid; gap: .3rem; font-size: .85rem; }
.crm-reach__contacts div { display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.crm-reach__contacts span { color: var(--text); }
.crm-reach .muted { color: var(--text-faint); }
@media (max-width: 720px) {
  .crm-reach li { grid-template-columns: auto minmax(0, 1fr); }
  .crm-reach__contacts { grid-column: 2; }
}
.crm-hint { margin: 0 0 1rem; font-size: .88rem; color: var(--text-muted); }
.crm-hint--after { margin: 1.25rem 0 0; }
.crm-endpoints { margin: 0 0 1.25rem; }
.crm-endpoints > div { padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.crm-endpoints > div + div { margin-top: .5rem; }
.crm-endpoints dd { margin: .3rem 0 0; font-size: .88rem; }
.crm-endpoints .crm-endpoints__fields { color: var(--text-muted); font-size: .8rem; }
.crm-endpoints__title { margin: 0 0 .5rem; font-size: .95rem; }
.crm-endpoint { font-size: .8rem; overflow-wrap: anywhere; }
.crm-endpoints dt { display: flex; align-items: center; gap: .4rem; }
.crm-copyable { display: flex; align-items: center; gap: .4rem; }
.crm-copyable .crm-token { flex: 1; }
.crm-copy.is-copied { color: var(--ok); }
.crm-token-delete { color: var(--bad); }
.crm-token { display: block; padding: .5rem .7rem; border-radius: var(--radius-sm); background: var(--surface-alt); overflow-wrap: anywhere; user-select: all; }

/* ----- Forms ----- */

.crm-form { max-width: 820px; }
.field--check label { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--text); }
.field--check input { width: auto; accent-color: var(--brand); }
.form-actions .crm-delete { margin-left: auto; color: var(--bad); }
div[data-region-field][hidden] { display: none; }

/* Boxes to tick in a list opened from one line, which sums them up. */
.crm-picker { position: relative; }
.crm-picker summary {
  position: relative;
  padding: .5rem 2rem .5rem .6rem;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  list-style: none;
  cursor: pointer;
}
.crm-picker summary::-webkit-details-marker { display: none; }
.crm-picker summary::after {
  content: '';
  position: absolute;
  top: 50%;
  right: .8rem;
  width: .4rem;
  height: .4rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
}
.crm-picker[open] summary, .crm-picker summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.crm-picker__panel {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 16rem;
  margin-top: .25rem;
  padding: .3rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.crm-picker__panel label { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .4rem .5rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 400; color: var(--text); cursor: pointer; }
.crm-picker__panel label:hover { background: var(--surface-alt); }
.crm-picker__panel input { flex: none; width: auto; padding: 0; accent-color: var(--brand); }
.crm-picker__panel .crm-kind { flex: none; width: 1.5rem; height: 1.5rem; }
.crm-picker__panel .crm-kind svg { width: .85rem; height: .85rem; }
.crm-picker__description { display: block; font-size: .78rem; color: var(--text-muted); }

/* Ready-made texts for a text area, from a menu on its label's line. */
.crm-snippets { position: relative; }
.crm-snippets__menu { position: absolute; right: 0; bottom: 100%; margin-bottom: .3rem; }
.crm-snippets__menu summary { font-size: .8rem; font-weight: 600; color: var(--brand-text); list-style: none; cursor: pointer; }
.crm-snippets__menu summary::-webkit-details-marker { display: none; }
.crm-snippets__menu summary::after { content: ' ▾'; }
.crm-snippets__panel {
  position: absolute;
  right: 0;
  z-index: 10;
  display: grid;
  width: max-content;
  max-width: 22rem;
  margin-top: .25rem;
  padding: .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.crm-snippets__panel button { padding: .4rem .5rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.crm-snippets__panel button:hover, .crm-snippets__panel button:focus-visible { background: var(--surface-alt); }

/* Entries of an admin list to pick: a card each, icon, name and description. */
div.crm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem; }
div.crm-cards--kinds { display: flex; flex-wrap: wrap; }
.crm-card, .field .crm-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 0;
  padding: .55rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.crm-cards--kinds .crm-card { align-items: center; padding: .25rem .8rem .25rem .3rem; border-radius: 999px; }
.crm-card:hover { border-color: var(--text-faint); }
.crm-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.crm-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.crm-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.crm-card .crm-kind { width: 1.6rem; height: 1.6rem; }
.crm-card .crm-kind svg { width: .9rem; height: .9rem; }
.crm-card__text { display: grid; gap: .1rem; padding-top: .1rem; }
.crm-cards--kinds .crm-card__text { padding-top: 0; }
.crm-card__description { font-size: .78rem; font-weight: 400; line-height: 1.35; color: var(--text-muted); }

/* A prospect: what it needs on the left, the rest aside. */
.crm-prospect-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); gap: 1.25rem; align-items: start; max-width: 1180px; }
.crm-prospect-form__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.crm-prospect-form .card + .card { margin-top: 0; }
.crm-prospect-form .form-actions { margin-top: 0; }
.crm-prospect-form .card__head .crm-hint { margin: 0; font-size: .8rem; }
/* The prospect and its complements share an edge, so they read as one. */
.crm-prospect-form__identity, .crm-prospect-form__aside { border-top: 3px solid var(--brand); }
.crm-prospect-form__aside { background: color-mix(in srgb, var(--brand) 3%, var(--surface)); }
@media (max-width: 1040px) {
  .crm-prospect-form { grid-template-columns: minmax(0, 1fr); }
}

/* The quick exchange: a prospect, a case and the exchange, each on its card. */
.crm-match { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; font-size: .8rem; font-weight: 600; }
.crm-match::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.crm-match--known { color: var(--ok); }
.crm-match--new { color: var(--brand-text); }
.crm-match[hidden], .field [data-match-none][hidden], [data-quick-case][hidden] { display: none; }
.crm-quick__row { display: grid; grid-template-columns: minmax(0, 1fr) 13rem auto; gap: 0 1rem; align-items: start; }
.crm-quick__row[hidden] { display: none; }
.crm-quick__reminder { grid-template-columns: 13rem minmax(0, 1fr); }
.crm-quick__reminder .field:not(:first-child) { grid-column: 1 / -1; }
/* A small form under its button, closed by a click elsewhere. */
.crm-popover { position: relative; }
.crm-popover summary { list-style: none; }
.crm-popover summary::-webkit-details-marker { display: none; }
.crm-popover__panel {
  position: absolute;
  right: 0;
  z-index: 10;
  display: grid;
  gap: .25rem;
  width: 18rem;
  margin-top: .4rem;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.crm-popover__panel .button { justify-self: start; }
.crm-suggest { position: relative; }
.crm-suggest__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  margin: 0;
  padding: .3rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.crm-suggest__list li { padding: .45rem .6rem; border-radius: var(--radius-sm); cursor: pointer; }
.crm-suggest__list li:hover, .crm-suggest__list li[aria-selected="true"] { background: var(--surface-alt); }
/* Level with the inputs, under their labels. */
.crm-quick__done { padding-top: 2rem; }
.crm-quick .form-actions { flex-wrap: wrap; margin-top: .25rem; }
.crm-quick .crm-hint { margin: 0 0 0 auto; font-size: .8rem; }
@media (max-width: 720px) {
  .crm-quick__row { grid-template-columns: minmax(0, 1fr) auto; }
  .crm-quick__prospect { grid-column: 1 / -1; }
  .crm-quick__reminder { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Social networks ---------- */

.social-net--mastodon { --net: #6364ff; }
.social-net--bluesky { --net: #1185fe; }
.social-net--x { --net: var(--text); }
.social-net--linkedin { --net: #0a66c2; }
.social-net { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.social-net__logo { width: 1.05em; height: 1.05em; flex: none; color: var(--net); }

.social-status { background: var(--surface-alt); color: var(--text-muted); }
.social-status--approved, .social-status--scheduled { background: var(--brand-soft); color: var(--brand-text); }
.social-status--publishing, .social-status--awaiting_manual { background: var(--warn-soft); color: var(--warn); }
.social-status--published { background: var(--ok-soft); color: var(--ok); }
.social-status--failed { background: var(--bad-soft); color: var(--bad); }

.social-meta { display: flex; align-items: center; gap: .6rem; margin: .3rem 0 0; font-size: .88rem; color: var(--text-muted); }
.social-version { display: inline-flex; }
.social-version svg { width: 1.5rem; height: 1rem; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }
.social-version svg { opacity: .85; transition: opacity .15s; }
.social-version:hover svg { opacity: 1; }
.social-publish-all { display: flex; justify-content: flex-end; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.social-publish-all .social-hint { margin: 0; }
.social-dialog {
  width: min(520px, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
}
.social-dialog::backdrop { background: rgba(16, 24, 40, .35); }
.social-dialog h2 { margin: 0 0 .4rem; }
.social-refresh { margin: 1rem 0 0; padding: 0; list-style: none; }
.social-refresh li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3rem 1rem; padding: .55rem 0; }
.social-refresh li + li { border-top: 1px solid var(--border); }
.social-refresh label { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; cursor: pointer; }
.social-refresh input { accent-color: var(--brand); }
.social-refresh__last { font-size: .8rem; color: var(--text-muted); }
.social-publish-all + .social-cards { margin-top: 0; }
.social-hint { margin: .5rem 0 0; font-size: .8rem; color: var(--text-muted); }
.social-form { max-width: 820px; }
.social-steps { max-width: 820px; margin: 0 0 1rem; font-size: .88rem; color: var(--text-muted); }
.social-steps p { margin: 0 0 .4rem; color: var(--text); }
.social-steps ol { margin: 0; padding-left: 1.3rem; }
.social-steps li { padding: .15rem 0; }
.social-history-tabs { margin-bottom: .8rem; }
.social-history-tabs .tab { text-decoration: none; }
.social-history-tabs + .social-hint { margin-bottom: 1rem; }
.social-fetch { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; max-width: 820px; margin-bottom: 1rem; }
.social-fetch .field { flex: 1 1 260px; margin: 0; }
.social-found { display: flex; flex-direction: column; gap: .8rem; max-width: 820px; margin: 1rem 0; padding: 0; list-style: none; }
.social-found__date { margin-right: auto; font-size: .85rem; color: var(--text-muted); }
.social-found .social-adopt { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-top: .8rem; }
.social-found .social-adopt .field { margin: 0; }
.social-adopt:has(select[name=article] option:checked:not([value=""])) .social-adopt__title { display: none; }
.social-code { font-family: var(--mono); font-size: .82rem; }
.field .field__label { display: block; margin-bottom: .3rem; font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.social-networks { display: flex; flex-wrap: wrap; gap: .5rem; }
.social-networks label, .field .social-networks label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .4rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.social-networks label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.social-networks input, .field .social-networks input { width: auto; accent-color: var(--brand); }

table.social-table :is(th, td) { text-align: left; }
table.social-table .social-table__number { text-align: right; }
.social-table__title { display: block; font-weight: 600; color: var(--text); white-space: normal; }
.social-table__date { font-size: .8rem; color: var(--text-muted); }
table.social-table :is(th, td) + :is(th, td) { border-left: 1px solid var(--border); }
/* A network's cell: its status, then its reactions, then when they were read. */
table.social-table td.social-table__post { text-align: center; }
.social-table__post .badge { display: inline-block; }
.social-table__reactions { display: flex; justify-content: center; gap: .6rem; margin-top: .35rem; font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.social-table__reactions span { display: inline-flex; align-items: center; gap: .2rem; }
.social-table__reactions svg { width: .9rem; height: .9rem; color: var(--text-faint); }
.social-table__updated { display: block; margin-top: .2rem; font-size: .72rem; color: var(--text-faint); }
table.social-table th.social-table__network { text-align: center; }
.social-table__logo { width: 1.5rem; height: 1.5rem; color: var(--net); vertical-align: middle; }
.social-sort { color: inherit; }
.social-sort.is-active { color: var(--text); }
.social-sort.is-active::after { content: ' ↓'; }

.social-errors { margin-bottom: 1.25rem; padding: .8rem 1rem; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); font-size: .9rem; }
.social-errors p { margin: 0; font-weight: 600; }
.social-errors ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.social-warnings { margin: 1rem 0 0; padding: .7rem 1rem .7rem 2rem; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: .85rem; }

/* One block per network, one under the other: the texts read in full. */
.social-changes { display: grid; gap: .75rem; margin-top: 1rem; }
.social-change { padding: .75rem .9rem; border: 1px solid var(--border); border-left: 3px solid var(--net, var(--border)); border-radius: var(--radius-sm); }
.social-change:has(.social-net--mastodon) { --net: #6364ff; }
.social-change:has(.social-net--bluesky) { --net: #1185fe; }
.social-change:has(.social-net--x) { --net: var(--text); }
.social-change:has(.social-net--linkedin) { --net: #0a66c2; }
.social-change header { display: flex; align-items: center; gap: .6rem; font-size: .9rem; font-weight: 600; }
.social-change__lang { padding: 0 .35rem; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: .72rem; color: var(--text-muted); }
.social-change__action { margin-left: auto; font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.social-copy:hover { color: var(--brand-text); }
.social-change--new .social-change__action { color: var(--ok); }
.social-change--update .social-change__action { color: var(--warn); }
.social-diff { margin: .6rem 0 0; font-family: var(--mono); font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.social-diff__add { display: block; background: var(--ok-soft); color: var(--ok); }
.social-diff__remove { display: block; background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.social-diff__same { display: block; color: var(--text-muted); }
.social-diff span { min-height: 1.4em; }

.social-cards { display: grid; gap: 1.25rem; margin: 1.25rem 0; }
.social-cards .card + .card { margin-top: 0; }
.social-card { border-top: 3px solid var(--net, var(--border)); }
.social-card .card__head { flex-wrap: wrap; justify-content: flex-start; }
.social-card .card__head h2 { font-size: 1rem; }
.social-card__mode { margin-right: auto; font-size: .8rem; color: var(--text-muted); }
.social-card .card__head .button--icon { margin: -.3rem -.4rem -.3rem 0; }
/* The card's facts: when published, read, validated; set apart from what one acts on. */
.social-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.5rem;
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface-alt);
  font-size: .8rem;
  color: var(--text-muted);
}
#post-mastodon { --net: #6364ff; } #post-bluesky { --net: #1185fe; } #post-x { --net: var(--text); } #post-linkedin { --net: #0a66c2; }

.social-edit textarea {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  line-height: 1.5;
  resize: vertical;
}
.social-edit textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.social-edit__foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .4rem; }
.social-count { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.social-count.is-over { color: var(--bad); }

.social-preview {
  margin: .75rem 0 0;
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: .9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.social-preview__link, .social-preview__tag { color: var(--net, var(--brand-text)); font-weight: 500; }

.social-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: .9rem 0 0; }
.social-facts dt { font-size: .75rem; color: var(--text-faint); }
.social-facts dd { margin: .1rem 0 0; font-size: .88rem; }
.social-metrics { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.social-metrics li { display: inline-flex; align-items: center; gap: .4rem; }
.social-metrics svg { width: 1.15rem; height: 1.15rem; color: var(--net, var(--text-muted)); }
.social-metrics strong { font-family: var(--font-title); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.social-updated.is-stale { color: var(--warn); font-weight: 600; }
.social-error { margin: .8rem 0 0; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); font-size: .85rem; }
.social-error span { font-size: .78rem; opacity: .85; }

.social-manual { margin-top: .9rem; padding: .75rem .85rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.social-manual__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.social-inline-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; }
.social-inline-form .field { margin: 0; flex: 1 1 8rem; }
.social-manual-metrics { margin-top: .8rem; font-size: .85rem; }
.social-manual-metrics summary { cursor: pointer; color: var(--text-muted); }
.social-manual-metrics form { margin-top: .6rem; }

.social-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.social-schedule { display: inline-flex; gap: .3rem; }
.social-schedule input { padding: .25rem .4rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; }

.social-chart { margin: 0; }
.social-chart > svg { display: block; width: 100%; height: auto; }
.social-chart__grid { stroke: var(--border); stroke-width: 1; }
.social-chart__tick { fill: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.social-chart__line { fill: none; stroke: var(--net); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.social-chart__end { fill: var(--net); stroke: var(--surface); stroke-width: 2; }
.social-chart__legend { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-top: .6rem; font-size: .85rem; }
.social-chart__legend strong { margin-left: -1rem; font-variant-numeric: tabular-nums; }

.social-imports { margin: 0; padding: .5rem 1.1rem 1rem; list-style: none; font-size: .88rem; color: var(--text-muted); }
.social-imports li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }

.social-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 1.25rem; align-items: start; }
.social-settings .card + .card { margin-top: 0; }
.social-settings[hidden] { display: none; }
.social-account-form { margin-top: 1rem; }
.social-account-form .field--check label { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-size: .9rem; color: var(--text); }
.social-account-form .field--check input { width: auto; margin: 0; accent-color: var(--brand); }
.social-x-connect { display: grid; gap: .4rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); justify-items: start; }
.social-x-connect code { font-size: .78rem; overflow-wrap: anywhere; }
