/* Final interventions theme. Keep this stylesheet after styles.css. */
:root {
  --status-success: #78b987;
  --status-success-strong: #b8e2bf;
  --status-pending: #6f9fc1;
  --status-pending-strong: #b7d8eb;
  --status-rest: #d3ad58;
  --status-rest-strong: #f0d58f;
  --status-danger: #c87570;
  --status-danger-strong: #efb7b1;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Master equipment layers share the base character canvas and never drift independently. */
.equipment-asset-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  pointer-events: none;
}

.attribute-rig .equipment-asset-layer {
  object-fit: cover;
  object-position: center;
}

.friend-equipment-layers .equipment-asset-layer {
  object-fit: fill;
  object-position: 50% 50%;
}

.shop-item-art,
.inventory-item-art {
  overflow: hidden;
}

.shop-item-art img,
.inventory-item-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-item-art img {
  transform: scale(1.12);
}

.inventory-item-art img {
  transform: scale(1.08);
}

#inventoryPanel .developer-equipment-preview {
  display: grid;
  gap: 12px;
  padding: 0 0 18px;
}

#inventoryPanel .developer-equipment-preview[hidden] {
  display: none;
}

#inventoryPanel .developer-equipment-preview > div:first-child {
  display: grid;
  gap: 3px;
}

#inventoryPanel .developer-equipment-preview strong {
  color: var(--time-text, #d8c9a8);
  font-size: 15px;
  font-weight: 400;
}

#inventoryPanel .developer-equipment-preview small {
  color: var(--time-muted, #9d8f78);
  font-size: 12px;
}

.equipment-set-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: color-mix(in srgb, var(--time-line, #655846) 34%, transparent);
}

.equipment-set-preview-button {
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  color: var(--time-muted, #9d8f78);
  border: 0;
  background: var(--time-panel-deep, #07080b);
  font: inherit;
  font-size: 12px;
  text-align: center;
}

.equipment-set-preview-button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.equipment-set-preview-button.active {
  color: var(--time-text-strong, #f0e6c8);
  background: color-mix(
    in srgb,
    var(--time-accent, #c88b3a) 10%,
    var(--time-panel-deep, #07080b)
  );
}

.interventions-header,
.history-header {
  min-height: 78px;
  padding: max(10px, var(--app-safe-top)) 18px 14px;
  align-items: center;
}

.interventions-header {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  padding-right: 18px;
}

.history-header {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding-right: 18px;
}

.interventions-heading {
  width: auto;
  min-width: 0;
  display: grid;
  gap: var(--stock-copy-gap);
  position: static;
  justify-self: center;
  transform: none;
  text-align: center;
}

.interventions-view .interventions-heading time {
  order: -1;
  margin: 0;
  font-size: 12px;
  font-variant-caps: small-caps;
}

.interventions-view .interventions-heading h1 {
  order: 1;
}

.interventions-header .daily-tally {
  display: none;
}

.history-header .daily-tally {
  width: auto;
  min-width: 52px;
  position: static;
}

.interventions-close {
  position: static;
  justify-self: end;
  width: 44px;
  height: 44px;
}

.interventions-close svg {
  width: 20px;
  height: 20px;
}

.participant-preview-tabs {
  grid-row: 3;
  min-height: 44px;
  margin: 0 18px;
  border: 0;
  background: transparent;
}

.participant-preview-tabs::after,
.participant-preview-tabs button + button::before {
  content: none;
}

.participant-preview-tabs button {
  height: 44px;
  color: var(--time-muted);
  border: 0;
  background: transparent;
  font-size: 14px;
}

.participant-preview-tabs button.active {
  color: var(--time-text-strong);
  background:
    linear-gradient(
      90deg,
      transparent,
      color-mix(in srgb, var(--time-accent) 9%, transparent),
      transparent
    );
  box-shadow: none;
}

.participant-preview-tabs button.active::after,
.participant-preview-tabs button[aria-selected="true"]::after {
  content: none;
}

.interventions-summary {
  grid-row: 2;
  min-height: 62px;
  margin: 4px 18px 0;
}

.interventions-scroll,
.history-scroll {
  padding-right: 18px;
  padding-left: 18px;
}

.rule-list,
.history-day-entries {
  gap: 0;
}

.interventions-scroll {
  grid-row: 4;
}

.intervention-row:not(.primary-project) {
  min-height: 76px;
  padding: var(--stock-row-gap) 4px;
  border: 0;
  border-image: none;
}

.intervention-row.primary-project {
  min-height: 98px;
  margin: 0;
  padding: var(--stock-row-gap) 12px;
}

.rule-list > .intervention-row:last-child:not(.primary-project) {
  border-bottom: 0;
  border-image: none;
}

.rule-group + .rule-group {
  margin-top: var(--stock-section-gap);
  padding-top: 0;
}

.rule-group + .rule-group::before {
  content: none;
}

.compact-interventions .intervention-row:not(.primary-project) {
  min-height: 48px;
  padding: 8px 4px;
}

.compact-interventions .intervention-row.primary-project {
  min-height: 74px;
  margin: 0;
  padding: 10px 12px;
}

.compact-interventions .rule-row-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

.rule-progress-pips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rule-progress-pips svg {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  overflow: visible;
  fill: transparent;
  stroke: color-mix(in srgb, var(--time-line, #98815a) 72%, transparent);
  stroke-width: 1.35;
  filter: none;
}

.rule-progress-pips svg.status-success {
  fill: var(--status-success);
  stroke: var(--status-success-strong);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--status-success) 44%, transparent));
}

.rule-progress-pips svg[data-routine-type="single"] .routine-pip-core {
  fill: var(--status-success-strong);
  stroke: none;
}

.rule-progress-pips svg[data-routine-type="full"] .routine-pip-core {
  fill: var(--status-success-strong);
  stroke: none;
}

.rule-progress-pips svg:is(.status-day_off, .status-exception) {
  fill: var(--status-rest);
  stroke: var(--status-rest-strong);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--status-rest) 40%, transparent));
}

.rule-progress-pips svg.status-violation {
  fill: var(--status-danger);
  stroke: var(--status-danger-strong);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--status-danger) 42%, transparent));
}

.history-day-entries {
  align-content: start;
  grid-auto-rows: max-content;
  gap: var(--stock-section-gap);
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior-y: none;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding:
    var(--stock-section-gap)
    max(calc(var(--stock-gutter) - var(--scrollbar-size)), 0px)
    calc(max(var(--stock-section-gap), var(--app-safe-bottom)) + 44px);
  scroll-padding-bottom: calc(
    max(var(--stock-section-gap), var(--app-safe-bottom)) + 44px
  );
}

.history-day {
  gap: 0;
}

.history-day::before {
  content: "";
  position: absolute;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.history-day.today::before,
.history-day.selected::before {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: 36px;
  height: 36px;
  border: 0;
  transform: translate(-50%, -50%);
}

.history-day.has-success::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--status-success) 29%, transparent) 0%,
    color-mix(in srgb, var(--status-success) 16%, transparent) 50%,
    transparent 82%
  );
}

.history-day.has-pending::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--status-pending) 31%, transparent) 0%,
    color-mix(in srgb, var(--status-pending) 17%, transparent) 50%,
    transparent 82%
  );
}

.history-day.has-rest::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--status-rest) 30%, transparent) 0%,
    color-mix(in srgb, var(--status-rest) 16%, transparent) 50%,
    transparent 82%
  );
}

.history-day.has-violation::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--status-danger) 32%, transparent) 0%,
    color-mix(in srgb, var(--status-danger) 17%, transparent) 50%,
    transparent 82%
  );
}

.history-day.selected::before {
  box-shadow:
    inset 0 0 8px color-mix(in srgb, var(--time-glow, transparent) 28%, transparent),
    0 0 6px color-mix(in srgb, var(--time-glow, transparent) 12%, transparent);
}

.history-day.selected[data-calendar-status="none"]::before,
.history-day.today[data-calendar-status="none"]::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--time-accent, #c88b3a) 20%, transparent) 0%,
    color-mix(in srgb, var(--time-accent, #c88b3a) 10%, transparent) 50%,
    transparent 82%
  );
}

.history-day.selected > span {
  color: var(--time-text-strong);
  text-shadow: 0 0 5px color-mix(in srgb, var(--time-glow) 30%, transparent);
}

.history-day > i {
  display: none;
}

.history-detail > header::after {
  content: none;
}

.history-calendar-legend {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 6px 0 0;
  color: var(--time-muted);
  font-size: 11px;
}

.history-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.history-calendar-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 5px color-mix(in srgb, var(--status-success) 34%, transparent);
}

.history-calendar-legend i.rest {
  background: var(--status-rest);
  box-shadow: 0 0 5px color-mix(in srgb, var(--status-rest) 28%, transparent);
}

.history-calendar-legend i.pending {
  background: var(--status-pending);
  box-shadow: 0 0 5px color-mix(in srgb, var(--status-pending) 32%, transparent);
}

.history-calendar-legend i.violation {
  background: var(--status-danger);
  box-shadow: 0 0 5px color-mix(in srgb, var(--status-danger) 30%, transparent);
}

.history-rule-filter {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  margin-top: var(--stock-row-gap);
  padding-left: 12px;
  color: var(--time-text);
  background: color-mix(in srgb, var(--time-accent) 9%, transparent);
  font-size: var(--stock-copy-size);
}

.history-rule-filter[hidden] {
  display: none;
}

.history-rule-filter span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-rule-filter button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--time-muted);
  background: transparent;
}

.history-rule-filter svg {
  width: 17px;
  height: 17px;
}

.history-entry:not(.primary-project),
.history-empty {
  min-height: 0;
  padding: 0 4px;
  border: 0;
  border-image: none;
}

.history-entry.primary-project {
  min-height: 82px;
  margin: 0;
  padding: var(--stock-row-gap) 12px;
}

.history-calendar-panel::after,
.history-detail > header::after,
.interventions-header::after,
.history-header::after,
.participant-preview-tabs::after,
.interventions-summary::after {
  opacity: 0.66;
}

#shopPanel .collection-tabs {
  min-height: 44px;
  position: relative;
  border: 0;
  background: transparent;
}

#shopPanel .collection-tabs::after {
  content: none;
}

#shopPanel .collection-tabs button {
  height: 44px;
  color: var(--time-muted);
  border: 0;
  background: transparent;
  font-size: 14px;
}

#shopPanel .collection-tabs button + button {
  border: 0;
}

#shopPanel .collection-tabs button.active {
  color: var(--time-text-strong);
  background:
    linear-gradient(
      90deg,
      transparent,
      color-mix(in srgb, var(--time-accent) 9%, transparent),
      transparent
    );
}

#shopPanel .collection-tabs button.active::after {
  content: none;
}

#inventoryPanel .inventory-loadout-slot.equipped:nth-child(odd) {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--time-accent, #c88b3a) 7%, transparent),
      transparent 76%
    );
}

#inventoryPanel .inventory-loadout-slot.equipped:nth-child(even) {
  background:
    linear-gradient(
      270deg,
      color-mix(in srgb, var(--time-accent, #c88b3a) 7%, transparent),
      transparent 76%
    );
}

#weekly-summaryPanel .weekly-summary-rules-chapter {
  grid-template-rows: auto minmax(0, 1fr);
}

#weekly-summaryPanel .weekly-summary-counsel-chapter {
  grid-template-rows: auto auto;
}

/* Intervention check-in follows the same visual grammar as the full-screen panels. */
.checkin-layer {
  background: color-mix(in srgb, var(--time-panel-deep, #050608) 88%, transparent);
}

.checkin-sheet {
  max-height: min(86dvh, 720px);
  background:
    radial-gradient(
      ellipse at 50% 0,
      color-mix(in srgb, var(--time-accent, #c88b3a) 7%, transparent),
      transparent 40%
    ),
    color-mix(in srgb, var(--time-panel-deep, #050608) 99%, #020304);
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.82);
}

.checkin-sheet::before,
.checkin-header::after {
  right: 18px;
  left: 18px;
  height: 8px;
  background: var(--stock-divider-fill);
  -webkit-mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
}

.checkin-header {
  min-height: 82px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 0;
  padding: 10px 8px 14px;
}

.checkin-header > div {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: var(--stock-copy-gap);
  text-align: center;
}

.checkin-sphere {
  justify-content: center;
  gap: 7px;
  font-size: var(--stock-kicker-size);
}

.checkin-sphere-icon {
  width: 18px;
  height: 18px;
}

.checkin-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.checkin-close {
  grid-column: 3;
  width: 44px;
  height: 44px;
  align-self: start;
  color: var(--time-muted, #a6977b);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.checkin-close svg {
  width: 20px;
  height: 20px;
}

.checkin-body {
  display: grid;
  align-content: start;
  gap: var(--stock-section-gap);
  padding: var(--stock-section-gap) 18px;
}

.checkin-description,
.checkin-voluntary-note {
  margin: 0;
}

.checkin-description {
  color: var(--time-muted, #a6977b);
  font-size: var(--stock-copy-size);
  line-height: 1.45;
  text-align: center;
}

.checkin-voluntary-note {
  padding: 10px 8px;
  border-style: solid;
  border-width: 1px 0;
  border-image-source: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-line, #98815a) 52%, transparent) 14%,
    color-mix(in srgb, var(--time-line, #98815a) 52%, transparent) 86%,
    transparent
  );
  border-image-slice: 1;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent, #c88b3a) 7%, transparent),
    transparent
  );
}

.checkin-state-line,
.metric-control {
  min-height: 46px;
  padding: 0 4px;
  border: 0;
  position: relative;
}

.checkin-state-line::after,
.metric-control::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 8px;
  pointer-events: none;
  background: var(--stock-divider-fill);
  -webkit-mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  opacity: 0.42;
}

.metric-stepper {
  grid-template-columns: 40px 64px 40px;
  align-items: center;
  border: 0;
  background: transparent;
}

.metric-stepper button,
.metric-stepper input {
  min-height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.metric-stepper button {
  width: 40px;
  height: 40px;
  color: var(--time-muted, #a6977b);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
}

.metric-stepper button:active,
.metric-stepper button:not(.is-pressed) {
  background: transparent;
}

.metric-stepper button.is-pressed {
  color: var(--time-text-strong, #fff0c7);
  background: transparent;
}

.metric-stepper input {
  width: 64px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--stock-title-size);
}

.weekdays-control {
  margin: 0;
  padding: 0;
  border: 0;
}

.weekdays-control header {
  align-items: center;
}

.weekday-buttons {
  gap: 6px;
  margin-top: var(--stock-row-gap);
}

.weekday-buttons button {
  height: 42px;
  border: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.weekday-buttons button::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border: 1px solid color-mix(in srgb, var(--time-line, #98815a) 62%, transparent);
  border-radius: 50%;
  transform: translateX(-50%);
}

.weekday-buttons button.active {
  color: var(--time-text-strong, #fff0c7);
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent, #c88b3a) 12%, transparent),
    transparent
  );
  box-shadow: none;
}

.weekday-buttons button.active::before {
  border-color: var(--time-accent, #d8c996);
  background: var(--time-accent, #d8c996);
  box-shadow: 0 0 4px var(--time-glow, transparent);
}

.weekday-buttons button.selected {
  color: var(--time-text-strong, #fff0c7);
  border: 0;
  box-shadow: inset 0 -1px color-mix(in srgb, var(--time-accent, #d8c996) 68%, transparent);
}

.weekday-buttons button.today::after {
  top: 4px;
  bottom: auto;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.weekday-inspection {
  margin-top: var(--stock-row-gap);
  padding-top: var(--stock-row-gap);
  border: 0;
  justify-content: center;
  text-align: center;
}

.checkin-actions {
  gap: var(--stock-row-gap);
  padding: var(--stock-row-gap) 18px max(var(--stock-section-gap), var(--app-safe-bottom));
  background: linear-gradient(
    0deg,
    color-mix(in srgb, var(--time-panel-deep, #050608) 99%, #020304),
    transparent
  );
}

.checkin-status-actions {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: var(--stock-row-gap);
  min-height: 44px;
}

.checkin-status-actions.no-rest:not(.limit-mode) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
}

.checkin-status-actions.limit-mode,
.checkin-status-actions.extra-mode,
.checkin-status-actions.extra-mode.no-rest:not(.limit-mode) {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
}

.checkin-status-actions button {
  width: 100%;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px 6px;
  color: var(--time-muted, #a6977b);
  border: 1px solid transparent;
  border-image: none;
  background: transparent;
  font-size: var(--stock-copy-size);
  line-height: 1.2;
  text-align: center;
  box-sizing: border-box;
}

.checkin-status-actions button > span:first-child {
  width: auto;
  height: auto;
  flex-basis: auto;
}

.checkin-status-actions button.active {
  color: var(--time-text-strong, #fff0c7);
  border: 1px solid color-mix(in srgb, var(--time-accent, #d8c996) 72%, transparent);
  border-image: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent, #c88b3a) 12%, transparent),
    transparent
  );
  box-shadow: none;
}

.checkin-status-actions .danger-action {
  color: var(--time-muted, #a6977b);
  border: 1px solid transparent;
  border-image: none;
}

.checkin-status-actions .danger-action.active {
  color: #e7aaaa;
  border: 1px solid rgba(184, 102, 102, 0.76);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(137, 52, 59, 0.18),
    transparent
  );
  box-shadow: none;
}

.confirm-checkin {
  min-height: 52px;
  font-size: var(--stock-title-size);
}

.belief-confirm.confirm-checkin,
.belief-confirm.confirm-checkin:enabled,
.belief-confirm.confirm-checkin:disabled,
.belief-confirm.confirm-checkin:focus,
.belief-confirm.confirm-checkin:focus-visible,
#weekly-summaryPanel .weekly-summary-confirm {
  border: 0;
  border-image: none;
  background: var(--featured-surface);
  outline: 0;
  box-shadow: none;
}

.intervention-row.swipe-completion-ready {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transform: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease;
  will-change: auto;
}

.interventions-scroll {
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

.app-shell.interventions-open {
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  touch-action: none;
}

.app-shell.interventions-open .interventions-view {
  width: 100%;
  height: 100%;
  max-height: 100%;
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.app-shell.interventions-open .interventions-scroll {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: none;
  touch-action: pan-y;
}

.interventions-scroll.intervention-swipe-lock {
  overscroll-behavior: none;
  scroll-behavior: auto;
  overflow-y: hidden;
}

.intervention-row.swipe-completion-ready.is-swipe-tracking {
  touch-action: none;
  transform: translate3d(var(--intervention-swipe-x, 0), 0, 0);
  transition: none;
  will-change: transform;
  backface-visibility: hidden;
}

html.swipe-gesture-captured,
html.swipe-gesture-captured body {
  overscroll-behavior: none;
}

.intervention-row.primary-project.swipe-completion-ready::before,
.intervention-row.primary-project.swipe-completion-ready::after {
  pointer-events: none;
}

.intervention-row.swipe-completion-ready.is-swipe-armed {
  color: var(--time-text-strong, #fff0c7);
}

.intervention-row.swipe-completion-ready.is-swipe-success.is-swipe-armed {
  background: color-mix(in srgb, var(--status-success) 14%, transparent);
}

.intervention-row.swipe-completion-ready.is-swipe-rest.is-swipe-armed {
  background: color-mix(in srgb, var(--status-rest) 14%, transparent);
}

.intervention-row.swipe-completion-ready.is-swipe-blocked.is-swipe-armed {
  background: color-mix(in srgb, var(--status-danger) 14%, transparent);
}

.intervention-row.swipe-completion-ready.is-swipe-clear.is-swipe-armed {
  background: color-mix(in srgb, var(--time-text-strong) 7%, transparent);
}

.intervention-swipe-reveal {
  width: calc(
    var(--intervention-swipe-distance, 0px) + var(--stock-gutter, 18px)
  );
  max-width: calc(82px + var(--stock-gutter, 18px));
  height: 100%;
  position: absolute;
  top: 0;
  display: none;
  place-items: center;
  color: var(--time-text, #d8ccb0);
  font-family: var(--font-display);
  font-size: var(--stock-copy-size);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
  transition:
    color 140ms ease,
    opacity 140ms ease;
}

.intervention-swipe-reveal[hidden] {
  display: none;
}

.intervention-row.is-swipe-tracking
  .intervention-swipe-reveal:not([hidden]) {
  display: grid;
}

.intervention-swipe-reveal.swipe-left {
  left: 100%;
}

.intervention-swipe-reveal.swipe-right {
  right: 100%;
}

.intervention-swipe-reveal.success {
  color: var(--status-success-strong);
}

.intervention-swipe-reveal.success.swipe-left {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--status-success) 8%, transparent),
    color-mix(in srgb, var(--status-success) 30%, var(--time-panel-deep))
  );
}

.intervention-swipe-reveal.success.swipe-right {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--status-success) 30%, var(--time-panel-deep)),
    color-mix(in srgb, var(--status-success) 8%, transparent)
  );
}

.intervention-swipe-reveal.rest {
  color: var(--status-rest-strong);
}

.intervention-swipe-reveal.rest.swipe-right {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--time-panel-deep) 70%, var(--status-rest) 30%),
    color-mix(in srgb, var(--status-rest) 8%, transparent)
  );
}

.intervention-swipe-reveal.rest.swipe-left {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--status-rest) 8%, transparent),
    color-mix(in srgb, var(--time-panel-deep) 70%, var(--status-rest) 30%)
  );
}

.intervention-swipe-reveal.clear {
  color: var(--time-text-strong, #f1ecdf);
}

.intervention-swipe-reveal.blocked {
  color: var(--status-danger-strong);
}

.intervention-swipe-reveal.blocked.swipe-left {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--status-danger) 8%, transparent),
    color-mix(in srgb, var(--status-danger) 34%, var(--time-panel-deep))
  );
}

.intervention-swipe-reveal.clear.swipe-left {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--time-text-strong) 5%, transparent),
    color-mix(in srgb, var(--time-text-strong) 18%, var(--time-panel-deep))
  );
}

.intervention-swipe-reveal.clear.swipe-right {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--time-text-strong) 18%, var(--time-panel-deep)),
    color-mix(in srgb, var(--time-text-strong) 5%, transparent)
  );
}

.intervention-swipe-reveal.blocked.swipe-right {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--status-danger) 34%, var(--time-panel-deep)),
    color-mix(in srgb, var(--status-danger) 8%, transparent)
  );
}

.intervention-swipe-reveal.is-active {
  opacity: var(--intervention-swipe-progress, 0);
}

.intervention-swipe-reveal.intervention-swipe-portal {
  width: var(--swipe-portal-width, 0);
  max-width: calc(82px + var(--stock-gutter, 18px));
  height: var(--swipe-portal-height, 0);
  position: absolute;
  top: var(--swipe-portal-top, 0);
  left: var(--swipe-portal-left, 0);
  right: auto;
  display: none;
  overflow: hidden;
  z-index: 70;
}

.intervention-swipe-reveal.intervention-swipe-portal.is-active {
  display: grid;
  opacity: var(--intervention-swipe-progress, 0);
}

.intervention-swipe-reveal.intervention-swipe-portal.swipe-left,
.intervention-swipe-reveal.intervention-swipe-portal.swipe-right {
  right: auto;
}

.intervention-row.is-swipe-armed .intervention-swipe-reveal.is-active {
  opacity: 1;
}

.intervention-row.primary-project.swipe-completion-ready
  > .intervention-swipe-reveal {
  z-index: 6;
}

.intervention-row.primary-project.swipe-completion-ready.is-swipe-tracking {
  overflow: visible;
}

#interventionsView .intervention-row.primary-project[data-status="success"] {
  --time-accent: var(--status-success);
  --time-glow: var(--status-success-strong);
}

#interventionsView
  .intervention-row.primary-project:is(
    [data-status="day_off"],
    [data-status="exception"]
  ) {
  --time-accent: var(--status-rest);
  --time-glow: var(--status-rest-strong);
}

#interventionsView .intervention-row.primary-project[data-status="violation"] {
  --time-accent: var(--status-danger);
  --time-glow: var(--status-danger-strong);
}

#interventionsView .intervention-row.primary-project .rule-reward {
  color: var(--time-accent, var(--time-text, #d8ccb0));
}

#interventionsView
  .intervention-row.primary-project.swipe-completion-ready.is-swipe-success {
  --time-accent: var(--status-success);
  --time-glow: var(--status-success-strong);
}

#interventionsView
  .intervention-row.primary-project.swipe-completion-ready.is-swipe-rest {
  --time-accent: var(--status-rest);
  --time-glow: var(--status-rest-strong);
}

#interventionsView
  .intervention-row.primary-project.swipe-completion-ready.is-swipe-blocked {
  --time-accent: var(--status-danger);
  --time-glow: var(--status-danger-strong);
}

#interventionsView
  .intervention-row.primary-project.swipe-completion-ready.is-swipe-clear {
  --time-accent: color-mix(
    in srgb,
    var(--time-text-strong) 58%,
    var(--time-panel-deep)
  );
  --time-glow: var(--time-text, #d8ccb0);
}

#interventionsView .intervention-row[data-status="success"] {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-success) 13%, transparent) 14%,
    color-mix(in srgb, var(--status-success) 7%, transparent) 86%,
    transparent
  );
}

#interventionsView .intervention-row.week-plan-complete {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-success) 13%, transparent) 14%,
    color-mix(in srgb, var(--status-success) 7%, transparent) 86%,
    transparent
  );
}

#interventionsView
  .intervention-row.week-plan-complete
  :is(.rule-rune, .rule-copy, .rule-row-meta) {
  opacity: 0.68;
  filter: saturate(0.76);
}

#interventionsView
  .intervention-row.week-plan-complete
  :is(.rule-copy h3, .rule-status-glyph) {
  opacity: 1;
}

#interventionsView .intervention-row.week-plan-complete .rule-status-glyph {
  color: var(--status-success);
}

#interventionsView .intervention-row[data-status="day_off"],
#interventionsView .intervention-row[data-status="exception"] {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-rest) 13%, transparent) 14%,
    color-mix(in srgb, var(--status-rest) 7%, transparent) 86%,
    transparent
  );
}

#interventionsView .intervention-row[data-status="violation"] {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-danger) 15%, transparent) 14%,
    color-mix(in srgb, var(--status-danger) 8%, transparent) 86%,
    transparent
  );
}

#interventionsView .intervention-row[data-status="in_progress"] {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent) 14%, transparent) 14%,
    color-mix(in srgb, var(--time-accent) 6%, transparent) 86%,
    transparent
  );
}

#interventionsView .intervention-row[data-status="in_progress"] :is(
  .rule-rune,
  .rule-copy,
  .rule-row-meta
) {
  opacity: 1;
  filter: none;
}

#interventionsView
  :is(
    .intervention-row[data-status="success"],
    .intervention-row[data-status="day_off"],
    .intervention-row[data-status="exception"],
    .intervention-row[data-status="violation"]
  )
  :is(.rule-rune, .rule-copy, .rule-row-meta) {
  opacity: 0.68;
  filter: saturate(0.76);
}

#interventionsView
  :is(
    .intervention-row[data-status="success"],
    .intervention-row[data-status="day_off"],
    .intervention-row[data-status="exception"],
    .intervention-row[data-status="violation"]
  )
  :is(.rule-copy h3, .rule-status-glyph) {
  opacity: 1;
}

#interventionsView .intervention-row[data-status="in_progress"] .rule-copy h3,
#interventionsView .intervention-row[data-status="in_progress"] .rule-status-glyph,
#interventionsView .intervention-row[data-status="in_progress"] .rule-progress-value {
  color: var(--time-accent);
}

.rule-progress-value {
  gap: 5px;
}

.rule-progress-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

#interventionsView
  .intervention-row[data-status="success"]
  .rule-status-glyph {
  color: var(--status-success);
}

#interventionsView
  :is(
    .intervention-row[data-status="day_off"],
    .intervention-row[data-status="exception"]
  )
  .rule-status-glyph {
  color: var(--status-rest);
}

#interventionsView
  .intervention-row[data-status="violation"]
  .rule-status-glyph {
  color: var(--status-danger);
}

#interventionsView .intervention-row.swipe-completion-ready.is-swipe-success {
  --swipe-action-color: var(--status-success-strong);
  background: color-mix(in srgb, var(--status-success) 14%, transparent);
}

#interventionsView .intervention-row.swipe-completion-ready.is-swipe-rest {
  --swipe-action-color: var(--status-rest-strong);
  background: color-mix(in srgb, var(--status-rest) 14%, transparent);
}

#interventionsView .intervention-row.swipe-completion-ready.is-swipe-blocked {
  --swipe-action-color: var(--status-danger-strong);
  background: color-mix(in srgb, var(--status-danger) 14%, transparent);
}

#interventionsView .intervention-row.swipe-completion-ready.is-swipe-clear {
  --swipe-action-color: var(--time-text-strong, #f1ecdf);
  background: color-mix(in srgb, var(--time-text-strong) 7%, transparent);
}

#interventionsView
  .intervention-row.swipe-completion-ready:is(
    .is-swipe-success,
    .is-swipe-rest,
    .is-swipe-blocked,
    .is-swipe-clear
  )
  :is(.rule-rune, .rule-copy, .rule-row-meta) {
  opacity: 1;
  filter: none;
}

#interventionsView
  .intervention-row.swipe-completion-ready:is(
    .is-swipe-success,
    .is-swipe-rest,
    .is-swipe-blocked,
    .is-swipe-clear
  )
  :is(
    .rule-rune,
    .rule-copy h3,
    .rule-copy p,
    .rule-reward,
    .rule-status-glyph,
    .rule-progress-pips,
    .rule-extra-count,
    .primary-project-label
  ) {
  color: var(--swipe-action-color);
}

@media (max-width: 390px) {
  .interventions-heading {
    width: min(calc(100% - 112px), 260px);
  }

  .interventions-heading h1 {
    font-size: 21px;
  }

  .interventions-heading time {
    font-size: 12px;
  }

  .daily-tally {
    right: 50px;
  }

  .history-header .daily-tally {
    right: 16px;
  }

  .history-detail > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 34px;
    align-items: center;
  }

  .history-detail h2 {
    min-width: 0;
    white-space: nowrap;
    font-size: 14px;
  }
}

/* Data safety commands follow the same icon, copy and spacing contract. */
.data-settings-actions {
  display: grid;
  gap: 15px;
  margin-top: 15px;
}

.data-settings-actions + .setting-row {
  margin-top: 15px;
}

.world-level-setting {
  gap: 12px;
}

.window-layer[data-tab="settings"] .world-level-setting {
  padding-right: 2px;
}

.world-level-setting > span {
  min-width: 0;
}

.world-level-stepper {
  display: grid;
  grid-template-columns: repeat(2, 38px) 44px 38px;
  align-items: center;
  min-height: 44px;
  color: var(--time-accent);
  background: color-mix(in srgb, var(--time-panel-soft) 58%, transparent);
  pointer-events: auto;
}

.world-level-stepper button,
.world-level-stepper input {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: center;
  pointer-events: auto;
}

.world-level-stepper button {
  display: grid;
  place-items: center;
}

.world-level-stepper button[hidden] {
  display: grid;
  visibility: hidden;
}

.world-level-stepper button svg {
  width: 18px;
  height: 18px;
}

.world-level-stepper input {
  position: static;
  inset: auto;
  opacity: 1;
  pointer-events: auto;
  font: 18px/1 var(--font-display);
  color: var(--time-text-strong);
  outline: 0;
  appearance: textfield;
}

.world-level-stepper:focus-within {
  background: color-mix(in srgb, var(--time-glow) 76%, var(--time-panel-soft));
  box-shadow: inset 0 -1px var(--time-accent);
}

@media (max-width: 390px) {
  .world-level-stepper {
    grid-template-columns: repeat(2, 34px) 38px 34px;
  }
}

.setting-command {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  color: var(--time-text);
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.setting-command > span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--time-accent);
}

.setting-command svg {
  width: 22px;
  height: 22px;
}

.setting-command > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.setting-command strong {
  font-size: var(--stock-title-size);
  font-weight: 400;
  line-height: 1.25;
}

.setting-command small,
.data-settings-status {
  color: var(--time-muted);
  font-size: var(--stock-copy-size);
  line-height: 1.4;
}

.setting-command.is-confirming {
  color: var(--time-text-strong);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent) 10%, transparent),
    transparent
  );
}

.setting-command:disabled {
  opacity: 0.5;
}

.data-settings-status {
  margin: 0 4px;
}

.data-settings-status:empty {
  display: none;
}

.data-settings-status[data-tone="saved"] {
  color: var(--time-accent);
}

.data-settings-status[data-tone="error"] {
  color: color-mix(in srgb, #d98181 78%, var(--time-text));
}

/* Preserve the approved geometry while expanding compact mobile hit areas. */
.hud-actions .hud-button,
.level-progress {
  position: relative;
}

.hud-actions .hud-button::before {
  content: "";
  position: absolute;
  inset: 0 -4px;
}

.level-progress::before {
  content: "";
  position: absolute;
  inset: -6px 0;
}

:is(
  button,
  [role="button"],
  [role="tab"],
  input,
  select
):focus-visible {
  outline: 1px solid var(--time-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .animated-background .weather-clouds::before {
    animation-duration: 10s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-clouds::after {
    animation-duration: 15s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-fog-back::before {
    animation-duration: 7s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-fog-back::after {
    animation-duration: 10s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-fog-low::before {
    animation-duration: 8s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-fog-low::after {
    animation-duration: 11s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-rain-back::before {
    animation-duration: 1180ms !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-rain-back::after {
    animation-duration: 1740ms !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-rain-front::before {
    animation-duration: 920ms !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-rain-front::after {
    animation-duration: 1360ms !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-bird {
    animation-duration: var(--bird-duration) !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-bird svg {
    animation-duration: 1.7s !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .bird-wing {
    animation-duration: 760ms !important;
    animation-iteration-count: infinite !important;
  }

  .animated-background .weather-bird:nth-child(3n + 2) .bird-wing {
    animation-duration: 910ms !important;
  }

  .animated-background .weather-bird:nth-child(3n + 3) .bird-wing {
    animation-duration: 640ms !important;
  }

  .animated-background :is(.arch-drip-bead, .arch-drop, .arch-drip-impact) {
    animation-duration: var(--drip-duration) !important;
    animation-iteration-count: infinite !important;
  }
}

.event-list .event-entry {
  touch-action: pan-y;
  transform: translate3d(var(--notification-swipe-x, 0), 0, 0);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.window-body.notification-swipe-lock {
  overscroll-behavior: none;
  scroll-behavior: auto;
  overflow-y: hidden;
}

.window-body {
  overflow-x: hidden;
}

:is(
  .belief-gate,
  .checkin-layer,
  .checkin-sheet,
  .window-layer,
  .game-window,
  .interventions-view,
  .history-view
) {
  background-color: var(--time-screen-solid, #050608);
}

:is(.window-layer, .window-layer.immersive-window-open, .checkin-layer) {
  backdrop-filter: none;
}

.event-list .event-entry.is-swiping {
  touch-action: none;
  transition: none;
}

.event-delete-reveal {
  position: absolute;
  top: 0;
  left: 100%;
  width: 112px;
  height: 100%;
  display: none;
  place-items: center;
  color: var(--status-danger-strong);
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--status-danger) 8%, transparent),
      color-mix(in srgb, var(--status-danger) 34%, var(--time-panel-deep))
    );
  font-family: var(--font-display);
  font-size: var(--stock-copy-size);
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    color 140ms ease,
    opacity 140ms ease;
}

.event-list .event-entry.is-swiping .event-delete-reveal {
  display: grid;
  opacity: 0.72;
}

.event-list .event-entry.will-dismiss .event-delete-reveal {
  color: var(--status-danger-strong);
  opacity: 1;
}

.event-list .event-entry.is-dismissing {
  opacity: 0;
  transform: translate3d(-110%, 0, 0);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .event-list .event-entry {
    transition: none;
  }
}

/* Notification center: one calm chronological feed with the stock 18px rhythm. */
#eventsPanel .event-list {
  display: grid;
  gap: 0;
  padding: 0 4px 20px;
  overflow-x: visible;
}

#eventsPanel .event-list > .event-entry {
  min-height: 74px;
  padding: 0 4px 18px;
}

#eventsPanel .event-list > .event-entry + .event-entry {
  padding-top: 18px;
}

#eventsPanel
  .event-list
  > .event-entry.is-read
  > :not(.event-delete-reveal) {
  opacity: 0.72;
}

#eventsPanel
  .event-list
  > .event-entry.is-read:focus-visible
  > :not(.event-delete-reveal) {
  opacity: 1;
}

#eventsPanel .event-list > .event-entry:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 8px;
  background: var(--stock-divider-fill);
  -webkit-mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  pointer-events: none;
}

#eventsPanel .event-list > .event-entry h2 {
  margin: 0 0 3px;
  line-height: 1.28;
}

#eventsPanel .event-list > .event-entry p {
  line-height: 1.4;
}

@media (max-width: 430px) {
  #eventsPanel .event-list {
    padding-inline: 0;
  }

  #eventsPanel .event-list > .event-entry {
    grid-template-columns: var(--stock-icon-box) minmax(0, 1fr) 42px;
    gap: 10px;
  }
}

/* Settings text is informational; only the 44px switch area changes a value. */
.window-layer[data-tab="settings"] .setting-row {
  padding-right: 48px;
  cursor: default;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

.window-layer[data-tab="settings"] .setting-row .toggle,
.window-layer[data-tab="settings"] .setting-row input {
  pointer-events: auto;
}

.window-layer[data-tab="settings"] .setting-row .toggle {
  width: 44px;
  height: 44px;
  right: -3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The XP value ends on the same vertical guide as the settings glyph. */
.level-progress {
  padding-right: 8px;
}

/* Shared primary-project frame and motion live together in this theme. */
:is(
  .intervention-row.primary-project,
  .history-entry.primary-project,
  #weekly-summaryPanel .weekly-summary-rule.primary-project,
  #statsPanel .intervention-stat-row.primary-project,
  .friend-page .intervention-stat-row.primary-project
) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--time-accent) 72%, transparent) 18%, color-mix(in srgb, var(--time-accent) 72%, transparent) 82%, transparent) top center / 100% 1.7px no-repeat,
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--time-accent) 72%, transparent) 18%, color-mix(in srgb, var(--time-accent) 72%, transparent) 82%, transparent) bottom center / 100% 1.7px no-repeat,
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--time-accent) 62%, transparent) 24%, color-mix(in srgb, var(--time-accent) 62%, transparent) 76%, transparent) left center / 1.7px 100% no-repeat,
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--time-accent) 62%, transparent) 24%, color-mix(in srgb, var(--time-accent) 62%, transparent) 76%, transparent) right center / 1.7px 100% no-repeat,
    radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--time-accent) 17%, transparent), transparent 64%),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--time-accent) 13%, transparent) 14%, color-mix(in srgb, var(--time-accent) 13%, transparent) 86%, transparent);
  box-shadow:
    inset 0 0 24px color-mix(in srgb, var(--time-accent) 8%, transparent),
    0 0 14px color-mix(in srgb, var(--time-glow) 10%, transparent);
}

:is(
  .intervention-row.primary-project,
  .history-entry.primary-project,
  #weekly-summaryPanel .weekly-summary-rule.primary-project,
  #statsPanel .intervention-stat-row.primary-project,
  .friend-page .intervention-stat-row.primary-project
)::before {
  animation: main-project-border-orbit 5.2s linear infinite;
}

:is(
  .intervention-row.primary-project,
  .history-entry.primary-project,
  #weekly-summaryPanel .weekly-summary-rule.primary-project,
  #statsPanel .intervention-stat-row.primary-project,
  .friend-page .intervention-stat-row.primary-project
)::after {
  content: "";
  z-index: 1;
  -webkit-mask: none;
  mask: none;
  animation: main-project-surface-shimmer 6.4s ease-in-out infinite;
}

/* The summary once replaced the shared orbit with a static four-line frame. */
#weekly-summaryPanel .weekly-summary-rule.primary-project::before {
  z-index: 3;
  width: auto;
  height: auto;
  padding: 1.7px;
  background:
    conic-gradient(
      from var(--project-orbit-angle),
      transparent 0deg 238deg,
      color-mix(in srgb, var(--time-accent) 22%, transparent) 258deg,
      color-mix(in srgb, var(--time-accent) 78%, var(--time-text)) 302deg,
      var(--time-text-strong) 326deg,
      color-mix(in srgb, var(--time-accent) 68%, transparent) 346deg,
      transparent 360deg
    );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: drop-shadow(
    0 0 3px color-mix(in srgb, var(--time-glow) 46%, transparent)
  );
  animation: main-project-border-orbit 5.2s linear infinite;
}

#weekly-summaryPanel .weekly-summary-rule.primary-project::after {
  z-index: 1;
}

/* Interventions use the same centered full-screen title contract as every window. */
.interventions-header {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding:
    max(9px, var(--app-safe-top))
    52px
    var(--stock-section-gap);
}

.interventions-header::after {
  right: 20px;
  left: 20px;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      transparent,
      color-mix(
        in srgb,
        var(--time-accent, #d8b46f) 48%,
        var(--time-line, #655846)
      ) 18%,
      color-mix(
        in srgb,
        var(--time-accent, #d8b46f) 48%,
        var(--time-line, #655846)
      ) 82%,
      transparent
    );
  opacity: 1;
  filter: drop-shadow(
    0 0 3px color-mix(in srgb, var(--time-glow, transparent) 26%, transparent)
  );
}

.interventions-header .interventions-heading {
  width: auto;
  gap: 1px;
  justify-self: center;
}

.interventions-view .interventions-heading time {
  color: var(--time-accent);
  font-size: var(--stock-kicker-size);
  line-height: normal;
}

.interventions-view .interventions-heading h1 {
  font-size: 22px;
  line-height: normal;
}

.interventions-header :is(.interventions-back, .interventions-close) {
  width: 44px;
  height: 44px;
  position: absolute;
  top: max(9px, var(--app-safe-top));
}

.interventions-header .interventions-back {
  left: 8px;
}

.interventions-header .interventions-close {
  right: 8px;
}

#friendPanel .friend-details-chapter,
#friendPanel .friend-details-scroll {
  overscroll-behavior: none;
}

@media (max-width: 390px) {
  .interventions-header .interventions-heading {
    width: auto;
  }
}

/* Compact intervention editor: state first, details only after an explicit choice. */
.checkin-state-line {
  width: 100%;
  color: inherit;
  border: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.checkin-state-line:active,
.checkin-state-line:focus,
.checkin-state-line:focus-visible {
  transform: none;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.checkin-state-line:disabled {
  opacity: 1;
}

.checkin-state-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--time-muted, #a6977b);
  opacity: 0;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    color 180ms ease;
}

.checkin-state-line.is-editable .checkin-state-chevron {
  opacity: 0.72;
}

.checkin-state-line.is-expanded .checkin-state-chevron {
  color: var(--time-accent, #d8c996);
  transform: rotate(180deg);
  opacity: 1;
}

#checkinCurrentState[data-status="success"] {
  color: var(--status-success-strong);
}

#checkinCurrentState[data-status="in_progress"] {
  color: var(--time-accent, #d8c996);
}

#checkinCurrentState:is([data-status="day_off"], [data-status="exception"]) {
  color: var(--status-rest-strong);
}

#checkinCurrentState[data-status="violation"] {
  color: var(--status-danger-strong);
}

.checkin-editor {
  display: grid;
  gap: var(--stock-section-gap);
  min-width: 0;
  animation: checkin-editor-reveal 180ms ease both;
}

.neck-routine-control {
  display: grid;
  min-width: 0;
  padding: 0 4px;
}

.neck-routine-control[hidden] {
  display: none;
}

.neck-routine-control > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--stock-row-gap);
}

.neck-routine-control button {
  min-height: 44px;
  padding: 8px 6px;
  color: var(--time-muted, #a6977b);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--stock-copy-size);
  line-height: 1.2;
  box-shadow: none;
  text-shadow: none;
}

.neck-routine-control button.active {
  color: var(--time-text, #d8ccb0);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-muted, #a6977b) 13%, transparent) 22%,
    color-mix(in srgb, var(--time-muted, #a6977b) 13%, transparent) 78%,
    transparent
  );
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--time-text, #d8ccb0) 48%, transparent);
}

.checkin-editor[hidden] {
  display: none;
}

@keyframes checkin-editor-reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#checkinLayer .checkin-status-actions {
  gap: var(--stock-row-gap);
  animation: checkin-editor-reveal 180ms ease both;
}

#checkinLayer .checkin-status-actions button {
  min-height: 44px;
  color: var(--time-muted, #a6977b);
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

#checkinLayer #markSuccess {
  color: color-mix(in srgb, var(--status-success-strong) 72%, var(--time-muted));
}

#checkinLayer #markRest {
  color: color-mix(in srgb, var(--status-rest-strong) 72%, var(--time-muted));
}

#checkinLayer #markViolation {
  color: color-mix(in srgb, var(--status-danger-strong) 72%, var(--time-muted));
}

#checkinLayer #markSuccess.active {
  color: var(--status-success-strong);
  border-color: color-mix(in srgb, var(--status-success) 76%, transparent);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-success) 18%, transparent),
    transparent
  );
}

#checkinLayer #markSuccess.active.in-progress {
  color: var(--time-accent);
  border-color: color-mix(in srgb, var(--time-accent) 76%, transparent);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent) 18%, transparent),
    transparent
  );
}

.history-entry[data-status="in_progress"] .history-entry-state > span {
  color: var(--time-accent, #d8c996);
}

#checkinLayer #markRest.active {
  color: var(--status-rest-strong);
  border-color: color-mix(in srgb, var(--status-rest) 76%, transparent);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-rest) 18%, transparent),
    transparent
  );
}

#checkinLayer #markViolation.active {
  color: var(--status-danger-strong);
  border-color: color-mix(in srgb, var(--status-danger) 76%, transparent);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-danger) 18%, transparent),
    transparent
  );
}

.checkin-editor .metric-control {
  padding: 0 4px;
}

.checkin-editor .metric-stepper {
  border: 0;
  background: transparent;
}

.checkin-editor .metric-stepper button:disabled {
  cursor: default;
  pointer-events: none;
  color: color-mix(in srgb, var(--time-muted) 42%, transparent);
  opacity: 0.52;
}

.checkin-actions[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .checkin-editor {
    animation: none;
  }

  .checkin-state-chevron,
    #checkinLayer .checkin-status-actions button {
    transition: none;
  }
}

/* Mobile gesture and check-in polish. */
#interventionsView .intervention-row[data-status="success"] {
  --intervention-state-color: var(--status-success);
}

#interventionsView
  :is(
    .intervention-row[data-status="day_off"],
    .intervention-row[data-status="exception"]
  ) {
  --intervention-state-color: var(--status-rest);
}

#interventionsView .intervention-row[data-status="violation"] {
  --intervention-state-color: var(--status-danger);
}

#interventionsView .intervention-row[data-status="in_progress"] {
  --intervention-state-color: var(--time-accent);
}

#interventionsView .intervention-row[data-status="unmarked"] {
  --intervention-state-color: var(--time-muted);
}

#interventionsView
  .intervention-row[data-status]
  .reward-currency-icon {
  color: var(--intervention-state-color);
  filter:
    drop-shadow(0 1px 0 #000)
    drop-shadow(
      0 0 4px
      color-mix(in srgb, var(--intervention-state-color) 38%, transparent)
    );
}

#interventionsView
  .intervention-row.swipe-completion-ready:is(
    .is-swipe-success,
    .is-swipe-rest,
    .is-swipe-blocked,
    .is-swipe-clear
  )
  .reward-currency-icon {
  color: var(--swipe-action-color);
}

#checkinLayer
  :is(#markSuccess, #markRest, #markViolation):not(.active) {
  color: var(--time-muted, #a6977b);
  border-color: transparent !important;
  background: transparent;
}

#checkinLayer .checkin-status-actions button.active {
  box-shadow: none;
}

.checkin-actions .confirm-checkin,
.checkin-actions .confirm-checkin:disabled {
  border-width: 1px 0;
}

.checkin-state-line::after {
  content: none;
}

#checkinLayer .metric-control::after {
  content: none;
}

.checkin-layer.metric-input-focused .checkin-body {
  padding-bottom: max(34vh, 180px);
  scroll-padding-block: 12px max(34vh, 180px);
}

/* Check-in hierarchy: choose the day before its status and values. */
#checkinLayer .checkin-description {
  order: 1;
}

#checkinLayer .checkin-voluntary-note {
  order: 3;
}

#checkinLayer .checkin-status-actions {
  order: 4;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--stock-row-gap);
  min-height: 0;
  animation: none;
}

#checkinLayer .weekdays-control {
  order: 2;
}

#checkinLayer .checkin-editor {
  order: 5;
  gap: var(--stock-row-gap);
  padding-top: 2px;
  animation: none;
}

#checkinLayer .checkin-state-line {
  order: 6;
}

#checkinLayer .checkin-state-line[hidden] {
  display: none;
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  .checkin-state-line {
  margin: 0;
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  .checkin-body {
  row-gap: var(--stock-section-gap);
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  .checkin-state-line:has(#checkinCurrentState[data-status="success"]) {
  --friend-state-color: var(--status-success);
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  .checkin-state-line:has(
    #checkinCurrentState:is(
        [data-status="day_off"],
        [data-status="exception"]
      )
  ) {
  --friend-state-color: var(--status-rest);
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  .checkin-state-line:has(#checkinCurrentState[data-status="violation"]) {
  --friend-state-color: var(--status-danger);
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  :is(#checkinStateLabel, .checkin-state-chevron) {
  display: none;
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  .checkin-state-value {
  width: 100%;
  justify-content: center;
  text-align: center;
}

#checkinLayer.read-only-preview:is(
    [data-rule-type="daily_action"],
    [data-rule-type="daily_compliance"],
    [data-rule-type="quarterly"]
  )
  #checkinCurrentState {
  color: var(--friend-state-strong);
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--friend-state-strong) 58%, transparent);
}

#checkinLayer .checkin-status-actions #markSuccess {
  grid-column: auto;
  min-height: 44px;
  font-size: var(--stock-copy-size);
}

#checkinLayer .checkin-status-actions #markRest,
#checkinLayer .checkin-status-actions #markViolation {
  min-height: 44px;
}

#checkinLayer .checkin-status-actions.no-rest:not(.extra-mode) #markViolation {
  grid-column: auto;
  width: auto;
  justify-self: stretch;
}

#checkinLayer .checkin-status-actions.no-rest:not(.extra-mode) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#checkinLayer .checkin-status-actions.extra-mode #markSuccess {
  grid-column: 1 / -1;
}

#checkinLayer .checkin-status-actions button,
#checkinLayer .checkin-status-actions button:disabled,
#checkinLayer .checkin-status-actions button:focus,
#checkinLayer .checkin-status-actions button:focus-visible {
  opacity: 1;
  color: var(--time-muted, #a6977b);
  border: 0;
  border-image: none;
  outline: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  transition:
    opacity 170ms ease,
    color 170ms ease,
    background 170ms ease,
    text-shadow 170ms ease;
}

#checkinLayer .checkin-status-actions #markSuccess.active {
  color: var(--status-success-strong);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-success) 13%, transparent) 22%,
    color-mix(in srgb, var(--status-success) 13%, transparent) 78%,
    transparent
  );
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--status-success-strong) 58%, transparent);
}

#checkinLayer .checkin-status-actions #markSuccess.active.in-progress {
  color: var(--time-accent);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--time-accent) 13%, transparent) 22%,
    color-mix(in srgb, var(--time-accent) 13%, transparent) 78%,
    transparent
  );
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--time-accent) 58%, transparent);
}

#checkinLayer .checkin-status-actions #markRest.active {
  color: var(--status-rest-strong);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-rest) 13%, transparent) 22%,
    color-mix(in srgb, var(--status-rest) 13%, transparent) 78%,
    transparent
  );
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--status-rest-strong) 58%, transparent);
}

#checkinLayer .checkin-status-actions #markViolation.active {
  color: var(--status-danger-strong);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--status-danger) 14%, transparent) 22%,
    color-mix(in srgb, var(--status-danger) 14%, transparent) 78%,
    transparent
  );
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--status-danger-strong) 58%, transparent);
}

#checkinLayer
  .checkin-status-actions
  :is(#markSuccess, #markRest, #markViolation):not(.active) {
  opacity: 0.45;
  color: var(--time-muted, #a6977b);
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

#checkinLayer .checkin-status-actions button:focus-visible:not(:disabled) {
  outline: 1px dotted var(--time-muted, #a6977b);
  outline-offset: -3px;
}

#checkinLayer :is(.metric-control, .neck-routine-control, .completion-checklist) {
  transition:
    opacity 180ms ease,
    filter 180ms ease;
}

#checkinLayer
  :is(.metric-control, .neck-routine-control, .completion-checklist).is-locked {
  opacity: 0.34;
  filter: saturate(0.55);
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  #checkinLayer .checkin-status-actions button,
  #checkinLayer
    :is(.metric-control, .neck-routine-control, .completion-checklist) {
    transition: none;
  }
}

/* The reward is one status-colored unit: icon and numeric value move together. */
#interventionsView
  .intervention-row[data-status]
  .rule-reward {
  color: var(--intervention-state-color);
}

#interventionsView
  .intervention-row[data-status]
  .rule-reward
  .reward-currency-icon {
  color: inherit;
}

#interventionsView
  .intervention-row.swipe-completion-ready:is(
    .is-swipe-success,
    .is-swipe-rest,
    .is-swipe-blocked,
    .is-swipe-clear
  )
  .rule-reward {
  color: var(--swipe-action-color);
}

/* Compact sections with closer spacing between related input rows. */
#checkinLayer .checkin-body {
  --checkin-block-gap: 12px;
  gap: var(--checkin-block-gap);
  padding: var(--checkin-block-gap) 18px;
}

#checkinLayer .checkin-status-actions {
  margin: 0;
}

#checkinLayer .checkin-editor {
  gap: 8px;
  margin: 0;
  padding: 0;
}

#checkinLayer :is(.metric-control, .neck-routine-control) {
  margin: 0;
}

#checkinLayer .metric-control {
  min-height: 44px;
  padding: 0 4px;
}

#checkinLayer .weekdays-control {
  display: grid;
  gap: var(--stock-row-gap);
  margin: 0;
  padding: 0;
}

#checkinLayer .weekdays-control[hidden],
#checkinLayer .weekday-inspection[hidden] {
  display: none;
}

#checkinLayer .weekdays-control header {
  display: grid;
  gap: var(--stock-copy-gap);
  margin: 0;
}

#checkinLayer .weekday-buttons {
  gap: 6px;
  margin: 0;
}

/* Week days use the same success/rest/violation language as interventions. */
#checkinLayer .weekday-buttons button {
  --weekday-state-color: var(--time-accent, #d8c996);
  --weekday-state-strong: var(--time-text-strong, #fff0c7);
  height: 44px;
  padding: 0;
  color: var(--time-muted, #a6977b);
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  transition:
    color 170ms ease,
    background 170ms ease,
    text-shadow 170ms ease;
}

#checkinLayer .weekday-buttons button[data-status="success"] {
  --weekday-state-color: var(--status-success);
  --weekday-state-strong: var(--status-success-strong);
}

#checkinLayer
  .weekday-buttons
  button:is([data-status="day_off"], [data-status="exception"]) {
  --weekday-state-color: var(--status-rest);
  --weekday-state-strong: var(--status-rest-strong);
}

#checkinLayer .weekday-buttons button[data-status="violation"] {
  --weekday-state-color: var(--status-danger);
  --weekday-state-strong: var(--status-danger-strong);
}

#checkinLayer .weekday-buttons button.active,
#checkinLayer .weekday-buttons button.rest,
#checkinLayer .weekday-buttons button.violation {
  color: var(--weekday-state-strong);
  border: 0;
  background: transparent;
  box-shadow: none;
}

#checkinLayer .weekday-buttons button::before {
  border-color: color-mix(
    in srgb,
    var(--weekday-state-color) 64%,
    transparent
  );
  background: transparent;
  box-shadow: none;
}

#checkinLayer
  .weekday-buttons
  button:not([data-status="unmarked"])::before {
  border-color: var(--weekday-state-color);
  background: var(--weekday-state-color);
  box-shadow: 0 0 5px
    color-mix(in srgb, var(--weekday-state-color) 42%, transparent);
}

#checkinLayer
  .weekday-buttons
  button[data-routine-type="single"]::before {
  width: 5px;
  height: 5px;
  border: 0;
  border-radius: 50%;
  background: var(--status-success-strong);
  box-shadow: 0 0 5px
    color-mix(in srgb, var(--status-success) 36%, transparent);
}

#checkinLayer
  .weekday-buttons
  button[data-routine-type="full"]::before {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--status-success-strong);
  box-shadow: none;
  filter: drop-shadow(
    0 0 4px color-mix(in srgb, var(--status-success) 46%, transparent)
  );
}

#checkinLayer .weekday-buttons button.selected {
  color: var(--weekday-state-strong);
  border: 0;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--weekday-state-color) 14%, transparent),
    transparent 72%
  );
  box-shadow: none;
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--weekday-state-strong) 54%, transparent);
}

#checkinLayer .weekday-buttons button.selected::before {
  border-color: var(--weekday-state-color);
  box-shadow: 0 0 6px
    color-mix(in srgb, var(--weekday-state-color) 52%, transparent);
}

#checkinLayer
  .weekday-buttons
  button.selected[data-routine-type="full"]::before {
  border-color: transparent;
  box-shadow: none;
  filter: drop-shadow(
    0 0 5px color-mix(in srgb, var(--status-success) 58%, transparent)
  );
}

#checkinLayer
  .weekday-buttons
  button.selected[data-routine-type="single"]::before {
  border-color: var(--status-success-strong);
  box-shadow: 0 0 7px
    color-mix(in srgb, var(--status-success) 48%, transparent);
}

/* Friend states use the same glow language as the owner's status choices. */
#checkinLayer.read-only-preview .checkin-state-line {
  --friend-state-color: var(--time-muted, #a6977b);
  --friend-state-strong: var(--time-text, #d8ccb0);
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  justify-content: center;
  border: 0;
  border-image: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--friend-state-color) 13%, transparent) 22%,
    color-mix(in srgb, var(--friend-state-color) 13%, transparent) 78%,
    transparent
  );
  box-shadow: none;
}

#checkinLayer.read-only-preview
  .checkin-state-line:has(#checkinCurrentState[data-status="success"]) {
  --friend-state-color: var(--status-success);
  --friend-state-strong: var(--status-success-strong);
}

#checkinLayer.read-only-preview .checkin-state-line[data-status="success"] {
  --friend-state-color: var(--status-success);
  --friend-state-strong: var(--status-success-strong);
}

#checkinLayer.read-only-preview
  .checkin-state-line:has(
    #checkinCurrentState:is([data-status="day_off"], [data-status="exception"])
  ) {
  --friend-state-color: var(--status-rest);
  --friend-state-strong: var(--status-rest-strong);
}

#checkinLayer.read-only-preview
  .checkin-state-line:is([data-status="day_off"], [data-status="exception"]) {
  --friend-state-color: var(--status-rest);
  --friend-state-strong: var(--status-rest-strong);
}

#checkinLayer.read-only-preview
  .checkin-state-line:has(#checkinCurrentState[data-status="violation"]) {
  --friend-state-color: var(--status-danger);
  --friend-state-strong: var(--status-danger-strong);
}

#checkinLayer.read-only-preview .checkin-state-line[data-status="violation"] {
  --friend-state-color: var(--status-danger);
  --friend-state-strong: var(--status-danger-strong);
}

#checkinLayer.read-only-preview
  .checkin-state-line:has(#checkinCurrentState[data-status="in_progress"]) {
  --friend-state-color: var(--time-accent, #d8c996);
  --friend-state-strong: var(--time-text-strong, #fff0c7);
}

#checkinLayer.read-only-preview .checkin-state-line[data-status="in_progress"] {
  --friend-state-color: var(--time-accent, #d8c996);
  --friend-state-strong: var(--time-text-strong, #fff0c7);
}

#checkinLayer.read-only-preview
  :is(#checkinStateLabel, .checkin-state-chevron) {
  display: none;
}

#checkinLayer.read-only-preview .checkin-state-value {
  width: 100%;
  justify-content: center;
  text-align: center;
}

#checkinLayer.read-only-preview #checkinCurrentState {
  color: var(--friend-state-strong);
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--friend-state-strong) 58%, transparent);
}

@media (max-width: 360px) {
  #checkinLayer .checkin-body {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #checkinLayer .weekday-buttons button {
    transition: none;
  }
}

/* Open calendar days repeat the intervention status palette across the row. */
#historyDayEntries .history-entry[data-status] {
  --history-state-color: var(--time-muted, #a6977b);
  --history-state-strong: var(--time-text, #d8ccb0);
  opacity: 1;
  border: 0;
  border-image: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--history-state-color) 9%, transparent) 12%,
    color-mix(in srgb, var(--history-state-color) 9%, transparent) 88%,
    transparent
  );
}

#historyDayEntries {
  gap: 0;
}

#historyDayEntries .history-entry {
  margin-block: 0;
}

#historyDayEntries .history-entry:not(.primary-project) {
  padding-block: calc(var(--stock-section-gap) / 2);
}

#historyDayEntries .history-entry.primary-project {
  padding-block: calc(
    var(--stock-row-gap) + var(--stock-section-gap) / 2
  );
}

#historyDayEntries .history-entry-status-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--history-state-strong);
  white-space: nowrap;
}

#historyDayEntries .history-status-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: currentColor;
  filter: drop-shadow(
    0 0 4px color-mix(in srgb, var(--history-state-color) 42%, transparent)
  );
}

#historyDayEntries .history-entry[data-status="success"] {
  --history-state-color: var(--status-success);
  --history-state-strong: var(--status-success-strong);
}

#historyDayEntries
  .history-entry:is(
    [data-status="day_off"],
    [data-status="exception"],
    [data-status="not_required"]
  ) {
  --history-state-color: var(--status-rest);
  --history-state-strong: var(--status-rest-strong);
}

#historyDayEntries .history-entry[data-status="violation"] {
  --history-state-color: var(--status-danger);
  --history-state-strong: var(--status-danger-strong);
}

#historyDayEntries .history-entry[data-status="in_progress"] {
  --history-state-color: var(--time-accent, #d8c996);
  --history-state-strong: var(--time-text-strong, #fff0c7);
}

#historyDayEntries .history-entry[data-status="unmarked"] {
  --history-state-color: var(--time-line, #526f7d);
  --history-state-strong: var(--time-muted, #788f9b);
}

#historyDayEntries .history-entry[data-status] .history-sphere-icon {
  color: var(--history-state-strong);
  filter:
    drop-shadow(0 1px 0 #000)
    drop-shadow(
      0 0 4px
      color-mix(in srgb, var(--history-state-color) 38%, transparent)
    );
}

#historyDayEntries
  .history-entry[data-status]
  :is(strong, .history-entry-status-line) {
  color: var(--history-state-strong);
  text-shadow: 0 0 7px
    color-mix(in srgb, var(--history-state-strong) 32%, transparent);
}

#historyDayEntries
  .history-entry[data-status]
  :is(.history-entry-meta small, .history-entry-measure) {
  color: color-mix(
    in srgb,
    var(--history-state-color) 78%,
    var(--time-muted, #a6977b)
  );
}

#historyDayEntries
  .history-entry.primary-project[data-status]:not([data-status="unmarked"]) {
  --time-accent: var(--history-state-color);
  --time-glow: var(--history-state-strong);
}

#historyDayEntries .history-entry.primary-project[data-status="unmarked"] {
  opacity: 1;
}

#historyDayEntries .history-entry.primary-project[data-status="unmarked"] > * {
  opacity: 0.52;
}

#historyDayEntries .history-entry.primary-project {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--time-accent) 68%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--time-accent) 8%, transparent),
    0 0 14px color-mix(in srgb, var(--time-glow) 10%, transparent);
}

/* Calendar history keeps the same living project frame as interventions. */
#historyDayEntries .history-entry.primary-project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  width: auto;
  height: auto;
  padding: 1.7px;
  pointer-events: none;
  background: conic-gradient(
    from var(--project-orbit-angle),
    transparent 0deg 238deg,
    color-mix(in srgb, var(--time-accent) 22%, transparent) 258deg,
    color-mix(in srgb, var(--time-accent) 78%, var(--time-text)) 302deg,
    var(--time-text-strong) 326deg,
    color-mix(in srgb, var(--time-accent) 68%, transparent) 346deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: drop-shadow(
    0 0 3px color-mix(in srgb, var(--time-glow) 46%, transparent)
  );
  animation: main-project-border-orbit 5.2s linear infinite;
}

#historyDayEntries .history-entry.primary-project > * {
  position: relative;
  z-index: 2;
}

/* Full-screen Telegram surfaces remain inside the same 520px room as the HUD. */
.app-shell > :is(.belief-gate, .window-layer) {
  position: absolute;
  inset: 0;
}

/* Capture chapter gestures without letting Telegram's outer WebView rebound. */
#friendPanel .friend-room-chapter {
  touch-action: none;
  overscroll-behavior: none;
}

#friendPanel .friend-details-chapter {
  touch-action: pan-y;
}

/* Spirit's asymmetric flame sits four pixels left of the shared icon axis. */
svg[data-sphere="spirit"] {
  translate: -4px 0;
}

/* One shared muted treatment for the label, value and both metric controls. */
#checkinLayer .metric-control.is-locked > span,
#checkinLayer .metric-control.is-locked .metric-stepper button,
#checkinLayer .metric-control.is-locked .metric-stepper input,
#checkinLayer .completion-checklist.is-locked .toggle {
  color: var(--time-muted, #a6977b);
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

#checkinLayer .completion-checklist.is-locked .toggle {
  filter: none;
}

/* Keep exactly one stock gap between the last check-in block and confirmation. */
#checkinLayer .checkin-actions {
  padding-top: 0;
}

#checkinLayer .checkin-actions .confirm-checkin {
  margin-top: 0;
}

/* Inline intervention order keeps the list visible while it is edited. */
.rule-order-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center end;
  margin: -8px -4px -8px auto;
  padding: 0;
  color: var(--time-muted, #8ba2ad);
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.rule-order-button svg {
  width: 16px;
  height: 16px;
}

.rule-order-confirm-icon {
  display: none;
}

.rule-order-button.active .rule-order-edit-icon {
  display: none;
}

.rule-order-button.active .rule-order-confirm-icon {
  display: block;
}

.rule-order-button[hidden] {
  display: none;
}

.rule-order-button:active {
  color: var(--time-text-strong, #e6f6ff);
  transform: translateY(1px);
}

.rule-order-button.active {
  color: var(--time-text-strong, #e6f6ff);
  filter: none;
}

.rule-order-button.active svg {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--time-accent) 72%, transparent));
}

.rule-order-button:focus-visible svg {
  color: var(--time-text-strong, #e6f6ff);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--time-accent) 68%, transparent));
}

.rule-order-button:focus,
.rule-order-button:focus-visible,
.rule-order-handle:focus,
.rule-order-handle:focus-visible {
  outline: 0;
  outline-offset: 0;
}

.rule-group.is-ordering .rule-list {
  position: relative;
}

.rule-group.is-ordering .intervention-row {
  grid-template-columns: var(--stock-icon-box) minmax(0, 1fr) 44px;
  cursor: default;
  color: var(--time-text, #b8d5df);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  animation: none !important;
}

.rule-group.is-ordering .intervention-row::before,
.rule-group.is-ordering .intervention-row::after {
  content: none !important;
  animation: none !important;
}

.rule-group.is-ordering .intervention-row :is(
  .rule-rune,
  .rule-sphere-icon,
  .rule-copy,
  .rule-copy h3,
  .rule-copy p,
  .primary-project-label
) {
  color: inherit !important;
  text-shadow: none !important;
  filter: none !important;
}

.rule-group.is-ordering .intervention-row > :not(.rule-order-handle) {
  opacity: 0.82;
}

.rule-order-handle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: end;
  grid-column: 3;
  margin-right: -8px;
  padding: 0;
  color: var(--time-text, #b8d5df);
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.rule-order-handle:focus-visible .rule-order-handle-icon {
  color: var(--time-text-strong, #e6f6ff);
  filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 55%, transparent));
}

.compact-interventions .rule-order-handle {
  /* Keep the 44px touch target inside a 48px row with 8px vertical padding. */
  margin-block: -6px;
}

.rule-order-handle:active,
.intervention-row.is-order-dragging .rule-order-handle {
  color: var(--time-text-strong, #e6f6ff);
  cursor: grabbing;
}

.rule-order-handle-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}

.rule-list.is-order-dragging .intervention-row:not(.is-order-dragging) {
  opacity: 0.62;
  transition: transform 140ms ease, opacity 140ms ease;
}

.intervention-row.is-order-dragging {
  z-index: 8;
  background: color-mix(in srgb, var(--time-text, #b8d5df) 6%, var(--time-panel-deep, #050608)) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

.interventions-scroll.rule-order-dragging {
  scroll-behavior: auto;
  overscroll-behavior: contain;
}

.checkin-status-actions.event-tracking-limit #markSuccess {
  order: 1;
}

.checkin-status-actions.event-tracking-limit #markRest {
  order: 2;
}

.checkin-status-actions.event-tracking-limit #markViolation {
  order: 3;
}

/* Section labels stand on their own; decorative leader lines are intentionally absent. */
:is(
  .profile-section-title,
  .notification-catalog-group-title,
  .belief-title-divider
)::before,
:is(
  .profile-section-title,
  .notification-catalog-group-title,
  .belief-title-divider
)::after,
#weekly-summaryPanel .weekly-summary-period::before,
#weekly-summaryPanel .weekly-summary-period::after,
#weekly-summaryPanel .weekly-summary-chapter-title::before,
#weekly-summaryPanel .weekly-summary-chapter-title::after {
  content: none !important;
  display: none !important;
}

#inventoryPanel .collection-overview::after,
.window-layer[data-tab="settings"] .settings-group + .settings-group::before,
.rule-group + .rule-group::before {
  content: none !important;
  display: none !important;
}

:is(
  .belief-title-divider,
  .profile-section-title.notification-now-title,
  #weekly-summaryPanel .weekly-summary-period,
  #weekly-summaryPanel .weekly-summary-chapter-title
) {
  justify-content: center;
}

/* Notification rows keep their spacing without decorative separators. */
#eventsPanel .event-list > .event-entry::after {
  content: none !important;
  display: none !important;
}

#eventsPanel .event-list > .event-entry.is-swiping,
#eventsPanel .event-list > .event-entry.is-dismissing {
  background:
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--status-danger, #bd4f56) var(--notification-swipe-tint, 0%),
        transparent
      ),
      color-mix(
        in srgb,
        var(--status-danger, #bd4f56) var(--notification-swipe-tint, 0%),
        var(--time-panel-deep, #050608)
      ) 72%,
      transparent
    );
  box-shadow: inset -18px 0 28px
    color-mix(
      in srgb,
      var(--status-danger, #bd4f56) var(--notification-swipe-tint, 0%),
      transparent
    );
}

/* Calendar header follows the exact centered contract of Interventions. */
.history-header {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding:
    max(9px, var(--app-safe-top))
    52px
    var(--stock-section-gap);
}

.history-header::after {
  right: 20px;
  bottom: -2px;
  left: 20px;
  z-index: 1;
  height: 8px;
  background:
    linear-gradient(
      90deg,
      transparent,
      color-mix(
        in srgb,
        var(--time-accent, #d8b46f) 48%,
        var(--time-line, #655846)
      ) 18%,
      color-mix(
        in srgb,
        var(--time-accent, #d8b46f) 48%,
        var(--time-line, #655846)
      ) 82%,
      transparent
    );
  -webkit-mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  opacity: 1;
}

.history-header .interventions-heading {
  width: auto;
  gap: 1px;
  justify-self: center;
}

.history-header .interventions-heading h1 {
  font-size: 22px;
  line-height: normal;
}

.history-header .interventions-heading span {
  margin: 0;
  color: var(--time-accent);
  font-size: var(--stock-kicker-size);
  line-height: normal;
}

.history-header .interventions-back,
.history-header .daily-tally {
  position: absolute;
  top: max(9px, var(--app-safe-top));
}

.history-header .interventions-back {
  left: 8px;
  width: 44px;
  height: 44px;
}

.history-header .daily-tally {
  right: 8px;
  min-height: 44px;
  justify-content: center;
}

.history-view.friend-preview .history-header .interventions-heading span {
  color: var(--time-text-strong, #e6f6ff);
  text-shadow: 0 0 7px
    color-mix(in srgb, var(--time-accent) 42%, transparent);
}

/* Both sheet dividers reuse the exact header stroke from the app sections. */
#checkinLayer .checkin-sheet::before,
#checkinLayer .checkin-header::after {
  right: 18px;
  left: 18px;
  height: 8px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(
      in srgb,
      var(--time-accent, #d8b46f) 48%,
      var(--time-line, #655846)
    ) 18%,
    color-mix(
      in srgb,
      var(--time-accent, #d8b46f) 48%,
      var(--time-line, #655846)
    ) 82%,
    transparent
  );
  -webkit-mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  mask: var(--stock-divider-mask) center / 100% 8px no-repeat;
  opacity: 1;
  filter: drop-shadow(
    0 0 3px color-mix(in srgb, var(--time-glow, transparent) 26%, transparent)
  );
}

#checkinLayer .checkin-sheet::before {
  top: 0;
}

#checkinLayer .checkin-header {
  border-bottom: 0;
  box-shadow: none;
}

#checkinLayer .checkin-header::after {
  bottom: 0;
}

/* Full neck routine is a filled circle; one exercise is a small dot. */
#checkinLayer .neck-routine-control button {
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#checkinLayer .neck-routine-control button::before {
  content: "";
  width: 18px;
  height: 18px;
  color: currentColor;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 4px color-mix(in srgb, currentColor 34%, transparent));
}

#checkinLayer #neckRoutineSingle::before {
  background: radial-gradient(circle, currentColor 0 2px, transparent 2.5px) center / 18px 18px no-repeat;
}

#checkinLayer #neckRoutineFull::before {
  background: radial-gradient(circle, currentColor 0 4px, transparent 4.5px) center / 18px 18px no-repeat;
}

#checkinLayer .neck-routine-control button.active {
  color: var(--status-success-strong);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--status-success) 13%, transparent) 22%, color-mix(in srgb, var(--status-success) 13%, transparent) 78%, transparent);
  text-shadow: 0 0 7px color-mix(in srgb, currentColor 38%, transparent);
}

/* Wake time uses the same quiet stepper as minutes and repetitions. */
#checkinLayer .wake-time-control {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 4px;
  color: var(--time-muted, #a6977b);
}

#checkinLayer .wake-time-control > span:first-child {
  font-size: var(--stock-copy-size);
}

#checkinLayer .wake-time-control[hidden],
#checkinLayer .checkin-note-toggle[hidden],
#checkinLayer .checkin-note-control[hidden],
#checkinLayer .checkin-note-editor[hidden] {
  display: none;
}

#checkinLayer .wake-time-control.is-locked {
  opacity: 0.34;
}

#checkinLayer .wake-time-stepper input {
  color: var(--time-text-strong, #fff0c7);
  caret-color: var(--time-accent, #d8c996);
}

#checkinLayer :is(.metric-control, .wake-time-control)[data-status] {
  --checkin-value-color: var(--time-muted);
}
#checkinLayer :is(.metric-control, .wake-time-control)[data-status="success"] {
  --checkin-value-color: var(--status-success-strong);
}
#checkinLayer :is(.metric-control, .wake-time-control)[data-status="in_progress"] {
  --checkin-value-color: var(--time-accent);
}
#checkinLayer :is(.metric-control, .wake-time-control)[data-status="violation"] {
  --checkin-value-color: var(--status-danger-strong);
}
#checkinLayer :is(.metric-control, .wake-time-control):is([data-status="day_off"], [data-status="exception"]) {
  --checkin-value-color: var(--status-rest-strong);
}
#checkinLayer :is(.metric-control, .wake-time-control)[data-status] .metric-stepper input {
  color: var(--checkin-value-color);
  -webkit-text-fill-color: currentColor;
}

#checkinLayer .checkin-note-control {
  order: 6;
  display: grid;
}

#checkinLayer .checkin-note-toggle {
  grid-column: 1;
  width: 44px;
  height: 44px;
  min-height: 44px;
  position: relative;
  align-self: center;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--time-muted, #a6977b);
  border: 0;
  background: transparent;
  box-shadow: none;
}

#checkinLayer .checkin-note-toggle svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(
    0 0 4px color-mix(in srgb, currentColor 30%, transparent)
  );
}

#checkinLayer .checkin-note-check {
  display: none;
}

#checkinLayer .checkin-note-indicator {
  width: 5px;
  height: 5px;
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  opacity: 0;
}

#checkinLayer .checkin-note-toggle.has-note,
#checkinLayer .checkin-note-toggle.active {
  color: var(--time-accent, #d8c996);
  text-shadow: 0 0 7px
    color-mix(in srgb, var(--time-accent, #d8c996) 34%, transparent);
}

#checkinLayer .checkin-note-toggle.has-note .checkin-note-indicator {
  opacity: 1;
}

#checkinLayer .checkin-note-toggle.active .checkin-note-icon,
#checkinLayer .checkin-note-toggle.active .checkin-note-indicator {
  display: none;
}

#checkinLayer .checkin-note-toggle.active .checkin-note-check {
  display: block;
}

#checkinLayer .checkin-close {
  align-self: center;
}

#checkinLayer .checkin-note-editor {
  display: grid;
  gap: 5px;
}

#checkinLayer .checkin-note-editor textarea {
  width: 100%;
  min-height: 92px;
  max-height: 180px;
  resize: none;
  padding: 11px 12px;
  color: var(--time-text, #d8ccb0);
  border: 1px solid
    color-mix(in srgb, var(--time-line, #98815a) 52%, transparent);
  border-radius: 0;
  outline: 0;
  background: color-mix(
    in srgb,
    var(--time-panel-deep, #050608) 92%,
    var(--time-accent, #d8c996) 8%
  );
  font: inherit;
  font-size: var(--stock-copy-size);
  line-height: 1.45;
  caret-color: var(--time-accent, #d8c996);
}

#checkinLayer .checkin-note-editor textarea::placeholder {
  color: color-mix(in srgb, var(--time-muted, #a6977b) 72%, transparent);
  opacity: 1;
}

#checkinLayer .checkin-note-editor textarea:focus {
  border-color: color-mix(
    in srgb,
    var(--time-accent, #d8c996) 68%,
    transparent
  );
  box-shadow: 0 0 10px
    color-mix(in srgb, var(--time-glow, transparent) 24%, transparent);
}

#checkinLayer .checkin-note-editor > small {
  justify-self: end;
  color: color-mix(in srgb, var(--time-muted, #a6977b) 68%, transparent);
  font-size: 11px;
}

#historyDayEntries .history-entry-note {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 7px 0 0;
  color: color-mix(
    in srgb,
    var(--history-state-strong, var(--time-text)) 78%,
    var(--time-muted, #a6977b)
  );
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#historyDayEntries .history-note-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  color: currentColor;
}

/* Entry beliefs and weekly results share the same softly fading surface. */
#beliefGate,
#weekly-summaryPanel .weekly-summary-chapter {
  --ritual-surface: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 7%, transparent) 24%,
    color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 11%, transparent) 50%,
    color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 7%, transparent) 76%,
    transparent
  );
}

#weekly-summaryPanel .weekly-summary-assessment {
  width: min(100%, 560px);
  min-height: 210px;
  align-content: center;
  gap: var(--stock-copy-gap);
  padding: var(--stock-section-gap) 22px;
  background: var(--ritual-surface);
}

#weekly-summaryPanel .weekly-summary-chapter[data-grade="excellent"] {
  --weekly-grade-color: var(--status-success-strong, #86e3a7);
}

#weekly-summaryPanel .weekly-summary-chapter[data-grade="good"] {
  --weekly-grade-color: var(--time-accent, #8ec9dd);
}

#weekly-summaryPanel .weekly-summary-chapter[data-grade="weak"] {
  --weekly-grade-color: var(--status-danger-strong, #e49a99);
}

#weekly-summaryPanel .weekly-summary-assessment-chapter .weekly-summary-period,
#weekly-summaryPanel .weekly-summary-assessment-chapter .weekly-summary-period span,
#weekly-summaryPanel .weekly-summary-assessment-chapter .weekly-summary-assessment > span,
#weekly-summaryPanel .weekly-summary-assessment-chapter .weekly-summary-assessment p {
  color: var(--weekly-grade-color, var(--time-accent));
  text-shadow: 0 0 8px
    color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 24%, transparent);
}

#weekly-summaryPanel .weekly-summary-assessment-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  color: var(--weekly-grade-color, var(--time-accent));
  filter: drop-shadow(
    0 0 8px color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 42%, transparent)
  );
}

#weekly-summaryPanel .weekly-summary-assessment-mark svg {
  width: 34px;
  height: 34px;
}

#weekly-summaryPanel .weekly-summary-assessment strong {
  color: var(--weekly-grade-color, var(--time-text));
  font-size: 24px;
  text-shadow: 0 0 9px
    color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 34%, transparent);
}

/* The second summary chapter is separated by rhythm, never by rules between rows. */
#weekly-summaryPanel .weekly-summary-rules {
  gap: var(--stock-row-gap);
}

#weekly-summaryPanel .weekly-summary-rule:not(.primary-project)::after {
  content: none !important;
  display: none !important;
}

/* Stable accessible targets without changing the surrounding layout. */
.history-month-nav {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.history-month-nav button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.history-month-nav button svg {
  width: 19px;
  height: 19px;
}

#checkinLayer .metric-stepper {
  grid-template-columns: 44px 64px 44px;
}

#checkinLayer .metric-stepper button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  font-size: 20px;
}

#checkinLayer .metric-stepper button > span {
  font-size: 20px;
  line-height: 1;
}

#shopPanel .shop-progression-item .shop-card-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#shopPanel .shop-card-actions .shop-action-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

/* Inventory wardrobe: preview first, collection second, actions stay deliberate. */
#inventoryPanel .inventory-wardrobe {
  display: grid;
  gap: 10px;
}

#inventoryPanel .inventory-look-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

#inventoryPanel .inventory-look-copy {
  min-width: 0;
  display: grid;
  gap: var(--stock-copy-gap, 4px);
}

#inventoryPanel .inventory-look-copy > span,
#inventoryPanel .inventory-owned-value > span {
  color: var(--time-muted, #9d8f78);
  font-size: var(--stock-kicker-size, 12px);
  font-variant-caps: small-caps;
}

#inventoryPanel .inventory-look-copy > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--time-text-strong, #f1e6c9);
  font-size: var(--stock-title-size, 17px);
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inventoryPanel .inventory-preview-reset {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--time-muted, #9d8f78);
  border: 0;
  background: transparent;
}

#inventoryPanel .inventory-preview-reset[hidden] {
  display: none !important;
}

#inventoryPanel .inventory-preview-reset svg {
  width: 19px;
  height: 19px;
}

#inventoryPanel .inventory-owned-value {
  min-width: 70px;
  display: grid;
  justify-items: end;
  gap: var(--stock-copy-gap, 4px);
  padding: 0;
}

#inventoryPanel .inventory-owned-value b {
  color: var(--time-text-strong, #f1e6c9);
  font-size: var(--stock-title-size, 17px);
  font-weight: 400;
}

#inventoryPanel .inventory-live-preview {
  min-height: 348px;
  margin-inline: 0;
  padding: 18px var(--stock-gutter, 24px);
  position: relative;
}

#inventoryPanel .inventory-live-preview .equipment-preview-stage {
  width: min(44vw, 184px);
  align-self: center;
  z-index: 2;
}

#inventoryPanel .inventory-loadout {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  pointer-events: none;
}

#inventoryPanel .inventory-loadout::after,
#inventoryPanel .inventory-loadout-slot::after {
  content: none !important;
  display: none !important;
}

#inventoryPanel .inventory-loadout-slot {
  width: clamp(98px, 29vw, 122px);
  min-height: 62px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon item";
  align-content: center;
  justify-items: start;
  column-gap: 7px;
  row-gap: 3px;
  padding: 8px 7px;
  position: absolute;
  pointer-events: auto;
  color: color-mix(in srgb, var(--time-muted, #9d8f78) 82%, transparent);
  border: 0;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--time-panel-deep, #03070d) 92%, transparent),
      color-mix(in srgb, var(--time-panel-deep, #03070d) 48%, transparent) 76%,
      transparent
    );
  box-shadow: none;
  text-align: left;
}

#inventoryPanel .inventory-loadout-slot:nth-child(even) {
  justify-items: end;
  grid-template-columns: minmax(0, 1fr) 24px;
  grid-template-areas:
    "label icon"
    "item icon";
  background:
    linear-gradient(
      270deg,
      color-mix(in srgb, var(--time-panel-deep, #03070d) 92%, transparent),
      color-mix(in srgb, var(--time-panel-deep, #03070d) 48%, transparent) 76%,
      transparent
    );
  text-align: right;
}

#inventoryPanel .inventory-loadout-slot[data-slot="head"],
#inventoryPanel .inventory-loadout-slot[data-slot="body"] {
  top: 34px;
}

#inventoryPanel .inventory-loadout-slot[data-slot="pants"],
#inventoryPanel .inventory-loadout-slot[data-slot="boots"] {
  bottom: 34px;
}

#inventoryPanel .inventory-loadout-slot:nth-child(odd) {
  left: 6px;
}

#inventoryPanel .inventory-loadout-slot:nth-child(even) {
  right: 6px;
}

#inventoryPanel .inventory-loadout-slot i {
  grid-area: icon;
  width: 24px;
  height: 24px;
  align-self: center;
  display: grid;
  place-items: center;
  color: currentColor;
}

#inventoryPanel .inventory-loadout-slot span {
  grid-area: label;
  color: currentColor;
  font-size: 11px;
  line-height: 1.15;
}

#inventoryPanel .inventory-loadout-slot strong {
  grid-area: item;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  color: var(--time-text, #d8c9a8);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.18;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#inventoryPanel .inventory-loadout-slot.equipped,
#inventoryPanel .inventory-loadout-slot.equipped:nth-child(odd),
#inventoryPanel .inventory-loadout-slot.equipped:nth-child(even) {
  color: color-mix(in srgb, var(--time-accent, #8ec9dd) 80%, var(--time-text));
}

#inventoryPanel .inventory-loadout-slot.active {
  color: var(--time-text-strong, #f1e6c9);
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--time-accent, #8ec9dd) 15%, var(--time-panel-deep, #03070d)),
      color-mix(in srgb, var(--time-accent, #8ec9dd) 7%, transparent) 74%,
      transparent
    );
  text-shadow: 0 0 8px color-mix(in srgb, var(--time-accent, #8ec9dd) 34%, transparent);
}

#inventoryPanel .inventory-loadout-slot.active:nth-child(even) {
  background:
    linear-gradient(
      270deg,
      color-mix(in srgb, var(--time-accent, #8ec9dd) 15%, var(--time-panel-deep, #03070d)),
      color-mix(in srgb, var(--time-accent, #8ec9dd) 7%, transparent) 74%,
      transparent
    );
}

#inventoryPanel .inventory-look-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: var(--time-muted, #9d8f78);
  font-size: 12px;
  line-height: 1.3;
}

#inventoryPanel .inventory-look-meta > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inventoryPanel .inventory-look-meta > span:last-child {
  flex: 0 0 auto;
}

#inventoryPanel .inventory-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: var(--stock-section-gap, 18px);
}

#inventoryPanel .inventory-tabs button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 3px;
  overflow: hidden;
  border: 0;
  color: var(--time-muted, #9d8f78);
  background: transparent;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inventoryPanel .inventory-tabs button.active {
  color: var(--time-text-strong, #f1e6c9);
  background:
    linear-gradient(
      90deg,
      transparent,
      color-mix(in srgb, var(--time-accent, #8ec9dd) 10%, transparent),
      transparent
    );
  text-shadow: 0 0 8px color-mix(in srgb, var(--time-accent, #8ec9dd) 30%, transparent);
}

#inventoryPanel .inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: var(--stock-row-gap, 12px) 0 var(--stock-section-gap, 18px);
}

#inventoryPanel .inventory-grid.has-selection {
  padding-bottom: 104px;
}

#inventoryPanel .inventory-card {
  min-width: 0;
  min-height: 176px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  grid-template-rows: 112px minmax(48px, auto);
  align-items: start;
  gap: 7px 4px;
  padding: 8px;
  position: relative;
  overflow: hidden;
  color: var(--time-text, #d8c9a8);
  border: 0;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--time-panel-soft, #10161d) 72%, transparent),
      color-mix(in srgb, var(--time-panel-deep, #03070d) 86%, transparent)
    );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--time-line, #655846) 20%, transparent);
  text-align: left;
}

#inventoryPanel .inventory-card + .inventory-card::before {
  content: none;
  display: none;
}

#inventoryPanel .inventory-card.selected {
  background:
    radial-gradient(
      ellipse at 50% 28%,
      color-mix(in srgb, var(--time-accent, #8ec9dd) 13%, transparent),
      transparent 58%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--time-panel-soft, #10161d) 80%, transparent),
      color-mix(in srgb, var(--time-panel-deep, #03070d) 90%, transparent)
    );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--time-accent, #8ec9dd) 52%, transparent);
}

#inventoryPanel .inventory-card.equipped {
  color: color-mix(in srgb, var(--status-success-strong, #86e3a7) 76%, var(--time-text));
}

#inventoryPanel .inventory-card-icon {
  width: 100%;
  height: 112px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(
      ellipse,
      color-mix(in srgb, var(--time-accent, #8ec9dd) 8%, transparent),
      transparent 68%
    );
}

#inventoryPanel .inventory-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}

#inventoryPanel .inventory-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-self: start;
}

#inventoryPanel .inventory-card-copy strong {
  color: currentColor;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

#inventoryPanel .inventory-card-copy small {
  color: var(--time-muted, #9d8f78);
  font-size: 11px;
  line-height: 1.25;
}

#inventoryPanel .inventory-card-state {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--time-muted, #9d8f78) 74%, transparent);
}

#inventoryPanel .inventory-card.equipped .inventory-card-state {
  color: var(--status-success-strong, #86e3a7);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--status-success-strong, #86e3a7) 38%, transparent));
}

#inventoryPanel .inventory-card-state-icon {
  width: 17px;
  height: 17px;
}

#inventoryPanel .inventory-selection-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  margin: 0;
  padding: 13px 4px max(13px, env(safe-area-inset-bottom));
  position: sticky;
  bottom: 0;
  z-index: 8;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--time-panel-deep, #03070d) 96%, transparent),
      var(--time-panel-deep, #03070d)
    );
  box-shadow: 0 -14px 24px color-mix(in srgb, var(--time-panel-deep, #03070d) 88%, transparent);
}

#inventoryPanel .inventory-selection-bar[hidden] {
  display: none !important;
}

#inventoryPanel .inventory-selection-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#inventoryPanel .inventory-selection-copy strong {
  overflow: hidden;
  color: var(--time-text-strong, #f1e6c9);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inventoryPanel .inventory-selection-copy small {
  overflow: hidden;
  color: var(--time-muted, #9d8f78);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#inventoryPanel .inventory-selection-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

#inventoryPanel .inventory-selection-actions .primary-action {
  min-width: 88px;
  min-height: 44px;
  padding: 8px 14px;
}

#inventoryPanel .inventory-selection-more {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--time-muted, #9d8f78);
  border: 0;
  background: transparent;
}

#inventoryPanel .inventory-selection-more[hidden],
#inventoryPanel .inventory-selection-bar > .inventory-disposal-action[hidden] {
  display: none !important;
}

#inventoryPanel .inventory-selection-more svg {
  width: 19px;
  height: 19px;
}

#inventoryPanel .inventory-selection-bar > .inventory-disposal-action {
  min-height: 44px;
  grid-column: 1 / -1;
  padding: 8px 12px;
  color: var(--status-danger-strong, #e49a99);
  border: 0;
  background: color-mix(in srgb, var(--status-danger-strong, #e49a99) 7%, transparent);
  font: inherit;
  font-size: 13px;
}

#inventoryPanel .inventory-selection-bar > .inventory-disposal-action:disabled {
  color: color-mix(in srgb, var(--time-muted, #9d8f78) 55%, transparent);
  background: transparent;
}

/* Check-in options reuse the settings typography and line-icon switches. */
#checkinLayer .completion-checklist:not([hidden]) {
  display: grid;
  gap: 8px;
  padding: 0 4px;
}

#checkinLayer .checkin-option {
  min-height: 44px;
  padding: 0;
  gap: 14px;
}

#checkinLayer .checkin-option strong {
  font-family: var(--font-display);
  font-size: var(--stock-title-size);
  line-height: 1.25;
}

#checkinLayer .metric-control > span:first-child,
#checkinLayer .checkin-option:has([data-checklist-key="readAloud"]) strong {
  color: var(--time-muted, #a6977b);
  font-family: inherit;
  font-size: var(--stock-copy-size);
  font-weight: 400;
  line-height: normal;
}

#checkinLayer .checkin-option small {
  font-size: var(--stock-copy-size);
  line-height: 1.35;
}

#checkinLayer .checkin-option:has(input:disabled) {
  cursor: default;
}

#checkinLayer .checkin-option input {
  width: 100%;
  height: 100%;
  inset: 0;
  z-index: 1;
  margin: 0;
  pointer-events: auto;
}

/* Page headers share the featured action's soft surface, without divider strokes. */
.language-sessions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--stock-row-gap);
}

.language-sessions[hidden] { display: none; }

.language-sessions button {
  --session-color: var(--time-accent);
  --session-text: var(--time-muted);
  --session-surface: var(--featured-surface);
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--session-text);
  font: inherit;
  opacity: 0.6;
  box-shadow: none;
}

.language-sessions button.active {
  opacity: 1;
  background: var(--session-surface);
}

.language-sessions strong { font-size: var(--stock-copy-size); font-weight: 400; }
.language-sessions small { font-size: var(--stock-kicker-size); }
.language-sessions [data-status="success"] {
  --session-color: var(--status-success);
  --session-text: var(--status-success-strong);
}
.language-sessions [data-status="violation"] {
  --session-color: var(--status-danger);
  --session-text: var(--status-danger-strong);
}
.language-sessions :is([data-status="day_off"], [data-status="exception"]) {
  --session-color: var(--status-rest);
  --session-text: var(--status-rest-strong);
}
.language-sessions button:not([data-status="unmarked"]) {
  --session-surface: linear-gradient(90deg, transparent, color-mix(in srgb, var(--session-color) 13%, transparent) 22%, color-mix(in srgb, var(--session-color) 13%, transparent) 78%, transparent);
}

.rule-group-progress {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  column-gap: 7px;
  row-gap: 4px;
  padding: 0 4px 8px;
  color: var(--time-muted);
  font-size: var(--stock-kicker-size);
  line-height: 1.4;
  font-variant-numeric: lining-nums tabular-nums;
}

.rule-group-progress[hidden] { display: none; }
.rule-group-title #todayRemainingMeta,
.rule-group-title #weekGroupMeta {
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}
.rule-group-title [hidden] { display: none; }
#checkinLayer .checkin-header { touch-action: none; }
#checkinLayer .checkin-sheet.is-dismiss-dragging {
  transition: none;
  user-select: none;
  will-change: transform;
}
.rule-group-progress span { white-space: nowrap; }
.rule-group-progress [data-kind="done"] { color: var(--status-success-strong); }
.rule-group-progress [data-kind="rest"] { color: var(--status-rest-strong); }
.rule-group-progress [data-kind="violation"] { color: var(--status-danger-strong); }

.belief-gate .belief-message {
  position: relative;
  isolation: isolate;
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 22px 16px;
}

.belief-message-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  filter: blur(12px);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent, #000 18px, #000 calc(100% - 18px), transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent, #000 18px, #000 calc(100% - 18px), transparent
  );
}

.belief-message-glow > span {
  position: absolute;
  border-radius: 24px;
  background: color-mix(in srgb, var(--time-accent) 15%, var(--time-panel-deep));
}

#beliefTitle,
#telegramAccessTitle,
#weeklySummaryFinalTitle {
  margin: 0;
  color: var(--time-text-strong);
  font-family: var(--font-display);
  font-size: var(--stock-title-size);
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#beliefDescription,
#telegramAccessDescription,
#weeklySummaryFinalAdvice {
  margin: 0;
  color: var(--time-muted);
  font-family: var(--font-body);
  font-size: var(--stock-copy-size);
  line-height: 1.65;
}

#beliefGate {
  padding-inline: 0;
}

#beliefGate .belief-gate-content {
  gap: 32px;
}

#beliefGate .belief-message {
  padding-inline: max(24px, var(--app-safe-left), var(--app-safe-right));
  background: var(--ritual-surface);
}

#beliefConfirm {
  width: calc(100% - 40px);
  margin: 0;
  background: var(--ritual-surface);
}

#weekly-summaryPanel .weekly-summary-rules-chapter > .weekly-summary-chapter-title {
  width: auto;
  min-width: 0;
}

#weekly-summaryPanel .weekly-summary-counsel-chapter {
  padding-inline: 0;
  gap: 32px;
}

#weekly-summaryPanel .weekly-summary-counsel-chapter .weekly-summary-counsel {
  gap: 14px;
  padding: 22px max(24px, var(--app-safe-left), var(--app-safe-right));
  background: var(--ritual-surface);
}

#weekly-summaryPanel .weekly-summary-confirm {
  width: calc(100% - 40px);
  min-height: 52px;
  background: var(--ritual-surface);
}

#weekly-summaryPanel :is(#weeklySummaryFinalTitle, #weeklySummaryFinalAdvice, .weekly-summary-confirm) {
  color: var(--weekly-grade-color, var(--time-accent));
  text-shadow: 0 0 8px
    color-mix(in srgb, var(--weekly-grade-color, var(--time-accent)) 24%, transparent);
}

:is(.interventions-header, .history-header, .immersive-window-open .window-header, #checkinLayer .checkin-header, #checkinLayer .confirm-checkin, .bottom-nav .tab-featured, .coming-soon) {
  background: var(--featured-surface);
  border: 0;
  border-image: none;
  box-shadow: none;
}

:is(.topbar, .interventions-header, .history-header, .immersive-window-open .window-header, #checkinLayer .checkin-header, .bottom-nav .tab-featured, .coming-soon)::before,
:is(.topbar, .interventions-header, .history-header, .immersive-window-open .window-header, #checkinLayer .checkin-header, .bottom-nav .tab-featured, .coming-soon)::after,
#checkinLayer .checkin-sheet::before {
  content: none;
  display: none;
}

#inventoryPanel .empty-state {
  min-height: 176px;
  padding: var(--stock-section-gap, 18px) 4px;
}

@media (max-width: 370px) {
  #inventoryPanel .inventory-live-preview {
    min-height: 334px;
  }

  #inventoryPanel .inventory-loadout-slot {
    width: 96px;
  }

  #inventoryPanel .inventory-card {
    min-height: 166px;
    grid-template-rows: 102px minmax(48px, auto);
  }

  #inventoryPanel .inventory-card-icon {
    height: 102px;
  }

  #inventoryPanel .inventory-selection-bar {
    grid-template-columns: minmax(0, 1fr) 132px;
  }
}

/* Phone typography scales by role, without scaling the viewport or artwork. */
@media (max-width: 600px), (pointer: coarse) {
  :root {
    --ui-caption: 14px;
    --ui-small: 15px;
    --ui-body: 17px;
    --ui-title: 19px;
    --stock-title-size: 19px;
    --stock-category-size: 17px;
    --stock-copy-size: 15px;
    --stock-kicker-size: 14px;
  }

  body { font-size: 16px; }

  #interventionsView .rule-copy h3,
  .history-entry strong {
    font-size: var(--stock-title-size);
  }

  #interventionsView .rule-copy p,
  .history-entry small,
  .history-entry-state,
  .history-entry-measure,
  .participant-preview-tabs button,
  #friendPanel .friend-page-tabs button,
  #checkinLayer .weekday-buttons button {
    font-size: var(--stock-copy-size);
  }

  .interventions-heading h1,
  .immersive-window-open .window-header h2,
  #checkinLayer .checkin-header h2 {
    font-size: 24px;
  }

  .interventions-heading time,
  .interventions-heading > span,
  .history-weekdays {
    font-size: var(--stock-kicker-size);
  }

  .rule-group-progress {
    column-gap: 5px;
    font-size: clamp(12px, 3.4vw, 14px);
  }
}
