/* Ora's one design system (LA-1896, tokens rewritten for LA-2996 and LA-4027). The tile, the
   room page, the recap, the readout, the review and the owner's panel load this file and keep
   nothing of their own but layout. The choices behind it are in design-choices.md.

   Two themes and one set for the tile. Paper (light) is the default on every page since
   2026-11-08 (LA-4027), whatever the viewer's system setting. theme.js offers Black once and
   keeps the answer, which it writes as data-theme="dark" on <html>. The tile sets
   data-theme="tile" and stays Black, since a light tile glares among the video faces in a call
   (docs/DECISIONS.md, 2026-10-22).

   Role                 Paper (light)    Black (dark)
   --bg  ground         #F7F6F3          #000000
   --surface  card      #FFFFFF          #141312
   --surface-2          #EFEDE9          #1F1E1C
   --text               #1F1E1C          #ECE8DF
   --text-muted         #5E5950          #BDB7AB
   --hairline           #E7E5E0          #262422
   --hairline-strong    #D6D3CD          #383532
   --control  borders   #B9B4AB          #5F5A52
   --accent  main button #1F1E1C (ink)   #F2E6D4 (sand)
   --selected           #F2E6D4          #F2E6D4  (sand marks the selected item only)
   --moss / --ochre / --oxide  state only, always with a word
                        #3A5A40 #7A5F2F #7A3030    #8FB394 #D4AA62 #E08272
   --moss-tint and the others  the ground of a status chip

   The card tokens (--paper, --paper-2, --ink, --ink-muted) follow the surface: a card sits on
   the ground in the same theme. Corners are 8px (6px on chips), borders 1px, and there are no
   shadows. There is no accent colour.

   Every text colour below passes WCAG 2.2 AA (4.5:1) on the surfaces it is used on. The ratios
   are in the LA-4027 entry of docs/DECISIONS.md. Change a colour, and check its ratio again. */

/* Geist stands in for GT Standard until Matt buys the Grilli web licence. No GT file ships, and
   the name comes first in the stack so the licensed file takes over the day it is added. One
   family only: numbers use Geist's tabular figures, never a mono face (design Law 10). */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap");

:root {
  --font-sans: "GT Standard", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --tracking-tight: -0.01em;

  /* Spacing on a 4 px grid. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* 8px corners, 6px on chips, and round only for a dot or an initial. No shadows. */
  --radius-s: 6px;
  --radius-m: 8px;
  --radius-l: 8px;
  --radius-full: 999px;
  --shadow-card: none;

  /* Sand marks the selected item, in both themes. */
  --selected: #f2e6d4;
  --selected-edge: #d8c6aa; /* the sand chip's own edge, so it holds on the warm white ground */
  --on-selected: #1f1e1c; /* 13.52:1 on sand */
}

/* Paper: the default on every page but the tile. */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #efede9;
  --text: #1f1e1c; /* 15.41:1 on bg */
  --text-muted: #5e5950; /* 6.43:1 on bg, 6.95:1 on surface, 5.95:1 on surface-2 */
  --text-dim: #5e5950;
  --hairline: #e7e5e0;
  --hairline-strong: #d6d3cd;
  --control: #b9b4ab;
  --accent: #1f1e1c;
  --on-accent: #f7f6f3; /* 15.41:1 on ink */
  --accent-text: var(--text);
  --moss: #3a5a40; /* 7.15:1 on bg */
  --ochre: #7a5f2f; /* 5.54:1 on bg */
  --oxide: #7a3030; /* 8.47:1 on bg */
  --moss-tint: #e3ebe2;
  --ochre-tint: #f4e8d0;
  --oxide-tint: #f4e2de;
  --danger-text: var(--oxide);

  /* A card is a slab. */
  --paper: var(--surface);
  --paper-2: var(--surface-2);
  --ink: var(--text);
  --ink-muted: var(--text-muted);
  --ink-dim: var(--text-muted);
  --stamp: var(--oxide);
}

/* Black: the tile always, and the other pages once the viewer picks dark. */
:root[data-theme="dark"],
:root[data-theme="tile"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #141312;
  --surface-2: #1f1e1c;
  --text: #ece8df;
  --text-muted: #bdb7ab; /* 10.53:1 on bg, 9.30:1 on surface, 8.35:1 on surface-2 */
  --text-dim: #bdb7ab;
  --hairline: #262422;
  --hairline-strong: #383532;
  --control: #5f5a52;
  --accent: #f2e6d4;
  --on-accent: #23221f; /* 12.91:1 on sand */
  --moss: #8fb394; /* 9.04:1 on bg */
  --ochre: #d4aa62; /* 9.73:1 on bg */
  --oxide: #e08272; /* 7.61:1 on bg, 6.72:1 on surface */
  --moss-tint: #18231a;
  --ochre-tint: #2a2213;
  --oxide-tint: #2c1815;
}

/* The base every page shares. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Nothing clickable is underlined (design Law 2). Ora has no accent colour, so a link is the
   text colour at weight 500, and dims on hover. */
a {
  color: var(--accent-text);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
a:hover {
  color: var(--text-muted);
}

/* A small label: section headings, timestamps, capability names. Sentence case in the one sans
   family, with tabular figures (design Laws 9 and 10). */
.readout {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Ora's live mark: a filled dot while it is in the meeting, an empty ring otherwise. */
.live-mark {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--text-muted);
  flex: none;
}
.live .live-mark,
.live-mark.on {
  background: var(--accent);
  border-color: var(--accent);
}

/* Cards are paper. Pages set their size and padding; colour and type live here. */
.card {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-l);
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.card .capability,
.card .label,
.card .picture-label {
  font-size: 14px;
  color: var(--ink-muted);
}
.card .credits {
  font-weight: var(--weight-bold);
}
.card .title,
.card .full,
.card .changes,
.card .source {
  color: var(--ink-muted);
}
.card .line {
  font-weight: 650;
}
.card .relation,
.card .chip {
  font-size: 13px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
}
.card .relation.stamp {
  color: var(--stamp);
  border-color: var(--stamp);
}

/* A sketch (LA-2009): rough ink boxes and arrows on the card's paper. No motion here: the
   tile loads this file and stays still. The panel adds its own draw-on (panel.html). The
   live map's look is in its own block at the end of this file (LA-2998). */
.card .sketch-figure,
.card .map-figure {
  margin: 0;
  min-width: 0;
}
.card svg.sketch,
.card svg.map {
  display: block;
  max-width: 100%;
  height: auto;
}
.sketch .box,
.sketch .arrow,
.sketch .arrow-head {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sketch .box.second {
  stroke-width: 1.2;
  opacity: 0.55;
}
.sketch .box-fill {
  fill: var(--paper-2);
  stroke: none;
}
.sketch .shape-label {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: 17px;
}
.card .sketch-state,
.card .map-state {
  color: var(--ink-muted);
}
.card .sketch-state:empty,
.card .map-state:empty {
  display: none;
}

.card .map-gap {
  color: var(--ink-muted);
}

/* A row in an action log, on the room page and the panel. */
.entry {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-l);
  overflow-wrap: anywhere;
}
.entry .skill {
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.entry .time,
.entry .where,
.entry .reason,
.entry .head {
  color: var(--text-muted);
}

/* Buttons and fields on the pages people use with a mouse or a finger. A button is outlined.
   Each screen marks its one main action with .primary, the only filled button on it (design
   Law 8): ink on Paper, sand on Black. */
.button,
button {
  font: inherit;
  font-weight: var(--weight-medium);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control);
  border-radius: var(--radius-m);
  min-height: 44px;
  padding: 10px 16px;
  cursor: pointer;
}
.button:hover,
button:hover {
  border-color: var(--text-muted);
}
.button.primary,
button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

input[type="email"],
input[type="password"],
input[type="url"],
input[type="text"],
input[type="search"],
textarea,
select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: var(--radius-m);
}
input[type="checkbox"] {
  accent-color: var(--accent);
}

.failure {
  color: var(--danger-text);
}

/* A status chip: a word on a pale tint of its state colour, so the state never rests on colour
   alone. .ready is moss, .open is ochre, .problem is oxide, and a plain chip is neutral. */
.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 20px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.state-chip.ready { background: var(--moss-tint); color: var(--moss); }
.state-chip.open { background: var(--ochre-tint); color: var(--ochre); }
.state-chip.problem { background: var(--oxide-tint); color: var(--oxide); }

/* A person's initial in a round mark, beside a task they own. A dashed ring and "?" mean
   nobody has taken it. */
.initial {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: var(--weight-semibold);
}
.initial.none {
  background: transparent;
  border: 1px dashed var(--control);
  color: var(--text-muted);
}

/* The header every owner page shares (web/header.js, LA-4044): the wordmark, the three places
   with the current one marked, and the box that sends Ora by a join link. The line under the
   box, for the project and "I am the host", shows once a link is typed. */
.site-top {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-top-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 32px;
  min-height: 48px;
}
.site-top .wordmark {
  font-size: 24px;
  line-height: 32px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  color: var(--text);
}
.site-top .places {
  display: flex;
  gap: 24px;
}
.site-top .places a {
  font-size: 15px;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  padding: 12px 0;
}
.site-top .places a:hover,
.site-top .places a[aria-current="page"] {
  color: var(--text);
}
.site-top .places a[aria-current="page"] {
  font-weight: var(--weight-semibold);
}
.site-top .who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-top .send-open {
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--text);
  cursor: pointer;
}
.site-top .send-open:hover {
  color: var(--text-muted);
}
.send {
  display: flex;
  align-items: center;
  width: min(340px, 40vw);
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: var(--radius-m);
  padding: 0 4px 0 12px;
}
.send input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}
.send input:focus-visible { outline: 0; }
.send:focus-within { border-color: var(--text); }
.send .send-go {
  min-height: 32px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: var(--weight-medium);
}
.send-for,
.send-status {
  align-self: flex-end;
  text-align: right;
  font-size: 14px;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.send-status:empty { display: none; }
.send-status.failure { color: var(--danger-text); }
.send-host { white-space: nowrap; }
.inline-select {
  min-height: 32px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: var(--weight-medium);
}
@media (max-width: 720px) {
  .site-top { padding: 12px 16px; }
  .site-top-row { gap: 8px 20px; }
  .site-top .places { gap: 16px; }
  .site-top .who { margin-left: 0; width: 100%; }
  .send { width: 100%; }
  .send-for, .send-status { align-self: stretch; text-align: left; }
}

/* The one-time dark offer (theme.js): a band in the home page's slot, never over the page. */
.theme-offer {
  width: 100%;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
}
.theme-offer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 40px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 15px;
  color: var(--text);
}
.theme-offer-inner p {
  flex: 1;
  min-width: 200px;
  margin: 0;
}
.theme-offer-picks {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-offer-inner button {
  min-height: 40px;
  padding: 8px 16px;
}
.theme-offer-inner button.link {
  background: transparent;
  border: 0;
  padding: 8px 4px;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .theme-offer-inner { padding: 8px 16px; }
}

/* The live map (LA-2998), in the look of PanelUI's Flow: square boxes on a faint grid, a
   header with the box's number and badge, lines in right angles with rounded bends. A
   decision has a dashed border and a sand badge (ink on Paper). The map moves only here: a
   box drawMap adds to a map the page keeps carries .map-new and draws in, and a box that
   leaves carries .map-leaving and fades out. Nothing else moves, and with reduced motion
   nothing moves at all. The zoom buttons show only where the panel mounts them. */
.card .map-figure {
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
  background-image: linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: -1px -1px;
  outline: 1px solid var(--hairline);
}
.card .map-figure:has(> .map-zoom) {
  padding-bottom: 64px;
  cursor: grab;
  touch-action: none;
}
.map .map-box {
  fill: var(--surface);
  stroke: var(--hairline-strong);
  stroke-width: 1;
}
.map .decision .map-box {
  stroke: var(--ink-muted);
  stroke-dasharray: 4 3;
}
.map .topic .map-box {
  stroke: var(--ink);
}
.map .map-rule {
  stroke: var(--hairline);
  stroke-width: 1;
}
.map .map-number,
.map .map-badge-words,
.map .map-exit-words {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--weight-medium);
  fill: var(--ink-muted);
}
.map .map-badge-box {
  fill: var(--surface-2);
}
.map .decision .map-badge-box {
  fill: none;
  stroke: var(--accent);
}
.map .decision .map-badge-words {
  fill: var(--accent);
}
.map .map-title {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: 15px;
  fill: var(--ink);
}
.map .map-owner {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--ink-muted);
}
.map .map-edge {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.5;
}
.map .map-arrowhead {
  fill: var(--ink-muted);
}
.map .map-exit-box {
  fill: var(--bg);
  stroke: var(--control);
  stroke-width: 1;
}
.map .map-exit-words {
  fill: var(--ink);
}
.map-zoom {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  display: flex;
  cursor: default;
}
.map-zoom .map-zoom-button {
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--control);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.map-zoom .map-zoom-button:first-child {
  border-radius: var(--radius-m) 0 0 var(--radius-m);
}
.map-zoom .map-zoom-button:last-child {
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
}
.map-zoom .map-zoom-button + .map-zoom-button {
  border-left: 0;
}
.map .shape.map-new .map-edge {
  stroke-dasharray: 1;
  animation: map-edge-in 260ms ease-out both;
  animation-delay: var(--pen-delay, 0ms);
}
.map .shape.map-new .map-arrowhead,
.map .shape.map-new .map-exit,
.map .shape.map-new .map-box,
.map .shape.map-new .map-rule,
.map .shape.map-new text {
  animation: map-box-in 240ms ease-out both;
  animation-delay: calc(var(--pen-delay, 0ms) + 220ms);
}
.map .shape.map-leaving {
  animation: map-box-out 240ms ease-out forwards;
  pointer-events: none;
}
@keyframes map-edge-in {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes map-box-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes map-box-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .map .shape.map-new *,
  .map .shape.map-leaving {
    animation: none !important;
  }
}

/* The sign-in card on every page that signs someone in (LA-3579), option A in
   docs/research/sign-in: the wordmark over a rule, then Microsoft and Google as two filled
   buttons 8px apart, and email behind one link. Everything a person must read is --text,
   since --text-muted reads at APCA Lc 53 on Black. Oxide marks a refusal and never colours
   its words. The stamp, the note button and the rule beside the error show only when the
   card carries data-refused, which showSignInMessage() in member-sign-in.js sets. */
.sign-in-card {
  max-width: 400px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-l);
  padding: 0 var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--text);
}
.sign-in-card .sign-in-mark {
  margin: 0 calc(-1 * var(--space-6)) var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--hairline-strong);
  font: 400 40px/1 var(--font-sans);
  letter-spacing: 0;
  color: var(--text);
}
.sign-in-card .sign-in-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}
.sign-in-card .sign-in-lead {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: var(--weight-medium);
  color: var(--text);
}
.sign-in-card .sign-in-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  margin: 0;
  font-size: 16px;
}
.sign-in-card .sign-in-ms {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
}
.sign-in-card .sign-in-error {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-3);
  border-left: 3px solid var(--oxide);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
}
.sign-in-card .sign-in-error:empty,
.sign-in-card .sign-in-stamp,
.sign-in-card .sign-in-note,
.sign-in-card[data-refused] .sign-in-lead {
  display: none;
}
.sign-in-card[data-refused] .sign-in-stamp {
  display: block;
  align-self: flex-start;
  margin: 0 0 var(--space-2);
  border-radius: var(--radius-s);
  background: var(--oxide-tint);
  padding: 4px 12px;
  font: 600 14px var(--font-sans);
  color: var(--oxide);
}
.sign-in-card .sign-in-email > summary,
.sign-in-card[data-refused] .sign-in-note {
  display: block;
  align-self: flex-start;
  min-height: 44px;
  line-height: 44px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font: 400 15px var(--font-sans);
  letter-spacing: normal;
  text-transform: none;
  font-weight: var(--weight-medium);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.sign-in-card .sign-in-email > summary::-webkit-details-marker {
  display: none;
}
.sign-in-card .sign-in-email form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.sign-in-card .sign-in-email input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 var(--space-3);
  font-size: 16px;
}

/* One-click controls (LA-3746), adapted by hand from transitions.dev's "Toggle", "Text states
   swap" and "Accordion". No file is copied and no package is added. Sand only for what is on.
   A control changes look on the click and saves at once; the page then redraws with what was
   stored, so a failed save puts it back.
   The switch is the round phone-style one Matt picked on 2026-11-03 (Paper "Ora MVP", page E,
   board 4, option A). Every other control has 8px corners. */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  min-height: 0;
  padding: 0;
  background: var(--hairline-strong);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: background-color 180ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  /* The thumb slides over and settles back a little, the library's bounce made quieter. */
  transition: transform 180ms cubic-bezier(0.34, 1.4, 0.64, 1), background-color 180ms ease;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--on-accent); }

.chip {
  min-height: 0;
  padding: 7px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--control);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
/* On and off must read without colour (LA-3754): on is the sand fill with a check mark drawn
   before the words, off is an outline with muted words and no fill. */
.chip[aria-pressed] { display: inline-flex; align-items: center; gap: 8px; }
.chip[aria-pressed="false"]:hover { color: var(--text); border-color: var(--text-muted); }
/* A picked chip is sand with a check, in both themes. Ink fill belongs to the screen's one main button. */
.chip[aria-pressed="true"] { background: var(--selected); border-color: var(--selected-edge); color: var(--on-selected); }
.chip[aria-pressed="true"]::before {
  content: "";
  flex-shrink: 0;
  width: 5px;
  height: 10px;
  margin: -2px 1px 0 2px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.chip.add { border-style: dashed; }
.chip.name { display: inline-flex; align-items: center; gap: 10px; padding-right: 10px; color: var(--text); border-color: var(--hairline-strong); cursor: default; }
.chip.name button { min-height: 0; padding: 0 2px; background: transparent; border: 0; color: var(--text-muted); font: inherit; cursor: pointer; }
.chip.name button:hover { color: var(--text); }
.chip.name.new { animation: chip-in 220ms ease-out; }

/* "Saved" swaps in through a soft blur, holds, then fades. A failure stays, in oxide. */
.saved { font-size: 13px; line-height: 16px; color: var(--text-muted); }
.saved:empty { display: none; }
.saved.done { color: var(--moss); animation: saved-swap 220ms ease-out, saved-fade 400ms ease-in 1.5s forwards; }
.saved.failure { color: var(--danger-text); font-size: 14px; }

/* A part that opens in place grows from nothing, so the rows below slide down, not jump. */
.grow { display: grid; grid-template-rows: 1fr; }
.grow > * { min-height: 0; overflow: hidden; }
.grow.opening { animation: grow-open 220ms ease-out; }

@keyframes saved-swap { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }
@keyframes saved-fade { to { opacity: 0; } }
@keyframes grow-open { from { grid-template-rows: 0fr; opacity: 0; } to { grid-template-rows: 1fr; opacity: 1; } }
@keyframes chip-in { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: blur(0); } }

@media (prefers-reduced-motion: reduce) {
  .switch, .switch::after, .chip { transition: none; }
  .saved.done, .grow.opening, .chip.name.new { animation: none; }
}

/* Sources (LA-3760), on a project's page and on Settings, as drawn on Paper "Ora MVP", page
   "G · Sources". A paste field with Add, rows with a fixed kind lane, a state lane and an ×,
   so the columns line up down the list. Nothing opens over the page. */
.sources-head { display: flex; flex-direction: column; gap: 6px; }
.sources-title { margin: 0; font-size: 18px; line-height: 22px; font-weight: var(--weight-medium); }
.sources-summary, .sources-or, .sources-rule, .sources-also, .sources-status { margin: 0; font-size: 14px; line-height: 18px; color: var(--text-muted); }
.sources-summary { font-size: 15px; }
.source-add-row { display: flex; }
.source-add-row { gap: 8px; }
.source-add-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; font-size: 15px; background: var(--surface); color: var(--text); border: 1px solid var(--control); }
.source-add-row input:focus-visible { border-color: var(--accent); }
.source-add-row button { min-height: 44px; padding: 0 20px; }
.sources-or button.link { background: transparent; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: var(--weight-medium); color: var(--text); cursor: pointer; }
.sources-status:empty { display: none; }
.sources-status.failure, .source-where.failure { color: var(--danger-text); }
.source-list { list-style: none; margin: 0; padding: 6px 0 0; display: flex; flex-direction: column; }
.source-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.source-row:last-child { border-bottom: 0; }
.source-row.new { animation: chip-in 220ms ease-out; }
.source-kind { width: 72px; flex-shrink: 0; font-size: 13px; line-height: 16px; color: var(--text-muted); }
.source-row.new .source-kind { color: var(--accent); }
.source-words { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.source-name { font-size: 16px; line-height: 20px; color: var(--text); overflow-wrap: anywhere; }
.source-where { font-size: 14px; line-height: 18px; color: var(--text-muted); overflow-wrap: anywhere; }
.source-state { width: 220px; flex-shrink: 0; text-align: right; font-size: 14px; line-height: 18px; color: var(--text); }
.source-row.ok .source-state { color: var(--moss); }
.source-row.failed .source-state { color: var(--danger-text); }
.source-remove { width: 24px; flex-shrink: 0; min-height: 0; padding: 0; background: transparent; border: 0; color: var(--text-muted); font-size: 16px; text-align: right; cursor: pointer; }
.source-remove:hover { color: var(--text); }
.sources-also { display: flex; gap: 16px; align-items: baseline; padding-top: 6px; }
.sources-also a { color: var(--text); }
.sources-rule { padding-top: 8px; }
body.dropping { outline: 1px dashed var(--accent); outline-offset: -8px; }
@media (max-width: 720px) {
  .source-row { flex-wrap: wrap; gap: 6px 12px; }
  .source-words { flex-basis: calc(100% - 120px); }
  .source-state { width: auto; order: 4; text-align: left; padding-left: 84px; }
}
@media (prefers-reduced-motion: reduce) { .source-row.new { animation: none; } }
.sources-block { display: flex; flex-direction: column; gap: 16px; }
