/* MUT ERP — one stylesheet, no build step. Mobile first: base styles are for
 * phones; `min-width` queries add layout for larger screens.
 *
 * Brand: MUT's Brandbook 2026, applied to the web in docs/design.md. Black, white
 * and MUT blue (with its grain gradient), pink as a highlight. Titles in Archivo
 * Expanded, highlights in Bitcount Grid Single, text in Manrope (the free stand-in
 * for the brandbook's Oakes Grotesk). A camera-tally red, outside the brand palette,
 * is reserved for problems (losses, overruns, errors).
 *
 * Breakpoints: 40rem (large phone), 48rem (tablet), 64rem (laptop), 90rem (wide).
 */

/* Titles: Archivo, used at 125 % width (Archivo Expanded). */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo/archivo-var-latin.96786d433cff.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

/* Text. */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope/manrope-var-latin.28d0918a0f90.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Subtitles and highlights. */
@font-face {
  font-family: "Bitcount Grid Single";
  src: url("../fonts/bitcount/bitcount-grid-single-latin.2f9ecbd2b8d1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* MUT's palette (Brandbook 2026) */
  --negro: #000;          /* headings, figures, rules that open a section */
  --tinta: #292929;       /* body text (MUT's text colour) */
  --gris: #6b6b69;        /* labels and metadata, 5.3:1 on white */
  --piedra: #a8a8a7;      /* secondary bars; on black, secondary text */
  --niebla: #e8e8e8;      /* hairlines and bar tracks */
  --humo: #f4f4f3;        /* the faintest fill */
  --papel: #fff;
  --azul: #0f6782;        /* MUT blue: the identity's colour, 6.4:1 on white */
  --azul-luz: #377488;    /* the blue background, top */
  --azul-medio: #2f677b;
  --azul-noche: #15394d;  /* the blue background, bottom */
  --rosa: #fad3d3;        /* highlights; on blue, the brand's accent */
  --rec: #c8231b;         /* problems only, 5.9:1 on white */
  --rec-claro: #ff5a4f;   /* the same signal on black */
  --rec-sobre-azul: #ffdcd8; /* and on the blue background */
  --sobre-azul: #dce6ea;  /* secondary text on the blue background */

  /* Category colours: they tell categories apart on boards (a project's stage, its
     process, its type of sale, a person). Not brand colours: docs/design.md.
     White text passes AA on each one; on the two light ones the text is dark. */
  --cat-azul: var(--azul);
  --cat-noche: var(--azul-noche);
  --cat-cielo: #d3e6ec;
  --cat-cielo-tinta: #0b3d4e;
  --cat-rosa: var(--rosa);
  --cat-verde: #1f7a5a;
  --cat-oliva: #5f7a1f;
  --cat-ocre: #8f6400;
  --cat-morado: #6a4c9c;
  --cat-ciruela: #9c2f6b;
  --cat-pizarra: #5b6670;

  /* The brand's digital background: a blue gradient with a fine grain over it. */
  --fondo-azul: linear-gradient(180deg, var(--azul-luz) 0%, var(--azul-luz) 25%, var(--azul-medio) 50%, #235367 72%, var(--azul-noche) 100%);
  --grano: url("../img/grain.3eaa2c64854d.svg");

  --font: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-titulo: "Archivo", "Helvetica Neue", Arial, sans-serif;  /* at 125 % width */
  --font-pixel: "Bitcount Grid Single", ui-monospace, monospace;

  /* Type scale (1.25) */
  --step--1: 0.8125rem;   /* 13px labels */
  --step-0: 1rem;         /* 16px body */
  --step-1: 1.125rem;     /* section titles */
  --step-2: 1.75rem;
  --step-3: 1.875rem;     /* page title on phones */
  --figure: 1.5rem;       /* the month's figures on phones */

  /* Spacing (8px rhythm) */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;

  --gutter: 1.25rem;
  --max: 84rem;
}

@media (min-width: 48rem) {
  :root { --gutter: 2.5rem; --step-3: 2.25rem; --figure: 1.875rem; }
}

@media (min-width: 90rem) {
  :root { --gutter: 3.5rem; --step-3: 2.5rem; --figure: 2.125rem; }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--tinta);
  background: var(--papel);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.num { font-variant-numeric: tabular-nums lining-nums; }

::selection { color: var(--negro); background: var(--rosa); }

/* Brand type roles (docs/design.md). Titles: Archivo Expanded, heavy, in capitals.
   Highlights: Bitcount Grid Single, for short labels and codes, never for text. */
.titulo {
  font-family: var(--font-titulo);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.02;
  color: var(--negro);
  overflow-wrap: anywhere;
}
.pixel {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The grain the brand lays over its blue and dark backgrounds: subtle, never dominant. */
.grano { position: relative; isolation: isolate; }
.grano::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--grano);
  opacity: 0.16;
  mix-blend-mode: overlay;
}

/* HTMX request indicators (htmx's own inline version is disabled for the CSP). */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }


/* ------------------------------------------------------------------------
 * Entrance: sign-in and every other account page.
 * A 2.39:1 frame from MUT's reel on the brand's blue grain background; the form
 * sits below it, where a film's titles would be.
 * --------------------------------------------------------------------- */

/* Account pages never scroll: the page is exactly one screen tall; the black bars
   keep their content and share any spare height, and the still gives way (down to
   a thin strip) when a form needs more room. */
.entrance {
  position: relative;
  isolation: isolate;
  color-scheme: dark;
  color: var(--papel);
  background: var(--azul-noche) var(--fondo-azul);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* If a screen is too short even for a thin strip, the page scrolls on blue. */
html:has(body.entrance) { background: var(--azul-noche); }

.entrance::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--grano);
  opacity: 0.18;
  mix-blend-mode: overlay;
}

.entrance__top,
.entrance__bottom { flex: 1 0 auto; }

.entrance__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
}

.entrance__logo { width: 3.75rem; color: var(--papel); }

.entrance__product { margin: 0; font-family: var(--font-pixel); font-size: 0.875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sobre-azul); }

.entrance__frame {
  flex: 0 1 auto;
  min-height: 0;          /* on a short phone the still can give way entirely */
  margin: 0;
  width: 100%;
  height: calc(100vw * 9 / 16);
  overflow: hidden;
  animation: shutter 900ms cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

.entrance__frame img { width: 100%; height: 100%; object-fit: cover; }

@keyframes shutter {
  from { clip-path: inset(50% 0 50% 0); }
  to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .entrance__frame { animation: none; }
}

.entrance__bottom { padding: 1.25rem var(--gutter) 1.25rem; }

.entrance__panel { max-width: 62rem; }

.entrance h1 {
  margin: 0 0 1rem;
  font-family: var(--font-titulo);
  font-size: var(--step-1);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.entrance p { margin: 0 0 1rem; max-width: 34rem; color: var(--sobre-azul); }

/* Fields on black: an underline, like a line on a call sheet. */
.entrance label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: var(--step--1);
  color: var(--sobre-azul);
}

.entrance input[type="email"],
.entrance input[type="password"],
.entrance input[type="text"] {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0 0.55rem;
  font: inherit;
  font-size: var(--step-1);
  color: var(--papel);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.5);
  border-radius: 0;
  caret-color: var(--papel);
}

.entrance input:focus { outline: none; border-bottom-color: var(--papel); }
.entrance input[aria-invalid="true"] { border-bottom-color: var(--rec-sobre-azul); }
.entrance input:focus-visible { outline: none; box-shadow: 0 2px 0 var(--papel); }

.entrance input:-webkit-autofill {
  -webkit-text-fill-color: var(--papel);
  box-shadow: 0 0 0 100px var(--azul-medio) inset;
}

.entrance button,
.entrance .button {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--negro);
  background: var(--papel);
  border: 1px solid var(--papel);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
}

.entrance button:hover { background: var(--niebla); }

.entrance .button--quiet,
.entrance button.button--quiet {
  color: var(--papel);
  background: transparent;
  border-color: rgb(255 255 255 / 0.5);
  font-weight: 500;
}

.entrance .button--quiet:hover { border-color: var(--papel); background: transparent; }

.entrance .errorlist,
.entrance .entrance__error {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: var(--rec-sobre-azul);
  font-size: var(--step--1);
}

.entrance__messages { margin: 0 0 1rem; padding: 0; list-style: none; color: var(--sobre-azul); font-size: var(--step--1); }

/* allauth's generic pages (password change, reset, sign out): stacked fields. */
.entrance__panel form > p { margin: 0 0 1.25rem; max-width: 26rem; }
.entrance__panel form > p:has(input[type="checkbox"]) { display: flex; gap: 0.5rem; align-items: center; }
.entrance__panel form > p:has(input[type="checkbox"]) label { margin: 0; }
.entrance__panel .helptext { display: block; margin-top: 0.4rem; font-size: var(--step--1); color: var(--sobre-azul); }
.entrance__panel .helptext ul { margin: 0; padding-left: 1.1rem; }
.entrance__panel a { color: var(--papel); }

/* Sign-in and password forms: stacked on phones, one line across the bar on wider
   screens. */
.signin { display: grid; gap: 0.75rem; max-width: 46rem; }
.signin__field { margin: 0; }
.signin button[type="submit"] { width: 100%; }

.signin__after {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--sobre-azul);
}

.signin__after a { color: var(--sobre-azul); padding: 0.5rem 0; }
.signin__after a:hover { color: var(--papel); }
.signin__after form { margin: 0; }
.signin__hint { margin: 0; max-width: 40rem; font-size: var(--step--1); color: var(--sobre-azul); }

@media (min-width: 40rem) {
  .entrance__top { padding-top: 1.75rem; padding-bottom: 2.25rem; }
  .entrance__logo { width: 4.75rem; }
  .entrance__frame { min-height: 4.5rem; }
  .entrance h1 { margin-bottom: 1.25rem; }
  .signin__after { margin-top: 1.25rem; gap: 1rem 1.5rem; }
  .entrance__frame {
    /* 2.39:1, unless the screen is short; then crop rather than squeeze the form. */
    height: min(calc(100vw / 2.39), 50vh);
    height: min(calc(100vw / 2.39), 50dvh);
  }
  .entrance__bottom { padding: 2rem var(--gutter); }
  .signin { grid-template-columns: 1fr 1fr auto; align-items: end; gap: 1.25rem 1.5rem; }
  .signin--single { grid-template-columns: minmax(0, 24rem) auto; }
  .signin--password { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 62rem; }
  .signin button[type="submit"] { width: auto; }
  .signin--password button[type="submit"] { justify-self: start; }
}

@media (min-width: 64rem) {
  .signin--password { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
}


/* ------------------------------------------------------------------------
 * Application shell: a black bar carries the wordmark, as on the sign-in page
 * and mut.mx. The page itself is white.
 * --------------------------------------------------------------------- */

.shell__bar {
  position: sticky;
  top: 0;
  z-index: 20;
  color: var(--papel);
  background: var(--negro);
}

/* Anchors and focused fields land below the bar, not under it. */
html:has(.shell__bar) { scroll-padding-top: 5rem; }

.shell__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  max-width: var(--max);
  min-height: 3.5rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.shell__home { display: inline-flex; align-items: center; min-height: 2.75rem; flex: none; }
.shell__logo { width: 3.25rem; color: var(--papel); }

.shell__main { max-width: var(--max); margin: 0 auto; padding: var(--s-4) var(--gutter) var(--s-6); }

/* The menu. Phones: one button (it names the page you're on) opens a panel
   with every group. Laptops: the groups sit along the bar, as links or dropdowns.
   static/js/app.js keeps it open on laptops; ::details-content does the same
   where JavaScript hasn't run yet. */
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }

.menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0 0 0 var(--s-2);
  color: var(--papel);
  user-select: none;
}
.menu__current { font-weight: 600; }

/* Three lines that turn into a cross. */
.menu__icon,
.menu__icon::before,
.menu__icon::after { display: block; width: 1.25rem; height: 2px; background: var(--papel); transition: transform 150ms ease, background-color 150ms ease; }
.menu__icon { position: relative; }
.menu__icon::before,
.menu__icon::after { content: ""; position: absolute; left: 0; }
.menu__icon::before { top: -6px; }
.menu__icon::after { top: 6px; }
.menu[open] .menu__icon { background: transparent; }
.menu[open] .menu__icon::before { transform: translateY(6px) rotate(45deg); }
.menu[open] .menu__icon::after { transform: translateY(-6px) rotate(-45deg); }

.menu__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100dvh - 3.5rem);
  overflow-y: auto;
  padding: var(--s-1) var(--gutter) var(--s-4);
  background: var(--negro);
  border-top: 1px solid var(--tinta);
  box-shadow: 0 1.5rem 2rem rgb(0 0 0 / 0.35);
}

.menu__groups,
.menu__pages { margin: 0; padding: 0; list-style: none; }
.menu__group { padding: var(--s-1) 0; border-bottom: 1px solid var(--tinta); }
.menu__group:last-child { border-bottom: 0; }

.menu__top { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; color: var(--piedra); text-decoration: none; }
/* On phones a group's name is a heading over its pages. */
.menu__drop > .menu__top { min-height: 2.25rem; font-size: var(--step--1); color: var(--gris); }
.menu[data-ready] .menu__drop > .menu__top { pointer-events: none; }
a.menu__top { font-size: var(--step-1); color: var(--papel); }
/* A group with its own colour (core.navigation): its name is a filled chip, in
   the panel and along the bar. The current page keeps its marks (the pink
   square on phones, the pink rule on laptops). */
.menu__chip { padding: 0.15rem 0.6rem; color: var(--papel); border-radius: 2px; }

.menu__pages a,
.menu__pages button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  width: 100%;
  min-height: 2.75rem;
  padding: 0;
  font: inherit;
  font-size: var(--step-1);
  text-align: left;
  color: var(--papel);
  background: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.menu__pages form { margin: 0; }
.menu__email { padding: 0.25rem 0 0.5rem; font-size: var(--step--1); color: var(--gris); overflow-wrap: anywhere; }

.menu a[aria-current="page"] { font-weight: 600; }
.menu__pages a[aria-current="page"]::after,
a.menu__top[aria-current="page"]::after { content: ""; width: 0.5rem; height: 0.5rem; background: var(--rosa); }

.menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--negro);
  background: var(--papel);
  border-radius: 2px;
}

@media (min-width: 64rem) {
  .shell__inner { min-height: 4rem; gap: var(--s-6); }
  .shell__logo { width: 3.5rem; }
  .shell__main { padding-top: var(--s-5); }

  .menu { flex: 1; }
  .menu::details-content { content-visibility: visible; }
  .menu__toggle { display: none; }
  .menu__panel { position: static; max-height: none; overflow: visible; padding: 0; background: none; border: 0; box-shadow: none; }
  .menu__groups { display: flex; align-items: stretch; gap: var(--s-4); }
  .menu__group { position: relative; padding: 0; border: 0; }
  .menu__group--account { margin-left: auto; }

  .menu__top,
  .menu__drop > .menu__top,
  a.menu__top {
    min-height: 4rem;
    font-size: var(--step-0);
    color: var(--piedra);
    border-bottom: 3px solid transparent;
  }
  .menu[data-ready] .menu__drop > .menu__top { pointer-events: auto; }
  .menu__top:hover,
  .menu__drop[open] > .menu__top { color: var(--papel); }
  .menu__group.is-current > .menu__top,
  .menu__group.is-current > .menu__drop > .menu__top { color: var(--papel); font-weight: 600; border-bottom-color: var(--rosa); }
  a.menu__top[aria-current="page"]::after { content: none; }

  /* A small chevron on dropdowns; it flips when open. */
  .menu__drop > .menu__top::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    margin-top: -0.2rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 150ms ease;
  }
  .menu__drop[open] > .menu__top::after { margin-top: 0.2rem; transform: rotate(225deg); }
  .menu__who::after { display: none; }
  .menu__who { gap: 0.6rem; font-size: var(--step--1); }

  .menu__drop .menu__pages {
    position: absolute;
    top: 100%;
    left: -1rem;
    min-width: 14rem;
    padding: var(--s-1) 0;
    background: var(--negro);
    border: 1px solid var(--tinta);
    border-top: 0;
    box-shadow: 0 1.25rem 2rem rgb(0 0 0 / 0.3);
  }
  .menu__drop--end .menu__pages { left: auto; right: 0; }
  .menu__pages a,
  .menu__pages button { padding: 0 1rem; font-size: var(--step-0); color: var(--piedra); }
  .menu__pages a:hover,
  .menu__pages button:hover { color: var(--papel); background: var(--tinta); }
  .menu__pages a[aria-current="page"] { color: var(--papel); }
  .menu__email { padding: 0.5rem 1rem; }
}

.notices { margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.notice { padding: var(--s-2) 0; color: var(--negro); border-top: 2px solid var(--negro); border-bottom: 1px solid var(--niebla); }
.notice--error { color: var(--rec); border-top-color: var(--rec); }


/* ------------------------------------------------------------------------
 * No access (403)
 * --------------------------------------------------------------------- */

.denied { max-width: 34rem; padding-top: var(--s-2); border-top: 2px solid var(--negro); }
.denied__code { margin: 0 0 var(--s-1); font-size: var(--step--1); color: var(--gris); }
.denied h1 {
  margin: 0 0 var(--s-2);
  font-family: var(--font-titulo);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 1.02;
  color: var(--negro);
}
.denied p:not(.denied__code) { margin: 0 0 var(--s-3); }

@media (min-width: 48rem) {
  .denied { padding-top: var(--s-3); margin-top: var(--s-4); }
}


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

.page-head { margin-bottom: var(--s-5); }

.page-head h1 {
  margin: 0;
  font-family: var(--font-titulo);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 1.02;
  color: var(--negro);
  overflow-wrap: anywhere;
}

/* A place with its own colour in the menu keeps it beside its title: a small
   filled chip (`.chip--<key>` gives the colour). */
.page-head__title { display: flex; align-items: center; gap: 0.6rem; }
.page-head__title h1 { min-width: 0; }
.page-head__chip { flex: none; width: 0.875rem; height: 0.875rem; border-radius: 2px; }

.page-head__period { margin: 0.35rem 0 0; color: var(--gris); }
.page-head > .button { margin-top: var(--s-3); }

.sample-note {
  display: inline-block;
  margin: var(--s-3) 0 0;
  padding: 0.3rem 0.65rem;
  font-size: var(--step--1);
  color: var(--gris);
  background: var(--humo);
  border-radius: 2px;
}

@media (min-width: 48rem) {
  .page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-2) var(--s-4);
    margin-bottom: var(--s-5);
  }
  .sample-note { margin: 0; }
  .page-head > .button { margin-top: 0; }
}

/* A group of headline figures ("Resumen general", "Resumen operativo"). */
.group { margin: 0 0 var(--s-5); }
.group__title { margin: 0 0 var(--s-1); font-size: var(--step-0); font-weight: 600; color: var(--negro); }

.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 2px solid var(--negro);
}

.figure { margin: 0; padding: var(--s-2) var(--s-2) var(--s-3) 0; }
.figure:nth-child(even) { padding-left: var(--s-2); border-left: 1px solid var(--niebla); }
.figure:nth-child(n + 3) { border-top: 1px solid var(--niebla); }

/* Three figures: the first takes the whole row on phones. */
.figures--three .figure:first-child { grid-column: 1 / -1; }
.figures--three .figure:nth-child(2) { padding-left: 0; border-left: 0; border-top: 1px solid var(--niebla); }
.figures--three .figure:nth-child(3) { padding-left: var(--s-2); border-left: 1px solid var(--niebla); }

.figure dt { font-size: var(--step--1); color: var(--gris); }
.figure dd { margin: var(--s-1) 0 0; }

.figure__value {
  display: block;
  font-size: var(--figure);
  font-weight: 550;
  font-stretch: 106%;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--negro);
  font-variant-numeric: tabular-nums lining-nums;
}

.figure__value--bad { color: var(--rec); }
.figures--spaced { margin-bottom: var(--s-5); }
.figure__note { display: block; margin-top: var(--s-1); font-size: var(--step--1); color: var(--gris); }

/* Resumen operativo: figures, then sales by line; side by side on laptops, with
   the figures stacked in a column as in MUT's sketch. */
.operating > .section { margin: var(--s-4) 0 0; }

@media (min-width: 64rem) {
  .operating { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-5); align-items: start; }
  .operating > .section { margin: 0; }
  /* (.figures doubled: these must beat the row layout of .figures--three below.) */
  .figures.figures--stack { grid-template-columns: minmax(0, 1fr); }
  .figures.figures--stack .figure:nth-child(n) { padding: var(--s-2) 0 var(--s-3); border-left: 0; }
  .figures.figures--stack .figure + .figure { border-top: 1px solid var(--niebla); }
}

@media (min-width: 64rem) {
  .group { margin-bottom: var(--s-6); }
  .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .figures--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .figure,
  .figure:nth-child(even),
  .figures--three .figure:nth-child(n) { padding: var(--s-2) var(--s-3) 0 0; border-top: 0; border-left: 0; }
  .figures--three .figure:first-child { grid-column: auto; }
  .figure + .figure,
  .figures--three .figure + .figure { padding-left: var(--s-3); border-left: 1px solid var(--niebla); }
}

/* Each section opens with a black rule, like the top line of a call sheet. */
.section { margin: 0 0 var(--s-5); padding-top: 0.75rem; border-top: 2px solid var(--negro); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-2);
  margin-bottom: var(--s-3);
}

.section h2 {
  margin: 0;
  font-family: var(--font-titulo);
  font-size: var(--step-0);
  font-weight: 800;
  font-stretch: 125%;
  text-transform: uppercase;
  color: var(--negro);
}

.section h3 { margin: 0; font-size: var(--step-0); font-weight: 600; color: var(--negro); }
.section .section__head h3 { font-size: var(--step-1); font-stretch: 104%; letter-spacing: -0.01em; }

/* A section's action is the same size in every section, whatever its label. */
.section__head .button { min-width: 10.5rem; }

.section__aside { margin: 0; font-size: var(--step--1); color: var(--gris); }

.split { display: grid; grid-template-columns: minmax(0, 1fr); }

@media (min-width: 64rem) {
  .section { margin-bottom: var(--s-6); }
  .split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-5); }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Monthly charts: inline SVG drawn on the server. Labels are in SVG units,
   so they're set larger on phones, where the chart is drawn smaller. */
.chart { width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--niebla); stroke-width: 1; }
.chart__in { fill: var(--negro); }
.chart__out { fill: var(--piedra); }
.chart__line { fill: none; stroke: var(--negro); stroke-width: 2; stroke-linejoin: round; }
.chart__point { fill: var(--negro); stroke: var(--papel); stroke-width: 2; }
.chart__ref { stroke: var(--gris); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart__label { fill: var(--gris); font-size: 24px; font-family: var(--font); }
.chart__axis { fill: var(--gris); font-size: 22px; font-family: var(--font); font-variant-numeric: tabular-nums; }

@media (min-width: 40rem) {
  .chart__label { font-size: 12px; }
  .chart__axis { font-size: 11px; }
}

.legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin: 0; padding: 0; list-style: none; font-size: var(--step--1); color: var(--gris); }
.legend li { display: flex; align-items: center; gap: 0.45rem; }
.legend svg { width: 0.7rem; height: 0.7rem; overflow: visible; }
.legend svg[viewBox="0 0 14 10"] { width: 1rem; }

/* Sales by line */
.lines { margin: 0; padding: 0; list-style: none; }
.lines__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3.75rem;
  gap: 0.35rem var(--s-2);
  align-items: baseline;
  padding: 0.6rem 0;
}
.lines__name { color: var(--negro); }
.lines__code { display: block; font-size: var(--step--1); color: var(--gris); font-variant-numeric: tabular-nums; }
.lines__amount { color: var(--negro); text-align: right; }
.lines__share { font-size: var(--step--1); color: var(--gris); text-align: right; }
.lines__bar { grid-column: 1 / -1; width: 100%; height: 4px; }
.lines__fill { fill: var(--negro); }
.lines--other .lines__fill { fill: var(--piedra); }
.lines__title { margin: var(--s-3) 0 0; font-size: var(--step--1); font-weight: 500; color: var(--gris); }

@media (min-width: 40rem) {
  .lines__code { display: inline-block; min-width: 5rem; margin-right: var(--s-1); }
}

.lines__total {
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  margin: var(--s-2) 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--negro);
  font-weight: 600;
  color: var(--negro);
}

.meter__track { fill: var(--niebla); }

/* Money owed: cuentas por cobrar and por pagar. */

.owed__total {
  margin: 0 0 var(--s-2);
  font-size: var(--figure);
  font-weight: 550;
  font-stretch: 106%;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--negro);
}
.owed__bar { width: 100%; height: 6px; }
.owed__current { fill: var(--negro); }
.owed__overdue { fill: var(--rec); }
.owed__split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin: var(--s-2) 0 var(--s-1); }
.owed__split dt { font-size: var(--step--1); color: var(--gris); }
.owed__split dd { margin: 0.2rem 0 0; font-weight: 600; color: var(--negro); }
.owed__split small { display: block; font-weight: 400; font-size: var(--step--1); color: var(--gris); }
.owed__late dt,
.owed__late dd { color: var(--rec); }
.owed__more { margin: var(--s-1) 0 0; font-size: var(--step--1); color: var(--gris); }

.list { margin: 0; padding: 0; list-style: none; }
.list li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: var(--s-2);
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--niebla);
}
.list__date { color: var(--gris); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.list__date--late { color: var(--rec); }
.list__what { color: var(--negro); min-width: 0; }
.list__what small { display: block; color: var(--gris); font-size: var(--step--1); }
.list__amount { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--negro); }
.list__amount--late { color: var(--rec); }
.list__what a { color: inherit; text-decoration: none; }
.list__what a:hover { color: var(--azul); }

/* Project stages */
.stages { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); margin: 0; padding: 0; list-style: none; font-size: var(--step--1); color: var(--negro); }
.stages .num { font-weight: 600; }

.stage {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--tinta);
  background: var(--humo);
  border: 1px solid transparent;
  border-radius: 2px;
  white-space: nowrap;
}
/* Each stage has its category colour, the same wherever it shows. Keyed by
   Project.stage values and by the dashboard's short names. The shoot is black:
   the brand's strongest. A project that ended early has no colour. */
.stage--lead { color: var(--papel); background: var(--cat-pizarra); }
.stage--cotizacion { color: var(--papel); background: var(--cat-ocre); }
.stage--proposal,
.stage--propuesta { color: var(--papel); background: var(--cat-ciruela); }
.stage--arranque { color: var(--papel); background: var(--cat-oliva); }
.stage--kickoff { color: var(--papel); background: var(--cat-verde); }
.stage--preproduccion { color: var(--papel); background: var(--cat-morado); }
.stage--shoot,
.stage--rodaje { color: var(--papel); background: var(--negro); }
.stage--post,
.stage--postproduccion { color: var(--papel); background: var(--cat-azul); }
.stage--delivered,
.stage--entregado { color: var(--papel); background: var(--cat-noche); }
.stage--cierre { color: var(--cat-cielo-tinta); background: var(--cat-cielo); }
.stage--cerrado { color: var(--gris); background: var(--papel); border-color: var(--piedra); }
.stage--no_viable,
.stage--perdido,
.stage--cancelado { color: var(--gris); background: var(--papel); text-decoration: line-through; }

/* A category as a filled chip: a process, a type of sale, a person, a date. */
.chip {
  display: inline-block;
  max-width: 14rem;
  padding: 0.1rem 0.55rem;
  overflow: hidden;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.5;
  color: var(--papel);
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--cat-pizarra);
  border: 1px solid transparent;
  border-radius: 2px;
}
.chip--azul,
.chip--venta-marketing { background: var(--cat-azul); }
.chip--noche { background: var(--cat-noche); }
.chip--cielo { color: var(--cat-cielo-tinta); background: var(--cat-cielo); }
.chip--rosa,
.chip--venta-recomendacion { color: var(--negro); background: var(--cat-rosa); }
.chip--verde,
.chip--venta-recurrente { background: var(--cat-verde); }
.chip--oliva { background: var(--cat-oliva); }
.chip--ocre,
.chip--venta-reactivado { background: var(--cat-ocre); }
.chip--morado,
.chip--venta-prospeccion { background: var(--cat-morado); }
.chip--ciruela { background: var(--cat-ciruela); }
.chip--pizarra,
.chip--venta-otro { background: var(--cat-pizarra); }
.chip--negro { background: var(--negro); }
/* Not a category: a date, something still to be decided, a link to a person. */
.chip--fecha { font-weight: 500; color: var(--negro); background: var(--humo); border-color: var(--niebla); }
.chip--none { font-weight: 400; color: var(--gris); background: var(--papel); border: 1px dashed var(--piedra); }
.chip--link { font-weight: 500; color: var(--negro); text-decoration: none; background: var(--humo); border-color: var(--niebla); }
.chip--link:hover { border-color: var(--negro); }

/* Choosing a colour (a process): each option shows as its chip. */
.swatches { margin: 0; padding: 0; border: 0; }
.swatches legend { padding: 0; font-size: var(--step--1); color: var(--gris); }
.swatches__options { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); }
.swatch { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; cursor: pointer; }
.swatch input { margin: 0; }

/* Timeline: every month is the same width, so bars line up with the labels.
   Phones: each project's name above its bar. Laptops: names in a column. */
.legend--timeline { margin: 0 0 var(--s-3); }

.timeline__head,
.timeline__row { display: grid; grid-template-columns: minmax(0, 1fr); }

.timeline__months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--gris);
}
.timeline__months li { padding: 0 0 0.35rem 0.35rem; border-left: 1px solid var(--niebla); }

.timeline__row { gap: 0.4rem; padding: 0.75rem 0; border-top: 1px solid var(--niebla); }
.timeline__row--load { border-top: 0; border-bottom: 1px solid var(--piedra); }
.timeline__row--load .timeline__track svg { height: 2.5rem; }

.timeline__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem var(--s-1); min-width: 0; }
.timeline__name { font-weight: 600; color: var(--negro); }
.timeline__client { font-size: var(--step--1); color: var(--gris); }
.timeline__status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); flex-basis: 100%; margin-top: 0.2rem; }
.timeline__due { font-size: var(--step--1); color: var(--gris); }
.timeline__late { font-size: var(--step--1); font-weight: 500; color: var(--rec); }
.timeline__row--proposal .timeline__name { font-weight: 500; color: var(--tinta); }

.timeline__track {
  background-image: linear-gradient(to right, var(--niebla) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
}
.timeline__track svg { width: 100%; height: 1.25rem; }
.timeline__today { stroke: var(--negro); stroke-width: 1.5; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }

.tl { vector-effect: non-scaling-stroke; }
.tl--pre { fill: var(--piedra); }
.tl--shoot { fill: var(--negro); }
.tl--post { fill: var(--gris); }
.tl--late { fill: var(--rec); }
.tl--proposal-pre,
.tl--proposal-post { fill: var(--papel); stroke: var(--piedra); stroke-width: 1; }
.tl--proposal-shoot { fill: var(--niebla); stroke: var(--gris); stroke-width: 1; }
.tl--gap { fill: url(#gap-hatch); }
.tl--load { fill: var(--tinta); }
.tl--gap-key { fill: url(#gap-hatch-key); }
.tl__hatch { stroke: var(--gris); stroke-width: 0.8; }

@media (min-width: 64rem) {
  .timeline__head,
  .timeline__row { grid-template-columns: 17rem minmax(0, 1fr); gap: var(--s-3); align-items: center; }
  .timeline__months { grid-column: 2; }
  .timeline__status { margin-top: 0.3rem; }
  .timeline__track svg { height: 1.5rem; }
  .timeline__row--load .timeline__track svg { height: 3rem; }
}

/* Weeks with no shoot booked: where MUT has room for more work. */
.gaps { margin-top: var(--s-3); }
.section .gaps__title { margin: 0 0 var(--s-1); font-size: var(--step-0); }
.gaps__list { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin: 0; padding: 0; list-style: none; color: var(--negro); }
.gaps__list small { color: var(--gris); font-size: var(--step--1); }


/* ------------------------------------------------------------------------
 * Forms on white (settings and, later, records): boxed fields, black ink.
 * --------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--papel);
  background: var(--negro);
  border: 1px solid var(--negro);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
}

.button:hover { background: var(--tinta); }

.button--quiet { color: var(--negro); background: var(--papel); border-color: var(--piedra); font-weight: 500; }
.button--quiet:hover { background: var(--papel); border-color: var(--negro); }

.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }

/* The lead form: the new client's name shows only with "+ Cliente nuevo" chosen.
   Browsers without :has() ignore the rule and always show it. */
.fields:not(:has([data-new-client] option[value="nuevo"]:checked)) #new-client-field { display: none; }
/* How the prospect arrived is asked only with the type of sale "Otro". */
.fields:not(:has([data-sale-type] option[value="otro"]:checked)) #sale-type-note-field { display: none; }
/* A long text with the formatting bar of the messages (includes/rich_field.html):
   the box draws the border, so the textarea inside has none. */
.field .composer textarea,
.field .composer textarea:hover,
.field .composer textarea:focus { border: 0; box-shadow: none; background: none; }
.field .rich textarea { min-height: 7rem; }

.field label { display: block; margin-bottom: 0.35rem; font-size: var(--step--1); color: var(--gris); }

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--negro);
  background: var(--papel);
  border: 1px solid var(--piedra);
  border-radius: 2px;
}

.field textarea { min-height: 6rem; resize: vertical; }

/* Fields swapped as a group (an address's postal code fills in the ones after it),
   laid out by the grid around them. */
.fields__part { display: contents; }
.postal-code__unknown { margin: 0; color: var(--rec); }

/* A celular: the lada, then the number. */
.mobile { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: var(--s-1); }

.field select {
  appearance: none;
  padding-right: 2.25rem;
  background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.85rem center / 0.75rem;
}

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--gris); }

.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }

.field [aria-invalid="true"] { border-color: var(--rec); }

.field__help { margin: 0.4rem 0 0; font-size: var(--step--1); color: var(--gris); }

.field .errorlist,
.settings__errors .errorlist {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--rec);
}

.settings { max-width: 62rem; }
.settings__intro h2 { margin-bottom: var(--s-1); }
.settings__intro p { margin: 0 0 var(--s-3); font-size: var(--step--1); color: var(--gris); max-width: 22rem; }
.settings__errors { margin-bottom: var(--s-4); }
.settings__empty { margin: 0 0 var(--s-4); color: var(--gris); }

.settings__actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 2px solid var(--negro);
}

@media (min-width: 40rem) {
  .settings__actions { flex-direction: row; align-items: center; }
}

/* Read-only settings: label above value on phones, side by side from tablets. */
.facts { margin: 0; }
.facts__row { padding: 0.75rem 0; border-bottom: 1px solid var(--niebla); }
.facts__row:first-child { padding-top: 0; }
.facts dt { font-size: var(--step--1); color: var(--gris); }
.facts dd { margin: 0.2rem 0 0; color: var(--negro); overflow-wrap: anywhere; }
.facts__none { color: var(--gris); }

@media (min-width: 48rem) {
  .facts__row { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: var(--s-3); }
  .facts__row:first-child { padding-top: 0.75rem; }
  .facts dd { margin: 0; }
}

/* Changes waiting for confirmation: what it was, struck through, then what it
   will be. */
.changes { margin: 0; }
.changes__row { padding: var(--s-2) 0; border-bottom: 1px solid var(--niebla); }
.changes dt { font-size: var(--step--1); color: var(--gris); }
.changes dd { margin: 0.25rem 0 0; overflow-wrap: anywhere; }
.changes__before { color: var(--gris); text-decoration: line-through; }
.changes__after { color: var(--negro); font-weight: 600; }
.changes__after::before { content: "→ "; font-weight: 400; color: var(--gris); }

@media (min-width: 48rem) {
  .changes__row {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s-3);
    align-items: baseline;
  }
  .changes dd { margin: 0; }
}

@media (min-width: 48rem) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
  .field--wide { grid-column: 1 / -1; }
}

@media (min-width: 64rem) {
  .settings__group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-5); }
  .settings__intro p { margin-bottom: 0; }
}


/* ------------------------------------------------------------------------
 * Records: lists of clients and projects, their pages and forms, modals.
 * --------------------------------------------------------------------- */

.page-head__crumb { margin: 0 0 var(--s-1); font-family: var(--font-pixel); font-size: 0.875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gris); }
.page-head__crumb a { color: inherit; }
.page-head__meta { margin: 0.5rem 0 0; font-family: var(--font-pixel); font-size: 0.875rem; letter-spacing: 0.04em; color: var(--gris); overflow-wrap: anywhere; }
.page-head__period a { color: var(--negro); }
.page-head__period .stage { vertical-align: 0.1em; }

.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-3); }
.page-head__actions form { margin: 0; }

@media (min-width: 48rem) {
  .page-head__actions { margin-top: 0; justify-content: flex-end; }
}

/* Save and cancel under a field edited in place, inside its section. */
.inline-actions { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-2); }

/* Search and tabs above a list. */
.toolbar { display: grid; gap: var(--s-2); margin: 0 0 var(--s-3); }
.search { margin: 0; }
.search input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--negro);
  background: var(--papel);
  border: 1px solid var(--piedra);
  border-radius: 2px;
}
.search input:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }
/* A search with filters beside it: stacked on phones, one line from tablets up. */
.search--filters { display: grid; gap: var(--s-1); }
.search--filters select {
  min-height: 2.75rem;
  padding: 0.55rem 2.25rem 0.55rem 0.75rem;
  font: inherit;
  color: var(--negro);
  appearance: none;
  background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.85rem center / 0.75rem;
  border: 1px solid var(--piedra);
  border-radius: 2px;
}
.search--filters select:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }

.tabs {
  display: flex;
  gap: var(--s-3);
  margin: 0 0 var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--niebla);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  white-space: nowrap;
  text-decoration: none;
  color: var(--gris);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--negro); }
.tabs a[aria-current="page"] { color: var(--negro); font-weight: 600; border-bottom-color: var(--azul); }

@media (min-width: 48rem) {
  .toolbar { grid-template-columns: auto minmax(16rem, 24rem); justify-content: space-between; align-items: end; }
  .toolbar .tabs { margin: 0; }
  .toolbar:has(> .search:only-child) { grid-template-columns: minmax(0, 24rem); justify-content: start; }
  .toolbar:has(> .search--filters) { grid-template-columns: auto minmax(0, 44rem); }
  .search--filters { grid-template-columns: minmax(12rem, 1fr) auto auto; }
}

.empty { margin: var(--s-3) 0; color: var(--gris); }

/* Tables of records: stacked rows on phones, a table from tablets up. */
.records { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; }
.records thead { display: none; }
.records tbody,
.records td { display: block; }
.records tr {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem var(--s-2);
  align-items: baseline;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--niebla);
}
.records td { padding: 0; }
.records__code { color: var(--gris); font-size: var(--step--1); }
.records__main { flex: 1 1 60%; min-width: 0; }
.records__main a { font-weight: 600; color: var(--negro); text-decoration: none; }
.records__main a:hover { text-decoration: underline; }
.records__sub { display: block; font-size: var(--step--1); color: var(--gris); }
.records__meta { font-size: var(--step--1); color: var(--gris); }
.records__meta[data-label]::before { content: attr(data-label) ": "; }

@media (min-width: 48rem) {
  .records thead { display: table-header-group; }
  .records tbody { display: table-row-group; }
  .records tr { display: table-row; }
  .records td,
  .records th { display: table-cell; padding: 0.8rem var(--s-3) 0.8rem 0; border-bottom: 1px solid var(--niebla); vertical-align: baseline; }
  .records th { padding-top: 0; font-size: var(--step--1); font-weight: 500; color: var(--gris); text-align: left; white-space: nowrap; }
  .records td:last-child,
  .records th:last-child { padding-right: 0; }
  .records .r { text-align: right; }
  .records__meta { font-size: var(--step-0); color: var(--tinta); white-space: nowrap; }
  .records__meta[data-label]::before { content: none; }
  .records__code { font-size: var(--step-0); width: 4.5rem; }
}

/* Forms for records: groups with a quiet legend. */
.record-form { max-width: 62rem; }
.record-form__group { margin: 0 0 var(--s-4); padding: 0; border: 0; min-width: 0; }
.record-form__group legend {
  display: block;
  width: 100%;
  margin: 0 0 var(--s-2);
  padding: 0.75rem 0 0;
  font-weight: 600;
  color: var(--negro);
  border-top: 2px solid var(--negro);
}
.record-form__actions { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 2px solid var(--negro); }

@media (min-width: 40rem) {
  .record-form__actions { flex-direction: row; align-items: center; }
}

.field__optional { color: var(--piedra); }
/* Not required to save, but needed for a step that comes later: it says which. */
.field__needed { color: var(--gris); }
.fields.fields--single { grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s-3); }

/* A payment policy: one row per instalment, stacked on phones, one line on wide screens. */
.terms__intro { margin: 0 0 var(--s-2); }
.terms { margin: 0 0 var(--s-2); padding: 0; list-style: none; }
.terms__row { padding: var(--s-2) 0; border-bottom: 1px solid var(--niebla); }
.terms__row:first-child { padding-top: 0; }
/* Only the box and its words toggle it, not the empty space across the row. */
.check.terms__remove { display: inline-flex; font-size: var(--step--1); color: var(--gris); }

@media (min-width: 48rem) {
  .fields.fields--terms { grid-template-columns: 7rem 6rem minmax(0, 1fr) minmax(0, 2fr); }
}

/* Modals: a full sheet on phones, a centred panel on larger screens. */
.dialog {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: var(--s-3) var(--gutter) var(--s-4);
  color: var(--tinta);
  background: var(--papel);
  border: 0;
  overflow-y: auto;
}
.dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-3); }
.dialog__head h2 { margin: 0; font-family: var(--font-titulo); font-size: var(--step-1); font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: var(--negro); }
.dialog__close {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--negro);
  background: none;
  border: 0;
  cursor: pointer;
}
.dialog__text { margin: 0 0 var(--s-3); }
.dialog .record-form__group legend { border-top-width: 1px; }

@media (min-width: 48rem) {
  .dialog {
    width: min(46rem, calc(100% - 4rem));
    height: fit-content;  /* a modal dialog is pinned top and bottom: auto would stretch it */
    max-height: calc(100% - 4rem);
    margin: auto;
    padding: var(--s-4);
    border-radius: 2px;
  }
  .dialog--small { width: min(32rem, calc(100% - 4rem)); }
}

/* Project information, as in MUT's sheet: label above value, many per row. */
.info__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); margin: 0; }
.info__grid dt { font-size: var(--step--1); color: var(--gris); }
.info__grid dd { margin: 0.2rem 0 0; color: var(--negro); overflow-wrap: anywhere; }
.info__note { display: block; margin-top: 0.3rem; font-size: var(--step--1); color: var(--tinta); }
.info__grid dd a { color: inherit; }
.info__grid > :first-child { grid-column: 1 / -1; }  /* the nomenclatura is long */

@media (min-width: 48rem) {
  .info__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .info__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); }
  .info__grid > :first-child { grid-column: span 2; }
}

.prose { max-width: 40rem; color: var(--tinta); }
.prose p { margin: 0 0 var(--s-2); }

.history { margin: 0; padding: 0; list-style: none; }
.history li { padding: 0.75rem 0; border-bottom: 1px solid var(--niebla); }
.history__what { display: block; color: var(--negro); }
.history__meta { display: block; font-size: var(--step--1); color: var(--gris); }
.history__note { margin: 0.35rem 0 0; color: var(--tinta); overflow-wrap: anywhere; }
/* An interaction's files and its edit link. */
.history__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-3); margin: 0; padding: 0; list-style: none; }
.history__links li { padding: 0; border: 0; }
.history__links a { display: inline-flex; align-items: center; min-height: 2.75rem; overflow-wrap: anywhere; }
.history__edit { color: var(--gris); }

/* What is pending with the client. Late is a problem: red. */
.next-step { margin: 0 0 var(--s-2); padding: var(--s-2); color: var(--negro); background: var(--humo); border-left: 3px solid var(--azul); overflow-wrap: anywhere; }
.next-step--late { border-left-color: var(--rec); }
.next-step__label { display: block; font-size: var(--step--1); color: var(--gris); }
.next-step--late .next-step__label { color: var(--rec); }

/* A project's checklist of process checkpoints. Only a late one is coloured: red. */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) 0; border-bottom: 1px solid var(--niebla); }
.checklist__text { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.checklist__when { display: block; font-size: var(--step--1); color: var(--gris); }
.checklist__row--done strong { font-weight: 500; }
.checklist__row--late .checklist__when { color: var(--rec); font-weight: 600; }


/* ------------------------------------------------------------------------
 * Contacts: people, their clients and projects.
 * --------------------------------------------------------------------- */

.button--small { min-height: 2.75rem; padding: 0.45rem 1rem; font-size: var(--step--1); }
/* Deleting is the one action that can lose information: it gets the problem red. */
.button--danger { background: var(--rec); border-color: var(--rec); }
.button--danger:hover { background: var(--rec); filter: brightness(0.88); }

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0;
  font: inherit;
  font-size: var(--step--1);
  color: var(--gris);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.link-button:hover { color: var(--negro); }

/* Initials in a black square: MUT's ink, no photos to manage. */
.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--papel);
  background: var(--negro);
  border-radius: 2px;
}
.avatar--lg { width: 3.5rem; height: 3.5rem; font-size: var(--step-1); }
.avatar--muted { color: var(--gris); background: var(--humo); }

/* With a photo: the face, cropped square from the 2:3 portrait. */
.avatar--photo { overflow: hidden; background: var(--azul); }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.avatar--photo.avatar--muted img { filter: grayscale(1); opacity: 0.6; }

/* Several people on one thing (a task's row): their avatars overlapping, the
   first on top, then "+N" for the ones that don't fit. */
.avatars { display: inline-flex; flex: none; align-items: center; }
.avatars .avatar { position: relative; z-index: 2; box-shadow: 0 0 0 2px var(--papel); }
.avatars .avatar + .avatar { z-index: 1; margin-left: -0.5rem; }
.avatars .avatar + .avatar + .avatar { z-index: 0; }
.avatars__more { margin-left: 0.3rem; font-size: 0.6875rem; font-weight: 600; color: var(--gris); }

/* A collaborator's portrait, as the brand frames people: 2:3, on MUT blue, with
   the brand's grain over it (docs/design.md, "People's photos"). */
.portrait {
  flex: none;
  width: 6rem;
  margin: 0;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--azul-noche) var(--fondo-azul);
  border-radius: 2px;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait.grano::after { z-index: 1; opacity: 0.22; }  /* the grain sits on the photo */

/* The collaborator form reads like a profile: the portrait first (tap it to choose
   a photo; static/js/app.js previews it), then the name. Stacked on phones, the
   portrait beside the name from tablets up. */
.profile__head { display: grid; gap: var(--s-3); margin-bottom: var(--s-3); }
.profile__photo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-2); align-items: end; }
.profile__portrait { position: relative; display: block; width: 7.5rem; cursor: pointer; }
.profile__portrait img[hidden] { display: none; }
.profile__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-titulo);
  font-size: var(--step-2);
  font-stretch: 125%;
  font-weight: 800;
  color: var(--papel);
}
.profile__portrait.has-photo .profile__placeholder { display: none; }
.profile__action {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: var(--papel);
  background: rgb(0 0 0 / 0.55);
}
.profile__portrait:hover .profile__action { background: var(--negro); }
.profile__file { min-width: 0; }
.profile__file input[type="file"] { width: 100%; min-height: 2.75rem; padding: 0.5rem 0; font: inherit; font-size: var(--step--1); border: 0; }
.profile__fields { margin: 0; }

@media (min-width: 48rem) {
  .profile__head { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--s-4); }
  .profile__photo { grid-template-columns: 1fr; width: 10rem; }
  .profile__portrait { width: 10rem; }
}

@media (min-width: 48rem) {
  .avatar--lg { width: 4.5rem; height: 4.5rem; font-size: var(--step-2); }
  .portrait { width: 8rem; }
}

.who { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.who__text { min-width: 0; }
.who__text > a { font-weight: 600; color: var(--negro); text-decoration: none; }
.who__text > a:hover { text-decoration: underline; }
.who--title { align-items: center; gap: var(--s-2); }
.who--title .page-head__period { overflow-wrap: anywhere; }

.tag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.05rem 0.5rem;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--tinta);
  background: var(--humo);
  border-radius: 2px;
  white-space: nowrap;
}
.tag--former { margin: 0 0.35rem 0 0; color: var(--gris); background: var(--papel); border: 1px solid var(--niebla); }

/* The list: who, where they work now, how to reach them. */
.records--people .records__main { flex-basis: 100%; }
.records__where { flex-basis: 100%; }

/* Row buttons (edit, archive): on their own line on phones, at the right end from tablets up. */
.records__actions { display: flex; flex-wrap: wrap; gap: var(--s-1); flex-basis: 100%; }
.records__actions form { margin: 0; }

@media (min-width: 48rem) {
  .records td.records__actions { display: table-cell; text-align: right; white-space: nowrap; }
  .records__actions form { display: inline-block; margin-left: var(--s-1); }
}
.where { display: block; color: var(--tinta); }
.where small { font-size: var(--step--1); color: var(--gris); }
.records__none { color: var(--piedra); }
.records__more { color: var(--gris); font-size: var(--step--1); }
.records--people .records__meta a { color: inherit; text-decoration: none; }

@media (min-width: 48rem) {
  .records--people td { vertical-align: middle; }
  .records__where { white-space: normal; }
  .records--people .records__meta a:hover { text-decoration: underline; }
}

.empty-state { margin: var(--s-4) 0; padding: var(--s-4) 0; border-top: 1px solid var(--niebla); }
.empty-state p { margin: 0 0 var(--s-2); max-width: 34rem; color: var(--gris); }

/* A person's page: one row of ways to reach them. */
.reach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 var(--s-5); background: var(--niebla); border: 1px solid var(--niebla); }
.reach__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.75rem;
  padding: 0.6rem var(--s-2);
  color: var(--negro);
  background: var(--papel);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.reach__link span:first-child { font-size: var(--step--1); color: var(--gris); }
.reach__link:hover { background: var(--humo); }

@media (min-width: 48rem) {
  .reach { display: flex; flex-wrap: wrap; }
  .reach__link { flex: 1 1 12rem; }
}

/* Cards: a person at a client. */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--s-2);
  border: 1px solid var(--niebla);
  border-top: 2px solid var(--negro);
  border-radius: 2px;
}
.card--former { border-top-color: var(--piedra); }
.card--former h3 a { color: var(--tinta); }
.card__head { display: flex; align-items: center; gap: 0.75rem; }
.card__title { min-width: 0; }
.card__title h3 { margin: 0; font-size: var(--step-0); font-weight: 600; }
.card__title h3 a { color: var(--negro); text-decoration: none; }
.card__title h3 a:hover { text-decoration: underline; }
.card__title p { margin: 0; font-size: var(--step--1); color: var(--gris); }
.card__tags { margin: 0; }
.card__when { margin: 0; font-size: var(--step--1); color: var(--gris); }
.card__reach { display: flex; flex-direction: column; margin: 0; font-size: var(--step--1); overflow-wrap: anywhere; }
.card__reach a { color: var(--tinta); }
.card__actions { display: flex; flex-wrap: wrap; gap: 0 var(--s-3); margin-top: auto; padding-top: 0.25rem; border-top: 1px solid var(--niebla); }
.card__actions a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--step--1); color: var(--gris); }
.card__actions a:hover { color: var(--negro); }

@media (min-width: 48rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
}

@media (min-width: 64rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Former employees: tucked away, one tap to open. */
.former { margin-top: var(--s-3); }
.former summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--gris);
  cursor: pointer;
  list-style: none;
}
.former summary::-webkit-details-marker { display: none; }
.former summary::before { content: "+"; display: inline-block; width: 1rem; font-weight: 600; color: var(--negro); }
.former[open] summary::before { content: "−"; }
.former summary:hover { color: var(--negro); }
.former .cards { margin-top: var(--s-2); }

.meta-line { margin: var(--s-3) 0 0; font-size: var(--step--1); color: var(--gris); }

/* Roles as toggle chips: tap to select; works without JavaScript. */
.chips-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.chips-field legend { display: block; margin-bottom: 0.35rem; padding: 0; font-size: var(--step--1); color: var(--gris); }
/* A choice to switch on and off (a checkbox or a radio and its label). Not the
   filled .chip that names a category. */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.toggle-chip { position: relative; display: inline-flex; }
.toggle-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.4rem 0.95rem;
  color: var(--tinta);
  background: var(--papel);
  border: 1px solid var(--piedra);
  border-radius: 2px;
  user-select: none;
}
.toggle-chip:hover span { border-color: var(--negro); }
.toggle-chip input:checked + span { color: var(--papel); background: var(--negro); border-color: var(--negro); }
.toggle-chip input:checked + span::before { content: "✓"; margin-right: 0.4rem; font-weight: 600; }
.toggle-chip input:focus-visible + span { outline: 2px solid var(--negro); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 2.75rem; padding: 0.5rem 0; cursor: pointer; }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; accent-color: var(--negro); }
.check--strong { font-weight: 600; color: var(--negro); }

/* Possible duplicates, while typing and when saving. */
.matches-slot:empty { display: none; }
.matches-slot { margin-top: var(--s-2); }
.matches { padding: var(--s-2); background: var(--humo); border-left: 3px solid var(--negro); }
.matches + .matches { margin-top: var(--s-1); }
.matches--hard,
.matches--confirm { border-left-color: var(--rec); }
.matches__title { margin: 0 0 var(--s-1); font-weight: 600; color: var(--negro); }
.matches__title a { font-weight: 400; }
.matches__list { margin: 0 0 var(--s-1); padding: 0; list-style: none; }
.matches__list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; }
.matches__list .avatar { width: 2rem; height: 2rem; }
.matches__list a { font-weight: 600; color: var(--negro); }
.matches__list small { display: block; font-size: var(--step--1); color: var(--gris); }
.matches__hint { margin: 0; font-size: var(--step--1); color: var(--gris); }

/* Choosing a person: a short, searchable list of radio cards. */
.picker__search { margin: 0 0 var(--s-2); }
.field__label { display: block; margin-bottom: 0.35rem; font-size: var(--step--1); color: var(--gris); }
.picker { display: grid; gap: var(--s-1); margin: 0 0 var(--s-3); }
.picker--flush { margin: 0; padding: 0; border: 0; min-width: 0; }
.picker__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.6rem var(--s-2) 0.6rem 0.75rem;
  border: 1px solid var(--niebla);
  border-radius: 2px;
  cursor: pointer;
}
.picker__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.picker__option:hover { border-color: var(--piedra); }
.picker__option:has(input:checked) { border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }
.picker__option:has(input:checked)::after { content: "✓"; margin-left: auto; font-weight: 600; color: var(--negro); }
.picker__option:has(input:focus-visible) { outline: 2px solid var(--negro); outline-offset: 2px; }
.picker__text { min-width: 0; }
.picker__text strong { display: block; color: var(--negro); }
.picker__text small { display: block; font-size: var(--step--1); color: var(--gris); overflow-wrap: anywhere; }
.picker__empty { margin: 0; padding: var(--s-1) 0; color: var(--gris); }
.picker__new { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; color: var(--negro); }

.record-form__aside { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--step--1); color: var(--gris); }
.record-form__aside:hover { color: var(--rec); }

@media (min-width: 40rem) {
  .record-form__aside { margin-left: auto; }
}

/* Before deleting someone with links: what goes with them. */
.warning { margin: 0 0 var(--s-2); padding: var(--s-2); color: var(--tinta); background: var(--humo); border-left: 3px solid var(--rec); }
.warning p { margin: 0 0 var(--s-1); }
.warning__title { font-weight: 600; color: var(--rec); }
.warning__label { margin-top: var(--s-2); font-size: var(--step--1); color: var(--gris); }
.warning__list { margin: 0 0 var(--s-2); padding: 0; list-style: none; }
.warning__list li { padding: 0.3rem 0; border-bottom: 1px solid var(--niebla); }
.warning__tip { font-size: var(--step--1); color: var(--gris); }

/* A project's contacts: who, how to reach them, their role (changes in place). */
.contacts { margin: 0; padding: 0; list-style: none; }
.contacts__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem var(--s-2);
  align-items: center;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--niebla);
  transition: background-color 900ms ease-out;
}
.contacts__row .who { grid-column: 1 / -1; }
.contacts__reach { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 var(--s-2); font-size: var(--step--1); overflow-wrap: anywhere; }
.contacts__reach a { color: var(--tinta); }
.contacts__role form { margin: 0; }
.contacts__remove { margin: 0; justify-self: end; }
.contacts__row.is-changed { animation: settled 1400ms ease-out; }

@keyframes settled {
  from { background-color: var(--humo); }
  to { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .contacts__row.is-changed { animation: none; }
}

.select-inline {
  min-height: 2.75rem;
  padding: 0.4rem 2.1rem 0.4rem 0.7rem;
  font: inherit;
  font-size: var(--step--1);
  color: var(--negro);
  background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.7rem center / 0.65rem;
  border: 1px solid var(--piedra);
  border-radius: 2px;
  appearance: none;
  cursor: pointer;
}
.select-inline:hover { border-color: var(--negro); }
.select-inline:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }

@media (min-width: 48rem) {
  .contacts__row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) auto auto; gap: var(--s-3); }
  .contacts__row .who,
  .contacts__reach { grid-column: auto; }
  .contacts__reach { flex-direction: column; }
}

/* The expense catalogue: department, category, nomenclaturas. */
.catalog__group { margin: 0 0 var(--s-3); }
.catalog__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem var(--s-2); padding: var(--s-1) 0; border-bottom: 1px solid var(--niebla); }
.catalog__actions { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); font-size: var(--step--1); }
.catalog__actions a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--negro); }
.catalog__code { display: inline-block; min-width: 4.5rem; color: var(--gris); }


/* Bank movements: long tables of figures. */
.movements__date { white-space: nowrap; }
.movements .records__sub { overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.pager__where { font-size: var(--step--1); color: var(--gris); }


/* Notifications: the bell and the list */

/* The bell sits in the black bar at every width. Phones: the logo, then the bell
   and the menu button together on the right. Laptops: after the menu, at the end. */
.bell { display: flex; flex: none; margin-left: auto; margin-right: calc(-1 * var(--s-3)); }
.bell__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--piedra);
}
.bell__link:hover,
.bell__link[aria-current="page"] { color: var(--papel); }
.bell__icon { width: 1.375rem; height: 1.375rem; }
/* Unread is a state: MUT blue (never red, which means a problem). */
.bell__count {
  position: absolute;
  top: 0.2rem;
  left: 50%;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: calc(1.25rem - 4px);
  text-align: center;
  color: var(--papel);
  background: var(--azul);
  border: 2px solid var(--negro);
  border-radius: 1rem;
}
/* With the bell in the bar, a long page name in the menu button is cut short
   instead of pushing the bar wider than a phone. */
.menu { min-width: 0; }
.menu__toggle { max-width: 100%; }
.menu__current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 64rem) {
  /* The bar's gap is wide there; the bell stays close to the account menu. */
  .bell { order: 3; margin-left: calc(var(--s-3) - var(--s-6)); margin-right: 0; }
}

/* The page: one row per notice, unread ones marked in blue. */
.notifications__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-3); margin: 0 0 var(--s-3); }
.notifications__bar .tabs { flex: 1 1 auto; margin: 0; }
.notifications__bar form { margin: 0; }
.notifications__count { margin-left: 0.4rem; padding: 0.05rem 0.4rem; font-size: 0.75rem; font-weight: 700; color: var(--papel); background: var(--azul); border-radius: 1rem; }

.notifications { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--negro); }
.notification { border-bottom: 1px solid var(--niebla); }
.notification__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-2);
  align-items: start;
  padding: var(--s-2) var(--s-1) var(--s-2) calc(var(--s-2) - 3px);
  color: var(--tinta);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.notification__link:hover { background: var(--humo); }
.notification.is-unread .notification__link { border-left-color: var(--azul); }
.notification__icon { width: 1.25rem; height: 1.25rem; }
.notification__body { display: grid; gap: 0.2rem; min-width: 0; overflow-wrap: anywhere; }
.notification__text { color: var(--gris); }
.notification.is-unread .notification__text { font-weight: 600; color: var(--negro); }
.notification__detail { color: var(--gris); }
.notification.is-unread .notification__detail { color: var(--tinta); }
.notification__when { font-size: var(--step--1); color: var(--gris); }




/* The board of projects (/proyectos/): groups, each with its table.
   Phones: a project is a block, with what matters most in two columns.
   Laptops: the whole table; wider than the page, it scrolls sideways inside its
   own box (never the page) and the project's name stays in place. */
.board-clear { margin: 0 0 var(--s-2); font-size: var(--step--1); }
.board-group { margin: 0 0 var(--s-4); border-top: 2px solid var(--negro); border-left: 4px solid var(--grupo, var(--negro)); }
.board-group--propuesta { --grupo: var(--cat-ciruela); }
.board-group--vigentes { --grupo: var(--cat-azul); }
.board-group--entregados { --grupo: var(--cat-ocre); }
.board-group--terminados { --grupo: var(--cat-verde); }
.board-group--perdidos { --grupo: var(--piedra); }
.board-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s-2);
  min-height: 2.75rem;
  padding: 0.6rem var(--s-2);
  cursor: pointer;
}
.board-group__name { font-family: var(--font-titulo); font-size: var(--step-1); font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: var(--negro); }
.board-group__count { font-size: var(--step--1); color: var(--gris); }
.board-group > .empty { margin: 0; padding: 0 var(--s-2) var(--s-2); }

.board { display: block; width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums lining-nums; }
.board thead { display: none; }
.board tbody { display: block; }
.board tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem var(--s-2); padding: var(--s-2); border-top: 1px solid var(--niebla); }
.board th,
.board td { display: block; min-width: 0; padding: 0; font-weight: 400; text-align: left; }
.board td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.15rem; font-size: var(--step--1); color: var(--gris); }
.board .board__project { grid-column: 1 / -1; }
.board .board__counts { grid-column: 1 / -1; display: flex; gap: var(--s-2); margin: -0.4rem 0; }
.board .board__extra { display: none; }
.board__project a { display: inline-block; padding: 0.3rem 0; font-weight: 600; color: var(--negro); text-decoration: none; overflow-wrap: anywhere; }
.board__project a:hover { text-decoration: underline; }
.board__bar { font-weight: 400; color: var(--piedra); }
.board__none { color: var(--piedra); }
.board__owner .who { gap: 0.5rem; }
.board__owner .avatar { display: none; }
.board-count { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 2.75rem; min-height: 2.75rem; font-size: var(--step--1); font-weight: 600; color: var(--negro); text-decoration: none; }
.board-count:hover { color: var(--azul); }
.board__late { color: var(--rec); font-weight: 600; }
.board-count--none { font-weight: 400; color: var(--gris); }

/* Tasks: boards and the task page */

/* A project's tabs sit right under its head. */
.page-head:has(+ .tabs) { margin-bottom: var(--s-3); }
.page-head + .tabs { margin-bottom: var(--s-4); }

/* A slim page head, for pages that are a list to work in (a board of tasks, a
   task, the notes): the title is one line of text, not a headline, so the work
   starts near the top of the screen. */
.page-head--slim { margin-bottom: var(--s-2); }
.page-head--slim h1 { font-size: 1.25rem; line-height: 1.2; }
.page-head--slim .page-head__crumb { margin-bottom: 0.15rem; font-size: 0.75rem; }
.page-head--slim .page-head__period { margin-top: 0.15rem; font-size: var(--step--1); }
.page-head--slim .page-head__title { gap: 0.5rem; }
.page-head--slim .page-head__title .avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.page-head--slim .page-head__actions { margin-top: var(--s-1); }
.page-head--slim:has(+ .tabs) { margin-bottom: var(--s-1); }

/* The quick form of a board, folded under its button ("Agregar tarea"): it takes
   room only while it is used. */
.task-new { margin: var(--s-1) 0 0; }
.task-new--board { margin: 0 0 var(--s-2); }
.task-new__open { width: fit-content; list-style: none; }
.task-new__open::-webkit-details-marker { display: none; }
.task-new__open::before { content: "+"; margin-right: 0.4rem; font-weight: 600; }
.task-new[open] > .task-new__open { font-weight: 500; color: var(--negro); background: var(--papel); border-color: var(--piedra); }
.task-new[open] > .task-new__open::before { content: "−"; }
.task-new > .task-add { margin: var(--s-1) 0 0; }

/* A form folded under a quiet link ("Agregar persona", "Agregar enlace"). */
.fold__open { list-style: none; }
.fold__open::-webkit-details-marker { display: none; }
.fold__open::before { content: "+"; display: inline-block; width: 0.9rem; font-weight: 600; text-decoration: none; }
.fold[open] > .fold__open::before { content: "−"; }

/* A board's filters: stacked on phones, one line on laptops. */
.task-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); align-items: center; margin: 0 0 var(--s-3); }
.task-filters input[type="search"],
.task-filters input[type="date"],
.task-filters select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--negro);
  background-color: var(--papel);
  border: 1px solid var(--piedra);
  border-radius: 2px;
}
.task-filters select {
  padding-right: 2.25rem;
  appearance: none;
  background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.85rem center / 0.75rem;
  text-overflow: ellipsis;
}
.task-filters input[type="search"]:focus,
.task-filters input[type="date"]:focus,
.task-filters select:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }
.task-filters__check { align-items: center; padding: 0; }
.task-filters__check input { margin: 0; }
/* The general board's range of due dates: two dates side by side, each under its label. */

/* The quick form on top of a board. */
.task-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1) var(--s-2); align-items: end; margin: 0 0 var(--s-2); padding: var(--s-2); background: var(--humo); }
.task-add__submit { justify-self: start; }

/* Tasks by month. Phones: each task is a small block (its title, then what can
   change on it); laptops: a table. */
.tasks { display: block; width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; }
.tasks thead { display: none; }
.tasks tbody,
.tasks tr,
.tasks th,
.tasks td { display: block; padding: 0; }
.tasks tbody { margin: 0 0 var(--s-3); }
.tasks .tasks__group th { padding: var(--s-1) 0; text-align: left; border-bottom: 2px solid var(--negro); }
/* A group's header, as in Monday: a bar in the group's colour (its department's
   or its person's `.chip--<key>`; black when it has none), its name, how many
   tasks it has and, where the board tallies them, a thin bar of the ones done. */
.tasks__head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); min-width: 0; padding-left: 1rem; }
.tasks__bar { position: absolute; top: 0; bottom: 0; left: 0; width: 0.5rem; border-radius: 2px; }
.tasks__month { min-width: 0; font-family: var(--font-titulo); font-size: var(--step-0); font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: var(--negro); overflow-wrap: anywhere; }
.tasks__count { font-size: var(--step--1); font-weight: 400; color: var(--gris); }
/* Done out of all: the fill is the green of a finished task's status. */
.tasks__progress { flex: none; align-self: center; width: 5rem; height: 0.25rem; overflow: hidden; color: var(--cat-verde); background: var(--niebla); border: 0; border-radius: 2px; appearance: none; }
.tasks__progress::-webkit-progress-bar { background: var(--niebla); }
.tasks__progress::-webkit-progress-value { background: var(--cat-verde); }
.tasks__progress::-moz-progress-bar { background: var(--cat-verde); }

.tasks .task {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem var(--s-2);
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--niebla);
}
.task__main { grid-column: 1; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
.task__talk { grid-column: 2; grid-row: 1; justify-self: end; }
.task__owner { grid-column: 1; grid-row: 2; min-width: 0; }
.task__due { grid-column: 2; grid-row: 2; min-width: 0; }
.task__status { grid-column: 1; grid-row: 3; min-width: 0; }
.task__priority { grid-column: 2; grid-row: 3; min-width: 0; }
.task__stage { grid-column: 1 / -1; grid-row: 4; min-width: 0; }

.task form { margin: 0; }
.task__main a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; color: var(--negro); text-decoration: none; }
.task__main a:hover { text-decoration: underline; }
.task--done .task__main a { font-weight: 500; color: var(--gris); }
.task__project { display: block; margin-top: -0.5rem; font-size: var(--step--1); color: var(--gris); }

/* A value that opens its choices: a task's owner, priority, status or date on a
   board. It reads as plain text until it is pointed at; then it is a button. */
.pick { position: relative; min-width: 0; }
.pick__value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.25rem 1.5rem 0.25rem 0.4rem;
  margin-left: -0.4rem;
  font-size: var(--step--1);
  color: var(--negro);
  list-style: none;
  border-radius: 2px;
  cursor: pointer;
}
.pick__value::-webkit-details-marker { display: none; }
.pick > .pick__value {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b69' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.6rem;
}
.pick > .pick__value:hover,
.pick[open] > .pick__value { background-color: var(--humo); }
.pick > .pick__value:focus-visible { outline: 2px solid var(--negro); outline-offset: -2px; }
.pick__value--static { padding-right: 0.4rem; cursor: default; }
.pick__value .avatar { flex: none; width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.pick__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__text--none { color: var(--gris); }
.pick__panel {
  position: absolute;
  top: 100%;
  left: -0.4rem;
  z-index: 5;
  display: grid;
  min-width: 13rem;
  max-width: min(20rem, calc(100vw - 2 * var(--gutter)));
  max-height: 20rem;
  margin: 0.2rem 0 0;
  padding: 0.3rem;
  overflow-y: auto;
  background: var(--papel);
  border: 1px solid var(--negro);
  border-radius: 2px;
  box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
}
.pick--end .pick__panel { right: 0; left: auto; }
.pick__panel form { display: grid; margin: 0; }
.pick__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: var(--step--1);
  color: var(--negro);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.pick__option:hover,
.pick__option:focus-visible { background: var(--humo); }
.pick__option.is-current { font-weight: 600; }
.pick__option.is-current::after { content: "✓"; margin-left: auto; padding-left: 0.5rem; }
.pick__option .avatar { flex: none; width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.pick__panel--date { gap: 0.3rem; min-width: 14rem; padding: 0.6rem; }
.pick__panel--date label { font-size: var(--step--1); color: var(--gris); }
.pick__panel--date .pick__option { padding-left: 0; padding-right: 0; color: var(--gris); }
.pick__panel--date .pick__option:hover { color: var(--negro); background: none; text-decoration: underline; }
/* The same thing as a field: a filter over the board. */
.pick--field > .pick__value { margin-left: 0; padding-left: 0.75rem; font-size: var(--step-0); background-color: var(--papel); border: 1px solid var(--piedra); }
.pick--field > .pick__value:hover,
.pick--field[open] > .pick__value { background-color: var(--papel); border-color: var(--negro); }

/* A task's status: a block in its colour. Stuck is a problem, so it is red. */
.status {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.5;
  color: var(--tinta);
  white-space: nowrap;
  background: var(--humo);
  border: 1px solid var(--piedra);
  border-radius: 2px;
}
.status--en_curso { color: var(--papel); background: var(--cat-azul); border-color: var(--cat-azul); }
.status--estancado { color: var(--papel); background: var(--rec); border-color: var(--rec); }
.status--listo { color: var(--papel); background: var(--cat-verde); border-color: var(--cat-verde); }
/* On a board the status takes its whole cell, as in Monday: the cell is filled
   with the colour of the value in it (the same pairs as above; the text keeps
   its own colour), however tall the row is. */
.task__status { background: var(--humo); }
.task__status:has(> .status--en_curso, > .pick > .status--en_curso) { background: var(--cat-azul); }
.task__status:has(> .status--estancado, > .pick > .status--estancado) { background: var(--rec); }
.task__status:has(> .status--listo, > .pick > .status--listo) { background: var(--cat-verde); }
.task__status > .status { display: flex; align-items: center; min-height: 2.75rem; padding: 0.25rem 0.7rem; border-color: transparent; border-radius: 0; }
/* Pointing at the value darkens the whole cell, as much as the value itself. */
.task__status:has(> .pick > .pick__value:hover),
.task__status:has(> .pick[open]) { box-shadow: inset 0 0 0 100vmax rgb(0 0 0 / 7%); }
/* There the block is the button: the cell's width, with the arrow that opens it. */
.pick > .pick__value--block {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.25rem 1.6rem 0.25rem 0.7rem;
  border-color: transparent;
  border-radius: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23292929' stroke-width='1.5'/%3E%3C/svg%3E");
}
.pick > .pick__value--block.status--en_curso,
.pick > .pick__value--block.status--estancado,
.pick > .pick__value--block.status--listo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E");
}
.pick > .pick__value--block:hover,
.pick[open] > .pick__value--block { filter: brightness(0.93); }
/* Pointing at it must not wash its colour out (the plain values turn grey). */
.pick > .pick__value--block.status { background-color: var(--humo); }
.pick > .pick__value--block.status--en_curso { background-color: var(--cat-azul); }
.pick > .pick__value--block.status--estancado { background-color: var(--rec); }
.pick > .pick__value--block.status--listo { background-color: var(--cat-verde); }

/* The conversation of a task: how many messages it has. */
.task-bubble { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 2.75rem; min-height: 2.75rem; font-size: var(--step--1); font-weight: 600; color: var(--negro); text-decoration: none; }
.task-bubble:hover { color: var(--azul); }
.task-bubble--none { font-weight: 400; color: var(--gris); }

/* A task's links on a board: an icon that opens the only one, or a count that
   opens their list. Phones: a line of its own under the rest, with the link's
   name; a task without links has no such line. */
.task__links { grid-column: 1 / -1; grid-row: 5; min-width: 0; }
.tasks .task__links--none { display: none; }
.task-link { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%; min-width: 2.75rem; min-height: 2.75rem; font-size: var(--step--1); color: var(--negro); text-decoration: none; }
.task-link:hover { color: var(--azul); }
.task-link svg,
.task__links .pick__value svg { flex: none; }
.task-link__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Priority: a filled chip in its level's colour (`.chip--<key>`: three blues, the
   darkest the most urgent; `Task.priority_color`) with MUT's number. Never red. */
.task-priority { flex: none; align-items: baseline; gap: 0.35rem; }
.task-priority__n { font-family: var(--font-pixel); font-size: 0.875rem; font-weight: 400; line-height: 1; }

/* A task's status on its page (next to its title): the same blocks. */
.stage.task-status--en_curso { color: var(--papel); background: var(--cat-azul); }
.stage.task-status--estancado { color: var(--papel); background: var(--rec); }
.stage.task-status--listo { color: var(--papel); background: var(--cat-verde); }

/* The due date. Late is a problem: red, and it says so. */
.task-date {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: var(--step--1);
  color: var(--negro);
  background: var(--papel);
  border: 1px solid var(--piedra);
  border-radius: 2px;
}
.task-date:hover { border-color: var(--negro); }
.task-date:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }
.task__late,
.info__grid .task__late { color: var(--rec); }
/* On a board the date is a pill. Late, it is filled red: white on --rec, 5.9:1,
   the pair of a stuck task's status. */
.task__date { flex: none; padding: 0.1rem 0.6rem; font-weight: 500; line-height: 1.5; color: var(--negro); white-space: nowrap; background: var(--humo); border: 1px solid var(--niebla); border-radius: 999px; }
.task__date--late { font-weight: 600; color: var(--papel); background: var(--rec); border-color: var(--rec); }
.task__due .task__late { flex: none; font-weight: 600; }
/* Due today or tomorrow: not a problem yet, so the highlight (pink), not red. */
.task__soon { padding: 0.1rem 0.4rem; font-weight: 600; color: var(--negro); white-space: nowrap; background: var(--rosa); }
.task__due .task__soon { flex: none; }
/* Working days left: a grey label next to the date, text only. */
.task__workdays { font-size: 0.8125rem; color: var(--gris); white-space: nowrap; }
.task__due .task__workdays { flex: none; }
.task__due .pick__value { flex-wrap: wrap; gap: 0.1rem 0.5rem; }
/* A new date waiting for approval: a neutral chip by the date. */
.task__due .task__pending { flex: none; max-width: 100%; }
/* The picker of a shared task: a new date is proposed, with the reason. */
.date-ask--row { gap: 0.3rem; }
.date-ask--row .date-ask__title { margin: 0; font-weight: 600; color: var(--negro); }
.date-ask--row .date-ask__text { min-height: 4.5rem; resize: vertical; }
.date-ask--row .button { margin-top: 0.3rem; }

/* The general board's head: its filters sit over the columns they filter and
   name them (the table's own titles are hidden there). The ways of seeing the
   tasks come first; then the filters, in `.task-head__cols`. */
.task-head { margin: 0 0 var(--s-1); padding: 0 0 var(--s-1); border-bottom: 2px solid var(--negro); }
.task-head__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-1); align-items: center; }
.task-head__cell { min-width: 0; }
/* "Ver por" and its ways, on one line. */
.task-head__views { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem var(--s-2); min-width: 0; margin: 0 0 var(--s-1); }
.task-head__views-label { font-size: var(--step--1); color: var(--gris); }
.chips--slim { gap: 0.35rem; }
.chips--slim .toggle-chip span { padding: 0.3rem 0.75rem; font-size: var(--step--1); }
.task-head__cell--main { grid-column: 1 / -1; }
.task-head__row { display: grid; gap: var(--s-1) var(--s-2); align-items: center; }
.task-head select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  font: inherit;
  color: var(--negro);
  text-overflow: ellipsis;
  background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b69' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.7rem center / 0.6rem;
  border: 1px solid var(--piedra);
  border-radius: 2px;
  appearance: none;
  cursor: pointer;
}
.task-head select:hover { border-color: var(--negro); }
/* Unset, a filter reads as its column's title; set, it stands out (blue: a state). */
.task-head select:has(option:checked:not([value=""])) { font-weight: 600; border-color: var(--azul); box-shadow: inset 0 -2px 0 var(--azul); }
.task-head select:focus { outline: none; border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }
.task-head__check { align-items: center; min-height: 2.75rem; padding: 0; white-space: nowrap; }
.task-head__check input { margin: 0; }

/* Mis tareas: a task just finished left the list; the way back. */
.task-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); margin: 0 0 var(--s-3); padding: 0 var(--s-2); color: var(--negro); background: var(--humo); border-left: 3px solid var(--azul); }

/* A task's page. Phones: one column (the head, what is worked on, the facts, the
   conversation). Laptops: what is worked on and the conversation on the left, a
   slim column of facts on the right; the head across both. #task-panel is only
   what a change swaps, so there it makes no box of its own. */
.task-page .section { margin-bottom: var(--s-3); padding-top: 0.5rem; }
.task-page .section__head { align-items: center; margin-bottom: var(--s-1); }
.task-page .empty { margin: var(--s-1) 0; font-size: var(--step--1); }
.task-top__head { margin-bottom: var(--s-2); }
.task-top__head h1 { font-size: 1.375rem; }
.task-archived form { margin: var(--s-1) 0 0; }
.task-description .prose { max-width: 46rem; }
.task-description .prose p:last-child { margin-bottom: 0; }
/* The facts of a task: one line each, the label then the value. */
.task-side .facts > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 var(--s-1); align-items: baseline; padding: 0.4rem 0; font-size: var(--step--1); border-bottom: 1px solid var(--niebla); }
.task-side .facts dt { color: var(--gris); }
.task-side .facts dd { min-width: 0; margin: 0; color: var(--negro); overflow-wrap: anywhere; }
.task-side .facts dd a { color: inherit; }
.task-side .facts .who { gap: 0.5rem; }
.task-side .facts .avatar { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.task-side .facts .records__sub { margin-top: 0.1rem; font-size: 0.75rem; }
/* What can be done about a fact (change the date), under its value. */
.facts__action { display: flex; width: fit-content; }
a.chip.facts__action { margin-top: 0.25rem; text-decoration: none; }
.facts__more summary { width: fit-content; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 0.2em; list-style: none; }
.facts__more summary::-webkit-details-marker { display: none; }
.facts__more p { margin: 0.25rem 0 0; }
/* A date request waiting: a notice over the task, not a section of its own. */
.task-dates { margin: 0 0 var(--s-3); }
.date-past { margin-top: 0; }
.date-past summary,
.task-activity summary { font-size: var(--step--1); }

@media (min-width: 64rem) {
  .task-page { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; grid-template-rows: auto auto auto 1fr; column-gap: var(--s-4); align-items: start; }
  .task-panel { display: contents; }
  .task-top { grid-column: 1 / -1; grid-row: 1; }
  .task-main { grid-column: 1; grid-row: 2; min-width: 0; }
  .task-side { grid-column: 2; grid-row: 2 / span 3; min-width: 0; }
  .task-page > .conversation { grid-column: 1; grid-row: 3; }
  .task-page > #task-activity { grid-column: 1; grid-row: 4; }
  .facts__action.link-button { min-height: 1.5rem; }
}

/* Subtasks: on a board, the parent's row carries the count and a subtask listed
   for its owner names its parent. On a task's page, the list and the quick form. */
.task__parent { display: block; font-size: var(--step--1); color: var(--gris); }
.task__subtasks { display: inline-block; padding: 0 0.4rem; font-size: var(--step--1); color: var(--tinta); background: var(--humo); }
.task-subs { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 2.75rem; min-height: 2.75rem; margin: 0 0 0 var(--s-1); padding: 0; font: inherit; color: var(--negro); background: none; border: 0; cursor: pointer; vertical-align: middle; }
.task-subs::after { content: "+"; width: 0.75rem; font-weight: 600; }
.task-subs[aria-expanded="true"]::after { content: "−"; }
.task-subs:hover .task__subtasks { background: var(--niebla); }
/* The task workspace (/tareas/): Monday's sidebar of boards beside the tasks.
   Each department the reader sees is a folder that opens to its boards, and its
   name is the way to the department's page. Phones: the sidebar is a
   panel that opens at the top of the page; laptops: a column, always open. */
.shell__main:has(.workspace) { max-width: 100rem; padding-top: var(--s-3); }
.shell__main:has(.task-page) { padding-top: var(--s-3); }
.workspace__side { margin: 0 0 var(--s-3); border: 1px solid var(--niebla); }
.workspace__toggle { display: flex; align-items: center; gap: var(--s-1); min-height: 2.75rem; padding: 0 var(--s-2); cursor: pointer; list-style: none; }
.workspace__toggle::-webkit-details-marker { display: none; }
.workspace__toggle::after { content: "+"; margin-left: auto; font-weight: 600; }
.workspace__side[open] > .workspace__toggle::after { content: "−"; }
.workspace__label { font-size: var(--step--1); color: var(--gris); }
.workspace__where { font-weight: 600; color: var(--negro); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace__main { min-width: 0; }
.folders { padding: 0 var(--s-1) var(--s-1); }
.folders__item, .folder__name { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0 var(--s-1); color: var(--tinta); text-decoration: none; border-left: 3px solid transparent; }
.folders__item:hover, .folder__name:hover { background: var(--humo); }
.folders__item.is-current { font-weight: 600; color: var(--negro); background: var(--humo); border-left-color: var(--azul); }
.folders__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folders__icon, .folders__lock { flex: none; color: var(--gris); }
.folders__lock { margin-left: auto; }
.folders__item.is-current .folders__icon { color: var(--azul); }
.folders__item--all { margin-bottom: var(--s-1); }
.folders__item--add { font-size: var(--step--1); color: var(--gris); }
.folders__plus { flex: none; width: 1.25rem; text-align: center; font-weight: 600; }
.folder__name { font-weight: 600; color: var(--negro); cursor: pointer; list-style: none; }
.folder__name::-webkit-details-marker { display: none; }
/* The folder's arrow: points right, and down when it is open. */
.folder__name::before { content: ""; flex: none; width: 0; height: 0; margin: 0 0.4rem 0 0.35rem; border-left: 0.4rem solid var(--negro); border-top: 0.3rem solid transparent; border-bottom: 0.3rem solid transparent; }
.folder[open] > .folder__name::before { transform: rotate(90deg); }
/* The department's colour: a filled dot, coloured by its `.chip--<key>`. */
.folder__dot { flex: none; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.folder__count { margin-left: auto; font-weight: 400; font-size: var(--step--1); color: var(--gris); }
.folder__boards { margin: 0; padding: 0 0 0 var(--s-2); list-style: none; }
/* A folder's name opens the department's page; the rest of its row (the arrow, the
   dot, the count) opens and closes it. */
.folder__link { display: flex; align-items: center; align-self: stretch; min-width: 2.75rem; color: inherit; text-decoration: none; }
.folder__link:hover { text-decoration: underline; }
.folder__name:has(.folder__link.is-current) { background: var(--humo); border-left-color: var(--azul); }
/* A personal board carries its person's avatar, small enough for a row. */
.folders__item .avatar, .head-boards__item .avatar { width: 1.5rem; height: 1.5rem; font-size: 0.6875rem; }
/* A department's page: the boards of it the reader can open, under its name. */
.head-boards { display: flex; flex-wrap: wrap; gap: var(--s-1); margin: var(--s-2) 0 0; padding: 0; list-style: none; }
.head-boards li { min-width: 0; max-width: 100%; }
.head-boards__item { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 var(--s-2); color: var(--tinta); text-decoration: none; border: 1px solid var(--niebla); }
.head-boards__item:hover { background: var(--humo); }
.board-archive { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--niebla); }
@media (min-width: 64rem) {
  .workspace { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: var(--s-3); align-items: start; }
  .workspace__side { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); margin: 0; overflow-y: auto; border: 0; border-right: 1px solid var(--niebla); }
  .workspace__toggle { min-height: 2rem; padding: 0 var(--s-1); cursor: default; pointer-events: none; }
  .workspace__toggle::after, .workspace__where { display: none; }
  .folders { padding: 0 var(--s-1) 0 0; }
  .folders__item, .folder__name { min-height: 2rem; font-size: var(--step--1); }
  .folder__link { min-width: 0; }
  .head-boards__item { min-height: 2.25rem; }
}

/* Marks beside a task's title: it is private; the reader is mentioned in it. */
.task__mark { display: inline-block; margin-left: var(--s-1); padding: 0 0.4rem; font-size: var(--step--1); color: var(--tinta); border: 1px solid var(--niebla); vertical-align: middle; }
.task__mark--mention { color: var(--negro); background: var(--rosa); border-color: var(--rosa); }
/* Under the general page's quick form, across it: what "Pública" means there. */
.task-add__note { grid-column: 1 / -1; margin: 0; font-size: var(--step--1); color: var(--gris); }
/* A subtask under its task: one more row, in the same columns. */
.tasks .task[hidden] { display: none; }
.tasks .task--sub { background: var(--humo); }
.tasks .task--sub .task__main { padding-left: var(--s-3); }
/* On a task's page: one line per subtask (its box ticks it off in place, then
   its title, who has it, its status and its date) and, in the section's head,
   how many are done. */
.task-subtasks__tally { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--step--1); color: var(--gris); }
.subtasks { margin: 0 0 var(--s-1); padding: 0; list-style: none; }
.subtask { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); padding: 0 0 0.4rem; border-bottom: 1px solid var(--niebla); }
.subtask__toggle { margin: 0 0 0 -0.8rem; }
.subtask__box { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; background: none; border: 0; cursor: pointer; }
.subtask__box::before { content: ""; width: 1.125rem; height: 1.125rem; border: 1.5px solid var(--gris); border-radius: 2px; }
.subtask__box:hover::before { border-color: var(--negro); }
.subtask__box.is-done::before { background: var(--cat-verde) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.7 2.7L10 3.5' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") center / 0.75rem no-repeat; border-color: var(--cat-verde); }
.subtask__title { flex: 1 1 60%; display: inline-flex; align-items: center; min-width: 0; min-height: 2.75rem; font-weight: 600; color: var(--negro); text-decoration: none; overflow-wrap: anywhere; }
.subtask__title:hover { text-decoration: underline; }
.subtask--done .subtask__title { font-weight: 500; color: var(--gris); text-decoration: line-through; }
.subtask__owner, .subtask__due { font-size: var(--step--1); color: var(--gris); }
.subtask__due.is-late { color: var(--rec); }
.subtask-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); align-items: end; }
.subtask-add__submit { justify-self: start; }
/* A task's links on its page: the list and the one-line form. */
.links { margin: 0; padding: 0; list-style: none; }
.link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-2); align-items: center; padding: var(--s-1) 0; border-bottom: 1px solid var(--niebla); }
.link__name { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; color: var(--negro); overflow-wrap: anywhere; }
.link__domain { grid-column: 1; font-size: var(--step--1); color: var(--gris); overflow-wrap: anywhere; }
.link__remove { grid-column: 2; grid-row: 1; margin: 0; }
.link-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); align-items: end; margin-bottom: var(--s-1); }
.link-add__submit { justify-self: start; }
/* Notes: the reader's own, inside the tasks workspace. Two panes: the list of
   notes with "Nueva nota" on top, and the note that is open, its title first.
   Phones show one at a time (the list, or the open note with the way back);
   from tablets up they sit side by side. */
.notes-app__notices:empty { display: none; }
.notes-app--open > .notes-nav,
.notes-app:not(.notes-app--open) > .notes-pane { display: none; }
.notes-nav__new { width: 100%; margin-bottom: var(--s-2); }
.notes-nav__new::before { content: "+"; margin-right: 0.4rem; }
.notes-nav__title { margin: 0 0 var(--s-1); font-family: var(--font-titulo); font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: var(--negro); }
.notes-nav__list { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--negro); }
.notes-nav__item { display: grid; gap: 0.1rem; min-height: 2.75rem; padding: 0.55rem var(--s-1); color: var(--tinta); text-decoration: none; border-bottom: 1px solid var(--niebla); border-left: 3px solid transparent; }
.notes-nav__item:hover { background: var(--humo); }
.notes-nav__item.is-current { background: var(--humo); border-left-color: var(--azul); }
.notes-nav__name { font-weight: 600; color: var(--negro); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-nav__text { font-size: var(--step--1); color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-nav__when { font-size: 0.75rem; color: var(--gris); }
.notes-nav .empty { margin: var(--s-2) 0; }
.notes-nav__more { margin: 0; font-size: var(--step--1); }
.notes-nav__more a,
.notes-pane__back a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--gris); }
.notes-pane { min-width: 0; }
.notes-pane__back { margin: 0 0 var(--s-1); font-size: var(--step--1); }
.notes-pane__back a::before { content: "←"; margin-right: 0.4rem; }
.note__head { margin: 0 0 var(--s-2); padding: 0 0 var(--s-1); border-bottom: 2px solid var(--negro); }
.note__title { margin: 0; font-family: var(--font-titulo); font-size: var(--step-2); font-weight: 800; font-stretch: 125%; line-height: 1.1; color: var(--negro); overflow-wrap: anywhere; }
.note__title--none { color: var(--piedra); }
.note__meta { margin: 0.35rem 0 0; font-size: var(--step--1); color: var(--gris); }
.note__actions { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-1); }
.note__actions form { margin: 0; }
.note__body { max-width: 46rem; line-height: 1.6; overflow-wrap: anywhere; }
/* Writing a note looks like the note: the title as its heading, then the text. */
.note-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); max-width: 46rem; }
.note-form__title input { padding-left: 0; padding-right: 0; font-family: var(--font-titulo); font-size: var(--step-1); font-weight: 800; font-stretch: 125%; color: var(--negro); border: 0; border-bottom: 2px solid var(--negro); border-radius: 0; }
.note-form__title input:focus { box-shadow: 0 2px 0 var(--negro); }
.note-form__fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
.note-form__status { margin: 0; font-size: var(--step--1); color: var(--gris); }
.note-form__body textarea,
.note-form__body .composer textarea { min-height: 45vh; line-height: 1.6; resize: vertical; }
/* A note's files: in its form, each with the cross that takes it away. */
.note-files { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); }
.note-files__list { display: flex; flex-wrap: wrap; gap: 0.35rem; flex-basis: 100%; margin: 0; padding: 0; list-style: none; }
.note-files__list li { display: inline-flex; align-items: center; min-width: 0; border: 1px solid var(--piedra); border-radius: 2px; font-size: var(--step--1); }
.note-files__list a { padding: 0.35rem 0.5rem; color: var(--negro); overflow-wrap: anywhere; }
.note-files__remove { min-width: 2.75rem; min-height: 2.75rem; font: inherit; font-size: var(--step-1); line-height: 1; color: var(--gris); background: none; border: 0; border-left: 1px solid var(--piedra); cursor: pointer; }
.note-files__remove:hover { color: var(--negro); }
.note-files__add { position: relative; overflow: hidden; cursor: pointer; }
.note-files__add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.note-files__help { font-size: var(--step--1); color: var(--gris); }
.note-files__error { flex-basis: 100%; margin: 0; font-size: var(--step--1); color: var(--rec); }
.note__files { margin-top: var(--s-2); }
@media (min-width: 48rem) {
  .notes-app { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: var(--s-2) var(--s-4); align-items: start; }
  .notes-app__notices { grid-column: 1 / -1; }
  .notes-app--open > .notes-nav,
  .notes-app:not(.notes-app--open) > .notes-pane { display: block; }
  .notes-nav { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
  .notes-pane__back { display: none; }
  .notes-nav__item { min-height: 0; padding: 0.45rem var(--s-1); }
  .note__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-2); align-items: end; }
  .note__meta { grid-column: 1; }
  .note__head .note__actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
}
/* A task's people on its page: the list (avatar, name, role, what can be done)
   and the one-line form. */
.people { margin: 0; padding: 0; list-style: none; }
.people__person { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s-2); align-items: center; padding: var(--s-1) 0; border-bottom: 1px solid var(--niebla); }
.people__who { min-height: 2.75rem; font-weight: 600; color: var(--negro); overflow-wrap: anywhere; }
.people__role { font-size: var(--step--1); color: var(--gris); }
.people__actions { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.people__actions form { margin: 0; }
.person-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-1); align-items: end; margin-bottom: var(--s-1); }
/* In the slim column of a task's page: small faces, and what can be done as quiet links. */
.task-side .people__who { gap: 0.5rem; min-height: 2.25rem; font-size: var(--step--1); }
.task-side .people__who .avatar { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.task-side .people__person { padding: 0.15rem 0; }
.task-side .people__actions { gap: 0 var(--s-2); }
.task-side .people__actions .button { padding: 0; font-weight: 400; color: var(--gris); text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; }
.task-side .people__actions .button:hover { color: var(--negro); }
.person-add__submit { justify-self: start; }
/* A task's date requests on its page: the pending one with what can be done
   about it, the form to propose a date, and the past ones. */
.date-request p { margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.date-request__what { color: var(--negro); }
.date-request__meta { font-size: var(--step--1); color: var(--gris); }
.date-decide,
.date-cancel { margin: var(--s-2) 0 0; }
.date-decide .field textarea { min-height: 4.5rem; }
/* The pop-up a date is changed in. */
.date-form .field textarea { min-height: 4.5rem; }

@media (min-width: 48rem) {
  .link { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
  .link__domain { grid-column: auto; }
  .link__remove { grid-column: 3; }
  .link-add { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
  .subtask { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 9rem) 6.5rem 6.5rem; gap: 0 var(--s-1); padding: 0; }
  .subtask__toggle { grid-column: 1; margin: 0; }
  .subtask__box { width: 2rem; height: 2.25rem; }
  .subtask__title { grid-column: 2; min-height: 2.25rem; font-size: 0.875rem; }
  .subtask__owner { grid-column: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .subtask .status { grid-column: 4; justify-self: start; }
  .subtask__due { grid-column: 5; text-align: right; white-space: nowrap; }
  .subtask-add { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
  .link__name { min-height: 2.25rem; font-size: 0.875rem; }
}
/* A task's people: a line each on tablets; in the slim column of laptops, stacked again. */
@media (min-width: 48rem) {
  .people__person { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
  .people__actions { justify-content: flex-end; }
  .person-add { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
}
@media (min-width: 64rem) {
  .task-side .people__person { grid-template-columns: minmax(0, 1fr) auto; }
  .task-side .people__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .task-side .people__actions .button { min-height: 1.5rem; }
  .task-side .person-add { grid-template-columns: minmax(0, 1fr); }
}
.task-activity { margin-top: 0; }
.task-activity summary { font-weight: 600; color: var(--negro); }
.task-activity__count { font-weight: 400; color: var(--gris); }

@media (min-width: 48rem) {
  .page-head--slim { align-items: center; gap: var(--s-1) var(--s-2); margin-bottom: var(--s-2); }
  /* The title takes the room: what can be done sits together at the end. */
  .page-head--slim > div:first-child { flex: 1 1 16rem; min-width: 0; }
  .page-head--slim .page-head__actions,
  .page-head > .task-new { margin-top: 0; }
  /* Open, the quick form takes the line under the head. */
  .page-head > .task-new[open] { flex: 1 0 100%; }
  .task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-1) var(--s-2); }
  .task-add { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-add__title { grid-column: 1 / -1; }
}

@media (min-width: 64rem) {
  .task-filters { grid-template-columns: minmax(12rem, 1fr) auto auto auto auto; }
  .task-filters--board { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  .board-scroll { overflow-x: auto; }
  .board { display: table; width: max-content; min-width: 100%; }
  .board thead { display: table-header-group; }
  .board tbody { display: table-row-group; }
  .board tr { display: table-row; }
  .board th,
  .board td,
  .board .board__project,
  .board .board__counts,
  .board .board__extra { display: table-cell; padding: 0.5rem var(--s-2); white-space: nowrap; vertical-align: middle; border-top: 1px solid var(--niebla); }
  .board thead th { padding-top: 0.35rem; padding-bottom: 0.35rem; font-size: var(--step--1); font-weight: 500; color: var(--gris); background: var(--humo); border-top: 0; }
  .board td[data-label]::before { content: none; }
  .board .r { text-align: right; }
  .board .board__project { position: sticky; left: 0; z-index: 1; width: 22rem; min-width: 18rem; max-width: 22rem; white-space: normal; background: var(--papel); box-shadow: 1px 0 0 var(--niebla); }
  .board thead .board__project { background: var(--humo); }
  .board tbody tr:hover > * { background: var(--humo); }
  .board .board__counts { margin: 0; }
  .board-count { margin-right: 0.35rem; }
  .board__links .chip + .chip { margin-left: 0.3rem; }
  .board__owner .avatar { display: inline-flex; width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
  .board__price { font-weight: 600; color: var(--negro); }

  .task-add { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; padding: var(--s-1) var(--s-2) var(--s-2); }
  .task-add__title { grid-column: auto; }

  .tasks { display: table; }
  .tasks thead { display: table-header-group; }
  .tasks tbody { display: table-row-group; }
  .tasks tr { display: table-row; }
  .tasks .task { display: table-row; border-bottom: 0; }
  .tasks th,
  .tasks td { display: table-cell; }
  /* A board's head on one line: where it is, its name, what it is. */
  .workspace__main > .page-head--slim > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); min-width: 0; }
  .workspace__main > .page-head--slim .page-head__crumb,
  .workspace__main > .page-head--slim .page-head__period { margin: 0; }
  .workspace__main > .page-head--slim .page-head__title { align-self: center; }
  .workspace__main > .page-head--slim .head-boards { flex-basis: 100%; margin-top: var(--s-1); }
  .chips--slim .toggle-chip span { min-height: 1.75rem; padding: 0 0.65rem; }
  .task-new__open,
  .page-head--slim .button--small { min-height: 2rem; padding-top: 0; padding-bottom: 0; }

  /* Dense, as in Monday: rows of about 32 px with hairlines between them. The
     status has no padding (its colour fills the cell), so the date after it
     brings its own on the left. */
  .tasks,
  .task-head__cols { --col-owner: 8.5rem; --col-priority: 7rem; --col-status: 7.5rem; --col-due: 13rem; --row: 2rem; }
  .tasks { table-layout: auto; }
  /* The column titles stay in view under the app bar (4rem tall here) while the
     list scrolls: over the rows, their avatars and their open choices. */
  .tasks thead th { position: sticky; top: 4rem; z-index: 6; padding: var(--s-1) var(--s-2) var(--s-1) 0; font-size: var(--step--1); font-weight: 500; color: var(--gris); text-align: left; white-space: nowrap; background: var(--papel); box-shadow: inset 0 -1px 0 var(--niebla); }
  .tasks thead th:nth-last-child(2) { padding-left: 0.7rem; }
  .tasks thead th:last-child { padding-right: 0; padding-left: var(--s-2); }
  html:has(.tasks) { scroll-padding-top: 8rem; }
  .tasks .tasks__group th { display: table-cell; padding: var(--s-2) 0 0.35rem; }
  .tasks td { padding: 0 var(--s-2) 0 0; vertical-align: middle; border-bottom: 1px solid var(--niebla); }
  .tasks td:last-child { padding-right: 0; }
  .tasks .pick__value { min-height: var(--row); padding-top: 0; padding-bottom: 0; }
  .tasks .pick__value .avatar { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
  .tasks .task__main { padding-top: 0; padding-bottom: 0; }
  .task__main a { min-height: var(--row); font-size: var(--step--1); line-height: 1.3; }
  .task__project { display: inline; margin: 0 0 0 var(--s-1); }
  .task-subs { min-width: 2rem; min-height: 1.75rem; }
  .task-bubble,
  .task-link { min-width: 2rem; min-height: var(--row); }
  .task-bubble svg,
  .task-link svg,
  .task__links .pick__value svg { width: 1rem; height: 1rem; }
  .task__talk { width: 2.75rem; }
  .tasks .task__links { display: table-cell; width: 2.75rem; }
  .tasks .chip,
  .tasks .stage,
  .task__date { line-height: 1.35; }
  .task-link__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .task__owner { width: var(--col-owner); max-width: var(--col-owner); }
  .task__stage { width: 11rem; }
  .task__priority { width: var(--col-priority); }
  .tasks .task__status { width: var(--col-status); padding: 0; }
  .task__status > .status,
  .tasks .pick > .pick__value--block { min-height: var(--row); }
  .tasks .task__due { width: var(--col-due); padding-left: var(--s-2); }
  .tasks .task__due .pick__value { padding-top: 0.1rem; padding-bottom: 0.1rem; }
  .tasks--headless thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tasks--headless thead th { position: static; }
  .tasks--headless tbody:first-of-type .tasks__group th { padding-top: var(--s-1); }
  /* The general board's filters are its column titles: the same columns as the
     table under them, and the row that stays in view. The form itself makes no
     box here, so that row sticks for as long as the list under it is on screen. */
  .task-head { display: contents; }
  .task-head__views { margin-bottom: 0.35rem; }
  .task-head__cols { position: sticky; top: 4rem; z-index: 6; grid-template-columns: minmax(0, 1fr) var(--col-owner) var(--col-priority) var(--col-status) var(--col-due); gap: 0; padding: 0.35rem 0; background: var(--papel); border-bottom: 2px solid var(--negro); }
  .task-head__cell { padding-right: var(--s-2); }
  .task-head__cell--main { grid-column: auto; }
  .task-head__cell--status { padding-right: 0; }
  .task-head__cell--due { padding-right: 0; padding-left: var(--s-2); }
  .task-head__row { grid-template-columns: minmax(0, 22rem) auto; justify-content: start; }
  .task-head select { min-height: 2rem; padding: 0.15rem 1.6rem 0.15rem 0.6rem; font-size: var(--step--1); background-position: right 0.55rem center; }
  .task-head .pick--field > .pick__value { min-height: 2rem; padding-top: 0; padding-bottom: 0; padding-left: 0.6rem; font-size: var(--step--1); }
  .task-head__check { min-height: 2rem; font-size: var(--step--1); }
}




/* Conversations: updates, replies, mentions, reactions */
/* ------------------------------------------------------------------------
 * The conversation of a project or a task (projects/includes/conversation.html):
 * the messages oldest first, as bubbles (other people's on the left, one's own on
 * the right, tinted), each with its answers, then the composer. Blue marks state
 * (a mention, one's own reaction, the message a link points to).
 * --------------------------------------------------------------------- */

.conversation { max-width: 46rem; margin: var(--s-3) 0 var(--s-5); }
.conversation .icon { display: inline-block; flex: none; width: 1.125rem; height: 1.125rem; }
.conversation__poll { display: none; }
.conversation__list { margin-bottom: var(--s-2); }
/* On a task's page the conversation is one more section of it. */
.conversation__title { margin: 0 0 var(--s-1); padding-top: 0.5rem; font-family: var(--font-titulo); font-size: var(--step-0); font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: var(--negro); border-top: 2px solid var(--negro); }
.task-page > .conversation { max-width: none; margin: 0 0 var(--s-3); }
.task-page .conversation__list .empty { margin: var(--s-1) 0 var(--s-2); }

/* The composer: one box holding the text, the people to mention and the tools. */
.composer { margin: 0; }
.composer__box { background: var(--papel); border: 1px solid var(--piedra); border-radius: 2px; }
.composer__box:hover { border-color: var(--gris); }
.composer__box:focus-within { border-color: var(--negro); box-shadow: 0 0 0 1px var(--negro); }
.composer textarea {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--negro);
  background: none;
  border: 0;
  resize: vertical;
}
.composer textarea:focus { outline: none; }
.composer--reply textarea { min-height: 3.25rem; }
.composer__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-1); padding: 0.25rem; border-top: 1px solid var(--niebla); }
.composer__tools { display: flex; flex-wrap: wrap; align-items: center; }
.composer__tool--text { font: inherit; font-size: var(--step-0); line-height: 1; }
.composer__tool--bold { font-weight: 800; }
.composer__tool--italic { font-style: italic; }
.composer__tool--strike { text-decoration: line-through; }
.composer__tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--gris);
  background: none;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  list-style: none;
}
.composer__tool::-webkit-details-marker { display: none; }
.composer__tool:hover,
.composer__emoji[open] > .composer__tool { color: var(--negro); background: var(--humo); }
.composer__attach:focus-within { outline: 2px solid var(--negro); outline-offset: -2px; }
.composer__send { display: flex; align-items: center; gap: var(--s-1); }
.composer__files { margin: 0.4rem 0 0; font-size: var(--step--1); color: var(--gris); overflow-wrap: anywhere; }
/* A day to be reminded of the message, under the composer. */
.composer__remind { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem var(--s-1); margin: 0.5rem 0 0; font-size: var(--step--1); color: var(--tinta); }
.composer__remind input { min-height: 2.75rem; padding: 0.3rem 0.5rem; font: inherit; color: var(--negro); background: var(--papel); border: 1px solid var(--piedra); border-radius: 2px; }
.composer__remind-help { color: var(--gris); }
.message__remind { margin: 0.35rem 0 0; font-size: var(--step--1); font-weight: 700; }
.composer .errorlist { margin: 0.4rem 0 0; padding: 0; list-style: none; font-size: var(--step--1); color: var(--rec); }

/* The conversation's own composer, under the messages. On phones it stays at the
   bottom of the screen while the messages scroll under it, and starts one line
   tall (it grows with the text where the browser can). */
.conversation > .composer {
  position: sticky;
  bottom: 0;
  z-index: 6;
  padding: var(--s-1) 0 calc(var(--s-1) + env(safe-area-inset-bottom, 0px));
  background: var(--papel);
}
.conversation > .composer textarea { min-height: 2.75rem; max-height: 40vh; field-sizing: content; }
/* The "Comentarios" button floats in the same corner: above the composer there. */
body:has(.conversation > .composer) .tynfb__button { bottom: 11rem; }

/* The emoji palette, under its button. */
.composer__emoji { position: relative; }
.composer__palette {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 2.75rem);
  padding: 0.25rem;
  background: var(--papel);
  border: 1px solid var(--negro);
  border-radius: 2px;
  box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
}
.composer__palette button { width: 2.75rem; height: 2.75rem; padding: 0; font: inherit; font-size: 1.25rem; line-height: 1; background: none; border: 0; border-radius: 2px; cursor: pointer; }
.composer__palette button:hover { background: var(--humo); }
/* At the bottom of the conversation there is no room under the button. */
.conversation > .composer .composer__palette { top: auto; bottom: 100%; }

/* The people to mention, between the text and the tools while "@…" is typed. */
.composer__people { max-height: 14rem; overflow-y: auto; border-top: 1px solid var(--niebla); }
.composer__person {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.25rem 0.75rem;
  font: inherit;
  text-align: left;
  color: var(--negro);
  background: none;
  border: 0;
  cursor: pointer;
}
.composer__person:hover { background: var(--humo); }
.composer__person[aria-selected="true"] { background: var(--humo); box-shadow: inset 2px 0 0 var(--azul); }
.composer__person .avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }

/* A top-level message with its answers. The first one of a day carries the
   day's separator; one that follows another by the same person sits close to it. */
.thread { margin-top: var(--s-2); scroll-margin-top: 5rem; }
.thread:has(> .message > .message__main--follows) { margin-top: 0.15rem; }
.thread:target > .message > .message__main > .message__bubble { box-shadow: 0 0 0 2px var(--azul); }
.thread__day { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-3) 0 var(--s-2); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--gris); }
.thread:first-of-type > .thread__day { margin-top: 0; }
.thread__day::before,
.thread__day::after { content: ""; flex: 1; border-top: 1px solid var(--niebla); }
/* The answers hang from their message: a rule down their side, under the bubble
   they answer (the left for other people's, the right for one's own). */
.thread__replies { max-width: min(100%, 32rem); margin: 0 0 0 1.25rem; }
.thread__replies--mine { margin-left: auto; }
.thread__replies:has(> .message, > .thread__earlier, > .thread__reply[open]) { margin-top: 0.25rem; padding-left: 0.75rem; border-left: 2px solid var(--niebla); }
.thread__replies--mine:has(> .message, > .thread__earlier, > .thread__reply[open]) { padding-right: 0.75rem; padding-left: 0; border-right: 2px solid var(--niebla); border-left: 0; }
.thread__earlier > summary,
.thread__reply > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  font-size: var(--step--1);
  color: var(--gris);
  cursor: pointer;
  list-style: none;
}
.thread__earlier > summary { color: var(--azul); font-weight: 600; }
.thread__earlier > summary:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.thread__earlier > summary::-webkit-details-marker,
.thread__reply > summary::-webkit-details-marker { display: none; }
.thread__reply > summary:hover,
.thread__reply[open] > summary { color: var(--negro); }
.thread__replies--mine > .thread__reply > summary { display: flex; justify-content: flex-end; }
.thread__reply > .composer { margin-bottom: var(--s-1); }

/* A message: a bubble (name, text, files, time) and, under it, reactions, who has
   seen it and the author's links. Other people's: avatar, then the bubble, on the
   left, on grey. One's own (.message__main--mine): no avatar, on the right, on
   pale blue. A bubble is rounded, but for the corner it speaks from; one that
   follows another by the same person is rounded all over. */
.message { display: flex; align-items: flex-start; gap: 0.6rem; }
.message > .avatar { width: 2.25rem; height: 2.25rem; }
.message__gap { flex: none; width: 2.25rem; }
.message__main { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; }
.message__main--mine { align-items: flex-end; }
.message--editing > .message__main { align-items: stretch; }
.message--reply { padding: 0.15rem 0; }
.message--reply:has(> .message__main--follows) { padding-top: 0; }
.message--reply > .avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.message--reply > .message__gap { width: 1.75rem; }
.message__bubble { max-width: min(100%, 34rem); padding: 0.45rem 0.8rem 0.4rem; background: var(--humo); border-radius: 2px 0.75rem 0.75rem; }
.message__main--mine > .message__bubble { max-width: min(88%, 34rem); background: var(--cat-cielo); border-radius: 0.75rem 2px 0.75rem 0.75rem; }
.message__main--follows > .message__bubble { border-radius: 0.75rem; }
.message--reply > .message__main > .message__bubble { padding: 0.35rem 0.65rem; font-size: var(--step--1); }
.message__author { margin: 0 0 0.05rem; font-size: var(--step--1); font-weight: 700; color: var(--negro); }
.message__body { color: var(--tinta); overflow-wrap: anywhere; }
.message__body > :first-child { margin-top: 0; }
.message__body > :last-child { margin-bottom: 0; }
.message__meta { display: flex; justify-content: flex-end; align-items: baseline; gap: 0.4rem; margin: 0.1rem 0 0; font-size: 0.6875rem; line-height: 1.3; color: var(--gris); }
/* Grey is too faint on the pale blue. */
.message__main--mine > .message__bubble .message__meta,
.message__main--mine > .message__bubble blockquote { color: var(--cat-cielo-tinta); }
.message__gone { margin: 0; padding: 0.25rem 0; font-size: var(--step--1); font-style: italic; color: var(--gris); }
.mention { font-weight: 600; color: var(--azul); }
.message__body ul,
.message__body ol { margin: 0.25rem 0; padding-left: 1.5rem; }
.message__body li { margin: 0.1rem 0; }
.message__body blockquote { margin: 0.25rem 0; padding-left: var(--s-1); color: var(--gris); border-left: 2px solid var(--piedra); }

/* Files: chips inside the bubble. */
.message__files { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0 0; padding: 0; list-style: none; }
.message__files li { min-width: 0; }
.message__files a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  font-size: var(--step--1);
  color: var(--negro);
  text-decoration: none;
  background: var(--papel);
  border: 1px solid var(--niebla);
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}
.message__files a:hover { border-color: var(--negro); }

/* Under the bubble, on its side: quiet, so the messages are what is read. */
.message__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-1); max-width: 100%; font-size: 0.75rem; color: var(--gris); }
.message__main--mine > .message__foot { justify-content: flex-end; }
.message__seen { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2.75rem; }
/* Only on one's own messages: first, so the reactions and who has seen it end the row. */
.message__own { display: inline-flex; gap: var(--s-2); order: -1; }
.message__own a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--gris); text-decoration: none; }
.message__own a:hover { color: var(--negro); text-decoration: underline; }
.message__confirm { margin: 0.5rem 0 0; }
.message__confirm p { margin: 0 0 var(--s-1); font-weight: 600; color: var(--negro); }
.message__confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-1); }

/* Reactions: the ones in use are pills with their count (blue when the reader's
   own); "Me gusta" before anyone uses it, and "+", are quiet offers. */
.reactions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0; }
.reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--tinta);
  background: var(--papel);
  border: 1px solid var(--niebla);
  border-radius: 999px;
}
button.reaction { cursor: pointer; }
button.reaction:hover { color: var(--negro); border-color: var(--negro); }
.reaction.is-mine { font-weight: 600; color: var(--azul); background: var(--cat-cielo); border-color: var(--azul); }
.reaction--none { color: var(--gris); background: none; border-color: transparent; }
.reaction__emoji { font-size: 0.9375rem; line-height: 1; }
.reaction--none .reaction__emoji { filter: grayscale(1); opacity: 0.7; }
button.reaction--none:hover .reaction__emoji { filter: none; opacity: 1; }
.reactions__more > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1rem;
  color: var(--gris);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}
.reactions__more > summary::-webkit-details-marker { display: none; }
.reactions__more > summary:hover,
.reactions__more[open] > summary { color: var(--negro); border-color: var(--negro); }
.reactions__palette { position: absolute; z-index: 5; top: 100%; left: 0; display: flex; padding: 0.25rem; background: var(--papel); border: 1px solid var(--negro); border-radius: 999px; box-shadow: 0 6px 18px rgb(0 0 0 / 12%); }
.reaction--pick { width: 2.75rem; padding: 0; font-size: 1.25rem; line-height: 1; background: none; border-color: transparent; }
button.reaction--pick:hover { background: var(--humo); border-color: transparent; }
/* It hangs from the row of reactions, on the message's side, so it stays on the screen. */
.message__main--mine > .message__foot .reactions__palette { right: 0; left: auto; }

@media (min-width: 48rem) {
  .thread__replies { margin-left: 2.85rem; }
  .thread__replies--mine { margin-left: auto; }
  .composer__palette { grid-template-columns: repeat(8, 2.75rem); }
  /* With room on the screen the composer stays in its place, under the messages. */
  .conversation > .composer { position: static; padding: 0; }
  .conversation > .composer textarea { min-height: 3.5rem; }
  body:has(.conversation > .composer) .tynfb__button { bottom: 1rem; }
}
/* With a pointer, what sits under a bubble is small, and the offers (react, edit,
   remove) wait until the message is pointed at or holds the focus. */
@media (min-width: 48rem) and (hover: hover) {
  .composer__tool { width: 2rem; height: 2rem; }
  .composer__tool .icon { width: 1rem; height: 1rem; }
  .composer__tool--text { font-size: 0.875rem; }
  .composer__bar { padding: 0.25rem 0.35rem; }
  .composer__send .button--small { min-height: 2rem; padding-top: 0; padding-bottom: 0; }
  .message__foot { min-height: 1.5rem; }
  .reaction,
  .message__seen,
  .message__own a { min-height: 1.5rem; }
  .reaction { padding: 0 0.45rem; }
  .reactions__more > summary { width: 1.5rem; height: 1.5rem; }
  .reaction--pick { width: 2.25rem; min-height: 2.25rem; }
  .thread { margin-top: var(--s-1); }
  .thread__earlier > summary,
  .thread__reply > summary { min-height: 1.5rem; }
  .message__files a { min-height: 2rem; }
  .reaction--none,
  .reactions__more,
  .message__own { opacity: 0; transition: opacity 0.12s; }
  .message:hover .reaction--none,
  .message:hover .reactions__more,
  .message:hover .message__own,
  .message__foot:focus-within .reaction--none,
  .message__foot:focus-within .reactions__more,
  .message__foot:focus-within .message__own,
  .reactions__more[open] { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .reaction--none,
  .reactions__more,
  .message__own { transition: none; }
}
/* End of conversations */

/* The floating "Comentarios" button and its form (the tyn-feedback package), in
   MUT's colours and type. */
.tynfb,
.tynfb__dialog {
  --tynfb-ink: var(--negro);
  --tynfb-paper: var(--papel);
  --tynfb-muted: var(--gris);
  --tynfb-line: var(--piedra);
  --tynfb-fill: var(--humo);
  --tynfb-accent: var(--negro);
  --tynfb-on-accent: var(--papel);
  --tynfb-problem: var(--rec);
  --tynfb-font: var(--font);
}
.tynfb__title { font-family: var(--font-titulo); font-weight: 800; font-stretch: 125%; text-transform: uppercase; }

/* The "Notas" window: a button that floats in the corner of every page, above
   "Comentarios", and opens the reader's notes over the page (a <details>). On
   phones the window takes the width of the screen. */
.notes-window__button {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 890;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--negro);
  background: var(--papel);
  border: 1px solid var(--negro);
  border-radius: 2px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.notes-window__button::-webkit-details-marker { display: none; }
.notes-window__button:hover,
.notes-window[open] > .notes-window__button { color: var(--papel); background: var(--azul); border-color: var(--azul); }
.notes-window__button:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
body:has(.tynfb__button) .notes-window__button { bottom: 4.25rem; }
body:has(.conversation > .composer):has(.tynfb__button) .notes-window__button { bottom: 14.25rem; }
.notes-window__panel {
  position: fixed;
  right: 0.5rem;
  left: 0.5rem;
  bottom: 4.5rem;
  z-index: 890;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(34rem, calc(100dvh - 9.5rem));
  background: var(--papel);
  border: 1px solid var(--negro);
  border-radius: 2px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 22%);
}
body:has(.tynfb__button) .notes-window__panel { bottom: 7.75rem; }
.notes-window__head { display: flex; align-items: center; gap: var(--s-2); padding: 0 0 0 var(--s-2); color: var(--papel); background: var(--negro); }
.notes-window__head h2 { margin: 0 auto 0 0; font-family: var(--font-titulo); font-size: var(--step--1); font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: var(--papel); }
.notes-window__head a { font-size: var(--step--1); color: var(--papel); }
.notes-window__close { width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.5rem; line-height: 1; color: var(--papel); background: none; border: 0; cursor: pointer; }
.notes-window__close:hover { background: var(--azul); }
.notes-window__body { min-height: 0; padding: var(--s-2); overflow-y: auto; overscroll-behavior: contain; }
.notes-window__body .notices { margin-bottom: var(--s-2); }
.notes-window__back { margin: 0; font-size: var(--step--1); }
.notes-window__back a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--gris); }
.notes-window__back a::before { content: "←"; margin-right: 0.4rem; }
.notes-window__name { margin: 0 0 var(--s-1); font-size: var(--step-1); color: var(--negro); overflow-wrap: anywhere; }
.notes-window__page { display: inline-flex; align-items: center; min-height: 2.75rem; margin-left: auto; font-size: var(--step--1); color: var(--gris); }
.notes-window__archive { margin: var(--s-1) 0 0; }
.note-form--window .note-form__body textarea,
.note-form--window .note-form__body .composer textarea { min-height: 12rem; }
@media print { .notes-window { display: none; } }
@media (min-width: 48rem) {
  .notes-window__panel { left: auto; right: 1rem; width: 26rem; height: min(36rem, calc(100dvh - 10rem)); }
  body:has(.conversation > .composer):has(.tynfb__button) .notes-window__button { bottom: 4.25rem; }
  .notes-window__back a { min-height: 2rem; }
}

/* Uso (Configuración): the period's figures, the pages opened each day as bars,
   and the tables under them. */
.usage-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); }
.usage-figures dt { font-size: var(--step--1); color: var(--gris); }
.usage-figures dd { margin: 0; font-size: var(--step-2); font-weight: 800; line-height: 1.1; color: var(--negro); }
.usage-chart { margin: 0; }
.usage-chart figcaption,
.usage-chart__ends,
.usage-note { font-size: var(--step--1); color: var(--gris); }
.usage-chart svg { display: block; width: 100%; height: 6rem; margin: var(--s-1) 0 0.25rem; border-bottom: 1px solid var(--negro); }
.usage-chart__bar { fill: var(--azul); }
.usage-chart__ends { display: flex; justify-content: space-between; margin: 0; }
.usage-note { max-width: 46rem; margin: 0 0 var(--s-2); }
.usage-route { font-size: var(--step--1); overflow-wrap: anywhere; }
@media (min-width: 48rem) {
  .usage-figures { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Usuarios (Configuración): the roles to choose from when inviting, and the
   invitation's link to copy. */
.roles { margin: 0; padding: 0; border: 0; min-width: 0; }
.roles legend { display: block; margin-bottom: 0.35rem; padding: 0; font-size: var(--step--1); color: var(--gris); }
/* `.roles .roles__option`: over `.field label`, which would make it a block. */
.roles .roles__option { display: flex; align-items: flex-start; gap: var(--s-2); min-height: 2.75rem; padding: var(--s-2) 0; border-top: 1px solid var(--niebla); cursor: pointer; }
.roles__option input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--azul); }
.roles__option strong { display: block; color: var(--negro); }
.invite-link { flex-basis: 100%; }
/* Changing someone's role, in the list of people with access. */
.role-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); }
.role-form select { min-height: 2.75rem; }
.invite-link input { width: 100%; min-height: 2.75rem; font-size: var(--step--1); color: var(--gris); }
@media (min-width: 48rem) {
  .roles__option strong { display: inline; margin-right: var(--s-1); }
  .invite-link input { min-width: 14rem; }
}

/* A stage change that belongs to another department: said, not offered. */
.page-head__held { margin: 0; display: flex; align-items: center; min-height: 2.75rem; font-size: var(--step--1); color: var(--gris); }
