/*
  Settings (G2, TO-99).

  Its own stylesheet, like tomo-visibility.css. The section carries .tomo-face, so every token
  (and the dark palette under prefers-color-scheme) comes from tomo-face.css; nothing here
  invents a colour. Your setting's own styles live in tomo-visibility.css, so hosts include both:
    <link rel="stylesheet" href="_content/Tomo.Face/tomo-visibility.css" />
    <link rel="stylesheet" href="_content/Tomo.Face/tomo-settings.css" />

  The rows are the kit's collapsible row in its link form (styled in tomo-face.css, Ro,
  26 Oct 2026): icon tile, the title over a one-line sub, the count and a right chevron.
*/

.tomo-settings.tomo-face {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  gap: var(--tomo-space-4);
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--tomo-space-8) var(--tomo-space-6);
  background: transparent;
}

.tomo-settings__title {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- The list: G2's rows, each a TomoCollapsibleRow in its link form ---------- */

.tomo-settings__list { gap: 6px; }

.tomo-settings__icon { width: 20px; height: 20px; }

/* The sub line's text span is sized to its content, so a loading skeleton gets the line's width
   to measure against; otherwise its percentage width resolves to nothing. */
.tomo-settings .tomo-crow__subtext:has(> .tomo-settings__skel) { flex: 1 1 auto; }
.tomo-settings__skel { width: min(18rem, 80%); height: 11px; margin-top: 3px; }

@media (max-width: 40rem) {
  .tomo-settings.tomo-face { padding: var(--tomo-space-6) var(--tomo-space-4); }
}

/* ---------- Connectors and access (G3, TO-179) ----------
   The same section frame as Settings. Each connector is a TomoCollapsibleRow; open, its
   operations are one line each: label, a Read/Write tag, and whether it asks first. */

.tomo-access__header { display: flex; flex-direction: column; gap: var(--tomo-space-1); }

.tomo-access__lede {
  margin: 0;
  font-size: 13px;
  color: var(--tomo-text-muted);
}

.tomo-access__section {
  margin: var(--tomo-space-2) 0 0;
  font-size: 14px;
  font-weight: 600;
}

.tomo-access__desc {
  margin: 0 0 var(--tomo-space-2);
  font-size: 13px;
  color: var(--tomo-text-secondary);
}

.tomo-access__ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.tomo-access__op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--tomo-space-2);
  padding: 8px 0;
  border-top: 1px solid var(--tomo-border-subtle);
  font-size: 13px;
}
.tomo-access__op:first-child { border-top: 0; }
/* One line, cut with an ellipsis; a label made from a long description opens in place. */
.tomo-access__op-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tomo-text-primary);
}
.tomo-access__op-label--more {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tomo-access__op-label--more:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.tomo-access__op-label--more:focus-visible { outline: 2px solid var(--tomo-accent); outline-offset: 2px; border-radius: var(--tomo-radius-sm); }
.tomo-access__op-label--more.is-open { white-space: normal; overflow: visible; }

.tomo-access__verb {
  padding: 1px 8px;
  border-radius: var(--tomo-radius-full);
  font-size: 11px;
  font-weight: 600;
}
.tomo-access__verb--read { background: var(--tomo-surface-sunken); color: var(--tomo-text-secondary); }
.tomo-access__verb--write { background: var(--tomo-accent-subtle); color: var(--tomo-accent); }

.tomo-access__gate { font-size: 12px; color: var(--tomo-text-muted); white-space: nowrap; }
.tomo-access__gate--asks { color: var(--tomo-warn-ink); font-weight: 600; }

.tomo-access__quiet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--tomo-text-muted);
}

.tomo-access__row-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tomo-space-2);
  font-size: 13px;
  color: var(--tomo-danger-ink);
}

.tomo-access__open { align-self: flex-start; margin-top: var(--tomo-space-2); text-decoration: none; }
.tomo-empty .tomo-access__open { margin: var(--tomo-space-3) auto 0; display: inline-flex; }

.tomo-access__refusal { display: flex; flex-direction: column; gap: var(--tomo-space-1); }

.tomo-access__refusal-text {
  margin: var(--tomo-space-1) 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--tomo-accent);
  border-radius: 0 var(--tomo-radius-sm) var(--tomo-radius-sm) 0;
  background: var(--tomo-surface-sunken);
  font-size: 14px;
  color: var(--tomo-text-primary);
}

/* A phone: the tags drop under the label. */
@media (max-width: 30rem) {
  .tomo-access__op { grid-template-columns: auto 1fr; }
  .tomo-access__op-label { grid-column: 1 / -1; }
}
