/* ==================================================================================================
   Content components — owner: design-system agent (r4 «Birge OS», spec §9.10–9.20, §6.3)

   .card (+ --hover lift, --flush, --inset; __header/__title/__subtitle/__body/__footer)
   .widget (home widgets: __head, __icon, __value, __foot; a.widget presses in)
   .list-group (iOS inset grouped list: __header, __items, __footer; .list-item + __icon/__body/
     __title/__subtitle/__trail/__chevron; a/button/label.list-item is a hoverable row)
   .table (+ --sticky header under the topbar; .table-wrap = card + horizontal scroll on mobile;
     tr.is-selected / [aria-selected="true"] = macOS selection)
   .badge (+ --accent/--danger/--success/--warning/--muted/--outline) · .counter
   .chip (+ __dot, __text, __remove; --sm/--lg/--solid/--outline/--neutral) — neutral capsule, the
     color (data-color) shows in the dot
   .status-pill · .icon-tile / .list-item__icon / .ws-tile (iOS app-icon squircles: --2xs…--xl,
     --soft) · .dot
   .avatar (--xs/--sm/--md/--lg/--xl/--2xl; .avatar--empty, --more) · .avatar-stack
   .progress (+ __bar, style="--value: 40") · .progress-ring (components/progress_ring.html)
   .skeleton (--text/--title/--circle/--block) · .empty-state (components/empty_state.html)
   .stat (big number tile: __label/__value/__trend) · .banner (--info/--success/--warning/--danger)
   .kbd · .spinner (Apple activity indicator, 8 spokes; {% spinner %}) · .divider (--label)
   .tabs/.tab (underline tabs with sliding indicator) · .props (label/value property list)
   .htmx-indicator
   ================================================================================================== */

/* -- Cards (r4 · 9.10) ----------------------------------------------------------------------------- */
.card {
  --card-pad: 16px 20px;
  position: relative;
  min-width: 0;
  padding: var(--card-pad);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs),
    inset 0 0.5px 0 var(--card-highlight);
}
.card--flush {
  --card-pad: 0;
  overflow: hidden;
}
.card--inset {
  background: var(--surface-sunken);
  box-shadow: none;
}
.card--hover {
  transition:
    box-shadow var(--dur-2) ease,
    transform var(--dur-snappy) var(--spring-snappy);
}
@media (hover: hover) {
  .card--hover:hover {
    box-shadow:
      0 0 0 0.5px var(--line),
      var(--shadow-md),
      inset 0 0.5px 0 var(--card-highlight);
    transform: translateY(-1px);
  }
}
.card--hover:active {
  transform: scale(0.99);
  transition-duration: var(--dur-1);
}
a.card {
  display: block;
  color: inherit;
}
.card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: var(--space-3);
}
.card--flush > .card__header {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--line-subtle);
}
.card__title {
  flex: 1;
  min-width: 0;
  font-size: var(--type-title3);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
  text-wrap: balance;
}
.card__subtitle {
  color: var(--text-3);
  font-size: var(--type-footnote);
}
.card__body {
  min-width: 0;
}
.card--flush > .card__body {
  padding: 12px 16px 16px;
}
.card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.card--flush > .card__footer {
  margin: 0;
  padding: 12px 16px;
  border-top: 0.5px solid var(--line-subtle);
}
/* "View all ›" in a card/section header: a quiet text link (neutral until hovered) that never
   squeezes the title. <a class="more-link" href="…">{% translate "View all" %}{% icon "chevron-right" size=14 %}</a> */
.more-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  height: 24px;
  margin: -2px -6px 0 0;
  padding: 0 4px 0 8px;
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  transition:
    color var(--dur-1) ease,
    background-color var(--dur-1) ease;
}
.more-link:hover {
  background: var(--fill-1);
  color: var(--text);
}
.more-link:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
}
.more-link .icon {
  color: var(--text-3);
}
.more-link:hover .icon {
  color: inherit;
}

/* -- Widgets (r4 · 9.10, iOS/macOS widgets on Home) ------------------------------------------------ */
.widget {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius-widget);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-sm),
    inset 0 0.5px 0 var(--card-highlight);
}
.widget__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-2);
  font-size: var(--type-footnote);
  font-weight: var(--fw-semibold);
}
.widget__icon {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tone-gradient);
  color: var(--tone-on);
}
.widget__icon .icon {
  --icon-stroke: 2.2;
  width: 16px;
  height: 16px;
}
.widget__value {
  font-family: var(--font-rounded);
  font-size: var(--type-title1);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}
.widget__foot {
  color: var(--text-3);
  font-size: var(--type-footnote);
}
a.widget {
  color: inherit;
  transition:
    transform var(--dur-snappy) var(--spring-snappy),
    box-shadow var(--dur-2) ease;
}
@media (hover: hover) {
  a.widget:hover {
    box-shadow:
      0 0 0 0.5px var(--line),
      var(--shadow-md),
      inset 0 0.5px 0 var(--card-highlight);
  }
}
a.widget:active {
  transform: scale(0.97);
  transition-duration: var(--dur-1);
}
a.widget:focus-visible {
  outline: 2.5px solid var(--focus-outline);
  outline-offset: 2px;
}

/* -- Inset grouped list (r4 · 9.11) ----------------------------------------------------------------
   The white surface sits on .list-group__items (header and footer text stay outside the group,
   like iOS). A .list-group holding .list-item rows directly gets the surface itself. Separators
   start at the text (--item-inset: 16 / 56 with an icon tile / 60 with an avatar). */
.list-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.list-group + .list-group {
  margin-top: var(--space-6);
}
.list-group__header {
  padding: 0 16px;
  color: var(--text-2);
  font-size: var(--type-footnote);
  font-weight: var(--fw-regular);
}
.list-group__footer {
  padding: 0 16px;
  color: var(--text-3);
  font-size: var(--type-footnote);
}
.list-group__items,
.list-group:has(> .list-item) {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
  list-style: none;
}
.list-group:has(> .list-item) {
  gap: 0;
}
.list-item {
  --item-inset: 16px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: var(--row-h-list);
  padding: 8px 16px;
  color: var(--text);
  font-size: var(--type-body);
  text-align: left;
}
.list-item:has(> .list-item__icon) {
  --item-inset: 56px;
}
.list-item:has(> .avatar) {
  --item-inset: 60px;
}
.list-item + .list-item::before,
li + li > .list-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--item-inset);
  height: 0.5px;
  background: var(--line);
}
:is(a, button, label).list-item {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--type-body);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) ease;
}
@media (hover: hover) {
  :is(a, button, label).list-item:hover {
    background: var(--fill-1);
  }
}
:is(a, button, label).list-item:active {
  background: var(--fill-2);
}
:is(a, button).list-item:focus-visible {
  outline: 2.5px solid var(--focus-outline);
  outline-offset: -2.5px;
}
.list-item__icon {
  --size: 28px;
}
.list-item__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.list-item__title {
  overflow: hidden;
  font-size: var(--type-body);
  font-weight: var(--fw-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item__subtitle {
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--type-subhead);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item__trail {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--text-2);
  font-size: var(--type-body);
}
.list-item__chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

/* -- Table (r4 · 9.12) ----------------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-md);
}
.table th {
  height: 32px;
  padding: 0 12px;
  border-bottom: 0.5px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-align: left;
  white-space: nowrap;
}
.table td {
  height: 36px;
  padding: 6px 12px;
  border-bottom: 0.5px solid var(--line-subtle);
  vertical-align: middle;
}
@media (pointer: coarse) {
  .table td {
    height: 48px;
  }
}
.table tbody tr {
  transition: background-color var(--dur-1) ease;
}
@media (hover: hover) {
  .table tbody tr:hover {
    background: var(--fill-1);
  }
}
.table tbody tr:is(.is-selected, [aria-selected="true"]) {
  --text: var(--selection-fg);
  --text-2: color-mix(in srgb, var(--selection-fg) 85%, transparent);
  --text-3: color-mix(in srgb, var(--selection-fg) 72%, transparent);
  --fill-1: color-mix(in srgb, var(--selection-fg) 16%, transparent);
  --fill-2: color-mix(in srgb, var(--selection-fg) 24%, transparent);
  background: var(--selection-bg);
  color: var(--text);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table th:first-child,
.table td:first-child {
  padding-left: 16px;
}
.table th:last-child,
.table td:last-child {
  padding-right: 16px;
}
.table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* Opt-in sticky header (page-level tables under the app topbar; not inside .table-wrap scroll). */
.table--sticky th {
  position: sticky;
  z-index: 1;
  top: calc(var(--topbar-h) + var(--safe-top));
  background: var(--mat-chrome);
  -webkit-backdrop-filter: var(--mat-filter);
  backdrop-filter: var(--mat-filter);
}
.table-wrap {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
}
@media (max-width: 767px) {
  .table-wrap {
    overflow-x: auto;
  }
  .table-wrap .table--sticky th {
    position: static;
  }
}

/* -- Badges & counters (r4 · 9.14) -----------------------------------------------------------------
   An 18px capsule, 11px 600, tabular figures. --danger = the iOS red badge (tab bar, bell, "needs
   you"); --accent = accent + white; --muted = a calm gray count. */
.badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--fill-2);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.badge--accent {
  background: var(--accent);
  color: var(--text-on-accent);
}
.badge--danger {
  background: var(--badge-bg);
  color: var(--text-on-accent);
}
.badge--success {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success-ink);
}
.badge--warning {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning-ink);
}
.badge--muted {
  background: var(--fill-2);
  color: var(--text-2);
}
.badge--outline {
  border: 0.5px solid var(--line-strong);
  background: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .badge--danger {
    animation: pop 420ms var(--spring-bouncy);
  }
}
.counter {
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}

/* -- Chips (r4 · 9.13) -----------------------------------------------------------------------------
   A neutral capsule (--fill-1, --text-2); the object's color shows as a 7px dot (__dot) — or the
   whole chip with --solid. Long names ellipsize inside the chip (title attr = full name). */
.chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
  max-width: min(180px, 100%);
  min-width: 0;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.chip > span:not([class]),
.chip__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
}
.chip .icon {
  flex-shrink: 0;
}
.chip__remove {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: -4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-3);
}
.chip__remove:hover {
  background: var(--fill-2);
  color: var(--text);
}
.chip__remove:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 0;
}
.chip--sm {
  height: 20px;
  padding: 0 7px;
  font-size: var(--fs-2xs);
}
.chip--lg {
  height: 28px;
  padding: 0 12px;
  font-size: var(--fs-sm);
}
.chip--solid {
  background: var(--tone-gradient);
  color: var(--tone-on);
}
.chip--solid .chip__dot {
  background: currentColor;
}
.chip--outline {
  background: none;
  box-shadow: inset 0 0 0 0.5px var(--line-strong);
}
.chip--neutral {
  background: var(--fill-1);
  color: var(--text-2);
}
.chip--neutral .chip__dot {
  background: var(--tone);
}
a.chip,
button.chip {
  border: 0;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-1) ease,
    box-shadow var(--dur-1) ease;
}
a.chip:hover,
button.chip:hover {
  background: var(--fill-2);
  color: var(--text);
}
a.chip:active,
button.chip:active {
  background: var(--fill-3);
}
a.chip.chip--solid:hover,
button.chip.chip--solid:hover {
  background: var(--tone-gradient);
  color: var(--tone-on);
  filter: brightness(1.06);
}
.dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

/* Status pill (project health, r4 · 9.23): a --fill-1 capsule + the status color as a 7px dot (the
   word carries the meaning, the dot the hue). */
.status-pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 9px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
}

/* -- App-icon tiles (r4 · 6.3) ---------------------------------------------------------------------
   Projects, teams, workspaces, settings rows: an iOS app icon — a soft squircle (radius = 25% of
   the size), a vertical tone gradient, a white glyph at 58%, a hairline light rim. Size via --size
   (modifiers below; pages set --size too) — --tile mirrors it. No data-color → gray. */
.icon-tile,
.list-item__icon {
  --tile: var(--size, 28px);
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--tile);
  height: var(--tile);
  border-radius: calc(var(--tile) * 0.25);
  background: var(--tone-gradient);
  color: var(--tone-on);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.35),
    inset 0 0 0 0.5px rgb(0 0 0 / 0.06),
    0 1px 2px rgb(0 0 0 / 0.12);
}
.icon-tile {
  --size: 28px;
}
:is(.icon-tile, .list-item__icon) .icon {
  --icon-stroke: 2.2;
  width: 58%;
  height: 58%;
}
.icon-tile--2xs { --size: 16px; }
.icon-tile--xs { --size: 20px; }
.icon-tile--sm { --size: 24px; }
.icon-tile--md { --size: 36px; }
.icon-tile--lg { --size: 48px; }
.icon-tile--xl { --size: 64px; }
.icon-tile--2xs,
.icon-tile--xs {
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.3),
    inset 0 0 0 0.5px rgb(0 0 0 / 0.06);
}
.icon-tile--2xs .icon,
.icon-tile--xs .icon {
  --icon-stroke: 2.6;
  width: 64%;
  height: 64%;
}
.icon-tile--soft {
  background: var(--tone-soft);
  color: var(--tone-ink);
  box-shadow: none;
}
/* Decorative tiles in card/section headers and stat tiles stay soft (tint + colored glyph); the
   saturated app-icon tile is for identity (projects, teams, workspaces, settings rows). */
.card__header > .icon-tile,
.section-header > .icon-tile,
.stat .icon-tile {
  background: var(--tone-soft);
  color: var(--tone-ink);
  box-shadow: none;
}
/* Workspace monogram (shell.css sets its size) — the same app-icon squircle, white letters. */
.ws-tile {
  border-radius: calc(var(--size, 32px) * 0.25);
  background: var(--tone-gradient);
  color: var(--tone-on);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.35),
    inset 0 0 0 0.5px rgb(0 0 0 / 0.06),
    0 1px 2px rgb(0 0 0 / 0.12);
  font-weight: var(--fw-bold);
}

/* -- Avatars (r4 · 9.15) ---------------------------------------------------------------------------
   Photo: a circle with a 0.5px inner ring. No photo: the iOS Contacts monogram — the user's
   avatar_color as a tone gradient, initials 600 at 40%. Sizes xs … 2xl. */
.avatar {
  --size: 32px;
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--size);
  height: var(--size);
  overflow: hidden;
  border-radius: 50%;
  background: var(--tone-gradient);
  color: var(--tone-on);
  font-size: calc(var(--size) * 0.4);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
  vertical-align: middle;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.08);
  pointer-events: none;
}
.avatar--xs { --size: 20px; font-size: 8.5px; }
.avatar--sm { --size: 24px; font-size: 10px; }
.avatar--md { --size: 32px; }
.avatar--lg { --size: 40px; }
.avatar--xl { --size: 64px; font-weight: var(--fw-bold); }
.avatar--2xl { --size: 96px; font-weight: var(--fw-bold); }
.avatar--empty {
  border: 1.5px dashed var(--control-border);
  background: transparent;
  color: var(--text-3);
}
.avatar--empty::after {
  display: none;
}
.avatar--empty .icon {
  --icon-stroke: 2.2;
  width: 62%;
  height: 62%;
}
.avatar--more {
  background: var(--fill-2);
  color: var(--text-2);
  font-size: calc(var(--size) * 0.36);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-transform: none;
}
.avatar--more::after {
  display: none;
}
/* Stacks: a 20% overlap with a 2px ring in the surface color (set --avatar-ring on other
   backgrounds). Every avatar but the last is partly covered on its right, so its initials are
   centred in the part that shows — they are never cut. "+N" (avatar--more) closes the stack. */
.avatar-stack {
  --ring: var(--avatar-ring, var(--surface));
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  vertical-align: middle;
  isolation: isolate;
}
.avatar-stack > .avatar {
  --stack-overlap: calc(var(--size) * 0.2);
  --stack-ring: 2px;
  box-shadow: 0 0 0 var(--stack-ring) var(--ring);
}
.avatar-stack > :is(.avatar--xs, .avatar--sm) {
  --stack-ring: 1.5px;
}
.avatar-stack > .avatar + .avatar {
  margin-left: calc(var(--stack-overlap) * -1);
}
.avatar-stack > .avatar:not(:last-child):not(:has(img)) {
  padding-right: calc(var(--stack-overlap) + var(--stack-ring));
}
.avatar-stack > .avatar--more {
  background: color-mix(in srgb, var(--text-3) 18%, var(--surface));
}

/* -- Progress (r4 · 9.16) --------------------------------------------------------------------------
   Bar: a 6px --fill-2 capsule track, the value in --tone (default accent), grows in on a spring.
   Ring (Activity ring): a round-capped value over a --tone-soft track; 100% pops once. */
.progress {
  --value: 0;
  position: relative;
  flex: 1 1 auto;
  height: 6px;
  min-width: 40px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--fill-2);
}
.progress__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  border-radius: inherit;
  background: var(--tone, var(--accent));
  transition: width var(--dur-smooth) var(--spring-smooth);
}
.progress:not([data-color]) .progress__bar {
  background: var(--accent);
}
@starting-style {
  .progress__bar {
    width: 0;
  }
}
.progress--sm {
  height: 4px;
}
.progress--lg {
  height: 10px;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.progress-row__value {
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.progress-ring {
  --size: 44px;
  --value: 0;
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--size);
  height: var(--size);
}
.progress-ring:not([data-color]) {
  --tone: var(--accent);
  --tone-soft: var(--accent-soft);
}
.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.progress-ring__track {
  fill: none;
  stroke: var(--tone-soft);
}
.progress-ring__value {
  fill: none;
  stroke: var(--tone);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--value));
  transition: stroke-dashoffset var(--dur-smooth) var(--spring-smooth);
}
@starting-style {
  .progress-ring__value {
    stroke-dashoffset: 100;
  }
}
.progress-ring__label {
  position: relative;
  font-family: var(--font-rounded);
  font-size: max(11px, calc(var(--size) * 0.26));
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
@media (prefers-reduced-motion: no-preference) {
  .progress-ring.is-complete {
    animation: content-ring-pop var(--dur-bouncy) var(--spring-bouncy) var(--dur-smooth) both;
  }
}
@keyframes content-ring-pop {
  0%,
  100% {
    transform: none;
  }
  45% {
    transform: scale(1.06);
  }
}

/* -- Skeleton (r4 · 9.17): a calm --fill-2 shape that "breathes" (no shimmer sweep) ----------------- */
.skeleton {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--fill-2);
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: skeleton-breathe 1.4s ease-in-out infinite;
  }
  .skeleton:nth-child(2) { animation-delay: 0.1s; }
  .skeleton:nth-child(3) { animation-delay: 0.2s; }
  .skeleton:nth-child(4) { animation-delay: 0.3s; }
}
@keyframes skeleton-breathe {
  50% {
    opacity: 0.55;
  }
}
.skeleton--text {
  height: 12px;
  border-radius: 4px;
}
.skeleton--title {
  width: 40%;
  height: 20px;
  border-radius: 6px;
}
.skeleton--circle {
  width: var(--size, 32px);
  height: var(--size, 32px);
  border-radius: 50%;
}
.skeleton--block {
  height: var(--h, 96px);
  border-radius: var(--radius-card);
}

/* -- Empty state (r4 · 9.18, iOS ContentUnavailableView) ------------------------------------------
   Three sizes (components/empty_state.html):
     full     (default) page/section: a 44px glyph (no tile) · title · text (≤ 40ch) · primary +
              link actions · optional "ways to start" inset group (steps) · optional hint line
     compact  inside cards/panels: a 32px glyph, tighter spacing
     inline   (.empty-inline, components/empty_inline.html) one quiet line for empty columns, lists
              and groups — never a big box that wastes the board
   Neutral by default (color only when passed: the glyph takes the tone). */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  margin-inline: auto;
  padding: var(--space-12) var(--space-4);
  text-align: center;
}
.empty-state--compact {
  padding: var(--space-6) var(--space-4);
}
.empty-state__art {
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--text-3);
}
.empty-state__art .icon {
  --icon-stroke: 1.5;
  width: 44px;
  height: 44px;
}
.empty-state__art[data-color] {
  color: var(--tone-ink);
}
.empty-state__art[data-color="gray"] {
  color: var(--text-3);
}
.empty-state--compact .empty-state__art {
  margin-bottom: 10px;
}
.empty-state--compact .empty-state__art .icon {
  --icon-stroke: 1.6;
  width: 32px;
  height: 32px;
}
.empty-state__title {
  font-size: var(--type-title2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
  text-wrap: balance;
}
.empty-state--compact .empty-state__title {
  font-size: var(--type-headline);
}
.empty-state__text {
  max-width: 40ch;
  margin-top: 6px;
  color: var(--text-2);
  font-size: var(--type-callout);
  line-height: var(--lh-normal);
  text-wrap: pretty;
}
.empty-state--compact .empty-state__text {
  margin-top: 4px;
  font-size: var(--type-footnote);
}
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  margin-top: 20px;
}
.empty-state--compact .empty-state__actions {
  margin-top: 14px;
}
/* "Ways to start": up to ~4 rows (icon tile · title · text · chevron) — an inset group. */
.empty-state__steps {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  margin: var(--space-6) 0 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
  text-align: left;
  list-style: none;
}
.empty-state__steps > li {
  position: relative;
}
.empty-state__steps > li + li::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 60px;
  height: 0.5px;
  background: var(--line);
}
.empty-state__step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px 8px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) ease;
}
@media (hover: hover) {
  .empty-state__step:hover {
    background: var(--fill-1);
  }
}
.empty-state__step:active {
  background: var(--fill-2);
}
.empty-state__step:focus-visible {
  outline: 2.5px solid var(--focus-outline);
  outline-offset: -2.5px;
}
.empty-state__step-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent-solid) 78%, white) 0%, var(--accent-solid) 100%);
  color: var(--text-on-accent);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.35),
    0 1px 2px rgb(0 0 0 / 0.12);
}
.empty-state__step-icon .icon {
  --icon-stroke: 2.2;
  width: 18px;
  height: 18px;
}
.empty-state__step-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.empty-state__step-title {
  font-size: var(--type-body);
  font-weight: var(--fw-medium);
}
.empty-state__step-text {
  color: var(--text-2);
  font-size: var(--type-subhead);
}
.empty-state__step > .icon:last-child {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--text-3);
}
.empty-state__hint {
  margin-top: var(--space-4);
  color: var(--text-3);
  font-size: var(--type-footnote);
}
@media (prefers-reduced-motion: no-preference) {
  .empty-state {
    animation: fade-up var(--dur-4) var(--ease-out) both;
  }
}

/* Inline empty line: an empty board column, list group or panel — one calm 13px row with an
   optional link-style action, so empty space stays small. --dashed while it is a drop target. */
.empty-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.35;
}
.empty-inline--dashed {
  outline: 1px dashed var(--line-strong);
  outline-offset: -1px;
}
.empty-inline--card {
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
}
.empty-inline > .icon {
  flex-shrink: 0;
}
.empty-inline__text {
  flex: 1;
  min-width: 0;
}
.empty-inline__action {
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-weight: var(--fw-medium);
  cursor: default;
  transition: opacity var(--dur-1) ease;
}
.empty-inline__action:hover {
  opacity: 0.8;
}
.empty-inline__action:active {
  opacity: 0.6;
}
.empty-inline__action:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

/* -- Stat tile ------------------------------------------------------------------------------------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.stat__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--type-footnote);
  font-weight: var(--fw-semibold);
}
.stat__value {
  font-family: var(--font-rounded);
  font-size: var(--fs-title-1);
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.stat__trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  padding: 0 7px 0 5px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.stat__trend--up {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success-ink);
}
.stat__trend--down {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger-ink);
}
.stat__trend--flat {
  background: var(--fill-1);
  color: var(--text-2);
}

/* -- Banner (r4 · 9.19) ----------------------------------------------------------------------------
   Radius 14, a --tone-softer wash (no hairline), a 28px soft icon tile on the left, a 600 title,
   --type-callout text, actions + ✕ (.btn--plain.btn--icon). Level = tone: info blue, success
   green, warning orange, danger red (or any data-color). */
.banner {
  --tone-soft: color-mix(in srgb, var(--tone) 16%, transparent);
  --tone-softer: color-mix(in srgb, var(--tone) 9%, transparent);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--tone-softer);
  color: var(--text);
}
.banner--info { --tone: var(--info); --tone-ink: var(--info-ink); }
.banner--success { --tone: var(--success); --tone-ink: var(--success-ink); }
.banner--warning { --tone: var(--warning); --tone-ink: var(--warning-ink); }
.banner--danger { --tone: var(--danger); --tone-ink: var(--danger-ink); }
.banner__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--tone-soft);
  color: var(--tone-ink);
}
.banner__icon .icon {
  width: 16px;
  height: 16px;
}
.banner__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 4px;
}
.banner__title {
  font-weight: var(--fw-semibold);
}
.banner__text {
  color: var(--text-2);
  font-size: var(--type-callout);
}
.banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.banner__close {
  margin: -2px -6px -4px 0;
}

/* -- Keyboard keys (r4 · 9.20) --------------------------------------------------------------------- */
kbd,
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 0.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.kbd-combo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kbd-combo__then {
  color: var(--text-3);
  font-size: var(--fs-2xs);
}

/* -- Spinner (r4 · 9.17, Apple activity indicator) ------------------------------------------------
   {% spinner %} = <span class="spinner"><i></i> ×8</span>. An empty .spinner (hand-written) draws
   the same 8 spokes with a masked conic gradient. Informative motion: under reduced motion it
   keeps turning, 2× slower. */
.spinner {
  --sp: 18px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: var(--sp);
  height: var(--sp);
  color: var(--text-3);
  vertical-align: middle;
}
.spinner--sm { --sp: 14px; }
.spinner--lg { --sp: 28px; }
.spinner i {
  position: absolute;
  top: 0;
  left: calc(50% - var(--sp) * 0.06);
  width: calc(var(--sp) * 0.12);
  height: calc(var(--sp) * 0.3);
  border-radius: var(--radius-full);
  background: currentColor;
  opacity: 0.25;
  transform-origin: 50% calc(var(--sp) * 0.5);
  animation: spinner-fade 1s linear infinite;
}
.spinner i:nth-child(1) { transform: rotate(0deg); animation-delay: -0.875s; }
.spinner i:nth-child(2) { transform: rotate(45deg); animation-delay: -0.75s; }
.spinner i:nth-child(3) { transform: rotate(90deg); animation-delay: -0.625s; }
.spinner i:nth-child(4) { transform: rotate(135deg); animation-delay: -0.5s; }
.spinner i:nth-child(5) { transform: rotate(180deg); animation-delay: -0.375s; }
.spinner i:nth-child(6) { transform: rotate(225deg); animation-delay: -0.25s; }
.spinner i:nth-child(7) { transform: rotate(270deg); animation-delay: -0.125s; }
.spinner i:nth-child(8) { transform: rotate(315deg); animation-delay: 0s; }
@keyframes spinner-fade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.25;
  }
}
.spinner:empty::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, color-mix(in srgb, currentColor 25%, transparent), currentColor);
  -webkit-mask:
    repeating-conic-gradient(from -7deg, #000 0deg 14deg, transparent 14deg 45deg),
    radial-gradient(farthest-side, transparent 38%, #000 40%);
  -webkit-mask-composite: source-in;
  mask-image:
    repeating-conic-gradient(from -7deg, #000 0deg 14deg, transparent 14deg 45deg),
    radial-gradient(farthest-side, transparent 38%, #000 40%);
  mask-composite: intersect;
  animation: content-spokes 1s steps(8) infinite;
}
@keyframes content-spokes {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner i,
  .spinner:empty::before {
    animation-duration: 2s;
  }
}
:root[data-motion="reduced"] .spinner:empty::before {
  animation-duration: 2s !important;
  animation-iteration-count: infinite !important;
}

/* -- Divider (r4 · 9.20) --------------------------------------------------------------------------- */
.divider {
  height: 0.5px;
  margin: var(--space-4) 0;
  border: 0;
  background: var(--line);
}
.divider--label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: auto;
  background: none;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
.divider--label::before,
.divider--label::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: var(--line);
}

/* -- Underline tabs (in-page) — app.js positions .tabs__indicator under the active tab ------------ */
.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 0.5px solid var(--line);
  scrollbar-width: none;
}
.tab {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  cursor: default;
  transition: color var(--dur-1) ease;
}
.tab:hover {
  color: var(--text);
}
.tab[aria-selected="true"],
.tab[aria-current="page"],
.tab.is-active {
  color: var(--text);
  font-weight: var(--fw-semibold);
}
.tab:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: -4px;
  border-radius: var(--radius-sm);
}
.tab .badge {
  margin-left: 2px;
}
.tabs__indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--ind-w, 0px);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  transform: translateX(var(--ind-x, 0px));
  transition:
    transform var(--dur-snappy) var(--spring-snappy),
    width var(--dur-snappy) var(--spring-snappy);
}
.tabs.no-anim .tabs__indicator {
  transition: none;
}
.tabs:not(.is-ready) :is(.tab[aria-selected="true"], .tab[aria-current="page"], .tab.is-active) {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* -- Property list (label / value rows, e.g. task details) -------------------------------------- */
.props {
  display: grid;
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 4px 16px;
  margin: 0;
}
.props dt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.props dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 34px;
  margin: 0;
}

/* -- Misc ---------------------------------------------------------------------------------------- */
.htmx-indicator {
  opacity: 0;
  transition: opacity var(--dur-2) ease;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}
.meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.meta .icon {
  color: var(--text-3);
}
.timeago {
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* -- Swipe actions (r4 · 11.2) --------------------------------------------------------------------
   Touch only (app.js initSwipeActions): the row itself slides with its background; the action tray
   hangs off its edge and fills the space the row leaves. Rows opt in with [data-swipe] +
   data-swipe-leading / -trailing (components/task_row.html). */
/* The row's parent clips sideways (clip makes no scroll container: sticky keeps working) */
.list-section__rows:has(> [data-swipe]), /* beats projects.css's phone rule (overflow: visible) */
:has(> [data-swipe]) {
  overflow-x: clip;
}
/* Doubled attribute: domain.css (.task-row transition) loads later */
[data-swipe][data-swipe-leading],
[data-swipe][data-swipe-trailing] {
  position: relative;
  touch-action: pan-y;
  transform: translateX(var(--swipe-x, 0px));
  transition:
    transform var(--dur-smooth) var(--spring-smooth),
    background-color var(--dur-1) ease;
}
[data-swipe].is-swiping {
  transition: none;
}
.swipe-tray {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
}
.swipe-tray--leading {
  right: 100%;
  width: max(calc(var(--n, 1) * 76px), var(--swipe-x, 0px));
  flex-direction: row-reverse;
}
.swipe-tray--trailing {
  left: 100%;
  width: max(calc(var(--n, 1) * 76px), calc(var(--swipe-x, 0px) * -1));
}
.swipe-tray__action {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 76px;
  padding: 0 6px;
  border: 0;
  background: var(--tone-solid);
  color: var(--text-on-accent);
  font: inherit;
  font-size: var(--type-caption);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: flex-grow var(--dur-snappy) var(--spring-snappy);
}
.swipe-tray__action > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A full swipe: the first action takes the whole tray */
[data-swipe].is-swipe-full .swipe-tray__action:first-child {
  flex-grow: 100;
}
