/* Treatly — commitment rail on the home feed
 *
 * commit-feed.js has always rendered this section. Its stylesheet never
 * existed, so once the script was wired into index.html the whole rail painted
 * as raw text: bare spans, no card, no layout, a run of words down the page.
 * This is that stylesheet.
 *
 * Structure it renders:
 *   .cfeed            section wrapper
 *     .cfeed-hdr      title + New button
 *     .cfeed-list     the cards
 *       .cfeed-card   tile · body · treat (button) — built like a task card
 *         .cfeed-ico
 *         .cfeed-body   .cfeed-hd (.cfeed-task + .cfeed-day) · .cfeed-badges
 *                       · .cfeed-sub · .cfeed-tiles (one tile a day) · .cfeed-bar
 *         .cfeed-treat
 */

.cfeed {
  display: block;
  margin: 0 0 14px;
}

.cfeed-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 8px;
}
.cfeed-title {
  display: block;
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
}
.cfeed-sub-hdr {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t4);
  line-height: 1.35;
}
.cfeed-new {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-size: 12px;
  font-weight: 800;
  color: var(--t2);
  cursor: pointer;
  white-space: nowrap;
}

.cfeed-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* One card per running streak. The category tone comes in as a .ctone-* class
   from commitColorClass(), so the left edge and the bar match the commitment
   wherever else it appears. */
.cfeed-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ctone, var(--brand));
  box-shadow: var(--sh);
  overflow: hidden;
}
.cfeed-card.is-done-today {
  background: var(--ctone-bg, var(--brand-dim));
}

.cfeed-card { cursor: pointer; }
.cfeed-card:focus-visible {
  outline: 2px solid var(--ctone, var(--brand));
  outline-offset: 2px;
}

/* Same tile a task row leads with, so a commitment sitting in the same card
   reads as the same kind of object. */
.cfeed-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--ctone-bg, var(--s2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.cfeed-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-inline-size: 0;
}

.cfeed-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cfeed-task {
  min-width: 0;
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Which day of the run, in the same pill as the task-card strip. */
.cfeed-day {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ctone, var(--brand));
  color: var(--on-brand, #fff);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.cfeed-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cfeed-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--s2);
  border: 1px solid var(--border2);
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  white-space: nowrap;
}
.cfeed-badge--streak {
  background: var(--ctone-bg, var(--brand-dim));
  border-color: var(--ctone, var(--brand));
  color: var(--ctone, var(--brand));
}
.cfeed-badge--proof { color: var(--amber, #8a6a2f); }
.cfeed-badge--renew {
  color: var(--cal-renewed, #4E7FA8);
  border-color: var(--cal-renewed, #4E7FA8);
}
.cfeed-sub {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t3);
}

/* Last fortnight as blocks — the same four states the calendar uses, and the
   same colours, so a kept day looks kept wherever you see it. */


.cfeed-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--s3);
  overflow: hidden;
  margin-top: 2px;
}
.cfeed-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ctone, var(--brand));
}

.cfeed-treat {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1.5px solid var(--border2);
  background: var(--s2);
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}
.cfeed-treat span {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--t3);
  white-space: nowrap;
}
.cfeed-treat.has-treat {
  border-color: var(--ctone, var(--brand));
  background: var(--ctone-bg, var(--brand-dim));
}
.cfeed-treat.has-treat span { color: var(--ctone, var(--brand)); }
/* Your own run has nothing to send — the button is just the way in. */
.cfeed-treat--own {
  padding: 8px 11px;
  font-size: 18px;
  color: var(--t4);
  background: none;
  border-color: transparent;
}

/* ── Commitment on a task card ──────────────────────────────────────────────
   task-commit-card.js renders these and had no stylesheet either, so a task
   belonging to a commitment printed its streak, its progress and its treat
   button as a run of bare text under the task name. Two shapes: the full
   .tcommit block on an expanded card, and the one-line .tcommit-chip on the
   tight feed rows. Category tone arrives as a .ctone-* class. */
.tcommit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--ctone-bg, var(--s2));
  border-left: 3px solid var(--ctone, var(--brand));
}
.tcommit-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}
.tcommit-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.tcommit-title {
  min-width: 0;
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Which day of the run this card is — the fact the card was missing most, so
   it sits at the end of the title line where the eye lands. */
.tcommit-day {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ctone, var(--brand));
  color: var(--on-brand, #fff);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.tcommit-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  color: var(--t3);
}
.tcommit-sep { opacity: 0.5; }
.tcommit-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--s3);
  overflow: hidden;
  margin-top: 3px;
}
.tcommit-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ctone, var(--brand));
}
.tcommit-missed { color: var(--coral, #9d554e); }
.tcommit-renewed { color: var(--cal-renewed, #4E7FA8); }
.tcommit-tail {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--t4);
}
/* What the run actually is — cadence, one tap or a timer, proof, who else is
   in. Without these the card says "day 4 of 21" and nothing about what of. */
.tcommit-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.tcommit-fact {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border2);
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  white-space: nowrap;
}
.tcommit-treat {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--ctone, var(--brand));
  background: var(--surface);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

/* One line, for the tight rows. */
.tcommit-chip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 5px;
  min-width: 0;
}
.tcommit-chip-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ctone, var(--brand));
}
.tcommit-chip-name {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--t2);
}
.tcommit-chip-meta {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--t4);
  white-space: nowrap;
}
.tcommit-chip-treat {
  flex-shrink: 0;
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

/* ── Inside a person's card ─────────────────────────────────────────────────
   These cards used to be a rail of their own across the top of the feed, so
   they carried a full card treatment: surface, border, shadow, and an avatar
   saying whose streak it was. Sitting inside that person's own card, all of
   that is said already — the header names them and the card is the card. What
   is left is the streak itself. */
.person-feed-sec--commits .cfeed-list {
  gap: 7px;
}
/* A commitment sitting in a person's card is the same kind of object as the
   one-off lock-ins under it, so it is built to the same recipe: the category
   tint, a 1px edge in that category's ink, the lock-in engraving, and the same
   corner. The 3px tone bar down the left went with it — a task row does not
   have one, and it was the loudest thing telling you these were two different
   things. The tone still shows, in the fill.

   Tints match the task-row set in css/social-elevate.css (the saturated block
   near the end of that file, not the pale one earlier). Commitments name their
   categories differently to tasks — study/fitness/wellness/creative/kindness/
   health against study/workout/reading/wellness/creative/challenge — so the
   hook is the .ctone-* class commitColorClass() already puts on the card. */
.person-feed-sec--commits .cfeed-card {
  padding: 11px 12px;
  gap: 10px;
  border-radius: var(--soc-task-r, 10px);
  border: 1px solid var(--soc-border, var(--border));
  box-shadow: var(--soc-lockin-recess, var(--soc-nested-recess, var(--soc-task-recess)));
  background: var(--soc-sunken, var(--s2));
}
.person-feed-sec--commits .cfeed-card.ctone-blue   { background: #dce4f2; border-color: rgba(54,72,110,.45); }
.person-feed-sec--commits .cfeed-card.ctone-teal   { background: #cfe8e5; border-color: rgba(49,99,93,.45); }
.person-feed-sec--commits .cfeed-card.ctone-green,
.friend-row.ctone-green                            { background: #d6ecdf; border-color: rgba(45,91,67,.45); }
.person-feed-sec--commits .cfeed-card.ctone-purple { background: #e4dcf2; border-color: rgba(78,54,110,.45); }
.person-feed-sec--commits .cfeed-card.ctone-amber  { background: #f2e7d4; border-color: rgba(120,88,36,.42); }
.person-feed-sec--commits .cfeed-card.ctone-coral,
.friend-row.ctone-coral                            { background: #f4dedd; border-color: rgba(150,66,62,.42); }

/* Kept today reads the way a finished lock-in reads, not as a stronger tint. */
.person-feed-sec--commits .cfeed-card.is-done-today,
.person-feed-sec--commits .cfeed-card.ctone-blue.is-done-today,
.person-feed-sec--commits .cfeed-card.ctone-teal.is-done-today,
.person-feed-sec--commits .cfeed-card.ctone-green.is-done-today,
.person-feed-sec--commits .cfeed-card.ctone-purple.is-done-today,
.person-feed-sec--commits .cfeed-card.ctone-amber.is-done-today,
.person-feed-sec--commits .cfeed-card.ctone-coral.is-done-today {
  background: rgba(45,91,67,.06);
  border-color: var(--soc-border, var(--border));
}

[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-blue   { background: #252c3a; }
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-teal   { background: #1f3230; }
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-green,
[data-theme="dark"] .friend-row.ctone-green                            { background: #1f3129; }
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-purple { background: #2b2537; }
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-amber  { background: #332c22; }
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-coral,
[data-theme="dark"] .friend-row.ctone-coral                            { background: #3a2726; }
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.is-done-today,
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-blue.is-done-today,
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-teal.is-done-today,
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-green.is-done-today,
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-purple.is-done-today,
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-coral.is-done-today,
[data-theme="dark"] .person-feed-sec--commits .cfeed-card.ctone-amber.is-done-today {
  background: rgba(45,91,67,.12);
}
.person-feed-sec--commits .cfeed-ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  /* --ctone-bg is the global tint, mixed for a white card. On the tinted card
     it went almost invisible, while a task row's tile is the category ink at
     15%. Same ink, same 15%. */
  background: var(--soc-sunken, var(--s2));
}
.person-feed-sec--commits .ctone-blue   .cfeed-ico { background: rgba(54,72,110,.15); }
.person-feed-sec--commits .ctone-teal   .cfeed-ico { background: rgba(49,99,93,.15); }
.person-feed-sec--commits .ctone-green  .cfeed-ico { background: rgba(45,91,67,.15); }
.person-feed-sec--commits .ctone-purple .cfeed-ico { background: rgba(78,54,110,.15); }
.person-feed-sec--commits .ctone-amber  .cfeed-ico { background: rgba(120,88,36,.15); }
.person-feed-sec--commits .ctone-coral  .cfeed-ico { background: rgba(150,66,62,.15); }
[data-theme="dark"] .person-feed-sec--commits .cfeed-ico { background: rgba(255,255,255,.07); }
.person-feed-sec--commits .cfeed-task {
  font-size: 13.5px;
}
/* Inside a feed card the tiles run a little smaller. */
.person-feed-sec--commits .cfeed-tile {
  width: 27px;
  height: 31px;
  border-radius: 8px;
}
.person-feed-sec--commits .cfeed-treat {
  padding: 6px 8px;
  font-size: 13px;
}

/* Nested in a person card the badges stay, but quieter — they are reference,
   not the headline. */
.person-feed-sec--commits .cfeed-badge {
  font-size: 9.5px;
  padding: 2px 6px;
}
.person-feed-sec--commits .cfeed-ico {
  width: 38px;
  height: 38px;
  font-size: 19px;
}


/* ── today's check, on the card ─────────────────────────────────────────────
   The card reported a run and gave no way to move it on: your own showed a "›"
   that opened the detail, and counting a day meant going inside. This is the
   run's own colour — an empty ring until the day is counted, filled once it
   is. A run that wants several a day carries the count instead of a tick. */
.cfeed-check{
  flex:0 0 auto;
  align-self:center;
  display:flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  margin-right:2px;
  padding:0;
  border-radius:50%;
  border:2px solid var(--ctone,var(--brand));
  background:transparent;
  color:transparent;
  cursor:pointer;
  transition:background-color .16s ease,color .16s ease,transform .12s ease;
}
.cfeed-check:hover{background:color-mix(in srgb,var(--ctone,var(--brand)) 15%,transparent);}
.cfeed-check:active{transform:scale(.9);}
.cfeed-check:focus-visible{outline:2px solid var(--ctone,var(--brand));outline-offset:2px;}
.cfeed-check.is-done{
  background:var(--ctone,var(--brand));
  border-color:var(--ctone,var(--brand));
  color:var(--on-brand,#fff);
}
.cfeed-check svg{display:block;}
.cfeed-check-n{
  font-family:var(--font-display,"Plus Jakarta Sans",sans-serif);
  font-size:11px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  line-height:1;
  color:var(--ctone,var(--brand));
}
@media (prefers-reduced-motion:reduce){
  .cfeed-check{transition:none;}
}


/* ── the run, one tile a day ────────────────────────────────────────────────
   These were flat blocks of colour and a missed day was a solid red bar —
   a lot of shouting for a day you did not get to. Each day is a tile that says
   what happened on it: a tick kept, a cross missed, an open ring for today, a
   faint outline for a day still ahead. The colour is a tint behind the mark
   rather than the whole block, and the date sits under it so a run can be read
   rather than only counted. */
.cfeed-tiles{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:8px;
}
.cfeed-tile{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  width:30px;
  height:34px;
  border-radius:9px;
  background:var(--s2);
  box-shadow:inset 0 0 0 1px var(--border);
  color:var(--t4);
  transition:transform .12s ease;
}
.cfeed-tile:hover{transform:translateY(-1px);}
.cfeed-tile-mark{
  display:flex;
  align-items:center;
  justify-content:center;
  width:14px;
  height:14px;
}
.cfeed-tile-mark svg{width:14px;height:14px;display:block;}
.cfeed-tile-mark i{font-style:normal;font-size:11px;line-height:1;}
.cfeed-tile-day{
  font-family:var(--font-display,"Plus Jakarta Sans",sans-serif);
  font-size:9px;
  font-weight:800;
  line-height:1;
  font-variant-numeric:tabular-nums;
  opacity:.75;
}

/* Kept — the run's own colour, as a tint with the tick full strength. */
.cfeed-tile.is-done{
  background:color-mix(in srgb,var(--ctone,var(--brand)) 16%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ctone,var(--brand)) 38%,transparent);
  color:var(--ctone,var(--brand));
}
/* Waiting on proof — kept, but not signed off. */
.cfeed-tile.is-proof,
.cfeed-tile.is-partial{
  background:color-mix(in srgb,var(--cal-proof,#C98A16) 15%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--cal-proof,#C98A16) 40%,transparent);
  color:var(--cal-proof,#C98A16);
}
/* Missed — a cross, not a red slab. The mark carries it; the tile stays quiet. */
.cfeed-tile.is-missed{
  background:transparent;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--cal-missed,#C2413C) 34%,transparent);
  color:color-mix(in srgb,var(--cal-missed,#C2413C) 78%,transparent);
}
/* Covered by a renew gift. */
.cfeed-tile.is-renewed{
  background:color-mix(in srgb,var(--cal-renewed,#4E7FA8) 15%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--cal-renewed,#4E7FA8) 40%,transparent);
  color:var(--cal-renewed,#4E7FA8);
}
/* Still ahead — barely there. */
.cfeed-tile.is-ahead,
.cfeed-tile.is-off{
  background:transparent;
  box-shadow:inset 0 0 0 1px var(--border);
  opacity:.55;
}
/* Today: still open, and ringed so it is obvious which one is yours to do. */
.cfeed-tile.is-today{
  box-shadow:inset 0 0 0 2px var(--ctone,var(--brand));
}
.cfeed-tile.is-today.is-open,
.cfeed-tile.is-open{
  background:transparent;
  color:var(--ctone,var(--brand));
}
/* A day with a treat hung on it carries it in the corner. */
.cfeed-tile-gift{
  position:absolute;
  top:-4px;
  right:-3px;
  font-style:normal;
  font-size:10px;
  line-height:1;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
@media (prefers-reduced-motion:reduce){
  .cfeed-tile{transition:none;}
}
