/* Dense filter bar (Requests page style) */

.dense-bar {
  flex-shrink: 0;
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.5rem;
}

.dense-bar__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.field--dense {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.field--dense span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field--dense input {
  height: 2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 0.85rem;
}

.field--dense input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.dense-bar__row .live-poll-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.date-quick-picks {
  display: flex;
  gap: 0.4rem;
}

.dense-bar__title {
  flex-shrink: 0;
  margin: 0 0.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dense-bar__title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.dense-bar__title-group .dense-bar__title {
  margin: 0;
}

.stat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  padding-top: 0.55rem;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  flex: 1 1 0;
  padding: 0.3rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--accent)) 30%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 8%, transparent);
}

button.stat-chip {
  font: inherit;
}

.stat-chip--clickable {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.stat-chip--clickable:hover {
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 16%, transparent);
  border-color: color-mix(in srgb, var(--chip-color, var(--accent)) 55%, transparent);
}

.stat-chip--active {
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 22%, transparent);
  border-color: var(--chip-color, var(--accent));
}

.stat-chip--accent { --chip-color: var(--accent); }
.stat-chip--good { --chip-color: var(--good); }
.stat-chip--warn { --chip-color: var(--warn); }
.stat-chip--bad { --chip-color: var(--bad); }

.stat-chip__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--chip-color, var(--text));

  /* The slot is sized for the value BEFORE the value exists, so the chip is
     already its final width while loading and does not resize when the number
     lands. `ch` is the width of "0" in this element's own font, so 3ch holds a
     three-digit count exactly; tabular figures stop 111 and 999 from measuring
     differently, which would otherwise still nudge the row on a live-poll tick.
     Counts wider than 3 digits grow the chip — min-width, not width, since a
     clipped total is worse than a slightly wider chip. */
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Sits in the value slot while the count loads. Sized in `em` so it inherits
   the value's font size and the chip's height is identical loading or loaded. */
.stat-chip__spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  vertical-align: -0.05em;
  border: 2px solid color-mix(in srgb, var(--chip-color, var(--accent)) 25%, transparent);
  border-top-color: var(--chip-color, var(--accent));
  border-radius: 50%;
  animation: stat-chip-spin 0.7s linear infinite;
}

@keyframes stat-chip-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .stat-chip__spinner {
    animation: none;
    /* Without the spin the ring reads as a stray circle, so flatten it to a
       neutral dot that still occupies the reserved slot. */
    border-color: color-mix(in srgb, var(--chip-color, var(--accent)) 35%, transparent);
  }
}

.stat-chip__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-chip--flash .stat-chip__value {
  animation: stat-chip-flash 1.6s ease-in-out infinite;
}

@keyframes stat-chip-flash {
  0%, 100% {
    color: var(--chip-color, var(--text));
  }
  50% {
    color: var(--text);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-chip--flash .stat-chip__value {
    animation: none;
  }
}

.stat-chip--pulse {
  animation: stat-chip-pulse-ring 1s ease-out;
}

@keyframes stat-chip-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--live-pulse, #3b82f6) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--live-pulse, #3b82f6) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-chip--pulse {
    animation: none;
  }
}

.metrics-toolbar {
  margin-bottom: 1.25rem;
}

.metrics-toolbar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.metrics-toolbar__header .card-heading {
  margin: 0;
}

.metrics-toolbar__heading-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-style: italic;
  line-height: 1;
  cursor: help;
}

/* Keeps the icon's box in flow so toggling it never re-lays-out the heading
   row. Paired with an x-bind:class rather than x-show/x-cloak, which would
   both size the element in only once deferred Alpine has booted. */
.info-icon--hidden {
  visibility: hidden;
  pointer-events: none;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
  z-index: 20;
}

.info-icon:hover::after,
.info-icon:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.metrics-toolbar__note {
  margin: -0.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.live-poll-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.live-poll-toggle input {
  accent-color: var(--accent);
}

.metrics-window {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-window select,
.filter-panel select,
.filter-panel input {
  height: 2.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.35rem;
}

.metrics-window select,
.filter-panel select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23808080' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.75rem;
}

.metrics-window select:focus,
.filter-panel select:focus,
.filter-panel input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.day-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.day-toggle__btn {
  display: inline-flex;
  align-items: center;
  font: inherit;
  height: 1.9rem;
  padding: 0 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.day-toggle__btn:hover {
  color: var(--text);
}

.day-toggle__btn--active {
  background: var(--accent);
  color: var(--surface);
}

.metrics-strip {
  margin-bottom: 0;
}

.requests-toolbar .metrics-strip {
  margin-bottom: 1.1rem;
}

/* Dashboard */

.dashboard-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.dashboard-live-grid .metrics-toolbar {
  margin-bottom: 0;
}

.card-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-heading-row .card-heading {
  margin: 0;
}

.card-heading-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.card-heading-link:hover {
  text-decoration: underline;
}

/* Requests — filter panel */

.requests-toolbar__row {
  display: flex;
}

.unified-toolbar__row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.unified-toolbar__row .field--inline {
  min-width: 150px;
}

.unified-toolbar__row .field--inline input {
  height: 2.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 0.85rem;
}

.unified-toolbar__row .field--inline input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.unified-toolbar__row .live-poll-toggle {
  padding-bottom: 0.6rem;
}

.unified-toolbar__row .requests-search {
  flex: 1 1 320px;
  margin-left: auto;
}

.requests-search {
  flex: 1;
  display: flex;
  gap: 0.75rem;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.filter-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-toggle svg {
  transition: transform 0.15s ease;
}

.filter-toggle--open svg {
  transform: rotate(180deg);
}

.filter-panel {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.filter-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
}

.field--inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.field--inline span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.filter-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.filter-panel__actions .btn {
  width: auto;
  padding: 0.6rem 1.25rem;
}

.filter-panel__actions .btn--secondary {
  width: auto;
  margin-top: 0;
  padding: 0.6rem 1.25rem;
}

/* Requests — pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--border);
}

.pagination__status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination__btn {
  padding: 0.5rem 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pagination__btn:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination__btn:disabled,
.pagination__btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Users admin page */

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
}

.user-list__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 0;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.75rem;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.user-row:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.user-row__info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.user-row__avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.user-row__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.user-row__you {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.user-row__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.user-row__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.role-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.role-badge:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.role-badge:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.role-badge--good {
  background: var(--good-soft);
  color: var(--good);
}

.role-badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.role-badge--off {
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}

/* Non-interactive status indicators — same pill shape as .role-badge, no
   hover/press affordance since these are just labels now (editing happens
   in the permissions modal via .icon-btn). */
.status-label {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-label--good {
  background: var(--good-soft);
  color: var(--good);
}

.status-label--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-label--bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.status-label--off {
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.skel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

/* Confirmation modal — reuses .picker-modal's overlay/panel shell. */

.confirm-modal__panel {
  width: min(380px, calc(100vw - 2rem));
  gap: 0.5rem;
}

.confirm-modal__body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.confirm-modal__actions .btn,
.confirm-modal__actions .btn--secondary {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 1rem;
}

.confirm-modal__actions .btn--danger {
  background: var(--bad);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--bad) 35%, transparent);
}

.confirm-modal__actions .btn--danger:hover {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--bad) 42%, transparent);
}

/* Permissions modal — reuses .picker-modal's overlay/panel shell and
   .confirm-modal__actions for the Cancel/Save row. */

/* Wider and taller than the shared .picker-modal__panel default: this panel
   carries a username field plus four toggle rows with two-line hints, which
   overflowed the shell's 420px/520px cap and clipped the Save row off the
   bottom. The height is a cap, not a fixed size — short panels still shrink. */
.permissions-modal__panel {
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  gap: 0;
}

.permissions-modal__panel .picker-modal__header {
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.75rem;
}

/* The scroll region. The header and the actions row stay pinned as flex
   siblings; only the rows between them scroll, so Save is always reachable
   however many permissions the list grows to. */
.permissions-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.permissions-modal__email {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.permissions-modal__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

/* The username row is a div (it holds a text field, not a toggle), so
   :first-of-type alone would skip it and leave a stray rule above the first
   row. Suppressing the border on the first child of any type covers both. */
.permissions-modal__row:first-of-type,
.permissions-modal__body > .permissions-modal__row:first-child {
  border-top: none;
  padding-top: 0;
}

.permissions-modal__row:last-child {
  padding-bottom: 0;
}

/* The username row stacks: a text field needs the full panel width, unlike a
   toggle which sits beside its label. It is also not a <label>, so it drops
   the pointer cursor the toggle rows use. */
.permissions-modal__row--stacked {
  display: block;
  cursor: default;
}

.username-edit {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* Sits inside the field's border so the input reads as "@ + name" rather than
   as a stray character floating beside it. */
.username-edit__field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 0.1rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.username-edit__field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Invalid usernames are rejected server-side, so the field turns red only
   after a save round-trips — there is no client-side mirror of the rules. */
.username-edit__field--error,
.username-edit__field--error:focus-within {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent);
}

.username-edit__at {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.username-edit__input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.username-edit__input:focus {
  outline: none;
}

.username-edit__save {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  padding: 0 1rem;
  white-space: nowrap;
}

.username-edit__save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Feedback lands under the field rather than as a banner behind the modal,
   which the admin could not see while the modal was open. */
.username-edit__note {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.username-edit__note--error {
  color: var(--bad);
}

.username-edit__note--ok {
  color: var(--good);
}

.permissions-modal__row--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pill-toggle {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  margin-top: 0.2rem;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pill-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.pill-toggle:checked {
  background: var(--accent);
}

.pill-toggle:checked::before {
  transform: translateX(16px);
}

.pill-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.permissions-modal__label {
  font-size: 0.88rem;
  font-weight: 600;
}

.permissions-modal__hint {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Date inputs ------------------------------------------------------------ */

/* App-wide, because every date field previously inherited only a border and a
   background from its context (.field input, .field--dense input, the unified
   toolbar, the reconciliation day bar) and left the native control alone. Two
   things were wrong with that:

   1. No `color-scheme`, so the browser drew the calendar glyph and the picker
      popup in its LIGHT palette regardless of theme — a near-invisible dark
      speck on a dark field.
   2. The default indicator is roughly 12px of unstyled chrome that reads as a
      stray artefact rather than a control.

   Declaring `color-scheme` fixes both the glyph and the popup the browser
   renders on top; the indicator is then scaled up and given a hit area and
   hover so it behaves like every other affordance on the page. */
input[type="date"] {
  color-scheme: light dark;
}

/* WebKit/Blink only — Firefox has no pseudo-element for this and keeps its own
   (already legible) indicator, which is why this is additive rather than a
   `appearance: none` rebuild that would leave Firefox with nothing. */
input[type="date"]::-webkit-calendar-picker-indicator {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0.15rem;
  margin-left: 0.35rem;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* The spin/clear affordances inside the field are noise at these sizes — the
   segments are directly editable and the picker covers the rest. */
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none;
}

/* Keeps the three segments from crowding the glyph once it has real size. */
input[type="date"]::-webkit-datetime-edit {
  padding-block: 0;
}
