/* ChatFlow Settings view (design A). Needs tokens.css, components.css and chrome.css
   (.cf-page) first. Layout from the Settings boards: page header, Appearance, then a
   grid of sections (LLM Connections and Sticker Library, Team Members and Cloudflare
   Integration) that falls to one column in a narrow window, in that reading order.
   Colours come from tokens only, so night needs no rules here. Statuses follow the colour
   language (COLOUR-TOKENS): Cloudflare Connected and an Active domain green, Connected with
   a failed account amber, Error red, any other domain state grey. The section cards are
   raised surfaces (.card, --shadow-card). */

.set-stack { display: flex; flex-direction: column; gap: 40px; max-width: 1200px; }
.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  align-items: start;
  gap: 40px 32px;
}
.set-section { min-width: 0; }

/* Appearance (the first section) */
.cf-appearance { display: flex; flex-direction: column; align-items: flex-start; }
.cf-appearance .section-head { align-self: stretch; }
.cf-appearance .seg { margin-top: 12px; }
.cf-appearance .hint { margin-top: 8px; }

/* Section cards: rows on --pop with hairlines between them */
.set-card { margin-top: 12px; }
.set-card:empty { display: none; }
.set-card > * + * { border-top: 1px solid var(--line); }
.set-note { margin: 0; padding: 14px 16px; font: var(--fw-regular) var(--fs-label)/var(--lh-label) var(--font); color: var(--ink-2); }

/* Sticker Library: 64px tiles; each tile is a button that opens its menu */
.sticker-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.sticker-grid > .set-note { padding: 6px 4px; }
.sticker-tile {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--fill);
  color: var(--ink);
  cursor: pointer;
}
.sticker-tile img { display: block; width: 56px; height: 56px; object-fit: contain; }
.sticker-tile:hover { background-image: linear-gradient(var(--press-overlay), var(--press-overlay)); }
.sticker-tile[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--reply); }
.sticker-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sticker-fallback { font-size: 32px; line-height: 1; }

/* Cloudflare Integration: status row, domain rows, token row */
.cf-status { justify-content: space-between; }
.cf-token {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 10px 16px;
}
.cf-token .field { align-self: stretch; max-width: 400px; }

/* Phones: row details wrap instead of cutting off the key or the account list */
@media (max-width: 767px) {
  .set-card .row-meta { white-space: normal; overflow-wrap: anywhere; }
}
/* Cloudflare with a failed account: the amber dot and count carry the warning; the word
   Connected (true for the accounts that answered) stays ink */
.cf-status .status .set-cf-word { color: var(--ink); }
