/* Assisty styles. Order: fonts, tokens, base, shell, components, pages.
   Mobile first; the rail replaces the tab bar from 900px up. Dark mode follows the system
   setting. All styling lives here: the CSP forbids inline <style> and style= attributes, and
   the fonts are served from /static/fonts/ (nothing comes from outside). */

/* --- Fonts ------------------------------------------------------------------------------ */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/barlow-400.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/barlow-500.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/barlow-600.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/barlow-700.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-600.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-700.woff2") format("woff2");
}

/* --- Tokens ------------------------------------------------------------------------------
   Every colour is a six-digit hex here, defined once per theme: the light values in :root, the
   dark ones in the media query below. A test checks that each colour has a dark value and that
   every text pair meets WCAG AA in both themes. */

:root {
  /* Rail and tab bar */
  --rail: #1F2B3D;
  --rail-current: #33476A;
  --rail-hover: #2A3950;
  --rail-rule: #33476A;
  --rail-ink: #E6ECF5;
  --rail-ink-2: #A9B8CE;
  --rail-ink-hi: #FFFFFF;

  /* Bays and strips */
  --bay: #DCE3EC;
  --bay-out: #CED7E3;
  --strip: #FFFFFF;
  --strip-border: #C3CDD9;
  --rule: #E1E6ED;
  --border-soft: #B7C3D2;
  --border-ui: #6F7E94;

  /* Text */
  --text: #18212E;
  --text-2: #47546A;
  --label: #4A5668;
  --link: #24406B;
  --link-hover: #16294A;

  /* Actions and focus */
  --go: #24406B;
  --go-ink: #FFFFFF;
  --go-hover: #16294A;
  --focus: #24406B;
  --focus-rail: #F2B33D;

  /* Counts and timers */
  --badge: #F2B33D;
  --badge-ink: #1F2B3D;
  --timer: #D98A1F;
  --timer-ink: #7A3E06;
  --timer-track: #E3E8EF;

  /* State tags: used only for meaning (held, blocked, done) */
  --held: #FDF0DC;
  --held-ink: #7A3E06;
  --blocked: #FBE4E1;
  --blocked-ink: #7A1E14;
  --ok: #DDF2E6;
  --ok-ink: #14532D;

  /* Labelled sources: untrusted text is dashed and grey, the assistant's text solid and blue */
  --source-outside: #F3F5F8;
  --source-outside-border: #B7C3D2;
  --source-ink: #2B3545;
  --source-assistant: #EEF2FA;
  --source-assistant-border: #B9C8E4;
  --label-assistant: #24406B;

  /* Account colours: a fixed set of six, each with white text at 4.5:1 or better */
  --acct-amber: #9A4A0B;
  --acct-blue: #2457C5;
  --acct-violet: #5B2BB5;
  --acct-teal: #0F6E6E;
  --acct-rose: #A3214F;
  --acct-olive: #5A6512;
  --acct-all: #47546A;
  --acct-ink: #FFFFFF;

  --shadow-lift: 0 6px 18px rgb(31 43 61 / 14%);

  --font-ui: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --radius-strip: 4px;
  --radius-ctl: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --rail-width: 264px;
  --tabbar-height: 3.5rem;
  --space: 1rem;

  /* Names the first pages were written against, kept until each page is restyled. */
  --bg: var(--bay);
  --surface: var(--strip);
  --border: var(--strip-border);
  --muted: var(--text-2);
  --accent: var(--go);
  --accent-text: var(--go-ink);
  --danger: var(--blocked-ink);
  --radius: var(--radius-ctl);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rail: #0E1420;
    --rail-current: #22314A;
    --rail-hover: #18233A;
    --rail-rule: #22314A;
    --rail-ink: #E6ECF5;
    --rail-ink-2: #A9B8CE;
    --rail-ink-hi: #FFFFFF;

    --bay: #121A26;
    --bay-out: #0F1722;
    --strip: #1C2635;
    --strip-border: #2C3A50;
    --rule: #2C3A50;
    --border-soft: #3A4A63;
    --border-ui: #6B7C96;

    --text: #E6ECF5;
    --text-2: #A9B8CE;
    --label: #A9B8CE;
    --link: #9DB9F2;
    --link-hover: #BBD0F7;

    --go: #9DB9F2;
    --go-ink: #0E1420;
    --go-hover: #BBD0F7;
    --focus: #9DB9F2;
    --focus-rail: #F2B33D;

    --badge: #F2B33D;
    --badge-ink: #0E1420;
    --timer: #D98A1F;
    --timer-ink: #F2B33D;
    --timer-track: #2C3A50;

    --held: #3A2A12;
    --held-ink: #F5C77A;
    --blocked: #3D1A18;
    --blocked-ink: #F5A9A0;
    --ok: #12301F;
    --ok-ink: #8FD8AB;

    --source-outside: #162030;
    --source-outside-border: #3A4A63;
    --source-ink: #D0DAE8;
    --source-assistant: #1A2742;
    --source-assistant-border: #31466B;
    --label-assistant: #9DB9F2;

    --acct-amber: #9A4A0B;
    --acct-blue: #2457C5;
    --acct-violet: #5B2BB5;
    --acct-teal: #0F6E6E;
    --acct-rose: #A3214F;
    --acct-olive: #5A6512;
    --acct-all: #47546A;
    --acct-ink: #FFFFFF;

    --shadow-lift: 0 6px 18px rgb(0 0 0 / 40%);
  }
}

/* --- Base ------------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--border-ui) transparent;
  scrollbar-width: thin;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bay);
  color: var(--text);
  font: 400 15px/1.5 var(--font-ui);
  font-variant-numeric: tabular-nums;
  accent-color: var(--go);
  caret-color: var(--go);
}

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

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

a:hover {
  color: var(--link-hover);
}

::selection {
  background: var(--go);
  color: var(--go-ink);
}

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--focus);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  color: var(--text);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space);
}

/* --- Shell: rail (desktop), tab bar (phone), page header ------------------------------ */

.shell {
  display: flex;
  flex: 1;
  min-width: 0;
}

.stage {
  flex: 1;
  min-width: 0;
}

.rail {
  display: none;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: calc(1.1rem + env(safe-area-inset-top)) var(--space) 0.9rem;
  background: var(--rail);
  color: var(--rail-ink);
}

.top-bar__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.content {
  padding: var(--space);
  max-width: 64rem;
  padding-bottom: calc(var(--space) * 1.5);
}

.content--wide {
  max-width: none;
}

.content:focus {
  outline: none;
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: var(--rail);
  padding: 0.25rem 0.5rem calc(0.25rem + env(safe-area-inset-bottom));
}

.tabbar__list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tabbar__list > li {
  flex: 1;
  min-width: 0;
}

.tabbar__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tabbar-height);
  border-radius: var(--radius-ctl);
  color: var(--rail-ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.tabbar__link:hover {
  color: var(--rail-ink);
  background: var(--rail-hover);
}

.tabbar__link:focus-visible {
  outline-color: var(--focus-rail);
}

.tabbar__link[aria-current="page"] {
  background: var(--rail-current);
  color: var(--rail-ink-hi);
}

.icon--tab {
  width: 24px;
  height: 24px;
}

.tabbar__count {
  position: absolute;
  top: 2px;
  left: 54%;
  min-width: 1.25rem;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}

@media (min-width: 900px) {
  body {
    flex-direction: row;
  }

  .shell {
    flex-direction: row;
  }

  .tabbar {
    display: none;
  }

  .rail {
    position: sticky;
    top: 0;
    display: flex;
    flex: 0 0 var(--rail-width);
    flex-direction: column;
    gap: 28px;
    align-self: flex-start;
    width: var(--rail-width);
    height: 100vh;
    height: 100dvh;
    padding: 24px 16px;
    overflow-y: auto;
    background: var(--rail);
    color: var(--rail-ink);
  }

  .top-bar {
    position: static;
    padding: 28px 32px 0;
    background: transparent;
    color: var(--text);
  }

  .top-bar__title {
    font-size: 34px;
  }

  .content {
    padding: 20px 32px 40px;
  }
}

.rail__brand {
  padding: 0 12px;
}

.rail__name {
  margin: 0;
  font: 700 26px/1.1 var(--font-code);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.rail__tag {
  margin: 2px 0 0;
  color: var(--rail-ink-2);
  font-size: 13px;
}

.rail__list,
.rail__accounts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-ctl);
  color: var(--rail-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.rail__link:hover {
  background: var(--rail-hover);
  color: var(--rail-ink-hi);
}

.rail__link[aria-current="page"] {
  background: var(--rail-current);
  color: var(--rail-ink-hi);
}

.rail :focus-visible {
  outline-color: var(--focus-rail);
}

.rail__label {
  flex: 1;
}

.rail__count {
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 14px;
}

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

.rail__section--safety {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid var(--rail-rule);
}

.rail__heading {
  margin: 0 12px 4px;
  color: var(--rail-ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail__section--safety .rail__heading {
  margin: 0 0 4px;
}

.rail__account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-ctl);
  color: var(--rail-ink);
  font-size: 14px;
  text-decoration: none;
}

.rail__account:hover {
  background: var(--rail-hover);
  color: var(--rail-ink-hi);
}

.rail__account-note {
  flex: none;
  color: var(--rail-ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.rail__account-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The pause switch: a real form; the button is the switch. */
.switch-form {
  margin: 0;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.switch__label {
  font-size: 14px;
  font-weight: 600;
}

.switch__hint {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}

.more__group .switch__hint {
  padding: 0 var(--space) 10px;
  color: var(--text-2);
  opacity: 1;
}

.switch__track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 12px;
  transition: background-color 160ms var(--ease-out);
}

.switch__track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transition: transform 160ms var(--ease-out);
}

.switch[aria-checked="true"] .switch__track {
  background: var(--badge);
  border-color: var(--badge);
  color: var(--badge-ink);
}

.switch[aria-checked="true"] .switch__track::after {
  transform: translateX(16px);
}

/* Brain sidebar: pills on the phone, a column beside the page from 900px. */
.brain-nav {
  margin: -4px -4px var(--space);
  padding: 4px; /* room for the focus ring, which overflow-x would clip */
  overflow-x: auto;
}

.brain-nav__list {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brain-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--strip-border);
  border-radius: 999px;
  background: var(--strip);
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.brain-nav__link:hover {
  color: var(--link-hover);
}

.brain-nav__link[aria-current="page"] {
  border-color: var(--go);
  background: var(--go);
  color: var(--go-ink);
  font-weight: 600;
}

.brain-nav__count {
  padding: 0 6px;
  border-radius: 3px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 13px;
}

@media (min-width: 900px) {
  .content:has(> .brain-nav) {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }

  .content:has(> .brain-nav) > * {
    grid-column: 2;
  }

  .content:has(> .brain-nav) > .brain-nav {
    position: sticky;
    top: 16px;
    grid-column: 1;
    grid-row: 1 / span 40;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .brain-nav__list {
    flex-direction: column;
    gap: 2px;
  }

  .brain-nav__link {
    min-height: 38px;
    border-color: transparent;
    border-radius: var(--radius-ctl);
    background: transparent;
  }

  .brain-nav__link:hover {
    background: var(--strip);
  }

  .brain-nav__link[aria-current="page"] {
    border-color: var(--strip-border);
    background: var(--strip);
    color: var(--text);
  }
}

/* The More page */
.more__group {
  margin: 0 calc(var(--space) * -1) 12px;
  border-block: 1px solid var(--strip-border);
  background: var(--strip);
}

.more__group .switch {
  padding: 0 var(--space);
}

.more__heading {
  margin: 0;
  padding: 14px var(--space) 6px;
  color: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.more__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 var(--space);
  border-top: 1px solid var(--rule);
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
}

.more__item:hover {
  background: var(--bay);
  color: var(--text);
}

.more__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 6px 0;
}

.more__note {
  color: var(--text-2);
  font-size: 13px;
}

.more__note--warn {
  color: var(--timer-ink);
}

.more__empty {
  margin: 0;
  padding: 12px var(--space);
  color: var(--text-2);
}

.icon--chevron {
  width: 18px;
  height: 18px;
  color: var(--text-2);
  stroke-width: 2;
}

@media (min-width: 900px) {
  .more__group {
    margin-inline: 0;
    border: 1px solid var(--strip-border);
    border-radius: var(--radius-strip);
  }
}

/* --- Components --------------------------------------------------------------------------- */

.code {
  font-family: var(--font-code);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* An account's code in its own colour. The colour is the account's, set on the element. */
.acct {
  --acct: var(--acct-all);
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--acct);
  color: var(--acct-ink);
  font-size: 12px;
  line-height: 1.3;
}

.rail__account .acct,
.more__item .acct {
  min-width: 2.75rem;
  text-align: center;
}

.acct--amber { --acct: var(--acct-amber); }
.acct--blue { --acct: var(--acct-blue); }
.acct--violet { --acct: var(--acct-violet); }
.acct--teal { --acct: var(--acct-teal); }
.acct--rose { --acct: var(--acct-rose); }
.acct--olive { --acct: var(--acct-olive); }

.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  color: var(--text);
  font: 600 14px/1.2 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover,
.button:hover {
  border-color: var(--border-ui);
  color: var(--text);
}

.btn--go,
.button--primary {
  border-color: var(--go);
  background: var(--go);
  color: var(--go-ink);
}

.btn--go:hover,
.button--primary:hover {
  border-color: var(--go-hover);
  background: var(--go-hover);
  color: var(--go-ink);
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--link);
}

.btn--danger,
.button--danger {
  border-color: var(--blocked-ink);
  color: var(--blocked-ink);
}

.btn[disabled],
.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (min-width: 900px) {
  .btn,
  .button {
    min-height: 36px;
  }
}

.label {
  color: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}

.tag--held { background: var(--held); color: var(--held-ink); }
.tag--blocked { background: var(--blocked); color: var(--blocked-ink); }
.tag--ok { background: var(--ok); color: var(--ok-ink); }

/* A strip: the holder column is a real column filled with the account's colour. */
.strip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
  transition: box-shadow 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.strip:focus-within,
.strip--open {
  border-color: var(--go);
  box-shadow: var(--shadow-lift);
}

.strip__holder {
  --acct: var(--acct-all);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding-top: 12px;
  background: var(--acct);
  color: var(--acct-ink);
  font-size: 13px;
}

.strip__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
}

.strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
}

.strip.acct--amber > .strip__holder { --acct: var(--acct-amber); }
.strip.acct--blue > .strip__holder { --acct: var(--acct-blue); }
.strip.acct--violet > .strip__holder { --acct: var(--acct-violet); }
.strip.acct--teal > .strip__holder { --acct: var(--acct-teal); }
.strip.acct--rose > .strip__holder { --acct: var(--acct-rose); }
.strip.acct--olive > .strip__holder { --acct: var(--acct-olive); }

.strip.htmx-added {
  animation: strip-in 200ms var(--ease-out);
}

@keyframes strip-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (min-width: 900px) {
  .strip {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .strip__holder {
    font-size: 14px;
  }

  .strip__body {
    padding: 14px 18px;
  }
}

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

  .strip__actions {
    grid-column: 2;
    padding-top: 0;
  }
}

/* Bays: Needs you, Going out, Done today. */
.bay {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.bay--out {
  padding: 16px;
  border-radius: var(--radius-ctl);
  background: var(--bay-out);
}

.bay__title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0;
  font: 700 18px/1.2 var(--font-code);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.source {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-strip);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.source--outside {
  border: 1px dashed var(--source-outside-border);
  background: var(--source-outside);
  color: var(--source-ink);
}

.source--assistant {
  border: 1px solid var(--source-assistant-border);
  background: var(--source-assistant);
}

.source--assistant .label {
  color: var(--label-assistant);
}

.source > .label {
  display: block;
  margin-bottom: 6px;
}

.panel {
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  overflow: hidden;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tabs > [role="tab"][aria-selected="true"] {
  border-color: var(--border-ui);
  background: var(--rail);
  color: var(--rail-ink);
}

/* The undo countdown: the digits in --timer-ink, the bar a <progress> element (no inline width). */
.timer {
  color: var(--timer-ink);
  font: 700 16px/1 var(--font-code);
  letter-spacing: 0.04em;
}

.timer__bar {
  display: block;
  width: 100%;
  height: 3px;
  border: 0;
  background: var(--timer-track);
  color: var(--timer);
  -webkit-appearance: none;
  appearance: none;
}

.timer__bar::-webkit-progress-bar {
  background: var(--timer-track);
}

.timer__bar::-webkit-progress-value {
  background: var(--timer);
}

.timer__bar::-moz-progress-bar {
  background: var(--timer);
}

/* Motion off for anyone who asked: the strips, the timer bar and the switch. */
@media (prefers-reduced-motion: reduce) {
  .strip,
  .strip.htmx-added,
  .strip--arriving,
  .timer__bar {
    transition: none;
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* htmx request indicators (htmx's own injected <style> is disabled for the CSP). */
.htmx-indicator {
  opacity: 0;
  visibility: hidden;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease-in;
}

/* --- Today (redesign T5) ------------------------------------------------------------------
   Strips in three bays. A strip's holder column is the account's colour; text from outside is
   dashed and grey, the assistant's is solid and blue. Phone: one bay at a time (server-set tab);
   desktop: Needs you beside Going out, with Done today under Going out. */

.top-bar__sub {
  margin: 4px 0 0;
  color: var(--rail-ink-2);
  font-size: 13px;
}

.today-tools {
  display: none;
}

.bay-tabs {
  display: flex;
  margin-top: 12px;
  padding: 3px;
  border-radius: var(--radius-ctl);
  background: var(--rail-hover);
}

.bay-tabs__tab {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border-radius: 4px;
  color: var(--rail-ink);
  font-weight: 600;
  text-decoration: none;
}

.bay-tabs__tab:hover {
  color: var(--rail-ink-hi);
}

.bay-tabs__tab:focus-visible {
  outline: 2px solid var(--focus-rail);
  outline-offset: 1px;
}

.bay-tabs__tab[aria-selected="true"] {
  background: var(--strip);
  color: var(--text);
  font-weight: 700;
}

.today-notice {
  min-height: 0;
}

.notice__text {
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
}

.notice__text--problem {
  border-color: var(--blocked-ink);
  background: var(--blocked);
  color: var(--blocked-ink);
}

.notice__text--problem a {
  color: inherit;
}

.today-tabs {
  flex-wrap: nowrap;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.today-tabs__tab {
  flex: none;
  min-height: 44px;
}

.today-tabs__tab .code {
  color: var(--text-2);
  font-size: 13px;
}

.tabs > .today-tabs__tab[aria-selected="true"] .code {
  color: inherit;
  opacity: 0.85;
}

.today {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.today-page--out .today-tabs,
.today-page--done .today-tabs {
  display: none;
}

.today__side {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.today--needs .today__side,
.today--out #bay-needs,
.today--out #bay-done,
.today--done #bay-needs,
.today--done #bay-out {
  display: none;
}

.bay--needs {
  gap: 22px;
}

.bay__count {
  color: var(--text-2);
  font-size: 15px;
}

.bay__note {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.bay__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.group__meta {
  color: var(--text-2);
  font-weight: 500;
}

.group__hint {
  color: var(--text-2);
  font-size: 13px;
}

.group__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group__more {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.strip__head {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  align-items: baseline;
  min-width: 0;
}

.strip__title {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.strip__sub {
  max-width: 100%;
  color: var(--text-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.strip__meta {
  margin-left: auto;
  color: var(--text-2);
  font-size: 13px;
}

.strip__line {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.strip__problem {
  color: var(--blocked-ink);
  font-weight: 600;
}

/* A reply strip's base layout works everywhere: the body, then one row under it with Open and the
   primary action; an opened strip's panel is the full width of that row. */
.strip--reply {
  grid-template-columns: 44px minmax(0, 1fr);
}

@media (min-width: 900px) {
  .strip--reply {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

.strip--reply > .strip__holder {
  grid-row: 1 / span 2;
}

.strip--reply > .strip__actions {
  grid-column: 2 / -1;
  padding: 0 14px 12px;
}

.strip--reply .strip__open {
  flex: 0 0 auto;
}

.strip--reply .strip__open[open] {
  flex: 1 1 100%;
  order: 2;
}

.strip--reply .strip__open > summary {
  list-style: none;
}

.strip--reply .strip__open > summary::-webkit-details-marker {
  display: none;
}

.strip--reply .strip__open[open] > summary {
  margin-bottom: 12px;
}

.strip__panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.strip__open-open,
.strip__open[open] .strip__open-closed {
  display: none;
}

.strip__open[open] .strip__open-open {
  display: inline;
}

/* Where the browser can place a <details> panel (::details-content), Open sits in the action
   column beside the primary action. The strip's action column and its <details> add no boxes of
   their own (display: contents), so the summary and the primary are two cells of the strip's grid
   and the opened panel is a full-width second row. Everywhere else the base layout above stands. */
@supports selector(::details-content) {
  .strip--reply > .strip__actions,
  .strip--reply .strip__open {
    display: contents;
  }

  .strip--reply {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
  }

  .strip--reply > .strip__holder {
    grid-row: 1 / span 2;
  }

  .strip--reply > .strip__body {
    grid-column: 2;
    grid-row: 1;
  }

  @media (min-width: 900px) {
    .strip--reply {
      grid-template-columns: 56px minmax(0, 1fr) auto auto;
    }
  }

  .strip--reply .strip__open > summary {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    margin: 12px 0 0;
  }

  .strip--reply .strip__open[open] > summary {
    margin: 12px 14px 0 0;
  }

  .strip--reply .strip__primary {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
    margin: 12px 14px 0 8px;
  }

  .strip--reply .strip__open::details-content,
  .strip--reply .strip__panel {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .strip__panel {
    padding: 0 18px 16px 14px;
  }

  /* On a phone the two buttons sit in a row under the text. */
  @media (max-width: 599px) {
    .strip--reply {
      grid-template-columns: 44px auto minmax(0, 1fr);
    }

    .strip--reply > .strip__holder {
      grid-row: 1 / span 3;
    }

    .strip--reply > .strip__body {
      grid-column: 2 / -1;
    }

    .strip--reply .strip__open > summary {
      grid-column: 2;
      grid-row: 2;
      margin: 0 0 12px 14px;
    }

    .strip--reply .strip__primary {
      grid-column: 3;
      grid-row: 2;
      justify-self: start;
      margin: 0 14px 12px 8px;
    }

    .strip--reply .strip__open::details-content,
    .strip--reply .strip__panel {
      grid-row: 3;
    }
  }
}

/* The collapsed strip's one line of the draft; the opened strip shows all of it below. */
.strip__preview {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip:has(.strip__open[open]) .strip__preview {
  display: none;
}

.strip__sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.strip__sources:empty {
  display: none;
}

.strip__why {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.strip__row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.strip__row-actions > form {
  margin: 0;
}

.strip__row-actions > details[open] {
  order: 2;
  flex: 1 1 100%;
}

.strip__row-actions > .strip__meta {
  margin-left: auto;
}

/* An opened strip has its one action row; the compact primary steps aside, and the strip takes
   the focus border and depth the board gives the strip being worked on. */
.strip:has(.strip__open[open]) .strip__primary {
  display: none;
}

.strip:has(.strip__open[open]) {
  border-color: var(--go);
  box-shadow: var(--shadow-lift);
}

.strip__cat {
  color: var(--text-2);
}

.today-filter-note {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 14px;
}

.group__more a,
.strip__row--more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.today-notice:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.strip__more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.strip__rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.strip__row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.strip__row-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip__row .strip__meta {
  flex: none;
  margin-left: 0;
}

.strip__row--more {
  justify-content: flex-start;
  font-weight: 600;
}

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

.strip__foot .strip__meta {
  margin-left: 0;
  font-size: 12px;
}

.strip--out {
  grid-template-columns: 44px minmax(0, 1fr);
}

.strip--out .strip__body {
  padding: 10px 12px;
}

.strip--out .strip__head {
  flex-wrap: nowrap;
  justify-content: space-between;
}

.strip--out .strip__title {
  font-size: 15px;
}

.strip--out .timer {
  flex: none;
  font-size: 20px;
}

.strip--out .btn {
  min-height: 44px;
}

.strip--group {
  grid-template-columns: 44px minmax(0, 1fr);
}

.strip--question .strip__title,
.strip--learned .strip__title,
.strip--memory .strip__title {
  font-size: 15px;
}

.label--assistant {
  margin: 0;
  color: var(--label-assistant);
}

.strip__actions form {
  margin: 0;
}

.strip__actions .btn:disabled {
  opacity: 0.55;
}

.done-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.done-list__row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.done-list__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.done-list .acct {
  font-size: 11px;
  line-height: 1.2;
}

.done-list .strip__meta {
  margin-left: 0;
}

.acct--blocked {
  background: var(--blocked);
  color: var(--blocked-ink);
}

.done-link {
  font-size: 14px;
  font-weight: 600;
}

/* The strip that arrives in Going out (static/app.js adds the class; off under reduced motion). */
.strip--arriving {
  animation: strip-arrive 240ms var(--ease-out);
}

@keyframes strip-arrive {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rail__note {
  margin: 0;
  color: var(--rail-ink);
  font-size: 13px;
}

.rail__note-sub {
  color: var(--rail-ink-2);
}

.rail__spend {
  font-size: 13px;
}

.rail__spend-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.rail__meter {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 6px;
  border: 0;
  border-radius: 2px;
  background: var(--rail-rule);
  color: var(--badge);
  -webkit-appearance: none;
  appearance: none;
}

.rail__meter::-webkit-progress-bar {
  border-radius: 2px;
  background: var(--rail-rule);
}

.rail__meter::-webkit-progress-value {
  border-radius: 2px;
  background: var(--badge);
}

.rail__meter::-moz-progress-bar {
  border-radius: 2px;
  background: var(--badge);
}

@media (min-width: 900px) {
  .top-bar__sub {
    color: var(--text-2);
    font-size: 15px;
  }

  .top-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: flex-end;
    justify-content: space-between;
  }

  .top-bar__title {
    flex: 1 0 100%;
  }

  .top-bar__sub {
    flex: 1;
    margin: 0;
  }

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

  .today-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-ctl);
    background: var(--strip);
  }

  .today-search__field:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  .today-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
  }

  .bay-tabs {
    display: none;
  }

  .today-page--out .today-tabs,
  .today-page--done .today-tabs {
    display: flex;
  }

  .today {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
  }

  .today > .bay--needs {
    flex: 999 1 520px;
    min-width: 0;
  }

  .today__side {
    flex: 1 1 300px;
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius-ctl);
    background: var(--bay-out);
  }

  .today--needs .today__side,
  .today--out #bay-needs,
  .today--out #bay-done,
  .today--done #bay-needs,
  .today--done #bay-out {
    display: flex;
  }

  .today__side .bay--out {
    padding: 0;
    background: none;
  }

  .strip--out .btn {
    min-height: 32px;
    padding: 0 10px;
  }

  .strip--out .timer {
    font-size: 16px;
  }

  .strip--out {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .strip--group {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .strip--cleanup-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

/* --- Pages --------------------------------------------------------------------------------
   Rules the first pages were written against, on the tokens above. Each page moves to the
   components as its own task restyles it. */

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  color: var(--text);
  font: inherit;
}

.card {
  margin-bottom: var(--space);
  padding: var(--space);
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
}

.muted {
  color: var(--text-2);
}

/* Offline page */
.offline {
  display: grid;
  place-content: center;
  gap: var(--space);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space);
  text-align: center;
}

/* --- Identity and setup ------------------------------------------------------ */

.stack {
  display: grid;
  gap: 0.5rem;
}

.stack input,
.card input,
.card select {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--strip-border);
  border-radius: 0.5rem;
  background: var(--strip);
  color: var(--text);
}

.form-error {
  color: var(--blocked-ink);
}

.recovery-codes {
  margin: 0;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--bay);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

/* Setup, sign-in, the wizard and the Google account result: no rail, no tab bar, no top bar. A
   centred panel on the bay ground under the assistant's name in the condensed face. */
.content--auth {
  display: grid;
  align-content: start;
  justify-items: center;
  max-width: none;
  padding-top: calc(var(--space) * 2 + env(safe-area-inset-top));
}

.auth {
  width: 100%;
  max-width: 32rem;
}

.auth-brand {
  margin: 0 0 12px;
  color: var(--text);
  font: 700 28px/1.1 var(--font-code);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.auth-panel {
  padding: 20px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
}

.auth-title {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.auth-section:not([hidden]) + .auth-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.auth-heading {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.auth-section > p,
.auth-section > ol {
  margin: 0 0 12px;
}

.auth-section > .btn,
.auth-section .stack .btn {
  justify-self: start;
}

.auth-panel .btn {
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
  text-align: center;
}

.auth-panel .stack input,
.auth-panel .stack select {
  width: 100%;
  min-height: 44px;
}

.auth-panel .stack label {
  font-weight: 600;
}

.auth-panel .callout {
  margin: 0 0 12px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wizard-progress {
  margin: 0 0 8px;
  font-weight: 600;
}

.wizard-steps {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--text-2);
}

.wizard-steps li[aria-current="step"] {
  color: var(--text);
  font-weight: 700;
}

.wizard-guide {
  padding-left: 22px;
}

.wizard-guide code {
  overflow-wrap: anywhere;
}

@media (min-width: 900px) {
  .content--auth {
    padding-top: 64px;
  }

  .auth-title {
    font-size: 34px;
  }

  .auth-panel {
    padding: 28px;
  }
}

/* --- Inbox (Task 42) ------------------------------------------------------------ */

/* Text from emails, drafts and models: plain text, line breaks kept, long URLs wrap. */
.untrusted,
.card__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inbox-section {
  margin-bottom: calc(var(--space) * 1.5);
}

.inbox-section:focus {
  outline: none;
}

.inbox-section__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.action-card__title {
  margin: 0;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.action-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--text-2);
  font-size: 0.875rem;
}

.risk-badge {
  padding: 0 0.5rem;
  border: 1px solid var(--strip-border);
  border-radius: 999px;
}

.risk-badge--high {
  border-color: var(--blocked-ink);
  color: var(--blocked-ink);
}

.action-card__notice,
.action-card__draft {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--source-assistant-border);
  border-radius: var(--radius-strip);
  background: var(--source-assistant);
}

.action-card__fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.75rem;
}

.action-card__fields dt {
  color: var(--text-2);
}

.action-card__fields dd {
  margin: 0;
}

.card__body {
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--strip-border);
  border-radius: 0.5rem;
  background: var(--bay);
}

.card__rationale {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.card__rationale p {
  margin: 0;
}

.suggested-label {
  margin: 0 0 0.25rem;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}

.action-card__actions form,
.action-card__more {
  margin: 0;
}

.action-card__more[open] {
  flex-basis: 100%;
}

.action-card__more > summary {
  list-style: none;
}

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

.action-card__more[open] > summary {
  margin-bottom: 0.5rem;
}

.action-card__countdown {
  margin: 0 0 0.5rem;
  font-variant-numeric: tabular-nums;
}

.card--notice {
  border: 1px solid var(--source-assistant-border);
  background: var(--source-assistant);
}

.card--problem {
  border: 1px solid var(--blocked-ink);
  background: var(--blocked);
}

.notice__text {
  margin: 0;
}

.question__text {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.question__subject {
  margin: 0 0 0.5rem;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 400;
}

.choice input {
  width: auto;
  min-height: 0;
}

.hours__day {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.75rem;
}

.hours__name {
  grid-column: 1 / -1;
  font-weight: 600;
}

.hours__day .choice {
  grid-column: 1 / -1;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (min-width: 40rem) {
  .hours__day {
    grid-template-columns: 7rem auto 1fr auto 1fr auto;
    align-items: center;
  }

  .hours__name,
  .hours__day .choice {
    grid-column: auto;
  }

  .hours__day label {
    margin: 0;
  }
}

/* --- Chat: pieces shared with My settings and the Analysis card -------------------------- */

.bubble__text {
  margin: 0;
}

.chat-onboarding__bar {
  width: 100%;
}

.chat-onboarding__list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.chat-onboarding__area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chat-onboarding__area form {
  margin: 0;
}

.analysis-card__items {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.analysis-card__item {
  margin-bottom: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--strip-border);
}

.analysis-card__item p,
.analysis-card__item blockquote {
  margin: 0 0 0.5rem;
}

.analysis-card__item blockquote {
  padding-left: 0.75rem;
  border-left: 1px solid var(--strip-border);
  color: var(--text-2);
}

.setup-banner {
  border: 1px solid var(--held-ink);
  background: var(--held);
}

.setup-banner form {
  margin: 0.5rem 0 0;
}

/* --- What I learned, Brain and My settings (Task 44) ----------------------------------- */

.form-ok {
  color: var(--text-2);
}

.sensitive-badge {
  padding: 0 0.5rem;
  border: 1px solid var(--blocked-ink);
  border-radius: 999px;
  color: var(--blocked-ink);
}

.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space);
}

.search label {
  flex-basis: 100%;
}

.search input {
  flex: 1 1 12rem;
  width: auto;
}

.change-table {
  width: 100%;
  margin: 0 0 0.75rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.change-table th,
.change-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--strip-border);
  text-align: left;
  vertical-align: top;
}

.change-table td .suggested-label {
  display: block;
}

.learned-item__evidence {
  margin: 0 0 0.75rem;
}

.learned-item__evidence-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.setting-field .stack {
  gap: 0.35rem;
}

/* --- Control, Accounts and Activity (redesign T8) ---------------------------------------------
   Control, Accounts and the account's own page are columns of panels; Activity is a filter bar and
   strips. Warnings and problems are tinted boxes with a 1px border and a text label, never a side
   stripe. Borders are 1px. Controls are 44px tall at every width, and from 900px a few of them are
   36-40px as the boards draw them. This section sits before the Chat and Brain ones on purpose:
   their tests read from their own markers to the end of the file. */

.content--control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 20px;
  max-width: none;
}

.content--control > p,
.content--control > form {
  margin: 0;
}

.panel[tabindex="-1"]:focus {
  outline: none;
}

.panel__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.panel > .panel__title {
  padding: 16px 20px 0;
}

.panel__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px 8px;
}

.panel__head > p {
  margin: 0;
}

.panel__head--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.panel__block {
  padding: 12px 20px 18px;
}

.panel__block + .panel__block {
  border-top: 1px solid var(--rule);
}

.panel__block > p {
  margin-top: 0;
}

.panel__subtitle {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.panel__empty {
  margin: 0;
  padding: 12px 20px 18px;
  color: var(--text-2);
}

.panel--held {
  border-color: var(--held-ink);
  background: var(--held);
}

.form--narrow {
  max-width: 32rem;
}

.form--narrow input,
.form--narrow select {
  min-height: 44px;
}

/* Forms stacked in one section keep a section's gap between them. */
.form--narrow + .form--narrow {
  margin-top: 24px;
}

/* A submit button under a narrow field is a normal button at the field's left edge. */
.form--narrow > .btn {
  justify-self: start;
}

/* A disclosure whose summary is a panel heading (Control's Diagnostics). */
.panel__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.panel__summary::-webkit-details-marker {
  display: none;
}

.panel__summary::before {
  flex: none;
  width: 8px;
  height: 8px;
  border: solid currentcolor;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(-45deg);
  transition: transform 160ms var(--ease-out);
}

.panel__disclosure[open] > .panel__summary::before {
  transform: rotate(45deg);
}

.panel__disclosure > .panel__summary {
  padding: 8px 20px;
}

.panel__summary .panel__title {
  margin: 0;
}

.panel__summary-note {
  color: var(--text-2);
  font-size: 14px;
}

.exclusion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
}

.exclusion p {
  margin: 0;
}

/* Right now */
.now__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 40px;
  padding: 12px 20px 18px;
}

.now__item {
  flex: 1 1 220px;
  min-width: 0;
}

.now__item .label {
  margin: 0;
}

.now__text {
  margin: 4px 0 0;
  font-size: 15px;
}

.now__action {
  margin-left: auto;
}

.now__action form {
  margin: 0;
}

/* Earned autonomy beside the list of limits */
.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
}

.control-row__main {
  flex: 999 1 520px;
  min-width: 0;
}

.control-row__side {
  flex: 1 1 300px;
  min-width: 0;
}

.jump {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}

.jump__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 20px;
  border-top: 1px solid var(--rule);
  color: var(--text);
  text-decoration: none;
}

.jump__link:hover {
  background: var(--bay);
  color: var(--text);
}

.jump__value {
  color: var(--text-2);
  text-align: right;
}

/* Tables */
.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  padding-block: 10px;
  color: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table__name {
  font-weight: 600;
}

.data-table__end {
  text-align: right;
  white-space: nowrap;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Accounts: three slots on every row (Settings, the state action, Disconnect), so the column reads
   the same down the table; a row that has no Disconnect leaves its slot empty. */
.acct-table .table-actions {
  display: grid;
  grid-template-columns: 5rem minmax(9.5rem, max-content) minmax(11rem, max-content);
  justify-content: end;
}

.acct-table .table-actions > * {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.acct-table .table-actions .btn {
  width: 100%;
  white-space: nowrap;
}

.table-actions form {
  margin: 0;
}

.table-actions .btn,
.acct-row__action {
  min-height: 44px;
}

@media (min-width: 900px) {
  .table-actions .btn,
  .acct-row__action {
    min-height: 36px;
  }
}

.acct-table {
  min-width: 900px;
}

.acct-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.acct-cell__text {
  display: flex;
  flex-direction: column;
  min-width: 12rem;
  overflow-wrap: break-word;
}

.acct-table .acct {
  min-width: 44px;
  text-align: center;
}

/* On a phone an account is a block, not a row of a wide table, and a button that carries an
   account's label may wrap instead of running off the screen. */
@media (max-width: 599px) {
  .table-actions .btn,
  .strip__actions .btn {
    max-width: 100%;
    height: auto;
    white-space: normal;
    text-align: center;
  }

  .acct-table {
    min-width: 0;
  }

  .acct-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .acct-table tr {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule);
  }

  .acct-table td {
    display: block;
    padding: 4px 0;
    border: 0;
  }

  .acct-table .data-table__end {
    text-align: left;
    white-space: normal;
  }

  .acct-table .table-actions {
    display: flex;
    justify-content: flex-start;
  }
}

/* Warnings and problems: a tinted box with a 1px border and a text label. */
.callout {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--source-assistant-border);
  border-radius: var(--radius-strip);
  background: var(--source-assistant);
  color: var(--text);
}

.callout--warning {
  border-color: var(--held-ink);
  background: var(--held);
  color: var(--held-ink);
}

.callout--problem {
  border-color: var(--blocked-ink);
  background: var(--blocked);
  color: var(--blocked-ink);
}

.callout__label {
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The colour and code of an account */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.swatches > legend {
  width: 100%;
  margin-bottom: 4px;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  cursor: pointer;
}

.swatch input {
  flex: none;
  width: 20px;
  min-height: 0;
  height: 20px;
  margin: 0;
  padding: 0;
}

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

.swatch__chip {
  display: inline-block;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--acct);
  color: var(--acct-ink);
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}

.swatch__name {
  font-weight: 600;
}

.code-field {
  max-width: 8rem;
  font-family: var(--font-code);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Activity: the filter bar and the strips under it */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
}

.filters__field {
  display: flex;
  flex: 1 1 180px;
  flex-direction: column;
  gap: 4px;
}

.filters__field label {
  margin: 0;
  color: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filters__field select {
  min-height: 44px;
}

.filters__go,
.filters__clear {
  min-height: 44px;
}

@media (min-width: 900px) {
  .filters__field select,
  .filters__go,
  .filters__clear {
    min-height: 40px;
  }
}

.activity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity > p {
  margin: 0;
}

.activity-entry .strip__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.activity-entry .action-card__meta {
  margin: 0;
}

.activity-entry .action-card__countdown {
  margin: 0;
}

.activity-entry .muted,
.activity-entry .form-error {
  margin: 0;
}

.strip--problem {
  border-color: var(--blocked-ink);
}

/* A run of identical actions: one strip with a count, the entries under a closed disclosure. */
.activity-group__more > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

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

.activity-group__rows {
  display: flex;
  flex-direction: column;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.activity-group__row {
  padding: 8px 0;
  border-top: 1px solid var(--strip-border);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.activity-group__row:target {
  background: var(--held);
}

.activity-entry .strip__actions {
  flex-direction: column;
  align-items: flex-start;
}

/* --- Chat redesign (T6) --------------------------------------------------------------- */
/* The conversation list: in the rail on a desktop, at the top of the page on a phone. */

.chat-convos__heading {
  margin: 0 12px 4px;
  color: var(--label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-convos__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-convos__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-ctl);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.chat-convos__link[aria-current="true"] {
  background: var(--strip);
  border: 1px solid var(--strip-border);
}

.chat-convos__note {
  color: var(--text-2);
  font-size: 12px;
}

.chat-convos--rail {
  display: none;
}

.chat-convos--page {
  margin-bottom: var(--space);
}

@media (min-width: 900px) {
  .chat-convos--page {
    display: none;
  }

  .chat-convos--rail {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .chat-convos--rail .chat-convos__heading {
    color: var(--rail-ink-2);
  }

  .chat-convos--rail .chat-convos__link {
    min-height: 44px;
    color: var(--rail-ink);
  }

  .chat-convos--rail .chat-convos__link[aria-current="true"] {
    border-color: transparent;
    background: var(--rail-hover);
  }

  .chat-convos--rail .chat-convos__note {
    color: var(--rail-ink-2);
  }
}

/* The page: the conversation, then the side panel (beside it once there is room). */

.chat-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.chat-main {
  flex: 999 1 520px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 820px;
}

.chat-side {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border-radius: 6px;
  background: var(--bay-out);
}

.chat-side__title {
  margin: 0;
  font-size: 18px;
}

.chat-side__item {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
  font-size: 14px;
}

.chat-side__item p {
  margin: 0 0 4px;
}

.chat-side__meta {
  color: var(--text-2);
  font-size: 13px;
}

.chat-side__subject {
  overflow-wrap: anywhere;
}

.chat-side__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
}

.chat-side__empty {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

/* Messages: the owner's in the primary colour, the assistant's on a strip-coloured card. */

.chat__history {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 var(--space);
  padding: 0;
  list-style: none;
}

.bubble {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  font-size: 15px;
  line-height: 1.5;
}

.bubble--owner {
  align-self: flex-end;
  max-width: 78%;
  margin: 0;
  border-color: var(--go);
  border-radius: 8px 8px 2px 8px;
  background: var(--go);
  color: var(--go-ink);
}

.bubble--assistant {
  max-width: 86%;
  margin: 0;
  border-radius: 8px 8px 8px 2px;
}

.bubble--card {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
}

.chat__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--strip);
}

.chat__form textarea {
  border: 0;
  outline: 0;
  resize: vertical;
  font-size: 15px;
}

.chat__form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* The composer's one row: Attach, the note, then Send on the right. */
.chat__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.chat__row .chat__limits {
  flex: 1 1 220px;
  min-width: 0;
}

.chat__row .btn--go {
  margin-left: auto;
}

.chat__attach {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat__attach:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chat__attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.chat__attached {
  color: var(--text-2);
  font-size: 13px;
}

.chat__limits {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

/* A memory waiting for the owner: a held (amber) box with its own decide forms. */

.chat-memory {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memory-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--timer);
  border-radius: var(--radius-strip);
  background: var(--held);
  color: var(--text);
}

.memory-card p {
  margin: 0;
}

.memory-card__kind {
  color: var(--held-ink);
}

.memory-card__text {
  font-size: 15px;
}

.memory-card__why {
  color: var(--text-2);
  font-size: 13px;
}

.memory-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.memory-card__actions form {
  margin: 0;
}

/* Onboarding and setup. Every control is a 44px target on a phone. */

.chat-onboarding {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--strip-border);
  border-radius: var(--radius-strip);
  background: var(--strip);
}

.chat-onboarding > * {
  margin: 0;
}

.chat-onboarding__areas summary,
.chat-side__setup summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.chat-onboarding__areas summary::-webkit-details-marker,
.chat-side__setup summary::-webkit-details-marker {
  display: none;
}

/* A visible marker: a chevron that turns when the list is open. */
.chat-onboarding__areas summary::before,
.chat-side__setup summary::before {
  flex: none;
  width: 8px;
  height: 8px;
  border: solid currentcolor;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(-45deg);
  transition: transform 160ms var(--ease-out);
}

.chat-onboarding__areas[open] > summary::before,
.chat-side__setup[open] > summary::before {
  transform: rotate(45deg);
}

.chat-side__setup {
  padding-block: 0;
}

.chat-onboarding__area .btn {
  min-height: 44px;
}

/* No coloured side stripe on a chat surface: a notice is a bordered box like the rest. */

.content--chat .card--notice,
.content--chat .card--problem {
  border: 1px solid var(--strip-border);
}

.content--chat .card--problem {
  border-color: var(--blocked-ink);
}

.content--chat .analysis-card__item blockquote {
  padding-left: 0.75rem;
  border-left: 1px solid var(--strip-border);
}

@media (max-width: 599px) {
  .bubble--owner,
  .bubble--assistant {
    max-width: 94%;
  }
}

/* --- Brain (redesign T7) ------------------------------------------------------------------
   People is two panes (the list, and the person) beside the Brain sidebar; on a phone they stack,
   the person first. Borders are 1px. An account's colour would live in a holder column, never a
   side stripe. Every link and button on these pages is 44px tall at every width. */

.content--brain {
  max-width: none;
}

.content--brain input:not([type="checkbox"]):not([type="hidden"]),
.content--brain select {
  min-height: 44px;
}

.content--brain .source {
  margin: 0 0 12px;
}

.content--brain .source p,
.content--brain .source dl {
  margin: 0;
}

.person-form input,
.person-form select,
.person-form textarea,
.brain-search input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-ctl);
  background: var(--strip);
  color: var(--text);
  font: inherit;
}

.brain-people {
  display: grid;
  gap: 16px;
  align-items: start;
}

.brain-pane {
  margin: 0;
}

.brain-pane__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}

.brain-pane__head--bare {
  padding: 0 0 12px;
}

.brain-pane__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.brain-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
}

.brain-search label {
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 600;
}

.brain-search input {
  flex: 1 1 10rem;
  min-width: 0;
}

.brain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brain-list > li {
  border-top: 1px solid var(--rule);
}

.brain-empty {
  padding: 12px 20px;
  color: var(--text-2);
}

.person-row {
  position: relative;
  padding: 0 16px 10px;
}

.person-row:has(a[aria-current="page"]) {
  background: var(--source-assistant);
}

.person-row__name {
  margin: 0;
  font-size: 15px;
}

.person-row__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.person-row__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.person-row__link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.person-row__meta {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.person-head {
  padding: 18px 20px 12px;
}

.person-head__name {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.person-head__line {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

.brain-section {
  padding-bottom: 10px;
  border-top: 1px solid var(--rule);
}

.brain-section__title {
  margin: 0;
  padding: 14px 20px 6px;
  font-size: 15px;
}

.person-form {
  max-width: 36rem;
  padding: 4px 20px 14px;
}

.person-form label {
  font-size: 13px;
  font-weight: 600;
}

.person-form__note {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

.fact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 20px;
}

.fact-row__text {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.fact-row__source {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.fact-row__action {
  min-width: 44px;
  min-height: 44px;
}

.fact-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.fact-row__actions form {
  margin: 0;
}

.person-row__holder {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
}

.brain-more {
  margin: 0;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--rule);
}

.brain-recent {
  margin: 0 20px 10px;
}

.brain-recent__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brain-recent__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.brain-recent__kind {
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--rule);
  font-size: 11px;
}

.brain-recent__title {
  flex: 1;
  min-width: 0;
}

.brain-recent__date {
  color: var(--text-2);
}

.sensitive-badge.code {
  display: inline-block;
  padding: 0 6px;
  border-radius: 2px;
  font-size: 12px;
}

@media (min-width: 900px) {
  .brain-people--open {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  }

  .brain-people--open .brain-people__list {
    grid-column: 1;
    grid-row: 1;
  }

  .brain-people--open .brain-people__person {
    grid-column: 2;
    grid-row: 1;
  }
}
