@layer components {
  /* Today: unified task list */
  .ws-quick-add {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
  }
  .ws-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-card);
  }
  .ws-item--attention {
    border-left: 3px solid var(--accent);
    background: linear-gradient(var(--accent-wash), var(--accent-wash)) var(--surface-card);
  }
  .ws-check {
    --tile-size: 26px; /* mockup checkbox size */
    --tile-radius: var(--radius-sm);
    --tile-wash: var(--surface-card);
    --icon-size: 13px;
    border: 1px solid var(--border-default);
    cursor: pointer;
    margin-top: 1px; /* optical alignment with title */
  }
  .ws-check .icon-checkmark {
    opacity: 0;
    transition: opacity 0.15s;
  }
  .ws-check:hover .icon-checkmark {
    opacity: 1;
  }
  .ws-check--done {
    --tile-size: 22px;
    --tile-wash: var(--semantic-success-wash);
    border: none;
  }
  .ws-check--done .icon-checkmark {
    opacity: 1;
  }
  .ws-attn-icon {
    --tile-size: 26px;
    --tile-radius: var(--radius-sm);
    --icon-size: 16px;
    margin-top: 1px; /* optical alignment with title */
  }
  .ws-item-body {
    flex: 1;
    min-width: 0;
  }
  .ws-item-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
  }
  .ws-item-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
  }
  span.ws-item-title {
    cursor: default;
  }
  .ws-recur {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  .ws-item-notes {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--spacing-xxs);
    max-width: 64ch;
  }
  .ws-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
    flex-shrink: 0;
  }
  .ws-completed {
    margin-top: var(--spacing-lg);
  }
  /* .ws-disclosure is the generic "show the rest" fold (earlier CE credits);
     it shares the completed-tasks summary treatment. */
  .ws-disclosure {
    margin-top: var(--spacing-sm);
  }
  .ws-disclosure > .app-panel {
    margin-top: var(--spacing-sm);
  }
  .ws-completed summary,
  .ws-disclosure summary {
    --label-color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
  }
  .ws-completed-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xxs);
    margin-top: var(--spacing-sm);
  }
  .ws-completed-row {
    --row-opacity: 0.72; /* mockup-spec muted treatment */
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    opacity: var(--row-opacity);
  }
  .ws-completed-title {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: line-through;
  }
  /* The snoozed fold reuses the completed-tasks row, without the
     strike-through and without the muting: a snooze is deferred work, not
     finished work, and opacity applies to the whole subtree — muting the
     row would mute the "Un-snooze" chip, the only control in the fold. */
  .ws-snoozed-row {
    --row-opacity: 1;
  }
  /* button_to wraps the chip in a form; contents makes the chip itself the
     flex child, and it must not shrink — at mobile width the title wraps
     instead, rather than the label breaking mid-word. */
  .ws-snoozed-row form {
    display: contents;
  }
  .ws-snoozed-row .ws-chip {
    flex-shrink: 0;
  }
  .ws-snoozed-title {
    font-size: var(--text-sm);
    color: var(--text-secondary);
  }
  .ws-snoozed-until {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  .ws-template-row {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .ws-template-row .ws-input {
    width: 100%;
    margin-bottom: var(--spacing-xxs);
  }
  .ws-template-row .ws-input--tiny {
    width: 64px; /* two-digit interval count */
    flex: none;
    margin-bottom: 0;
  }
  .ws-template-every {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
  }
  .ws-template-row--new {
    border-bottom: none;
  }
}
