/* The client's Odoo connector — web UI.
 *
 * No framework, no CDN, no build step. Everyone who sees these pages is either
 * setting up an API key once or checking who read what; the pages must render
 * instantly on a slow office connection and look like the client, not like a
 * product. One file, loaded from our own origin.
 *
 * Brand colours are injected per client by base.html from client.toml:
 *   --brand  --brand-dark  --brand-tint  --brand-rgb  --accent
 * Everything below is neutral and must work with any hue those carry.
 */

:root {
  /* Fallbacks only — base.html overrides these for the live client. */
  --brand: #1f2a44;
  --brand-dark: #161d30;
  --brand-tint: #eceef2;
  --brand-rgb: 31, 42, 68;
  --accent: #6e6662;

  /* Neutrals lean warm. Most clients running this pair a cool primary with a
     warm secondary, and a warm paper keeps the primary from being the only
     colour in the room. */
  --paper: #fbfaf8;
  --sheet: #ffffff;
  --rule: #e4e1da;
  --rule-soft: #f0eee9;
  --ink: #1a1916;
  --ink-2: #57544d;
  --ink-3: #726f65;

  --ok: #1d6440;
  --ok-soft: #e9f1ec;
  --warn: #7d5310;
  --warn-soft: #f7f0e1;
  --bad: #94281e;
  --bad-soft: #f8e9e7;

  --r-block: 4px;
  --r-control: 6px;
  --measure: 68ch;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Data should line up in columns and never be misread. */
table, .mono, .num, time { font-variant-numeric: tabular-nums slashed-zero; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- type ---------------------------------------------------------------- */

h1 {
  font-size: 1.9375rem;
  line-height: 1.15;
  letter-spacing: -0.021em;
  font-weight: 600;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.011em;
  font-weight: 600;
  margin: 0 0 6px;
}

/* Deliberately not uppercase and not tracked out: a label that shouts is a
   label competing with the thing it labels. */
h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 10px;
}

p { margin: 0 0 12px; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede { color: var(--ink-2); font-size: 1.0625rem; margin: 0 0 26px; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 0.84375rem; line-height: 1.5; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* --- console shell ------------------------------------------------------- */

/* A white bar with a rule, not a slab of brand colour. The brand is worth more
   spent on the one button you are meant to press. */
.topbar {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 22px;
  height: 58px;
  padding: 0 26px;
}
.topbar img { height: 24px; display: block; }
.topbar .wordmark { color: var(--brand); }

.topbar nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  align-items: center;
}
.topbar nav a,
.topbar nav button {
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: var(--r-control);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.topbar nav a:hover,
.topbar nav button:hover { background: var(--rule-soft); color: var(--ink); }
.topbar nav a.active { color: var(--brand); background: var(--brand-tint); }
.topbar .who {
  color: var(--ink-3);
  font-size: 0.8125rem;
  padding-right: 6px;
  margin-left: 6px;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 40px 26px 80px; }
.wrap.wide { max-width: 1180px; }
.wrap.narrow { max-width: 560px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-head .lede { margin: 0; }

/* --- blocks -------------------------------------------------------------- */

/* Flat, ruled, barely rounded. No shadow anywhere: a stack of identically
   floating cards tells you nothing about what matters on the page. */
.block {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-block);
  padding: 24px 26px;
  margin-bottom: 18px;
}
.block:last-child { margin-bottom: 0; }
.block > h2 + p { color: var(--ink-2); margin-top: -2px; }

.block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.block-head > div { min-width: 0; }

.rule { height: 1px; background: var(--rule); border: 0; margin: 22px 0; }

/* --- the stage spine ----------------------------------------------------- */

/* The account page is a genuine two-step sequence: hold a key, then connect.
   Numbering is information here, not decoration — so it gets the one piece of
   structure that carries weight on the whole site. */
.stages { margin: 0 0 34px; padding: 0; list-style: none; counter-reset: stage; }

.stage {
  position: relative;
  padding: 0 0 26px 52px;
  counter-increment: stage;
}
.stage:last-child { padding-bottom: 0; }

/* The line joining one stage to the next. */
.stage::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -2px;
  width: 2px;
  background: var(--rule);
}
.stage:last-child::before { display: none; }

.stage__mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--sheet);
  color: var(--ink-3);
  font-size: 0.875rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.stage__mark::after { content: counter(stage); }

.stage--done > .stage__mark {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
/* A completed stage is a tick, not a number — the number is only useful while
   it is telling you where to go next. */
.stage--done > .stage__mark::after { content: "\2713"; font-size: 1rem; }
.stage--done::before { background: var(--brand); opacity: .28; }

.stage--now > .stage__mark { border-color: var(--brand); color: var(--brand); }

/* Waiting on an earlier stage: present, legible, clearly not yet your problem. */
.stage--wait > .stage__body { opacity: .62; }

.stage__body > h2 { margin-bottom: 2px; }
.stage__say { color: var(--ink-2); margin: 0 0 14px; }

/* Anything after the sequence keeps the same left edge as the stage bodies. */
.stages-tail { padding-left: 52px; }

/* --- people list ----------------------------------------------------------- */

/* Not a table. Managing someone opens a panel of forms, and a panel that has to
   live inside a table cell ends up absolutely positioned over its neighbours. */
.people { list-style: none; margin: 0; padding: 0; }

.people__head,
.person__main {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.5fr)
                         minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.people__head {
  font-size: 0.84375rem;
  color: var(--ink-3);
  font-weight: 600;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
}

.person { border-bottom: 1px solid var(--rule-soft); padding: 14px 0; }
.person:last-child { border-bottom: 0; padding-bottom: 0; }

.person__name { font-weight: 600; }
.person__email { display: block; }

.person__manage { margin-top: 12px; }
.person__panel {
  border: 1px solid var(--rule);
  border-radius: var(--r-block);
  background: var(--paper);
  padding: 20px 22px;
  margin-top: 4px;
  max-width: 560px;
}

/* One person on the overview who has stopped part-way, and the nudge for it. */
.stall {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.stall .person__email,
.stall .small { display: block; }

/* --- charts ---------------------------------------------------------------- */

/* Hand-drawn in CSS rather than pulled from a charting library: it is fourteen
   numbers, and the page's whole promise is that it loads instantly offline. */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 84px;
  margin-top: 18px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
}
.chart__col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
}
.chart__bar {
  background: var(--brand);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  opacity: .85;
}
/* A day with a refusal gets a mark under the axis, not a stacked segment --
   refusals are rare and would be invisible stacked against a busy day. */
.chart__bad {
  height: 3px;
  background: var(--bad);
  border-radius: 2px;
  flex: none;
  order: 1;
}
.chart__col:hover .chart__bar { opacity: 1; }

.chart__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

/* A ranked list where the bar is the comparison and the number is the detail. */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px auto;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  font-size: 0.875rem;
}
.bars__track {
  background: var(--rule-soft);
  border-radius: 2px;
  height: 6px;
  overflow: hidden;
}
.bars__fill {
  display: block;
  height: 100%;
  background: var(--brand);
  opacity: .7;
  border-radius: 2px;
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- status --------------------------------------------------------------- */

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: 0.78125rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--rule-soft);
  color: var(--ink-2);
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.brand { background: var(--brand-tint); color: var(--brand); }

/* An Odoo refusal is a sentence, not a label — it has to wrap. */
.err-note {
  display: block;
  color: var(--bad);
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-top: 3px;
}

.msg {
  padding: 12px 15px;
  border-radius: var(--r-block);
  border-left: 3px solid;
  margin-bottom: 20px;
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: var(--measure);
}
.msg:last-child { margin-bottom: 0; }
.msg.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.msg.err { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.msg.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.msg strong { font-weight: 600; }

/* --- forms ---------------------------------------------------------------- */

label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 5px; }
label.plain { font-weight: 400; }

.field { margin-bottom: 17px; max-width: 420px; }
.field .hint {
  font-weight: 400;
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 5px 0 0;
}

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  font: inherit;
  font-size: 0.96875rem;
  color: var(--ink);
  background: var(--sheet);
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .13);
}
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }

select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  padding: 10px 18px;
  border-radius: var(--r-control);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }

.btn.ghost { background: var(--sheet); color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--rule-soft); color: var(--ink); border-color: var(--ink-3); }

.btn.danger { background: var(--sheet); color: var(--bad); border-color: #e5cbc7; }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

.btn.small { padding: 6px 12px; font-size: 0.84375rem; font-weight: 500; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.choice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  padding: 13px 15px;
  margin-bottom: 9px;
  cursor: pointer;
  font-weight: 400;
  transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--ink-3); }
.choice input { margin-top: 4px; flex: none; }
.choice.selected { border-color: var(--brand); background: var(--brand-tint); }
.choice .t { font-weight: 600; display: block; }
.choice .d { color: var(--ink-2); font-size: 0.84375rem; }

.check {
  display: flex;
  gap: 9px;
  align-items: center;
  font-weight: 400;
  font-size: 0.9375rem;
  margin: 6px 0;
  cursor: pointer;
}
.check input { flex: none; }

/* --- gate pages (sign in, set password, consent, errors) ------------------ */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px 56px;
}
.gate__inner { width: 100%; max-width: 432px; }

.gate__mark { margin-bottom: 26px; }
.gate__mark img { height: 30px; display: block; }
.gate__mark .wordmark { color: var(--brand); font-size: 1.25rem; }

/* The first thing a person reads here is why they were sent, so it is set as
   text rather than wrapped in a coloured header bar. */
.gate__say {
  font-size: 1.5rem;
  line-height: 1.28;
  letter-spacing: -0.017em;
  font-weight: 600;
  margin: 0 0 8px;
}
.gate__sub { color: var(--ink-2); margin: 0 0 26px; }

.gate__sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-block);
  padding: 26px 28px;
}
.gate__foot {
  margin: 20px 0 0;
  font-size: 0.84375rem;
  line-height: 1.55;
  color: var(--ink-3);
}
.gate__foot a { color: var(--ink-2); }

.wordmark { font-weight: 600; letter-spacing: -0.015em; }

/* --- steps ---------------------------------------------------------------- */

ol.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 11px 26px;
  max-width: var(--measure);
}
ol.steps li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
ol.steps li:last-child { padding-bottom: 0; }

/* --- copy field ----------------------------------------------------------- */

.copy { display: flex; gap: 8px; align-items: stretch; max-width: 100%; }
.copy input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84375rem;
  background: var(--paper);
}
.copy button { flex: none; }

/* --- tables --------------------------------------------------------------- */

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

table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th {
  text-align: left;
  font-size: 0.84375rem;
  color: var(--ink-3);
  font-weight: 600;
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }

.nowrap { white-space: nowrap; }

/* --- layout helpers ------------------------------------------------------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.split > * { min-width: 0; }

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

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

/* --- disclosure ----------------------------------------------------------- */

details.more > summary {
  list-style: none;
  cursor: pointer;
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-block;
  padding: 2px 0;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: "\203A";
  display: inline-block;
  width: 14px;
  color: var(--ink-3);
}
details.more[open] > summary::before { content: "\2039"; }
details.more[open] > summary { margin-bottom: 14px; }

/* --- the one moment of motion --------------------------------------------- */

/* Testing a key is the only point on these pages where you are waiting to find
   out whether something worked. The answer arriving is worth showing. */
.result:not(:empty) { margin-top: 14px; animation: settle .22s ease-out; }

@keyframes settle {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* --- narrow --------------------------------------------------------------- */

@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 1.6875rem; }

  .split { grid-template-columns: 1fr; gap: 20px; }
  .wrap { padding: 28px 18px 60px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .who { display: none; }
  .topbar nav a, .topbar nav button { padding: 6px 8px; }

  .page-head { flex-direction: column; gap: 14px; }

  .block { padding: 20px 18px; }
  .stage { padding-left: 42px; }
  .stage__mark { width: 28px; height: 28px; }
  .stage::before { left: 13px; top: 30px; }

  .copy { flex-direction: column; }
  .copy button { width: 100%; }

  /* Rows become records. A table scrolled sideways on a phone is unreadable,
     and these tables are read far more often than they are scanned. */
  table.rows, table.rows tbody, table.rows tr, table.rows td { display: block; }
  table.rows thead { display: none; }
  table.rows tr {
    border-bottom: 1px solid var(--rule);
    padding: 14px 0;
  }
  table.rows tr:last-child { border-bottom: 0; }
  table.rows td { border: 0; padding: 2px 0; }
  table.rows td:empty { display: none; }
  table.rows td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--ink-3);
    font-size: 0.8125rem;
  }
  table.rows td.actions { text-align: left; padding-top: 10px; white-space: normal; }

  .people__head { display: none; }
  .stall { flex-direction: column; gap: 10px; }
  .bars li { grid-template-columns: minmax(0, 1fr) 54px auto; }
  .person__main { grid-template-columns: 1fr; gap: 6px; }
  .person__panel { padding: 16px 16px; }
  .stages-tail { padding-left: 0; }
}

/* --- access picker ------------------------------------------------------
   One fieldset per Odoo system: the three levels, then the model scope that
   only applies to the third. Reuses .choice's shape for the levels so the
   invite form reads as one control, not two unrelated ones. */

.access {
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  padding: 14px 16px 4px;
  margin: 0 0 12px;
}
.access legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 0.9375rem;
}
.access legend .small { font-weight: 400; margin-left: 8px; }

.access__levels { display: flex; flex-direction: column; gap: 0; }
.access__level {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 4px;
  cursor: pointer;
  font-weight: 400;
}
.access__level input { margin-top: 3px; flex: none; }
.access__level .t { display: block; font-weight: 500; }
.access__level .d { color: var(--ink-2); font-size: 0.84375rem; }
.access__level:hover .t { color: var(--brand); }

/* Indented under the level it belongs to, and ruled off, so it is obvious it
   qualifies "Read and change" rather than standing on its own. */
.access__models {
  margin: 4px 0 14px 27px;
  padding: 12px 0 0 14px;
  border-left: 2px solid var(--rule);
}
.access__models label { font-size: 0.875rem; }
.access__models .picker { width: 100%; max-width: 420px; }
.access__models[hidden] { display: none; }

/* --- a model, named the way people name it ------------------------------
   The label leads; the technical name follows in small type because it is
   what anyone types into a picker or a domain. Two lines in a table cell,
   one line where there is room. */

.model {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  /* Enough that "Journal Entry" does not break across two lines in a narrow
     table column. Tables here sit inside .table-scroll, so the cost of asking
     for room is a horizontal scroll on a small screen, not a broken layout. */
  min-width: 7.5rem;
}
.model__name { font-weight: 500; }
.model__tech {
  color: var(--ink-3);
  font-size: 0.78125rem;
  line-height: 1.3;
}

/* --- changes ------------------------------------------------------------
   Reads are the background noise of this log; changes are the thing someone
   came to look for. One tinted rule down the left is enough to find them by
   without turning the table into a traffic light. */

.row--write td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.before {
  margin: 8px 0 0;
  padding: 9px 11px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  font-size: 0.78125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 200px;
  overflow: auto;
}

/* A day that carried a change, stacked above that day's reads. */
.chart__wr {
  background: var(--warn);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: .9;
}

.bare { list-style: none; padding: 0; margin: 0; }
.bare > li { padding: 5px 0; }

/* --- many-to-many picker ------------------------------------------------
   Tags in a box, the way an Odoo tag field behaves. picker.js builds it out
   of a plain text input; without JavaScript that input is simply visible and
   takes a comma-separated list, which is why nothing here styles the input
   itself out of existence. */

.m2m { position: relative; }

.m2m__box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 7px 9px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  cursor: text;
  transition: border-color .12s;
}
.m2m__box:focus-within { border-color: var(--brand); }

.m2m__chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 6px 4px 10px;
  background: var(--brand-tint);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.875rem;
  max-width: 100%;
}
.m2m__chip-name { font-weight: 500; overflow-wrap: anywhere; }
.m2m__chip-tech {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--ink-3);
}
.m2m__x {
  border: 0;
  background: none;
  padding: 0 2px;
  margin-left: 1px;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 3px;
}
.m2m__x:hover { color: var(--bad); }
.m2m__x:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.m2m__search {
  flex: 1 1 9rem;
  min-width: 9rem;
  border: 0;
  outline: 0;
  padding: 4px 2px;
  font: inherit;
  color: inherit;
  background: none;
}

.m2m__menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  /* The one place a shadow earns itself: this floats over other content and
     needs to read as a layer, not as part of the form. */
  box-shadow: 0 6px 20px rgba(0, 0, 0, .09);
}
.m2m__opt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.m2m__opt:hover, .m2m__opt.is-active { background: var(--brand-tint); }
.m2m__opt-name { font-weight: 500; }
.m2m__opt-tech {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78125rem;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Until picker.js has run, the plain input is the control -- so it must look
   like one. `is-ready` is set once the tags exist. */
.m2m:not(.is-ready) .m2m__box { display: none; }
