/* Youpi · Círculo, refino "família primeiro" (circle-ui.mjs overviewView / moreView / createView, friends-ui.mjs circleEntryMarkup).
 * The first screen: my sharing state in one line, the people of the circle, "Adicionar familiar" + "Ver no mapa", then two
 * light rows ("Mais opções do círculo", "Amigos") and a one-line privacy note with "Saiba mais". Loaded after the older
 * Círculo sheets (v140/v141/uppi-*), before wave1-ui.css; reuses their --circle-* tokens (light and dark). Rules that change
 * elements those sheets style with `html body` carry `html body` too. */

/* ---------- Header and body rhythm ---------- */
dialog.circle-sheet .circle-overview { gap: 12px; }
dialog.circle-sheet .circle-options { gap: 22px; }

/* ---------- My state in one line: "Você está compartilhando · Pausar" ---------- */
/* No min-height on the sheet body's own items: an explicit one replaces the automatic minimum, and in the scrolling sheet
 * grid the row may then shrink below the content (the button of this line overlapped the next block at 320 px). */
html body .circle-banner.circle-share-line {
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid color-mix(in srgb, var(--circle-live) 28%, transparent);
  border-radius: 16px;
}
html body .circle-share-line .circle-share-text { display: grid; gap: 1px; min-width: 0; }
html body .circle-share-line strong { font-size: 14px; line-height: 1.3; }
html body .circle-share-line small { margin-top: 0; font-size: 12.5px; line-height: 1.35; }
html body .circle-share-line > .circle-btn { min-width: 0; min-height: 44px; padding: 0 12px; gap: 6px; }
html body .circle-share-line > .circle-btn .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
html body .circle-share-line[data-sharing="paused"] { border-color: var(--circle-line); }
html body .circle-share-line[data-gps="denied"] { border-color: color-mix(in srgb, var(--circle-warn-ink) 30%, transparent); }
html body .circle-share-line[data-gps="denied"] .circle-live-dot { background: var(--circle-warn-ink); animation: none; }
@media (max-width: 359px) {
  html body .circle-banner.circle-share-line { grid-template-columns: 10px minmax(0, 1fr); }
  html body .circle-share-line > .circle-btn { grid-column: 2; justify-self: start; }
}

/* ---------- The people of the circle: one calm block ---------- */
html body .circle-overview .circle-list {
  gap: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--circle-line);
  border-radius: 18px;
  background: var(--circle-surface);
}
html body .circle-overview .circle-list > li + li { border-top: 1px solid var(--circle-line); }
html body .circle-overview .circle-list > li + li .circle-row { border-top-left-radius: 12px; border-top-right-radius: 12px; }
html body .circle-overview .circle-row { min-height: 60px; padding: 8px 10px 8px 12px; border-radius: 14px; }
/* The dashed "approximate" ring stays inside the list's border. */
html body .circle-overview .circle-row.is-approx > .circle-avatar { outline-offset: 3px; }
html body .circle-overview .circle-row-state { max-width: 120px; }
/* "≈ 500 m" before the role or the status chip, in the colour of the approximate ring. */
.circle-row-approx { display: inline-flex; align-items: center; margin-right: 6px; color: var(--circle-friends-ink); font-weight: 700; white-space: nowrap; }
.circle-row-approx .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.circle-empty { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--circle-accent-soft); color: var(--circle-ink); font-size: 13.5px; line-height: 1.45; }

/* ---------- "Adicionar familiar" (primary) + "Ver no mapa" (compact) ---------- */
/* Side by side when both labels fit on one line (390 px with the app font); otherwise each takes the whole row. Labels never
 * break inside a button. */
.circle-main-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.circle-main-actions > .circle-btn { flex: 1 1 auto; min-height: 48px; padding: 0 14px; white-space: nowrap; }
.circle-main-actions > .circle-btn-primary { flex-grow: 1.4; font-size: 14.5px; }
.circle-main-actions > .circle-btn-primary .ui-icon { width: 20px; height: 20px; flex-basis: 20px; }
html body .live-map-cta.is-compact {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--circle-line);
  border-radius: 14px;
  background: var(--circle-raised);
  color: var(--circle-accent);
  font: 700 14px/1.2 'DM Sans', system-ui, sans-serif;
  text-align: center;
}
html body .live-map-cta.is-compact > .ui-icon { width: 19px; height: 19px; flex: 0 0 19px; color: inherit; }
@media (hover: hover) { html body .live-map-cta.is-compact:hover { border-color: var(--circle-accent); background: var(--circle-accent-soft); } }

/* ---------- Light rows: "Mais opções do círculo", "Amigos" ---------- */
/* No overflow: hidden here: in the scrolling sheet grid a clipped item may shrink below its content (v141-circle.css). */
.circle-links { display: grid; border: 1px solid var(--circle-line); border-radius: 16px; background: var(--circle-surface); }
.circle-links > .circle-link:first-child { border-top-left-radius: 15px; border-top-right-radius: 15px; }
.circle-links > .circle-link:last-child { border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; }
.circle-links:empty { display: none; }
.circle-links > .circle-link + .circle-link { border-top: 1px solid var(--circle-line); }
html body .circle-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--circle-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .circle-link:has(.friends-badge) { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
.circle-link-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--circle-raised); color: var(--circle-accent); }
.circle-link-icon .ui-icon { width: 19px; height: 19px; }
.circle-link.friends-entry .circle-link-icon { background: var(--circle-friends-soft); color: var(--circle-friends-ink); }
.circle-link-text { display: grid; gap: 1px; min-width: 0; }
.circle-link-text strong { font-size: 14.5px; line-height: 1.3; }
.circle-link-text small { overflow: hidden; color: var(--circle-muted); font-size: 12.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.circle-link[data-pending="true"] .circle-link-text small { color: var(--circle-friends-ink); font-weight: 700; }
.circle-link > .ui-icon { width: 16px; height: 16px; color: var(--circle-muted); }
.circle-link:focus-visible { outline: 3px solid var(--circle-accent); outline-offset: -3px; }
@media (hover: hover) { html body .circle-link:hover { background: var(--circle-raised); } }

/* ---------- One-line privacy note, "Saiba mais" opens the rest ---------- */
.circle-privacy { margin: -4px 0 0; color: var(--circle-muted); font-size: 12.5px; line-height: 1.45; }
.circle-privacy > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  min-height: 44px;
  padding: 4px 2px;
  border-radius: 10px;
  list-style: none;
  cursor: pointer;
}
.circle-privacy > summary::-webkit-details-marker { display: none; }
.circle-privacy > summary > .ui-icon { width: 15px; height: 15px; flex: 0 0 15px; }
.circle-privacy-more, .circle-privacy-less { color: var(--circle-accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.circle-privacy-less, .circle-privacy[open] .circle-privacy-more { display: none; }
.circle-privacy[open] .circle-privacy-less { display: inline; }
.circle-privacy > summary:focus-visible { outline: 3px solid var(--circle-accent); outline-offset: 2px; }
.circle-privacy-body { display: grid; gap: 6px; padding: 2px 2px 4px 23px; }
.circle-privacy-body p { margin: 0; }
.circle-privacy-body a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; color: var(--circle-accent); font-weight: 700; }

/* ---------- Circle picker: only with two circles or more, compact ---------- */
html body .circle-overview .circle-switch { gap: 6px; }
html body .circle-overview .circle-switch button { padding: 0 12px; font-size: 13px; }

/* ---------- First use: "Crie o círculo da sua família" ---------- */
.circle-create .circle-lead { margin-top: -4px; }
.circle-kind-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 4px; margin: -8px 0 0; color: var(--circle-muted); font-size: 13.5px; }
.circle-kind-switch > .circle-btn-text { padding: 0 4px; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.circle-secondary { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--circle-line); }
.circle-secondary > .circle-link { border: 1px solid var(--circle-line); border-radius: 16px; }
html body .circle-secondary .live-nocircle { gap: 8px; margin: 0; padding: 12px 14px; border: 1px solid var(--circle-line); background: transparent; }
html body .circle-secondary .live-nocircle h3 { font-size: 14px; }
html body .circle-secondary .live-nocircle p { font-size: 12.5px; }
html body .circle-secondary .live-nocircle .circle-btn { padding: 0 10px; border-color: var(--circle-line); background: transparent; font-size: 13.5px; }

/* ---------- "Mais opções" ---------- */
.circle-group-title { margin: 0 0 8px; color: var(--circle-muted); font: 700 12px/1.3 'DM Sans', system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.circle-more-group { display: grid; gap: 10px; }
.circle-more-group > .circle-group-title { margin-bottom: -2px; }
html body .circle-options .circle-events h3.circle-group-title { margin: 0 0 6px; }
.circle-more-privacy p { display: flex; gap: 8px; margin: 0; color: var(--circle-muted); font-size: 12.5px; line-height: 1.5; }
.circle-more-privacy p > .ui-icon { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.circle-more-privacy a { color: var(--circle-accent); font-weight: 700; }
html body .circle-options .circle-foot { gap: 10px; padding-top: 14px; }
.circle-more-create > .circle-btn { width: 100%; }
