/* ============================================================
   SOCIAL — Badges, People and Shared Lists
   The LEDGER look again: the same page, header and cards. Additions are the badge
   tiles, person rows with a round initial, and shared-list items with a checkbox.
   ============================================================ */
.soc-page { max-width: 1040px; } /* the standard page width (Rules, Things, Routines) */
.soc-page.soc-narrow { max-width: 560px; }
.soc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.soc-main { min-width: 0; }
.soc-side { top: 16px; }
.soc-side-hint { margin: 0; padding: 4px 16px 14px; color: var(--text-3); font-size: var(--fs-11); line-height: 1.5; }
.soc-side-hint a, .soc-setup-text a { color: var(--text-1); }
@media (max-width: 820px) {
  .soc-layout { grid-template-columns: minmax(0, 1fr); }
  .soc-side { position: static; }
}
.soc-tally { color: var(--text-3); font-size: var(--fs-12); }
.soc-tally strong { color: var(--text-1); font-size: var(--fs-16); font-variant-numeric: tabular-nums; }
.soc-inline { display: inline; margin: 0; }

/* Buttons: the settings page's three weights, plus a quiet one for row actions. */
.soc-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-1);
  font-family: inherit; font-size: var(--fs-12); font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.soc-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.soc-btn i { font-size: var(--fs-11); }
.soc-btn.is-primary { border-color: transparent; background: var(--accent); color: #04140a; font-weight: 600; }
.soc-btn.is-primary:hover { background: var(--accent-bright); }
.soc-btn.is-quiet:hover { color: var(--text-1); }
.soc-btn.is-danger { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); color: var(--danger-bright); }
.soc-btn.is-danger:hover { border-color: var(--danger); background: rgba(239, 68, 68, 0.18); }
.soc-state { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-12); }

.soc-input {
  box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-1); font-family: inherit; font-size: var(--fs-13);
  transition: border-color var(--dur-fast) ease;
}
textarea.soc-input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.soc-input:focus { outline: none; border-color: var(--border-strong); }
.soc-input::placeholder { color: var(--text-3); }
.soc-input[type="date"] { color-scheme: dark; }
.soc-select { width: auto; max-width: 180px; }

.soc-callout {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 16px;
  border: 1px solid rgba(234, 179, 8, 0.35); border-radius: var(--radius-lg); color: var(--gold-bright); font-size: var(--fs-13); font-weight: 500;
}

/* Badges: the ascent — 30 medallions, five climbs of six. Each sits on the page itself:
   lost in fog while locked, ringed in its group's colour as it gets under way, engraved
   in gold once unlocked — with its details in a popover on hover or tap. */
.soc-badge[data-group="tasks"],   .soc-group[data-group="tasks"]   { --group-color: #4d9fff; }
.soc-badge[data-group="journal"], .soc-group[data-group="journal"] { --group-color: #a78bfa; }
.soc-badge[data-group="writing"], .soc-group[data-group="writing"] { --group-color: #2dd4bf; }
.soc-badge[data-group="life"],    .soc-group[data-group="life"]    { --group-color: #fb923c; }
.soc-badge[data-group="apex"],    .soc-group[data-group="apex"]    { --group-color: #22c55e; }

/* The page's tally: a ring of everything unlocked, and the badge closest to unlocking. */
.soc-summary { display: flex; align-items: center; gap: 18px; margin: 4px 0 30px; }
.soc-summary-ring { position: relative; display: grid; flex-shrink: 0; place-items: center; width: 84px; height: 84px; }
.soc-summary-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p, 0) * 1%), var(--surface-3) 0);
  -webkit-mask: radial-gradient(circle, transparent 0 35px, #000 36px); mask: radial-gradient(circle, transparent 0 35px, #000 36px);
}
.soc-summary-pct { color: var(--text-1); font-size: var(--fs-22); font-weight: 600; font-variant-numeric: tabular-nums; }
.soc-summary-pct small { margin-left: 1px; color: var(--text-3); font-size: var(--fs-12); font-weight: 500; }
.soc-summary-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.soc-summary .soc-tally { font-size: var(--fs-14); }
.soc-summary .soc-tally strong { font-size: var(--fs-24); }
.soc-summary-next { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.soc-summary-next a { color: var(--text-1); text-decoration: none; }
.soc-summary-next a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }

/* A group: a heading and a hairline, no panel. */
.soc-group { margin-bottom: 30px; }
.soc-group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-panel);
}
.soc-group-title {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  color: var(--text-2); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.soc-group-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--group-color); }
.soc-group-count { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }

/* Always six across, three on a phone: every group is six, so no row is ever ragged. */
.soc-badges { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 6px; padding: 16px; }
.soc-group .soc-badges { padding: 0; }
.soc-badge {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 4px 2px; border-radius: var(--radius-md); outline: none; text-align: center; cursor: default;
}
.soc-badge:focus-visible { box-shadow: 0 0 0 1.5px var(--border-strong); }
/* The ring: a conic fill to --p percent, the icon disc sitting in its middle. */
.soc-badge-medal {
  position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  transition: transform var(--dur-fast, 0.15s) ease;
}
.soc-badge-icon {
  position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--surface-2); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  /* Locked: lost in fog. */
  color: #4a4a52;
}
.soc-badge-icon svg { position: relative; z-index: 1; width: 36px; height: 36px; }
/* Locked: fogged past recognising — something's up there, but not what. */
.soc-badge:not(.is-unlocked) .soc-badge-icon svg { filter: blur(4.5px); opacity: 0.55; }
/* Under way: a faint track for the ring to fill in the group's colour. */
.soc-badge.is-started .soc-badge-medal {
  background: conic-gradient(var(--group-color, var(--text-3)) calc(var(--p, 0) * 1%), var(--surface-3) 0);
}
.soc-badge-name { color: var(--text-3); font-size: var(--fs-12); font-weight: 500; line-height: 1.3; text-wrap: balance; }
.soc-badge:not(.is-unlocked) .soc-badge-name { letter-spacing: 0.15em; opacity: 0.6; }
.soc-badge.is-unlocked .soc-badge-medal { background: none; }
.soc-badge.is-unlocked .soc-badge-icon {
  width: 64px; height: 64px; color: #3b2a00;
  background: radial-gradient(circle at 35% 30%, #fde68a, var(--gold) 70%);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15), 0 0 22px rgba(234, 179, 8, 0.22);
}
/* Engraved: a highlight under the emblem's edge, as if cut into the gold. */
.soc-badge.is-unlocked .soc-badge-icon svg { width: 40px; height: 40px; filter: drop-shadow(0 1px 0 rgba(255, 244, 200, 0.55)); }
.soc-badge.is-unlocked .soc-badge-name { color: var(--text-1); font-weight: 600; }
.soc-badge:hover .soc-badge-medal, .soc-badge:focus-visible .soc-badge-medal { transform: translateY(-2px); }

/* The popover: what it's for, and when it was earned or how far along it is. */
.soc-badge-pop {
  position: absolute; bottom: calc(100% - 2px); left: 50%; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: max-content; max-width: 180px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-pop); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 4px);
  transition: opacity var(--dur-fast, 0.15s) ease, transform var(--dur-fast, 0.15s) ease, visibility var(--dur-fast, 0.15s);
}
.soc-badge:hover .soc-badge-pop, .soc-badge:focus .soc-badge-pop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.soc-badge-emblem { color: var(--gold-bright); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.soc-badge-desc { color: var(--text-1); font-size: var(--fs-12); line-height: 1.35; text-wrap: balance; }
.soc-badge-when { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.soc-badge-count { color: var(--group-color, var(--text-3)); font-size: var(--fs-11); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Just earned: the big reveal. The fog lifts off the gold, the medallion pops, a ring
   bursts out from it, and a light sweeps across. */
.soc-badge.is-new .soc-badge-icon::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--surface-2);
  animation: soc-reveal-cover 0.9s ease-out 0.5s both;
}
.soc-badge.is-new .soc-badge-icon svg { animation: soc-reveal-art 0.9s ease-out 0.5s both; }
.soc-badge.is-new .soc-badge-medal { animation: soc-reveal-pop 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) 0.5s both; }
.soc-badge.is-new .soc-badge-medal::after {
  content: ""; position: absolute; inset: 0; border: 2px solid var(--gold-bright); border-radius: 50%;
  opacity: 0; animation: soc-reveal-burst 1s ease-out 1s;
}
.soc-badge.is-new .soc-badge-icon { overflow: hidden; }
.soc-badge.is-new .soc-badge-icon::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
  transform: translateX(-120%); animation: soc-reveal-shine 1s ease-in-out 1.3s;
}
.soc-badge.is-new .soc-badge-name { animation: soc-reveal-name 0.6s ease-out 1s both; }
@keyframes soc-reveal-cover { from { opacity: 1; } to { opacity: 0; } }
@keyframes soc-reveal-art { from { color: #4a4a52; filter: blur(4.5px); opacity: 0.55; } }
@keyframes soc-reveal-pop { 0% { transform: scale(0.82); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes soc-reveal-burst { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
@keyframes soc-reveal-shine { to { transform: translateX(120%); } }
@keyframes soc-reveal-name { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .soc-badge.is-new .soc-badge-icon::before { display: none; }
  .soc-badge.is-new .soc-badge-icon svg, .soc-badge.is-new .soc-badge-medal, .soc-badge.is-new .soc-badge-medal::after,
  .soc-badge.is-new .soc-badge-icon::after, .soc-badge.is-new .soc-badge-name { animation: none; }
  .soc-badge-medal, .soc-badge-pop { transition: none; }
}

.soc-credit { margin: 4px 0 0; color: var(--text-3); font-size: var(--fs-11); opacity: 0.8; }
.soc-credit a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }

/* The scoreboard beside them, toned down to match: a hairline card, no stripe or sheen. */
.soc-board-card { border-left-width: 1px; border-left-color: var(--border-panel); background-image: none; box-shadow: none; }

/* Scoreboard. */
/* Up to 51 rows (the top 50, and you further down), so the list scrolls inside the card
   rather than running the sticky sidebar off the bottom of the screen. */
.soc-score {
  max-height: min(520px, calc(100vh - 200px)); margin: 0; padding: 6px 0; overflow-y: auto;
  overscroll-behavior: contain; list-style: none; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
@media (max-width: 820px) { .soc-score { max-height: 480px; } }
.soc-score-row { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 16px; }
/* Your own row stays in sight while the list scrolls: pinned to the top or bottom edge
   when it would scroll away. Painted solid, the tint over the card's own surface, so the
   rows passing underneath don't show through. */
.soc-score-row.is-you {
  position: sticky; top: 0; bottom: 0; z-index: 1;
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-card);
}
.soc-score-rank { color: var(--text-3); font-size: var(--fs-11); text-align: right; font-variant-numeric: tabular-nums; }
.soc-score-name { overflow: hidden; font-size: var(--fs-13); text-overflow: ellipsis; white-space: nowrap; }
.soc-score-count { color: var(--gold-bright); font-size: var(--fs-13); font-weight: 600; font-variant-numeric: tabular-nums; }

/* People. */
.soc-avatar {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 50%;
  background: hsl(var(--soc-hue) 45% 30%); color: hsl(var(--soc-hue) 80% 88%); font-weight: 600; line-height: 1;
}
/* A predator (Pseudonym) where no icon was picked: game-icons art, drawn a little larger
   than a glyph since it fills its square edge to edge less. */
.soc-avatar > svg { width: 66%; height: 66%; }
.soc-people { margin: 0; padding: 4px 0; list-style: none; }
.soc-person { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid rgba(255, 255, 255, 0.035); }
.soc-person:first-child { border-top-color: transparent; }
.soc-people.is-compact .soc-person { gap: 10px; padding: 7px 14px; }
.soc-person-body { flex: 1; }
.soc-person-name { overflow: hidden; color: var(--text-1); font-size: var(--fs-13); font-weight: 500; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
a.soc-person-name:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
/* A name or avatar that opens the person's profile (SocialHelper#profile_link): reads as
   the text around it, underlined on hover. */
a.profile-link { text-decoration: none; }
a.profile-link:not(.ledger-tag) { color: inherit; }
a.profile-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a.profile-link:has(> .soc-avatar:only-child):hover { text-decoration: none; }
a.profile-link > .soc-avatar:only-child { transition: box-shadow var(--dur-fast) ease; }
a.profile-link:hover > .soc-avatar:only-child { box-shadow: 0 0 0 1.5px var(--accent); }
.soc-person-actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }

.soc-search { position: relative; display: flex; gap: 8px; margin-bottom: 14px; }
.soc-search-icon { position: absolute; top: 50%; left: 12px; color: var(--text-3); font-size: var(--fs-12); transform: translateY(-50%); pointer-events: none; }
.soc-search .soc-search-icon + .soc-input { padding-left: 32px; }
.soc-setup .soc-search { margin: 0; padding: 0 16px 16px; }
.soc-setup-text { margin: 0; padding: 12px 16px; color: var(--text-2); font-size: var(--fs-12); line-height: 1.5; }

.soc-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 18px; }
.soc-profile-body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.soc-profile-name { margin: 0; color: var(--text-1); font-size: var(--fs-22); font-weight: 600; letter-spacing: -0.015em; }
.soc-profile-tally { margin-top: 4px; color: var(--text-3); font-size: var(--fs-12); }
.soc-profile-tally strong { color: var(--gold-bright); }
.soc-profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Shared lists. */
.soc-lists { margin: 0; padding: 4px 0; list-style: none; }
.soc-list-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid rgba(255, 255, 255, 0.035); color: inherit; text-decoration: none; }
.soc-lists li:first-child .soc-list-row { border-top-color: transparent; }
@media (hover: hover) { .soc-list-row:hover { background: rgba(255, 255, 255, 0.025); } }
.soc-list-body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.soc-list-name { color: var(--text-1); font-size: var(--fs-14); font-weight: 500; }
.soc-list-meta { color: var(--text-3); font-size: var(--fs-12); }
.soc-list-desc { margin: -8px 0 16px; color: var(--text-2); font-size: var(--fs-13); line-height: 1.5; }
.soc-stack { display: flex; flex-shrink: 0; }
.soc-stack .soc-avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface-card); }

.soc-tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.soc-tab { padding: 4px 10px; border-radius: var(--radius-xs); color: var(--text-3); font-size: var(--fs-12); text-decoration: none; }
.soc-tab:hover { color: var(--text-1); }
.soc-tab.is-active { background: var(--surface-3); color: var(--text-1); }

.soc-add { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.035); align-items: center; }
.soc-add-title { flex: 1 1 220px; }

.soc-add-member { display: flex; gap: 8px; padding: 6px 14px 14px; }
.thing-share-panel .soc-add-member { padding: 0 0 10px; }
.thing-share-panel .soc-side-hint { padding-left: 0; padding-right: 0; }
.soc-add-member .soc-select { flex: 1; max-width: none; }

.soc-items { margin: 0; padding: 4px 0; list-style: none; }
.soc-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, 0.035); }
.soc-item:first-child { border-top-color: transparent; }
@media (hover: hover) { .soc-item:hover { background: rgba(255, 255, 255, 0.02); } }
.soc-check {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; padding: 0;
  border: 1.5px solid var(--border-strong); border-radius: 50%; background: none; color: #04140a; font-size: 10px; cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.soc-check:hover { border-color: var(--accent); }
.soc-check.is-checked { border-color: var(--accent); background: var(--accent); }
.soc-item-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.soc-item-title { color: var(--text-1); font-size: var(--fs-14); line-height: 1.35; overflow-wrap: anywhere; }
.soc-item-notes { color: var(--text-3); font-size: var(--fs-12); line-height: 1.45; white-space: pre-line; }
.soc-item-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.soc-item.is-done .soc-item-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.soc-item-actions { display: flex; flex-shrink: 0; gap: 2px; }
.soc-item-actions .ledger-action { opacity: 0; }
.soc-item:hover .soc-item-actions .ledger-action, .soc-item-actions .ledger-action:focus-visible { opacity: 1; }
@media (hover: none) { .soc-item-actions .ledger-action { opacity: 1; } }
.soc-assignee .soc-avatar { font-size: 8px !important; }
.soc-assignee.is-you { background: var(--accent-soft); color: var(--accent-bright); }
.ledger-tag.soc-overdue { background: rgba(239, 68, 68, 0.12); color: var(--danger-bright); }

/* "Assigned to others" (calendars/_assigned_to_others): what you've handed to others. Not
   task rows — they aren't yours to file — so a plain list on the card's surface. */
.shared-tasks-list { margin: 0; padding: 0 0 8px; list-style: none; background: var(--surface-row); }
[id^="assigned-to-others-"] { background: var(--surface-row); }
.shared-tasks-subhead {
  padding: 10px 14px 4px; border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.shared-task a.shared-task-title { text-decoration: none; }
.shared-task a.shared-task-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.shared-task { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid rgba(255, 255, 255, 0.035); }
.shared-task .soc-check { margin-top: 0; }
.shared-task-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.shared-task-title { color: var(--text-1); font-size: var(--fs-14); line-height: 1.35; overflow-wrap: anywhere; }
.shared-task-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.shared-task.is-done .shared-task-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.shared-task:target { background: rgba(99, 102, 241, 0.1); }
/* On the owner's own row (tasks/_task_row): the people a task is shared with. */
.task-share-chip { display: inline-flex; margin-left: 0.4rem; vertical-align: middle; align-items: center; gap: 0; }

/* "Assign to…" in a task row's hover toolbar, under the calendar (task_assign.js), and the
   panel it opens. The panel is lifted to <body> while open, so it's styled on its own
   rather than through the row. */
.task-row .assign-anchor,
.subtask-inline-row .assign-anchor { display: flex; justify-content: center; margin-bottom: 0.25rem; }
.task-row .assign-dropdown-toggle,
.subtask-inline-row .assign-dropdown-toggle {
  padding: 0; border: none; background: none; color: var(--text-3); font: inherit; line-height: 1; cursor: pointer;
  /* Optical nudge: the person-plus glyph is wider on its right, so it sits 2px left of the calendar above. */
  position: relative; left: 2px;
}
.task-row .assign-dropdown-toggle:hover,
.subtask-inline-row .assign-dropdown-toggle:hover { color: #818cf8; }
.subtask-inline-row .assign-dropdown-toggle { color: #666; font-size: var(--fs-12); }
.assign-dropdown { display: none; }
.assign-dropdown.is-open {
  display: block; z-index: 600; width: 260px; padding: 10px 0 8px;
  border: 1px solid #444; border-radius: 10px; background: #1e1e1e; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
.assign-menu-head { padding: 0 12px 6px; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.assign-menu-note { margin: 0; padding: 2px 12px 6px; color: var(--text-2); font-size: var(--fs-12); line-height: 1.45; }
.assign-menu-note.is-error { color: var(--danger-bright); }
.assign-menu-note a { color: var(--text-1); }
.assign-menu-list { max-height: 260px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.assign-menu-person { display: flex; align-items: center; gap: 8px; padding: 5px 12px; }
.assign-menu-person .soc-avatar { flex-shrink: 0; font-size: 9px !important; }
.assign-menu-name { flex: 1; min-width: 0; overflow: hidden; color: var(--text-1); font-size: var(--fs-13); text-overflow: ellipsis; white-space: nowrap; }
.assign-menu-state { color: var(--text-3); font-size: var(--fs-11); }
.assign-menu-state.is-accepted, .assign-menu-state.is-done { color: var(--accent-bright); }
.assign-menu-assign { height: 24px; padding: 0 10px; font-size: var(--fs-12); }
.assign-menu-remove { padding: 2px 4px; border: none; background: none; color: var(--text-3); cursor: pointer; }
.assign-menu-remove:hover { color: var(--danger-bright); }

/* The assigned count in a category header's corner (SocialHelper#category_assign_badge):
   stacked avatars of who has them, and how many. The Shared header and a subcategory's
   header row carry it at their far end too. */
.category-assign-slot:empty { display: none; }

/* "Assigned to others" rows for your own tasks (calendars/_assigned_to_others): a status
   mark rather than a checkbox — ticking is the other person's — and a take-back × by
   each person. */
.assigned-status { display: inline-flex; flex-shrink: 0; justify-content: center; width: 18px; color: var(--text-3); font-size: var(--fs-13); }
.assigned-row.is-accepted .assigned-status { color: #818cf8; }
.assigned-row.is-done .assigned-status { color: var(--accent); }
.assigned-person { display: inline-flex; align-items: center; }
.assigned-person .soc-assignee.is-pending { opacity: 0.55; }
.assigned-person .soc-assignee.is-accepted, .assigned-person .soc-assignee.is-done { background: var(--accent-soft); color: var(--accent-bright); }
.assigned-accepted-mark { font-size: 9px; }
.assigned-take-back { padding: 0 3px; border: none; background: none; color: var(--text-3); font-size: 10px; cursor: pointer; opacity: 0; }
.assigned-row:hover .assigned-take-back, .assigned-take-back:focus-visible { opacity: 1; }
.assigned-empty { margin: 0; padding: 10px 14px; color: var(--text-3); font-size: var(--fs-12); }
/* Your own category for an assigned task: a quiet tag that's a select. */
.assigned-filing { display: inline-flex; margin: 0; }
.assigned-filing-tag { gap: 4px; cursor: pointer; }
.assigned-filing-select { field-sizing: content; max-width: 140px; padding: 0; border: none; background: none; color: inherit; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; text-overflow: ellipsis; }
.assigned-filing-select:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.assigned-filing-select option { background: var(--surface-2, #1c1c22); color: var(--text-1); }
.assigned-take-back:hover { color: var(--danger-bright); }
@media (hover: none) { .assigned-take-back { opacity: 0.7; } }
.category-header > .category-assign-slot,
.inbox-header > .category-assign-slot,
.subcategory-header .category-assign-slot { position: absolute; top: 50%; right: 12px; z-index: 3; transform: translateY(-50%); }
/* Kept quiet — muted text and small faces, no pill — and only brought up on hover. */
.category-assign-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px 2px 2px;
  border: none; border-radius: 999px; background: none;
  color: var(--text-3); font-size: var(--fs-11); font-weight: 500; letter-spacing: 0; white-space: nowrap; cursor: default;
  opacity: 0.7; transition: opacity 150ms ease, color 150ms ease, background-color 150ms ease;
  animation: category-assign-in 220ms ease-out;
}
.category-header:hover .category-assign-badge,
.inbox-header:hover .category-assign-badge,
.subcategory-header:hover .category-assign-badge,
.category-assign-badge:focus-visible { opacity: 1; }
button.category-assign-badge { font-family: inherit; cursor: pointer; }
button.category-assign-badge:hover { color: var(--text-2); background: rgba(255, 255, 255, 0.06); }
/* The Inbox badge's panel: "Assigned to others", on the panel's own surface. */
.assigned-dropdown.is-open { width: 380px; max-height: min(420px, 70vh); padding: 4px 0; overflow-y: auto; }
.assigned-dropdown [id^="assigned-to-others-"], .assigned-dropdown .shared-tasks-list { background: none; }
.assigned-dropdown .shared-tasks-subhead { border-top: none; }
.category-assign-avatars { display: inline-flex; }
.category-assign-avatars > * + * { margin-left: -6px; }
.category-assign-avatars .soc-avatar { width: 16px !important; height: 16px !important; font-size: 7px !important; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.45); }
.category-assign-more { display: inline-flex; align-items: center; margin-left: 2px; color: var(--text-3); font-size: 10px; }
@keyframes category-assign-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .category-assign-badge { animation: none; } }
.task-share-chip > a + a, .task-share-chip > span + span { margin-left: -4px; }
.task-share-list { margin-right: 6px; color: #818cf8; font-size: var(--fs-11); text-decoration: none; }
.task-share-chip .soc-avatar { font-size: 8px !important; box-shadow: 0 0 0 1.5px var(--surface-row); }
.task-share-chip .is-pending { opacity: 0.45; }
.task-share-chip .is-accepted .soc-avatar { box-shadow: 0 0 0 1.5px var(--accent); }
/* Your copy of a task someone assigned you, until you file it (SocialHelper#incoming_task_chip):
   who it's from, spelled out, and a × to decline. */
.task-share-chip.is-incoming {
  gap: 2px; padding: 1px 1px 1px 2px; border: 1px solid rgba(129, 140, 248, 0.4); border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
}
.task-share-chip.is-incoming .soc-avatar { box-shadow: none; }
.task-incoming-from {
  display: inline-flex; align-items: center; gap: 5px; padding-right: 2px;
  color: #c7d2fe; font-size: var(--fs-11); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.task-incoming-decline { padding: 0 5px; border: none; background: none; color: #a5b4fc; font-size: 10px; line-height: 1; cursor: pointer; }
.task-incoming-decline:hover { color: var(--danger-bright); }
.ledger-tag.soc-overdue i { color: inherit; }

/* Assigning, beyond the basics: the note sent with it and the reminder bell in the
   "Assign to" panel (task_memberships/_menu, _nudge_button), whether one or everyone must
   finish (_mode_switch), and the message count on a shared task's row. */
.assign-menu-note-form { padding: 0 12px 8px; }
.assign-menu-note-input {
  width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid #3a3a3a; border-radius: 6px;
  background: #161616; color: var(--text-1); font: inherit; font-size: var(--fs-12);
}
.assign-menu-note-input:focus { border-color: rgba(129, 140, 248, 0.6); outline: none; }
.assign-menu-nudge, .assigned-nudge, .soc-nudge { border: none; background: none; color: var(--text-3); cursor: pointer; }
.assign-menu-nudge { padding: 2px 4px; }
.assigned-nudge { padding: 0 3px; font-size: 10px; opacity: 0; }
.assigned-row:hover .assigned-nudge, .assigned-nudge:focus-visible { opacity: 1; }
@media (hover: none) { .assigned-nudge { opacity: 0.7; } }
.assign-menu-nudge:hover, .assigned-nudge:hover, .soc-nudge:hover { color: #fbbf24; }
.assign-menu-nudge.is-spent, .assigned-nudge.is-spent, .soc-nudge.is-spent { cursor: default; opacity: 0.35; }
.assigned-row:hover .assigned-nudge.is-spent { opacity: 0.35; }
.assign-menu-state.is-done { color: var(--accent-bright); }
.soc-state.is-accepted, .soc-state.is-done { color: var(--accent-bright); }
.assign-mode { display: flex; gap: 4px; margin: 6px 12px 2px; padding: 3px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.show-card-body > .assign-mode { margin: 4px 14px 10px; }
.assign-mode .soc-inline { display: flex; flex: 1; }
.assign-mode-option {
  flex: 1; padding: 4px 6px; border: none; border-radius: 6px; background: none;
  color: var(--text-3); font: inherit; font-size: var(--fs-11); text-align: center; cursor: pointer;
}
.assign-mode-option:hover { color: var(--text-1); }
.assign-mode-option.is-current { background: rgba(99, 102, 241, 0.22); color: #c7d2fe; font-weight: 600; cursor: default; }
.soc-add-member.is-with-note { flex-wrap: wrap; }
.soc-add-member.is-with-note > .soc-input:not(.soc-select) { flex: 1 1 100%; order: 3; }
.task-share-comments {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  color: #a5b4fc; font-size: var(--fs-11); text-decoration: none;
}
.task-share-chip.is-incoming .task-share-comments { margin-left: 2px; }
.assigned-all-link {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 6px 14px 8px;
  color: var(--text-3); font-size: var(--fs-12); text-decoration: none;
}
.assigned-all-link:hover { color: var(--text-1); }
.assigned-all-link i { font-size: 10px; }

/* The task page's sharing cards, wrapped so a live update can redraw them
   (tasks/_share_panel) — the wrapper takes no part in the page's layout. */
#task-sharing { display: contents; }
/* The page's live-update subscription (layouts/application): no box of its own. */
turbo-cable-stream-source { display: none; }

/* A new date someone suggested, under their row (task_memberships/_proposal). */
.assign-proposal {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 8px 46px; padding: 6px 10px;
  border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 8px; background: rgba(251, 191, 36, 0.08);
  color: var(--text-2); font-size: var(--fs-12); list-style: none;
}
.assign-proposal > i { color: #fbbf24; }
.assign-proposal-text { flex: 1; }
.assign-proposal-text strong { color: var(--text-1); }
.ledger-tag.assigned-proposal { background: rgba(251, 191, 36, 0.12); color: #fcd34d; text-decoration: none; }

/* An unfiled task someone handed you (SocialHelper#incoming_assignment?): an indigo edge,
   never dimmed, until you file it. */
tr.task-row.is-incoming-assignment > td:first-child { box-shadow: inset 3px 0 0 #818cf8; }
.task-incoming-list {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 6px 0 4px;
  color: #a5b4fc; font-size: var(--fs-11); text-decoration: none; white-space: nowrap;
}
.task-share-comments.is-complete { color: var(--accent-bright); }

/* A shared task's checklist, ticked in common (tasks/_checklist). */
.task-checklist-tally { color: var(--text-3); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.task-checklist { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 4px 14px 6px; list-style: none; }
.task-checklist-item { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.task-checklist-item .soc-check { margin-top: 0; }
.task-checklist-title { flex: 1; min-width: 0; color: var(--text-1); font-size: var(--fs-13); overflow-wrap: anywhere; }
.task-checklist-item.is-done .task-checklist-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.task-checklist-by { color: var(--text-3); font-size: var(--fs-11); }
.task-checklist-item:hover .task-comment-delete { opacity: 1; }

/* A shared task's conversation (tasks/_comments). */
.task-comments { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 4px 14px 10px; list-style: none; }
.task-comment { display: flex; align-items: flex-start; gap: 10px; }
.task-comment > .soc-avatar { flex-shrink: 0; }
.task-comment-body { flex: 1; min-width: 0; }
.task-comment-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-12); }
.task-comment-who { color: var(--text-1); font-weight: 600; }
.task-comment-who a { color: inherit; text-decoration: none; }
.task-comment-when { color: var(--text-3); }
.task-comment-delete { padding: 0 3px; border: none; background: none; color: var(--text-3); font-size: 10px; cursor: pointer; opacity: 0; }
.task-comment:hover .task-comment-delete, .task-comment-delete:focus-visible { opacity: 1; }
@media (hover: none) { .task-comment-delete { opacity: 0.7; } }
.task-comment-delete:hover { color: var(--danger-bright); }
.task-comment-text { margin: 2px 0 0; color: var(--text-2); font-size: var(--fs-13); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.task-comment-form { display: flex; align-items: flex-end; gap: 8px; padding: 6px 14px 14px; }
.task-comment-input { flex: 1; min-height: 38px; resize: vertical; font: inherit; }

/* Assignments (assignments/index): who to filter to, as a row of chips. */
.soc-tab-count { margin-left: 2px; color: var(--text-3); font-size: var(--fs-11); }
.assignments-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.assignments-person {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--border-panel, #2a2a2a);
  border-radius: 999px; color: var(--text-2); font-size: var(--fs-12); text-decoration: none;
}
.assignments-person:first-child { padding-left: 10px; }
.assignments-person:hover { color: var(--text-1); }
.assignments-person.is-active { border-color: rgba(129, 140, 248, 0.5); background: rgba(99, 102, 241, 0.14); color: #c7d2fe; }
.assignments-list .assigned-nudge { opacity: 0.7; }
.soc-done > summary { cursor: pointer; list-style: none; }
.soc-done > summary::-webkit-details-marker { display: none; }
.soc-done:not([open]) > summary { border-bottom: none; }

/* Forms. */
.soc-form { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.soc-field { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.soc-field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.soc-field .soc-select { max-width: none; width: 100%; }
.soc-label em { font-style: normal; font-weight: 400; letter-spacing: 0; text-transform: none; }
.soc-form-foot { display: flex; justify-content: flex-end; gap: 8px; }
.soc-error { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.1); color: var(--danger-bright); font-size: var(--fs-12); }
.soc-danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; color: var(--text-3); font-size: var(--fs-12); }

@media (max-width: 600px) {
  .soc-select { flex: 1 1 120px; width: auto; max-width: none; }
  .soc-person-actions .soc-btn { padding: 0 9px; }
}

/* Duels: two sides facing each other, each with how it stands. */
.duel-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 0; }
.duel-rules { margin: 0; color: var(--text-3); font-size: var(--fs-12); line-height: 1.5; }
/* The duel's rules as a few short lines, not a paragraph. */
ul.duel-rules { display: grid; gap: 4px; padding: 0; list-style: none; }
ul.duel-rules li { display: flex; gap: 8px; }
ul.duel-rules li i { width: 12px; margin-top: 3px; color: var(--text-3); font-size: var(--fs-11); text-align: center; }
/* Visited on its own (back from Stripe), the duel form keeps a form's width, as in the modal. */
.task-form-card:has(> form.soc-form) { max-width: 520px; margin-left: auto; margin-right: auto; }
.ledger-card > .duel-rules { padding: 10px 16px 0; }
.duel-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; padding: 14px 16px 16px; }
.duel-vs { align-self: center; color: var(--text-3); font-size: var(--fs-11); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.duel-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--border-panel); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.02); }
.duel-side.is-winner { border-color: rgba(234, 179, 8, 0.35); background: rgba(234, 179, 8, 0.05); }
.duel-side-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.duel-trophy { margin-left: auto; color: var(--gold-bright); }
.duel-side-item { display: flex; flex-direction: column; gap: 2px; }
.duel-kind { color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.duel-title { color: var(--text-1); font-size: var(--fs-14); font-weight: 500; overflow-wrap: anywhere; }
.duel-side-rule { margin: 0; color: var(--text-3); font-size: var(--fs-12); line-height: 1.4; }
.duel-side-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.duel-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-11); font-weight: 600; }
.duel-chip.is-done { background: var(--accent-soft); color: var(--accent-bright); }
.duel-chip.is-pending { background: var(--surface-3); color: var(--text-2); }
.duel-chip.is-missed { background: rgba(239, 68, 68, 0.12); color: var(--danger-bright); }
.duel-row-chips { flex-shrink: 0; }
.duel-result { flex-shrink: 0; font-size: var(--fs-12); font-weight: 600; }
.duel-result.is-won { color: var(--gold-bright); }
.duel-result.is-lost { color: var(--text-3); }
.duel-answer { border-top: 1px solid var(--border-panel); }
.duel-custom-stake, .duel-length { display: none; }
.soc-form:has(select[name="pick"] option:is([data-kind="habit"], [data-kind="tracker"]):checked) .duel-length { display: flex; }
.soc-form:has(select[name="duel[stake]"] option[value="custom"]:checked) .duel-custom-stake { display: flex; }
.duel-card-prompt, .duel-stake-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 16px 0; padding: 10px 12px; border: 1px solid var(--border-panel); border-radius: var(--radius-md); color: var(--text-2); font-size: var(--fs-12); line-height: 1.5; }
.duel-card-prompt > span, .duel-stake-status > span { flex: 1 1 220px; }
.duel-card-prompt > i, .duel-stake-status > i { color: var(--gold-bright); }
/* The stake panel's words and its dispute / waive controls (duels/_stake_status). */
.duel-stake-body { display: flex; flex: 1 1 220px; flex-wrap: wrap; align-items: center; gap: 8px; }
.duel-stake-body > span { flex: 1 1 220px; }
.duel-dispute-form { display: flex; flex: 1 1 100%; gap: 8px; }
.duel-dispute-form .soc-input { flex: 1; }

/* The challenger's look at the opponent's pick, before it starts (duels/show). */
.duel-confirm { margin: 0 16px; padding: 12px; border: 1px solid rgba(129, 140, 248, 0.35); border-radius: var(--radius-md); background: rgba(99, 102, 241, 0.08); }
.duel-confirm .duel-rules { color: var(--text-2); }
.duel-confirm .soc-form-foot { margin-top: 10px; padding: 0; }
.duel-rematch { display: flex; justify-content: flex-end; padding: 12px 16px 16px; }

/* Day by day, both sides (duels/_log): a cell a day, scrolling sideways on a long run. */
.duel-log { padding: 0 16px 6px; }
.duel-log-scroll { overflow-x: auto; padding-bottom: 4px; padding-right: 24px; }
.duel-log-grid { border-collapse: separate; border-spacing: 3px; }
.duel-log-grid th { color: var(--text-3); font-size: 10px; font-weight: 500; white-space: nowrap; }
.duel-log-grid thead th { position: relative; width: 12px; min-width: 12px; height: 14px; padding: 0; }
/* A day's label hangs off its own column rather than widening it. */
.duel-log-grid thead th > span { position: absolute; bottom: 1px; left: 0; }

.duel-log-grid thead th.is-today { color: var(--text-1); }
.duel-log-grid tbody th { padding-right: 8px; color: var(--text-2); font-size: var(--fs-11); text-align: right; }
.duel-day, .duel-day-key {
  position: relative; width: 12px; min-width: 12px; height: 12px; padding: 0;
  border-radius: 3px; background: var(--surface-3);
}
.duel-day-key { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.duel-day.is-kept, .duel-day-key.is-kept, .duel-day.is-done_early { background: var(--accent); }
.duel-day.is-missed, .duel-day-key.is-missed { background: var(--danger, #ef4444); }
/* A miss the habit's freebies cover: not held against it, but still not done. */
.duel-day.is-excused, .duel-day-key.is-excused { background: none; box-shadow: inset 0 0 0 1.5px var(--danger, #ef4444); opacity: 0.6; }
.duel-day.is-open, .duel-day-key.is-open { background: none; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.duel-day.is-upcoming { opacity: 0.35; }
.duel-day.is-off, .duel-day.is-none { background: none; }
/* Ticked after its day closed: on honour, so it's marked for the other person to see. */
.duel-day.is-late::after, .duel-day-key.is-late::after {
  content: ''; position: absolute; top: -2px; right: -2px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--gold-bright, #fbbf24); box-shadow: 0 0 0 1px var(--surface-row);
}
.duel-log-key { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 0; color: var(--text-3); font-size: 10px; }
.duel-stake-status { margin-bottom: 14px; }
@media (max-width: 600px) {
  .duel-sides { grid-template-columns: minmax(0, 1fr); }
}

/* Notifications: the unread count, a filled circle over the bottom-right corner of the
   user icon (and, where that icon is hidden, the rail's User item and the mobile menu
   button). The unread ones are listed at the top of the Settings page. */
.soc-count-host { position: relative; display: inline-flex; align-items: center; }
.soc-count-slot:empty { display: none; }
.soc-count {
  position: absolute; right: -7px; bottom: -6px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  border: 2px solid #000; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 13px; text-align: center; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* In the More dropdown it follows the word rather than sitting on a corner. */
.soc-count-host.is-inline { gap: 8px; }
.soc-count-host.is-inline .soc-count { position: static; border-color: transparent; }
.mobile-menu-btn .soc-count { right: -9px; bottom: -7px; }

.soc-notes { margin: 0; padding: 4px 0; list-style: none; }
.soc-note { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid rgba(255, 255, 255, 0.035); color: inherit; text-decoration: none; }
.soc-notes li:first-child .soc-note { border-top-color: transparent; }
.soc-note:hover { background: rgba(255, 255, 255, 0.025); }
.soc-note-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-13); }
.soc-note-body { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.soc-note-text { color: var(--text-2); font-size: var(--fs-13); line-height: 1.4; overflow-wrap: anywhere; }
.soc-note-when { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-11); }
.soc-note-when i { font-size: var(--fs-10); }

/* Premium-only task types (blocks, values): a free account sees the button dimmed, and
   hovering it tints the icon gold and drops a "Premium" tag below it. Choosing it opens
   the upgrade card (task_form_button.js). The tag hangs below rather than above because
   .task-form-card clips its overflow and the switcher is flush with the header. */
body[data-premium="false"] .task-type-card[data-type="block"]:not(.active),
body[data-premium="false"] .task-type-card[data-type="value"]:not(.active) {
  position: relative;
}
body[data-premium="false"] .task-type-card[data-type="block"]:not(.active) i,
body[data-premium="false"] .task-type-card[data-type="value"]:not(.active) i {
  color: #333;
}
body[data-premium="false"] .task-type-card[data-type="block"]:not(.active):hover i,
body[data-premium="false"] .task-type-card[data-type="value"]:not(.active):hover i {
  color: var(--gold-bright);
}
body[data-premium="false"] .task-type-card[data-type="block"]:not(.active)::after,
body[data-premium="false"] .task-type-card[data-type="value"]:not(.active)::after {
  content: "Premium";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 5;
  padding: 3px 8px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 5px;
  background: #1a1a1e;
  color: var(--gold-bright);
  font-size: var(--fs-11);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -2px);
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
body[data-premium="false"] .task-type-card[data-type="block"]:not(.active):hover::after,
body[data-premium="false"] .task-type-card[data-type="value"]:not(.active):hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* The scoreboard's Connections / Everyone switch, and its anonymous rows. */
.soc-board-tabs { display: flex; gap: 2px; margin-left: auto; }
/* The lock rides in the title, and the head's gaps are a touch tighter, so both tabs
   still fit beside it in the side column. */
.soc-board-card .ledger-card-head { gap: 6px; }
.soc-board-card .soc-board-tab { padding-left: 6px; padding-right: 6px; }
.soc-board-card .ledger-card-title { white-space: nowrap; }
.soc-board-card .ledger-card-title .soc-only-you { margin-left: 5px; vertical-align: 1px; }
.soc-board-tab { padding: 2px 8px; border-radius: 6px; color: var(--text-3); font-size: var(--fs-11); text-decoration: none; }
.soc-board-tab:hover { color: var(--text-1); }
.soc-board-tab.is-active { background: var(--surface-3); color: var(--text-1); }
.soc-person-name.is-anonymous { color: var(--text-2); font-style: italic; }
.soc-score-gap { padding: 0 16px; color: var(--text-3); text-align: center; line-height: 1; }

/* The Journal row before an account's first entry: one line that opens the entry box
   (tasks/_task_row), sized like the rows around it. */
.journal-collapsed-row {
  /* The padding stands in for the checkbox column, so the book and "Journal" line up
     with the icons and titles of the rows around it. */
  display: flex; align-items: center; gap: 28px; width: 100%;
  padding: 0.15rem 0.25rem 0.15rem 56px; background: none; border: none; cursor: pointer;
  color: var(--text-1); font: inherit; text-align: left;
}
.journal-collapsed-row > .fa-book { width: 18px; color: var(--text-3); text-align: center; }
.journal-collapsed-title { flex: 1; }
.journal-collapsed-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 5px;
  color: var(--text-2); font-size: var(--fs-12);
}
.journal-collapsed-row:hover .journal-collapsed-cta { border-color: var(--accent); color: var(--text-1); }
.journal-collapsed-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.journal-collapsed-row[hidden] { display: none; }

/* The day's journal entry in the schedule column: the sidebar's New Journal Entry card
   (journals/_form), closed by the New Task form's X. */
.sched-journal-card { margin: 0; }
a.task-form-close { text-decoration: none; }

/* The category picker on an Inbox task's row (tasks/_task_row): the task form's picker
   as a small pill beside the title, its panel wide enough to read the categories. */
.inbox-file-form { display: inline-flex; vertical-align: middle; margin: 0 0 0 0.5rem; }
.cat-sel-compact .cat-sel-trigger {
  width: auto; gap: 5px; padding: 1px 8px 1px 7px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-3); font-size: var(--fs-11); line-height: 1.6;
}
.cat-sel-compact .cat-sel-trigger > .fa-inbox { font-size: 9px; }
.cat-sel-compact .cat-sel-trigger:hover,
.cat-sel-compact .cat-sel-trigger:focus-visible { color: var(--text-1); border-color: var(--accent); }
.cat-sel-compact .cat-sel-panel { min-width: 220px; }
/* A row dimmed because it's already on the day (its inline opacity) or sent: opacity
   fades the panel with it and makes the row a stacking context, so the cards below
   paint over the list. Full strength while its picker is open. */
.task-row:has(.inbox-file-form .cat-sel-trigger.open),
.task-row:has(.inbox-file-form .cat-sel-trigger.open) > td { opacity: 1 !important; }

/* An index with nothing in it yet (shared/_empty_panel): what goes there, and the
   button that adds the first one. */
.empty-panel {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 36px 28px 30px; text-align: center;
}
.empty-panel-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 4px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  font-size: var(--fs-20);
}
.empty-panel-title { margin: 0; color: var(--text-1); font-size: var(--fs-16); font-weight: 600; }
.empty-panel-text { max-width: 340px; margin: 0; color: var(--text-2); font-size: var(--fs-13); line-height: 1.55; }
.empty-panel-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 8px 18px;
  border: none; border-radius: 999px; background: var(--accent); color: #04140a;
  font: inherit; font-size: var(--fs-13); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) ease;
}
.empty-panel-btn:hover { background: var(--accent-bright); color: #04140a; }
.empty-panel-link { color: var(--text-3) !important; font-size: var(--fs-12); text-decoration: none; }
.empty-panel-link:hover { color: var(--text-1) !important; text-decoration: underline; }
/* Narrower pages set a width; the panel takes the column it's given. */
.empty-panel-page { max-width: 440px; margin: 0 auto; }

/* Find More on an index that's just starting (shared/_starter_picks): a few gallery
   items under the list, until there are three of the kind. Rows are .gallery-item. */
.starter-picks { margin: 24px 0 14px; }
.empty-panel-page + .starter-picks, .empty-panel-page .starter-picks { max-width: 440px; margin-left: auto; margin-right: auto; }
.starter-picks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 10px; }
.starter-picks-title {
  margin: 0; color: var(--text-3); font-size: var(--fs-11); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.starter-picks-all { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-12); text-decoration: none; }
.starter-picks-all i { font-size: var(--fs-11); }
.starter-picks-all:hover { color: var(--text-1); }

/* A one-time hint (shared/_hint): a quiet line with a close button, on the accent. */
.app-hint {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 14px; padding: 10px 10px 10px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--text-2); font-size: var(--fs-12); line-height: 1.5; text-align: left;
}
.app-hint-icon { margin-top: 3px; color: var(--accent); }
.app-hint-text { flex: 1; }
.app-hint-text strong { color: var(--text-1); font-weight: 600; }
.app-hint-text a { color: var(--accent); }
.app-hint form { margin: 0; }
/* A hint about Premium: Premium's gold, as on the Premium page, rather than the green
   that elsewhere means done or saved. */
.app-hint.is-premium { border-color: color-mix(in srgb, var(--gold-bright) 30%, transparent); background: color-mix(in srgb, var(--gold-bright) 6%, transparent); }
.app-hint.is-premium .app-hint-icon,
.app-hint.is-premium .app-hint-text a { color: var(--gold-bright); }
.app-hint-close {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer;
}
.app-hint-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-1); }

/* Review mode after a long time away (calendars/_task_schedule, ReviewDays::CAP). */
.review-capped-note { margin: 0 0 12px; color: var(--text-3); font-size: var(--fs-12); text-align: center; }

/* The day tasks on offer (calendars/_day_tasks_card, _add_day_task_hint). */

.day-tasks-add {
  flex: none; padding: 3px 10px; margin-top: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px;
  background: none; color: var(--accent); font: inherit; font-size: var(--fs-12); cursor: pointer;
}

.day-tasks-add:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.day-tasks-card-actions { margin-top: 8px; }
a.day-tasks-add { display: inline-block; text-decoration: none; }

/* The same, drawn into today's schedule before they're added (calendars/_day_tasks_preview). */
.day-preview {
  margin: 0 0 12px; padding: 4px 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 10px;
}
.day-preview-head {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  color: var(--accent); font-size: var(--fs-12); font-weight: 600;
}
.day-preview-head > span { flex: 1; }
.day-preview-head form { margin: 0; }
.day-preview-head .day-tasks-add { margin-top: 0; }
.day-preview-cancel { color: var(--text-3); font-size: var(--fs-12); text-decoration: none; }
.day-preview-cancel:hover { color: var(--text-1); }
.day-preview-row {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 0; margin: 4px 0;
  border-radius: 6px; font-size: var(--fs-13); color: var(--text-2);
}
/* Icon and title line up with the real rows around them, whose table gives the checkbox
   13% and the icon 18% (calendars/_task_schedule). The row sits 11px in from the table's
   edges (the group's border and padding), hence the small offsets. */
.day-preview-icon {
  flex: none; box-sizing: border-box; width: calc(18% + 2px); margin-left: calc(13% - 10px);
  text-align: center; font-size: var(--fs-12);
}
.day-preview-icon + .day-preview-text { margin-left: -4px; }
.day-preview-text { flex: 1; min-width: 0; line-height: 1.4; }
.day-preview-text strong { color: var(--text-1); font-weight: 500; margin-right: 4px; }
.day-preview-text span { display: block; color: var(--text-3); font-size: var(--fs-12); }

/* The same faint repeat mark a daily's real row carries (.task-row .dynamic-aspect). */
.day-preview-repeat { color: var(--text-3); opacity: 30%; margin: 0 6px 0 2px; font-size: var(--fs-11); }
.day-preview-row form { margin: 0; }
.day-preview-row .day-tasks-add { margin-top: 0; }
.day-preview-btn {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer;
}
.day-preview-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge-toast > .fa-trophy { color: var(--gold-bright) !important; }
.badge-toast { border-color: var(--gold); }

/* ---- People: what a connection is, at a glance ---- */
.soc-person-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.soc-person-sub { color: var(--text-3); font-size: var(--fs-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A name is a way to their profile: say so on hover. */
.soc-person-body a { text-decoration: none; }
.soc-person-body a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.35); }
.soc-person { transition: background var(--dur-fast); }
.soc-person:hover { background: rgba(255, 255, 255, 0.025); }
/* The connection menu: actions with icons, a line, then Disconnect. */
.soc-more-menu .soc-more-item { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.soc-more-menu .soc-more-item i { width: 14px; color: var(--text-3); text-align: center; }
.soc-more-sep { height: 1px; margin: 4px 0; background: var(--border); }
/* A profile's Together card. */
.soc-together-list { list-style: none; margin: 0; padding: 6px 18px 12px; display: grid; gap: 8px; }
.soc-together-list li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: var(--fs-13); }
.soc-together-list i { width: 16px; color: var(--text-3); text-align: center; }
.soc-together-list a { color: var(--text-1); text-decoration: none; }
.soc-together-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.soc-profile-locked.is-bare { display: flex; align-items: center; gap: 8px; margin: 4px 2px; color: var(--text-3); font-size: var(--fs-13); }

/* ---- Your profile: preview bar, username prompt, badges under way, quieter unstarted ---- */
.soc-preview-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 14px;
  border: 1px solid rgba(96, 165, 250, 0.35); border-radius: var(--radius-lg);
  background: rgba(96, 165, 250, 0.07); color: var(--text-2); font-size: var(--fs-13);
}
.soc-preview-bar > i { color: #60a5fa; }
.soc-preview-bar .soc-btn { margin-left: auto; }
.soc-pick-username {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; padding: 2px 9px; vertical-align: middle;
  border: 1px dashed var(--border-strong); border-radius: 999px;
  color: var(--text-2); font-size: var(--fs-11); font-weight: 500; letter-spacing: 0; text-decoration: none;
}
.soc-pick-username:hover { color: var(--text-1); border-color: var(--text-3); }
.soc-pick-username i { font-size: 0.9em; }
.soc-btn.is-quiet { background: transparent; color: var(--text-2); }
.soc-btn.is-quiet i { margin-right: 6px; }
/* Under way: what it takes, small, under the count. */
.soc-badge-goal {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  max-width: 120px; margin-top: -4px; color: var(--text-3); font-size: var(--fs-10); line-height: 1.35; text-wrap: balance;
}
/* Not started: the medallion as it was, without the "???" under it. */
.soc-badge.is-unstarted .soc-badge-name { display: none; }
/* Next up: a soft glow until it's earned. */
.soc-badge.is-next .soc-badge-medal { border-radius: 50%; box-shadow: 0 0 0 3px rgba(245, 185, 113, 0.28), 0 0 22px rgba(245, 185, 113, 0.22); }
.soc-badge.is-next::before {
  content: "Next up"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  color: var(--gold-bright); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
/* An empty Duels card: its way in as a button, not a line of grey. */
.soc-duel-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.soc-duel-empty .soc-btn i { margin-right: 6px; }
/* A phone: each group one row to swipe, not two rows of three; a tapped badge's details
   open as a card at the foot of the screen, which the row's scrolling can't clip. */
@media (max-width: 560px) {
  .soc-group .soc-badges {
    display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 12px 2px 4px;
    margin: 0 -12px; padding-inline: 12px; scrollbar-width: none;
  }
  .soc-group .soc-badges::-webkit-scrollbar { display: none; }
  .soc-group .soc-badges > .soc-badge { flex: 0 0 92px; scroll-snap-align: start; }
  .soc-group .soc-badges > .soc-badge .soc-badge-pop,
  .soc-group .soc-badges > .soc-badge:nth-child(n) .soc-badge-pop {
    position: fixed; left: 16px; right: 16px; top: auto; bottom: 84px; z-index: 50;
    width: auto; max-width: none; transform: translateY(6px);
  }
  .soc-group .soc-badges > .soc-badge:nth-child(n):is(:hover, :focus) .soc-badge-pop { transform: translateY(0); }
  .soc-profile-actions .soc-btn.is-quiet { font-size: 0; padding-inline: 10px; }
  .soc-profile-actions .soc-btn.is-quiet i { margin: 0; font-size: var(--fs-13); }
}
@media (max-width: 560px) {
  .soc-pick-username { display: flex; width: fit-content; margin: 6px 0 0; }
}

/* ---- Duels: who's ahead, each side's bar, the VS, a result banner, the stake owed ---- */
.duel-headline { margin: 12px 16px 0; color: var(--text-1); font-size: var(--fs-14); line-height: 1.5; }
.duel-side.is-out { opacity: 0.55; }
.duel-side.is-out .duel-title { text-decoration: line-through; text-decoration-color: rgba(239, 68, 68, 0.5); }
.duel-bar { display: block; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.duel-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.4s ease; }
.duel-side.is-out .duel-bar > span { background: var(--danger, #ef4444); }
.duel-side.is-winner .duel-bar > span { background: var(--gold-bright); }
.duel-today-form { margin: 2px 0 0; }
.duel-today-btn { width: 100%; justify-content: center; }
.duel-today-btn i { margin-right: 6px; }
.duel-vs { display: grid; place-items: center; }
.duel-vs > span {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-2); font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
}
.duel-result-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 16px 0; padding: 14px;
  border-radius: var(--radius-md); font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  border: 1px solid var(--border-panel); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
}
.duel-result-banner.is-won, .duel-result-banner.is-both {
  border-color: rgba(234, 179, 8, 0.4); color: var(--gold-bright);
  background: radial-gradient(120% 160% at 50% 0%, rgba(234, 179, 8, 0.14), transparent 70%);
}
.duel-result-banner.is-reveal { animation: duel-reveal 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.duel-result-banner.is-reveal i { animation: duel-reveal-icon 1.2s ease-out 0.3s both; }
@keyframes duel-reveal { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes duel-reveal-icon { 0% { transform: scale(0.4) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.3) rotate(8deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .duel-result-banner.is-reveal, .duel-result-banner.is-reveal i { animation: none; } }
.duel-owe-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 2px 9px; border-radius: 999px;
  background: rgba(239, 68, 68, 0.12); color: var(--danger-bright); font-size: var(--fs-11); font-weight: 600; white-space: nowrap;
}
.duel-owe-chip.is-owed { background: rgba(234, 179, 8, 0.12); color: var(--gold-bright); }
.duel-owe-chip.is-small { margin: 2px 0 0; width: fit-content; }
/* The new duel form: what's agreed in a sentence; the rules folded under it. */
.duel-summary {
  margin: 4px 0 0; padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.06);
  color: var(--text-1); font-size: var(--fs-13); line-height: 1.5;
}
.duel-how > summary { cursor: pointer; color: var(--text-3); font-size: var(--fs-12); list-style: none; }
.duel-how > summary::-webkit-details-marker { display: none; }
.duel-how > summary::before { content: "\f05a"; font: var(--fa-font-solid); margin-right: 6px; font-size: 0.9em; }
.duel-how > summary:hover { color: var(--text-2); }
.duel-how[open] > summary { margin-bottom: 8px; }
.duel-how .duel-rules + .duel-rules { margin-top: 4px; }
/* The day log: one long row on a wide screen, weeks of seven on a phone. */
.duel-log-weeks { display: none; }
@media (max-width: 600px) {
  .duel-log-scroll { display: none; }
  .duel-log-weeks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .duel-weeks-who { display: block; margin-bottom: 6px; color: var(--text-2); font-size: var(--fs-11); font-weight: 600; }
  .duel-weeks-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .duel-weeks-head { color: var(--text-3); font-size: 9px; text-align: center; }
  .duel-weeks-grid .duel-day {
    width: auto; min-width: 0; height: auto; aspect-ratio: 1; display: grid; place-items: center;
    color: transparent; font-size: 8px;
  }
  .duel-weeks-grid .duel-day.is-today { box-shadow: inset 0 0 0 1.5px var(--text-1); }
  .duel-vs > span { width: 28px; height: 28px; font-size: 10px; }
}

/* ---- Assigned to others: what needs a nudge first, said plainly ---- */
.assigned-when { color: var(--text-3); font-size: var(--fs-11); }
.assigned-when.is-late { color: var(--danger-bright); font-weight: 600; }
/* The folder is a mover, not news: on hover (or always, where there's no hover). */
.assigned-dropdown .assigned-filing { display: none; }
.assigned-dropdown .assigned-row:hover .assigned-filing,
.assigned-dropdown .assigned-filing:focus-within { display: inline-flex; }
@media (hover: none) { .assigned-dropdown .assigned-filing { display: inline-flex; } }
/* Late or not seen yet: the nudge says itself rather than waiting for a hover. */
.assigned-row:is(.is-sent, .is-late):not(.is-done) .assigned-nudge:not(.is-spent) {
  opacity: 1; padding: 1px 7px; margin-left: 4px; border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--text-2); font-size: var(--fs-11);
}
.assigned-row:is(.is-sent, .is-late):not(.is-done) .assigned-nudge:not(.is-spent)::after { content: " Nudge"; font-family: inherit; }
.assigned-row:is(.is-sent, .is-late):not(.is-done) .assigned-nudge:not(.is-spent):hover { color: var(--text-1); border-color: var(--text-3); }
.assigned-dropdown .shared-task-meta { align-items: center; gap: 6px; }
/* A phone: the list as a sheet along the bottom, above the tab bar. */
.assigned-dropdown.is-open.is-sheet {
  left: 8px !important; right: 8px; top: auto !important; bottom: calc(64px + env(safe-area-inset-bottom));
  width: auto; max-height: 60vh; border-radius: 14px; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55);
}

/* People polish. The whole row opens the profile: the name's link stretched across it,
   with the actions lifted above. */
.soc-person.is-linked { position: relative; }
.soc-person.is-linked .soc-person-name::after { content: ""; position: absolute; inset: 0; }
.soc-person.is-linked .soc-person-actions { position: relative; z-index: 1; }
@media (hover: hover) { .soc-person.is-linked:hover { background: rgba(255, 255, 255, 0.04); } }
.soc-person.is-linked:hover .soc-person-name { text-decoration: none; }

/* You & <name>: since when in the header, and quiet prompts when nothing's shared yet. */
.soc-together-since { margin-left: auto; color: var(--text-3); font-size: var(--fs-11); }
.soc-together-empty { margin: 0; padding: 4px 18px 8px; color: var(--text-3); font-size: var(--fs-13); }
.soc-together-prompts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 18px 14px; }
.soc-together-prompts .soc-btn i { margin-right: 6px; }
.soc-together-tip { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-12); }

/* Locked badges: a small lock over the fog, so it reads as locked rather than a smudge. */
.soc-badge-lock {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-3); font-size: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.soc-badge.is-started .soc-badge-lock { opacity: 0.8; }
.soc-badge-locked { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.soc-badge-locked i { font-size: 9px; }

/* New badges: a count and chips, calmer than a gold run-on sentence. */
.soc-callout { flex-wrap: wrap; border-color: rgba(234, 179, 8, 0.22); background: rgba(234, 179, 8, 0.05); }
.soc-callout > i { font-size: var(--fs-12); }
.soc-callout-title { color: var(--text-1); font-weight: 600; }
.soc-callout-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.soc-callout-chip {
  padding: 2px 9px; border: 1px solid rgba(234, 179, 8, 0.3); border-radius: 999px;
  color: var(--gold-bright); font-size: var(--fs-11); font-weight: 500; text-decoration: none;
}
.soc-callout-chip:hover { background: rgba(234, 179, 8, 0.1); }

/* Phone: the profile's buttons get their own row under the name, rather than squeezing
   its facts into a column one word wide; the together card's date drops under its title. */
@media (max-width: 600px) {
  .soc-profile-body { flex-basis: calc(100% - 80px); }
  .soc-profile-actions { width: 100%; }
  .soc-together-card .ledger-card-head { flex-wrap: wrap; }
}

/* ---- Duels polish ---- */
/* A forfeit beside the result, in the banner's own line, quieter. */
.duel-result-sub { margin-left: 2px; font-size: 0.8em; font-weight: 500; opacity: 0.75; }
/* After a forfeit: the days that never happened, faint; a deleted pick's days, dashed. */
.duel-day.is-after, .duel-day-key.is-after { background: var(--surface-3); opacity: 0.35; }
.duel-day.is-unrecorded { background: none; box-shadow: inset 0 0 0 1px var(--border-strong); opacity: 0.5; }
/* Pick yours, from your own card. */
.duel-pick-btn { align-self: flex-start; margin-top: 4px; }
.duel-pick-btn i { margin-right: 6px; }
/* The new duel's sentence while it's still a draft: the blanks read as such. */
.duel-summary.is-draft { color: var(--text-3); }
/* A phone: the owe chip under the title, not squeezing it to three lines beside it. */
@media (max-width: 640px) {
  .ledger-card-head:has(.duel-owe-chip) { flex-wrap: wrap; row-gap: 6px; }
  .ledger-card-head:has(.duel-owe-chip) .duel-owe-chip { order: 9; margin-left: 0; }
}

/* A badge under way shows its count in place of "???". */
.soc-badge-name.is-progress { letter-spacing: 0 !important; opacity: 1 !important; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Three medallions a row on a phone: each group holds six, so two even rows, where four
   across left a row of four over a row of two. */
@media (max-width: 560px) { .soc-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 4px; } }

/* On a phone's three-across rows, the outer columns' popovers open inward so they aren't
   cut off at the screen's edge. */
@media (max-width: 560px) {
  .soc-badges > .soc-badge:nth-child(3n+1) .soc-badge-pop { left: 0; transform: translate(0, 4px); }
  .soc-badges > .soc-badge:nth-child(3n) .soc-badge-pop { left: auto; right: 0; transform: translate(0, 4px); }
  .soc-badges > .soc-badge:nth-child(3n+1):is(:hover, :focus) .soc-badge-pop,
  .soc-badges > .soc-badge:nth-child(3n):is(:hover, :focus) .soc-badge-pop { transform: translate(0, 0); }
}

/* People carries Shared Lists and Assignments, Badges carries Duels, each under a heading
   of its own that the old addresses (/shared_lists, /assignments, /duels) land on. */
.soc-section-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin: 34px 0 12px; padding-top: 18px; border-top: 1px solid var(--border-panel);
}
.soc-side .soc-section-head { margin-top: 24px; }
.soc-section-title { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; color: var(--text-1); font-size: var(--fs-16); font-weight: 600; }
.soc-section-count { color: var(--text-3); font-size: var(--fs-12); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- People polish ---- */
/* The username as the welcome card's first step: numbered, centred with the finder. */
.soc-setup-step { display: block; max-width: 520px; margin: 0 auto 8px; color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
.soc-setup.is-inline { max-width: 520px; margin: 0 auto 20px; text-align: left; }
.soc-setup.is-inline .soc-setup-text { padding: 0 0 10px; }
.soc-setup.is-inline .soc-search { padding: 0; }
@media (max-width: 560px) {
  /* The header's two buttons as icons, so they don't crowd the title. */
  .soc-head-actions .ledger-new > span { display: none; }
  .soc-head-actions .ledger-new { width: 34px; padding: 0; justify-content: center; }
  .soc-head-actions .ledger-new i { margin: 0; }
  /* A request's Accept and Decline on a row of their own, under the name, so the line
     under it isn't cut to "new to Ap…". */
  .soc-people.is-requests .soc-person { flex-wrap: wrap; row-gap: 8px; }
  .soc-people.is-requests .soc-person-body { flex-basis: calc(100% - 44px); }
  .soc-people.is-requests .soc-person-actions { width: 100%; padding-left: 44px; }
}
/* A profile: ⋯ as a square beside Challenge, not a wide button; a waiting request's line. */
.soc-profile-actions .soc-btn.soc-more-btn { width: 34px; min-width: 34px; padding: 0; justify-content: center; }
.soc-profile-request { display: block; margin-top: 4px; color: var(--text-3); font-size: var(--fs-12); }
/* You & them: each shared list with its progress. */
.soc-together-list-row .soc-progress.is-inline { display: inline-block; flex: 0 1 120px; width: auto; margin: 0 0 0 auto; }
.soc-together-count { color: var(--text-3); font-size: var(--fs-11); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* No badges yet: the set, locked and dimmed. */
.soc-badges.is-dimmed { opacity: 0.45; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 12px 4px; }
.soc-badges.is-dimmed .soc-badge { min-width: 0; padding: 0; }
.soc-badges.is-dimmed .soc-badge-name { display: none; }
.soc-badges.is-dimmed .soc-badge-medal { width: 46px; height: 46px; }
.soc-badges.is-dimmed .soc-badge-icon { width: 40px; height: 40px; }
.soc-badges.is-dimmed .soc-badge-icon svg { width: 24px; height: 24px; }
.soc-badges-none .soc-profile-locked.is-bare { padding: 0 16px 14px; }
@media (max-width: 720px) { .soc-badges.is-dimmed { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 2px; padding: 12px; } }
/* A shared list: Done's chevron, people added by chip, the edit popup's assignee chips. */
.soc-done > summary .soc-done-chev { margin-left: auto; color: var(--text-3); font-size: var(--fs-11); transition: transform var(--dur-fast); }
.soc-done[open] > summary .soc-done-chev { transform: rotate(180deg); }
.soc-side .soc-add-member { flex-direction: column; gap: 8px; }
.soc-add-member-label { color: var(--text-3); font-size: var(--fs-11); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.soc-pick-person.is-add { background: none; font: inherit; font-size: var(--fs-12); }
.soc-pick-person.is-add i { color: var(--text-3); font-size: var(--fs-10); }
.soc-pick-person.is-add:hover { border-color: var(--accent-bright); color: var(--text-1); }
.soc-pick-person.is-add:hover i { color: var(--accent-bright); }
.soc-pick-none-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); font-size: var(--fs-10); }
.soc-item-form-card .soc-pick-people { margin: 0; padding: 0; border: none; }

/* ---- Duels polish ---- */
/* The day log in the softer kept and missed the other strips use, and sized to its card:
   the table takes the card's width and its days share it, so 30 days always fit
   (a 90-day one still scrolls rather than shrinking past reading). */
.duel-day.is-kept, .duel-day-key.is-kept, .duel-day.is-done_early { background: rgba(34, 197, 94, 0.78); }
.duel-day.is-missed, .duel-day-key.is-missed { background: rgba(214, 78, 82, 0.72); }
.duel-day.is-excused, .duel-day-key.is-excused { box-shadow: inset 0 0 0 1.5px rgba(214, 78, 82, 0.72); }
.duel-log-scroll { padding-right: 0; }
.duel-log-grid { width: 100%; table-layout: fixed; }
.duel-log-grid thead th:first-child, .duel-log-grid tbody th { width: 58px; }
.duel-log-grid thead th:not(:first-child), .duel-log-grid td.duel-day { width: auto; min-width: 7px; }
.duel-log-grid:has(tbody tr td:nth-of-type(45)) { width: auto; table-layout: auto; }
/* A side that's out: quietly, not a red alarm with days still to go. */
.duel-chip.is-out { background: var(--surface-3); color: var(--text-2); }
.duel-side.is-out { opacity: 0.7; }
.duel-side.is-out .duel-title { text-decoration: none; }
.duel-side.is-out .duel-bar > span { background: var(--text-3); }
/* Your turn to pick: a pointer to the picker below, not a second button. */
.duel-pick-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-bright); text-decoration: none; }
.duel-pick-hint:hover { text-decoration: underline; text-underline-offset: 3px; }
/* How an answered challenge plays out, a line each, the stake standing out. */
.duel-answer-rules { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.duel-answer-rules li { display: flex; align-items: baseline; gap: 8px; color: var(--text-2); font-size: var(--fs-12); line-height: 1.5; }
.duel-answer-rules li i { width: 14px; flex-shrink: 0; color: var(--text-3); text-align: center; }
.duel-answer-rules li.is-stake { color: var(--text-1); }
.duel-answer-rules li.is-stake i.fa-crown { color: var(--gold-bright); }
/* Premium at stake, in gold. */
.ledger-tag.is-premium-stake { border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.1); color: var(--gold-bright); }
.duel-stake-field:has(option[value="monthly"]:checked, option[value="yearly"]:checked) select { border-color: rgba(251, 191, 36, 0.5); color: var(--gold-bright); }
/* Duel rows: you and them overlapped, the stake on its own quiet line. */
.duel-row-pair { display: inline-flex; flex-shrink: 0; }
.duel-row-pair > :last-child { margin-left: -9px; box-shadow: 0 0 0 2px var(--surface-card, #0e0e10); border-radius: 50%; }
.duel-row-stake { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--text-3); font-size: var(--fs-11); }
.duel-row-stake i { font-size: 0.9em; }
.duel-row-stake.is-premium { color: rgba(251, 191, 36, 0.85); }
.soc-lists .soc-list-row .soc-list-body { flex: 1; min-width: 0; }

/* ---- Assignments polish ---- */
/* A row without a tick keeps a tick's room, so titles line up down the card. */
.soc-check-spacer { display: inline-block; flex-shrink: 0; width: 18px; height: 18px; }
/* Remind, said, as a chip beside the person. */
.assigned-nudge.is-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px; font-size: var(--fs-10); opacity: 1; }
.assigned-nudge.is-chip:hover { border-color: rgba(251, 191, 36, 0.5); }
@media (hover: hover) { .assigned-row .assigned-nudge.is-chip { opacity: 0.75; } .assigned-row:hover .assigned-nudge.is-chip { opacity: 1; } }
/* How far an assignee has got, as its own quiet tag. */
.assigned-state { color: var(--text-3); }
.assigned-state.is-accepted { color: var(--accent-bright); }
/* File it: the way to accept, as a button. */
.assigned-file-it { border-color: rgba(34, 197, 94, 0.4) !important; color: var(--accent-bright) !important; text-decoration: none; }
.assigned-file-it:hover { background: var(--accent-soft); }
/* A shared list's members beside its name. */
.soc-list-head-stack { display: inline-flex; margin-left: 4px; text-decoration: none; }
.soc-list-head-stack .soc-avatar + .soc-avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--bg, #000); }
/* The assign menu: a person's whole row is the button, its word quiet until hovered. */
.assign-menu-person.is-pick { padding: 0 4px; }
.assign-menu-row-form { display: block; }
.assign-menu-row {
  display: flex; align-items: center; gap: 8px; width: 100%; height: auto; padding: 5px 8px;
  border: none; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.assign-menu-row:hover, .assign-menu-row:focus-visible { background: var(--surface-3); outline: none; }
.assign-menu-go { color: var(--text-3); font-size: var(--fs-12); font-weight: 600; opacity: 0; transition: opacity var(--dur-fast); }
.assign-menu-row:hover .assign-menu-go, .assign-menu-row:focus-visible .assign-menu-go { color: var(--accent-bright); opacity: 1; }
@media (hover: none) { .assign-menu-go { opacity: 1; color: var(--accent-bright); } }

/* An assignment's tags at one height and spacing: Remind sat 2px short and lower, jammed
   against "not seen yet". */
.assignments-list .shared-task-meta { align-items: center; }
.assigned-person { gap: 4px; }
.assignments-list .assigned-nudge.is-chip { height: 18px; padding: 0 7px; font-size: var(--fs-11); line-height: 1; }
/* The rows' own background stops at the card's rounded foot instead of squaring it off. */
.ledger-card > .shared-tasks-list:last-child {
  border-bottom-left-radius: calc(var(--radius-lg) - 3px) calc(var(--radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--radius-lg) - 1px);
}

/* Under the scoreboard: what earns a point. */
.soc-score-key { margin: 0; padding: 10px 16px 0; color: var(--text-3); font-size: var(--fs-11); line-height: 1.5; }

/* "Pick a username →" as a plain link on the line under the name, not a dashed tag. */
.soc-profile-facts .soc-pick-username, .soc-profile-facts .soc-pick-username:hover {
  display: inline; margin: 0; padding: 0; border: 0; border-radius: 0;
  color: var(--blue); font-size: inherit; font-weight: 500;
}
.soc-profile-facts .soc-pick-username:hover { text-decoration: underline; text-underline-offset: 3px; }

/* A phone's badge rows swipe sideways: the right edge fades, so the cut-off badge reads as
   "more this way" rather than clipped. */
@media (max-width: 560px) {
  .soc-group .soc-badges { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
}
