/* Implentio OS Admin: the few rules the app needs on top of Keel (keel/components.css). Tokens only. */

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Sign-in, not allowed, sign-in failed: the product mark (with the Rive orbit on sign-in), one card, a footer. */
.bare {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
.bare__main {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6) var(--space-4);
}
/* A faint dot grid behind the card, fading out towards the edges of the window. */
.bare__main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--border) 1px, transparent 1.5px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 55% 50% at 50% 45%, currentColor, transparent 80%);
}
.bare__stack {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  width: min(420px, 100%);
}
.bare__hero {
  position: relative;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  margin: calc(var(--space-6) * -1) 0 calc(var(--space-2) * -1);
}
.bare__hero > .rive--orbit {
  position: absolute;
  inset: 0;
}
.orbit-still {
  width: 160px;
  height: 160px;
}
.orbit-still__node {
  fill: var(--accent-solid);
}
.bare__mark {
  position: relative;
  width: var(--mark-lg);
  height: var(--mark-lg);
  border-radius: var(--radius-lg);
  font-size: var(--fs-14);
  box-shadow:
    0 0 0 6px var(--bg),
    var(--shadow-2);
}
.bare__tile {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: var(--space-4) 0;
  border: var(--bw) solid;
  border-radius: var(--radius-xl);
}
.bare__tile--warn {
  background: var(--warn-subtle);
  border-color: var(--warn-border);
  color: var(--warn-fg);
}
.bare__tile--bad {
  background: var(--bad-subtle);
  border-color: var(--bad-border);
  color: var(--bad-fg);
}
.bare__card {
  width: 100%;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
}
.bare__title {
  display: grid;
  gap: var(--space-1);
  text-align: center;
}
.bare__name {
  font-size: var(--fs-24);
  line-height: var(--lh-24);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
}
.bare__button {
  width: 100%;
  justify-content: center;
}
.bare__dev {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
  border: var(--bw) dashed var(--border-control);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.bare__dev-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
}
.bare__person {
  width: 100%;
  height: auto;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  white-space: normal;
}
.bare__person-text {
  flex: 1;
  display: grid;
  gap: 2px;
}
.bare__person-text b {
  font-weight: var(--fw-semibold);
}
.bare__person > .icon {
  color: var(--text-subtle);
}
.bare__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-1h);
  margin: 0;
}

/* User menu in the top bar: a native details element, so it works without script. */
.user-menu {
  position: relative;
}
.user-menu > summary {
  list-style: none;
  cursor: pointer;
}
.user-menu > summary::-webkit-details-marker {
  display: none;
}
.user-menu > .menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  display: grid;
  gap: var(--space-1);
}
.menu__label {
  padding: var(--space-1) var(--space-2) 0;
}
.user-menu form {
  margin: 0;
}

.note-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.note-block {
  margin-top: var(--space-4);
}
.switch-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--fs-13);
}

/* Setup steps on a connection page: numbered, with the screenshots from the setup guide. */
.setup-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.setup-step {
  grid-template-columns: 22px minmax(0, 1fr);
}
.setup-step .check-step__tick {
  color: var(--text-muted);
  font-size: var(--fs-11);
}
.setup-step__main p {
  margin: var(--space-1) 0 0;
}
.setup-step__action {
  margin: var(--space-2) 0 0;
}
/* Values a setup step asks for: each one a button that copies it. */
.copy-values {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
}
.copy-value {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  padding: 2px var(--space-2);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-13);
  cursor: pointer;
}
.copy-value:hover {
  border-color: var(--border-strong, var(--border));
}
.copy-value__label {
  color: var(--text-muted);
}
.copy-value code {
  overflow-wrap: anywhere;
}
.paste-file {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}
.paste-file__show > summary {
  cursor: pointer;
  width: max-content;
  color: var(--text-subtle);
  font-size: var(--fs-12);
}
.paste-file__show pre {
  max-height: 320px;
  overflow: auto;
  margin: var(--space-1) 0 0;
  padding: var(--space-2);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font: var(--fw-regular) var(--fs-12) / 18px var(--font-mono);
}
.setup-step__figure {
  margin: var(--space-3) 0 0;
  max-width: 640px;
}
.setup-step__figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: var(--bw) solid var(--border);
}

.dialog__foot {
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--space-4) var(--space-4);
}
.ai-panel .secure-form {
  margin-top: var(--space-2);
}

/* Every Keys card (views/keys-card.ts): once keys are stored, a saved panel in place of the form (what is stored,
   names and versions only, the test, the next step), the form behind Change the keys (Youssef, 2026-11-02: a toast
   was missed and the card looked as before the save). */
.keys-card {
  display: grid;
  gap: var(--space-2);
}
.key-fields__row {
  display: contents;
}
.key-fields dd {
  overflow-wrap: anywhere;
}
.key-next {
  display: grid;
  gap: var(--space-1);
  margin: 0;
}
p.key-next {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.key-next .t-meta {
  margin: 0;
}
.key-result__saved,
.key-test {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-13);
  line-height: var(--lh-13);
  overflow-wrap: anywhere;
}
.key-result__saved > .icon,
.key-test > .icon {
  flex: none;
  margin-top: 2px;
}
.key-result__saved,
.key-test--ok {
  border-color: var(--ok-border);
  background: var(--ok-subtle);
}
.key-result__saved > .icon,
.key-test--ok > .icon {
  color: var(--ok-fg);
}
.key-test--bad {
  border-color: var(--bad-border);
  background: var(--bad-subtle);
}
.key-test--bad > .icon {
  color: var(--bad-fg);
}
.key-test--pending,
.key-test--none {
  background: var(--surface-2);
  color: var(--text-muted);
}
.key-test > .btn {
  flex: none;
  margin-left: auto;
}
.key-test[aria-busy="true"] {
  opacity: 0.7;
}
/* The stored state of a secret field wraps in a narrow card (the AI panel) instead of running out of its box. */
.secret-saved {
  height: auto;
  min-height: var(--control-h-md);
  flex-wrap: wrap;
  padding-block: 4px;
}
.secret-saved--unset {
  color: var(--text-subtle);
}
.secret-saved code {
  font-size: var(--fs-12);
}

/* Workflow drafts: a source chip opens to the row or message it came from (a native details element). */
.source-detail {
  display: inline-block;
  max-width: 100%;
}
.source-detail > summary {
  cursor: pointer;
  list-style: none;
}
/* A long label wraps inside the chip (a phone is narrower than some labels); the page never scrolls sideways. */
.source-detail > summary.source {
  height: auto;
  min-height: 20px;
  max-width: 100%;
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: var(--lh-12);
  white-space: normal;
  overflow-wrap: anywhere;
}
.source-detail > summary::-webkit-details-marker {
  display: none;
}
.source-detail[open] {
  display: block;
  margin: var(--space-1) 0;
}
.source-detail__body {
  margin-top: var(--space-1);
  padding: var(--space-2);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-12);
  overflow-wrap: anywhere;
}

/* A long id (task, run, draft) inside a row breaks anywhere instead of pushing the row wider. */
.id-wrap {
  overflow-wrap: anywhere;
}

/* The "run now" form of a workflow: space between the question and its button. */
.run-now {
  display: grid;
  gap: var(--space-3);
}

/* The admin AI's Markdown (markdown.js): headings as bold lines, not titles; compact lists; code in an inset well. */
.msg__md .md-h {
  font-weight: var(--fw-semibold);
}
.msg__md .md-list {
  margin: 0;
  padding-left: var(--space-5);
}
.msg__md .md-list li + li,
.msg__md li > .md-list {
  margin-top: var(--space-1);
}
.msg__md li > p + p {
  margin-top: var(--space-2);
}
.msg__md .md-code {
  padding: 0 var(--space-1);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.msg__md .md-pre {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-12);
  line-height: var(--lh-12);
  overflow-x: auto;
}
.msg__md .md-quote {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}
.msg__md .md-hr {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: var(--bw) solid var(--border);
}
.msg__md a {
  overflow-wrap: anywhere;
}

/* Images in the chat: the tray above the box (each with a remove button), and the thumbnails of a sent message. */
.composer__images {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-1);
}
.composer__thumb {
  position: relative;
  display: inline-flex;
}
.img-thumb {
  display: block;
  height: 56px;
  width: auto;
  max-width: 180px;
  object-fit: cover;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.composer__thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: var(--bw) solid var(--border-control);
  border-radius: var(--radius-full);
  background: var(--surface-1);
  color: var(--text-muted);
  cursor: pointer;
}
.composer__thumb-remove:hover {
  color: var(--text);
}
.msg__images {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1h);
  max-width: 88%;
}
aside[data-drop] .composer__box {
  outline: var(--focus-w) dashed var(--focus-ring);
  outline-offset: 2px;
}
/* With images waiting to be sent: never one that shows a key. */
.composer__warn {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  margin: 0 0 var(--space-1);
  color: var(--warn-fg);
  font-size: var(--fs-12);
  line-height: var(--lh-12);
}
.composer__warn[hidden] {
  display: none;
}
/* A web call's link on its activity line: the page it read. */
.activity {
  flex-wrap: wrap;
}
.activity__link {
  max-width: 40ch;
  overflow: hidden;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity__link:hover {
  color: var(--text);
}
/* A web search's Google Search Suggestions (src/web/search-suggestions.ts): Google's own look inside the frame (its CSS
   picks light or dark), the full width of the answer, no border or background of ours. */
.search-suggestions {
  display: block;
  width: 100%;
  height: 56px;
  margin: var(--space-1) 0 var(--space-2);
  border: 0;
  background: transparent;
}

/* Health: setup steps the admin AI found wrong, with the way that worked. */
.setup-reports__lede {
  margin: 0 0 var(--space-3);
}
.setup-reports {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.setup-report {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}
.setup-report__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1h);
}
.setup-report__when {
  margin-left: auto;
}
.setup-report p {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Agents: what an agent does in one muted line under its name; status and mode side by side, the reason of "needs a
   person" under them; the last run under the trigger; a second count under the first. On a phone each agent is a card:
   name and state, who it runs as, the trigger, the decisions that wait and the row's action. */
.agent__about {
  display: block;
  min-width: 10rem;
  max-width: 24rem;
  margin-top: var(--space-1);
  color: var(--text-muted);
}
.agent__sub {
  display: block;
  margin-top: var(--space-1);
}
.agent__why {
  max-width: 11rem;
}
.agent__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.agent__badges .badge {
  white-space: nowrap;
}
@container (max-width: 600px) {
  .table--agents.table--cards tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name state" "runs runs" "when when" "waiting actions";
  }
  .table--agents .ag__name {
    grid-area: name;
  }
  .table--agents .ag__state {
    grid-area: state;
    justify-self: end;
  }
  .table--agents .agent__badges {
    flex-direction: column;
    align-items: flex-end;
  }
  .table--agents .agent__why {
    text-align: right;
  }
  .table--agents .ag__runs {
    grid-area: runs;
  }
  .table--agents .ag__when {
    grid-area: when;
  }
  .table--agents .ag__when .agent__sub {
    display: inline;
    margin-left: var(--space-2);
  }
  .table--agents .ag__waiting {
    grid-area: waiting;
  }
  .table--agents .ag__actions {
    grid-area: actions;
    justify-self: end;
  }
  .table--agents .agent__about {
    min-width: 0;
  }
  .table--agents .ag__runs::before,
  .table--agents .ag__when::before,
  .table--agents .ag__waiting::before {
    content: attr(data-label) ": ";
    color: var(--text-subtle);
  }
}

/* A person's role badges (People, Me): side by side, wrapping on a narrow screen. */
.person__roles {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: var(--space-1);
}

/* My connections: the Connect button is a one-button form inside a row's actions. */
.inline-form {
  display: inline;
}
/* A Connect form's box (a shared mailbox you own): one line next to its button. */
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 0.875em;
}
.personal-connection {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

/* ---------- Health: connection sign-ins (the token keepalive, decision D9) ---------- */
/* Four columns; the error sentence wraps, so the table fits next to the admin AI panel. A card below 600 px. */
.table--signins td {
  vertical-align: top;
}
.table--signins .col-what {
  min-width: 14rem;
  white-space: normal;
}
@container (max-width: 600px) {
  .table--signins.table--cards tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "conn state" "when when" "error error";
  }
  .table--signins.table--cards td[data-label="Connection"] {
    grid-area: conn;
  }
  .table--signins.table--cards td[data-label="State"] {
    grid-area: state;
  }
  .table--signins.table--cards td[data-label="Refreshed"] {
    grid-area: when;
    color: var(--text-muted);
    font-size: var(--fs-12);
  }
  .table--signins.table--cards td[data-label="Error"] {
    grid-area: error;
  }
}

/* What Slack may read (slack-allow.ts): the channel picker. One list of the person's conversations, a box each, with
   the search and the kinds above it and the pages under it (Youssef, 2026-11-03: "I can pick which channels it has
   access to"). */
.picker-bar__search {
  flex: 1 1 16rem;
}
.picker-bar__search .input {
  width: 100%;
}
.picker-bar__kinds {
  flex-wrap: wrap;
}
.pick-row {
  cursor: pointer;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.pick-row__kind {
  flex: none;
  color: var(--text-muted);
  font-size: var(--fs-12);
  line-height: var(--lh-12);
}
.pick-row:hover {
  background: var(--surface-2);
}
.pick-row > input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
}
.pick-row > .badge {
  flex: none;
}
.picker-foot {
  flex-wrap: wrap;
}
.picker-public {
  margin: var(--space-4) 0 var(--space-3);
}
.picker-public .t-meta {
  margin: var(--space-1) 0 0;
}
.pick-head {
  gap: var(--space-2);
  background: var(--surface-2);
  font-size: var(--fs-13);
  line-height: var(--lh-13);
}
.picker-rules {
  margin-top: var(--space-4);
}
.picker-dms {
  margin-top: var(--space-3);
}
.picker-actions__now,
.picker-actions__after {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-13);
  line-height: var(--lh-13);
}
/* Save stays in sight under a long list. */
.picker-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: var(--space-4);
  padding: var(--space-3) 0;
  border-top: var(--bw) solid var(--border);
  background: var(--bg);
}

/* ---------- Connections: the checklist per personal system (views/people-setup.ts) ---------- */
/* One card per system each person connects (Gmail, Slack, NetSuite): client -> turn on -> people connect. */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4);
  align-items: start;
}
.setup {
  container-type: inline-size;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  min-width: 0;
}
.setup__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.setup__name {
  margin: 0;
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.setup__head > .badge {
  margin-left: auto;
  flex: none;
}
.setup__why {
  margin: 0;
  font-size: var(--fs-13);
  line-height: var(--lh-13);
  color: var(--text-muted);
}
.setup__steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.setup__step-title {
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--text);
}
.setup .check-step__desc {
  margin: var(--space-1) 0 0;
}
.setup .check-step__tick {
  font: var(--fw-medium) var(--fs-11) / 1 var(--font-mono);
}
.setup .check-step[data-state="todo"] .check-step__tick {
  color: var(--text-subtle);
}
.setup .check-step[data-state="wait"] .check-step__tick {
  border-color: var(--warn-solid);
  color: var(--warn-fg);
}
.setup__step-action:empty {
  display: none;
}
.setup__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
/* Slack's company bot: one row of the Slack card, above each person's own Slack. */
.setup__bot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: var(--bw) solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--fs-13);
}
.setup__bot-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.setup__bot-text b {
  color: var(--text);
  font-weight: var(--fw-medium);
}
.setup__part {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-subtle);
}
@container (max-width: 420px) {
  .setup .check-step {
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .setup__step-action {
    grid-column: 2;
  }
  .setup__bot {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .setup__bot > .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
/* The company systems that are not set up: behind one full-width "Show all N other systems". */
.more-systems {
  margin-top: var(--space-4);
}
.more-systems > summary {
  list-style: none;
  width: 100%;
  justify-content: center;
  cursor: pointer;
}
.more-systems > summary::-webkit-details-marker {
  display: none;
}
.more-systems__show,
.more-systems__hide {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.more-systems[open] > summary {
  margin-bottom: var(--space-4);
}
.more-systems[open] .more-systems__show,
.more-systems:not([open]) .more-systems__hide {
  display: none;
}
