/*
 * Copyright (c) KINAV GmbH
 * SPDX-License-Identifier: LicenseRef-Proprietary
 */

/*
 * The look of the licence portal, which is the window's. Its colours, corners, gaps and type
 * are the values of the window's tokens in ui/src/tokens.css, written here again: the service
 * builds nothing of the window. A colour has the name of its token, and a token that is the
 * `var()` of another the other's, as `ring` is the fill of `primary`. The page is the frame,
 * with the glow in its top-left corner. The logo stands on it, and on a signed-in page the
 * address with Sign out; the page is on a panel that fills the rest of the window, as a panel
 * of the window does, with Sign out on all devices at its foot. A page that says or asks one
 * thing is a card on the panel, as a dialog stands in the window, and a question over a page is
 * such a card over it. The system's preference picks the light set or the dark one.
 */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("jetbrains-mono.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --frame: #e6e8ed;
  --glow: #fbddd5;
  --background: #fcfcfd;
  --popover: #ffffff;
  --foreground: #1f2228;
  --link: #2457c5;
  --input: #777b86;
  --ring: #2f66d8;
  --primary-foreground: #ffffff;
  --primary-hover: #2a5cc2;
  --destructive: #ad1a4c;
  --destructive-hover: #9c1744;
  --chip: #dde0e7;
  --chip-focus: #cfdefb;
  --hover: #f0f1f5;
  --secondary-hover: #c7cad0;
  --muted-foreground: #585c66;
  --border: #dadde3;
  --warning: #855400;
  --added: #1a6b34;
  --commercial: #6a3fd6;
  --commercial-foreground: #ffffff;
  --non-profit: #0b7a54;
  --non-profit-foreground: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --frame: #2a2c32;
    --glow: #48322c;
    --background: #1b1c20;
    --popover: #24262c;
    --foreground: #cdd0d7;
    --link: #86abfa;
    --input: #858a95;
    --ring: #5f8ff0;
    --primary-foreground: #1b1c20;
    --primary-hover: #699dff;
    --destructive: #f28b8b;
    --destructive-hover: #ff9999;
    --chip: #373a42;
    --chip-focus: #203a6b;
    --hover: #24262b;
    --secondary-hover: #454852;
    --muted-foreground: #a4a8b1;
    --border: #383b42;
    --warning: #f0b840;
    --added: #7fd69a;
    --commercial: #a98bff;
    --commercial-foreground: #16121f;
    --non-profit: #3ddc9a;
    --non-profit-foreground: #0d1f17;
  }
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0 6px 6px;
  background: radial-gradient(75% 95% at 0% 0%, var(--glow) 0%, 30%, transparent 75%) var(--frame);
  color: var(--foreground);
  font: 13px / 20px "Inter Variable", system-ui, -webkit-system-font, sans-serif;
  /* A name and an address are drawn as written: no two letters become one sign. */
  font-variant-ligatures: none;
}

/* The top of the frame: the logo, and on a signed-in page the address and Sign out. */
.top {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  min-height: 48px;
  padding: 10px 6px;
}

.logo {
  display: block;
  height: 20px;
}

/* The link of the logo has the room of the ring inside it, which its margin takes back. */
.top > a:has(.logo) {
  display: block;
  margin: -3px;
  padding: 3px;
  border-radius: 4px;
}

/* The address signed in, from outside: one line, cut with an ellipsis where it has no room. */
.who {
  min-width: 0;
  margin: 0 0 0 auto;
  overflow: hidden;
  color: var(--muted-foreground);
  font: 12px / 20px "JetBrains Mono Variable", ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top form {
  flex: none;
}

/* On a signed-out page, the way to the website, quiet, at the right. */
.top .site {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted-foreground);
  font-size: 12px;
  text-decoration: none;
}

.top .site:hover {
  color: var(--foreground);
}

.top .site .i {
  width: 12px;
  height: 12px;
}

.panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px 16px;
  border-radius: 10px;
  background: var(--background);
}

.panel > :not(.ask, .foot) {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* The foot of a signed-in page, at the bottom of the panel: Sign out on all devices. */
.foot {
  display: flex;
  width: 100%;
  max-width: 720px;
  margin: auto auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.foot form {
  margin-left: auto;
}

h1 {
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

/* The ring of the keyboard: a line just inside the edge of what it is on, as in the window. */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

/* An address, which is text from outside: it breaks anywhere rather than run out of its place. */
strong {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.mono {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  overflow-wrap: anywhere;
}

/* An icon of Lucide, drawn in the colour of its text. */
.i {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A button, and a link that leads on in a button's look: the main action in the fill of
 * `primary`, a quiet one as a chip, and the one at the foot as a link. */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--ring);
  color: var(--primary-foreground);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
}

.second,
li button {
  background: var(--chip);
  color: var(--foreground);
  font-weight: 500;
}

.second:hover,
li button:hover {
  background: var(--secondary-hover);
}

/* Take back and Replace the key, which end a key: the look of what discards work. */
form[action*="/take-back/"] button,
form[action*="/replace"] button {
  background: var(--destructive);
}

form[action*="/take-back/"] button:hover,
form[action*="/replace"] button:hover {
  background: var(--destructive-hover);
}

/* The ring cannot stand 3:1 against the fill of the main action, of what discards work, or of a
 * quiet button under the pointer: under the keyboard, a line of `primary-foreground` lies inside
 * it, the ring on its outer half. */
button:not(.second, li button, .plain, .rowmenu):focus-visible,
.btn:not(.second, .plain):focus-visible,
.second:hover:focus-visible,
li button:hover:focus-visible {
  box-shadow: inset 0 0 0 4px var(--primary-foreground);
}

.plain,
.plain:hover {
  height: auto;
  margin: -3px;
  padding: 3px;
  border-radius: 2px;
  background: none;
  color: var(--link);
  font-weight: 400;
  text-decoration: underline;
}

/* A form: a field a label over its input, one under the other, and its button. */
.panel form,
.layer form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.panel .stack,
.layer .stack {
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: stretch;
}

.full {
  align-self: stretch;
}

label {
  font-weight: 500;
}

input {
  align-self: stretch;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
}

input[aria-invalid="true"] {
  border-color: var(--destructive);
}

/* A field keeps its edge, invalid or not: the ring lies just inside it. */
input:not([type="radio"], [type="checkbox"]):focus-visible {
  outline-offset: -3px;
}

/* What stands in the way of a form, over its fields, in the warm hue of the glow. */
.note {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--glow) 45%, var(--background));
  overflow-wrap: anywhere;
}

.note .i {
  margin-top: 3px;
  color: var(--warning);
}

/* A page that says or asks one thing: a card on the panel, as a dialog stands in the window,
 * with its sign, its heading, its words and its buttons. */
.ask {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 32px auto 0;
  padding: 16px;
  border-radius: 10px;
  background: var(--popover);
  box-shadow:
    0 1px 3px #1f22281f,
    0 8px 24px -4px #1f222833;
}

.ask h1,
.ask p {
  margin: 0;
  overflow-wrap: anywhere;
}

.ask .acts,
.bar .acts {
  display: flex;
  align-self: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  margin-top: 4px;
}

.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--chip-focus);
  color: var(--link);
}

.mark .i {
  width: 18px;
  height: 18px;
}

.mark.care {
  background: color-mix(in srgb, var(--glow) 45%, var(--background));
  color: var(--warning);
}

@media (prefers-color-scheme: dark) {
  .ask {
    box-shadow:
      0 1px 3px #00000066,
      0 8px 24px -4px #00000099;
  }
}

/* The cards of the way to sign in: a little larger, in the middle of the panel, the claw over
 * the heading of the first, and the button that mails a link across the card. A card taller than
 * the panel starts at its top. */
.signin {
  gap: 14px;
  max-width: 400px;
  margin: auto;
  padding: 24px;
  border-radius: 12px;
}

/* A panel that holds a sign-in card has as much room under the card as over it. */
.panel:has(> .signin) {
  padding-bottom: 28px;
}

.signin h1 {
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.01em;
}

.signin .for,
.signin .quiet {
  color: var(--muted-foreground);
}

.signin .for {
  margin-top: -8px;
}

.signin .stack {
  gap: 10px;
}

.signin .full {
  height: 34px;
  font-size: 14px;
}

.ask.signin .acts {
  justify-content: flex-start;
}

.claw {
  display: block;
  width: 52px;
  height: 36px;
}

@media (prefers-color-scheme: dark) {
  .signin {
    box-shadow:
      0 0 0 1px var(--border),
      0 8px 24px -4px #00000099;
  }
}

/* A phone's width: the panel keeps its words close to its edges, and a card other than a sign-in
 * one close to the top. */
@media (max-width: 600px) {
  .panel {
    padding: 20px 14px 12px;
  }

  .ask:not(.signin) {
    margin-top: 8px;
  }

  .panel:has(> .signin) {
    padding-bottom: 20px;
  }

  .signin {
    padding: 18px 16px;
  }
}

/* A question over the page it was asked from, as a dialog stands over the window: the page
 * rests under a shade, both fixed to the browser's window, and the card holds its lines, a table
 * on a wide one, and its buttons in a row at its end. */
.layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 88px 12px 12px;
  overflow: auto;
}

.shade {
  position: fixed;
  inset: 0;
  background: #1f222852;
  cursor: default;
}

.layer .ask {
  position: relative;
  margin: 0;
}

.layer .wide {
  max-width: 560px;
}

/* The facts of a question, as what Add seats charges, each name beside its value. */
.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 24px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--hover);
}

.facts dt {
  color: var(--muted-foreground);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The question of Give: under its form, the way to the manager's own seat, after a quiet "or". */
.ask .or {
  margin-top: -4px;
  color: var(--muted-foreground);
  text-align: center;
}

.ask .or + form {
  align-items: center;
}

/* The first button of a form that Enter must not send: a browser presses it for Enter in a box
 * of the form. It is not seen, not reached by Tab and not read out. */
.unseen {
  position: absolute;
  visibility: hidden;
}

.layer ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer li {
  padding: 0;
  border: 0;
}

.layer ul.hint {
  gap: 4px;
}

.layer legend {
  margin-bottom: 8px;
  color: var(--foreground);
  font-weight: 600;
}

td > label:has(input[type="checkbox"]) {
  margin-top: 0;
}

/* A word on a computer to mark wraps in the room the card leaves it. */
.layer td.end {
  width: auto;
  white-space: normal;
}

@media (prefers-color-scheme: dark) {
  .shade {
    background: #00000085;
  }
}

@media (max-width: 600px) {
  .layer {
    padding-top: 56px;
  }
}

/* A list of licences or keys: a line a name, then what it is, quieter, between rules. */
h2 {
  margin: 20px 0 0;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

li:first-child {
  border-top: 0;
}

li p {
  margin: 0;
}

li p + p {
  color: var(--muted-foreground);
}

li a {
  font-weight: 500;
}

/* A name from outside breaks anywhere rather than run out of its place. */
h1,
li {
  overflow-wrap: anywhere;
}

/* A short id or a code, which reads as written in the window's fixed-width type, and whole: a
 * code as K7Q-F29 does not break at its dash. */
code {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  white-space: nowrap;
}

/* A set of choices, as the licences to pick from on the page of a ticket, and the radio or box
 * of each, beside its label. */
fieldset {
  align-self: stretch;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  color: var(--muted-foreground);
  font-weight: 500;
}

input[type="radio"],
input[type="checkbox"] {
  align-self: start;
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--ring);
}

/* A box is drawn here, as the window draws one, so that the ring of the keyboard shows on it
 * ticked or not: ticked, it is filled with the ring's colour, and Lucide's check, which follows
 * it, stands over it. Under the keyboard a line of `primary-foreground` lies inside the ring, and
 * the check is small enough to leave a pixel of the fill around it. */
input[type="checkbox"] {
  appearance: none;
  border-radius: 4px;
  background: transparent;
}

input[type="checkbox"]:checked {
  border-color: var(--ring);
  background: var(--ring);
}

input[type="checkbox"]:checked:focus-visible {
  box-shadow: inset 0 0 0 3px var(--primary-foreground);
}

.tick {
  display: none;
  position: absolute;
  grid-area: 1 / 1;
  width: 12px;
  height: 12px;
  margin: 4px 0 0 1px;
  fill: none;
  stroke: var(--primary-foreground);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

input[type="checkbox"]:checked + .tick {
  display: block;
}

input[type="checkbox"]:checked:focus-visible + .tick {
  width: 4.5px;
  height: 4.5px;
  margin: 7.75px 0 0 4.75px;
  stroke-width: 5.33;
}

/* A radio is drawn here too: picked, it is filled with the ring's colour around a dot of
 * `primary-foreground`. Under the keyboard a line of that colour lies inside the ring, and the dot
 * is small enough to leave a pixel of the fill around it. */
input[type="radio"] {
  appearance: none;
  border-radius: 50%;
  background: transparent;
}

input[type="radio"]:checked {
  border-color: var(--ring);
  background: radial-gradient(circle, var(--primary-foreground) 2.5px, var(--ring) 3px);
}

input[type="radio"]:checked:focus-visible {
  box-shadow: inset 0 0 0 3px var(--primary-foreground);
  background: radial-gradient(circle, var(--primary-foreground) 2px, var(--ring) 2.5px);
}

li label span {
  display: block;
}

li label span + span {
  color: var(--muted-foreground);
  font-weight: 400;
}

/* The page of a ticket: the computer's name and the code in the band, the code large, to compare
 * at a glance; the licences to pick from, a radio each beside its name with the badge of its kind,
 * and under it, quieter, its seat, its key's short id and its state, so that two licences of one
 * name read apart, with Renew under one that ended; and Put, whose name from outside breaks anywhere rather than run out. */
.band code.big {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.pick li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  padding: 10px 0;
}

.pick li > :not(input) {
  grid-column: 2;
}

.pick label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  overflow-wrap: anywhere;
}

.pick label .here {
  margin: 0;
  color: inherit;
  font-weight: inherit;
}

.pick .line {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: var(--muted-foreground);
}

.pick .note,
.pick li > .acts {
  margin-top: 4px;
}

.note .acts {
  margin-top: 8px;
}

form.sec {
  align-items: stretch;
  gap: 8px;
}

form.sec > .acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}

button.wrap {
  height: auto;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 10px;
  overflow-wrap: anywhere;
  text-align: start;
  white-space: normal;
}

.sec > .way {
  max-width: 440px;
  overflow-wrap: anywhere;
}

/* The licence terms, the tick and Take the seat in the box of a seat that waits. */
.way > section {
  align-self: stretch;
  margin-top: 6px;
}

/* The tick that agrees to the licence terms, on the pages of a non-profit licence, a licence and a
 * ticket: a box beside its words, which name licences from outside and so break anywhere rather
 * than run out of the form. */
label:has(input[type="checkbox"]) {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  margin-top: 6px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* The licence terms, in a box of their own that scrolls, as the window shows them: their title,
 * the headings of their sections and their lists in the type of the page. */
article {
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

article h2 {
  margin: 0;
  color: inherit;
  font-weight: 600;
}

article h3 {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 600;
}

article p {
  margin: 4px 0 0;
}

/* A word that the terms set apart, which their file writes in bold. */
article em {
  font-style: normal;
  font-weight: 600;
}

article ul {
  margin-top: 4px;
  padding-left: 20px;
  list-style: disc;
}

article li {
  padding: 0;
  border: 0;
}

/* How many seats to add to a licence: a few digits, in a field as narrow. */
input[type="number"] {
  align-self: flex-start;
  width: 96px;
}

/* The page of an address with no licence: its heading, a line under it, and the two ways to a
 * licence side by side, each a box with the badge of its kind, one under the other at a phone's
 * width. What a page tells, with nothing in the way, is a note in the hue of a chip that has the
 * keyboard, with its buttons under its words. */
.col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.col h1,
.col p {
  margin: 0;
}

.col .under {
  margin-top: 6px;
  color: var(--muted-foreground);
}

.ways {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.way {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.way > h3 {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.way > p {
  flex: 1;
  color: var(--muted-foreground);
}

.way .btn {
  margin-top: 6px;
}

.kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 8px 0 6px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.kind .i {
  width: 12px;
  height: 12px;
  stroke-width: 2.25;
}

.kind.com {
  background: var(--commercial);
  color: var(--commercial-foreground);
}

.kind.np {
  background: var(--non-profit);
  color: var(--non-profit-foreground);
}

.note.info,
.note.computer {
  background: var(--chip-focus);
}

.note.info .i,
.note.computer .i {
  color: inherit;
}

.note p {
  margin: 0;
}

.note form {
  margin-top: 8px;
}

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

/* The page of a licence: its name with the badge of its kind, then the band of its facts side by
 * side between rules, each a label over its value, the status with a dot of its colour: one
 * under the other at a phone's width. */
.head .title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 0;
  padding: 12px 0;
  border-block: 1px solid var(--border);
}

.band > div {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid var(--border);
}

.band > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.band .l,
.band .more {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.band .v {
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.band .btn,
.band form {
  align-self: flex-start;
  margin-top: 6px;
}

.state {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.state i.dot {
  align-self: center;
}

.state.care {
  color: var(--warning);
}

.state.over {
  color: var(--muted-foreground);
}

.hint {
  color: var(--muted-foreground);
}

/* The person's seat: its heading with how many computers are in use and Replace key, a line of
 * its facts, and its computers in a table, those out of use quieter. At a phone's width each
 * computer is a block, its name a line of its own and each day named. */
.sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sechead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 28px;
}

.sechead h2,
.bar h2,
.side h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sechead .count {
  color: var(--link);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.sechead .btn {
  height: 24px;
}

.seatfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  color: var(--muted-foreground);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 4px 10px 4px 0;
  box-shadow: inset 0 -1px var(--border);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  text-align: start;
  white-space: nowrap;
}

td {
  padding: 6px 10px 6px 0;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:first-child td {
  border-top: 0;
}

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

td.name {
  min-width: 120px;
  overflow-wrap: anywhere;
}

td.day {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.end {
  width: 1%;
  text-align: end;
  white-space: nowrap;
}

tr.off td {
  color: var(--muted-foreground);
}

/* The seats of a team's licence: the bar over them with their heading, the search by address and
 * Give a seat; then the people, each address with when its seat was given under it, the headings
 * that sort them, and the menu of each row, which opens under its button with no script. At a
 * phone's width the menu stays at the top right of its person. */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bar h2 {
  margin-right: 8px;
}

.bar .acts {
  align-self: auto;
  align-items: center;
  margin: 0 0 0 auto;
}

.panel form.search {
  display: block;
}

.search label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(280px, 100%);
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--input);
  border-radius: 6px;
  background: var(--background);
  color: var(--muted-foreground);
}

.search label:focus-within {
  outline: 2px solid var(--ring);
  outline-offset: -3px;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--foreground);
}

a.sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: -3px;
  padding: 3px;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
}

a.sort .i {
  width: 12px;
  height: 12px;
  opacity: 0.55;
}

a.sort.on,
a.sort:hover {
  color: var(--foreground);
}

a.sort.on .i {
  opacity: 1;
}

table.people td.name {
  width: 46%;
}

td.name .mono {
  font-size: 12px;
}

td .sub {
  display: block;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

td.num {
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.band .v .care {
  color: var(--warning);
}

div.empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

/* The menu of a row of the seats: a popover of its button, under it at its right edge where the
 * browser places a popover by its button, and in the middle of the window where it does not. */
button.rowmenu {
  width: 28px;
  height: 24px;
  padding: 0;
  background: none;
  color: var(--muted-foreground);
  font-weight: 400;
}

.menu:popover-open + button.rowmenu,
button.rowmenu:hover {
  background: var(--chip);
  color: var(--foreground);
}

/* A press is the button's, not its icon's: WebKit goes on with Tab from what was pressed, and
 * from the icon it passes the open menu by. */
button.rowmenu .i {
  pointer-events: none;
}

.menu[popover] {
  flex-direction: column;
  min-width: 150px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--popover);
  color: var(--foreground);
  box-shadow:
    0 1px 3px #1f22281f,
    0 8px 24px -4px #1f222833;
  text-align: start;
}

.menu:popover-open {
  display: flex;
}

/* Only while open: anchored popovers in the page, though closed, move WebKit's scroll to a
 * fragment as the page loads. */
@supports (position-area: bottom) {
  .menu:popover-open {
    inset: auto;
    margin: 4px 0;
    position-area: bottom span-left;
    position-try-fallbacks: flip-block;
  }
}

.menu[popover] a {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
}

.menu[popover] a.danger {
  color: var(--destructive);
}

.menu[popover] a:hover {
  background: var(--chip);
}

@media (prefers-color-scheme: dark) {
  .menu[popover] {
    box-shadow:
      0 0 0 1px var(--border),
      0 8px 24px -4px #000000a0;
  }
}

.here {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--chip-focus);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

.empty {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--hover);
  color: var(--muted-foreground);
}

@media (max-width: 600px) {
  .band > div {
    flex-basis: 100%;
    padding: 0;
    border-left: 0;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
  }

  tbody tr:first-child {
    border-top: 0;
  }

  td {
    padding: 0;
    border: 0;
  }

  td.name {
    flex: 1 0 100%;
    font-weight: 500;
  }

  td[data-l]::before {
    content: attr(data-l) " ";
    color: var(--muted-foreground);
  }

  td.day {
    color: var(--muted-foreground);
  }

  td.end {
    flex: 1 0 100%;
    padding-top: 4px;
    text-align: start;
  }

  table.people tr {
    position: relative;
  }

  table.people td.name {
    padding-right: 40px;
  }

  table.people td.end {
    position: absolute;
    top: 6px;
    right: 0;
    width: auto;
    padding-top: 0;
  }
}

/* The column of licences left of the panel of a signed-in page, as the window's left panel stands
 * beside its graph: each licence a row with the dot of its status, its name and the line under it,
 * one line each, the page's own marked; then the ways to another licence. Narrower than a small
 * window it is a strip over the panel, without its heading, and gone while it lists none. */
.split {
  display: grid;
  flex: 1;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 6px;
}

.split .panel {
  padding: 24px 28px 16px;
}

.split .panel > :not(.ask, .foot),
.split .foot {
  max-width: 780px;
  margin-inline: 0;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-content: start;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--background);
}

.sechead h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.side h2 {
  padding: 10px 8px 4px;
  overflow-wrap: anywhere;
}

.side a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.side a > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.side a > span > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side a > span > span + span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.side a.on {
  background: var(--chip-focus);
}

.side a:hover:not(.on) {
  background: var(--hover);
}

.side .none {
  padding: 5px 8px;
  color: var(--muted-foreground);
}

/* The dot of a licence's status, in the band of its page and in the column. */
i.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--input);
}

i.dot.good {
  background: var(--added);
}

i.dot.care {
  background: var(--warning);
}

.side i.dot {
  margin-top: 6px;
}

.side .adds {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.side a.add {
  align-items: center;
  color: var(--muted-foreground);
}

.side a.add > span {
  display: block;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .split {
    grid-template-rows: auto 1fr;
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding: 6px;
  }

  .side h2 {
    display: none;
  }

  .side a,
  .side .none {
    flex: none;
    max-width: 240px;
  }

  .side .adds {
    flex: none;
    flex-direction: row;
    margin: 0 0 0 4px;
    padding: 0 0 0 8px;
    border-top: 0;
    border-left: 1px solid var(--border);
  }
}
