/* SnailChat styles.
   Themes are CSS variables only, set on :root[data-theme=glass|clean|grok]. The .theme-* classes reuse the same
   variables for the preview cards in Settings. One accent colour in every theme. */

/* ---------- theme: Glass (default) ---------- */
:root,
:root[data-theme="glass"],
.theme-glass {
  --bg: #0f1117;
  --bg-img:
    radial-gradient(70vmax 55vmax at 0% 0%, rgba(255, 150, 40, 0.2), transparent 60%),
    radial-gradient(70vmax 60vmax at 100% 100%, rgba(72, 110, 255, 0.24), transparent 60%),
    radial-gradient(50vmax 40vmax at 90% 5%, rgba(168, 92, 255, 0.14), transparent 60%),
    linear-gradient(160deg, #181b24 0%, #0d0f14 100%);
  --fade: rgba(14, 16, 22, 0.94);
  --surface: rgba(30, 33, 43, 0.58);
  --surface-solid: #1e212a;
  --raised: rgba(38, 42, 54, 0.78);
  --raised-solid: #262a36; /* the same colour, opaque: for bars that sit over scrolling content */
  --fill: rgba(255, 255, 255, 0.07);
  --fill-2: rgba(255, 255, 255, 0.11);
  --fill-3: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.09);
  --bar: rgba(20, 23, 31, 0.86); /* opaque enough that messages scrolling under a header never read through it */
  --bar-line: rgba(255, 255, 255, 0.07);
  --side-bg: rgba(24, 27, 36, 0.5);
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.38), 0 2px 8px rgba(0, 0, 0, 0.22);
  --blur: blur(30px) saturate(170%);
  --text: #f3f3f6;
  --text-2: rgba(236, 237, 246, 0.68);
  --text-3: rgba(236, 237, 246, 0.56);
  --bubble-own: rgba(255, 159, 10, 0.22); /* mine: tinted, the way iMessage uses blue */
  --bubble-own-edge: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --bubble-them: rgba(255, 255, 255, 0.07);
  --input: rgba(255, 255, 255, 0.07);
  --scrim: rgba(4, 5, 9, 0.5);
  --av-s: 32%;
  --av-l: 34%;
  --av-fg: #fff;
  --accent: #ff9f0a;
  --accent-text: #ffbd59;
  --focus: #ffbd59; /* the keyboard ring: 3:1 at least on every surface */
  --on-accent: #1f1300;
  --accent-soft: rgba(255, 159, 10, 0.16);
  --accent-softer: rgba(255, 159, 10, 0.09);
  --danger: #ff8b80;
  --danger-text: #ffa39a; /* small words on a button's fill: 4.5:1 over the glass */
  --ok: #4cd97b;
  --ok-text: #4cd97b;
  --idle: #8b8d98;
  --warn-soft: rgba(255, 159, 10, 0.12);
  --code-bg: rgba(0, 0, 0, 0.28);
  --pop: rgba(34, 37, 48, 0.97);
  --prev-img:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 150, 40, 0.32), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(72, 110, 255, 0.4), transparent 60%),
    linear-gradient(160deg, #1b1e28 0%, #0d0f14 100%);
  --run-gap: 14px;
  --msg-gap: 2px;
  --page-pad: 16px;
  color-scheme: dark;
}

/* ---------- theme: Clean ---------- */
:root[data-theme="clean"],
.theme-clean {
  --bg: #ffffff;
  --bg-img: none;
  --fade: rgba(255, 255, 255, 0.96);
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --raised: #ffffff;
  --raised-solid: #ffffff;
  --fill: #f3f3f5;
  --fill-2: #ececef;
  --fill-3: #e2e2e6;
  --line: #e7e7eb;
  --bar: #ffffff;
  --bar-line: #ececf0;
  --side-bg: #fafafb;
  --edge: 0 0 0 0 transparent;
  --shadow: 0 10px 30px rgba(20, 20, 30, 0.08), 0 1px 3px rgba(20, 20, 30, 0.06);
  --blur: none;
  --text: #121216;
  --text-2: #5b5d66;
  --text-3: #5f616a;
  --bubble-own: #fff0d8; /* mine: the accent at about 16% on white */
  --bubble-own-edge: 0 0 0 0 transparent;
  --bubble-them: #f6f6f8;
  --input: #f5f5f7;
  --scrim: rgba(20, 20, 30, 0.28);
  --av-s: 48%;
  --av-l: 88%;
  --av-fg: #2b2b33;
  --accent-text: #944c00;
  --focus: #944c00; /* the accent itself is about 2:1 on white */
  --accent-soft: rgba(255, 159, 10, 0.18);
  --accent-softer: rgba(255, 159, 10, 0.1);
  --danger: #c0251a;
  --danger-text: #c0251a;
  --ok: #1d8a43;
  --ok-text: #167339; /* the green for small words: 4.5:1 on white and on a fill */
  --idle: #a3a4ab;
  --warn-soft: rgba(255, 159, 10, 0.12);
  --code-bg: #f3f3f5;
  --pop: #ffffff;
  --prev-img: none;
  --run-gap: 20px;
  --msg-gap: 4px;
  --page-pad: 22px;
  color-scheme: light;
}

/* ---------- theme: Grok ---------- */
:root[data-theme="grok"],
.theme-grok {
  --bg: #131211;
  --bg-img: none;
  --fade: rgba(19, 18, 17, 0.96);
  --surface: #1c1b1a;
  --surface-solid: #1c1b1a;
  --raised: #211f1e;
  --raised-solid: #211f1e;
  --fill: #22211f;
  --fill-2: #2a2927;
  --fill-3: #33312f;
  --line: transparent;
  --bar: #131211;
  --bar-line: transparent;
  --side-bg: #1a1918;
  --edge: 0 0 0 0 transparent;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --blur: none;
  --text: #f4f2ef;
  --text-2: #a6a39e;
  --text-3: #9b9893;
  --bubble-own: #4e3816; /* mine: the accent at about 22% on the surface */
  --bubble-own-edge: 0 0 0 0 transparent;
  --bubble-them: #1d1c1b;
  --input: #22211f;
  --scrim: rgba(0, 0, 0, 0.55);
  --av-s: 18%;
  --av-l: 30%;
  --av-fg: #f4f2ef;
  --accent-text: #ffb340;
  --focus: #ffb340;
  --idle: #7d7a75;
  --code-bg: #0d0c0b;
  --pop: #211f1e;
  --prev-img: none;
  --run-gap: 14px;
  --msg-gap: 2px;
  --page-pad: 16px;
  color-scheme: dark;
}

/* Solid fallback for Glass: older browsers without blur, and Reduce Transparency. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme="glass"],
  .theme-glass {
    --surface: #1e212a;
    --raised: #252833;
    --bar: #191c24;
    --side-bg: #171a21;
  }
}
/* Reduce Transparency, and (per the spec's "Glass in detail") Reduce Motion too: solid surfaces, no blur. */
@media (prefers-reduced-transparency: reduce), (prefers-reduced-motion: reduce) {
  :root[data-theme="glass"],
  .theme-glass {
    --surface: #1e212a;
    --raised: #252833;
    --bar: #191c24;
    --side-bg: #171a21;
    --blur: none;
  }
}

/* Inter, self-hosted (SIL OFL, see inter-license.txt): Apple devices keep SF Pro, everyone else gets Inter. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-latin.woff2") format("woff2-variations"), url("inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-latin-ext.woff2") format("woff2-variations"), url("inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --spring: cubic-bezier(0.32, 1.28, 0.54, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 320ms;
  --side-w: 260px;
  --rail-w: 68px;
  --top-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --composer-h: 76px;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background-color: var(--bg);
  background-image: var(--bg-img);
  background-attachment: fixed;
  color: var(--text);
  font: 15.5px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-soft);
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ic {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
}
.ic svg {
  width: 100%;
  height: 100%;
}
.ic.sm {
  width: 18px;
  height: 18px;
}
.ic.xs {
  width: 14px;
  height: 14px;
}
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--edge), var(--shadow);
  border: 1px solid var(--line);
}

/* ---------- app frame (follows the visual viewport so the keyboard never hides the composer) ---------- */
#app,
#layer {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--vh, 100dvh);
  transform: translateY(var(--vv-top, 0px));
}
#app {
  display: flex;
  overflow: hidden;
}
#layer {
  pointer-events: none;
  z-index: 50;
}
#layer > * {
  pointer-events: auto;
}
.splash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.splash-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  animation: breathe 1.6s ease-in-out infinite;
}
.splash-note {
  position: absolute;
  bottom: calc(18% + var(--safe-b));
  left: 0;
  right: 0;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
  padding: 0 24px;
}
@keyframes breathe {
  50% {
    transform: scale(0.94);
    opacity: 0.85;
  }
}

/* ---------- sidebar ---------- */
.side {
  width: var(--side-w);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--side-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-right: 1px solid var(--bar-line);
  box-shadow: var(--edge);
  padding: calc(var(--safe-t) + 8px) 8px calc(var(--safe-b) + 8px) calc(var(--safe-l) + 8px);
  z-index: 20;
  transition: width var(--dur) var(--ease);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 4px 0 8px;
  flex: none;
}
.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex: none;
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex: 1;
  white-space: nowrap;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 4px;
  flex: none;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}
.nav-item .ic {
  color: var(--text-2);
}
.nav-item:hover,
.nav-item.active {
  background: var(--fill);
}
.nav-item.new {
  background: var(--fill);
  margin-bottom: 4px;
}
.nav-item.new:hover {
  background: var(--fill-2);
}
.nav-item .kbd {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}
.side-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -8px;
  padding: 0 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--fill-3) transparent;
}
.sec {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 16px 10px 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}
button.sec:hover {
  color: var(--text);
}
.sec .ic {
  transition: transform var(--dur) var(--ease);
}
.sec.closed .ic {
  transform: rotate(-90deg);
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 7px 8px;
  border-radius: 14px;
  color: var(--text);
}
.row:hover {
  background: var(--fill);
}
.row.active {
  background: var(--fill-2);
}
.emo {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--fill);
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
  flex: none;
}
.row.active .emo {
  background: var(--fill-3);
}
.emo .dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-solid);
  display: none;
}
.row .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row .nm {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 560;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .nm > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .nm .ic {
  color: var(--text-3);
}
.row .pv {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row.unread .nm {
  font-weight: 700;
}
.row.unread .pv {
  color: var(--text);
}
.row .rs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
  align-self: stretch;
  justify-content: center;
}
.row time {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.badges {
  display: flex;
  gap: 4px;
}
.badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.badge.at {
  background: transparent;
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  font-size: 12.5px;
}
.row-more {
  position: absolute;
  right: 6px;
  top: 50%;
  translate: 0 -50%;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: none;
  place-items: center;
  color: var(--text-2);
  background: var(--raised);
}
@media (hover: hover) and (pointer: fine) {
  .row:hover .row-more,
  .row-more:focus-visible {
    display: grid;
  }
  .row:hover .rs {
    visibility: hidden;
  }
}
.side-empty {
  color: var(--text-2);
  font-size: 13.5px;
  padding: 10px 12px;
}
.me-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  width: 100%;
  text-align: left;
  flex: none;
  margin-top: 4px;
}
.me-btn:hover {
  background: var(--fill);
}
.me-btn .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.me-btn .nm {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.me-btn .role {
  font-size: 12.5px;
  color: var(--text-2);
}

/* collapsed icon rail (desktop) */
@media (min-width: 900px) {
  .rail .side {
    width: var(--rail-w);
    padding-right: 8px;
  }
  .rail .side .brand-name,
  .rail .side .nav-item .lbl,
  .rail .side .nav-item .kbd,
  .rail .side .sec,
  .rail .side .row .txt,
  .rail .side .row .rs,
  .rail .side .me-btn .txt,
  .rail .side .side-empty,
  .rail .side .row-more {
    display: none !important;
  }
  .rail .side .brand {
    flex-direction: column;
    height: auto;
    gap: 8px;
    padding: 4px 0;
  }
  .rail .side .nav-item {
    justify-content: center;
    padding: 0;
  }
  .rail .side .row {
    justify-content: center;
    padding: 6px 0;
    min-height: 50px;
  }
  .rail .side .emo .dot {
    display: block;
  }
  .rail .side .me-btn {
    justify-content: center;
    padding: 6px 0;
  }
  .rail .side .side-scroll {
    padding-top: 8px;
  }
}

/* phone drawer */
.drawer-scrim {
  display: none;
}
@media (max-width: 899px) {
  .side {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 336px);
    transform: translateX(-104%);
    transition: transform var(--dur) var(--spring), visibility 0s linear var(--dur);
    visibility: hidden;
    box-shadow: var(--edge), var(--shadow);
    background: var(--surface);
  }
  :root[data-theme="clean"] .side {
    background: #fff;
  }
  .drawer .side {
    transform: none;
    visibility: visible;
    transition: transform var(--dur) var(--spring), visibility 0s;
  }
  .side::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 48px;
    background: inherit;
  }
  .drawer-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 19;
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease);
  }
  .drawer .drawer-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .brand-collapse {
    display: none;
  }
}
@media (min-width: 900px) {
  .phone-only {
    display: none !important;
  }
}
@media (max-width: 899px) {
  .desk-only {
    display: none !important;
  }
}

/* ---------- main and views ---------- */
.main {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  --pk-h: 0px; /* room the passkey banner takes at the top, while it shows */
}
.view {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.view.enter-fwd {
  animation: view-fwd var(--dur) var(--spring);
}
.view.enter-back {
  animation: view-back var(--dur) var(--spring);
}
.view.enter-fade {
  animation: fade-in 200ms ease;
}
@keyframes view-fwd {
  from {
    transform: translateX(28%);
    opacity: 0.4;
  }
}
@keyframes view-back {
  from {
    transform: translateX(-18%);
    opacity: 0.4;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@media (min-width: 900px) {
  .view.enter-fwd,
  .view.enter-back {
    animation: fade-in 180ms ease;
  }
}

.top {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) calc(var(--safe-r) + 8px) 0 calc(var(--safe-l) + 8px);
  display: flex;
  align-items: center;
  gap: 2px;
}
.bar {
  background: var(--bar);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--bar-line);
  box-shadow: var(--edge);
}
.top-title {
  flex: 1;
  min-width: 0;
  margin: 0 6px;
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  margin-left: auto;
}
.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: inline-grid;
  place-items: center;
  color: var(--text-2);
  flex: none;
  transition: background 150ms, color 150ms, transform 150ms;
}
.icon-btn:hover {
  background: var(--fill);
  color: var(--text);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn.on {
  color: var(--accent-text);
}
.g-title {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  text-align: left;
  height: 48px;
}
.g-title:hover {
  background: var(--fill);
}
.g-title .emo {
  width: 36px;
  height: 36px;
  font-size: 18px;
}
.g-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.g-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 650;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-name .ic {
  color: var(--text-3);
}
.g-sub {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offline-note {
  position: absolute;
  z-index: 7;
  top: calc(var(--top-h) + var(--safe-t) + 8px + var(--pk-h)); /* under the passkey banner while it shows */
  left: 50%;
  translate: -50% 0;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: drop-in var(--dur) var(--spring);
}
.offline-note::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
@keyframes drop-in {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}

@media (min-width: 900px) {
  .page .top {
    padding-left: max(calc(var(--safe-l) + 8px), calc((100% - 760px) / 2 + var(--page-pad) - 6px));
    padding-right: max(calc(var(--safe-r) + 8px), calc((100% - 760px) / 2 + var(--page-pad) - 6px));
  }
}

/* ---------- home ---------- */
.home .top {
  background: transparent;
}
.home-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--top-h) + var(--safe-t) + var(--pk-h)) calc(var(--safe-r) + 12px) calc(var(--safe-b) + 10px)
    calc(var(--safe-l) + 12px);
  overflow-y: auto;
  transition: padding-top 220ms ease;
}
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 12px;
  gap: 6px;
}
.hero .mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 30px rgba(245, 154, 30, 0.25);
}
.hero h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero p {
  margin: 0;
  font-size: 17px;
  color: var(--text-2);
}
.home-dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.home-dock .composer-wrap {
  position: static;
  padding: 0;
  pointer-events: auto;
}
.home-dock .composer-wrap::before {
  display: none;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -12px;
  padding: 2px 12px;
  scroll-padding: 12px;
  scroll-snap-type: x proximity;
}
.chips > * {
  scroll-snap-align: start;
}
@media (max-width: 420px) {
  /* the row runs past the edge: fade it out there, the way the agent strip does, so a cut chip reads as "more" */
  .chips {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 40px), transparent 100%);
  }
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--edge);
  white-space: nowrap;
  transition: background 150ms, transform 150ms;
}
.chip:hover {
  background: var(--fill-2);
}
.chip:active {
  transform: scale(0.97);
}
.chip .ic {
  color: var(--text-2);
}
:root[data-theme="clean"] .chip {
  border-color: var(--line);
  box-shadow: none;
}
.welcome {
  max-width: 420px;
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
@media (min-width: 900px) {
  .home-body {
    justify-content: center;
    padding-bottom: 12vh;
  }
  .hero {
    flex: none;
    padding-bottom: 28px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .home-dock .chips {
    order: 2;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    margin: 4px 0 0;
    padding: 0;
  }
}

/* ---------- thread ---------- */
.thread {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-top: calc(var(--top-h) + var(--safe-t) + 4px + var(--pk-h));
  padding-bottom: calc(var(--composer-h) + 18px);
  scrollbar-width: thin;
  scrollbar-color: var(--fill-3) transparent;
  outline: none;
}
.col {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 calc(var(--safe-r) + 16px) 0 calc(var(--safe-l) + 16px);
}
.loader-row {
  display: grid;
  place-items: center;
  height: 56px;
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--fill-3);
  border-top-color: var(--text-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.intro {
  padding: 36px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.intro .emo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 30px;
  margin-bottom: 10px;
}
.intro h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.intro p {
  margin: 0;
  color: var(--text-2);
}
.day {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 18px 0 6px;
  pointer-events: none;
}
.day span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 4px 11px;
  border-radius: 12px;
  background: var(--raised);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--edge);
}
:root[data-theme="clean"] .day span {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.newline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}
.newline::before,
.newline::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--accent);
  opacity: 0.55;
}
.sys {
  text-align: center;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-2);
}
.sys span {
  display: inline-block;
  padding: 3px 10px;
}

.msg {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: var(--msg-gap);
  align-items: flex-start;
}
.msg.first {
  margin-top: var(--run-gap);
}
.msg.own {
  justify-content: flex-end;
}
.msg.enter {
  animation: msg-in 340ms var(--spring);
}
@keyframes msg-in {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
}
.av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: hsl(var(--h, 30) var(--av-s) var(--av-l));
  color: var(--av-fg);
  user-select: none;
}
.av.lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.av-gap {
  width: 32px;
  flex: none;
}
.mb {
  min-width: 0;
  max-width: min(84%, 600px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.msg.own .mb {
  align-items: flex-end;
  max-width: min(80%, 560px);
}
.meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 3px 2px;
  font-size: 13px;
}
.meta .nm {
  font-weight: 650;
  color: var(--text);
}
.meta time,
.a-head time {
  font-size: 12px;
  color: var(--text-3);
}
.bubble {
  position: relative;
  padding: 8px 13px 9px;
  border-radius: 19px;
  background: var(--bubble-them);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.msg.cont.them .bubble {
  border-top-left-radius: 7px;
}
.msg.own .bubble {
  background: var(--bubble-own);
  box-shadow: var(--bubble-own-edge);
}
.msg.own.cont .bubble {
  border-top-right-radius: 7px;
}
.bubble.bare {
  background: none !important;
  box-shadow: none !important;
  padding: 0;
}
.bubble.jumbo .txt {
  font-size: 40px;
  line-height: 1.15;
}
.msg.hitme .bubble:not(.bare) {
  box-shadow: inset 3px 0 0 var(--accent);
  background: color-mix(in srgb, var(--bubble-them) 70%, var(--accent-soft));
}
.txt {
  white-space: pre-wrap;
}
.bubble.deleted {
  color: var(--text-3);
  font-style: italic;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--fill-2) !important;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg.pending .bubble {
  opacity: 0.72;
}
.msg.failed .bubble {
  box-shadow: inset 0 0 0 1.5px var(--danger) !important;
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-3);
}
.status.bad {
  color: var(--danger);
}
.status button {
  font-weight: 650;
  color: var(--accent-text);
  min-height: 32px;
  padding: 0 4px;
}
.status button.del {
  color: var(--text-2);
}
.lnk {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.mention {
  color: var(--accent-text);
  font-weight: 600;
}
.mention.me {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0 3px;
  margin: 0 -1px;
}
.quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-width: 140px;
  text-align: left;
  margin: 1px 0 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--fill);
  box-shadow: inset 3px 0 0 var(--accent);
  font-size: 13.5px;
  line-height: 1.35;
}
.quote:hover {
  background: var(--fill-2);
}
.q-name {
  font-weight: 650;
  color: var(--accent-text);
  font-size: 12.5px;
}
.q-text {
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.q-text.gone {
  font-style: italic;
}
.msg.hl::before {
  content: "";
  position: absolute;
  inset: -4px -10px;
  border-radius: 16px;
  background: var(--accent-soft);
  animation: hl 2.6s ease forwards;
  pointer-events: none;
}
@keyframes hl {
  0%,
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* files in messages */
.files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  max-width: 100%;
}
.bubble.bare .files,
.txt + .files {
  margin-top: 6px;
}
.bubble.bare .files {
  margin-top: 0;
}
.imgs {
  display: grid;
  gap: 4px;
  max-width: 320px;
  border-radius: 16px;
  overflow: hidden;
}
.imgs.n2,
.imgs.n3,
.imgs.n4 {
  grid-template-columns: 1fr 1fr;
  width: min(320px, 100%);
}
.imgs.n3 > :first-child {
  grid-column: span 2;
}
.img-btn {
  display: block;
  position: relative;
  background: var(--fill);
  overflow: hidden;
  max-width: 100%;
}
.img-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.imgs.n1 .img-btn img {
  max-height: 380px;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.imgs:not(.n1) .img-btn {
  aspect-ratio: 1;
}
.vid {
  display: block;
  max-width: min(360px, 100%);
  max-height: 420px;
  border-radius: 16px;
  background: #000;
}
.aud {
  display: block;
  width: min(300px, 70vw);
  height: 40px;
}
.filecard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  background: var(--fill);
  max-width: min(320px, 100%);
  min-width: 0;
}
.filecard:hover {
  background: var(--fill-2);
}
.f-ext {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: none;
}
.f-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.f-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f-size {
  font-size: 12.5px;
  color: var(--text-2);
}

/* decision badge and reactions */
.dbadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 10px 3px 7px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
  text-align: left;
}
@media (pointer: coarse) {
  /* 28 px to see, 44 px to tap */
  .dbadge {
    position: relative;
  }
  .dbadge::before {
    content: '';
    position: absolute;
    inset: -8px 0;
  }
}
.dbadge span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.msg.own .reacts {
  justify-content: flex-end;
}
.react {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 15px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: transform 150ms var(--spring), background 150ms;
  user-select: none;
  -webkit-user-select: none;
}
.react::after {
  content: "";
  position: absolute;
  inset: -7px -2px;
}
.react .e {
  font-size: 15px;
  line-height: 1;
}
.react:hover {
  background: var(--fill-2);
}
.react:active {
  transform: scale(0.92);
}
.react.mine {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--text);
}
.react.add {
  padding: 0 8px;
  color: var(--text-3);
}

/* hover tools (desktop) */
.tools {
  position: absolute;
  top: -26px;
  right: 4px;
  z-index: 3;
  display: flex;
  gap: 0;
  padding: 0;
  border-radius: 14px;
  background: var(--raised);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--edge), var(--shadow);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.96);
  transition: opacity 120ms, transform 200ms var(--spring);
}
.tools button {
  width: 44px; /* 44 px hit areas; the icons keep their size */
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.tools button:hover {
  background: var(--fill-2);
  color: var(--text);
}
.msg.own .tools {
  right: auto;
  left: 4px;
}
@media (hover: hover) and (pointer: fine) {
  .msg:hover > .tools,
  .tools:focus-within {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}
@media (hover: none) {
  .tools {
    display: none;
  }
  .msg,
  .row {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

/* agent answers: full width, no bubble */
.msg.agent {
  display: block;
  margin-top: 18px;
}
.a-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.a-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--accent-soft);
  flex: none;
}
.a-name {
  font-weight: 650;
  font-size: 14px;
}
.a-head button.a-name:hover {
  text-decoration: underline;
}
.a-reply {
  font-size: 12.5px;
  color: var(--text-3);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-align: left;
  min-height: 24px;
}
.a-reply:hover {
  color: var(--text-2);
}
.a-reply {
  max-width: 100%;
}
.a-reply span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.md {
  font-size: 15.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.md > :first-child {
  margin-top: 0;
}
.md > :last-child {
  margin-bottom: 0;
}
.md p {
  margin: 0 0 0.65em;
}
.md .md-h {
  font-weight: 700;
  font-size: 1.05em;
  margin-top: 0.9em;
}
.md ul,
.md ol {
  margin: 0 0 0.7em;
  padding-left: 1.4em;
}
.md li {
  margin: 0.2em 0;
}
.md li::marker {
  color: var(--text-3);
}
.md blockquote {
  margin: 0 0 0.7em;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--fill-3);
  color: var(--text-2);
}
.md strong {
  font-weight: 700;
}
.md-code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--code-bg);
}
.md-pre {
  position: relative;
  margin: 0 0 0.8em;
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.md-pre .pre-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 0 12px;
  font-size: 12px;
  color: var(--text-3);
}
.md-pre .pre-head button {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 4px 8px;
  border-radius: 8px;
}
.md-pre .pre-head button:hover {
  background: var(--fill);
}
.md-pre pre {
  margin: 0;
  padding: 6px 14px 12px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}
.md em.ph {
  color: var(--text-2);
}
.a-actions {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 6px 0 0 -12px; /* the 44 px buttons' icons line up with the words */
}
.a-actions button {
  width: 44px; /* a 44 px hit area everywhere; the icon keeps its size */
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.a-actions button:hover {
  background: var(--fill);
  color: var(--text);
}
.stop-btn {
  display: inline-flex !important;
  width: auto !important;
  gap: 6px;
  padding: 0 12px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text) !important;
  background: var(--fill);
}
.thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  font-size: 14.5px;
  font-weight: 500;
}
.thinking .t {
  background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 35%, var(--text) 50%, var(--text-3) 65%, var(--text-3) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -150% 0;
  }
}
.thinking.idle .t {
  animation: none;
  color: var(--text-2);
  background: none;
}
/* "Sam is typing…": the thinking row's look, with the typers' faces and three dots for the ellipsis */
.thinking.typing .t {
  animation: none;
  color: var(--text-2);
  background: none;
  display: flex;
  min-width: 0;
}
/* the typers' names may shrink with "…"; "is typing" / "are typing" never does (list rows and the thread row) */
.ty-who {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ty-verb {
  flex: none;
  white-space: pre;
}
.thinking.typing.enter {
  animation: fade-in 220ms ease-out;
}
.ty-avs {
  display: inline-flex;
  flex: none;
}
.ty-avs .av {
  width: 28px;
  height: 28px;
  font-size: 11px;
  box-shadow: 0 0 0 2px var(--bg);
}
.ty-avs .av + .av {
  margin-left: -6px;
}
.ty-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  height: 1em;
  margin-left: -5px;
  padding-top: 0.25em;
}
.ty-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-2);
  animation: ty-dot 1.2s ease-in-out infinite;
}
.ty-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.ty-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ty-dot {
  0%,
  60%,
  100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.row .pv.typing,
.row.unread .pv.typing {
  display: flex;
  color: var(--accent-text);
}

.jump {
  position: absolute;
  z-index: 5;
  right: calc(var(--safe-r) + 16px);
  bottom: calc(var(--composer-h) + 14px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--raised);
  animation: pop-in 260ms var(--spring);
}
.jump .badge {
  position: absolute;
  top: -6px;
  right: -4px;
}
@keyframes pop-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
.drop-hint {
  position: absolute;
  inset: 10px;
  z-index: 8;
  border-radius: 22px;
  border: 2px dashed var(--accent);
  background: var(--accent-softer);
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 17px;
  pointer-events: none;
}

/* ---------- composer ---------- */
.composer-wrap {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 calc(var(--safe-r) + 12px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 12px);
  pointer-events: none;
}
.kb .composer-wrap {
  padding-bottom: 8px;
}
.composer-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: -26px;
  background: linear-gradient(to top, var(--fade) 0%, var(--fade) 45%, transparent 100%);
  pointer-events: none;
}
:root[data-theme="glass"] .composer-wrap::before {
  background: linear-gradient(to top, rgba(12, 14, 20, 0.6) 0%, transparent 100%);
}
.composer {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 6px;
  pointer-events: auto;
  transition: border-radius var(--dur) var(--spring), box-shadow 200ms;
}
.composer.tall {
  border-radius: 24px;
}
.composer:focus-within {
  box-shadow: var(--edge), var(--shadow), 0 0 0 1px var(--fill-3);
}
:root[data-theme="clean"] .composer {
  box-shadow: 0 6px 24px rgba(20, 20, 30, 0.07), 0 0 0 1px var(--line);
  border-color: transparent;
}
:root[data-theme="clean"] .composer:focus-within {
  box-shadow: 0 6px 24px rgba(20, 20, 30, 0.09), 0 0 0 1px #d4d4da;
}
:root[data-theme="grok"] .composer {
  background: var(--surface);
  box-shadow: 0 0 0 1px #2a2927;
}
.c-target {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0 8px;
  height: 30px;
  padding: 0 8px 0 10px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--fill);
}
.c-target:hover {
  color: var(--text);
}
.c-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 2px 4px;
  padding: 6px 4px 6px 12px;
  border-radius: 18px;
  background: var(--fill);
  box-shadow: inset 3px 0 0 var(--accent);
  animation: fade-in 180ms;
}
.c-reply .q {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
}
.c-reply .q b {
  color: var(--accent-text);
  font-size: 12.5px;
}
.c-reply .q span {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-reply .icon-btn {
  width: 36px;
  height: 36px;
}
.c-files {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 6px 2px;
  scrollbar-width: none;
}
.c-file {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background: var(--fill-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  animation: pop-in 240ms var(--spring);
}
.c-file img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.c-file .f-ext {
  width: 34px;
  height: 34px;
}
.c-file .cf-name {
  font-size: 10.5px;
  color: var(--text-2);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-file .ring {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
}
.c-file .ring svg {
  width: 34px;
  height: 34px;
  transform: rotate(-90deg);
}
.c-file .ring circle {
  fill: none;
  stroke-width: 3.5;
}
.c-file .ring .track {
  stroke: rgba(255, 255, 255, 0.3);
}
.c-file .ring .val {
  stroke: #fff;
  stroke-linecap: round;
  transition: stroke-dashoffset 150ms linear;
}
.c-file.err {
  box-shadow: inset 0 0 0 2px var(--danger);
}
.c-file.err .ring {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
/* the remove X: a 44 px box in the card's corner (the card clips anything outside it) that draws the same 24 px dark
   circle 4 px in; the padding centres the icon on that circle */
.c-file .x {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 4px 4px 16px 16px;
  border-radius: 0 16px 0 0;
  display: grid;
  place-items: center;
  background: none;
  color: #fff;
  z-index: 2;
}
.c-file .x::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}
.c-file .x::after {
  content: "";
  position: absolute;
  inset: -8px;
}
.c-input {
  display: block;
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 22px;
  padding: 9px 12px 5px;
  min-height: 36px;
  max-height: calc(22px * 8 + 14px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.c-input::placeholder {
  color: var(--text-3);
}
.inp::placeholder,
.search-input::placeholder {
  color: var(--text-3);
  opacity: 1;
}
.c-bar {
  display: flex;
  align-items: center;
  gap: 2px;
}
.c-bar .icon-btn {
  width: 40px;
  height: 40px;
}
.c-count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  white-space: nowrap;
}
.c-count.over {
  color: var(--danger);
  font-weight: 650;
}
.c-send {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  flex: none;
  transition: transform 180ms var(--spring), background 150ms, opacity 150ms;
}
.c-count:not([hidden]) + .c-send {
  margin-left: 0;
}
.c-send .ic {
  width: 22px;
  height: 22px;
}
.c-send .ic svg {
  stroke-width: 2.4;
}
.c-send:disabled {
  background: var(--fill-2);
  color: var(--text-3);
}
.c-send:not(:disabled):active {
  transform: scale(0.9);
}
.c-note {
  font-size: 12.5px;
  color: var(--danger);
  padding: 0 12px 4px;
}
.seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 18px;
  background: var(--fill);
  flex: none;
}
.seg button {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 150ms, color 150ms;
}
.seg button[aria-pressed="true"] {
  background: var(--fill-3);
  color: var(--text);
}
:root[data-theme="clean"] .seg button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.12);
}
.seg button:disabled {
  opacity: 0.5;
}
.readonly-note {
  position: relative; /* above the composer-wrap fade, which is positioned */
  max-width: 760px;
  margin: 0 auto;
  min-height: 52px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  pointer-events: auto;
  padding: 0 18px;
  text-align: center;
}
.mention-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: 280px;
  overflow-y: auto;
  border-radius: 18px;
  padding: 6px;
  /* fully opaque: even 3% see-through lets thread text ghost through on dark themes */
  background: linear-gradient(var(--pop), var(--pop)), var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--edge), var(--shadow);
  z-index: 5;
  animation: menu-in 220ms var(--spring);
  transform-origin: 30% 100%;
}
.composer-wrap > .mention-pop {
  left: calc(var(--safe-l) + 12px);
  right: calc(var(--safe-r) + 12px);
  max-width: 760px;
  margin: 0 auto;
  pointer-events: auto;
}
.home-dock .composer-wrap {
  position: relative;
}
.home-dock .composer-wrap > .mention-pop {
  left: 0;
  right: 0;
}
.mention-pop .opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 4px 10px;
  border-radius: 12px;
  text-align: left;
}
.mention-pop .opt.on,
.mention-pop .opt:hover {
  background: var(--fill-2);
}
.mention-pop .opt .av,
.mention-pop .opt .a-mark {
  width: 30px;
  height: 30px;
}
.opt .o-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.opt .o-name {
  font-weight: 600;
  font-size: 14.5px;
}
.opt .o-sub {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- pages (search, decisions, files, people, settings) ---------- */
.page-body {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: calc(var(--top-h) + var(--safe-t) + 8px + var(--pk-h)) 0 calc(var(--safe-b) + 40px);
  transition: padding-top 220ms ease;
}
.page-col {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 calc(var(--safe-r) + var(--page-pad)) 0 calc(var(--safe-l) + var(--page-pad));
}
.page-col.narrow {
  max-width: 640px;
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  margin: 0 6px 0 2px;
  padding: 0 14px 0 38px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--input)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E")
    12px 50% / 18px no-repeat;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-softer);
}
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.empty {
  text-align: center;
  color: var(--text-2);
  padding: 56px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty .ic {
  width: 40px;
  height: 40px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.empty b {
  color: var(--text);
  font-size: 17px;
}
.empty p {
  margin: 0;
  max-width: 340px;
}
.result,
.dcard {
  display: block;
  padding: 12px 14px;
  margin: 0 0 8px;
  border-radius: 16px;
  background: var(--fill);
  transition: background 150ms;
}
.result:hover,
.dcard:hover {
  background: var(--fill-2);
}
.r-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 3px;
  min-width: 0;
}
.r-top .r-grp {
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.r-top time {
  margin-left: auto;
  white-space: nowrap;
  color: var(--text-3);
}
.r-top .r-who {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-text {
  font-size: 14.5px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
mark {
  background: var(--accent-soft);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}
.r-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.r-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  padding: 3px 9px 3px 6px;
  border-radius: 10px;
  background: var(--fill-2);
  color: var(--text-2);
  max-width: 100%;
}
.r-file span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 0 14px;
}
.select {
  height: 38px;
  padding: 0 34px 0 14px;
  border-radius: 19px;
  border: 1px solid var(--line);
  background: var(--input)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
    right 10px center / 16px no-repeat;
  font-size: 14.5px;
  font-weight: 500;
  -webkit-appearance: none;
  appearance: none;
  max-width: 100%;
  min-width: 0;
}
.dcard .d-text {
  font-weight: 650;
  font-size: 15.5px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.dcard .d-text .ic {
  color: var(--accent-text);
  margin-top: 1px;
}
.d-meta {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding-left: 30px;
}
.d-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}
.d-actions button {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 8px;
  border-radius: 10px;
  min-height: 36px;
}
.d-actions button:hover {
  background: var(--fill-2);
  color: var(--danger);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}
.media-grid a {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--fill);
}
.media-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.list {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--fill);
  overflow: hidden;
}
:root[data-theme="clean"] .list {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}
:root[data-theme="grok"] .li {
  border-bottom-color: #262523;
}
.li:last-child {
  border-bottom: 0;
}
a.li:hover {
  background: var(--fill);
}
.li .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.li .t1 {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  min-width: 0;
}
.li .t1 .tag {
  margin-left: 6px;
  vertical-align: 1px;
}
.li .t2 {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li.gone {
  opacity: 0.55;
}
.li .select {
  flex: none;
  height: 34px;
  padding: 0 28px 0 12px;
  font-size: 13.5px;
  background-position: right 8px center;
}
.li .icon-btn {
  margin-right: -8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--fill-2);
  color: var(--text-2);
  flex: none;
}
.tag.acc {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.h2 {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  margin: 26px 4px 8px;
  letter-spacing: 0.01em;
}
.h2:first-child {
  margin-top: 8px;
}
.card {
  border-radius: 18px;
  background: var(--fill);
  padding: 16px;
}
:root[data-theme="clean"] .card {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.card p {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 14px;
}
.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.code-row.big .code-val {
  font-size: 28px;
  text-align: center;
}
.add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.add-row .inp {
  flex: 1;
  min-width: 0;
}
.add-row .select {
  flex: none;
  height: 44px;
}
.code-val {
  flex: 1 1 auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}
.themes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  text-align: left;
  padding: 0;
  border-radius: 16px;
}
.tcard .tname {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  font-size: 14px;
  padding: 0 4px;
}
.tcard .tname .ic {
  color: var(--accent-text);
}
.tprev {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--bg);
  background-image: var(--prev-img);
  box-shadow: 0 0 0 1px var(--fill-3);
  display: flex;
  transition: box-shadow 200ms;
}
@media (min-width: 900px) {
  .tprev {
    aspect-ratio: 16 / 11;
  }
}
.tcard[aria-checked="true"] .tprev {
  box-shadow: 0 0 0 2.5px var(--accent);
}
.theme-clean.tprev {
  box-shadow: 0 0 0 1px #dcdce1;
}
.tprev .p-side {
  width: 28%;
  background: var(--side-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-right: 1px solid var(--bar-line);
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tprev .p-side i {
  height: 6px;
  border-radius: 3px;
  background: var(--fill-3);
}
.tprev .p-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 8px;
}
.tprev .p-b {
  height: 12px;
  border-radius: 6px;
  background: var(--bubble-them);
  width: 70%;
}
.tprev .p-b.own {
  align-self: flex-end;
  background: var(--bubble-own);
  width: 55%;
}
.tprev .p-t {
  height: 4px;
  border-radius: 2px;
  background: var(--text-3);
  width: 85%;
  opacity: 0.7;
}
.tprev .p-c {
  height: 16px;
  border-radius: 8px;
  margin-top: 4px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--edge), 0 0 0 1px var(--line);
  display: flex;
  justify-content: flex-end;
  padding: 3px;
}
.tprev .p-c::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field > .lbl,
.lbl {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}
.hint {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 0;
}
.inp {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input);
  font-size: 16px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
  -webkit-appearance: none;
  appearance: none;
}
:root[data-theme="grok"] .inp {
  border-color: #2c2b29;
}
textarea.inp {
  resize: vertical;
  line-height: 1.45;
}
.inp:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-softer);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 23px;
  font-weight: 650;
  font-size: 15px;
  background: var(--fill-2);
  color: var(--text);
  transition: transform 150ms var(--spring), background 150ms, opacity 150ms;
  white-space: nowrap;
}
.btn:hover {
  background: var(--fill-3);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  filter: brightness(1.05);
}
.btn.danger {
  color: var(--danger-text, var(--danger));
}
.btn.sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}
.btn.tap44 {
  min-height: 44px;
}
.btn:disabled {
  opacity: 0.5;
}
.btn.primary:disabled {
  background: var(--fill-2);
  color: var(--text-3);
  opacity: 1;
}
.btn.wide {
  width: 100%;
}
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.btn-row .btn {
  flex: 1;
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 0;
  margin-bottom: 10px;
  cursor: pointer;
}
.switch-row .txt {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.switch-row .t1 {
  font-weight: 600;
}
.switch-row .t2 {
  font-size: 13px;
  color: var(--text-2);
}
/* a switch in a list: its words are a sentence, so they wrap and are never cut off (phone walk O12) */
.li.switch-row .t1,
.li.switch-row .t2 {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--fill-3);
  flex: none;
  cursor: pointer;
  transition: background 200ms;
  margin: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 260ms var(--spring);
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(20px);
}
.checks {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--input);
  border: 1px solid var(--line);
  max-height: 240px;
  overflow-y: auto;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.check:last-child {
  border-bottom: 0;
}
.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  margin: 0;
  flex: none;
}
.check .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.check .t2 {
  font-size: 12.5px;
  color: var(--text-2);
}
.seg.big {
  display: flex;
  width: 100%;
}
.seg.big button {
  flex: 1;
  height: 38px;
  justify-content: center;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
}
.emoji-grid button {
  height: 44px;
  border-radius: 12px;
  font-size: 22px;
  display: grid;
  place-items: center;
}
.emoji-grid button:hover,
.emoji-grid button[aria-pressed="true"] {
  background: var(--fill-2);
}
.emoji-pick {
  display: flex;
  align-items: center;
  gap: 10px;
}
.emoji-pick .emo {
  width: 56px;
  height: 56px;
  font-size: 28px;
  border-radius: 16px;
  cursor: pointer;
}
.emoji-pick .inp {
  flex: 1;
}
.emoji-more {
  margin-top: 10px;
  padding: 10px;
  border-radius: 16px;
  background: var(--input);
  border: 1px solid var(--line);
  animation: fade-in 160ms;
}
.emoji-more .inp {
  margin-bottom: 8px;
  min-height: 40px;
  padding: 8px 12px;
}

/* ---------- sign-in ---------- */
.signin {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-t) + 24px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 24px) calc(var(--safe-l) + 16px);
}
/* centred while it fits; taller than a short phone, it starts at the top and scrolls (phone walk O11). Auto margins,
   not justify-content: center, which pushes the top of an overflowing card off screen where no scroll reaches it */
.signin > :first-child {
  margin-top: auto;
}
.signin > :last-child {
  margin-bottom: auto;
}
.signin-card {
  width: 100%;
  max-width: 400px;
  border-radius: 28px;
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  animation: rise var(--dur) var(--spring);
}
:root[data-theme="clean"] .signin-card {
  box-shadow: 0 20px 60px rgba(20, 20, 30, 0.08), 0 0 0 1px var(--line);
}
@keyframes rise {
  from {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
  }
}
.signin-card .mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  align-self: center;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(245, 154, 30, 0.3);
}
.signin-card h1 {
  margin: 0;
  text-align: center;
  font-size: 26px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.signin-card .sub {
  text-align: center;
  color: var(--text-2);
  margin: 4px 0 24px;
}
.signin-card .err,
.signin-card .soft {
  color: var(--danger);
  font-size: 14px;
  margin: -4px 0 12px;
  min-height: 0;
}
/* a cancelled passkey sheet is a choice, not a failure */
.signin-card .soft {
  color: var(--text-2);
}
/* a wide button that carries a name may need two lines, never more than its card */
.signin-card .btn.wide {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
  padding-block: 10px;
}
.signin-card .fine {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2);
  margin: 16px 0 0;
}

/* ---------- sheets, menus, dialogs ---------- */
.ov {
  position: absolute;
  inset: 0;
}
.ov .scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.ov.open .scrim {
  opacity: 1;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(var(--vh, 100dvh) - var(--safe-t) - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 24px 24px 0 0;
  background: var(--raised);
  border-bottom: 0;
  transform: translateY(105%);
  transition: transform var(--dur) var(--spring);
  outline: none;
}
.ov.open .sheet {
  transform: none;
}
.sheet::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 48px;
  background: inherit;
}
.ov.dragging .sheet {
  transition: none;
}
.sheet:focus,
.menu:focus,
.lightbox:focus {
  outline: none;
}
:root[data-theme="clean"] .sheet {
  background: #fff;
}
.grab {
  flex: none;
  height: 22px;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}
.grab::before {
  content: "";
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--fill-3);
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 6px 20px;
  min-height: 44px;
  touch-action: none;
}
.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.sheet-body {
  --body-pb: calc(var(--safe-b) + 20px); /* the sticky button bar below reaches down over it */
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px var(--body-pb);
  overscroll-behavior: contain;
}
.kb .sheet-body {
  --body-pb: 16px;
}
.sheet-body.flush {
  padding-left: 10px;
  padding-right: 10px;
}
@media (min-width: 900px) {
  .sheet {
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(500px, calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 64px));
    border-radius: 24px;
    border-bottom: 1px solid var(--line);
    transform: translate(-50%, -47%) scale(0.96);
    opacity: 0;
    transition: transform var(--dur) var(--spring), opacity 180ms ease;
  }
  .ov.open .sheet {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .sheet .grab,
  .sheet::after {
    display: none;
  }
  .sheet-head {
    padding-top: 12px;
  }
  .sheet-body {
    --body-pb: 22px;
  }
  .sheet {
    overflow: clip; /* the sticky button bar keeps the sheet's round corners */
  }
}
.menu {
  position: absolute;
  min-width: 232px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: calc(var(--vh, 100vh) - 16px);
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  background: var(--raised);
  transform: scale(0.9);
  opacity: 0;
  transform-origin: var(--ox, 0) var(--oy, 0);
  transition: transform 280ms var(--spring), opacity 140ms ease;
  outline: none;
}
.ov.open .menu {
  transform: none;
  opacity: 1;
}
:root[data-theme="clean"] .menu {
  background: #fff;
}
.ov.menu-ov .scrim {
  background: transparent;
}
@keyframes menu-in {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
}
.mi {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.mi .ic {
  color: var(--text-2);
}
.mi:focus-visible {
  background: var(--fill-2);
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
@media (hover: hover) {
  .mi:hover {
    background: var(--fill-2);
  }
}
.mi:active {
  background: var(--fill-2);
}
.mi.danger,
.mi.danger .ic {
  color: var(--danger);
}
.mi:disabled {
  opacity: 0.45;
}
.mi .mi-sub {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-3);
}
.msep {
  height: 1px;
  background: var(--line);
  margin: 5px 8px;
}
:root[data-theme="grok"] .msep {
  background: #2c2b29;
}
.sheet .mi {
  min-height: 50px;
  font-size: 16px;
}
.menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
}
.menu-head .txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.menu-head .t1 {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-head .t2 {
  font-size: 13px;
  color: var(--text-2);
}
.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 6px 8px;
}
.theme-switch button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  min-height: 44px;
}
.theme-switch button:hover {
  background: var(--fill);
}
.theme-switch button[aria-checked="true"] {
  background: var(--fill-2);
  color: var(--text);
}
.theme-switch .sw {
  width: 30px;
  height: 22px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--fill-3);
  background-color: var(--bg);
  background-image: var(--prev-img);
  position: relative;
  overflow: hidden;
}
.theme-switch .sw::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 6px;
  border-radius: 3px;
  background: var(--bubble-own);
}
.theme-clean.sw {
  box-shadow: 0 0 0 1px #d6d6dc;
}
.react-row {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 4px 4px 8px;
}
.react-row button {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: transform 160ms var(--spring), background 150ms;
}
.react-row button:hover {
  background: var(--fill-2);
  transform: scale(1.12);
}
.react-row button[aria-pressed="true"] {
  background: var(--accent-soft);
}
.react-row button.more {
  font-size: 15px;
  color: var(--text-2);
  background: var(--fill);
}
.sheet-preview {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--fill);
  font-size: 14.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.sheet-preview b {
  color: var(--text);
}
.who-list .li {
  padding-left: 4px;
  padding-right: 4px;
}
.who-list .who-mark {
  width: 32px;
  height: 32px;
  font-size: 17px;
}
.info-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 4px 0 14px;
}
.info-top .emo {
  width: 72px;
  height: 72px;
  font-size: 36px;
  border-radius: 22px;
  margin-bottom: 8px;
}
.info-top h3 {
  margin: 0;
  font-size: 21px;
}
.info-top p {
  margin: 0;
  color: var(--text-2);
}
.info-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}
.info-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin: 4px 0 8px;
}
/* five tiles (Pin, Made, Files, Decisions, Scheduled) don't fit one row at 375 px with readable words: three, then two
   wider ones, instead of four and one left alone */
.info-actions:has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(6, 1fr);
}
.info-actions:has(> :nth-child(5):last-child) > * {
  grid-column: span 2;
}
.info-actions:has(> :nth-child(5):last-child) > :nth-child(n + 4) {
  grid-column: span 3;
}
.info-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 16px;
  background: var(--fill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  min-height: 64px;
}
.info-actions button:hover {
  background: var(--fill-2);
}
.info-actions .ic {
  color: var(--accent-text);
}

/* lightbox */
.lightbox {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 220ms ease;
}
.ov.open .lightbox {
  opacity: 1;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform var(--dur) var(--spring);
}
.ov.open .lightbox img {
  transform: none;
}
.lb-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--safe-t) + 8px) 10px 8px 16px;
  color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}
.lb-bar .icon-btn {
  color: #fff;
}
.lb-bar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.lb-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* toasts */
#toasts {
  position: fixed;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(var(--safe-t) + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 14.5px;
  font-weight: 500;
  background: var(--raised);
  animation: toast-in 320ms var(--spring);
  transition: opacity 200ms, transform 200ms;
}
:root[data-theme="clean"] .toast {
  background: #fff;
}
.toast.out {
  opacity: 0;
  transform: translateY(-8px);
}
.toast button {
  flex: none;
  white-space: nowrap;
  font-weight: 700;
  color: var(--accent-text);
  /* Undo is a 44 px target (a playbook's save, a note's), the toast stays its own height */
  min-height: 44px;
  margin: -10px -8px -10px 0;
  padding: 0 8px;
  border-radius: 14px;
}
@media (max-width: 899px) {
  /* on a phone, at the bottom where the thumb is, over the composer when one shows (toast() sets --toast-lift) */
  #toasts {
    top: auto;
    bottom: calc(var(--safe-b) + 16px + var(--toast-lift, 0px));
  }
  #toasts.over-sheet {
    top: calc(var(--safe-t) + 10px);
    bottom: auto;
  }
  .toast {
    animation-name: toast-up;
  }
  .toast.out {
    transform: translateY(8px);
  }
}
@keyframes toast-up {
  from {
    transform: translateY(14px) scale(0.96);
    opacity: 0;
  }
}
@keyframes toast-in {
  from {
    transform: translateY(-14px) scale(0.96);
    opacity: 0;
  }
}

@media (pointer: coarse) {
  .select,
  select.inp {
    font-size: 16px;
  }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur: 200ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .thinking .t {
    animation: none !important;
    color: var(--text-2);
    background: none;
  }
  .ty-dots i {
    animation: none !important;
    opacity: 0.8;
  }
  .spinner {
    animation-duration: 1.2s !important;
    animation-iteration-count: infinite !important;
  }
  .side,
  .drawer .side {
    transition: opacity var(--dur) linear, visibility 0s linear var(--dur) !important;
    transform: none !important;
  }
  @media (max-width: 899px) {
    .side {
      opacity: 0;
    }
    .drawer .side {
      opacity: 1;
      transition: opacity var(--dur) linear, visibility 0s !important;
    }
  }
  .sheet,
  .ov.open .sheet,
  .menu,
  .ov.open .menu {
    transform: none !important;
    transition: opacity var(--dur) linear !important;
  }
  .sheet {
    opacity: 0;
  }
  .ov.open .sheet {
    opacity: 1;
  }
  @media (min-width: 900px) {
    .sheet,
    .ov.open .sheet {
      transform: translate(-50%, -50%) !important;
    }
  }
  .lightbox img {
    transform: none !important;
  }
  .switch::after {
    transition: none;
  }
}

/* Tap targets: at least 44 px on every screen, phone or computer, mostly by an invisible hit area that keeps the
   visual size. A touch screen also gets the composer's buttons, tabs and small buttons at a full 44 px. */
@media (pointer: coarse) {
  .c-bar .icon-btn,
  .c-send {
    width: 44px;
    height: 44px;
  }
  .a-actions {
    gap: 0;
  }
  .a-actions button {
    width: 44px;
    height: 44px;
  }
  .tabs button {
    height: 44px;
    border-radius: 22px;
  }
  .btn.sm,
  select.inp {
    min-height: 44px;
  }
}
.nav-item {
  min-height: 44px;
}
.select,
.li .select {
  min-height: 44px;
}
.search-input {
  height: 44px;
  border-radius: 22px;
}
.seg button,
.c-target,
.c-send,
.chip,
.btn.sm,
.stop-btn,
.c-reply .icon-btn,
.a-head button.a-name,
.a-mark.tap,
.a-reply,
.switch,
.tabs button,
.d-actions button {
  position: relative;
}
.seg button::before,
.c-target::before,
.c-send::before,
.c-bar .icon-btn::before,
.chip::before,
.btn.sm::before,
.stop-btn::before,
.c-reply .icon-btn::before,
.a-head button.a-name::before,
.a-mark.tap::before,
.a-reply::before,
.switch::before,
.tabs button::before,
.d-actions button::before {
  content: "";
  position: absolute;
}
.seg button::before,
.c-target::before {
  inset: -7px 0;
}
.c-send::before,
.c-bar .icon-btn::before {
  inset: 0 -2px -4px; /* down into the composer's padding, never up into the message box over them */
}
/* the composer's Brain button: starts the words with "Brain, " (no Chat / Ask switch) */
.c-bar .icon-btn.c-ask {
  width: auto;
  max-width: 50%;
  gap: 6px;
  padding: 0 12px 0 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.c-ask-word {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.c-ask-emo {
  font-size: 20px;
  line-height: 1;
}
.c-ask:disabled {
  opacity: 0.45;
}
.c-bar .icon-btn:first-child::before {
  left: -6px; /* into the box's padding: its neighbour takes the gap between them */
}
.chip::before {
  inset: -3px 0; /* from inside its 1 px border */
}
.chips {
  margin-block: -2px;
  padding-block: 4px; /* room for the chips' hit areas inside the scroller, the same layout */
}
.btn.sm::before {
  inset: -4px 0;
}
.stop-btn::before,
.c-reply .icon-btn::before {
  inset: -4px;
}
.react::after {
  inset: -7px -2px;
  min-width: 44px;
}
.c-file .x::after {
  inset: 0;
}
.a-head button.a-name::before {
  inset: -12px -6px;
}
.a-mark.tap::before {
  inset: -8px;
}
.a-reply {
  min-height: 32px;
}
.a-reply::before {
  inset: -6px 0;
}
.switch::before {
  inset: -7px -4px;
  border-radius: 22px;
}
/* every row of small card actions (Undo, Remove…), not only the decision card's: 36 px to see, 44 to tap */
.d-actions button::before {
  inset: -4px 0;
}
/* the message box: its 6 px of padding above the text is part of the box you tap, and it is 44 px tall */
.composer > .c-input {
  margin-top: -6px;
  padding-top: 15px;
  padding-bottom: 7px;
  min-height: 44px;
  max-height: calc(22px * 8 + 22px);
}
.lnk-host {
  color: var(--text-3);
  font-size: 0.92em;
}

/* ---------- agents as teammates (CONTRACT-AGENTS.md) ---------- */
/* An agent's mark is round, like a person's avatar, tinted with the accent: groups stay rounded squares. */
.agent-emo {
  white-space: nowrap; /* no overflow: hidden, which clipped the online dot and the unread dot to a sliver */
}
.a-mark {
  white-space: nowrap; /* no overflow: hidden, which would clip its 44 px hit area on touch screens */
}
.agent-emo {
  background: var(--accent-soft);
  border-radius: 50%;
}
.row.active .agent-emo {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent-soft);
}
.a-mark {
  border-radius: 50%;
}
.emo.big {
  width: 72px;
  height: 72px;
  font-size: 36px;
}
.emo.agent-emo.big {
  border-radius: 50%;
}
.emo.sm {
  width: 30px;
  height: 30px;
  font-size: 16px;
  border-radius: 9px;
}
/* status dot: green when a real AI will answer you, grey for the placeholder, none when switched off */
.sdot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--idle);
  border: 2.5px solid var(--surface-solid);
  box-sizing: border-box;
}
.side .sdot {
  border-color: var(--side-solid, var(--surface-solid));
}
.sdot.ready {
  background: var(--ok);
}
.sdot.off {
  background: transparent;
  border: 1.5px solid var(--idle);
}
.sdot.inline {
  position: static;
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 0;
  flex: none;
  vertical-align: 1px;
}
.sdot.inline.off {
  border: 1.5px solid var(--idle);
}
.sdot.big {
  position: static;
  width: 14px;
  height: 14px;
  border: 0;
  flex: none;
}
.emo.big .sdot {
  width: 18px;
  height: 18px;
  border-width: 3px;
  right: 1px;
  bottom: 1px;
}
.sheet .sdot:not(.inline):not(.big) {
  border-color: var(--raised-solid, var(--surface-solid));
}
:root[data-theme="clean"] .sdot:not(.inline):not(.big) {
  border-color: #fff;
}
:root[data-theme="grok"] .side .sdot {
  border-color: #1a1918;
}

/* sidebar: the Agents section */
.sec.sub {
  padding-top: 10px;
  font-weight: 600;
}
.row.mini {
  min-height: 44px;
  padding-top: 4px;
  padding-bottom: 4px;
  color: var(--text-2);
}
.row.mini .nm {
  font-weight: 500;
  font-size: 14.5px;
}
.row.mini:hover {
  color: var(--text);
}
.emo.mini-ic {
  width: 38px;
  height: 30px;
  background: none;
  color: var(--text-3);
}
.row.past .agent-emo {
  background: var(--fill);
  filter: grayscale(0.6);
  opacity: 0.8;
}
.row.past .pv {
  color: var(--text-3);
}

/* home: the agents you can message, under the greeting */
.agent-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 22px -12px 0;
  padding: 2px 12px 4px;
  max-width: calc(100% + 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.agent-strip::-webkit-scrollbar {
  display: none;
}
.ag {
  flex: none;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 2px;
  border-radius: 16px;
  transition: background 150ms, transform 150ms var(--spring);
}
.ag:hover {
  background: var(--fill);
}
.ag:active {
  transform: scale(0.95);
}
.ag-tile {
  position: relative;
}
.ag-tile .agent-emo {
  width: 56px;
  height: 56px;
  font-size: 27px;
  box-shadow: var(--edge);
}
.ag-tile .sdot {
  width: 16px;
  height: 16px;
  border-width: 3px;
  right: 0;
  bottom: 0;
  border-color: var(--bg);
}
:root[data-theme="glass"] .ag-tile .sdot {
  border-color: #1a1d26;
}
.ag-tile .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  box-shadow: 0 0 0 2.5px var(--bg);
}
.ag-n {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .agent-strip {
    justify-content: flex-start;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 40px), transparent 100%);
  }
  .agent-strip .ag {
    width: 72px;
    scroll-snap-align: start;
  }
  .agent-strip:has(.ag:nth-child(4):last-child),
  .agent-strip:not(:has(.ag:nth-child(5))) {
    justify-content: center;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* direct chat with an agent */
.g-title:disabled {
  cursor: default;
}
.g-title:disabled:hover {
  background: none;
}
.g-title .agent-emo {
  width: 36px;
  height: 36px;
  font-size: 18px;
}
.g-sub.ok {
  color: var(--text-2);
}
.col.centered {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.col.centered > .dm-intro {
  margin: auto 0;
}
.dm-intro {
  align-items: center;
  text-align: center;
  padding: 34px 4px 18px;
  gap: 6px;
}
.dm-intro .agent-emo.big {
  margin-bottom: 8px;
  box-shadow: var(--edge);
}
.dm-intro h2 {
  font-size: 23px;
}
.dm-intro .dm-desc {
  font-size: 15.5px;
  max-width: 420px;
}
.dm-facts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}
.fact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  text-align: left;
  max-width: 100%;
}
.fact .ic {
  color: var(--text-3);
}
.dm-connect {
  margin-top: 12px;
}
.dm-connect .ic {
  color: var(--accent-text);
}
.starters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin-top: 22px;
}
.starter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 10px 14px 10px 16px;
  border-radius: 18px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--edge);
  transition: background 150ms, transform 150ms var(--spring);
}
.starter:hover {
  background: var(--fill-2);
}
.starter:active {
  transform: scale(0.98);
}
.starter .ic {
  color: var(--text-3);
}
:root[data-theme="clean"] .starter {
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.05);
}
:root[data-theme="grok"] .starter {
  background: var(--fill);
  border-color: transparent;
}
.view.dm .readonly-note span {
  min-width: 0;
}

/* under a question: an agent that was asked but got no job */
.status.skip {
  gap: 6px;
  align-items: flex-start;
  color: var(--text-2);
  max-width: 320px;
  line-height: 1.35;
}
.status.skip .ic {
  margin-top: 1px;
  color: var(--text-3);
}
.msg.own .status.skip {
  text-align: right;
  width: fit-content;
  margin-left: auto;
  justify-content: flex-end;
}

/* answers: who asked whom, and which AI wrote it */
.a-by {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 4px 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
}
.a-by .ic {
  transform: scaleX(-1);
}
/* Main Brain's plan card: one 44 px row per specialist it asked, with how each is getting on, then its summary */
.plan {
  display: flex;
  flex-direction: column;
  max-width: 420px;
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
}
.plan-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px 0 8px;
  text-align: left;
  color: var(--text);
}
.plan-row.tap {
  cursor: pointer;
}
.plan-row + .plan-row {
  box-shadow: inset 0 1px 0 var(--plan-sep, var(--line));
}
.plan-row.tap:hover {
  background: var(--fill-2);
}
.plan-row:focus-visible {
  outline-offset: -2px;
  border-radius: 14px;
}
.plan-row .a-mark {
  width: 28px;
  height: 28px;
  font-size: 15px;
}
.plan-nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14.5px;
  font-weight: 600;
}
.plan-st {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.plan-st .ty-dots {
  margin-left: 0;
}
.plan-st.done {
  color: var(--plan-ok, var(--ok));
}
.plan-st.done .ic {
  width: 16px;
  height: 16px;
}
.plan-st.failed {
  color: var(--danger);
}
.plan-st.idle,
.plan-st.asked,
.plan-st.stopped {
  color: var(--text-3);
}
.plan-act {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  white-space: nowrap;
}
.plan-act:empty {
  display: none;
}
.plan-go {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  color: var(--text-3);
}
/* the card opens in once, when Main Brain's words finish typing out; a status that changes fades in */
.plan.enter {
  animation: plan-in 200ms ease-out;
}
@keyframes plan-in {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 240px;
    opacity: 1;
  }
}
.plan-row.enter,
.plan-st.flip {
  animation: fade-in 180ms ease-out;
}
:root[data-theme="grok"] .plan {
  --plan-sep: var(--bg); /* Grok draws no lines: the page shows through between rows */
}
:root[data-theme="clean"] .plan {
  --plan-ok: #167339; /* the theme's green is too light for 13 px text on the card (4.5:1) */
}

/* ---------- agent souls (CONTRACT-AGENTS.md, Souls) ---------- */
/* An agent's soul draft under its answer: title, the first lines (Show all for the rest), then Edit and Save for
   admins, or who saved it. Same look as the plan card. */
.soul {
  display: flex;
  flex-direction: column;
  max-width: 460px;
  margin-top: 10px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  --soul-line: var(--soul-sep, var(--line));
}
:root[data-theme="grok"] .soul {
  --soul-sep: var(--bg); /* Grok draws no lines: the page shows through */
}
:root[data-theme="clean"] .soul {
  --soul-ok: #167339;
}
.soul-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px 12px;
}
.soul-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.soul-head .txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.soul-title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
  overflow-wrap: anywhere;
}
.soul-sub {
  font-size: 12.5px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.soul-body {
  padding: 2px 14px 12px;
}
.soul-body.clip .soul-text {
  max-height: 15em; /* about ten lines, however long its first lines are */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.soul-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.soul-text .sl-h {
  font-weight: 650;
  color: var(--text);
}
.soul-text strong {
  font-weight: 650;
  color: var(--text);
}
.soul-text .sl-li {
  display: flex;
  gap: 8px;
}
.soul-text .sl-dot {
  flex: none;
  color: var(--text-3);
}
.soul-text .sl-t {
  min-width: 0;
}
.soul-text .sl-gap {
  height: 8px;
}
.soul-text .sl-none {
  color: var(--text-3);
}
.soul-more {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.soul-more:hover {
  background: var(--fill-2);
}
.soul-more .ic {
  margin-left: auto;
  color: var(--text-3);
}
.soul-more:focus-visible {
  outline-offset: -2px;
}
.soul-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.soul-foot > .btn {
  flex: 1 1 0;
  min-height: 44px;
  min-width: 0;
}
.soul-foot > .btn.sm {
  flex: 0 0 auto;
}
.soul-state {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24px;
  margin: 0;
  padding: 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.soul-state > span:not(.ic) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.soul-state.ok {
  color: var(--soul-ok, var(--ok));
}
.soul-state.wait,
.soul-state.off {
  color: var(--text-3);
  font-weight: 500;
}
/* a new agent's draft whose name needs changing before Save: Save opens Edit with this line */
.soul-problem {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.soul-problem .ic {
  flex: none;
  margin-top: 2px;
  color: var(--warn, var(--accent-text));
}
.soul-problem > span:not(.ic) {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* "Use as a soul" under a .md file in a chat (admins) */
.soul-use {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--accent-softer);
  color: var(--accent-text);
}
.soul-use:hover {
  background: var(--accent-soft);
}
.msg.agent .files .soul-use {
  margin-top: 2px;
}
@media (pointer: coarse), (max-width: 599px) {
  .soul-use {
    min-height: 44px;
    border-radius: 22px;
  }
}
/* the Soul tab, and the sheet a soul arrives in before it is saved */
.soul-lbl {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.soul-lbl .soul-count {
  margin: 0;
  font-weight: 500;
  font-size: 12.5px;
}
.soul-count.err {
  color: var(--danger);
}
textarea.soul-inp {
  min-height: 300px;
  line-height: 1.5;
  resize: none;
  overflow: hidden; /* it grows with its text: the page scrolls, not a box inside it */
  field-sizing: content;
}
/* the Soul tab's Save stays in reach at the bottom of the screen while a long soul scrolls (down over the page's own
   bottom padding); the card's round corners clip it where it sits at rest */
.form-card.soul-card {
  overflow: clip;
}
.save-row.soul-save {
  position: sticky;
  bottom: calc(-40px - var(--safe-b, 0px));
  z-index: 2;
  margin: 4px -16px -16px;
  padding: 10px 16px calc(10px + var(--safe-b, 0px));
  background: var(--raised-solid, var(--raised));
  box-shadow: 0 -1px 0 var(--line);
}
:root[data-theme="clean"] .save-row.soul-save {
  background: #fff;
}
.soul-start {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--accent-text);
}
.soul-now {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.soul-now .ic {
  flex: none;
  color: var(--soul-ok, var(--ok));
}
:root[data-theme="clean"] .soul-now {
  --soul-ok: #167339;
}
.soul-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.soul-files > .btn {
  flex: 1 1 170px;
}
/* "Ask Main Brain to write it" (the Soul tab) and "Change its soul" (an agent's card): buttons drawn as card links */
button.card-link {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}
.soul-pick.likely .t2 {
  color: var(--accent-text);
  font-weight: 600;
}
.soul-hist-box > .h2 {
  margin-top: 14px;
}
.soul-ver .txt,
.soul-pick .txt {
  text-align: left;
}
.soul-ver > .emo {
  width: 32px;
  height: 32px;
}
.soul-ver > .ic:last-child,
.soul-pick > .ic:last-child {
  flex: none;
  color: var(--text-3);
}
.soul-review {
  border-radius: 14px;
  background: var(--fill);
  padding: 12px 14px;
}
.soul-review.editing {
  padding: 0;
  background: none;
}
.soul-review > textarea {
  width: 100%;
}
.soul-who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}
.soul-who .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.soul-who .t1 {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.soul-who .t2 {
  font-size: 13px;
  color: var(--text-3);
}
.emo.agent-emo.new {
  color: var(--accent-text);
}
.soul-note {
  margin: 10px 2px 4px;
}
.soul-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 6px 12px;
  font-size: 15px;
  color: var(--text-2);
}
.soul-lead .f-ext.sm {
  width: 34px;
  height: 34px;
  flex: none;
}
.soul-lead > span:not(.f-ext) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.a-via {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* the agent card */
.info-top .agent-emo.big {
  margin-bottom: 8px;
  border-radius: 50%;
}
.info-top .handle {
  font-size: 14px;
  color: var(--text-3);
}
.eng-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  margin: 6px 0 0;
}
.info-top .eng-line {
  padding: 5px 12px;
  border-radius: 14px;
  background: var(--fill);
}
.info-actions button.main {
  background: var(--accent);
  color: var(--on-accent);
}
.info-actions button.main .ic {
  color: var(--on-accent);
}
.info-actions button.main:hover {
  background: var(--accent);
  filter: brightness(1.05);
}
.card-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px 10px 14px;
  margin: 6px 0 4px;
  border-radius: 16px;
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.card-link > .ic:first-child {
  color: var(--accent-text);
}
.card-link .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-link .t1 {
  font-weight: 650;
}
.card-link .t2 {
  font-size: 13px;
  color: var(--text-2);
}
.card-link > .ic:last-child {
  color: var(--text-3);
}
.gchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 550;
  background: var(--fill);
}
.gchip:hover {
  background: var(--fill-2);
}

/* lists with a link part and a switch */
.li-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  align-self: stretch;
  margin: -10px 0 -10px -14px;
  padding: 10px 0 10px 14px;
  border-radius: 0;
}
.li-link .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
a.li-link:hover,
button.li-link:hover {
  background: none;
}
.li:has(> .li-link:hover) {
  background: var(--fill);
}
.li .agent-emo {
  width: 40px;
  height: 40px;
  font-size: 20px;
}
.li > .ic:last-child {
  color: var(--text-3);
}
.li > .ic:first-child {
  color: var(--text-2);
}

/* admin pages */
.page-lead {
  margin: 4px 4px 16px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.5;
}
.note-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--fill);
}
.note-card > .ic:first-child {
  color: var(--text-3);
  margin-top: 1px;
}
.note-card > span:not(.ic) {
  flex: 1;
  min-width: 0;
}
.note-card.warn {
  background: var(--warn-soft, var(--accent-softer));
  color: var(--text);
}
.note-card.warn > .ic:first-child {
  color: var(--accent-text);
}
.note-card.link {
  color: var(--text);
}
.note-card.link:hover {
  background: var(--fill-2);
}
.note-card.link > .ic:last-child {
  color: var(--text-3);
  margin-top: 3px;
}
.hint.err {
  color: var(--danger);
  font-size: 13.5px;
  min-height: 0;
  margin: 0 0 8px;
}
.hint.err:empty {
  display: none;
}
.note-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 12px;
}
.at-inp {
  display: flex;
  align-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input);
  transition: border-color 150ms, box-shadow 150ms;
}
:root[data-theme="grok"] .at-inp {
  border-color: #2c2b29;
}
.at-inp:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-softer);
}
.at-inp > span {
  padding-left: 14px;
  color: var(--text-3);
  font-weight: 600;
}
.at-inp .inp {
  border: 0;
  background: transparent;
  padding-left: 2px;
  box-shadow: none !important;
}
.at-inp.off {
  opacity: 0.65;
}
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.tpl {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 150ms, background 150ms;
}
.tpl:hover {
  background: var(--fill-2);
}
.tpl[aria-checked="true"] {
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.tpl-emo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--accent-soft);
  flex: none;
}
.tpl-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.tpl-txt b {
  font-size: 14.5px;
}
.tpl-txt span {
  font-size: 12px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ae-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 16px;
}
.ae-head .agent-emo.big {
  width: 64px;
  height: 64px;
  font-size: 32px;
}
.ae-head .txt {
  flex: 1;
  min-width: 0;
}
.ae-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ae-head p {
  margin: 1px 0 0;
  color: var(--text-3);
  font-size: 13.5px;
}
.ae-head p.eng-line {
  color: var(--text-2);
  margin-top: 4px;
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--page-pad)) 16px;
  padding: 2px var(--page-pad) 4px;
  scroll-padding: 0 var(--page-pad);
}
.tabs::-webkit-scrollbar {
  display: none;
}
@media (max-width: 720px) {
  .tabs {
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--page-pad), #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--page-pad), #000 calc(100% - 28px), transparent 100%);
  }
  .tabs button {
    scroll-snap-align: start;
  }
}
.tabs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--fill);
  transition: background 150ms, color 150ms;
}
.tabs button:hover {
  color: var(--text);
}
.tabs button[aria-selected="true"] {
  background: var(--text);
  color: var(--bg);
}
:root[data-theme="glass"] .tabs button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.92);
  color: #14161d;
}
.tab-n {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
}
.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade-in 160ms ease;
}
.panel-stack > .note-card {
  margin: 0;
}
.form-card .field:last-of-type {
  margin-bottom: 10px;
}
.form-card > p {
  margin: 0 0 12px;
}
.form-card .checks {
  max-height: none;
}
.owner-mark {
  color: var(--accent-text);
  font-weight: 650;
}
@media (max-width: 520px) {
  .ae-msg {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 22px;
  }
  .ae-msg span:not(.ic) {
    display: none;
  }
}
.form-card .field .inp + .inp {
  margin-top: 2px;
}
.save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}
.save-row .hint {
  margin-right: auto;
}
.save-row .btn {
  min-width: 110px;
}
.switch-row.tight {
  margin: 0;
  padding: 10px 16px;
}
.card .switch-row {
  margin-bottom: 0;
}
.card .switch-row + .switch-row {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}
.del-agent {
  margin-top: 8px;
}
.select.wide {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  font-size: 15px;
}
.engine-order {
  margin: 6px 0 8px !important;
  font-size: 13.5px !important;
  line-height: 1.5;
}
.card .eng-line {
  margin: 0;
}
.eng-line.ok {
  color: var(--text);
}
.kn-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kn-actions .hint {
  margin-left: auto;
}
.kn-list .li .txt {
  text-align: left;
  min-width: 0;
}
.f-ext.note {
  background: var(--fill-2);
  color: var(--text-2);
}
.t2.clamp {
  white-space: normal !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.secret {
  padding: 12px 14px;
  margin: 8px 0 10px;
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.btn-row.wrap {
  flex-wrap: wrap;
}
.btn-row.wrap .btn {
  flex: 0 0 auto;
}
.tag.warn {
  background: rgba(255, 120, 90, 0.16);
  color: var(--danger);
}
.rcard {
  display: block;
  padding: 12px 14px 6px;
  margin: 0 0 8px;
  border-radius: 16px;
  background: var(--fill);
}
:root[data-theme="clean"] .rcard {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.rc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  font-size: 15.5px;
  min-width: 0;
}
.rc-title b {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rc-body {
  font-size: 14.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rcard .d-actions {
  align-items: center;
}
.rc-by {
  font-size: 12.5px;
  color: var(--text-3);
  margin-right: auto;
}
.filters .select {
  flex: 1 1 0;
}

/* My AI: your own AIs in the order they answer (Settings → Connect your AI) */
.myai {
  margin-bottom: 4px;
}
.myai .list {
  margin-top: 2px;
}
button.li.myai-row {
  width: 100%;
  min-height: 58px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
button.li.myai-row:last-child {
  border-bottom: 0;
}
button.li.myai-row:hover {
  background: var(--fill);
}
button.li.myai-row:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.myai-first,
.myai-pick {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}
.myai-first {
  color: var(--ok-text, var(--ok));
}
.myai-pick {
  color: var(--accent-text);
}
.myai-hint {
  margin: 8px 4px 14px;
}

/* connect your AI */
.connect-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 10px 8px 18px;
}
.connect-hero .emo.big {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 22px;
}
.connect-hero .emo.big .ic {
  width: 34px;
  height: 34px;
}
.connect-hero p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.45;
  max-width: 440px;
}
.runner-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.runner-card.on {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 55%, transparent);
}
.runner-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.runner-top .sdot.big {
  margin-top: 4px;
}
.runner-top .txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.runner-top b {
  font-size: 16px;
}
.runner-top span {
  font-size: 14px;
  color: var(--text-2);
}
.runner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 26px;
}
.runner-meta span {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--fill-2);
  color: var(--text-2);
}
.runner-card .btn {
  margin-left: 26px;
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 14px 14px 52px;
  border-radius: 18px;
  background: var(--fill);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
:root[data-theme="clean"] .steps li {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
}
.steps li > span {
  color: var(--text-2);
  font-size: 14px;
}
.steps .secret {
  width: 100%;
}
ul.plain {
  margin: 0 0 12px;
  padding: 0 0 0 18px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
ul.plain b {
  color: var(--text);
  font-weight: 600;
}
.check.plain-check {
  border: 0;
  padding: 6px 0 0;
  min-height: 44px;
  font-weight: 600;
}
@media (pointer: coarse) {
  .gchip,
  .sec.sub {
    min-height: 44px;
  }
  .tabs button {
    position: relative;
    height: 40px;
  }
  .tabs button::before {
    content: "";
    position: absolute;
    inset: -2px 0;
  }
}

.hint.again {
  margin: 12px 4px 0;
  font-size: 14px;
}
.linkish {
  color: var(--accent-text);
  font-weight: 650;
  min-height: 44px;
  min-width: 44px; /* a short word ("Back") is still a 44 px tap (phone walk 2, F) */
  padding: 0 2px;
}
.linkish:hover {
  text-decoration: underline;
}
.a-mark.tap {
  cursor: pointer;
}
.check .txt .ic {
  margin-left: 5px;
  vertical-align: -2px;
  color: var(--text-3);
}

/* DM header: who can read this chat, always in view (a lock or an eye; the words on desktop). Only the engine label
   and the description shrink, so the mark never falls behind the ellipsis. */
.g-sub.dm-sub {
  display: flex;
  align-items: center;
  min-width: 0;
}
.dm-sub .g-eng,
.dm-sub .g-desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-sub .g-desc {
  flex: 1 1 0;
}
.g-priv {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  margin-left: 6px;
  white-space: nowrap;
}
.g-priv .ic {
  opacity: 0.85;
}
.g-priv.program {
  color: var(--accent-text);
}
@media (min-width: 900px) {
  .g-eng + .g-priv::before {
    content: "·";
  }
}
.dm-sub .g-desc {
  margin-left: 4px;
}
/* agent card: the group line and the privacy line under the engine line */
.info-top .eng-line.sub {
  background: none;
  padding: 0 12px;
  margin-top: 4px;
  font-size: 13px;
}
.eng-line.priv .ic {
  flex: none;
}
/* sheets, phone and desktop: the last row of buttons (Cancel and Create) stays in reach at the bottom while a long form
   scrolls. It is the sheet's own colour, opaque (Glass: --raised-solid), so text scrolling under it never shows through
   behind the buttons. */
.sheet-body > .btn-row:last-child,
.sheet-body > form > .btn-row:last-child {
  position: sticky;
  bottom: calc(-1 * var(--body-pb));
  z-index: 2;
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: calc(-1 * var(--body-pb));
  padding: 12px 20px var(--body-pb);
  background: var(--raised-solid, var(--raised));
  box-shadow: 0 -1px 0 var(--line);
}
.sheet-body.flush > .btn-row:last-child,
.sheet-body.flush > form > .btn-row:last-child {
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 10px;
  padding-right: 10px;
}
:root[data-theme="clean"] .sheet-body > .btn-row:last-child,
:root[data-theme="clean"] .sheet-body > form > .btn-row:last-child {
  background: #fff;
}

/* 44 px to tap on a phone: the sidebar's rows, the home's chips and invite buttons, and (a larger hit area, the same
   look) the composer's "To general" and Chat / Ask agent */
@media (pointer: coarse), (max-width: 599px) {
  .nav-item {
    min-height: 44px;
  }
  .chip {
    height: 44px;
    border-radius: 22px;
  }
  .li .row-btn {
    min-height: 44px;
  }
  .seg button,
  .c-target {
    position: relative;
  }
  .seg button::before,
  .c-target::before {
    content: "";
    position: absolute;
    inset: -7px 0;
  }
  /* People on a phone: the name and its line in full, the role and Remove on a line of their own under them */
  .li.person {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .li.person > .txt {
    flex: 1 1 calc(100% - 52px);
  }
  .li.person .t1,
  .li.person .t2 {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .li.person > .select {
    margin-left: 52px;
    height: 44px;
  }
  .li.person > .icon-btn {
    margin-left: auto;
  }
}

/* ---------- sign-in: passkeys, codes and invites (CONTRACT-LOGIN.md) ---------- */
.signin-card .notice {
  margin: -10px 0 18px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}
.signin-wait {
  min-height: 160px;
  display: grid;
  place-items: center;
}
.signin-card .btn .ic {
  margin-left: -4px;
}
.pk-area {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.pk-note {
  margin: 8px 6px 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
.signin-card .pk-area .err,
.signin-card .pk-area .soft {
  margin: 12px 0 0;
  text-align: center;
}
.signin-card .err:empty,
.signin-card .soft:empty {
  display: none;
}
.signin-card .linkish {
  align-self: center;
  margin-top: 4px;
  font-size: 15px;
}
.signin-card form + .linkish {
  margin-top: 8px;
}
.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--fill-3);
}
.join-form .field:last-of-type {
  margin-bottom: 16px;
}
.signin-card .err {
  margin: -4px 0 12px;
  line-height: 1.4;
}
.link-line {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.link-line a {
  color: var(--accent-text);
  font-weight: 650;
}
.link-line a:hover {
  text-decoration: underline;
}
/* the address to open: its own line, a full tap target, and never split at a hyphen */
.link-line .go-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 2px auto -8px;
  padding: 0 10px;
  max-width: 100%;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14.5px;
}
.li .link-line .go-link,
.nc-body .link-line .go-link {
  margin-left: -10px;
  justify-content: flex-start;
}
.signin-card .link-line {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--fill);
  text-align: center;
}
.code-inp {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}
.code-inp::placeholder {
  font-weight: 500;
  color: var(--text-3);
}
.key-mark {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  align-self: center;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 12px 34px rgba(245, 154, 30, 0.32);
}
.key-mark .ic {
  width: 40px;
  height: 40px;
}
.key-mark .ic svg {
  stroke-width: 1.6;
}
.pk-setup .sub {
  max-width: 300px;
  align-self: center;
  margin-bottom: 26px;
  line-height: 1.45;
}
.pk-setup .err,
.pk-setup .soft {
  text-align: center;
}
.pk-setup .linkish {
  margin-top: 10px;
}
.invite .sub {
  line-height: 1.45;
}
.invite .btn.wide + .linkish {
  margin-top: 10px;
}
.sheet-text {
  font-size: 15px;
  margin: 0 0 18px;
}

/* the once-a-session prompt for people with no passkey: a slim card under the top bar */
.pk-banner {
  position: absolute;
  z-index: 8;
  top: calc(var(--top-h) + var(--safe-t) + 8px);
  left: 50%;
  translate: -50% 0;
  width: min(540px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px 10px 12px;
  border-radius: 20px;
  animation: drop-in var(--dur) var(--spring);
  transition: opacity 200ms, transform 200ms;
}
:root[data-theme="clean"] .pk-banner {
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 20, 30, 0.1), 0 0 0 1px var(--line);
}
:root[data-theme="grok"] .pk-banner {
  background: var(--raised);
}
.pk-banner.out {
  opacity: 0;
  transform: translateY(-8px);
}
.pk-ic {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.pk-banner .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pk-banner b {
  font-size: 14.5px;
}
.pk-banner .txt span {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
}
.pk-banner .acts {
  flex: none;
  display: flex;
}
.pk-banner > .icon-btn {
  margin-left: -6px;
}
/* "Open the secure link" is long: on a phone it gets its own row; on a wide screen the card stays one slim row */
@media (min-width: 900px) {
  .pk-banner.move {
    width: min(660px, calc(100% - 24px));
  }
}
@media (max-width: 899px) {
  .pk-banner.move {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .pk-banner.move .txt {
    flex-basis: calc(100% - 38px - 44px - 24px);
  }
  .pk-banner.move .acts {
    order: 5;
    flex-basis: 100%;
    padding-left: 50px;
  }
}

/* Settings, Sign-in and devices */
.acc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
}
button.li {
  width: 100%;
  text-align: left;
}
button.li:hover {
  background: var(--fill);
}
button.li:disabled {
  opacity: 0.6;
}
.li-ic {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--fill-2);
  color: var(--text-2);
}
.li-ic.acc {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.li.wrap .t1 {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.li.wrap .t2 {
  white-space: normal;
  line-height: 1.35;
  margin-top: 1px;
}
.li.wrap {
  padding-top: 11px;
  padding-bottom: 11px;
}
.li > .btn.sm {
  flex: none;
}
.li > .ic:last-child {
  color: var(--text-3);
}
.li.add .t1 {
  color: var(--accent-text);
}
.li.danger-row .t1 {
  color: var(--danger);
  font-weight: 600;
}
.li.danger-row .li-ic {
  color: var(--danger);
}
.li.ev .t1 {
  font-weight: 500;
  white-space: normal;
  line-height: 1.35;
}
.li.ev.recov .li-ic {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.li.quiet,
.li.line {
  min-height: 52px;
}
.li.line .link-line {
  padding: 4px 2px;
}
.li .t1.with-tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
}
.li .t1.with-tag .tag {
  margin-left: 0;
}
.pk-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  margin: 8px 0 6px;
  border-radius: 18px;
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.pk-card .pk-ic {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
.nc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.nc-body b {
  font-size: 15.5px;
}
.nc-body p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}
.nc-body .link-line {
  margin-top: 2px;
}
.alert-card {
  margin: 8px 0 10px;
  padding: 14px;
}
.alert-card .nc-body p {
  color: var(--text);
  margin-bottom: 10px;
}
.nc-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.help-line {
  margin: 24px 12px 4px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}
.signin-page > .h2:first-child {
  margin-top: 8px;
}

/* sheets: invites and codes */
.sheet-lead {
  margin: 2px 2px 10px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.code-row.big + .sheet-lead {
  margin-top: 14px;
}
.link-box {
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere; /* a link wraps where it can (after a /), and mid-word only when it must */
  -webkit-user-select: all;
  user-select: all;
}
.btn-row.left .btn {
  flex: none;
}
.invite-note {
  margin: 12px 2px 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.or-code {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--fill-3);
}
.or-code p {
  margin: 0 2px 8px;
  font-size: 14px;
  color: var(--text-2);
}
.used-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--warn-soft, var(--accent-softer));
  font-size: 14px;
  line-height: 1.4;
}
.used-box > span:not(.ic) {
  flex: 1 1 180px;
}
.used-box > .ic {
  color: var(--accent-text);
}
.li.invited {
  padding-top: 11px;
  padding-bottom: 11px;
}
.li.invited .t2 {
  color: var(--accent-text);
  white-space: normal;
  line-height: 1.35;
}
.li .row-btn {
  align-self: flex-start;
  margin-top: 8px;
  min-height: 36px;
}
.li .row-btn .ic {
  margin-left: -2px;
}

/* CONTRACT-PHONE: QR codes (always black on a white tile, in every theme, so any camera reads them) */
.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 2px;
}
.qr-tile {
  flex: none;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 20, 30, 0.08), 0 6px 20px rgba(20, 20, 30, 0.08);
  line-height: 0;
  transition: opacity 200ms;
}
.qr-tile .qr {
  display: block;
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  -webkit-user-drag: none;
  user-select: none;
}
.qr-tile .qr[width="220"] {
  width: 220px;
  height: 220px;
}
.qr-tile.used {
  opacity: 0.3;
}
.sheet-lead.qr-lead,
.qr-lead {
  text-align: center;
  margin: 14px 2px 2px;
}
.or-code .qr-lead {
  margin: 10px 2px 2px;
  font-size: 14px;
  color: var(--text-2);
}
.qr-once {
  text-align: center;
  margin: 2px 2px 0;
}
.or-code.qr-small .qr-once {
  margin-top: 2px;
}
.or-code.invite-qr .qr-wrap {
  margin-top: 6px;
}
.sheet-done {
  margin-top: 18px;
}
.sheet-done .btn {
  flex: 1;
}

/* the team code card: the code, then Share, Copy and Change (they wrap under the code on a phone) */
.code-row.team-code {
  gap: 10px 12px;
}
.code-row.team-code .code-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* on a phone the code gets its line, and Share, Copy and Change share the next one */
@media (max-width: 899px) {
  .code-row.team-code .code-acts {
    flex: 1 1 100%;
    flex-wrap: nowrap;
  }
  .code-row.team-code .code-acts .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* the sidebar's "Open on your phone", above the profile button */
.nav-item.side-phone {
  flex: none;
  margin-top: 4px;
  color: var(--accent-text);
  background: var(--accent-softer, var(--fill));
}
.nav-item.side-phone .ic {
  color: var(--accent-text);
}
.nav-item.side-phone:hover {
  background: var(--accent-soft, var(--fill-2));
}

/* "Invite someone" */
.invite-form .field + .err {
  margin: -4px 2px 10px;
}
.invite-form .err:empty {
  display: none;
}
.invite-form .select {
  height: 44px;
  width: 100%;
}
.invite-form > .btn.wide {
  margin-top: 6px;
}

/* after a #/code/ sign-in: whose account this is */
.pk-setup .not-you {
  margin: -6px 0 6px;
}
.pk-banner.who .av {
  flex: none;
}
.pk-banner.who .txt {
  align-items: flex-start;
}
.pk-banner.who .who-out {
  min-height: 44px;
  margin: -8px 0 -12px;
  font-size: 13.5px;
  padding: 0;
  text-align: left;
}

/* ---------- connect your agent: the owner's first run ("Your agent") and the choices it shares ---------- */
.agent-setup .setup-emo {
  align-self: center;
  width: 84px;
  height: 84px;
  font-size: 44px;
  border-radius: 26px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  box-shadow: 0 12px 34px rgba(245, 154, 30, 0.22);
  cursor: pointer;
  transition: transform 150ms var(--spring);
}
.agent-setup .setup-emo:active {
  transform: scale(0.96);
}
.agent-setup .sub {
  margin-bottom: 20px;
}
.agent-setup .setup-field {
  margin-bottom: 10px;
}
.agent-setup .emoji-more {
  margin: 0 0 12px;
}
.agent-setup .hint.err {
  margin-top: -2px;
}
.lbl.choices-lbl {
  display: block;
  margin: 10px 2px 8px;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  color: var(--text);
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 150ms, transform 150ms var(--spring);
}
button.choice:hover {
  background: var(--fill-2);
}
button.choice:active {
  transform: scale(0.98);
}
.choice-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.choice-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}
.choice-txt b {
  font-size: 15.5px;
  font-weight: 650;
}
.choice-sub {
  font-size: 13px;
  color: var(--text-2);
}
.choice-end {
  flex: none;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.choice-end:empty {
  display: none;
}
/* set up (the owner's Claude, a team key, a bot): a green ring and a tick */
.choice.static,
.choice.on {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 55%, transparent);
}
/* the free AI's row turns green only once it answers: getting ready, done for today, off or failed is not set up */
.choice.static.shared-ai:not(.on) {
  box-shadow: none;
}
.choice .tick {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ok);
}
.agent-setup .choices-lbl + .choices + .choices-lbl {
  margin-top: 18px;
}
.agent-setup .setup-go {
  margin-top: 22px;
}
.agent-setup .later {
  align-self: center;
  margin-top: 12px;
  min-width: 44px; /* "Later" alone is narrower than a thumb */
  min-height: 44px;
  padding: 0 12px;
}
.agent-setup .fine {
  margin-top: 8px;
}
/* "Invite your team", right after "Your agent" */
.agent-setup.invite-step .setup-emo.static {
  cursor: default;
  display: grid;
  place-items: center;
  position: relative;
}
/* a picture, not the emoji picker: no pencil */
.agent-setup .setup-emo.static::before,
.agent-setup .setup-emo.static::after {
  display: none;
}
.agent-setup .invite-link {
  margin: 0 0 14px;
}
.agent-setup .invite-link,
.agent-setup .invite-link code {
  word-break: normal; /* not .secret's break-all: the link wraps after a /, and mid-word only when it must */
  overflow-wrap: anywhere;
}
.agent-setup .setup-no-ai {
  margin: 8px 2px 0;
  text-align: left;
}
/* "Connect your AI" inside the sentence: 44 px to tap without changing the line it sits on */
.agent-setup .setup-no-ai .linkish {
  position: relative;
  display: inline-block;
  min-height: 0;
}
.agent-setup .setup-no-ai .linkish::before {
  content: "";
  position: absolute;
  inset: -13px -6px;
}
.agent-setup .shared-slot {
  display: contents;
}
.agent-setup .shared-slot[hidden] {
  display: none;
}
.btn-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-stack > .choices {
  margin-bottom: 14px;
}

/* the team AI key: its form, its card and this month's meter */
.seg.prov-seg button,
.sheet .seg.big button {
  height: 44px;
  border-radius: 14px;
}
.seg.prov-seg,
.sheet .seg.big {
  border-radius: 17px;
}
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  flex-wrap: wrap;
}
.key-row .hint {
  flex: 1 1 180px;
}
.get-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  flex: none;
}
.money-inp {
  display: flex;
  align-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input);
  transition: border-color 150ms, box-shadow 150ms;
}
:root[data-theme="grok"] .money-inp {
  border-color: #2c2b29;
}
.money-inp:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-softer);
}
.money-inp > span {
  padding-left: 14px;
  color: var(--text-2);
  font-weight: 650;
}
.money-inp .inp {
  border: 0;
  background: transparent;
  padding-left: 4px;
  box-shadow: none !important;
}
.team-ai-form .note-card {
  margin: 4px 0 12px;
}
.inp.mono {
  font-family: var(--mono);
  font-size: 15px;
}
.tai-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tai-card .note-card,
.tai-card .hint {
  margin: 0;
}
.nowrap {
  white-space: nowrap;
}
.tai-card .tai-acts {
  display: flex;
  gap: 10px;
}
.tai-card .tai-acts .btn {
  flex: 1;
  min-width: 0;
}
/* Remove is quiet: red text on a row of its own, under Change and Replace key */
.tai-card .tai-remove {
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--danger);
  font-weight: 600;
}
.tai-card.full {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 45%, transparent);
}
.meter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meter-txt {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.meter-txt b {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.meter-txt span {
  color: var(--text-2);
  font-size: 14px;
}
.meter-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--fill-3);
  overflow: hidden;
}
.meter-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 400ms var(--ease);
}
.meter.warn .meter-bar > span {
  background: var(--accent);
}
.meter.full .meter-bar > span {
  background: var(--danger);
}
@media (prefers-reduced-motion: reduce) {
  .meter-bar > span,
  .choice,
  .agent-setup .setup-emo {
    transition: none;
  }
}

/* New agent: ready-made agents, one tap each */
.tpl-grid.ready .tpl {
  min-height: 64px;
}
.tpl-grid.ready .tpl-txt {
  flex: 1;
}
.tpl.have .tpl-emo {
  background: var(--fill-2);
}
.tpl.busy {
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.tpl:disabled:not(.busy) {
  opacity: 0.5;
}
.tpl-grid + .hint.err {
  margin: 8px 0 0;
}
.lbl.new-own {
  display: block;
  margin: 8px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
:root[data-theme="grok"] .lbl.new-own {
  border-top-color: #2a2927;
}

/* Connect my bot: who it answers (two radio cards) */
.choice.radio {
  min-height: 60px;
}
.choice.radio[aria-checked="true"] {
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.radio-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 2px var(--text-3);
  display: grid;
  place-items: center;
}
.choice.radio[aria-checked="true"] .radio-dot {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.choice.radio[aria-checked="true"] .radio-dot::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.who-answers {
  gap: 8px;
}
.model-box {
  display: block;
}
.model-box .inp {
  width: 100%;
}
.tai-people {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tai-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: 14.5px;
}
.tai-person .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tai-person .amt {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.msg.agent .notice-btn {
  align-self: flex-start;
  margin: 8px 0 2px;
  min-height: 44px;
}
.tai-person .av {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.tpl-grid.ready {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tpl-grid.ready .tpl > .ic:last-child {
  flex: none;
  color: var(--text-3);
}
@media (max-width: 599px) {
  /* one per row on a phone, so each says what it does in full */
  .tpl-grid.ready {
    grid-template-columns: minmax(0, 1fr);
  }
}
.bot-after {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bot-after > .eng-line,
.bot-after > .hint {
  margin: 0 2px;
}
.bot-after > .eng-line {
  margin-top: 4px;
}
.agent-setup .setup-emo {
  position: relative;
}
/* a small pencil badge: the big emoji is a button */
.agent-setup .setup-emo::before,
.agent-setup .setup-emo::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.agent-setup .setup-emo::before {
  background: var(--pop);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--line);
}
.agent-setup .setup-emo::after {
  background: var(--text-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 19.5l1-4L15.8 5.2a2 2 0 012.9 0l.1.1a2 2 0 010 2.9L8.5 18.5z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 19.5l1-4L15.8 5.2a2 2 0 012.9 0l.1.1a2 2 0 010 2.9L8.5 18.5z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

/* ---------- Made: what the team and its agents made, and where it is kept ---------- */
.mk-filters .select {
  flex: 0 1 auto;
  max-width: 62%;
  height: 44px;
  border-radius: 22px;
}
.mk-filters .search-input {
  height: 44px;
  margin: 0;
  border-radius: 22px;
}
.li.mk {
  padding: 0 6px 0 0;
  gap: 4px;
  transition: background 600ms ease;
}
/* the row's ⋯ stays inside the list's rounded edge (the list clips): 44 px wide, not 42 */
.li.mk > .icon-btn {
  margin-right: 0;
}
/* a file row's link: 44 px tall even with one short line */
.li > a.txt {
  min-height: 44px;
  justify-content: center;
}
.mk-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 0 10px 14px;
  color: inherit;
  text-decoration: none;
  border-radius: 0;
  -webkit-touch-callout: none;
}
@media (hover: hover) {
  .li.mk:hover {
    background: var(--fill);
  }
  :root[data-theme="glass"] .li.mk:hover,
  :root[data-theme="grok"] .li.mk:hover {
    background: var(--fill-2);
  }
}
.mk-open .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mk-open .t1 {
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mk-open .nw {
  white-space: nowrap;
}
.li.mk.hl {
  background: var(--accent-soft);
}
.mk-lead {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}
.mk-lead.link {
  background: var(--accent-softer);
  color: var(--accent-text);
}
.mk-lead.img {
  background: var(--fill-2);
}
.mk-lead.img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* the sheet "Save to Made" opens: what is kept, then its title */
.mk-what {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
  border-radius: 16px;
  background: var(--fill);
}
.mk-what-t {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mk-what-t b {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-what-t span {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi .mi-sub {
  min-width: 0;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* chips under a message: "Saved to Made", "Follow-up tomorrow 9:00 AM" with Cancel */
.mchips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  max-width: 100%;
}
.msg.own .mchips {
  justify-content: flex-end;
}
.mchip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 11px 3px 8px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none;
  text-align: left;
  transition: background 150ms, color 150ms;
}
.mchip .ic {
  color: var(--accent-text);
  flex: none;
}
.mchip span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* quiet, like the answer's own meta line: the words are the answer */
.mchip.fu {
  color: var(--text-2);
}
.mchip.fu.skipped,
.mchip.fu.skipped .ic {
  color: var(--text-3);
}
.mchip.fu.due .ic {
  animation: breathe 1.6s ease-in-out infinite;
}
/* the chip and its Cancel: far enough apart that a thumb on the chip's end never lands on Cancel */
.fu-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}
.mchip-x {
  flex: none;
  position: relative;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
@media (hover: hover) {
  .mchip:hover,
  .mchip-x:hover {
    background: var(--fill-2);
    color: var(--text);
  }
}
.mchip:active,
.mchip-x:active {
  background: var(--fill-2);
}
.mchip-x:disabled {
  opacity: 0.5;
}
/* an invisible hit area: 44 px tall on touch screens, the chip's own size on screen */
@media (pointer: coarse) {
  .mchips {
    gap: 6px 8px;
    margin-top: 10px;
    margin-bottom: 4px;
  }
  .mchip::before,
  .mchip-x::before {
    content: "";
    position: absolute;
    inset: -8px -3px;
    min-width: 44px;
  }
  /* side by side, each hit area stops at its own edge: they never overlap */
  .fu-pair .mchip::before {
    right: 0;
  }
  .fu-pair .mchip-x::before {
    left: 0;
  }
}
/* "In Made" in an agent answer's action row, after "via your Claude": one tap to what it recorded */
.a-made {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: 0;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
}
.a-made .ic {
  color: var(--accent-text);
}
@media (hover: hover) {
  .a-made:hover {
    background: var(--fill);
    color: var(--text);
  }
}
@media (pointer: coarse) {
  .a-made {
    min-height: 44px;
    margin-left: 0;
  }
}
/* the action row on a phone: the buttons never shrink below their 44 px, and a footer that doesn't fit beside them
   moves to its own line under them, whole (a short one stays on the row) */
.a-actions {
  flex-wrap: wrap;
}
.a-actions button {
  flex: none;
}
.a-actions .a-via {
  flex: 0 1 auto;
  max-width: 100%;
}
/* a lighter chat: the buttons show on the newest answer, one whose plan still runs (Stop) and one tapped, and while
   a keyboard is inside the answer; the footer and "In Made" stay on every answer (markAnswerRows) */
.msg.agent:not(.a-newest):not(.a-running):not(.a-tapped):not(:focus-within) > .a-actions > button,
.msg.agent.a-board:not(:focus-within) > .a-actions > button {
  display: none;
}
.msg.agent:not(.a-newest):not(.a-running):not(.a-tapped):not(:focus-within) > .a-actions.a-bare,
.msg.agent.a-board:not(:focus-within) > .a-actions.a-bare {
  display: none;
}
.msg.agent:not(.a-newest):not(.a-running):not(.a-tapped):not(:focus-within) > .a-actions,
.msg.agent.a-board:not(:focus-within) > .a-actions {
  margin-left: 0;
  min-height: 32px;
}
.msg.agent:not(.a-newest):not(.a-running):not(.a-tapped):not(:focus-within) > .a-actions .a-via,
.msg.agent.a-board:not(:focus-within) > .a-actions .a-via {
  margin-left: 0;
}
.a-actions button.a-word {
  width: auto;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px 0 10px;
  font-size: 13px;
  font-weight: 600;
}
/* an admin's Edit in a sheet's header (Group info): the iOS spot, beside the close button */
.sheet-head .head-act {
  flex: none;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-text);
}
@media (hover: hover) {
  .sheet-head .head-act:hover {
    background: var(--fill);
  }
}
.a-reply.fu .ic {
  color: var(--accent-text);
}
.fu-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 320px;
  padding: 10px 12px 8px;
  font-size: 13.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.sheet .fu-info {
  max-width: none;
  padding: 4px 12px 10px;
  font-size: 15px;
}
.fu-info b {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
}
.sheet .fu-info b {
  font-size: 16px;
}
.fu-info .fu-for {
  font-size: 12.5px;
  color: var(--text-3);
}
.a-by.fu-by .ic {
  transform: none;
  color: var(--accent-text);
}
.a-by.fu-by span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- notes, queued jobs and never drop (CONTRACT-AGENTS.md, Notes and memory; Never drop) ---------- */
/* "Queued for Main Brain · about 40 s", "Main Brain is trying again · in 20 s": the thinking row, quiet, no dots */
.thinking.wait .t {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
/* why a question got no answer, in place of its thinking row: "Main Brain didn't answer: agents are paused…" */
.status.skip.end {
  margin: 10px 0 4px;
  max-width: 460px;
}
.status.skip:has(.line-btn) {
  align-items: center;
}
.status.skip:has(.line-btn) .ic {
  margin-top: 0;
}
.status .line-btn {
  flex: none;
  min-height: 36px;
  padding: 0 10px;
  margin-left: 2px;
  border-radius: 12px;
  font-weight: 650;
  color: var(--accent-text);
  white-space: nowrap;
}
@media (hover: hover) {
  .status .line-btn:hover {
    background: var(--fill);
  }
}
@media (pointer: coarse) {
  .status .line-btn {
    min-height: 44px;
  }
}
/* a line under my own question wraps and keeps to the right, like the bubble above it */
.msg.own .status.skip {
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  justify-content: flex-end;
  text-align: right;
}
/* the plan card's one line in place of its summary row: "Main Brain couldn't sum up: …" */
.plan-row.plan-note {
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.35;
}
.plan-row.plan-note .ic {
  flex: none;
  color: var(--text-3);
}
.plan-st.queued,
.plan-st.retrying {
  color: var(--text-2);
}
/* note chips ("Noted: …", "Remembered", "Note waiting") and a failure line's Retry share the follow-up chip's look */
.mchip.note .ic,
.mchip.again .ic,
.mchip.retry .ic {
  color: var(--accent-text);
}
.mchip.note.waiting .ic {
  color: var(--warn, var(--accent-text));
}
.mchip.note.off {
  color: var(--text-3);
  box-shadow: none;
  background: transparent;
  padding-left: 2px;
}
.mchip.note.off .ic {
  color: var(--text-3);
}
@media (hover: hover) {
  .mchip.note.off:hover {
    background: transparent;
    color: var(--text-3);
  }
}
a.mchip-x {
  display: inline-flex;
  align-items: center;
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}
.mchip-x {
  white-space: nowrap;
}
.mchip.retry:disabled,
.mchip.again:disabled {
  opacity: 0.5;
}
/* Made | Notes: two halves, each a 44 px target, full width on a phone */
.seg.big.mk-switch {
  margin: 2px 0 12px;
}
.seg.big.mk-switch button {
  min-height: 44px;
  height: 44px;
  border-radius: 20px;
  font-size: 15px;
}
.seg.big.mk-switch button .ic {
  color: var(--text-3);
}
.seg.big.mk-switch button[aria-pressed="true"] .ic {
  color: var(--accent-text);
}
.mk-filters.nt-filters .select {
  max-width: 100%;
  flex: 1;
}
/* the Notes page */
.nt-usage {
  margin: 0 4px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.nt-usage.full {
  color: var(--warn, var(--accent-text));
}
.nt-hint {
  margin: 0 4px 14px;
  line-height: 1.4;
}
.nt-add {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 16px;
}
.nt-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}
.nt-input {
  display: block;
  min-height: 46px;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
}
textarea.inp.nt-input {
  resize: none;
}
.nt-field .nt-input {
  padding-right: 64px;
}
.nt-count {
  position: absolute;
  right: 12px;
  bottom: 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.nt-save {
  flex: none;
}
.li.nt {
  align-items: flex-start;
  gap: 10px;
  padding: 10px 6px 10px 14px;
  transition: background 600ms ease;
}
.li.nt .txt {
  padding-top: 1px;
  gap: 3px;
}
.nt-num {
  flex: none;
  min-width: 26px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.nt-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}
.li.nt .nt-meta {
  white-space: normal;
  line-height: 1.35;
}
.li.nt.waiting .nt-meta {
  color: var(--warn, var(--text-2));
}
.li.nt > .btn.sm,
.li.nt > .icon-btn {
  flex: none;
  margin-top: -2px;
}
.li.nt > .icon-btn {
  margin-right: 0;
}
.li.nt.hl {
  background: var(--accent-soft);
}
.nt-edit .txt {
  gap: 8px;
}
.nt-edit-acts {
  margin-top: 0;
}
.nt-edit-acts .btn {
  flex: none;
}
.nt-ch .li-link .t2 {
  white-space: nowrap;
}
.nt-ch-ic {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-softer);
  color: var(--accent-text);
}
.nt-fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  margin: 18px 0 6px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}
.nt-fold .ic {
  color: var(--text-3);
  transition: transform 200ms ease;
}
.nt-fold[aria-expanded="true"] .ic {
  transform: rotate(180deg);
}
.nt-diff .txt {
  gap: 4px;
}
.nt-was,
.nt-now {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.nt-was {
  color: var(--text-2);
}
.nt-was b,
.nt-now b {
  font-weight: 650;
  color: var(--text);
}
.nt-dli {
  align-items: flex-start;
}
/* Team AI usage: the notes' daily tidy-up has its own row */
.tai-person .tidy-av {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-softer);
  color: var(--accent-text);
}
.tai-sub {
  color: var(--text-3);
  font-weight: 500;
}
/* a long chip ("Noted: Logo files live in…") shrinks with "…" so its Undo always stays on screen beside it */
.fu-pair .mchip {
  flex: 0 1 auto;
  min-width: 0;
}
.nt-pane .btn.sm {
  min-height: 44px;
}
.nt-acts {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.nt-arch .li.nt {
  padding-right: 14px;
}

/* ---------- Memory 3: playbooks, Made status and history, the weekly card, Keep memory on GitHub ---------- */
/* Made | Notes | Playbooks: three halves stay 44 px tall and full width at 375 px */
.seg.big.mk-switch.three button {
  gap: 5px;
  padding: 0 6px;
  min-width: 0;
}
.seg.big.mk-switch button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 380px) {
  .seg.big.mk-switch.three button {
    font-size: 14.5px;
  }
}
.mk-filters.pb-filters .search-input {
  flex: 1;
}
/* where a Made item stands now: "Live", "Waiting on Ben", "Done" */
.mk-st {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 7px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
  vertical-align: 1px;
  color: var(--accent-text);
  background: var(--accent-softer);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-st.waiting {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.mk-st.done {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 13%, transparent);
}
.mk-st.stopped,
.mk-st.none {
  color: var(--text-3);
  background: var(--fill-2);
}
.li .t3,
.mk-open .t3 {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the item's sheet: its status, Set status, and its history newest first */
.mi-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 10px;
}
.mi-top .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mi-top .t1 {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.mi-top .t2 {
  font-size: 13px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.mi-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.mi-status .mk-st {
  font-size: 13.5px;
  line-height: 24px;
  padding: 0 10px;
  border-radius: 12px;
}
.mi-status .t2 {
  font-size: 13px;
  color: var(--text-2);
}
.mi-acts {
  flex-wrap: wrap;
}
.mk-hist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mk-ev {
  align-items: flex-start;
  min-height: 0;
  padding: 10px 14px;
  gap: 10px;
}
.mk-ev-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--text-3);
}
/* a status's dot takes its pill's colour: Live and Done green, Waiting amber, a draft or anything else grey */
.mk-ev.st .mk-ev-dot {
  background: var(--text-3);
}
.mk-ev.st.done .mk-ev-dot {
  background: var(--ok);
}
.mk-ev.st.waiting .mk-ev-dot {
  background: var(--accent);
}
.mk-ev .mk-ev-t {
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}
.mk-ev .t2 {
  white-space: normal;
}
.mi-all {
  display: flex;
  width: 100%;
  margin-top: 14px;
  background: none;
  color: var(--accent-text);
}
.mi-all:hover {
  background: var(--fill);
}
/* Set status: four one-tap choices, 2 by 2 on a phone */
.mk-for {
  margin: 0 4px 10px;
  font-weight: 600;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.mk-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 520px) {
  .mk-choices {
    grid-template-columns: 1fr 1fr;
  }
}
.mk-choices .btn {
  min-height: 46px;
  padding: 0 8px;
}
.mk-choices .btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.mk-own {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.mk-own .field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.mk-own > .btn {
  flex: none;
  margin-bottom: 0;
}
/* chips: the quiet "Used: …", a Made status, "Suggest in #general" */
.mchip.used {
  color: var(--text-3);
  background: none;
  box-shadow: none;
  padding-left: 4px;
  font-weight: 550;
}
.mchip.used .ic {
  color: var(--text-3);
}
@media (hover: hover) {
  button.mchip.used:hover {
    background: var(--fill);
    color: var(--text-2);
  }
}
.mchip.made.st .ic {
  color: var(--ok);
}
.mchip.note.suggest {
  color: var(--accent-text);
}
.mchip.note.done,
.mchip.note.done .ic {
  color: var(--text-3);
}
.sg-now {
  margin: 0 4px 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}
.sg-now b {
  display: block;
  font-weight: 650;
  color: var(--text);
}
.sg-was {
  margin: 2px 0 0;
}
/* a playbook's lines: plain text, as written; a change's new lines are marked */
.pb-lines {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.pb-ln {
  white-space: pre-wrap;
}
.pb-lines.has-chg {
  padding-left: 10px;
}
.pb-ln.chg {
  margin-left: -10px;
  padding-left: 8px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}
.pb-ln.none {
  color: var(--text-3);
}
.pb-gap {
  height: 8px;
}
.soul-body.pb-body.clip .pb-lines {
  max-height: 22em; /* about 14 lines */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.pb-box {
  padding: 12px 14px;
  margin: 0 0 12px;
  border-radius: 14px;
  background: var(--fill);
}
:root[data-theme="clean"] .pb-box {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.pb-box.was .pb-lines {
  color: var(--text-3);
}
.pb-meta {
  margin: 0 4px 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.pb-meta.t2 {
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 12px;
}
.pb-stats {
  margin: -4px 4px 12px;
  font-size: 13px;
  color: var(--text-3);
}
.pb-quiet {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
}
.linkish.danger {
  color: var(--danger);
}
.pb-steps {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}
.pb-form .field {
  margin-bottom: 12px;
}
/* the Playbooks half */
.pb-hint {
  margin: 0 4px 12px;
}
.pb-add {
  width: 100%;
  margin: 0 0 14px;
}
.pb-row {
  width: 100%;
  text-align: left;
  min-height: 64px;
}
@media (hover: hover) {
  .pb-row:hover {
    background: var(--fill-2);
  }
}
.pb-row.arch {
  opacity: 0.75;
}
.pb-lead {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-softer);
  color: var(--accent-text);
}
.li > .pb-lead:first-child .ic,
.li > .pb-lead .ic {
  color: var(--accent-text);
}
.pb-flag {
  color: var(--accent-text);
}
.pb-cap {
  margin: 10px 4px 0;
}
.pb-arch {
  margin-bottom: 8px;
}
.pb-ver {
  width: 100%;
  text-align: left;
}
@media (hover: hover) {
  .pb-ver:hover {
    background: var(--fill-2);
  }
}
.pb-ver .t2,
.pb-ver .t3,
.pb-row .t3 {
  white-space: normal;
}
/* the weekly "What I learned" card: a title, the numbers, then one row per change with its one-tap buttons */
.wk {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin-top: 2px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  --soul-line: var(--soul-sep, var(--line));
}
:root[data-theme="grok"] .wk {
  --soul-sep: var(--bg);
}
.wk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 6px 12px;
}
.wk-head .txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wk-title {
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
}
.wk-nums {
  margin: 0;
  padding: 2px 14px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.wk-nums .nw {
  white-space: nowrap;
}
.wk-none {
  margin: 0;
  padding: 10px 14px 14px;
  font-size: 14px;
  color: var(--text-3);
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.wk-rows {
  display: flex;
  flex-direction: column;
}
.wk-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 10px 8px 14px;
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.wk-words {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  color: var(--text);
  overflow-wrap: anywhere;
}
.wk-words > .ic {
  flex: none;
  color: var(--text-3);
}
button.wk-words {
  margin: -4px 0;
  padding: 4px 0;
  border-radius: 8px;
}
span.wk-words {
  min-height: 0;
  padding: 8px 0;
}
@media (hover: hover) {
  button.wk-words:hover span {
    text-decoration: underline;
    text-decoration-color: var(--text-3);
  }
}
.wk-row[data-state="undone"] .wk-words,
.wk-row[data-state="no"] .wk-words,
.wk-row[data-state="gone"] .wk-words {
  color: var(--text-3);
}
.wk-acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.wk-acts .btn.sm {
  min-height: 44px;
  min-width: 64px;
  padding: 0 14px;
}
.wk-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.wk-state.ok {
  color: var(--soul-ok, var(--ok));
}
:root[data-theme="clean"] .wk {
  --soul-ok: #167339;
}
@media (max-width: 520px) {
  /* on a phone a row's one button sits beside its words when they fit, and under them, at the right, when not */
  .wk-row {
    padding: 6px 10px 6px 14px;
  }
  .wk-words {
    flex-basis: 170px;
  }
}
.wk-more {
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.wk-foot {
  display: flex;
  padding: 10px 12px 12px;
  box-shadow: inset 0 1px 0 var(--soul-line);
}
.wk-foot .btn {
  flex: 1 1 auto;
  min-height: 46px;
}
.wk-diff .pb-ln.add {
  color: var(--text);
  font-weight: 600;
}
.wk-diff .pb-ln.add::before {
  content: "+ ";
  color: var(--soul-ok, var(--ok));
}
.wk-diff .pb-ln.del {
  color: var(--text-3);
  text-decoration: line-through;
}
.wk-diff .pb-ln.del::before {
  content: "− ";
  text-decoration: none;
  display: inline-block;
}
.wk-sheet-acts {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 12px;
}
.sheet .wk-rows {
  --soul-line: var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--fill);
  margin-bottom: 12px;
}
.sheet .wk-rows .wk-row:first-child {
  box-shadow: none;
}
.sheet .wk-nums {
  padding: 0 4px 12px;
}
/* Settings: Keep memory on GitHub */
.br-all {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 4px 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.br-all .ic {
  flex: none;
  margin-top: 3px;
  color: var(--accent-text);
}
.br-all b {
  font-weight: 650;
}
.br-card .br-all {
  margin: 12px 0 0;
}
.br-steps {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.br-step {
  gap: 12px;
}
.br-step .t2 {
  white-space: normal;
}
.br-step > .btn {
  flex: none;
  min-width: 96px;
}
.br-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.br-small {
  margin: 0 4px;
}
.br-repo {
  display: flex;
  flex-wrap: wrap; /* at 375 px "Open on GitHub" goes under the name rather than breaking it in three */
  align-items: center;
  gap: 12px;
}
.br-repo .txt {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.br-repo .t1 {
  font-weight: 650;
  overflow-wrap: break-word;
}
.br-repo .t2 {
  font-size: 13px;
  color: var(--text-2);
}
.br-repo > .btn.sm {
  flex: none;
  min-height: 44px;
  margin-left: auto;
}
.br-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-softer);
  color: var(--accent-text);
}
.br-line,
.br-readers,
.br-held,
.br-fail p,
.br-stop-t {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}
.br-line .ic,
.br-readers .ic,
.br-held .ic,
.br-fail .ic,
.br-stop-t .ic {
  flex: none;
  margin-top: 3px;
  color: var(--text-3);
}
.br-line .ic {
  color: var(--ok);
}
.br-fail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--warn-soft, var(--accent-softer));
}
.br-fail p {
  flex: 1 1 200px;
  margin: 0;
  color: var(--text);
}
.br-fail .ic {
  color: var(--accent-text);
}
.br-fail > .btn.sm {
  min-height: 44px;
  margin-left: auto;
}
.br-held .ic {
  color: var(--accent-text);
}
.br-stop {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  background: var(--warn-soft, var(--accent-softer));
}
:root[data-theme="clean"] .br-stop {
  background: var(--warn-soft);
  box-shadow: none;
}
.br-stop-t {
  margin: 0;
  color: var(--text);
}
.br-stop-t .ic {
  color: var(--accent-text);
}
.br-acts {
  margin-top: 14px;
}
.br-fixes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.br-fixes > .btn {
  flex: 1 1 auto;
}
.br-held-list {
  margin: 10px 0 0;
}
.br-held-list .li {
  min-height: 48px;
}
.br-held-list .btn.sm {
  min-height: 44px;
  min-width: 64px;
}
.br-off {
  display: block;
  margin: 18px auto 0;
}
.msg.agent a.notice-btn {
  text-decoration: none;
}
/* an archived playbook: its row opens it, Restore brings it back in one tap */
.li.pb-arow {
  padding: 0 10px 0 0;
  gap: 6px;
}
.pb-arow > .pb-row.li-link {
  margin: 0;
  padding: 10px 6px 10px 14px;
  border-bottom: 0;
  background: none;
}
.pb-arow > .pb-row > .ic:last-child {
  display: none;
}
.pb-arow > .btn.sm {
  flex: none;
  min-height: 44px;
}

/* A11: a friend's question found no AI. The notice's buttons (Open Team AI, Free AI on this Mac) wrap on a phone */
.msg.agent .notice-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}
.msg.agent .notice-btns .notice-btn {
  margin: 0;
}

/* ---- people (launch batch 2): the Mac away, the home's passkey card, joins and letting a friend back in ---------- */
/* "Can't reach Tony's Mac. It may be asleep. Messages send when it's back." is two lines on a phone */
.offline-note.mac {
  white-space: normal;
  text-align: center;
  width: max-content;
  max-width: calc(100% - 32px);
  line-height: 1.35;
  border-radius: 16px;
}
.offline-note.mac::before {
  flex: none;
}
/* a copy from another Mac: where the offline note goes, and below it when both show */
.main:has(.offline-note:not(.other-mac)) .offline-note.other-mac {
  top: calc(var(--top-h) + var(--safe-t) + 52px + var(--pk-h));
}
.status.wait {
  color: var(--text-2);
}
/* stays on the home screen until there's a passkey (in place of the once-a-session banner) */
.pk-home {
  flex: none;
  align-self: center;
  width: min(540px, 100%);
  margin: 8px 0 0;
  padding: 14px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:root[data-theme="clean"] .pk-home {
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 20, 30, 0.06), 0 0 0 1px var(--line);
}
:root[data-theme="grok"] .pk-home {
  background: var(--raised);
}
.pk-home-t {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.pk-home .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pk-home b {
  font-size: 15px;
}
.pk-home .txt span {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-2);
}
.pk-home .btn {
  min-height: 44px;
  width: 100%;
}
@media (min-width: 900px) {
  .pk-home {
    flex-direction: row;
    align-items: center;
  }
  .pk-home-t {
    flex: 1;
    align-items: center;
  }
  .pk-home .btn {
    width: auto;
  }
}
/* the owner's notices under Main Brain's line: Remove, or the words a friend sees */
.msg.agent .pn-acts {
  display: flex;
  gap: 8px;
}
.msg.agent .pn-done {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-2);
}
.msg.agent .pn-done.ok {
  color: var(--ok-text, var(--text-2));
}
.pn-letin {
  margin-top: 10px;
  max-width: 420px;
}
.pn-line {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-2);
}
.pn-line:empty {
  display: none;
}
.pn-line {
  margin-top: 8px;
}
.pn-line.err {
  color: var(--danger);
}
.pn-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pn-choice {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--edge);
  transition: background 150ms, transform 150ms;
}
:root[data-theme="clean"] .pn-choice {
  background: #fff;
  box-shadow: none;
}
:root[data-theme="grok"] .pn-choice {
  background: var(--fill-2);
}
.pn-choice:hover {
  background: var(--fill-2);
}
.pn-choice:active {
  transform: scale(0.97);
}
.pn-choice:disabled {
  opacity: 0.55;
}
.pn-choices .btn {
  min-height: 44px;
}
.pn-no {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}
/* the signed-out browser's words while it waits for the owner */
.letin-label {
  text-align: center;
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-2);
}
.letin-words {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  padding: 18px 12px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--fill-2);
  overflow-wrap: anywhere;
}
.letin-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 24px;
  margin: 0 0 8px;
  color: var(--text-2);
}
.spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  flex: none;
}
.letin-ask {
  margin-bottom: 10px;
}
/* Retry and Delete under a message that waits for the Mac: 44 px to tap, the row stays slim */
.status.wait button,
.status.bad button {
  min-height: 44px;
  margin: -6px 0;
  padding: 0 6px;
}
/* waiting for the Mac is not an error: no red ring, just the paler bubble of a message on its way */
.msg.failed.waiting .bubble {
  box-shadow: none !important;
  opacity: 0.72;
}

/* ---- pings (Web Push): the "Get pings" step and Settings, Notifications ---------------------------------------------- */
.pings-step .sub {
  max-width: 300px;
  align-self: center;
  margin-bottom: 22px;
  line-height: 1.45;
}
.pings-steps {
  margin: 0 0 4px;
  padding: 0 0 0 22px;
  text-align: left;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}
.pings-step .pings-steps {
  align-self: center;
  max-width: 300px;
  margin-bottom: 24px;
}
.pings-steps li {
  margin: 7px 0;
  padding-left: 2px;
}
.pings-steps .ic {
  width: 17px;
  height: 17px;
  vertical-align: -3px;
  color: var(--accent-text);
}
.pings-card .pings-note {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text);
}
.pings-card .pings-note:last-child {
  margin-bottom: 0;
}
.pings-card .pings-steps {
  font-size: 14px;
}
.pings-card .pings-seg {
  margin-top: 8px;
}
.pings-card .pings-desc {
  margin: 10px 0 14px;
  line-height: 1.4;
}
.pings-card .err {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--danger);
}
.pings-card .err:empty {
  display: none;
}
.pings-wait {
  min-height: 46px;
  display: grid;
  place-items: center;
}

/* ---------- asking by name (CONTRACT-AGENTS.md, Asking by name) ---------- */
/* the composer's cue: "Brain will answer" once the words ask it by name */
.c-cue {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 4px 2px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text);
  animation: fade-in 180ms;
}
.c-cue[hidden] {
  display: none;
}
/* the writer's "Ask Brain?" chip: the one tap that asks it (no AI decided this) */
.mchip.ask-hint {
  color: var(--accent-text);
  background: var(--accent-soft);
  box-shadow: none;
}
.mchip.ask-hint:disabled {
  opacity: 0.55;
}
@media (hover: hover) {
  .mchip.ask-hint:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
    filter: brightness(1.08);
  }
}
/* a personal agent: "Mikaella's agent" next to its name, and her small avatar on its mark's corner */
.a-owner {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.a-mark.owned {
  position: relative;
}
.a-mark .av.own-av {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 15px;
  height: 15px;
  font-size: 7px;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--bg);
  pointer-events: none;
}
.info-top .owner-line {
  margin-top: -2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

/* ---------- the working card (teammate.md §4.3, §6.5): "On it", plain steps, the words so far, a real Stop ---------- */
.working {
  margin: 10px 0 4px;
  max-width: min(560px, 100%);
}
.working .w-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.working .w-t {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.3;
}
.working .w-name {
  flex: none;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.working .w-step {
  min-width: 0;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.working .ty-dots {
  margin-left: 0;
}
.working .w-stop {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.working .w-stop:disabled {
  opacity: 0.55;
}
@media (hover: hover) {
  .working .w-stop:hover {
    background: var(--fill-2, var(--fill));
  }
}
@media (pointer: coarse) {
  .working .w-head,
  .working .w-stop {
    min-height: 44px;
  }
}
/* the answer's words so far: the newest lines in view, the oldest fading out at the top once it runs long */
.working .w-live {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-height: 42vh;
  overflow: hidden;
  margin: 2px 0 0; /* in line with the posted answer's words, so nothing jumps sideways when it lands */
  color: var(--text);
}
.working .w-live.long {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
}
.working .w-live[hidden] {
  display: none;
}
.why-ai {
  margin: 0;
  padding: 4px 4px 12px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
}
/* a4 models: which model of the asker's own plan did it, in small print under Why this AI? */
.model-line {
  margin: -6px 0 0;
  padding: 0 4px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
}
@media (prefers-reduced-motion: reduce) {
  .working .ty-dots i {
    animation: none !important;
    opacity: 0.8;
  }
}

/* ---- hosted team: people and sign-in (area P: the QR sheet, the let-in cards, Make owner) ---- */
.note-card.info {
  color: var(--text);
}
.qr-ask:empty {
  display: none;
}
.qr-ask {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.qr-ask .btn-row .btn {
  min-height: 44px;
  flex: 1 1 0;
}
.qr-ask .qr-q {
  overflow-wrap: anywhere;
}
.handover-wait {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--text-2, inherit);
}
.handover-wait .linkish {
  min-height: 44px;
}
/* K1: a key or card refused before sending: the line above the box, the secure form and "Send anyway" 1 tap away */
.c-keynote {
  margin: 4px 8px 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.c-keynote p {
  margin: 0;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.c-keynote p .ic {
  flex: none;
  margin-top: 2px;
  color: var(--danger);
}
.c-keynote .k-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.c-keynote .k-btns .btn {
  min-height: 44px;
}

/* ---- hosted hands (BRIEF F2, F5, F7): Connect your AI's one line, members' own AI, the DOC chip ---- */
.os-pick {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.os-seg button {
  min-height: 44px;
}
.steps.dim {
  opacity: 0.5;
}
.hint.line-left {
  margin: 10px 4px 0;
}
.own-ai .switch-row {
  padding: 0;
}
.own-ai-lbl {
  margin: 14px 0 6px;
}
.own-ai-bots .list {
  margin: 0;
}
.pays-check {
  margin-top: 10px;
  min-height: 44px;
}
.doc-chip {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.doc-chip .doc-open {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
}
.f-ext.doc {
  background: var(--accent);
  color: var(--on-accent);
}
.doc-chip .doc-md {
  flex: none;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: none;
}
.doc-chip .doc-md:hover,
.doc-chip .doc-open:hover {
  background: var(--fill-2);
}

/* feat-f3: the ready card, the share sheet's lines, Home's ready row and the ping offer (f3-made.js) */
.f3-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 12px;
  align-items: center;
  max-width: 360px;
  margin-top: 6px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--edge);
  border: 1px solid var(--line);
}
.f3-pic {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--fill);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.f3-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.f3-icon {
  font-size: 32px;
  line-height: 1;
}
.f3-icon.sm {
  font-size: 22px;
}
.f3-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.f3-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.f3-sub,
.f3-foot,
.f3-line {
  color: var(--text-2); /* --idle was about 2.3:1 */
  font-size: 13px;
}
.f3-acts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 44px;
  gap: 8px;
}
.f3-acts .btn {
  min-height: 44px;
  padding: 0 8px;
}
.f3-acts .f3-more {
  width: 44px;
  padding: 0;
}
.f3-foot {
  grid-column: 1 / -1;
}
.f3-warn {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--text);
}
.f3-row .btn {
  flex: 1;
  min-height: 44px;
}
.f3-stop {
  margin-top: 12px;
  min-height: 44px;
}
.f3-ver {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}
.f3-ver .txt {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.f3-ver .btn {
  min-height: 44px;
}
.f3-ready {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 560px;
}
.f3-ready-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--accent-softer);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.f3-ready-row .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.f3-ready-row .txt span {
  color: var(--text-2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.f3-go {
  color: var(--accent-text);
  font-weight: 600;
}
.f3-ping {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--text);
  cursor: pointer;
}
/* end feat-f3 */

/* ---- f9 lead: Brain's task board (app.js buildBoard) and the task a worker's answer is ---- */
.board-row {
  min-height: 52px;
}
.board-txt {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.board-txt .plan-nm {
  flex: none;
  white-space: normal; /* two lines, then … (a long task stays readable at 375 px) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.board-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.board-go {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--text-3);
  transform: rotate(-90deg);
}
.board-who {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  color: var(--text-2);
}
.board-stop {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text-2);
}
.board-stop:hover {
  background: var(--fill-2);
}
.board-all {
  justify-content: center;
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}
.board-all:disabled,
.board-stop:disabled {
  opacity: 0.5;
}
.task-tag {
  margin-bottom: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.a-mark.person {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.tcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tcard-h {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tcard-h b {
  font-size: 15.5px;
}
.tcard-h span,
.tcard-f span:first-child {
  font-size: 12.5px;
  color: var(--text-2);
}
.tcard-f {
  display: flex;
  gap: 8px;
  font-size: 14px;
}
.tcard-f span:first-child {
  flex: none;
  width: 72px;
  padding-top: 1px;
}
.tcard-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tcard-acts .btn {
  flex: 1 1 auto;
  min-height: 44px;
}
.tcard-note {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  font: inherit;
}
.tcard-said {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.tcard-said.ok {
  color: var(--plan-ok, var(--ok));
}
.tcard-always {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
}
.tcard-always.on {
  color: var(--text-2);
}
.board-res {
  padding: 8px 12px 12px 46px;
  font-size: 14px;
  box-shadow: inset 0 1px 0 var(--line);
}
.clar-q {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clar-t {
  font-size: 14.5px;
  font-weight: 600;
}
.clar-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.clar-opts .chip {
  min-height: 44px;
}
.clar-opts .chip.on {
  box-shadow: inset 0 0 0 2px var(--accent-text);
  color: var(--accent-text);
  opacity: 1;
}
.clar-opts .chip:disabled:not(.on) {
  opacity: 0.5;
}
.clar-opts.suggest {
  margin-top: 10px;
}
/* ---- end f9 lead ---- */

/* feat-f4-make: what the hub made from an answer's block (f4-make.js) */
.f4-chart {
  margin: 8px 0 0;
  max-width: 640px;
  border-radius: 14px;
  background: var(--fill);
  padding: 8px;
}
.f4-chart img {
  display: block;
  width: 100%;
  height: auto;
}
.f4-opens,
.f4-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.f4-opens .btn,
.f4-row .btn {
  min-height: 44px;
}
.f4-budget {
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--fill);
  max-width: 420px;
}
.f4-line {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}
/* end feat-f4-make */

/* feat-f7: spaces (f7-spaces.js): the badge on a space's chats, the Company screen, a space's page, Ask Finance and
   the misfiling card */
.sp-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.sp-badge.locked {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.sp-ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--fill-2);
  color: var(--text-2);
}
.sp-ic.locked {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.sp-ic.big {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.sp-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sp-head .t1,
.sp-pack .t1 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}
.sp-pack .btn,
.sp-join,
.sp-new,
.sp-leave {
  min-height: 44px;
  width: 100%;
  margin-top: 12px;
}
.sp-leave {
  margin-top: 20px;
  color: var(--danger, #ff453a);
}
.sp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.sp-row .btn {
  min-height: 44px;
}
.sp-about {
  margin: 0;
  white-space: pre-wrap;
}
.sp-askcard {
  margin-top: 10px;
}
.sp-words {
  margin: 6px 0 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--fill-2);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sp-shared {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
}
.sp-chips {
  margin-top: 6px;
}
.sp-chips .btn,
.sp-ask-line .btn {
  min-height: 44px;
}
.sp-add {
  width: 100%;
  min-height: 44px;
  text-align: left;
}
.sp-misfile p {
  font-weight: 600;
}
/* decision #37: Confirm it's you to open Finance */
.sp-check {
  margin-top: 10px;
}
.sp-check .t1 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}
.sp-faceid {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
}
/* feat-f10 (integrator): the password row under Face ID, 44 px, full width at 375 px */
.sp-password {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.sp-password input {
  min-height: 44px;
  width: 100%;
  font-size: 17px;
}
.sp-password .sp-faceid {
  margin-top: 0;
}
/* end feat-f7 */

/* Settings > Connect your AI: your other AIs and Brain's computer (decision #30) */
.more-ai-row .sdot,
.brain-pc .sdot {
  flex: none;
}
.more-ai-add,
.brain-add {
  margin-top: 12px;
  min-height: 44px;
}
.brain-cap-row .inp.brain-cap {
  flex: none;
  width: 84px;
  min-height: 44px;
  text-align: center;
}
/* Brain's cloud (decision #41): its row in Settings > Brain and the owner's setup card */
.cloud-row .sdot {
  flex: none;
}
.cloud-row .t2 {
  white-space: normal;
}
.cloud-act {
  flex: none;
  min-height: 44px;
  min-width: 44px;
}
.row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.row-btns .btn,
.tap44 {
  min-height: 44px;
}
.cloud-paste {
  width: 100%;
  box-sizing: border-box;
  min-height: 88px;
  margin: 8px 0;
  font: 14px/1.4 ui-monospace, Menlo, monospace;
}
.cloud-result {
  min-height: 1.4em;
}
.hint.warn {
  color: var(--danger, #c33);
}

/* A6 living apps (a6-apps.js): an app's page sits in a fixed frame, on a surface that looks unlike SnailChat's own
   screens (a tinted edge in the app's accent), so an app can never pass for the chat's own cards. */
.a6-btn {
  min-height: 44px;
  min-width: 44px;
}
.a6-view .a6-frame-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.a6-view .a6-frame-title .t1 {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.a6-view .a6-frame-title .t2 {
  font-size: 12px;
  color: var(--text-3);
}
.a6-surface {
  --a6-accent: var(--accent);
  --a6-ink: var(--accent-text); /* words and edges in the accent: 4.5:1 in every theme (the raw accent is 1.9:1 on clean) */
  border-top: 3px solid var(--a6-accent);
  border-radius: 14px;
  background: var(--fill);
  padding: 12px 16px 20px;
  margin: 8px 0 24px;
  overflow-wrap: anywhere;
}
.a6-surface[data-font="serif"] {
  font-family: ui-serif, Georgia, serif;
}
.a6-surface[data-font="rounded"] {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}
.a6-surface[data-font="mono"] {
  font-family: ui-monospace, Menlo, monospace;
}
.a6-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -4px 12px;
  padding: 0 4px;
}
.a6-tab {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 22px;
  background: var(--fill-2);
  color: var(--text-2);
  text-decoration: none;
}
.a6-tab.on {
  background: var(--a6-accent);
  color: var(--a6-on, var(--on-accent));
}
.a6-crumbs {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.a6-crumbs a {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}
.a6-h {
  font-size: 20px;
  margin: 12px 0 6px;
}
.a6-h3 {
  font-size: 15px;
  margin: 14px 0 6px;
  color: var(--text-2);
}
.a6-p,
.a6-ul {
  margin: 6px 0;
  line-height: 1.45;
}
.a6-img {
  max-width: 100%;
  border-radius: 10px;
}
.a6-chart {
  margin: 10px 0;
}
.a6-chart img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #fff;
}
.a6-stat {
  display: inline-flex;
  flex-direction: column;
  padding: 10px 14px;
  margin: 4px 8px 4px 0;
  border-radius: 12px;
  background: var(--fill-2);
  min-width: 120px;
}
.a6-stat-v {
  font-size: 22px;
  font-weight: 700;
  color: var(--a6-ink);
}
.a6-stat-l,
.a6-stat-n {
  font-size: 13px;
  color: var(--text-2);
}
.a6-tablewrap {
  overflow-x: auto;
  margin: 8px 0;
}
.a6-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 14px;
}
.a6-table th,
.a6-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.a6-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  /* columns past the edge fade out there, so a cut column reads as "more"; the fade lands on the padding at the end */
  padding-right: 32px;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.a6-board > * {
  scroll-snap-align: start;
}
.a6-col {
  flex: 0 0 min(240px, 78vw);
  background: var(--fill-2);
  border-radius: 12px;
  padding: 8px;
}
.a6-col-h {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 4px 4px 8px;
  text-transform: capitalize;
}
.a6-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface, var(--fill));
  border-radius: 10px;
  padding: 6px 6px 6px 10px;
  margin-bottom: 6px;
}
.a6-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.a6-state {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: transparent;
  color: var(--text-2);
  padding: 0 12px;
  font-size: 13px;
  text-transform: capitalize;
}
.a6-action,
.a6-ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 0 16px;
  margin: 8px 8px 0 0;
  border: 1px solid var(--a6-ink);
  background: transparent;
  color: var(--a6-ink);
  font-weight: 600;
}
.a6-ask {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 20px;
  background: var(--a6-accent);
  color: var(--a6-on, var(--on-accent));
}
.a6-site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin: 8px 0;
}
.a6-site .t1 {
  flex: 1;
  font-weight: 600;
}
.a6-paused {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--fill-2);
  color: var(--text-2);
  margin-bottom: 8px;
}
.a6-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.a6-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--fill-2);
  color: var(--text);
  text-decoration: none;
}
.a6-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.a6-field .input,
.a6-field .select {
  min-height: 44px;
}
.a6-ic {
  --a6-accent: var(--accent);
  --a6-ink: var(--accent-text);
  color: var(--a6-ink);
}
.a6-msgcard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--fill);
}
.a6-msgcard.failed {
  border-color: var(--danger);
}
.a6-msgcard .a6-card-t {
  flex: 1;
  min-width: 140px;
}
.a6-msgcard .a6-btn,
.a6-sys .a6-btn,
.a6-site .a6-btn {
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--fill-2);
  color: var(--text);
}
.a6-msgcard .a6-btn.primary,
.a6-site .a6-btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
.a6-sys {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.a6-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 120px;
  padding: 0 10px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--text);
}
.a6-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.a6-warn {
  margin: -4px 0 8px;
}
/* feat-f1-hands: the asker-only approval card ("Tony's agent wants to send …" [Allow once] [No]) and the My AI switch */
.ap-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-width: 360px;
}
.msg.own .ap-cards {
  margin-left: auto;
}
.ap-card {
  border-radius: 16px;
  background: var(--fill);
  box-shadow: 0 0 0 1px var(--line);
  padding: 12px 14px;
  color: var(--text);
}
:root[data-theme="clean"] .ap-card {
  background: #fff;
}
.ap-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.ap-line .ic {
  flex: none;
  margin-top: 1px;
  color: var(--accent-text);
}
.ap-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
/* feat-f5: the hub's tools and scheduled tasks (f5-tools.js) */
.f5-used {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.35;
}
.f5-card {
  margin-top: 6px;
  margin-left: auto;
  width: min(300px, 100%);
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
:root[data-theme="grok"] .f5-card {
  border-color: rgba(255, 255, 255, 0.08);
}
.f5-card.refused {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
}
.f5-when {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
}
.f5-what {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.f5-runs {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-3);
}
.f5-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.ap-btns .btn {
  min-height: 44px;
  flex: 1;
}
.ap-state {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.ap-allowed .ap-state {
  color: var(--ok);
}
.ap-denied,
.ap-expired {
  opacity: 0.8;
}
.hands-card .list {
  margin-top: 2px;
}
.hands-row {
  min-height: 58px;
}
.hands-can {
  margin: 8px 4px 14px;
}
/* end feat-f1-hands */
.a6-live.frozen {
  opacity: 0.55;
}

/* feat-a3-conflicts: Brain's "Two things I remember disagree" card (a3-conflicts.js) */
.cf-card {
  margin-top: 8px;
  border-radius: 16px;
  background: var(--fill);
  box-shadow: 0 0 0 1px var(--line);
  padding: 6px 12px 10px;
  color: var(--text);
}
:root[data-theme="clean"] .cf-card {
  background: #fff;
}
.cf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.cf-body {
  flex: 1;
  min-width: 0;
}
.cf-text {
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cf-row.open .cf-text {
  display: block;
  -webkit-line-clamp: unset;
}
.cf-meta {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-2);
}
.cf-meta .linkish {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  cursor: pointer;
}
.cf-keep {
  flex: none;
  min-width: 72px; /* its 44 px hit area is .btn.sm::before */
}
.cf-meta .cf-said {
  position: relative;
}
.cf-meta .cf-said::before {
  content: "";
  position: absolute;
  inset: -13px -8px; /* a 44 px tap target around the small link */
}
.cf-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cf-btns .btn {
  flex: 1;
  min-height: 44px;
}
.cf-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.cf-picked .cf-line .ic,
.cf-both .cf-line .ic,
.cf-neither .cf-line .ic {
  flex: none;
  margin-top: 2px;
  color: var(--ok);
}
.cf-gone,
.cf-undone {
  opacity: 0.85;
}
/* end feat-a3-conflicts */


/* feat-a2-beats: Brain looks after an area (a2-beats.js): the Start card, the proposal card, Chat info › Looking after */
.bt-card {
  box-sizing: border-box;
  margin-top: 8px;
  max-width: min(360px, 100%);
  border-radius: 16px;
  background: var(--fill);
  box-shadow: 0 0 0 1px var(--line);
  padding: 12px 14px;
  color: var(--text);
}
:root[data-theme="clean"] .bt-card {
  background: #fff;
}
.msg.own .bt-card,
.msg.own .bt-note {
  margin-left: auto;
}
.bt-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.35;
}
.bt-line .ic {
  flex: none;
  margin-top: 2px;
  color: var(--accent-text);
}
.bt-t1,
.bt-head {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.bt-t2 {
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.bt-how {
  margin-top: 6px;
}
.bt-items {
  display: flex;
  flex-direction: column;
  margin: 6px -6px 0;
}
.bt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
}
button.bt-row:active {
  background: var(--fill-2);
}
.bt-check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--text-3);
  display: grid;
  place-items: center;
}
.bt-check.on {
  background: var(--accent);
  box-shadow: none;
  color: #fff;
}
.bt-n {
  flex: none;
  min-width: 14px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.bt-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bt-title,
.bt-why {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bt-why {
  font-size: 14px;
  color: var(--text-2);
}
.bt-more {
  margin: -2px 6px 6px 58px;
  font-size: 14px;
  color: var(--text-2);
}
.bt-link {
  display: block;
  min-height: 44px;
  margin: 2px auto 0;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-size: 15px;
}
.bt-foot {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
}
.bt-pick.stale {
  opacity: 0.6;
}
.bt-stale {
  margin-top: 6px;
}
.bt-li,
.bt-info {
  min-height: 58px;
  width: 100%;
  text-align: left;
}
.bt-sum {
  margin: 4px 4px 14px;
}
.bt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bt-actions .btn {
  min-height: 44px;
  flex: 1 1 40%;
}
.bt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.bt-chips .chip {
  min-height: 44px;
  padding: 0 14px;
}
.bt-card .ap-btns {
  flex-wrap: wrap;
}
.bt-card .ap-btns .btn {
  flex: 1 1 auto;
  padding: 0 14px;
}
.bt-info > .ic:last-child {
  transform: rotate(-90deg);
}
.bt-chips .chip.on {
  background: var(--accent);
  color: #fff;
}
/* end feat-a2-beats */

/* feat-a5-company: Projects (a5-company.js): risks with one-tap fixes, steps left in order, priorities, projects; the
   project link on a task board */
.pj-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 4px 0 4px;
  padding: 0 16px;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 14px;
}
.pj-risk {
  margin-bottom: 10px;
  border-left: 4px solid var(--accent);
}
.pj-risk.high {
  border-left-color: var(--danger);
}
.pj-risk .t1 {
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 650;
  font-size: 15px;
}
.pj-risk .hint {
  margin: 0 0 6px;
}
.pj-where {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-2);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pj-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pj-acts .btn,
.pj-more .btn,
.pj-all,
.pj-retry .btn {
  min-height: 44px;
}
.pj-more {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pj-note {
  margin: 0 0 10px;
}
.pj-all {
  width: 100%;
}
.pj-retry {
  display: flex;
  justify-content: center;
}
.pj-steps {
  min-height: 58px;
}
.pj-health {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.pj-health i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.pj-health.at_risk i {
  background: var(--accent);
}
.pj-health.stuck i {
  background: var(--danger);
}
.pj-health.done i {
  background: var(--idle);
}
.pj-prow {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.pj-prow:last-child {
  border-bottom: 0;
}
.pj-prow .li {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
}
.pj-up {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: 6px;
  font-size: 18px;
}
.pj-rank,
.pj-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
}
.pj-rank {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.pj-task.done .t1 {
  color: var(--text-2);
  text-decoration: line-through;
}
.pj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}
.pj-chips .chip {
  height: 44px;
}
.pj-chips .chip.on {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: transparent;
}
.pj-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 14px;
}
.pj-sheet-acts {
  margin-top: 18px;
}
.pj-person {
  width: 100%;
  min-height: 52px;
  text-align: left;
}
.pj-row .t2 {
  white-space: normal;
}
.pj-board-link {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
}
/* end feat-a5-company */
/* feat-a1-inbox: Needs you (a1-inbox.js). 44 px targets; theme colours only through the tokens above. */
.ib-home {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}
.ib-home[hidden] {
  display: none;
}
.ib-home .txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ib-home .t1 {
  font-weight: 600;
}
.ib-home .t2 {
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-home-ic {
  color: var(--accent-text);
  display: inline-grid;
}
.nav-item .ib-badge {
  margin-left: auto;
}
.ib-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.ib-list.settling button,
.ib-list.settling a.btn,
.ib-item.ib-fresh [data-consent="1"],
.ib-item.ib-fresh .ap-cards button,
.ib-item.ib-fresh .sp-askcard button.primary,
.ib-item.ib-fresh .tcard-acts button.primary {
  pointer-events: none;
}
.ib-item {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 12px 12px;
  outline: none;
}
.ib-item:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}
.ib-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.ib-who {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-why {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--text-2);
  white-space: nowrap;
}
.ib-why.red {
  color: var(--danger);
}
.ib-more {
  min-width: 44px;
  min-height: 44px;
}
.ib-line {
  margin: 4px 0 10px;
}
.ib-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* every button in the list is a 44 px target, the chat cards' own small buttons included */
.ib-btn,
.ib-list .ib-item button,
.ib-list .ib-item a.btn,
.ib-list .ib-item .btn.sm {
  min-height: 44px;
}
.ib-pulse {
  animation: ib-pulse 0.9s ease-in-out 2;
  position: relative;
}
.ib-pulse::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  font-size: 12px;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1206;
  font-weight: 600;
}
@keyframes ib-pulse {
  50% {
    box-shadow: 0 0 0 6px var(--accent-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ib-pulse {
    animation: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
}
.ib-older summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--text-2);
  cursor: pointer;
}
.ib-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-2);
}
.ib-empty .ic {
  width: 40px;
  height: 40px;
  color: var(--accent-text);
}
.ib-dock {
  position: sticky;
  bottom: 0;
  margin: 12px -4px 0;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  background: var(--bar);
  border-top: 1px solid var(--bar-line);
}
.ib-dock[hidden] {
  display: none;
}
.ib-say {
  width: 100%;
  min-height: 44px;
  font-size: 16px; /* no zoom on iPhone */
}
.ib-where,
.ib-heard,
.ib-mic {
  margin: 4px 2px;
  font-size: 12px;
}
.ib-heard:empty,
.ib-where:empty {
  display: none;
}
.ib-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* end feat-a1-inbox */

/* a4 models: a board row's second line (its hand, then " · Opus" on the asker's own rows) may wrap to two lines at
   375 px, so the model's name is never cut off; never more than two. */
.board-txt .board-who {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.brain-guide {
  margin-top: 12px;
  min-height: 44px;
}
.brain-pc .t2 {
  white-space: normal;
}
/* Settings, Sign-in and devices: the password row's Change and Remove (decision #34) */
.li-btns {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.pk-setup [data-pw="setup"] {
  margin-top: 10px;
}

/* A11 accounts (a11-accounts.js): "Confirm your email" on Home, the join form's Face ID button, the mail's pages */
.a11-card {
  flex: none;
  align-self: center;
  width: min(540px, 100%);
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass, var(--raised));
  box-shadow: 0 0 0 1px var(--line);
}
:root[data-theme="clean"] .a11-card {
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 20, 30, 0.06), 0 0 0 1px var(--line);
}
:root[data-theme="grok"] .a11-card {
  background: var(--raised);
}
.a11-card .a11-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.a11-card b {
  font-size: 15px;
}
.a11-card .a11-text span {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-2);
}
.a11-card .btn,
.join-form [data-a11="faceid"] {
  min-height: 44px;
}
.join-form [data-a11="faceid"] {
  margin-top: 8px;
}
/* a cancelled Face ID on the team link: where a new person goes instead */
.join-form .a11-note {
  margin: 8px 4px 0;
  text-align: center;
}
/* A11: a switch in a confirm sheet ("Also make a new team link"), a 44 px row */
.cb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -6px 0 12px;
  font-size: 15px;
  cursor: pointer; /* the whole row is the tap target, not the 22 px box (phone walk O13) */
}
.cb-row .cb-check {
  width: 22px;
  height: 22px;
  flex: none;
}
.a11-gap {
  height: 24px;
}
/* gap review SF5: the confirm sheet's "Send a new code" and "Wrong email? Change it", side by side, 44 px each */
.a11-more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin-top: 8px;
}
.a11-sent:empty {
  display: none;
}
.a11-sent {
  margin: 8px 0 0;
  text-align: center;
}
.sheet form > .linkish {
  display: block;
  margin: 8px auto 0;
}
/* SF6: the only admin's ways back in, one under the other */
.letin-ways {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.signin-card [data-a11="way-out"] {
  margin-top: 10px;
}
.signin-card h1 + [data-a11="back-email"] {
  margin-top: 16px;
}
.a11-btn {
  min-height: 44px;
  min-width: 44px;
}

/* feat-f6-connect: Settings → Connections (hub/static/chat/f6-connect.js) */
.f6-tabs {
  display: flex;
  margin: 4px 0 14px;
}
.f6-tabs button {
  flex: 1;
  height: 38px;
  justify-content: center;
}
.f6-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.f6-search {
  flex: 1;
  min-width: 0;
  min-height: 44px;
}
.f6-add {
  min-height: 44px;
  flex: none;
}
.f6-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.f6-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 124px;
  padding: 14px 8px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: center;
}
.f6-tile:disabled {
  opacity: 1;
  cursor: default;
}
.f6-name {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.2;
}
.f6-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.f6-logo.big {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 19px;
}
.f6-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--fill);
  color: var(--text-2);
}
.f6-connected {
  color: var(--ok-text, var(--ok));
}
.f6-needs_signin {
  background: var(--accent-soft);
  color: var(--accent-text, var(--accent));
}
.f6-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.f6-head .txt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.f6-head .t2,
.f6-loses {
  color: var(--text-2);
  font-size: 14px;
}
.f6-app,
.f6-credits .li,
.f6-recent .li,
.f6-mine .li {
  min-height: 52px;
  gap: 12px;
  width: 100%;
  text-align: left;
}
.f6-app:disabled {
  opacity: 0.55;
}
.f6-can p {
  margin: 0 0 6px;
}
.f6-can p:last-child {
  margin: 0;
}
.f6-bar-meter {
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: var(--fill);
  overflow: hidden;
  flex: none;
}
.f6-bar-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.f6-cap-row {
  gap: 10px;
}
.f6-cap-row .t1 {
  flex: 1;
}
.f6-cap {
  width: 90px;
  min-height: 44px;
}
.f6-mine-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.f6-mine-empty p {
  margin: 0;
}
.f6-off {
  margin-top: 12px;
}
.f6-card .btn {
  min-height: 44px;
}
/* end feat-f6-connect */
/* feat-a10-storage: folders per place, the bucket form, an answer's storage line */
.f6-folder {
  min-height: 52px;
  gap: 12px;
}
.f6-folder .txt {
  flex: 1;
  min-width: 0;
}
.f6-folder .t1 {
  overflow-wrap: anywhere;
}
.f6-folder .btn,
.f6-folders .btn,
.f6-bucket .btn,
.f6-bucket .chip {
  min-height: 44px;
}
.f6-folders .h3 {
  margin: 16px 0 6px;
  font-weight: 600;
}
.f6-bucket .chips {
  display: flex;
  flex-wrap: wrap; /* the three providers wrap at 375 px: no edge fade, no cut chip */
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
.a10-storage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}
.a10-saved {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.a10-saved .t2 {
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.a10-storage .btn {
  min-height: 44px;
}
/* end feat-a10-storage */
.f5-card .f5-btns .btn,
.f5-row .f5-btns .btn {
  min-height: 44px;
  min-width: 44px;
}
.f5-card .f5-btns .btn {
  flex: 1;
}
.f5-row {
  align-items: center;
  gap: 10px;
}
.f5-row .f5-btns {
  margin-top: 0;
  flex-shrink: 0;
}
.f5-row.paused .t1 {
  color: var(--text-3);
}
.f5-empty {
  padding: 16px 4px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.4;
}
/* end feat-f5 */

/* feat-f8: a big video's card in the composer (uploads that resume): its type, and one line saying how far it is.
   f8-fix-ui: a grid so a done card shows its name over "Ready" and a failed one its line over a 44 px Retry; the X
   is a 44 px box inside the card, since the card clips anything outside it */
.c-file.big {
  width: 212px;
  height: auto;
  min-height: 76px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 6px;
  align-content: center;
  align-items: center;
  justify-items: start;
  padding: 10px 44px 10px 10px;
}
.c-file.big > :not(.x):not(.f-ext) {
  grid-column: 2;
}
.c-file.big .f-ext {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.c-file.big.up .f-ext {
  grid-row: 1;
}
.c-file.big:not(.done) .cf-name,
.c-file.big .ring[role="progressbar"] {
  display: none;
}
.c-file.big.done .cf-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.c-file .cf-big {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
  white-space: normal;
  text-align: left;
}
.c-file.big.done .cf-big {
  color: var(--text-2);
}
.c-file.big .cf-big.go {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.c-file.big.err {
  cursor: pointer;
}
.c-file.big.err .retry {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 600;
}
.c-file.big .x {
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
}
.c-file.big .x::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}
.c-file.big .x::after {
  inset: 0;
}
/* end feat-f8 */

/* the connect code's developer line, one tap away */
.dev-more summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--accent-text);
  cursor: pointer;
}
.invite-teamai {
  margin-top: 10px;
  min-height: 44px;
  white-space: normal;
  text-align: center;
}

.a6-msgrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.a6-msgrow .a6-btn {
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--fill-2);
  color: var(--text);
}

/* feat-a7: workflows (a7-flows.js): the Save card, the review card with its 44 px action bar (the image is at most
   50vh, so the bar stays on screen with it), Pause all ads */
.wf-card {
  margin-top: 8px;
  max-width: 360px;
  border-radius: 16px;
  background: var(--fill);
  box-shadow: 0 0 0 1px var(--line);
  padding: 12px 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-wrap: anywhere;
}
:root[data-theme="clean"] .wf-card {
  background: #fff;
}
.wf-line {
  line-height: 1.4;
}
.wf-note,
.wf-meta,
.wf-refused {
  color: var(--text-2);
  font-size: 14px;
}
.wf-done {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--text-2);
  font-size: 14px;
}
.wf-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wf-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wf-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 50vh;
  object-fit: cover;
  border-radius: 12px;
}
.wf-head {
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wf-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.wf-text.open {
  display: block;
}
.wf-more {
  align-self: flex-start;
  min-height: 44px;
  color: var(--accent-text);
  font-size: 14px;
}
.wf-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.wf-bar .btn {
  flex: 1 1 auto;
  min-width: 72px;
}
.wf-change {
  flex-direction: column;
}
.wf-note-in {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}
.wf-pause {
  background: var(--danger);
  color: #fff;
}
/* end feat-a7 */
/* feat-a7: workflows in Made (decision #42) */
.wf-made {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.wf-made .wf-card {
  max-width: none;
  margin-top: 0;
}
.wf-made-h {
  font-weight: 650;
  color: var(--text-2);
  font-size: 14px;
}
/* end feat-a7 */

/* a9-memory: working-memory pages */
.a9-line, .a9-add { min-height: 44px; gap: 8px; }
.a9-line .txt { min-width: 0; min-height: 44px; justify-content: center; flex: 1; overflow-wrap: anywhere; cursor: pointer; }
.a9-line .txt .t1, .a9-pick .t1 { white-space: normal; overflow: visible; text-overflow: clip; }
.a9-line .btn, .a9-add .btn, .a9-ask .btn, .a9-lock, .a9-undo, .a9-line .icon-btn { min-height: 44px; min-width: 44px; }
.a9-share { align-self: flex-start; margin-top: 6px; }
.a9-ask { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-width: 100%; }
.a9-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.a9-pick { min-height: 44px; gap: 10px; }
.a9-input { flex: 1; min-width: 0; min-height: 44px; font: inherit; color: inherit; background: transparent; border: 0; outline: none; }
.a9-switch { min-height: 44px; }
.a9-lock { margin-top: 12px; min-height: 44px; }
.a9-words { margin: 0 4px 8px; }
.a9-chip { min-height: 44px; }
.a9-chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.a9-chips .a9-choices { margin-top: 6px; }

/* Settings, Sign-in and devices: the password row's Change and Remove (decision #34) */
.li-btns {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.pk-setup [data-pw="setup"] {
  margin-top: 10px;
}
.join-chips .chip.quiet {
  color: var(--text-2);
}

/* ux-cd: What Brain knows (knows.js) */
.knows-lead {
  margin: 4px 4px 12px;
}
.knows-part {
  margin-bottom: 18px;
}
.knows-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.knows-n {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.knows-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.knows .t1.clamp2,
.knows .t1.clamp4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}
.knows .t1.clamp2 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.knows .t1.clamp4 {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.knows-note .t1 {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* a note and a page line are a sentence or two: body weight, like Notes, not a bold title */
.knows-note .t1,
.knows-line .t1 {
  font-weight: 400;
}
.knows-none {
  margin: 0;
  padding: 12px 14px;
}
.knows-all .t1 {
  color: var(--accent-text);
  font-weight: 600;
}
.knows .li {
  min-height: 48px;
}
.mk-more {
  margin-bottom: 12px;
}
/* decision #50: one-tap Yes and No under Brain's "Want me to…?" (offerChips in app.js). Two even 44 px buttons. */
.offer-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  max-width: 320px;
}
.offer-btns .btn {
  flex: 1;
  min-height: 44px;
  font-size: 15px;
}
.offer-btns .btn.picked {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent);
  cursor: progress;
}
/* decision #50: Needs you's offer line opens the answer in its chat */
a.ib-line.ib-open {
  display: block;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

/* phone walk 10: Home's "Invite your team" card, with a 44 px X to put it away */
.invite-home .invite-home-x {
  flex: none;
  margin: -8px -8px 0 0;
}

/* a locked space's page: a suggestion waiting for a yes shows its words in full, Keep and No under them */
.li.a9-wait {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.a9-wait .t1 {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.a9-wait-acts {
  display: flex;
  gap: 8px;
}
.a9-wait-acts .btn {
  min-height: 44px;
}

/* phone walk 2, C: a short phone (iPhone SE, 667 px) with a card on Home keeps the message box in view. The card is
   one row (its title and button; the sentence goes), and the hero drops its logo and padding */
@media (max-width: 899px) and (max-height: 720px) {
  .home-body > .pk-home {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .home-body > .pk-home .pk-home-t {
    flex: 1;
    min-width: 0;
    align-items: center;
  }
  .home-body > .pk-home .txt span,
  .home-body > .pk-home .pk-ic {
    display: none;
  }
  .home-body > .pk-home > .btn {
    width: auto;
    flex: none;
    padding: 0 16px;
  }
  .home-body > .a11-card .a11-text span {
    display: none;
  }
  .home-body:has(> .pk-home) .hero,
  .home-body:has(> .a11-card) .hero {
    padding: 8px 12px;
  }
  .home-body:has(> .pk-home) .hero .mark,
  .home-body:has(> .a11-card) .hero .mark {
    display: none;
  }
}
