/* Magicwork OS Lite on the REEVI portal design, "The cable line", with REEVI's own colours: white
   pages, light wide figures, Anek Latin throughout, status as a shape and a word, and the teal
   cable only where it means something (the primary action). The logo is Magicwork Technologies'
   own, in its own colours (/static/brand). Everything is here: the content security policy forbids
   inline styles and any other host, so the font is our own (/static/fonts, copied from
   @fontsource-variable/anek-latin) and the select's chevron is a data: image. The server gives
   each font URL below its version (src/http/static.ts). The components the pages and the script
   share (boards, the calendar, lines, documents and print, the palette, files, comments) are
   described, with their markup, in COMPONENTS.md; src/http/css.test.ts holds this file to its
   rules. */

/* Anek Latin, variable: width 75 to 125 %, weight 100 to 800. Two files: Latin, and the rest of
   Latin with the rupee sign. */
@font-face {
  font-family: "Anek Latin";
  font-style: normal;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("/static/fonts/anek-latin-latin-wdth-normal.woff2?v=37b52178d8585025") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Anek Latin";
  font-style: normal;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("/static/fonts/anek-latin-latin-ext-wdth-normal.woff2?v=bf8874bee48e1e81") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* Tokens: the shared REEVI set, exactly as the portal has them. The figures are WCAG contrast
   ratios, as the portal states them. */
:root {
  --ink: #04303c; /* text, figures, icons, focus ring: 14.06 paper */
  --slate: #57747c; /* secondary text: 5.01 paper, 4.69 mist, 4.53 tint */
  --cable: #10aca8; /* the line, primary button fill behind ink: ink on it 5.02. Never text */
  --cable-hover: #3dbdb9; /* ink 6.15 */
  --cable-press: #5fc9c6; /* ink 7.14 */
  --deep: #0c7c7a; /* teal words, links, positive status: 5.02 paper, 4.70 mist, 4.55 tint */
  --live: #0f9d9a; /* live dots, meters: 3.33 paper. Graphics only */
  --press: #096361; /* pressed links: 7.07 */
  --edge: #7a9198; /* control borders: 3.32 paper, 3.11 mist */
  --hair: #e1e9eb; /* dividers only */
  --track: #dce5e7;
  --mist: #f5f8f8; /* quiet panels */
  --tint: #eaf6f6; /* selected rows, calm notes */
  --amber: #9e5c00; /* warnings: 5.27 paper, 4.94 mist, 4.92 amber tint */
  --amber-tint: #fff6e8;
  --fault: #b3261e; /* faults, errors: 6.54 paper, 5.92 fault tint */
  --fault-tint: #fdf1f0;
  --avail: #cfe6e5; /* a calm band: ink on it 10.78 */
  --font: "Anek Latin", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wide: 112.5%; /* Anek SemiExpanded: display type and big figures */
  --r1: 10px;
  --r2: 14px;
  --r3: 20px;
  --r4: 28px;
  --e1: 0 1px 2px rgba(4, 48, 60, 0.1), 0 8px 24px -12px rgba(4, 48, 60, 0.3);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 15px / 1.5 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

b,
strong {
  font-weight: 500;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Codes and record ids, as the portal sets its setup values: Anek Latin 500, a little tracked. */
code {
  font: 500 13px / 1.45 var(--font);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* A key of the keyboard, as the search and the palette write their shortcuts: Ctrl K. */
kbd {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: #fff;
  color: var(--slate);
  font: 500 12.5px / 1 var(--font);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Hidden means hidden, whatever display a component gives itself: the script hides the empty
   lines of an editor and the rows it filters with this attribute. */
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: the hidden attribute wins over every component's display */
  display: none !important;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.nw {
  white-space: nowrap;
}

/* An amount: tabular figures, right-aligned, on one line. */
.amt {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}

/* The currency before a big figure (a figure of 32 px or more), smaller than its digits, as the
   portal sets its rupee. In text and in tables the code keeps the text's size. */
.cur {
  margin-right: 0.04em;
  font-size: 0.62em;
  letter-spacing: 0;
}

svg.i {
  width: 20px;
  height: 20px;
  flex: none;
}

/* The icon sprite: drawn by <use>, never shown itself. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: var(--r1);
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* The logo, where REEVI's portal has its own: Magicwork Technologies' logo, black text for these
   white surfaces, in its own colours. Its green circle belongs to the logo; nothing else on the
   page uses that green. Drawn by height, so its two lines stay readable: 36 px in the sidebar,
   where the word MAGICWORK is about as tall as REEVI's wordmark, 28 px in the phone's top bar and
   40 px on the sign-in page. */
.wm {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--r2);
  text-decoration: none;
}

.wm img {
  display: block;
  width: auto;
  height: 36px;
}

.wm.pt-mlogo img {
  height: 28px;
}

/* Buttons and links */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 0 18px;
  border: 1.5px solid transparent;
  border-radius: var(--r2);
  background: none;
  color: var(--ink);
  font: 500 15px / 1.2 var(--font);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-pri {
  background: var(--cable);
  color: var(--ink);
}

.btn-pri:hover {
  background: var(--cable-hover);
}

.btn-pri:active {
  background: var(--cable-press);
}

.btn-sec {
  background: #fff;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-sec:hover {
  background: var(--mist);
}

.btn-danger {
  background: var(--fault);
  color: #fff;
}

.btn-danger:hover {
  background: #8f1e18;
}

.btn-s {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r1);
  font-size: 14px;
}

.btn-wide {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-pri:disabled:hover {
  background: var(--cable);
}

.btn-sec:disabled:hover {
  background: #fff;
}

.btn-danger:disabled:hover {
  background: var(--fault);
}

.tlink {
  padding: 0;
  border: 0;
  background: none;
  color: var(--deep);
  font-size: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.tlink:hover {
  color: var(--press);
  text-decoration-thickness: 2px;
}

/* A button that is only an icon, its name in aria-label or a .vh span: 40 px, 44 px on touch. */
.icon-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--r1);
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--mist);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* A download, as the portal's: deep words beside a 16 px icon, underlined on hover. */
.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--deep);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.dl svg {
  width: 16px;
  height: 16px;
}

.dl:hover {
  color: var(--press);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.dl + .dl {
  margin-left: 14px;
}

/* A link in the text of a page: deep, underlined. Low specificity, so the breadcrumb's and the
   tables' own links keep their look. */
:where(.pt-body, .si) a:not([class]) {
  color: var(--deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:where(.pt-body, .si) a:not([class]):hover {
  color: var(--press);
  text-decoration-thickness: 2px;
}

/* The shell: sidebar, phone top bar, top bar, body */

.pt {
  position: relative;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-areas: "side main";
  min-height: 100dvh;
  font-size: 15px;
  line-height: 1.5;
  background: #fff;
}

.pt-side {
  grid-area: side;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100dvh;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 14px 18px;
  border-right: 1px solid var(--hair);
  background: #fff;
}

.pt-logo {
  align-self: flex-start;
}

.pt-org {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 12px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: var(--r2);
  background: #fff;
  text-align: left;
}

.pt-org-name {
  min-width: 0;
}

.pt-org-name b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
}

.pt-org-name span {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: var(--slate);
}

.pt-org svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--slate);
}

.pt-chev {
  transition: transform 0.2s ease;
}

/* A member of both companies switches between them from the company block. */
.pt-pick {
  margin: 12px 0 16px;
}

.pt-pick > .pt-org {
  margin: 0;
  cursor: pointer;
  list-style: none;
}

.pt-pick > .pt-org::-webkit-details-marker {
  display: none;
}

.pt-pick > .pt-org:hover {
  border-color: var(--edge);
}

.pt-pick[open] .pt-chev {
  transform: rotate(180deg);
}

.pt-pick-list {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 6px;
  border: 1px solid var(--hair);
  border-radius: var(--r2);
  background: #fff;
  box-shadow: var(--e1);
}

.pt-pick-cur,
.pt-pick-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--r1);
  background: none;
  font-size: 14.5px;
  text-align: left;
}

.pt-pick-cur {
  background: var(--mist);
  font-weight: 500;
}

.pt-pick-cur svg {
  width: 18px;
  height: 18px;
}

.pt-pick-opt {
  padding-left: 38px;
  cursor: pointer;
}

.pt-pick-opt:hover {
  background: var(--mist);
}

.pt-pick-role {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--slate);
}

.pt-nav {
  display: grid;
  gap: 2px;
}

.pt-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r1);
  color: var(--slate);
  font-size: 15px;
  line-height: 1.25;
  text-decoration: none;
}

.pt-nav a:hover {
  background: var(--mist);
  color: var(--ink);
}

/* The item of the page shown (aria-current="page"), or of the section it is in ("true"). */
.pt-nav a[aria-current] {
  background: var(--mist);
  color: var(--ink);
  font-weight: 500;
}

.pt-nav svg {
  width: 20px;
  height: 20px;
}

/* The sidebar's sections (Sales, Delivery, Money, Support, Team, Directors), each a group of links
   under its heading: 13 px, 500, slate, as a table's headings, in sentence case and with no extra
   tracking. The heading is a <p> the group is labelled by, not a heading element, so the page's
   own headings stay its outline. A hair rule sets each section off from the one above it. */
.pt-grp {
  display: grid;
  gap: 2px;
}

.pt-nav > .pt-grp:not(:first-child) {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}

.pt-sec {
  padding: 2px 12px 4px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.pt-nav.low {
  margin-top: auto;
  padding-top: 24px;
}

.pt-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 12px 0;
  border-top: 1px solid var(--hair);
  font-size: 14px;
  line-height: 1.3;
}

.ava {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.pt-id {
  min-width: 0;
}

.pt-id .who {
  display: block;
  overflow-wrap: anywhere;
}

.pt-id .role {
  display: block;
  font-size: 13px;
  color: var(--slate);
}

.pt-out {
  margin: 2px 0 0;
}

/* Sign out: a quiet text link. */
.pt-out button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--slate);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pt-out button:hover {
  color: var(--ink);
}

.pt-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pt-mtop {
  grid-area: mtop;
  display: none;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 16px 0 6px;
  border-bottom: 1px solid var(--hair);
}

.pt-mtop .org {
  min-width: 0;
  overflow: hidden;
  color: var(--slate);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-menu {
  margin-left: auto;
}

.pt-menu > summary {
  list-style: none;
}

.pt-menu > summary::-webkit-details-marker {
  display: none;
}

.pt-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 40px;
  border-bottom: 1px solid var(--hair);
}

.pt-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(480px, 100%);
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: var(--r2);
}

.pt-search svg {
  width: 18px;
  height: 18px;
  color: var(--ink);
}

.pt-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  text-overflow: ellipsis;
  appearance: none;
}

.pt-search input::placeholder {
  color: var(--slate);
  opacity: 1;
}

.pt-search input:focus-visible {
  outline: none;
}

.pt-search:focus-within {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.pt-tz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--slate);
  font-size: 13.5px;
  white-space: nowrap;
}

.pt-tz svg {
  width: 16px;
  height: 16px;
}

/* The search's shortcut, Ctrl K (on a Mac the script writes the Command key's sign), at the
   field's end. The script opens the palette with it, so it shows only under the script. */
.pt-kbd {
  flex: none;
}

/* The bell: a link to the notifications, at the right end of the top bar whatever the order of
   its markup. Its count is an ink fill with white text, hidden from a screen reader, which hears
   the link's name instead ("Notifications, 3 unread"). */
.pt-bell {
  position: relative;
  display: inline-grid;
  flex: none;
  order: 1;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r1);
  color: var(--ink);
}

.pt-bell:hover {
  background: var(--mist);
}

.pt-badge {
  position: absolute;
  top: 1px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: 0 0 0 2px #fff;
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}

.pt-body {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 48px;
}

/* Controls */

.inp {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--edge);
  border-radius: var(--r2);
  background: #fff;
  color: var(--ink);
  font: 400 15px var(--font);
}

.inp:not([type="date"]) {
  appearance: none;
}

/* A value to copy (an invite or recovery link), as the portal's setup values: on mist, tracked. */
.inp[readonly] {
  background: var(--mist);
  font: 500 15px var(--font);
  letter-spacing: 0.02em;
}

.inp::placeholder,
.ta::placeholder {
  color: var(--slate);
  opacity: 1;
}

/* A select, with the chevron drawn as a data: image (the policy allows data: images only). */
.sel {
  max-width: 100%;
  height: 40px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--edge);
  border-radius: var(--r2);
  background:
    #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304303C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center / 18px;
  color: var(--ink);
  font-size: 14.5px;
  cursor: pointer;
  appearance: none;
}

/* In a form, a select is as tall and as wide as the inputs beside it. */
.fld > .sel {
  width: 100%;
  height: 44px;
  font-size: 15px;
}

.ta {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border: 1.5px solid var(--edge);
  border-radius: var(--r2);
  background: #fff;
  color: var(--ink);
  font: 400 14.5px / 1.5 var(--font);
  resize: vertical;
}

.inp:focus-visible,
.sel:focus-visible,
.ta:focus-visible {
  border-color: var(--ink);
}

.inp[aria-invalid="true"],
.sel[aria-invalid="true"],
.ta[aria-invalid="true"] {
  border-color: var(--fault);
  box-shadow: inset 0 0 0 1px var(--fault);
}

.fld {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.fld > label,
.fld > .lb,
.fld legend {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.help {
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.5;
}

.err {
  color: var(--fault);
  font-size: 13.5px;
  line-height: 1.5;
}

.err:empty {
  display: none;
}

/* A form: its fields one under the other, then its actions, the primary one first. */
.form {
  display: grid;
  gap: 22px;
  max-width: 640px;
}

.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form > .acts {
  margin-top: 2px;
}

.h3 + .form {
  margin-top: 16px;
}

/* One field and its button on a line: a status, an owner, a link. As the portal's remote actions. */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline-form > .sel,
.inline-form > .inp {
  flex: 1 1 150px;
  min-width: 0;
}

/* A select takes its own width first, so its button stays beside it where there is room. */
.inline-form > .sel {
  flex-basis: auto;
}

.inline-form > .sel {
  height: 36px;
  border-radius: var(--r1);
  font-size: 14px;
}

.inline-form > .inp {
  height: 36px;
  border-radius: var(--r1);
  font-size: 14px;
}

/* A radio button or a checkbox with its words (a tax treatment, a choice of client), and a
   description in slate under them (a <small> inside the words' <span>): an 18 px control in ink,
   as the portal's. A choice that cannot be made yet keeps its words readable; its reason is the
   description. */
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}

.opt input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--ink);
}

.opt > span {
  min-width: 0;
}

.opt small {
  display: block;
  color: var(--slate);
  font-size: 13.5px;
}

.opt:has(input:disabled) {
  cursor: not-allowed;
}

/* A choice of a few, drawn as segments over native radio buttons, so it works as a plain form: the
   radios stay (and take the focus), each segment is a radio's label. */
.seg {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: var(--r2);
  background: #fff;
}

.seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.seg label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--r1);
  color: var(--slate);
  font-size: 14px;
  cursor: pointer;
}

.seg label:hover {
  color: var(--ink);
}

/* The chosen segment: mist with an ink ring; the transparent outline shows in forced colours,
   where shadows do not. */
.seg input:checked + label {
  background: var(--mist);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
  font-weight: 500;
  outline: 1.5px solid transparent;
  outline-offset: -1.5px;
}

.seg input:focus-visible + label {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* A field with its unit beside it, as the portal's: a currency before an amount, h and min after a
   time. */
.affix {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 280px;
  height: 44px;
  overflow: hidden;
  border: 1.5px solid var(--edge);
  border-radius: var(--r2);
  background: #fff;
}

.affix:focus-within {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.affix:has(input[aria-invalid="true"]) {
  border-color: var(--fault);
  box-shadow: inset 0 0 0 1px var(--fault);
}

.affix > span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--mist);
  color: var(--slate);
  font-size: 15px;
  white-space: nowrap;
}

.affix > span:first-child {
  border-right: 1px solid var(--hair);
  color: var(--ink);
}

.affix > span:last-child:not(:first-child) {
  border-left: 1px solid var(--hair);
}

.affix input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.affix input:focus-visible {
  outline: none;
}

.affix.sm {
  max-width: 150px;
}

.affix.xs {
  max-width: 96px;
}

/* Filters: the bar of search and selects, status chips, and tabs between views */

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 28px 0 0;
}

.bar .grow {
  flex: 1 1 220px;
  max-width: 320px;
}

.bar + .err {
  margin-top: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.bar + .chips {
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--edge);
  border-radius: var(--r1);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--ink);
}

.chip > span {
  color: var(--chip-n, var(--slate));
  font-variant-numeric: tabular-nums;
}

.chip svg {
  width: 14px;
  height: 14px;
}

.chip[aria-current="page"] {
  --chip-n: var(--ink);
  padding: 0 12px;
  border: 2px solid var(--ink);
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--hair);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: -1px;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--slate);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

/* The tabs scroll sideways, which clips anything drawn outside them: the ring goes inside. */
.tab:focus-visible {
  outline-offset: -4px;
  border-radius: var(--r1);
}

.tab[aria-current="page"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
  font-weight: 500;
}

/* The page header */

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 10px;
  color: var(--slate);
  font-size: 14px;
}

/* Underlined at rest: deep and slate are of one lightness, so the hue alone would not tell a link
   from the current page beside it. */
.crumb a {
  color: var(--deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.crumb a:hover {
  color: var(--press);
  text-decoration-thickness: 2px;
}

.crumb [aria-current="page"] {
  overflow-wrap: anywhere;
}

.pg-h {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}

.pg-h > div:first-child {
  min-width: 0;
}

.pg-h h1,
.msg h1 {
  font-size: 32px;
  font-weight: 300;
  font-stretch: var(--wide);
  letter-spacing: -0.008em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.pg-h p,
.msg > p {
  max-width: 46em;
  margin-top: 8px;
  color: var(--slate);
  font-size: 15px;
  line-height: 1.5;
}

.pg-act {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.h3 {
  font-size: 19px;
  font-weight: 400;
  line-height: 1.3;
}

.h3 .cnt {
  margin-left: 4px;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

.sec {
  margin-top: 40px;
}

.sec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.lead-s {
  margin-top: 6px;
  color: var(--slate);
  font-size: 14px;
  line-height: 1.5;
}

/* The status line under a detail page's header. */
.ch-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  margin-top: 14px;
  color: var(--slate);
  font-size: 14px;
  font-variant-numeric: tabular-nums lining-nums;
}

.msg {
  max-width: 46em;
}

/* Status: a shape and a word, never colour alone */

.st {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.st svg {
  width: 15px;
  height: 15px;
}

.st-av,
.st-ok {
  color: var(--deep);
}

.st-chg {
  color: var(--ink);
}

.st-flt,
.st-off {
  color: var(--fault);
}

.st-new,
.st-unk,
.st-dim {
  color: var(--slate);
}

.st-warn {
  color: var(--amber);
}

/* A priority: a word, urgent in fault, high in amber, the others in slate. */
.pri {
  font-weight: 500;
}

.pri-urgent {
  color: var(--fault);
}

.pri-high {
  color: var(--amber);
}

.pri-normal,
.pri-low {
  color: var(--slate);
  font-weight: 400;
}

/* Tables: hairline rows, no box. The first column's link makes the whole row a target. */

/* A table's scroller. It clips what is drawn outside it, so it has 4 px either side, outside the
   table's own width, for the focus ring of a link at the table's edge. */
.tw {
  overflow-x: auto;
  margin: 16px -4px 0;
  padding: 0 4px;
}

/* A list straight under its header, with no bar of filters between them. */
.pg-h + .tw {
  margin-top: 28px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.45;
}

.tbl th {
  padding: 0 18px 10px 0;
  border-bottom: 1px solid var(--hair);
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}

.tbl td {
  padding: 13px 18px 13px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}

.tbl th:last-child,
.tbl td:last-child {
  padding-right: 0;
}

.tbl .r {
  text-align: right;
  white-space: nowrap;
}

.tbl .n {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.tbl td > .st:not(:last-child) {
  margin-right: 8px;
}

.tbl .sub {
  display: block;
  color: var(--slate);
  font-size: 13px;
}

/* A second line that repeats a column the table drops below 1100 px; shown only then. */
.tbl .narrow-sub {
  display: none;
}

/* A quiet value (a dash, "No owner", "Unassigned"), in tables and everywhere else. */
.dim {
  color: var(--slate);
}

.tbl a.row {
  color: inherit;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tbl a.row:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tbl tbody tr {
  position: relative;
}

.tbl a.row::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* The other controls of a row lie over its link: a link, a button, a select or a field and their
   labels, a confirmation's summary. A label for a screen reader only keeps its own place. */
.tbl tr:has(a.row) :is(a:not(.row), button, select, input, label, summary):not(.vh) {
  position: relative;
  z-index: 1;
}

/* A table's foot, and the row's mist on hover and while its link has the focus, are further down:
   the last rules for cells, after those of the calendar, the lines and the documents. */

.tbl code {
  font-size: 12.5px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--slate);
  font-size: 14px;
}

.pager:empty {
  display: none;
}

.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

/* Panels, notes and facts */

.pnl {
  padding: 22px 24px 24px;
  border-radius: var(--r3);
  background: var(--mist);
}

.pnl-o {
  padding: 22px 24px 24px;
  border: 1px solid var(--hair);
  border-radius: var(--r3);
  background: #fff;
}

.pnl > * + *,
.pnl-o > * + * {
  margin-top: 14px;
}

/* A panel's own sentence, such as the work order's next step: 14 px, as the portal's cards. */
.pnl > p:not([class]) {
  font-size: 14px;
  line-height: 1.5;
}

.pnl .btn {
  white-space: normal;
}

.pnl .help,
.pnl .err {
  margin-top: 10px;
}

.note {
  --note-mark: var(--deep);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r2);
  background: var(--tint);
  font-size: 14px;
  line-height: 1.5;
}

.note svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--note-mark);
}

.note.warn {
  --note-mark: var(--amber);
  background: var(--amber-tint);
}

.note.mist {
  --note-mark: var(--ink);
  background: var(--mist);
}

.kv {
  display: grid;
  grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr);
  gap: 10px 24px;
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.45;
}

.kv dt {
  color: var(--slate);
}

.kv dd {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.kv dd .sub {
  display: block;
  color: var(--slate);
  font-size: 13px;
}

.pnl > .kv:first-child,
.pnl-o > .kv:first-child {
  margin-top: 0;
}

/* Text people typed: their paragraphs and line breaks. */
.prose {
  display: grid;
  gap: 10px;
  max-width: 46em;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* An action that cannot be undone, confirmed in place (confirmAction, src/http/confirm.ts), as
   the portal's remote actions: the summary is the action's button; open, it asks and warns on
   fault tint, with the action in fault red beside "Keep it". It needs no script; "Keep it" shows
   only under the script, which closes the details with it. */
.ra > summary {
  list-style: none;
  cursor: pointer;
}

.ra > summary::-webkit-details-marker {
  display: none;
}

.ra[open] > summary {
  background: var(--mist);
}

/* In a row of actions an open confirmation takes a line of its own. */
.ra[open] {
  flex-basis: 100%;
}

.confirm {
  max-width: 34em;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--r2);
  background: var(--fault-tint);
}

.confirm b {
  display: block;
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.confirm p {
  margin-top: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.ra-act {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.ra-act > form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
}

/* A reason or a note the action needs fills the line above its button. */
.ra-act .fld {
  flex: 1 1 100%;
}

/* Layouts */

.two {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: start;
}

.two.side {
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}

.stack > * + * {
  margin-top: 36px;
}

/* The calm state of a list or a section with nothing to show, as the portal's state cards: a slate
   icon in the title's line, the text in slate, then the action. */

.empty {
  margin-top: 16px;
  padding: 18px 20px 20px;
  border-radius: var(--r3);
  background: var(--mist);
  font-size: 14px;
  line-height: 1.5;
}

.empty b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}

.empty b .i {
  width: 16px;
  height: 16px;
}

.empty p {
  margin-top: 6px;
  color: var(--slate);
}

.empty .empty-act {
  margin-top: 14px;
}

/* A text link sits closer than a button, as in the portal. */
.empty .empty-act:has(> .tlink) {
  margin-top: 10px;
}

/* Sign in, and the pages of invites, recovery and the re-check */

.si {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  padding: 24px 40px 22px;
  font-size: 15px;
  line-height: 1.5;
}

.si-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wm.si-logo {
  padding-left: 0;
}

.wm.si-logo img {
  height: 40px;
}

.si-mid {
  display: grid;
  place-items: center;
  padding: 56px 0;
}

.si-form,
.si .msg {
  width: min(420px, 100%);
}

.si-form h1,
.si .msg h1 {
  font-size: 40px;
  font-weight: 300;
  font-stretch: var(--wide);
  letter-spacing: -0.01em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.si-form > p,
.si .msg > p {
  margin-top: 12px;
  color: var(--slate);
  font-size: 16px;
}

.si-steps {
  display: grid;
  gap: 22px;
  margin-top: 36px;
}

.si-steps .kv {
  margin-top: 0;
}

.status {
  min-height: 1.5em;
  color: var(--slate);
  font-size: 14px;
}

.status:empty {
  min-height: 0;
}

/* A failure (passkey.js sets data-tone): the fault colour and its mark, as the portal's sign-in
   failures. The mark is the sprite's m-flt, as a data: image (the policy allows data: images). */
.status[data-tone="error"]:not(:empty) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--fault);
  font-weight: 500;
}

.status[data-tone="error"]:not(:empty)::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.6 15.2 14.4H.8z' fill='%23B3261E' stroke='%23B3261E' stroke-width='1' stroke-linejoin='round'/%3E%3Cpath d='M8 6.3v3.6' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='12' r='.95' fill='%23fff'/%3E%3C/svg%3E")
    no-repeat center / 16px;
}

.si-role {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  color: var(--slate);
  font-size: 14px;
}

.si-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  color: var(--slate);
  font-size: 13.5px;
}

/* The overview: figures, what needs you, and the latest activity */

/* What needs you, and the latest activity: side by side, as the portal's overview lists. */
.ov {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: start;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.kpi {
  min-width: 0;
  padding: 18px 20px 20px 0;
}

.kpi + .kpi {
  padding-left: 24px;
  border-left: 1px solid var(--hair);
}

.kpi dt {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.kpi .v {
  display: block;
  margin-top: 6px;
  font-size: 40px;
  font-weight: 300;
  font-stretch: var(--wide);
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.kpi .c {
  display: block;
  margin-top: 6px;
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.45;
}

.alerts {
  margin-top: 12px;
  border-top: 1px solid var(--hair);
}

.al {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0 12px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--hair);
}

.al > svg {
  width: 17px;
  height: 17px;
  margin-top: 3px;
}

.al b {
  display: block;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.al .m {
  display: block;
  margin-top: 2px;
  color: var(--slate);
  font-size: 13.5px;
}

.al-act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 12px;
}

.ls {
  margin-top: 12px;
  border-top: 1px solid var(--hair);
}

.ls li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14.5px;
}

.ls-t {
  color: var(--slate);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.ls-w {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ls-w b {
  font-weight: 500;
}

/* Underlined at rest, so a row that opens something reads apart from a row that does not. */
.ls-link {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.ls-link:hover {
  text-decoration-thickness: 2px;
}

.ls-w > span {
  display: block;
  color: var(--slate);
  font-size: 13px;
}

.ls-a {
  text-align: right;
  white-space: nowrap;
}

/* A ticket's comments, as a timeline: who, when, what they wrote */

.tline {
  margin-top: 12px;
  border-top: 1px solid var(--hair);
}

.tline > li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0 14px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--hair);
}

.tline-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}

.tline-h b {
  font-weight: 500;
}

.tline-h time {
  color: var(--slate);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.tline .prose {
  margin-top: 6px;
}

/* A ticket's comment is a reply (logged: what the client was told) or an internal note, said in
   its header line by a mark and a word; a note's text sits on mist, apart from what the client
   saw. */
:where(.tl-reply, .tl-note) .tline-h .st {
  font-size: 13.5px;
}

.tl-note .prose {
  padding: 10px 14px;
  border-radius: var(--r2);
  background: var(--mist);
}

/* A mention: the person's name in 500 on tint; the rest of the text stays as it was typed. */
b.mention {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--tint);
  font-weight: 500;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Under a comment, to its author only: a name that matched no one, or two people. */
.mention-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}

.mention-note svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--amber);
}

/* My passkeys */

.keys {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  max-width: 720px;
}

/* Money: a list's totals, a receipt, a document's totals */

/* The totals of a list, on a line above it: "Outstanding INR 1,20,000.00, AED 4,000.00". */
.tot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin-top: 22px;
  font-size: 14.5px;
}

.tot b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tot span {
  color: var(--slate);
}

/* A receipt, as the portal's: rows of a label and an amount, a sum under an ink rule. */
.rcpt {
  font-size: 15px;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.45;
}

.rc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}

.rc-row > span:first-child {
  color: var(--slate);
}

.rc-row > span:last-child {
  white-space: nowrap;
}

.rc-row > span:first-child b {
  color: var(--ink);
  font-weight: 400;
}

.rc-sum {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
}

.rc-sum > span:first-child {
  color: var(--ink);
  font-weight: 500;
}

.rc-big {
  font-size: 32px;
  font-stretch: var(--wide);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.rc-gap {
  height: 14px;
}

/* The totals of a quote or a billing record (totalsBlock, src/money/lines.ts): each row a <div>
   of its term and its amount, as a receipt's; the total under an ink rule. On the right, under the
   lines. */
.tots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 420px);
  margin: 20px 0 0 auto;
  font-size: 15px;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.45;
}

.tots > div {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 0;
}

.tots dt {
  color: var(--slate);
}

.tots dd {
  text-align: right;
  white-space: nowrap;
}

.tots .grand {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  font-weight: 500;
}

.tots .grand dt {
  color: var(--ink);
}

/* A ticket's targets (support): the SLA status, a mark and a word as every status, never a chip,
   over its time in words ("Reply by 14:05"). No countdown: pages do not refresh. */
.sla {
  display: inline-grid;
  justify-items: start;
  gap: 2px;
}

.sla > :not(.st) {
  color: var(--slate);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Boards: a pipeline of leads, a project's tasks */

/* The columns side by side, each a quiet panel of cards under its name, count and value. With the
   script a card is dragged to another column (its grip says it can be); every card also has its
   Move control, a plain form, which is the way on a keyboard and on a phone. A board wider than
   the page scrolls inside itself, never the page; at 600 px and below its columns stack. */
.board {
  display: grid;
  grid-auto-columns: minmax(172px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  margin: 20px -4px 0;
  padding: 0 4px 4px;
  overflow-x: auto;
}

.col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 12px 12px;
  border-radius: var(--r3);
  background: var(--mist);
}

/* The column a card is dragged over: an ink outline. */
.col.over {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.col-h {
  padding: 0 2px 10px;
}

.col-h > :is(h2, h3, h4) {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.35;
}

/* The column's count, in its heading; the script writes it after a move. */
.col-n {
  color: var(--slate);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* The column's value: one total per currency, each kept on one line. */
.col-v {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: 2px;
  color: var(--slate);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums lining-nums;
}

.col-v > span {
  white-space: nowrap;
}

/* The cards; an empty column keeps room to drop one in. */
.cards {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 8px;
  min-height: 48px;
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  min-width: 0;
  padding: 12px 12px 14px;
  border: 1px solid var(--hair);
  border-radius: var(--r2);
  background: #fff;
  scroll-margin: 16px;
}

.card > * {
  grid-column: 1 / -1;
  min-width: 0;
}

/* The card a move without the script came back to (the page's #card-<id>). The transparent outline
   shows in forced colours, where shadows do not. */
.card:target {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  outline: 2px solid transparent;
}

/* The card being dragged: its place, dashed, until it is dropped. */
.card.dragging {
  border-color: var(--edge);
  border-style: dashed;
  opacity: 0.6;
}

/* The title, a link to the record; the grip beside it on the right. */
.card-t {
  grid-column: 1;
  grid-row: 1;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.card-t a {
  color: inherit;
  text-decoration: none;
}

:is(a.card-t, .card-t a):hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The drag handle (i-grip), shown with the script only: the card itself is what is dragged, and
   its Move control is the way without a mouse. */
.card-grip {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -3px -6px 0 0;
  color: var(--slate);
  cursor: grab;
}

.card-grip svg {
  width: 18px;
  height: 18px;
}

/* A line of facts: the client, the value, the owner, the follow-up or due date in words. */
.card-m {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* A status in a card ("Follow up overdue, 12 Nov") wraps, as the card is narrow. */
.card .st {
  white-space: normal;
}

/* A card's owner or assignee: a 24 px avatar, with the name beside it for a screen reader. */
.card .ava {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

/* The Move control: the stage or status, and Move. */
.card-move {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
}

/* A narrow select: its chevron closer to the edge, so "Proposal sent" fits a card. */
.card-move > .sel {
  flex: 1 1 120px;
  min-width: 0;
  height: 36px;
  padding: 0 28px 0 9px;
  border-radius: var(--r1);
  background-position: right 7px center;
  font-size: 14px;
}

/* "and 12 more in the list", under a column's 100 cards. */
.col-more {
  margin-top: 10px;
  padding: 0 2px;
  font-size: 14px;
}

/* The month calendar of who is out (hr) */

/* A table of seven columns, Monday first. A day not worked (a weekend, a holiday) is shaded mist
   beside its words; today's date has a 2 px ink ring. The people out are lines of text, never
   chips; a pending one is dashed, with the word "pending". Text is ink, or slate on white or mist
   only. At 600 px and below the grid gives way to the list of days under it. */
.cal {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
  line-height: 1.35;
}

.cal caption {
  padding-bottom: 12px;
  font-size: 19px;
  line-height: 1.3;
  text-align: left;
}

.cal th {
  padding: 0 8px 8px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.cal td {
  height: 96px;
  padding: 6px 8px 8px;
  border: 1px solid var(--hair);
  vertical-align: top;
}

.cal-off,
.cal-hol {
  background: var(--mist);
}

/* The date: the day's number (the whole date is in words for a screen reader). */
.cal-d {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin: -2px 0 0 -4px;
  padding: 0 4px;
  border-radius: 14px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.cal-out .cal-d {
  color: var(--slate);
  font-weight: 400;
}

/* Today (aria-current="date"): a 2 px ink ring round the date. */
.cal-today .cal-d {
  border: 2px solid var(--ink);
}

/* A holiday's name. */
.cal-n {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* The people out on a day, at most three in a cell; each line as wide as its words. */
.cal-l {
  display: grid;
  justify-items: start;
  gap: 3px;
  margin-top: 4px;
}

.cal-c {
  overflow-wrap: anywhere;
}

/* Someone whose leave is not decided yet: dashed, with the word "pending". */
.cal-c.pend {
  padding: 0 4px;
  border: 1px dashed var(--edge);
  border-radius: 6px;
}

.cal-c.pend > span {
  color: var(--slate);
}

/* "+2 more", to the day in the list under the grid: at least 24 px each way. */
.cal-more {
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  min-height: 24px;
  margin-top: 2px;
  color: var(--deep);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cal-more:hover {
  color: var(--press);
  text-decoration-thickness: 2px;
}

/* The month's days with someone out, under the grid for everyone; at 600 px and below, the
   calendar itself. */
.cal-days {
  margin-top: 16px;
  border-top: 1px solid var(--hair);
}

.cal-days > li {
  display: grid;
  grid-template-columns: minmax(0, 12em) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--hair);
  font-size: 14.5px;
  scroll-margin-top: 16px;
}

.cal-days .cal-l {
  margin-top: 0;
}

/* The day a "+2 more" leads to: tint, with an ink bar. */
.cal-days > li:target {
  padding-left: 14px;
  background: var(--tint);
  box-shadow: inset 3px 0 0 var(--ink);
}

/* The lines of a quote or a billing record (lineEditor, src/money/lines.ts) */

/* Above 820 px a table of fields under the columns' headings, each field also with its own label
   for a screen reader ("Description, line 3"); at 820 px and below each line is a block of
   labelled fields, the description across, then the quantity and the unit, the unit price and the
   SAC, two to a row, never a table that scrolls sideways. The fields are known by their names
   (line_<n>_description and so on), so the cells need no classes. Add a line and Remove are the
   script's: without it the empty rows are there to fill, and a line is removed by emptying it. */
.lines {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.45;
}

.lines th {
  padding: 0 10px 8px 0;
  border-bottom: 1px solid var(--hair);
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}

.lines td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}

.lines th:last-child,
.lines td:last-child {
  padding-right: 0;
}

.lines .inp {
  height: 40px;
  padding: 0 10px;
  font-size: 14.5px;
}

.lines .sel {
  width: 100%;
  height: 40px;
  font-size: 14.5px;
}

.lines .ta {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14.5px;
}

/* The numbers (the line's number, its quantity and price), right-aligned in tabular figures. */
.lines .n {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}

.lines .n .inp {
  text-align: right;
}

/* A field's own label: for a screen reader above 820 px, where the headings show; over its field
   at 820 px and below. */
.lines-l {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.lines-add {
  margin-top: 12px;
}

.lines-rm {
  white-space: nowrap;
}

/* The table's widths, by the fields' names: the description takes the rest. */
@media (min-width: 821px) {
  .lines td:has([name$="_quantity"]) {
    width: 6em;
  }

  .lines td:has([name$="_unit"]) {
    width: 5.5em;
  }

  .lines td:has([name$="_unit_price"]) {
    width: 8em;
  }

  .lines td:has([name$="_sac"]) {
    width: 6.5em;
  }

  .lines td:has(.lines-rm) {
    width: 1%;
  }

  /* A cell with no field (the line's number) sits on the line of its fields' text. */
  .lines td:not(:has(input, select, textarea, button)) {
    padding-top: 19px;
  }
}

/* Documents: a quote as it prints, a billing record as a record */

/* On screen a sheet with a hair border; printed, the page itself. One component in two places:
   inside the shell its title is an <h2>; on its own page (layout "document") the page's only
   <h1>. */
.doc {
  max-width: 880px;
  margin-top: 28px;
  padding: 40px 44px 44px;
  border: 1px solid var(--hair);
  border-radius: var(--r3);
  background: #fff;
  font-size: 14.5px;
  line-height: 1.5;
}

/* The document's status, on screen only. */
.doc-stamp {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* The head: a quote's letterhead on the left (the logo, the legal name, the address and the tax
   number), its title and facts on the right. A record has no letterhead: its title is on the
   left, its facts on the right. */
.doc-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 40px;
}

.doc-head > :is(h1, h2) {
  font-size: 28px;
  font-stretch: var(--wide);
  font-weight: 300;
  letter-spacing: -0.008em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.doc-from {
  grid-row: 1 / span 2;
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* The print-sized logo (Assets.logoPrint), drawn by its height as the sidebar's. */
.doc-logo {
  display: block;
  width: auto;
  height: 40px;
  margin-bottom: 14px;
}

/* The facts: number, dates, place of supply, as terms in slate and their values in ink. */
.doc-meta {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 3px 16px;
  color: var(--slate);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums lining-nums;
}

.doc-meta > div {
  display: contents;
}

.doc-meta dd {
  color: var(--ink);
}

/* Under a letterhead the title and the facts take the right-hand column, to its edge. */
.doc-from ~ :is(h1, h2) {
  grid-column: 2;
  text-align: right;
}

.doc-from ~ .doc-meta {
  grid-column: 2;
  justify-content: end;
}

/* Who it is for: a label, then the client's name, address and tax number. */
.doc-to {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.doc-to > :first-child {
  margin-bottom: 4px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
}

/* The lines: a table that fits the A4 page (about 673 px) with every column; the description
   wraps, the numbers do not. */
.doc-lines {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.45;
}

.doc-lines th {
  padding: 0 10px 8px 0;
  border-bottom: 1px solid var(--edge);
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
}

.doc-lines td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.doc-lines th:last-child,
.doc-lines td:last-child {
  padding-right: 0;
}

.doc-lines .n {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
  overflow-wrap: normal;
}

/* The totals, on the right under the lines. */
.doc-tots {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.doc-tots .tots {
  margin-top: 0;
}

/* What the document must say: "Indicative quotation, not a tax invoice." and the tax treatment's
   sentence on a quote; "Not a tax invoice." under a record's title. On screen and in print. */
.doc-note {
  margin-top: 24px;
  padding: 12px 14px;
  border-radius: var(--r2);
  background: var(--mist);
  font-size: 13.5px;
  line-height: 1.5;
}

.doc-head + .doc-note {
  margin-top: 16px;
}

/* The foot: notes, terms, and the bank details with "Payment is due against our tax invoice." */
.doc-foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.doc-foot > * + * {
  margin-top: 14px;
}

.doc-foot :is(h2, h3, h4) {
  font-size: 13px;
  font-weight: 500;
}

/* A document's own page (layout "document"): on screen only, a bar to go back and to print, with
   how to save it as a PDF; then the document. */
.docw {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 40px 56px;
}

.docw .doc {
  margin-top: 0;
}

.doc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hair);
}

/* Back on the left, Print at the far end. */
.doc-bar > .tlink {
  margin-right: auto;
}

.doc-hint {
  flex: 1 1 100%;
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.5;
}

/* The search palette (the script's) */

/* Ctrl K, or Cmd K on a Mac, opens a modal dialog near the top of the window: its field a combobox
   over a listbox of results grouped by kind, and a status line that says how many there are. The
   dialog's display is the browser's until it is open. The active result has an ink ring, as
   focus has. */
dialog.pal {
  width: min(640px, calc(100% - 32px));
  max-width: none;
  max-height: min(600px, calc(100dvh - 32px));
  margin: 10vh auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: var(--r3);
  background: #fff;
  box-shadow: var(--e1);
  color: var(--ink);
}

dialog.pal[open] {
  display: flex;
  flex-direction: column;
}

dialog.pal::backdrop {
  background: var(--ink);
  opacity: 0.18;
}

.pal-in {
  flex: none;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: 400 17px var(--font);
  appearance: none;
}

.pal-in::placeholder {
  color: var(--slate);
  opacity: 1;
}

/* The field keeps the focus while the dialog is open: its rule turns ink. */
.pal-in:focus-visible {
  box-shadow: inset 0 -2px 0 var(--ink);
  outline: none;
}

/* "5 results", "No results for "acme"", "Type two letters or more". */
.pal-st {
  flex: none;
  padding: 8px 20px;
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.45;
}

.pal-st:empty {
  padding: 0;
}

.pal-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 8px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pal-g + .pal-g {
  margin-top: 6px;
}

/* A kind of result, named as a table's headings. */
.pal-gl {
  display: block;
  padding: 10px 12px 4px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 500;
}

/* A result: its title over its detail, 44 px at least. */
.pal-o {
  display: grid;
  align-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r1);
  overflow-wrap: anywhere;
  cursor: pointer;
}

.pal-o:hover {
  background: var(--mist);
}

.pal-o > :first-child {
  font-weight: 500;
}

.pal-o > :not(:first-child) {
  color: var(--slate);
  font-size: 13px;
}

/* The active result (the combobox's aria-activedescendant): an ink ring on mist. The transparent
   outline shows in forced colours, where shadows do not. */
.pal-o[aria-selected="true"] {
  background: var(--mist);
  box-shadow: inset 0 0 0 2px var(--ink);
  outline: 2px solid transparent;
  outline-offset: -2px;
}

/* Nothing found, or nothing typed yet: a quiet line in the list's place. */
.pal-empty {
  padding: 16px 20px 18px;
  color: var(--slate);
  font-size: 14px;
}

/* Notifications (the notify module) */

/* Newest first: each its title and, under it, what and when, with Open at the end. An unread one
   starts with the m-use mark and the word "New" (.st st-chg), and its title is in 500. */
.ntf {
  margin-top: 16px;
  border-top: 1px solid var(--hair);
}

.ntf-i {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 20px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--hair);
}

.ntf-i > form {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}

.ntf-t {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ntf-t > .st {
  margin-right: 8px;
}

.ntf-i.unread .ntf-t {
  font-weight: 500;
}

.ntf-m {
  grid-column: 1;
  color: var(--slate);
  font-size: 13.5px;
}

/* Files (the files module) */

/* The files of a record: each its kind, its name with its size, who added it and when, and its
   actions (Download, View for an image, Delete as a confirmation); under them the upload field
   with its limits. On a work order once sent, a note says the files are shared with the other
   company. */
.file-list {
  margin-top: 12px;
  border-top: 1px solid var(--hair);
}

.file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px 14px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--hair);
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

/* The kind, in a word: PDF, PNG, Word. */
.file-k {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 24px;
  margin-top: 1px;
  padding: 0 6px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Its size, who added it (the other company's name for its uploads, never a person) and when. */
.file-m {
  display: block;
  color: var(--slate);
  font-size: 13px;
}

/* The actions at the end of the row; a confirmation, once open, takes the row's width. */
.file > .acts {
  justify-content: flex-end;
}

.file:has(.ra[open]) > .acts {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

/* The upload: the field with its limits under it, then Upload. */
.file-up {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 16px;
}

.file-up input[type="file"] {
  max-width: 100%;
  color: var(--ink);
  font-size: 14px;
}

.file-up input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 12px;
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r1);
  background: #fff;
  color: var(--ink);
  font: 500 14px var(--font);
  cursor: pointer;
}

.file-up input[type="file"]::file-selector-button:hover {
  background: var(--mist);
}

/* "Files here are shared with MW-India", on a work order. */
.file-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r2);
  background: var(--tint);
  font-size: 14px;
  line-height: 1.5;
}

.file-note svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--deep);
}

/* The last rules for cells, after those of the calendar, the lines and the documents, which are
   less specific. A table's foot, such as its totals: slate, with no rule under it. */
.tbl tfoot :is(th, td) {
  padding-top: 13px;
  border-bottom: 0;
  vertical-align: top;
}

.tbl tfoot td {
  color: var(--slate);
  font-size: 14px;
}

/* A row whose first cell links to its record: hovered, or its link focused, the row is mist. */
.tbl tbody tr:has(a.row):hover td,
.tbl tbody tr:has(a.row:focus-visible) td {
  background: var(--mist);
}

/* The controls only the script makes work, shown once app.js has added the class js to <html>:
   Print, Add a line and Remove, Keep it, the drag grip and the search's shortcut. Everything else
   works as a plain form without it. */
:root:not(.js)
  :is([data-print], [data-add-line], [data-remove-line], [data-close], .pt-kbd, .card-grip) {
  display: none;
}

/* Responsive: the portal's breakpoints, for the window the app fills */

@media (max-width: 1240px) {
  .pt {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .pt-side {
    padding: 20px 12px 18px;
  }

  .pt-nav a {
    gap: 10px;
    padding: 0 10px;
  }

  .pt-sec {
    padding-right: 10px;
    padding-left: 10px;
  }

  .pt-top {
    padding: 10px 32px;
  }

  .pt-body {
    padding: 28px 32px 44px;
  }

  .kpi .v {
    font-size: 36px;
  }
}

@media (max-width: 1100px) {
  .tbl th,
  .tbl td {
    padding-right: 14px;
  }

  .tbl th:last-child,
  .tbl td:last-child {
    padding-right: 0;
  }

  /* The wide tables drop their least needed columns, as the portal's do; the one that matters
     most of them shows as a second line instead (.narrow-sub). By position, so each table keeps
     its columns in the order written here:
     - work orders: Due and Updated;
     - tickets (number, subject, client, priority, status, assignee, SLA): Client and Assignee,
       the client then under the subject ("For <client>"), and the SLA kept;
     - clients: Country and Updated;
     - quotes (number, title, client, total, status, valid until, owner): Valid until and Owner;
     - billing records (number, books number, client, project, total, balance, status, issue
       date, due date): Books number, Project and Issue date;
     - leads (title, client or company, stage, value, owner, follow-up, source): Owner and
       Source. */
  .tbl-orders :is(th, td):is(:nth-child(5), :nth-child(7)),
  .tbl-tickets :is(th, td):is(:nth-child(3), :nth-child(6)),
  .tbl-clients :is(th, td):is(:nth-child(4), :nth-child(6)),
  .tbl-quotes :is(th, td):is(:nth-child(6), :nth-child(7)),
  .tbl-invoices :is(th, td):is(:nth-child(2), :nth-child(4), :nth-child(8)),
  .tbl-leads :is(th, td):is(:nth-child(5), :nth-child(7)) {
    display: none;
  }

  /* The column that is now the last one ends flush with the table (the tickets' SLA and the
     billing records' due date are last already). */
  .tbl-orders :is(th, td):nth-child(6),
  .tbl-clients :is(th, td):nth-child(5),
  .tbl-quotes :is(th, td):nth-child(5),
  .tbl-leads :is(th, td):nth-child(6) {
    padding-right: 0;
  }

  .tbl .narrow-sub {
    display: block;
  }

  .two,
  .two.side {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .ov {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 40px;
  }
}

@media (max-width: 959px) {
  /* The phone top bar takes its own height, and the page the rest: on a page shorter than the
     window, an auto row would stretch and leave a band under the top bar. */
  .pt {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "mtop" "main";
  }

  .pt-side {
    display: none;
  }

  .pt-mtop {
    display: flex;
  }

  /* Menu opens the sidebar over the page, with no script: <details> in the phone's top bar. */
  .pt:has(.pt-menu[open]) .pt-side {
    position: absolute;
    top: 64px;
    left: 12px;
    right: 12px;
    z-index: 30;
    display: flex;
    max-width: 340px;
    height: auto;
    border: 1px solid var(--hair);
    border-radius: var(--r3);
    box-shadow: 0 24px 48px -28px rgba(4, 48, 60, 0.45);
  }

  .pt:has(.pt-menu[open]) .pt-side > .pt-logo {
    display: none;
  }

  /* While the menu is open, the page under it leaves the focus order and the accessibility tree,
     so a keyboard never lands on a link the menu covers. Menu itself is in the phone's top bar,
     outside .pt-main, and stays there to close it. */
  .pt:has(.pt-menu[open]) .pt-main {
    visibility: hidden;
  }

  .pt-top {
    padding: 10px 24px;
  }

  .pt-body {
    padding: 24px 24px 40px;
  }

  /* Touch targets of 44 px on the tablet and phone layouts. */
  .btn-s,
  .chip,
  .pt-nav a,
  .inline-form > .sel,
  .inline-form > .inp,
  .card-move > .sel,
  .seg label,
  .opt,
  .dl,
  .cal-more {
    min-height: 44px;
  }

  .inline-form > .sel,
  .inline-form > .inp,
  .card-move > .sel,
  .bar .sel,
  .lines .inp,
  .lines .sel,
  .pt-search {
    height: 44px;
  }

  .lines .ta {
    min-height: 44px;
  }

  .pt-bell,
  .icon-btn {
    width: 44px;
    height: 44px;
  }

  /* An option's words and description take the tap with its control: 44 px at least. */
  .opt {
    padding: 10px 0;
  }

  .file-up input[type="file"]::file-selector-button {
    min-height: 44px;
  }

  /* The search field fills its box's whole height, borders included, so all 44 px take a tap. */
  .pt-search input {
    height: calc(100% + 2px);
    margin: -1px 0;
  }

  .crumb a,
  .al-act .tlink,
  .acts .tlink,
  .bar .tlink,
  .inline-form .tlink,
  .lead-s .tlink,
  .empty-act .tlink,
  .si-role a,
  .pt-out button,
  .col-more a,
  .doc-bar .tlink {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* Links inside a line of facts, a table cell or a list row: 44 px tall to a tap, without moving
     the text around them (the padding is taken back by the margin). */
  .kv dd a,
  .tbl td a:not(.row),
  .ls-link {
    display: inline-block;
    padding: 12px 0;
    margin: -12px 0;
  }
}

@media (max-width: 820px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 0;
  }

  .kpis .kpi {
    padding: 16px 16px 18px 0;
    border-left: 0;
    border-bottom: 1px solid var(--hair);
  }

  .kpis .kpi:nth-child(even) {
    padding-left: 20px;
    border-left: 1px solid var(--hair);
  }

  .tw .tbl {
    min-width: 620px;
  }

  .ov {
    display: block;
  }

  .ov > section + section {
    margin-top: 36px;
  }

  /* Each line a block of labelled fields: the description across, then the quantity and the unit,
     the unit price and the SAC, two to a row. The headings go; each field's own label shows. */
  .lines,
  .lines tbody,
  .lines tr,
  .lines td {
    display: block;
  }

  .lines thead {
    display: none;
  }

  .lines tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    padding: 16px 0 18px;
    border-bottom: 1px solid var(--hair);
  }

  .lines td,
  .lines tbody th,
  .lines .n {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .lines td:has([name$="_description"]) {
    grid-column: 1 / -1;
  }

  /* A cell with no field (the line's number) heads its block; Remove ends it. */
  .lines td:not(:has(input, select, textarea, button)),
  .lines tbody th,
  .lines td:has(.lines-rm) {
    grid-column: 1 / -1;
  }

  .lines td:not(:has(input, select, textarea, button)),
  .lines tbody th {
    color: var(--slate);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
  }

  .lines .n .inp {
    text-align: left;
  }

  .lines .lines-l {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 6px;
    overflow: visible;
    clip: auto;
    clip-path: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .pt-top {
    min-height: 56px;
    padding: 8px 16px;
  }

  /* The top bar's control stretches across it, as the portal's site picker does on a phone. */
  .pt-search {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
  }

  .pt-tz {
    flex: none;
    font-size: 13px;
  }

  /* A phone has no keyboard to press it on, and the field needs the room. */
  .pt-kbd {
    display: none;
  }

  .pt-body {
    padding: 22px 16px 32px;
  }

  .pg-h h1,
  .msg h1 {
    font-size: 28px;
  }

  .kpi .v {
    font-size: 30px;
  }

  .ls li {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    row-gap: 2px;
  }

  .si {
    min-height: 100dvh;
    padding: 18px 16px;
  }

  .si-form h1,
  .si .msg h1 {
    font-size: 30px;
  }

  .si-mid {
    padding: 36px 0;
  }

  .bar .grow {
    flex-basis: 100%;
    max-width: none;
  }

  .tbl {
    font-size: 14px;
  }

  /* A board's columns stack, each a section under its head, as the portal's grouped board: the
     cards are rows, the Move control is the way to move one (the script leaves dragging off), and
     nothing scrolls sideways. */
  .board {
    display: block;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .col {
    margin-top: 28px;
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .col-h {
    padding: 0 0 8px;
    border-bottom: 1px solid var(--hair);
  }

  .cards {
    gap: 0;
    min-height: 0;
  }

  .card {
    padding: 14px 0 16px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: none;
  }

  .card:target {
    padding-left: 12px;
    box-shadow: inset 3px 0 0 var(--ink);
  }

  .card-grip {
    display: none;
  }

  .col-more {
    margin-top: 12px;
    padding: 0;
  }

  /* The calendar's grid gives way to its list of days, which is then the calendar. */
  .cal {
    display: none;
  }

  .cal-days > li {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A document on a phone: the head in one column, the sheet closer to its edge. */
  .docw {
    padding: 16px 16px 32px;
  }

  .doc {
    padding: 22px 18px 24px;
    border-radius: var(--r2);
  }

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

  .doc-head > :is(h1, h2) {
    font-size: 24px;
  }

  .doc-from {
    grid-row: auto;
  }

  .doc-from ~ :is(h1, h2) {
    grid-column: 1;
    text-align: left;
  }

  .doc-from ~ .doc-meta {
    grid-column: 1;
    justify-content: start;
  }

  /* The lines keep room for their words and scroll in their .tw (never the page, never in
     print, where the page is wider than this). */
  .tw > .doc-lines {
    min-width: 560px;
  }

  /* A file's actions go under its name. */
  .file {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .file > .acts {
    grid-column: 2;
    justify-content: flex-start;
  }

  dialog.pal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    margin-top: 12px;
  }

  /* 16 px in fields, so a phone does not zoom in on them. */
  .inp,
  .sel,
  .ta,
  .fld > .sel,
  .inline-form > .sel,
  .inline-form > .inp,
  .card-move > .sel,
  .lines .inp,
  .lines .sel,
  .lines .ta,
  .affix input,
  .file-up input[type="file"],
  .pt-search input {
    font-size: 16px;
  }
}

/* No motion when it is asked for: the page jumps, nothing slides, fades or turns. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion wins over every component's own motion */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion wins over every component's own motion */
    transition: none !important;
  }
}

/* Print, for documents: A4 with 16 mm margins, black on white. The content is then about 673 px
   wide, so the rules for 1100, 959 and 820 px apply too; a document's lines fit that width with
   every column (COMPONENTS.md; M1's end-to-end spec checks it). */
@page {
  size: A4;
  margin: 16mm;
}

@media print {
  /* Everything that is the app rather than the document goes: the shell, the page's actions,
     buttons, forms, the files panel, the document's status, whatever is marked no-print. */
  /* biome-ignore-start lint/complexity/noImportantStyles: print hides these whatever display their component gives them */
  .skip,
  .pt-mtop,
  .pt-side,
  .pt-top,
  .crumb,
  .pg-act,
  .chips,
  .tabs,
  .pager,
  .ra,
  button,
  .btn,
  form,
  dialog,
  section.files,
  .no-print,
  .doc-stamp {
    display: none !important;
  }
  /* biome-ignore-end lint/complexity/noImportantStyles: print */

  html,
  body {
    background: #fff;
    color: var(--ink);
  }

  /* The shell is one block: no sidebar column, no padding round the page. */
  .pt,
  .pt-main,
  .two,
  .two.side {
    display: block;
    min-height: 0;
  }

  .two > * + * {
    margin-top: 28px;
  }

  .pt-body,
  .docw {
    max-width: none;
    padding: 0;
  }

  .doc {
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  /* Without its mist, the note keeps a rule round it. */
  .doc-note {
    border: 1px solid var(--ink);
    background: none;
  }

  .doc-lines td {
    border-bottom-color: var(--edge);
  }

  /* A scroller would cut what it holds at the end of the first page. */
  .tw,
  .board {
    overflow: visible;
  }

  thead {
    display: table-header-group;
  }

  /* A line never breaks across two pages; nor do the head, the totals and the notes. */
  tr,
  .doc-head,
  .doc-to,
  .doc-tots,
  .doc-note,
  .doc-foot > * {
    break-inside: avoid;
  }
}
