@layer base {
/* The membership / relationship row and everything it is built from live in
   components/entity-row.css — the row is a shared component, and the two
   flow-edit forms render the same row open (METIS-pub#399). */
/* Detail page */
.detail-header {
  margin-bottom: var(--space-lg);
}
.detail-header-main {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
/* The page title. It consumes --font-display, so it is the serif on platform
   pages and the owning app's display face on an app's own — which is what that
   token is for. Weight 400: the brand sets block titles in regular, and a
   semibold serif at this size reads as heavy rather than editorial. */
.detail-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* The owning app's mark, leading the detail header. Holon pages take the theme
   of the MetisApp that owns their MetisClass, so the mark is how the page says
   which app that is — and it says it first, before the holon's own logo, the
   same order the page-header icon slot uses (crm/partials/_page_icon.html).
   Sized down from the 51px header-slot mark so it reads as provenance next to
   the holon logo rather than competing with it. */
.detail-header .app-mark img {
  height: 38px;
}

/* Header inline-editable name */
.header-name-field-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.header-name-field-wrap .header-name-field {
  flex: 0 1 auto;
  min-width: 0;
}
.header-name-field {
  flex: 1;
  min-width: 0;
}

.view-page-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.view-page-link:hover {
  opacity: 1;
  color: var(--text-primary);
}
.header-name-field .field-display {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius);
  gap: 0;
  position: relative;
}
.header-name-field .field-label {
  display: none;
}
.header-name-field .field-value {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.02em;
}
/* Same three properties as the value above, or clicking to edit makes the
   title jump. Saving as it changes, the name is a growing textarea
   (METIS-pub#787). */
.header-name-field .field-edit-form :is(input, textarea) {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* Editable indicator (pencil icon on hover) */
.editable-indicator {
  position: relative;
}
.editable-indicator::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--surface);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 2px var(--border);
  pointer-events: none;
}
.editable-indicator:hover::after {
  opacity: 1;
}
.header-name-field .field-display[hx-get]::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: var(--space-xs);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  background-image: 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'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.header-name-field .field-display[hx-get]:hover::after {
  opacity: 1;
}

/* Person photo */
.person-photo-container {
  flex-shrink: 0;
}
.person-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color var(--dur-base) var(--ease-out);
}
.person-photo:hover {
  border-color: var(--accent);
}
.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  color: var(--text-muted);
}
.person-photo-edit {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.person-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.photo-edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.photo-edit-form input[type="file"] {
  display: none;
}
.photo-edit-actions {
  display: flex;
  gap: var(--space-xs);
}

.delete-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}
/* The aside's width is a token because it is not only a column: the app page
   motif has to stop at the content column's edge rather than the window's, and
   a second hard-coded 320px would drift the moment this one changed.

   Declared on .main rather than on .detail-grid, deliberately. The motif is
   .main::after, and .main is the grid's ANCESTOR — a value set on the grid
   inherits down to the grid's children and could never reach it. Declaring it
   here puts it where both consumers can see it. detail.css only loads on
   detail pages, so the token exists exactly where it means something. */
.main {
  --detail-aside-w: 320px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--detail-aside-w);
  gap: var(--space-lg);
  align-items: flex-start;
  width: 100%;
}

/* A page whose side column is the shell's side panel (the Profile's account
   sections, METIS-pub#826) has the main column alone: the whole width. */
.detail-grid:not(:has(> :nth-child(2))) {
  grid-template-columns: minmax(0, 1fr);
}

/* Chat-left layout: chat feed thin on left, profile info/fields wide on right.
   When the Metis extension sidepanel is open, the embedded chat is hidden to
   avoid duplicating the sidepanel's content. The extension toggles
   data-metis-sidepanel-open on <html> via metis-handshake.js. */
[data-metis-sidepanel-open="1"] .detail-grid--chat-left .detail-sidebar--chat {
  display: none;
}
[data-metis-sidepanel-open="1"] .main {
  --detail-aside-w: 0px;
}

[data-metis-sidepanel-open="1"] .detail-grid--chat-left {
  grid-template-columns: minmax(0, 1fr);
}

/* Make the main container a flex column so the grid can fill remaining height */
.main:has(.detail-grid--chat-left) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.detail-grid--chat-left {
  grid-template-columns: var(--detail-aside-w) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
  gap: 0;
}

.detail-grid--chat-left .detail-main {
  overflow-y: auto;
  padding: var(--space-md);
}

.detail-grid--chat-left .detail-main .detail-header {
  margin-bottom: var(--space-md);
}

/* Remove white card look from info sections on chat-center pages */
.detail-grid--chat-left .detail-main .field-group {
  background: none;
  border: none;
  border-radius: 0;
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
}

.detail-grid--chat-left .detail-sidebar--chat .chat-composer__textarea {
  font-size: var(--text-md);
}

.detail-grid--chat-left .detail-sidebar--chat .chat-message__body {
  font-size: var(--text-md);
}

/* Chat-right layout: wide main content on left, chat feed thin on right. */
[data-metis-sidepanel-open="1"] .detail-grid--chat-right .detail-sidebar--chat {
  display: none;
}
[data-metis-sidepanel-open="1"] .detail-grid--chat-right {
  grid-template-columns: minmax(0, 1fr);
}

.main:has(.detail-grid--chat-right) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.detail-grid--chat-right {
  grid-template-columns: minmax(0, 1fr) 320px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
  gap: 0;
}

.detail-grid--chat-right .detail-main {
  overflow-y: auto;
  padding: var(--space-md);
}

/* No feed column drawn (the reader may not see notes, or the page places its
   feed as a section: METIS-pub#744): the details take the whole width rather
   than leaving an empty column on the right. */
.detail-grid--chat-right:not(:has(> .detail-sidebar--chat)) {
  grid-template-columns: minmax(0, 1fr);
}

.detail-grid--chat-right .detail-main .detail-header {
  margin-bottom: var(--space-md);
}

.detail-grid--chat-right .detail-main .field-group {
  background: none;
  border: none;
  border-radius: 0;
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
}

/* Header-less field-groups (the individual profile fields: description, links,
   locations, spheres) stack as a compact list rather than as separate spaced
   cards. Before they became independently-ordered blocks they lived inside one
   field-group; this keeps that tight look without a card's padding + margin gap
   between each one. The inner .field-display padding supplies the row spacing. */
.detail-grid--chat-left .detail-main .field-group:not(:has(> h2)),
.detail-grid--chat-right .detail-main .field-group:not(:has(> h2)) {
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.detail-grid--chat-right .detail-sidebar--chat .chat-composer__textarea {
  font-size: var(--text-md);
}

.detail-grid--chat-right .detail-sidebar--chat .chat-message__body {
  font-size: var(--text-md);
}

/* Actions row inside detail-main (Import CSV etc.) */
.detail-actions {
  margin-bottom: var(--space-md);
}

.field-group {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-bottom: none;
  border-radius: var(--radius);
}
.field-group h2 {
  /* Two steps up the fixed scale — the nearest step to "20% larger"; the scale
     has no intermediate value and is not gaining one. */
  font-size: var(--text-lg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-strong);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

/* Field display */
.field-row { min-height: 36px; }

/* A row with no value, for a reader: holon_field_display.html draws only this
   marker, and the row is not drawn (METIS-pub#818). */
.field-row:has(> .field-row__blank) { display: none; }

/* An editor's empty field, said quietly; clicking the row opens its editor. */
.field-value__add {
  color: var(--color-text-muted);
  font-style: italic;
}

.field-display {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease-out);
}
.field-display:hover { background: var(--border-light); }

/* A reader who cannot write gets no click-to-edit affordance (METIS-pub#296):
   the partial drops the hx-get, so pointer and hover would promise an editor
   that is not there. The value itself still renders. */
.field-display--readonly { cursor: default; }
.field-display--readonly:hover { background: none; }

/* A pencil inside a clickable row whose editor offers more than the value
   suggests — the Stage row's Journey + Step editor (METIS-pub#750). A cue
   only: the row itself opens the editor. */
.field-edit-cue {
  margin-left: var(--space-1);
  vertical-align: middle;
  color: var(--color-text-muted);
}

.field-label {
  flex: 0 0 120px;
  font-size: var(--text-base);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.field-value {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.field-value--description {
  line-height: 1.5;
}

/* Quill editor font override */
.ql-editor { font-family: var(--font); font-size: var(--text-lg); }
/* Neither Quill's stylesheet nor ours set a colour on the editor, so it took
   whatever an ancestor happened to pass down — and an app theme or surface
   change one layer up could leave a user typing invisible text into a field
   they cannot see into. Both ends are pinned to tokens so that cannot happen,
   whatever the page above decides. The placeholder gets the muted token for the
   same reason: the vendor sheet hardcodes it against a light background. */
.crm-quill.ql-container,
.crm-quill .ql-editor {
  color: var(--color-text);
  background-color: var(--color-surface);
}
.crm-quill .ql-editor.ql-blank::before { color: var(--color-text-muted); }

/* Rich text content inside description field (from Quill editor) */
.field-value h1 { font-size: var(--text-xl); font-weight: 600; margin: 0.75em 0 0.25em; color: var(--text); }
.field-value h2 { font-size: var(--text-lg); font-weight: 600; margin: 0.75em 0 0.25em; color: var(--text); }
.field-value h3 { font-size: var(--text-xl); font-weight: 600; margin: 0.5em 0 0.2em; color: var(--text); }
.field-value p { margin: 0.4em 0; }
.field-value ol,
.field-value ul { padding-left: 1.4em; margin: 0.4em 0; }
.field-value li { margin: 0.15em 0; }
/* Quill carries list indent depth as a class on the <li> rather than by nesting
   the lists, and its own rules for it only reach inside .ql-editor. Display
   renders that same markup outside the editor, so without these the indent a
   user just saved reappears flat the moment the editor closes. One step is 3em,
   matching Quill's scale (measured: 1.5em for the list, +3em per level). */
.field-value li.ql-indent-1 { margin-left: 3em; }
.field-value li.ql-indent-2 { margin-left: 6em; }
.field-value li.ql-indent-3 { margin-left: 9em; }
.field-value li.ql-indent-4 { margin-left: 12em; }
.field-value li.ql-indent-5 { margin-left: 15em; }
.field-value li.ql-indent-6 { margin-left: 18em; }
.field-value li.ql-indent-7 { margin-left: 21em; }
.field-value li.ql-indent-8 { margin-left: 24em; }

/* Contact icons: .contact-list, .contact-item and .contact-icon are the
   shared component crm/css/components/contact-list.css. */

/* Inline contact icons (.contact-icons): crm/css/components/contact-list.css. */

/* Contact edit fields */
.contact-fields { display: flex; flex-direction: column; gap: var(--space-xs); }
.contact-field-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.contact-field-label {
  flex: 0 0 110px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-base);
  color: var(--text-muted);
}
.contact-field-row input {
  flex: 1;
}

/* Field edit */
.field-edit-form {
  padding: var(--space-sm) 0;
}
.field-edit-form input,
.field-edit-form select,
.field-edit-form textarea {
  /*width: 100%; not needed I think */
  padding: var(--space-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-md);
  font-family: var(--font);
  margin: var(--space-xs) 0;
  outline: none;
}
.field-edit-form textarea {
  width: 100%;
}
.field-edit-form input:focus,
.field-edit-form select:focus,
.field-edit-form textarea:focus {
  border-color: var(--accent);
}
.field-edit-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* One field inside a multi-field form: its label, then its control.
   `.field-edit-row` sits on touch_tracking.js's FIELD_SELECTOR and was
   declared there for a row that had never been built — the info-field group
   form is it (METIS-pub#450), so the per-row `.is-touched` tint works with no
   JS change. The left padding is what gives components/touch.css's 2px rule
   somewhere to sit. */
.field-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: var(--space-xs) var(--space-md);
  align-items: start;
  padding: var(--space-xs) 0 var(--space-xs) var(--space-sm);
}

.field-edit-row__control {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.field-edit-row__help {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

@media (max-width: 40rem) {
  .field-edit-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Sidebar */
.detail-sidebar {
  position: sticky;
  top: var(--space-lg);
}
.detail-sidebar h2 {
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: var(--space-md) 0 var(--space-sm);
}
.detail-sidebar h2:first-child { margin-top: 0; }

.membership-group { margin-bottom: var(--space-sm); }
.membership-group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin: 0 0 var(--space-xs);
}
.membership-role {
  font-size: var(--text-sm);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
/* Holon detail */
.holon-logo-container {
  flex-shrink: 0;
}
.holon-logo {
  height: 72px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
.detail-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.holon-parent-link {
  font-size: var(--text-base);
  color: var(--text-muted);
}
/* A tabbed holon page's description, as text under its name (METIS-pub#744). */
.detail-header-description {
  color: var(--color-text);
  font-size: var(--text-base);
  max-width: 70ch;
}
.detail-header-description > :first-child { margin-top: 0; }
.detail-header-description > :last-child { margin-bottom: 0; }

/* The Activity section (METIS-pub#744): the holon's feed in the page. Comments
   hides every row that is not a note (crm/js/holon_activity.js). */
.holon-activity__feed {
  /* A box of its own, as in the feed column: the feed scrolls inside it and
     the comment box stays in view under it. */
  height: 70dvh;
  min-height: 24rem;
}
/* The feed layout (METIS-pub#801) puts the comment box on top and the newest
   entry under it, so the feed needs no box of its own to keep the box in view:
   it runs down the page, at a reading width. (The panel's header is left out
   here too: chat.css, beside .chat-panel-head, whose layer it must share.) */
.holon-activity__feed:has(.chat-feed--rows) {
  height: auto;
  min-height: 0;
  max-width: 60rem;
}
/* In the side panel (the mission panel, METIS-pub#847) the feed is the chat
   look and the panel is what scrolls, so the box is as tall as its notes. */
[data-side-panel-item] .holon-activity__feed {
  height: auto;
  min-height: 0;
}
.holon-activity .chat-feed--rows {
  overflow: visible;
  padding: 0;
}
.holon-activity--comments [data-feed-kind]:not([data-feed-kind="note"]),
.holon-activity--comments [data-feed-kinds]:not([data-feed-kinds~="note"]) {
  display: none;
}
.holon-parent-link a {
  color: var(--accent);
}

/* Child holons list */
.children-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.child-holon-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.child-holon-card:hover {
  background: var(--border-light);
  border-color: var(--border);
}
.child-holon-logo {
  height: 40px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
}
.child-holon-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.child-holon-name {
  font-weight: 500;
}

/* Inline locations display */
.locations-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

/* Inline links display: one wrapping line of icon links (METIS-pub#818),
   not a column of one link per line. */
.links-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}
.link-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-base);
  color: var(--text);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease-out);
}
.link-item:hover {
  background: var(--border-light);
}
.link-text {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Holon logo editing */
.holon-logo-editable {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 4px;
  transition: border-color var(--dur-base) var(--ease-out);
}
.holon-logo-editable:hover {
  border-color: var(--accent);
}
.holon-logo-placeholder {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  color: var(--text-muted);
  border-radius: var(--radius);
}
.holon-logo-edit {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.holon-logo-preview {
  height: 72px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
.logo-edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.logo-edit-form input[type="file"] {
  display: none;
}
.logo-edit-actions {
  display: flex;
  gap: var(--space-xs);
}

/* Team section */

/* Section header with actions (HolonDetailSection.actions): the h2 itself is
   the flex row, so it keeps its full-width rule. The actions come first, before
   the title, and the gap above is all the spacing they need — they no longer
   push to the right edge (METIS-pub#414), so there is no margin-left:auto and
   no sibling rule undoing it for the second button. */
.detail-section__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
/* The heading is uppercase and letter-spaced; a button in it is neither. */
.detail-section__action {
  text-transform: none;
  letter-spacing: normal;
}

.team-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.team-actions .btn svg {
  margin-right: 4px;
}
/* Rows above (e.g. configured conversations) have no .entity-row-list wrapper to
   supply the standard bottom gap, so add it on the actions row itself. */
.team-actions--top-gap {
  margin-top: var(--space-sm);
}
/* Team add form */
.team-add-form-container {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.team-add-form .form-row {
  margin-bottom: var(--space-sm);
}
.team-add-form label {
  display: block;
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.team-add-form input,
.team-add-form select {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-md);
  font-family: var(--font);
}
.team-add-form input:focus,
.team-add-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.team-add-form .checkbox-row label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--text-md);
  color: var(--text);
}
.team-add-form .checkbox-row input[type="checkbox"] {
  width: auto;
}
.team-add-form .form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
/* Pushes everything after it to the right, so Delete sits alone on the left
   and Cancel/Save group at the end (ui-guide.md § Buttons). A margin-left:auto
   on Cancel would do the same until something is inserted between them. */
.team-add-form .form-actions__spacer {
  flex: 1;
}
.team-add-form .form-error {
  color: var(--danger);
  font-size: var(--text-base);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--danger-bg);
  border-radius: var(--radius);
}
.team-add-form .form-info {
  font-size: var(--text-base);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--success-bg);
  color: var(--success-color);
  border-radius: var(--radius);
}
.team-add-form textarea {
  width: 100%;
  min-height: 10em;
  font-family: inherit;
  font-size: inherit;
  /* Was an inline style on each of the three add forms (two membership, one
     relationship). Here because it is the rule all three already match. Note
     the reach: every textarea inside a .team-add-form now resizes vertically
     only, including the create forms' and the flow-edit comment boxes, which
     had the browser default of both. That is the intended behaviour for a
     narrow form column — a textarea dragged wider than its form overflows it. */
  resize: vertical;
}
.required {
  color: var(--danger);
}

/* Location select (Tom Select integration) */
.location-select {
  width: 100%;
}
.field-edit-form .ts-wrapper {
  font-family: var(--font);
}
.field-edit-form .ts-control {
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
}
.field-edit-form .ts-control:focus,
.field-edit-form .ts-wrapper.focus .ts-control {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent-ring) !important;
}
.field-edit-form .ts-dropdown {
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
}
.field-edit-form .ts-dropdown .option.active,
.field-edit-form .ts-dropdown .option.selected {
  background: var(--border-light) !important;
  color: var(--text) !important;
}

/* User section */
.user-info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.user-info-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
}
.user-info-label {
  flex: 0 0 100px;
  font-size: var(--text-base);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.user-info-value {
  flex: 1;
  font-size: var(--text-md);
}
.no-user-state {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.no-user-state .btn svg {
  margin-right: 4px;
}

/* Telegram connections (revoke UI, specs/telegram-notify-config.md §12.1) */
.telegram-connection-item {
  padding: var(--space-sm) 0;
}
.telegram-connection-item + .telegram-connection-item {
  border-top: 1px solid var(--border-light);
}

/* User create form */
.user-create-form-container {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.user-create-form .form-row {
  margin-bottom: var(--space-sm);
}
.user-create-form label {
  display: block;
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.user-create-form input {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-md);
  font-family: var(--font);
}
.user-create-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-hint {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 4px;
}
.form-errors {
  margin-bottom: var(--space-sm);
}
.form-errors .form-error {
  color: var(--danger);
  font-size: var(--text-base);
  padding: var(--space-xs) var(--space-sm);
  background: var(--danger-bg);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.user-create-form .form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}


/* Section label inside a form (e.g. "Membership in ...") */
.form-section-label {
  font-size: var(--text-lg);
  font-weight: 600;
  display: block;
  margin-bottom: var(--space-sm);
}

/* LinkedIn import fieldset */
.linkedin-import {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.linkedin-import legend {
  font-size: var(--text-base);
  font-weight: 600;
  padding: 0 0.25rem;
}
.linkedin-import-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.linkedin-import .form-error { margin-top: var(--space-sm); }

.linkedin-load-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}


/* The Access section's table (crm/holon/partials/holon_access_section.html).
   A plain reference table inside a detail section — no sorting, no selection,
   so it takes none of table.css's list machinery. Scrolls in its own box so a
   long journey/step name never makes the page scroll sideways. */
.access-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.access-table th,
.access-table td {
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.access-table th {
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Delete row inside flow editors */
.flow-delete-row {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

/* Hint shown when no focus holon is selected */
.focus-hint {
  padding: 0.75rem 1rem;
  background: var(--danger-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: var(--text-md);
}

/* Logo upload row */
.logo-upload-row { display: flex; align-items: center; gap: 0.75rem; }
.logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Date shortcut buttons row */
.date-shortcuts { display: flex; gap: var(--space-xs); margin-top: var(--space-xs); }

/* Form success — e.g. new password reveal */
.form-success {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: var(--border-light);
  border-radius: var(--radius);
  font-family: var(--mono);
  word-break: break-all;
}
.form-success p {
  margin-top: var(--space-xs);
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* User actions row */
.user-actions { margin-top: var(--space-sm); }

/* Interest tags inline display */
.interest-tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Audit stats grid */
.audit-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  max-width: 600px;
}
.audit-stat-card {
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.audit-stat-value { font-size: 2rem; font-weight: 600; }
.audit-stat-label { color: var(--text-muted); font-size: var(--text-base); }
.audit-section { margin-bottom: var(--space-lg); }
.audit-section h2 { margin-bottom: var(--space-sm); }
.audit-form { margin-bottom: var(--space-lg); }
.audit-table { width: 100%; max-width: 600px; }
.audit-empty { color: var(--text-muted); }
.audit-sync-result { margin-bottom: var(--space-md); font-family: var(--font); }

/* Pages section */
.pages-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.page-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease-out);
}

.page-card:hover {
  background: var(--border-light);
}

.page-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.page-slug {
  font-weight: 500;
  color: var(--text);
  font-family: 'Red Hat Mono', monospace;
}

.page-updated {
  font-size: var(--text-base);
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* The holon-level row on the CRM detail section, which sits after the page
   cards rather than inside one, so it has no card padding to lean on. */
.page-actions--section {
  margin-top: var(--space-sm);
}

.page-actions .btn svg {
  margin-right: 4px;
}

/* Page config display */
.page-config-section {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}
.page-config-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-xs);
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease-out);
}
.page-config-items[hx-get]:hover {
  background: var(--border-light);
}
.page-config-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: var(--text-base);
}
.page-config-label {
  color: var(--text-muted);
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-xs);
}
.page-config-value {
  color: var(--text);
}
.page-config-form .form-row {
  margin-bottom: var(--space-sm);
}
.page-config-form .form-row .field-label {
  display: block;
  margin-bottom: var(--space-xs);
}

/* Flow editor — collapsed display (static, card handles the click) */
.flow-editor-collapsed {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.flow-field-value {
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* Flow editor — expanded form */
.flow-editor-expanded {
  padding: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.flow-editor-expanded .flow-field-row {
  margin-bottom: var(--space-sm);
}
.flow-editor-expanded .field-label {
  display: block;
  flex: none;
  font-size: var(--text-xs);
  margin-bottom: var(--space-xs);
}
.flow-editor-expanded select {
  width: 100%;
  padding: var(--space-xs);
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
}
.flow-editor-expanded select:focus {
  outline: none;
  border-color: var(--accent);
}
.flow-editor-expanded input[type="date"] {
  padding: var(--space-xs);
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
}
.flow-editor-expanded input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}
.flow-editor-expanded textarea {
  width: 100%;
  padding: var(--space-xs);
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  resize: vertical;
}
.flow-editor-expanded textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.flow-editor-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.flow-error-message {
  font-size: var(--text-base);
  color: var(--danger);
}

/* Single-column create form (replaces detail-grid two-column layout) */
.create-form-single-col {
  max-width: 860px;
}

/* Holon chip moved to the shared component sheet
   (crm/css/components/holon-chip.css) when Outreach needed it on a page that
   does not load detail.css. */

/* Inline type-select heading — the class picker doubles as the page title,
   e.g. "Add Camp ▾" on generic create pages (crm/holon/holon_event_create.html). */
.inline-select-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35em;
  margin-bottom: var(--space-md);
}
.inline-select-title .inline-select-title__select {
  width: auto;
  max-width: 100%;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--accent-ring);
  border-radius: 0;
  padding: 0 0.1em 0.05em;
  cursor: pointer;
}
.inline-select-title .inline-select-title__select:hover,
.inline-select-title .inline-select-title__select:focus {
  border-bottom-color: var(--accent);
  outline: none;
}

/* Flow edit two-column layout */
.flow-edit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 700px) {
  .flow-edit-layout { grid-template-columns: 1fr; }
}

/* Detail sidebar as chat feed container */
.detail-sidebar--chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
}

.detail-sidebar--chat .chat-conversation-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-sidebar--chat .chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}

.detail-sidebar--chat .chat-composer {
  padding: 0.5rem 0.75rem;
}

.detail-sidebar--chat .chat-composer__textarea {
  font-size: var(--text-base);
}

.detail-sidebar--chat .chat-message__body {
  font-size: var(--text-base);
}

.detail-sidebar--chat .chat-empty-state {
  padding: 1rem 0.75rem;
  font-size: var(--text-base);
}

/* ── Conversation list rows (in person/holon detail sections) ── */
.conversation-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px 8px 8px 4px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
  border-radius: var(--radius);
}
.conversation-row:last-child { border-bottom: none; }
.conversation-row:hover { background: var(--border-light); }

/* Date as a stacked day-over-month block, so the eye scans one narrow column
   instead of a run of same-width dates. */
.conversation-row__date {
  flex: 0 0 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  color: var(--text-muted);
  white-space: nowrap;
}
.conversation-row__day {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}
.conversation-row__month {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conversation-row__badge {
  flex: 0 0 auto;
}

/* Title over its chip strip; both ellipsis rather than wrap so row height
   stays uniform however long the generated title is. */
.conversation-row__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.conversation-row__title {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-row__title--untitled {
  color: var(--text-light);
  font-style: italic;
  font-weight: 400;
}
.conversation-row__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

/* People column: shrinks before the title does, and never past one chip wide. */
.conversation-row__people {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.conversation-row__names {
  flex: 1;
  font-size: var(--text-base);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Configured-conversation rows link to journey config and show the invite URL. */
.conversation-row__url {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-base);
}
.conversation-row__url:hover { text-decoration: underline; }

/* Journey pills on holon detail */
.journeys-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.journey-select-group { margin-bottom: 10px; }
.journey-select-sublabel {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.journey-select-sublabel img {
  width: 12px;
  height: 12px;
  display: block;
}
.action-button {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out);
}
.action-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 50%;
  height: 200%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-18deg);
  opacity: 0;
}
.action-button:hover {
  color: #fff;
  transform: translateY(-1px);
  animation: action-glow 1.4s ease-in-out infinite;
}
.action-button:hover::after {
  animation: action-shine 3s ease infinite;
}
@keyframes action-glow {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(248,76,1,0.45), var(--elev-2); }
  50%       { box-shadow: 0 0 20px 7px rgba(248,76,1,0.6), 0 4px 14px rgba(248,76,1,0.2); }
}
@keyframes action-shine {
  0%   { left: -80%; opacity: 1; }
  100% { left: 120%; opacity: 1; }
}

/* Journey connected holons section */
.journey-holons-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-sm);
}
.journey-holon-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 0;
}
.journey-holon-name {
  flex: 1;
  font-size: var(--text-md);
}
.journey-holon-remove {
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  font-size: var(--text-lg);
  line-height: 1;
  padding: 0 4px;
}
.journey-holon-row:hover .journey-holon-remove {
  opacity: 1;
}
.journey-holon-add {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-xs);
}
.journey-holon-add .ts-wrapper {
  flex: 1;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.video-wrapper :is(iframe, video) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Slideshow edit UI */
.slideshow-edit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.slideshow-edit-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--border-light);
}
.slideshow-edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slideshow-edit-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: var(--text-sm);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.slideshow-edit-remove:hover {
  background: rgba(180,0,0,0.8);
}
.slideshow-edit-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  /* The picker inside is .visually-hidden (METIS-pub#668): no raw "Choose file"
     box beside the label, and the label never runs past its column. */
  max-width: 100%;
}
.slideshow-edit-add:has(input:focus-visible) {
  /* The hidden picker takes the focus; the label shows where it is, for
     keyboard focus only (a tap leaves no ring behind), as choice-pills.css. */
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: 2px;
}
.slideshow-edit-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Splide overrides for CRM detail (fixed height carousel) */
#info-fields-section .splide__slide {
  height: 260px;
}
#info-fields-section .splide__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

/* Only a phone's holon page shows these (the phone block below). */
.detail-jump { display: none; }
.field-value__more { display: none; }

/* Phone width (METIS-pub#649): the notes column kept 320px at every width, so
   on a phone the details were squeezed into a strip. One column instead: the
   details full width, the notes beneath them, the page scrolling as a whole
   (two nested scrollers trap the thumb). 48rem is the breakpoint chat.css and
   video-card.css already use. The extension side panel's rules above still hide
   the embedded notes when it is open. --detail-aside-w is 0 so the Gathering
   motif is not clipped short (gathering/css/theme.css). */
@media (max-width: 48rem) {
  .main {
    --detail-aside-w: 0px;
  }

  /* .main stays the page's scroller: body is overflow: hidden (base.css), so
     the stacked page scrolls here, as a whole. */
  .main:has(.detail-grid--chat-left),
  .main:has(.detail-grid--chat-right) {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .detail-grid--chat-left,
  .detail-grid--chat-right {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .detail-grid--chat-left .detail-main,
  .detail-grid--chat-right .detail-main {
    /* Down the page, not in a box of its own; clip (not hidden) so nothing can
       ever be scrolled sideways out of reach. */
    overflow: visible;
    overflow-x: clip;
    order: 1;
  }

  /* Labels above their values (METIS-pub#668): beside them, a 120px label
     left a value about 200px. Detail pages only, as the rules around it. */
  :is(.detail-grid--chat-left, .detail-grid--chat-right) .field-display {
    flex-direction: column;
    /* Full width: the base rule's flex-start would shrink a value to its
       content, and a video (no in-flow content) to nothing. */
    align-items: stretch;
    gap: var(--space-1);
  }

  :is(.detail-grid--chat-left, .detail-grid--chat-right) .field-label {
    flex-basis: auto;
    padding-top: 0;
  }

  /* The person page draws a select inside a field value (e.g. the language
     picker): it may be no wider than its row. */
  :is(.detail-grid--chat-left, .detail-grid--chat-right) .detail-main .field-value select {
    max-width: 100%;
  }

  /* A long page title shrinks and wraps within its row, its pencil beside it. */
  :is(.detail-grid--chat-left, .detail-grid--chat-right) .header-name-field .field-value {
    flex: 0 1 auto;
    min-width: 0;
  }

  .detail-sidebar--chat {
    order: 2;
    height: 70dvh;
    position: static;
    border-right: 0;
    border-top: 1px solid var(--border-light);
  }

  /* A holon's page, facts first (METIS-pub#669): the person page shares the
     -right grid and keeps its order, so everything here names the holon's own. `order`
     needs a flex parent. Flex does not collapse margins, so the gap makes up for
     what the sections lost. */
  .detail-grid--holon .detail-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }
  .detail-grid--holon .detail-main > .delete-section { margin-top: var(--space-2); }
  .detail-grid--holon .detail-main > .view-switch { order: -5; }
  .detail-grid--holon .detail-main > .detail-header { order: -4; }
  .detail-grid--holon .detail-main > section:has(> #info-fields-section) { order: -3; }
  .detail-grid--holon .detail-main > section:has(> #field-description) { order: -2; }
  .detail-grid--holon .detail-main > .detail-jump { order: -1; }
  /* A tabbed page's tab bar stays under its header, above the tab's sections. */
  .detail-grid--holon .detail-main > .holon-tabs { order: -3; }

  .detail-grid--holon .detail-header .app-mark { display: none; }
  .detail-grid--holon .holon-logo {
    height: 48px;
    max-width: 48px;
  }

  .detail-grid--holon #info-fields-section .field-display--empty { display: none; }

  /* Not an editor's label: that one names its textarea. */
  .detail-grid--holon #field-description .field-display > .field-label { display: none; }
  .detail-grid--holon #field-description .field-value:not([data-expanded]) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
  }
  .field-value__more { display: inline-flex; }

  .detail-grid--holon .detail-jump:not([hidden]) {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: var(--space-2);
    background: var(--color-bg);
  }
  .detail-grid--holon .detail-jump::-webkit-scrollbar { display: none; }
  .detail-grid--holon .detail-jump > .chip { flex: none; }

  /* More chips past an edge (METIS-pub#826): crm/js/detail_phone.js marks the
     edge and it fades out, as the place band's tab row does (place-band.css). */
  .detail-grid--holon .detail-jump[data-fade-end] {
    mask-image: linear-gradient(to right, var(--black) calc(100% - var(--space-8)), transparent);
  }
  .detail-grid--holon .detail-jump[data-fade-start] {
    mask-image: linear-gradient(to left, var(--black) calc(100% - var(--space-8)), transparent);
  }
  .detail-grid--holon .detail-jump[data-fade-start][data-fade-end] {
    mask-image: linear-gradient(to right, transparent, var(--black) var(--space-8),
                                var(--black) calc(100% - var(--space-8)), transparent);
  }

  /* The bar's height: a jump lands the heading below it, not under it. */
  .detail-grid--holon .detail-main > section.detail-section,
  .detail-grid--holon .detail-sidebar--chat {
    scroll-margin-top: 3.5rem;
  }
}
}

/* In the components layer, not base with the rest of this file, beside the
   team rows below. (About's own head moved into the band's place header,
   crm/css/components/place-header.css, METIS-pub#826.) */
@layer components {
  /* Under a place's Team: everyone else, one line away on People. */
  .team-more {
    display: block;
    margin: var(--space-2) 0 var(--space-3);
    color: var(--color-accent);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
  }
  a.team-more:hover { text-decoration: underline; }
  p.team-more { color: var(--color-text-muted); }
}

/* About's team, as cards (METIS-pub#826; holon_team_section.html,
   _team_card.html): a `.card` with its own layout (card.css: "a new card is
   .card plus your own layout classes"), and an `.entity-row`, so its name is
   the stretched link that opens the person. The owner's card: a large face
   centred at the top, the name, the contact icons in one quiet row; for an
   editor one pencil in the top-right corner. */
@layer components {
  .team-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
    gap: var(--space-3);
  }

  /* The membership editor opened from a card takes the grid's whole width. */
  .team-cards > :not(.team-card) { grid-column: 1 / -1; }

  .team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-3) var(--space-4);
    text-align: center;
  }

  .team-card:hover { border-color: var(--color-accent-ring); }

  .team-card__link { max-width: 100%; color: inherit; text-decoration: none; }

  /* The face over the name, not beside it, and larger than a list's. */
  .team-card .person-face {
    --person-face-size: calc(var(--space-16) + var(--space-8));
    flex-direction: column;
    gap: var(--space-3);
    max-width: 100%;
  }

  .team-card .person-face__name {
    font-size: var(--text-md);
    font-weight: 600;
    white-space: normal;
  }

  .team-card__contacts .contact-icons { justify-content: center; opacity: 0.75; }
  .team-card__contacts .contact-icons:hover { opacity: 1; }

  /* The one pencil, in the corner, over the card's stretched link. */
  .team-card__edit {
    position: absolute;
    z-index: 1;
    top: var(--space-2);
    right: var(--space-2);
  }
}
