/* ============================================================
   THING AVATARS + SEGMENTED TOGGLE — polish pass
   ============================================================ */

/* Thing avatar chips: quiet, with a hover lift */
.sidebar-thing-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: color-mix(in srgb, var(--thing-color) 11%, var(--surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--thing-color) 28%, var(--border));
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.sidebar-thing-avatar i,
.sidebar-thing-avatar span {
  color: #fdfdfc;
  font-size: var(--fs-16);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.sidebar-thing-avatar:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--thing-color) 16%, var(--surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--thing-color) 28%, var(--border));
}
/* Small variant used for the per-category thing chips shown pre-review */
.sidebar-thing-avatar.thing-avatar-sm {
  width: 30px;
  height: 30px;
  font-weight: 500;
  color: #fdfdfc;
  font-size: var(--fs-12);
}
.sidebar-thing-avatar.thing-avatar-sm i,
.sidebar-thing-avatar.thing-avatar-sm span {
  font-size: var(--fs-12);
}

/* Trackers/Dashboard segmented toggle: swap hardcoded colors for tokens
   and animate the active pill instead of hard-cutting between states */
/* Trough matches the mini calendar's panel in the schedule column
   (--surface-card + a --border hairline, see _task_schedule.html.erb): both sit
   directly on the black sidebar/page, so they read as the same material rather
   than the toggle floating a step lighter than everything around it. */
.sidebar-segmented {
  display: inline-flex;
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.sidebar-segmented-tab {
  display: inline-block;
  font-family: inherit;
  border: none;
  outline: none;
  font-size: var(--fs-13);
  font-weight: normal;
  text-decoration: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transform: translateY(-0.5px);
  color: #555;
  background-color: transparent;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.sidebar-segmented-tab.is-active {
  color: #04140a;
  background-color: var(--accent);
}
.sidebar-segmented-tab:not(.is-active):hover {
  color: var(--text-1);
  background-color: var(--surface-2);
}

/* ============================================================
   DASHBOARD PANEL — unified chip/row system
   Replaces the per-page hardcoded inline styles (Journals,
   Inspirations, Posts, Rules, Values, Tasks dashboards) with a
   shared, token-driven visual language so the whole sidebar
   reads as one system.
   ============================================================ */

.dash-label {
  display: block;
  color: var(--text-3);
  font-size: var(--fs-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Clear tag filter: centered under the tag cloud while a filter is on */
.dash-clear-link {
  display: block;
  margin: 8px auto 0;
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-3);
  font-size: var(--fs-11);
  transition: color var(--dur-fast) ease;
}
.dash-clear-link:hover { color: var(--accent-bright); }
.dash-clear-link[hidden] { display: none; }

/* Pill grid shared by every dashboard: two equal columns. */
.dash-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: row dense;
  gap: 6px 8px;
}
/* The home dashboard's categories column toggles (--split): Completed/Habits/Places
   pinned to the left and the deferral trio (Maybe/Someday/Waiting On) to the right.
   `dense` lets the right column start back at the top row instead of below Places.
   Scoped to the modifier so other dashboards' grids keep flowing across both columns. */
.dash-toggle-grid--split > .dash-filter-pill { grid-column: 1; }
.dash-toggle-grid--split > .dash-filter-pill--deferral { grid-column: 2; }

/* One pill per filter. Colour tracks distance from the default rather than
   plain on/off, so the filters you've actually changed are the loud ones:
   - default state, on  (Places, Maybe, Waiting On):  soft tint
   - changed, on        (Completed, Habits, Someday): solid accent
   - default state, off (Completed, Habits, Someday): quiet outline
   - changed, off       (Places, Maybe, Waiting On):  quiet outline */
.dash-filter-pill {
  font-family: inherit;
  font-size: var(--fs-11);
  font-weight: 500;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.dash-filter-pill i { font-size: var(--fs-10); }
/* Same faint pill a chip's count sits in, so a count reads the same wherever it is. */
.dash-pill-count {
  padding: 1px 5px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.08);
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.dash-filter-pill.is-active .dash-pill-count { background-color: rgba(0, 0, 0, 0.12); }
.dash-filter-pill:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  background-color: var(--surface-3);
}
.dash-filter-pill.is-active {
  color: #04140a;
  background-color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.dash-filter-pill.is-active[data-default-on] {
  color: var(--accent-bright);
  background-color: var(--accent-soft);
  border-color: rgba(34, 197, 94, 0.35);
}
.dash-filter-pill.is-active:hover { filter: brightness(1.1); }
.dash-filter-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.dash-year-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--text-3);
  font-size: var(--fs-11);
}
.dash-year-row[hidden] { display: none; }

/* Tag cloud: chips of different sizes centred in each row; category_toggle.js
   counts rows by vertical overlap to clamp the cloud */
.dash-tag-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  /* Reaches a little past the section's edges so a row fits one more chip */
  margin-left: -5px;
  margin-right: -5px;
}
/* A size up from the shared .dash-chip so the cloud fills the sidebar's width
   instead of leaving wide margins either side of the centered rows */
.dash-tag-flow .dash-chip {
  font-size: var(--fs-12);
  padding: 4px 12px;
  /* No chip takes a whole row to itself: a long name ("Marcus Aurelius") is capped at
     just under half the row and trimmed, so a row always holds at least two of them.
     min-width: 0 is what lets that happen — a flex item's automatic minimum is its
     content, which would otherwise win over the max-width and keep the name full length. */
  box-sizing: border-box;
  min-width: 0;
  max-width: calc(50% - 5px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-tag-flow .dash-chip.is-clamped { display: none; }
/* Empty slots padding a cloud out to its full height (fillGhosts in category_toggle.js):
   dotted outlines where more tags would go, with nothing to read or click */
.dash-tag-flow .dash-chip--ghost {
  border-style: dashed;
  border-color: var(--border-strong);
  background: none;
  cursor: default;
  pointer-events: none;
}
/* A fixed cloud (Rules categories, Values areas) is two rows tall whatever it holds: one
   row of chips, none at all, or two rows and a "…". Nothing is measured or padded, so the
   height can't drift by a pixel between two pages that render the same panel. Rows stack
   from the top, and the "…" drops to chip size so it can't make its row taller. */
.dash-tag-flow[data-tag-fixed] {
  align-content: flex-start;
  min-height: calc(var(--dash-chip-row) * 2 + 4px);
}
.dash-tag-flow[data-tag-fixed] .dash-tag-more { font-size: 10.5px; padding: 2px 8px; }
/* Tag chips grow with use (ApplicationHelper#tag_chip_size_class): four steps, the
   padding scaling with the text so a big chip isn't a cramped one */
/* The height of a size-1 chip: font, padding and border, and the row height a cloud of
   them comes out at. Fixed-height clouds are sized in these. */

.dash-tag-flow .dash-chip.dash-chip--size-0 { font-size: 9.5px; padding: 2px 7px; }
.dash-tag-flow .dash-chip.dash-chip--size-1 { font-size: 10.5px; padding: 2px 8px; }
.dash-tag-flow .dash-chip.dash-chip--size-2 { font-size: 11.5px; padding: 3px 10px; }
.dash-tag-flow .dash-chip.dash-chip--size-3 { font-size: 13px; padding: 3px 11px; }

/* The dashboard never scrolls: #dashboard-section clips rather than scrolls, and tag
   clouds shrink to fit (fitDashboardClouds in category_toggle.js). The one exception is
   a cloud expanded with "…" — asking to see every chip — which may scroll, still with
   no bar. */
#dashboard-popover.is-tags-expanded #dashboard-section { overflow-y: auto !important; }
/* The inline display:none on a closed panel has to win over this */
.dash-panel:not([style*="display: none"]) { display: flex; }
/* Dropped by fitDashboardClouds when nothing else makes the dashboard fit */
#dashboard-section .is-fit-hidden { display: none !important; }
#app-sidebar,
#app-sidebar *,
#dashboard-popover,
#dashboard-popover * { scrollbar-width: none; }
#app-sidebar::-webkit-scrollbar,
#app-sidebar *::-webkit-scrollbar,
#dashboard-popover::-webkit-scrollbar,
#dashboard-popover *::-webkit-scrollbar { display: none; }
/* The active chip trades its count for the delete "x" */
.tag-filter-btn.is-active .dash-chip-count { display: none; }
/* Same colour as the tags; category_toggle.js gives it the size of the chip before it */
.dash-tag-more {
  border-style: dashed;
}

/* Expanded chip cloud: every other dashboard section steps aside so the cloud gets
   the full height, while its chips keep filtering the page */
#dashboard-popover.is-tags-expanded .dash-section:not(.is-cloud-expanded) {
  display: none !important;
}

/* ============================================================
   DASHBOARD SECTIONS — the shared vocabulary every page's
   dashboard is built from:
   - .dash-section      one block, spaced rather than ruled off
   - .dash-segmented    single choice (sort, view, range)
   - .dash-toggle-grid  on/off pills with icons
   - .dash-tag-flow     centered chip cloud, clamped with "…"
   ============================================================ */
/* Sections sit the same distance apart as the rows of pills inside one (Milestones over
   Recurring, Blocks over Values), so the panel reads as one list rather than a stack of
   islands — including the first one, which sits that same distance under the
   Stats/Dashboard switch. */
.dash-stack {
  display: flex;
  flex-direction: column;
  /* Fills the panel, with sections at their own heights, so a CTA can be pushed to the
     foot of it rather than trailing whatever happens to be above it */
  flex: 1;
  min-height: 0;
  gap: 6px;
  /* 2px on top of the 4px #dashboard-section already pads (see layouts/_sidebar), so the
     first section sits the same 6px under the Stats/Dashboard switch as the sections do
     from each other */
  padding-top: 2px;
}
.dash-section { min-width: 0; }
.dash-section > .dash-label {
  padding-left: 2px;
}
/* Galleries (every "Find More …" page): its label heads the whole panel rather than one
   section of it, so it runs to both edges — same type as every other dash-label, centred
   between hairlines instead of hanging off the left with pills squared up under it. */
.dash-stack--galleries .dash-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 0;
}
.dash-stack--galleries .dash-label::before,
.dash-stack--galleries .dash-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.dash-stack > * { flex: 0 0 auto; }
/* The one break in the panel's even rhythm: a CTA leaves the page for a gallery, where
   everything above it filters the page in place. It sits at the foot of the panel on every
   dashboard that has one, with at least a gap above it. */
.dash-stack .dash-cta { margin-top: auto; margin-bottom: 1px; }
.dash-stack .dash-cta + .dash-cta { margin-top: 0; }
/* A dashboard with more rows than room (Calendar: eight type filters, tags and a CTA):
   pills at 3px rather than 5px, rows 4px apart rather than 6px — enough to keep every
   section in a short panel instead of the fit script dropping the tags and filters. */
.dash-stack--compact { gap: 4px; }
.dash-stack--compact .dash-toggle-grid { row-gap: 4px; }
.dash-stack--compact .dash-filter-pill { padding-block: 3px; }
.dash-stack--compact .dash-segmented .sidebar-segmented-tab { padding-block: 3px; }
.dash-stack--compact .dash-cta { padding-block: 6px; }
/* The home dashboard: its tag cloud sits midway between the pills above it and the CTA
   below, the spare height split evenly either side instead of all of it under the cloud.
   The CTA still lands at the foot, since the cloud's margins take up the rest. */
.dash-stack--center-cloud > .dash-section--cloud { margin-block: auto; }
/* Only while a cloud is there to carry it: on a short panel the fit drops the cloud
   (is-fit-hidden), its margins go with it, and the CTA has to push itself to the foot again
   — or it rides up under the filters, off the panel's foot. */
.dash-stack--center-cloud > .dash-section--cloud:not(.is-fit-hidden) ~ .dash-cta { margin-top: 0; }
/* Two clouds back to back (Notes: tags, then categories) are centred as one block: the spare
   height goes above the first and below the last, and the two keep the panel's ordinary gap
   between them rather than taking a double share of it. */
.dash-stack--center-cloud > .dash-section--cloud:has(+ .dash-section--cloud:not(.is-fit-hidden)) { margin-bottom: 0; }
.dash-stack--center-cloud > .dash-section--cloud:not(.is-fit-hidden) + .dash-section--cloud { margin-top: 0; }
/* A fixed cloud (Rules categories, Values areas) holds two rows' height and packs its chips
   at the top, so a single row would sit high inside a centred box. Centred in the panel, it
   is the cloud's margins that keep the CTA in place, not the fixed height — so the chips can
   centre inside it too, and what reads as centred is the chips themselves. */
.dash-stack--center-cloud .dash-tag-flow[data-tag-fixed] { align-content: center; }

/* Full-width segmented control: tabs share the width equally */
.dash-segmented {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}
.dash-segmented .sidebar-segmented-tab {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: var(--fs-11);
  padding: 5px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-segmented + .dash-segmented { margin-top: 6px; }

/* Pill grids that read across rows (the tasks grid reads down columns);
   an odd pill out spans the full width instead of leaving a hole */
.dash-toggle-grid--rows { grid-auto-flow: row; grid-template-rows: none; }
.dash-toggle-grid--rows > :last-child:nth-child(odd) { grid-column: 1 / -1; }
/* Icon-only pills (pill_links icons_only:), all on one row */
.dash-toggle-grid--icons { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.dash-toggle-grid--icons .dash-filter-pill { font-size: var(--fs-13); }
a.dash-filter-pill { text-decoration: none; }

/* Multi-select chips whose default is "everything selected": the default
   reads neutral, a narrowed selection tints what's kept, and anything
   deselected dims */
.dash-chip.is-off {
  color: var(--text-3);
  opacity: 0.45;
}
.dash-chip.is-off:hover { opacity: 0.9; }

/* Year stepper centered in its section (Journals) */
.dash-year-nav--center { justify-content: center; gap: 10px; }
.dash-year-nav--center .dash-year-nav-value { font-size: var(--fs-14); min-width: 44px; }
.dash-chip {
  display: inline-block;
  font-family: inherit;
  outline: none;
  background-color: transparent;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fs-11);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.dash-chip:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  background-color: var(--surface-3);
}
.dash-chip.is-active {
  background-color: var(--accent-soft);
  color: var(--accent-bright);
  border-color: rgba(34, 197, 94, 0.35);
  font-weight: 600;
}

/* Count riding along inside a chip. Quiet enough that the tag name still reads
   first, and it inherits the chip's colour when the chip is hovered or active. */
/* Smaller than the tag and set in its own faint pill, so "Star Wars 2" reads as the
   tag Star Wars with a count of 2 rather than one three-word name */
.dash-chip-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1.3;
  vertical-align: 0.12em;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.dash-chip.is-active .dash-chip-count { background-color: rgba(34, 197, 94, 0.14); color: var(--accent-bright); }
.dash-chip:hover .dash-chip-count { color: var(--text-2); }
/* Leading icon marking what kind of chip it is (e.g. a category among tags) */
.dash-chip-icon { font-size: 0.8em; margin-right: 5px; opacity: 0.7; }

/* Tag cloud: dim tags that don't match any task currently visible in
   the categories column — still clickable, just visually deprioritized */
.dash-chip--dimmed {
  opacity: 0.4;
}
.dash-chip--dimmed:hover {
  opacity: 0.75;
}

/* Tag cloud: delete "x" — hidden until the chip is hovered, sits
   inline after the tag name */
.tag-filter-delete {
  display: none;
  margin-left: 5px;
  color: var(--text-3);
  transition: color var(--dur-fast) ease;
}
.tag-filter-btn.is-active .tag-filter-delete {
  display: inline-block;
}
.tag-filter-delete:hover {
  color: var(--danger);
}

/* Pinned tracker goal cells: show "days left" only while hovering the
   tracker, in place of the date line, instead of a permanent 3rd line */
.goal-days-left-line { display: none; }
tr:hover .goal-date-line { display: none; }
tr:hover .goal-days-left-line { display: inline; }

/* Vertical sort list (Rules/Values): a panel of label + direction-arrow rows,
   the same material as the segmented controls */
.dash-sort-list {
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 2px;
}
/* Two columns, so a six-way sort takes three rows of sidebar height rather than six */

.dash-sort-row { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); min-width: 0; }
.dash-sort-row .dash-sort-btn { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 7px; padding-right: 4px; }
.dash-sort-row .dash-sort-arrow { padding-left: 4px; padding-right: 5px; }
.dash-sort-row.is-active { background-color: var(--accent-soft); }
.dash-sort-row.is-active .dash-sort-btn,
.dash-sort-row.is-active .dash-sort-arrow { color: var(--accent-bright); background-color: transparent; }
.dash-sort-btn {
  flex: 1;
  background-color: transparent;
  color: var(--text-3);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-11);
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.dash-sort-btn:hover { color: var(--text-1); background-color: var(--surface-3); }
.dash-sort-btn.is-active { color: var(--text-1); background-color: var(--surface-3); }
.dash-sort-arrow {
  color: var(--text-3);
  font-size: var(--fs-12);
  font-weight: 700;
  text-decoration: none;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background-color: transparent;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.dash-sort-arrow.is-active { color: var(--text-1); background-color: var(--surface-2); }

/* Year picker (Journals) */
.dash-year-nav { display: flex; align-items: center; gap: 2px; }
.dash-year-nav-btn {
  color: var(--text-3);
  font-size: var(--fs-13);
  text-decoration: none;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.dash-year-nav-btn:hover { color: var(--text-1); background-color: var(--surface-3); }
.dash-year-nav-btn.is-disabled { color: var(--border-strong); pointer-events: none; }
.dash-year-nav-value {
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 600;
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Completed-filter year picker: compact pill select, sits beside the
   toggle instead of stacking underneath it */
.dash-year-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath fill='%236b6b76' d='M0 0l4 6 4-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-10);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 16px 3px 8px;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.dash-year-select:hover { border-color: var(--border-strong); background-color: var(--surface-3); }
.dash-year-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* "Find more" CTA — soft tinted card, one accent per content type */
.dash-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  border-radius: var(--radius-md);
  font-size: var(--fs-11);
  font-weight: 600;
  padding: 8px 12px;
  text-decoration: none;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: filter var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.dash-cta:hover { filter: brightness(1.15); }
.dash-cta:active { transform: scale(0.98); }
.dash-cta--blue {
  background-color: rgba(77, 159, 255, 0.1);
  border-color: rgba(77, 159, 255, 0.25);
  color: var(--blue);
}
.dash-cta--purple {
  background-color: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.25);
  color: #a78bfa;
}

/* Task form: preview the focus accent on hover, so fields read as interactive
   before they are clicked. :not(:focus) keeps the real focus state authoritative. */
.task-form-input:hover:not(:focus),
.task-form-select:hover:not(:focus) {
  border-color: var(--field-optional-hover);
  background-color: rgba(255, 255, 255, 0.09);
}

.task-form-input-title:hover:not(:focus),
.task-form-aoi-select:hover:not(:focus),
.task-form-value-select:hover:not(:focus) {
  border-color: var(--field-required-hover) !important;
  background-color: rgba(255, 255, 255, 0.09) !important;
}

.task-time-input-wrapper:hover:not(:focus-within) {
  border-color: var(--field-optional-hover);
}

/* Same hover preview for the form's icon buttons. :not(.active) leaves the
   selected-state colors alone; :not(:disabled) leaves dead nest arrows dim. */
.icon-card:hover:not(.active),
.task-type-card:hover:not(.active),
.task-repeat-btn:hover:not(.active),
.task-form-nest-btn:hover:not(:disabled),
.nest-controls-flush .task-form-nest-btn:hover:not(:disabled) {
  border-color: rgba(29, 161, 242, 0.45);
  background: rgba(29, 161, 242, 0.1);
  color: #1da1f2;
}

.icon-card:hover:not(.active) i,
.icon-card:hover:not(.active) span,
.task-type-card:hover:not(.active) i,
.task-type-card:hover:not(.active) span,
.task-repeat-btn:hover:not(.active) i,
.task-form-nest-btn:hover:not(:disabled) i {
  color: #1da1f2;
}

/* Priority previews its own selected yellow rather than the generic blue. */
.task-type-card[data-type="priority"]:hover:not(.active) {
  border-color: rgba(240, 224, 64, 0.45);
  background: rgba(240, 224, 64, 0.1);
}

.task-type-card[data-type="priority"]:hover:not(.active) i,
.task-type-card[data-type="priority"]:hover:not(.active) span {
  color: #f0e040;
}

/* Reminder card has no data-type, so the generic .active rules never reached it. */
.task-reminder-card.active {
  border-color: #1da1f2;
  background-color: rgba(29, 161, 242, 0.15);
}

.task-reminder-card.active i,
.task-reminder-card.active span {
  color: #1da1f2;
}

/* One placeholder color across every task form. The ancestor prefix is load
   bearing: the sidebar's inline <style> sets input[type="text"]::placeholder
   globally, which outranks a bare class selector and renders later in the body.
   Both prefixes are listed because .task-form-card wraps most forms but the
   full new/edit form at tasks/_form.html.erb only has .task-form-body. */
.task-form-body .task-form-input::placeholder,
.task-form-body .cat-sel-search::placeholder,
.task-form-card .task-form-input::placeholder,
.task-form-card .cat-sel-search::placeholder,
.task-form-body .date-words.is-empty .date-words-text,
.task-form-card .date-words.is-empty .date-words-text {
  color: #555;
}

/* Freebies at 0 means none set, so it reads as placeholder rather than a value. */
.task-number-input.is-zero,
input[name="task[freebies_per_week]"].is-zero {
  color: #555;
}

/* "Find More …" at a panel's foot: a quiet link with an arrow, like the empty pages' "See
   all", not the app's only blue button. Every tint drops to the same quiet text. */
.dash-cta[class*="dash-cta--"] {
  justify-content: flex-start; margin-top: 6px; padding: 8px 2px 2px;
  border: none; border-top: 1px solid var(--border-panel); border-radius: 0; background: none;
  color: var(--text-2); font-weight: 500; letter-spacing: 0;
}
.dash-cta[class*="dash-cta--"] i { color: var(--text-3); }
.dash-cta[class*="dash-cta--"]::after { content: '→'; margin-left: auto; color: var(--text-3); }
.dash-cta[class*="dash-cta--"]:hover { filter: none; color: var(--text-1); }
.dash-cta[class*="dash-cta--"]:hover::after { color: var(--text-1); }
.dash-stack .dash-cta + .dash-cta { border-top: none; padding-top: 4px; }

/* Only the active sort shows its ↓/↑; hovering a row shows that row's. */
.dash-sort-row:not(.is-active) .dash-sort-arrow { visibility: hidden; }
.dash-sort-row:not(.is-active):hover .dash-sort-arrow,
.dash-sort-row:not(.is-active):focus-within .dash-sort-arrow { visibility: visible; }

/* A panel's single-choice control (Notes' Sort) is on the way every other chosen chip and
   sort row is: a green tint with green text, not a solid green fill. */
.dash-segmented .sidebar-segmented-tab.is-active {
  background-color: var(--accent-soft);
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
  font-weight: 600;
}
