/* ──────────────────────────────────────────────────────────────
   components.css — composites built from the material in
   material.css: tabs, chips, notices, page chrome, page shell.
   Nothing here introduces a new colour, radius or shadow.
   ────────────────────────────────────────────────────────────── */

/* ── Option cards (radio groups that look like choices) ─────── */
.glass-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--recess);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.875rem;
  text-align: center;
  /* Shrinks just enough that a three-up row fits on a 390px phone. */
  font-size: clamp(0.875rem, 3.4vw, 1rem);
  font-weight: 540;
  color: var(--color-ink-2);
  cursor: pointer;
  transition: border-color 0.16s var(--ease-out-std),
    background-color 0.16s var(--ease-out-std), color 0.16s var(--ease-out-std),
    transform var(--duration-press) var(--ease-std);
}

/* A choice is tapped, so it answers like a button. */
.glass-option:active {
  transform: scale(0.97);
}

.glass-option:hover {
  border-color: var(--hairline-strong);
}

.peer:checked ~ .glass-option,
.glass-option.is-selected {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.peer:disabled ~ .glass-option {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Segmented tabs (one raised pill in a recessed track) ───── */
.glass-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--recess);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.glass-tabs::-webkit-scrollbar {
  display: none;
}

.glass-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.4375rem 0.875rem;
  font-family: var(--font-body);
  font-size: var(--text-meta);
  font-weight: 560;
  color: var(--color-ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s var(--ease-out-std),
    color 0.16s var(--ease-out-std),
    transform var(--duration-press) var(--ease-std);
}

.glass-tab:active {
  transform: scale(0.97);
}

.glass-tab:hover {
  color: var(--color-ink);
}

.glass-tab.active {
  background: var(--material-strong);
  color: var(--color-ink);
  box-shadow: var(--shadow-hair);
}

/* ── Chips, badges and status ────────────────────────────────── */
.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--recess);
  border: 0.5px solid var(--hairline);
  border-radius: 999px;
  padding: 0.125rem 0.625rem;
  font-size: var(--text-meta);
  font-weight: 560;
  color: var(--color-ink-2);
  white-space: nowrap;
}

.glass-chip--gold {
  border-color: var(--gold-hairline);
  color: var(--color-caution);
}

.glass-chip--accent {
  background: var(--color-accent-soft);
  border-color: color-mix(in oklab, var(--color-accent) 25%, transparent);
  color: var(--color-accent);
}

.glass-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3125rem;
  border-radius: 999px;
  background: var(--color-rubric);
  color: var(--color-ground);
  font-size: 0.6875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.state-affirm {
  color: var(--color-affirm);
}
.state-caution {
  color: var(--color-caution);
}
.state-rubric {
  color: var(--color-rubric);
}

/* Notices: tinted recess, hairline in the state colour. */
.glass-notice {
  border-radius: var(--radius-md);
  border: 0.5px solid var(--hairline);
  background: var(--recess);
  padding: 0.75rem 0.875rem;
  font-size: var(--text-meta);
  color: var(--color-ink-2);
}

.glass-notice--affirm {
  border-color: color-mix(in oklab, var(--color-affirm) 30%, transparent);
  background: color-mix(in oklab, var(--color-affirm) 7%, transparent);
}

.glass-notice--caution {
  border-color: color-mix(in oklab, var(--color-caution) 30%, transparent);
  background: color-mix(in oklab, var(--color-caution) 7%, transparent);
}

.glass-notice--rubric {
  border-color: color-mix(in oklab, var(--color-rubric) 30%, transparent);
  background: color-mix(in oklab, var(--color-rubric) 6%, transparent);
}

/* Monogram: initials, hairline ring, no coloured fill. */
.glass-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--material-strong);
  border: 0.5px solid var(--hairline-strong);
  color: var(--color-ink-2);
  font-size: var(--text-meta);
  font-weight: 600;
}

/* A link that makes its whole positioned ancestor clickable. */
.stretch-link {
  color: inherit;
  text-decoration: none;
}

.stretch-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.stretch-link:hover {
  color: inherit;
}

.no-underline {
  text-decoration: none;
}

/* ──────────────────────────────────────────────────────────────
   Screen header: back, title, one action. The same three slots on
   every detail screen, so the eye never hunts for the way out.
   ────────────────────────────────────────────────────────────── */
.screen-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.screen-head > .min-w-0 {
  flex: 1 1 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: -0.375rem;
  border-radius: 999px;
  color: var(--color-ink-2);
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease,
    transform var(--duration-press) var(--ease-std);
}

.back-link:active { transform: scale(0.9); }

.back-link svg { width: 1.125rem; height: 1.125rem; }

.back-link:hover {
  background: var(--recess);
  color: var(--color-ink);
}

/* Actions under a card's headline: one filled, the rest quiet. */
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* A person in a list. The remove control stays invisible until the row is
   hovered or focused, so a list of five reads as five people, not ten
   buttons. Touch devices have no hover, so there it is always shown. */
.person-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm, 10px);
}

.person-row:hover { background: var(--recess); }

.person-row__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--color-ink-3);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.person-row__remove svg { width: 0.9rem; height: 0.9rem; }

.person-row:hover .person-row__remove,
.person-row__remove:focus-visible { opacity: 1; }

.person-row__remove:hover {
  color: var(--color-rubric);
  background: var(--recess);
}

@media (hover: none) {
  .person-row__remove { opacity: 1; }
}

/* Week stepper: two chevrons around the week being shown. */
.week-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.week-nav .glass-button {
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

/* A section that folds away: the whole header is the hit target, and the
   summary on the right says what the defaults are so opening it is a
   choice rather than an obligation. */
.disclosure-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.disclosure-head:hover .t-label { color: var(--color-accent); }
