/* botdotadd web client. Every value comes from the tokens below: spacing 4-64, type scale 1.2 from 16, two radii,
   three shadows. Tinted greys, one accent; colour only for meaning, state and interaction. */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --text-sm: 13px; --text-md: 16px; --text-lg: 19px; --text-xl: 23px; --text-2xl: 28px;
  --radius-sm: 8px; --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  /* Secrets and keys, where 0 and O or l and 1 must differ. */
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --column: 720px; --reading: 65ch;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --bg: hsl(195 18% 97%);
  --surface: hsl(195 20% 99.5%);
  --sunken: hsl(195 16% 93%);
  --line: hsl(195 14% 87%);
  --ink: hsl(195 22% 13%);
  --ink-2: hsl(195 10% 36%);
  --ink-3: hsl(195 8% 46%);
  --accent: hsl(186 59% 29%);
  --accent-ink: hsl(186 40% 98%);
  --accent-soft: hsl(186 38% 90%);
  --danger: hsl(4 59% 40%);
  --shadow-sm: 0 1px 2px hsl(195 30% 10% / .06);
  --shadow-md: 0 4px 12px hsl(195 30% 10% / .08);
  --shadow-lg: 0 12px 32px hsl(195 30% 10% / .14);
  --scrim: hsl(195 30% 10% / .4);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(195 18% 8%);
    --surface: hsl(195 16% 11%);
    --sunken: hsl(195 16% 14%);
    --line: hsl(195 12% 21%);
    --ink: hsl(195 16% 91%);
    --ink-2: hsl(195 10% 70%);
    --ink-3: hsl(195 8% 60%);
    --accent: hsl(186 45% 62%);
    --accent-ink: hsl(195 30% 8%);
    --accent-soft: hsl(186 30% 20%);
    --danger: hsl(4 80% 72%);
    --shadow-sm: 0 1px 2px hsl(0 0% 0% / .3);
    --shadow-md: 0 4px 12px hsl(0 0% 0% / .35);
    --shadow-lg: 0 12px 32px hsl(0 0% 0% / .45);
    --scrim: hsl(0 0% 0% / .6);
    color-scheme: dark;
  }
}

/* The hidden attribute always wins: a view or an offer that is hidden never shows. */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--text-md)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
h1 { font-size: var(--text-lg); font-weight: 600; line-height: 1.2; }
h2 { font-size: var(--text-md); font-weight: 600; line-height: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }

/* Controls: one primary per view; secondary is outlined; quiet is link-like. */
button, a.button {
  font: inherit; font-weight: 600; line-height: 1.25; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
button.quiet { background: transparent; color: var(--ink-2); font-weight: 400; padding-inline: var(--space-3); }
button.danger { background: transparent; color: var(--danger); border-color: currentColor; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:is([type=email], [type=search], [type=text], [type=password]), select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 44px; padding: var(--space-2) var(--space-3);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* Views. A page view is a centred column; the Chat fills the screen with the composer docked at the bottom. */
main { max-width: var(--column); margin: 0 auto; padding: 0 var(--space-4) var(--space-7); display: flex; flex-direction: column; gap: var(--space-5); }
main > header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--space-2);
  margin: 0 calc(-1 * var(--space-4)); padding: var(--space-2) var(--space-4); min-height: 56px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
main > header h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main > header nav { display: flex; gap: var(--space-1); }
main > header button { min-height: 40px; }
/* A back button lines up its text, not its padding, with the content edge. */
main > header > button.quiet:first-child { margin-left: calc(-1 * var(--space-3)); }
main > header nav { margin-right: calc(-1 * var(--space-3)); }

/* Signed out: welcome, the app hand-off. One narrow column, vertically centred. */
#welcome, #app-handoff { max-width: 440px; min-height: 100dvh; justify-content: center; padding-block: var(--space-7); gap: var(--space-4); }
#welcome h1 { font-size: var(--text-2xl); letter-spacing: -.01em; }
#welcome > p:first-of-type { color: var(--ink-2); font-size: var(--text-lg); margin-bottom: var(--space-4); }
#welcome > button { width: 100%; }
#email-form { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--line); }
#email-form label { color: var(--ink-2); font-size: var(--text-sm); }
#email-form .row input { flex: 1; min-width: 12rem; }
#auth-error, #app-error { color: var(--ink-2); min-height: 1.5em; }
#app-handoff h1 { font-size: var(--text-xl); }

/* Consent: the text at reading width; the decision at the bottom. */
#consent { padding-top: var(--space-7); }
#consent h1 { font-size: var(--text-xl); }
.consent-text { max-width: var(--reading); white-space: pre-wrap; color: var(--ink-2); }
#consent-form { display: flex; flex-direction: column; gap: var(--space-4); max-width: var(--reading); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

/* The Chat. */
#chat { height: 100dvh; padding-bottom: 0; gap: 0; }
#chat > header { position: static; }
.offer {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--sunken);
}
.offer > span, .offer > label { flex: 1 1 16rem; color: var(--ink-2); font-size: var(--text-sm); }
.offer input { flex: 1 1 12rem; }
.offer button { min-height: 36px; padding-block: var(--space-1); }
#messages {
  list-style: none; margin: 0; padding: var(--space-5) 0; flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--space-4);
  /* scrollIntoView ignores padding; this keeps the newest message off the composer. */
  scroll-padding-block: var(--space-5);
  /* Still scrolls (wheel, touch, keys); just no bar over the bubbles. */
  scrollbar-width: none;
}
#messages::-webkit-scrollbar { display: none; }
/* The Chief is on a reply: one quiet line above the composer until it lands. */
#working, #background { margin: 0 0 var(--space-3); color: var(--ink-3); font-size: var(--text-sm); }
#working, #background > p { animation: working 1.6s ease-in-out infinite alternate; }
/* Background work: the same quiet line, with Stop beside it. */
#background:not([hidden]) { display: flex; align-items: baseline; gap: var(--space-2); }
#background > p { margin: 0; }
#background > button { font-size: inherit; padding: var(--space-1) var(--space-2); min-height: 0; }
@keyframes working { from { opacity: 1; } to { opacity: .45; } }

/* The Board: the Chief's cards beside the Chat. Narrow: their titles in a row, one card open below. Wide: a column
   left of the Chat, all cards. */
#board:not([hidden]) { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); }
#board-tabs { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
#board-cards { display: flex; flex-direction: column; gap: var(--space-4); }
#board-tabs::-webkit-scrollbar { display: none; }
#board-tabs button { flex: none; min-height: 36px; padding-block: var(--space-1); font-weight: 400; }
#board-tabs button[aria-selected="true"] { border-color: var(--accent); }
.board-card { display: none; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.board-card.open { display: flex; }
.board-card > header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.board-card h2 { font-size: var(--text-sm); color: var(--ink-2); }
.board-card > header button { min-height: 32px; padding: 0 var(--space-2); margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2)) calc(-1 * var(--space-1)) 0; color: var(--ink-3); font-size: var(--text-lg); }
.board-card .a2-surface, .board-card .a2-column { display: flex; flex-direction: column; gap: var(--space-2); }
.board-card .a2-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.board-card .a2-text { margin: 0; white-space: pre-wrap; }
.board-card .a2-caption { color: var(--ink-2); font-size: var(--text-sm); }
.board-card button { min-height: 36px; padding-block: var(--space-1); }
/* The Board draws the card; a Card the Chief wrapped around its content draws nothing more. */
.board-card .a2-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* A button that ticks a to-do off reads as a checklist line. */
.board-card button[data-action="done"] { justify-content: flex-start; text-align: left; gap: var(--space-3); padding: var(--space-1) 0; background: none; border: 0; color: var(--ink); font-weight: 400; }
.board-card button[data-action="done"]::before { content: ""; flex: none; width: 16px; height: 16px; border: 2px solid var(--ink-3); border-radius: 4px; }
.board-card button[data-action="done"]:hover::before { border-color: var(--accent); }
.board-card button[data-action="done"]:disabled::before { background: var(--accent); border-color: var(--accent); }
/* A card the Chief just put up shows itself once. */
.board-card.fresh { animation: board-fresh 2.4s var(--ease); }
@keyframes board-fresh { from { background: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .board-card.fresh { animation: none; } }
@media (min-width: 1180px) {
  #board:not([hidden]) {
    position: fixed; top: var(--space-8); right: calc(50% + var(--column) / 2 + var(--space-5));
    width: min(280px, calc(50vw - var(--column) / 2 - var(--space-5) - var(--space-4)));
    max-height: calc(100dvh - var(--space-8) - var(--space-5)); overflow-y: auto; padding-top: 0;
  }
  #board-tabs { display: none; }
  .board-card { display: flex; }
}
#messages > li { max-width: min(var(--reading), 100%); white-space: pre-wrap; overflow-wrap: anywhere; }
#messages li.chief { align-self: flex-start; max-width: min(62ch, 100%); white-space: normal; line-height: 1.55; }
/* The Chief's words (text.js): paragraphs spaced instead of blank lines, lists with a hanging indent. */
#messages li.chief > :is(p, ul, ol) { margin: 0; }
#messages li.chief > * + * { margin-top: var(--space-3); }
#messages li.chief :is(ul, ol) { padding-inline-start: 1.25em; }
#messages li.chief li + li { margin-top: var(--space-2); }
#messages li.chief li::marker { color: var(--ink-3); }
#messages li.chief strong, #messages .a2-text strong { font-weight: 600; }
/* Code from the Chief: a command to paste sits in its own box, as typed, with Copy at its corner. */
#messages li.chief code { font-family: var(--mono); font-size: .9em; padding: .1em .3em; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
#messages li.chief .code { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
#messages li.chief .code pre { margin: 0; padding: var(--space-3) var(--space-4); padding-right: 5.5rem; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--text-sm)/1.6 var(--mono); user-select: all; }
#messages li.chief .code pre code { all: unset; }
#messages li.chief .code .copy { position: absolute; top: var(--space-2); right: var(--space-2); min-height: 32px; padding: var(--space-1) var(--space-3); font-size: var(--text-sm); }
#messages li a { color: var(--accent); text-underline-offset: 2px; }
#messages li.owner { align-self: flex-end; max-width: min(52ch, 85%); padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg); background: var(--accent-soft); }
#messages li.failed { color: var(--ink-2); }
#messages li button.link { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
#messages li button.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#messages li.heads-up { align-self: center; color: var(--ink-3); font-size: var(--text-sm); }
#messages li.held { background: var(--sunken); }

/* A message's A2UI surface (ADR-0013, a2ui.js): the server's components, drawn with these few rules. */
#messages .a2-surface, #messages .a2-column { display: flex; flex-direction: column; gap: var(--space-3); white-space: normal; }
#messages .a2-text { margin: 0; white-space: pre-wrap; }
#messages .a2-caption { color: var(--ink-2); font-size: var(--text-sm); }
#messages .a2-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
#messages .a2-row > .a2-text { flex: 1; min-width: 0; }
#messages .a2-row > .icon { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
#messages .a2-row > button.secondary { font-weight: 400; min-height: 40px; }
#messages li.heads-up .a2-row { gap: var(--space-1); }
#messages .a2-image { display: block; max-width: min(100%, 320px); max-height: 320px; border-radius: var(--radius-sm); object-fit: cover; }
/* A card (an Approval, a secure entry card) spans the Chat; a draft's words sit in a sunken box under its title. */
#messages li:has(.a2-card) { align-self: stretch; max-width: 100%; }
#messages .a2-card { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
#messages .a2-card > .a2-column > .a2-text:not(:first-child) { color: var(--ink-2); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--sunken); }
#messages .a2-card button.quiet:last-child { margin-right: calc(-1 * var(--space-3)); }
/* The Owner's own file buttons: small, beside their file. */
#messages li.owner .a2-row > button.quiet { font-size: var(--text-sm); padding: var(--space-1) var(--space-2); }
/* Move to Vault on the Owner's own words: beside the message when it is hovered or focused; under it when tapped. */
#messages li.owner { position: relative; }
#messages li.owner button[data-action="text.moveToVault"] { display: none; position: absolute; right: 100%; bottom: 0; margin-right: var(--space-2); white-space: nowrap; font-size: var(--text-sm); }
@media (hover: hover) { #messages li.owner:hover button[data-action="text.moveToVault"] { display: block; } }
#messages li.owner:focus-within button[data-action="text.moveToVault"] { display: block; }
#messages li.owner.picked button[data-action="text.moveToVault"] { display: block; position: static; margin: 0 0 0 auto; }
.a2-field { display: grid; gap: var(--space-1); }
.a2-field > span { color: var(--ink-2); font-size: var(--text-sm); }
.a2-choices { margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-2); }
.a2-choices > legend { padding: 0; margin-bottom: var(--space-2); color: var(--ink-2); font-size: var(--text-sm); }
.a2-check { display: flex; align-items: center; gap: var(--space-2); }
/* A Modal's content (a confirm step): the Fresh check's dialog look. */
.a2-modal {
  width: min(400px, calc(100vw - 2 * var(--space-4))); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.a2-modal[open] { display: flex; flex-direction: column; gap: var(--space-4); }
.a2-modal::backdrop { background: var(--scrim); }
.a2-modal .a2-column { display: flex; flex-direction: column; gap: var(--space-4); }
.a2-modal .a2-text { margin: 0; }
.a2-modal .a2-row { display: flex; justify-content: flex-end; }

/* The composer: one field with its actions, docked under the messages. */
#composer {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); align-items: end;
  margin-bottom: var(--space-2); padding: var(--space-2); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
#composer textarea { grid-column: 1 / -1; border: 0; background: transparent; resize: none; max-height: 40vh; padding: var(--space-2); }
#composer textarea:focus-visible { outline: none; }
#composer:focus-within { border-color: var(--accent); }
#composer .tools { display: flex; gap: var(--space-1); align-items: center; }
#composer .tools button { min-height: 40px; }
#composer button[type=submit] { min-height: 40px; }
#attach svg { width: 20px; height: 20px; }
#record[aria-pressed="true"] { background: var(--danger); color: var(--surface); }
#record[aria-pressed="true"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
#voice-status { min-height: 1.5em; padding-bottom: var(--space-2); color: var(--ink-2); font-size: var(--text-sm); }
#voice-status:empty { min-height: 0; padding: 0; }

/* Lists: rows in one grouped surface, separated by hairlines. */
.list { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.list li { padding: var(--space-3) var(--space-4); overflow-wrap: anywhere; }
.list li + li { border-top: 1px solid var(--line); }
.list li small { display: block; color: var(--ink-3); font-size: var(--text-sm); }
/* A Standing approval on a Vault item: the line, then Stop. */
.list li.standing { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.list li.standing button { flex: none; overflow-wrap: normal; }
.list li button.handoff { margin-top: var(--space-2); min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-sm); font-weight: 400; }
.list:empty { display: none; }
.list li.empty { color: var(--ink-3); }
.list:has(li.empty) { background: transparent; border-style: dashed; }
.list li:has(> button.link) { padding: 0; }
.list button.link {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  width: 100%; min-height: 52px; padding: var(--space-3) var(--space-4);
}
.list button.link::after { content: ""; width: 8px; height: 8px; flex: none; border: solid var(--ink-3); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.list button.link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Projects, a Project, the Account. */
#projects, #project, #account { min-height: 100dvh; }
#project section, #account section { display: flex; flex-direction: column; gap: var(--space-3); }
#project h2, #account h2 { color: var(--ink-2); }
#talk { align-self: flex-start; }
#account section p { color: var(--ink-2); max-width: var(--reading); }
#account section > :is(a, button) { align-self: flex-start; }
#account .error { color: var(--danger); min-height: 1.5em; }
#account .error:empty { min-height: 0; }

@media (min-width: 768px) {
  main > header { margin-inline: 0; padding-inline: 0; }
  #messages { padding-block: var(--space-6); }
}
@media (hover: hover) {
  button:hover, a.button:hover { background: color-mix(in hsl, var(--accent), var(--ink) 15%); }
  button.secondary:hover, button.danger:hover, .list button.link:hover { background: var(--sunken); }
  button.quiet:hover { background: var(--sunken); color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } #working, #background > p { animation: none; } }

/* The Passkeys list: name and date on the left, Remove on the right. */
#passkey-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: var(--space-3); }
#passkey-list li > button { grid-column: 2; grid-row: 1 / span 2; min-height: 36px; }
#passkey-list li.empty { display: block; }

/* "Confirm it’s you": the Fresh check. */
#fresh-check {
  width: min(400px, calc(100vw - 2 * var(--space-4))); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
#fresh-check[open] { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
#fresh-check::backdrop { background: var(--scrim); }
#fresh-check h2 { margin: 0; font-size: var(--text-lg); }
#fresh-check > button.quiet { margin-left: calc(-1 * var(--space-3)); }
#fresh-status { margin: 0; color: var(--ink-2); }
#fresh-status:empty { display: none; }

/* The Vault sheet (#112): over the Chat, full height from the bottom on a phone, a centred panel on a wide screen. */
#to-vault .icon { width: 16px; height: 16px; flex: none; }
#vault {
  width: 100%; max-width: 560px; height: 92dvh; max-height: none; margin: auto auto 0; padding: 0; border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--bg); color: var(--ink); box-shadow: var(--shadow-lg);
}
#vault::backdrop { background: var(--scrim); }
#vault-body { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-4) var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.sheet-head { display: flex; align-items: center; gap: var(--space-2); }
.sheet-head > h2, .sheet-head > span { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: var(--text-lg); overflow-wrap: anywhere; }
.sheet-head button { min-height: 40px; }
.sheet-head > button.quiet:last-child { margin-right: calc(-1 * var(--space-3)); }
.sheet-head > button.back { margin-left: calc(-1 * var(--space-3)); }
#vault input[type=search] { width: 100%; }
.vault-results { display: flex; flex-direction: column; gap: var(--space-2); }
.vault-results .list + .group-title { margin-top: var(--space-4); }
.group-title { font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
#vault section { display: flex; flex-direction: column; gap: var(--space-2); }
#vault button.show-all { align-self: flex-start; margin-left: calc(-1 * var(--space-3)); }
.vault-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding-top: var(--space-6); }
.vault-title { display: flex; flex-direction: column; gap: var(--space-1); }
.vault-title h2 { font-size: var(--text-xl); overflow-wrap: anywhere; }
.vault-status { color: var(--ink-2); font-size: var(--text-sm); margin-top: calc(-1 * var(--space-3)); }
.vault-status:empty { display: none; }
.vault-delete { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.vault-delete > button.quiet { margin-left: calc(-1 * var(--space-3)); color: var(--danger); }
.vault-delete p { color: var(--ink-2); max-width: var(--reading); }

/* An item's fields: the label quiet above its value on a phone, beside it on a wide screen; Show and Copy at the end. */
.fields { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.fields li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-1) var(--space-3); min-height: 56px; padding: var(--space-3) var(--space-4); }
.fields li + li { border-top: 1px solid var(--line); }
.fields .k { grid-column: 1 / -1; color: var(--ink-3); font-size: var(--text-sm); }
.fields .v { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.fields .actions { display: flex; gap: var(--space-1); }
.fields button { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-sm); font-weight: 400; }
.mono { font-family: var(--mono); font-size: var(--text-sm); }

/* Add and Edit. */
.vault-form, .vault-kind-fields { display: flex; flex-direction: column; gap: var(--space-4); }
.vault-form { max-width: 480px; }
.vault-form label { display: flex; flex-direction: column; gap: var(--space-1); color: var(--ink-2); font-size: var(--text-sm); }
.vault-form :is(input, select, textarea) { width: 100%; font-size: var(--text-md); }
.vault-form textarea { resize: vertical; }
/* A file input reads like the other controls: its button is a secondary one. */
.vault-form input[type=file] { color: var(--ink-2); font-size: var(--text-sm); }
.vault-form input[type=file]::file-selector-button {
  font: inherit; font-size: var(--text-md); font-weight: 600; min-height: 44px; margin-right: var(--space-3); padding: var(--space-2) var(--space-4);
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); cursor: pointer;
}
.vault-form textarea.mono { font-family: var(--mono); font-size: var(--text-sm); }
.with-action { display: flex; gap: var(--space-2); }
.with-action input { flex: 1; min-width: 0; }
.vault-form fieldset { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.vault-form legend { padding: 0; margin-bottom: var(--space-2); color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.vault-extras { display: flex; flex-direction: column; gap: var(--space-3); }
.vault-extras:empty { display: none; }
.vault-extra { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); align-items: center; }
.vault-extra label.inline { flex-direction: row; align-items: center; gap: var(--space-2); font-size: var(--text-md); color: var(--ink); }
.vault-extra input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.vault-extra > button { justify-self: end; }
.vault-form button.add-field { align-self: flex-start; margin-left: calc(-1 * var(--space-3)); }
@media (min-width: 768px) {
  #vault { margin: auto; height: min(80dvh, 720px); border-radius: var(--radius-lg); }
  #vault-body { padding: var(--space-5) var(--space-6) var(--space-6); }
  .fields li { grid-template-columns: 8rem 1fr auto; }
  .fields .k { grid-column: auto; }
  .vault-extra { grid-template-columns: 1fr 1fr auto auto; }
}

/* The Debug tab (testing only): a Job's status line coloured while it runs or when it failed, its result folded. */
.list li.debug-job.running > small:first-of-type, .list li.debug-job.queued > small:first-of-type { color: var(--accent); }
.list li.debug-job.failed > small:first-of-type { color: var(--danger); }
.debug-job details { margin-top: var(--space-2); }
.debug-job summary { cursor: pointer; color: var(--ink-2); font-size: var(--text-sm); }
.debug-job pre { margin: var(--space-2) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: var(--text-sm); }
