/*
 * Segmented control (README "Segmented control"; D-14 Assigned / Overdue / Completed, D-05
 * Title / Filename | Full text): 1.5px divider outline around 3px of padding; the active segment is
 * #1d6aa1 with white text. Segments are links (filters) or radio inputs (form modes).
 */
@layer components {
  .segmented {
    display: inline-flex;
    flex: none;
    padding: 3px;
    border: 1.5px solid var(--color-divider);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
  }

  .segmented__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    color: var(--color-text);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.55;
  }
  .segmented__item:hover { background: var(--color-btn-hover); color: var(--color-text); }

  .segmented__item.is-active,
  .segmented__item[aria-current],
  .segmented__item:has(input:checked) {
    background: var(--color-blue);
    color: #fff;
  }

  .segmented__item input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  /* Offset ring (like .switch): a plain blue ring would vanish around the blue checked segment. */
  .segmented__item:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-blue); }

  .segmented__count { font-weight: 600; }

  .segmented__dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--color-err);
  }
  .is-active .segmented__dot,
  .segmented__item:has(input:checked) .segmented__dot { box-shadow: 0 0 0 1.5px #fff; }
}
