/* Date grid — the visible half. Pairs with calendar.js; the two files are the
   whole component. Every colour and size reads a role token with a dark-ground
   fallback, so it can be dropped on a page that has none. */

.cal-group { min-width: 0; }
.cal { display: block; min-width: 0; position: relative; }
.cal[hidden] { display: none; }

/* The trigger stands where the native input stood, at the input's own metrics. */
.cal__b {
  width: 100%; min-width: 0; display: block; text-align: left; cursor: pointer;
  background: var(--tint, hsl(226 8% 19%)); border: 0; border-radius: 4px;
  padding: 11px 12px; margin: 0;
  font-family: inherit; font-size: var(--type-body, 17px); font-weight: 500; letter-spacing: -.015em;
  color: var(--ink-meta, #9A9DA4); /* #9A9DA4 on #2D2E31 = 5.2:1, the resting hint */
  transition: background-color .3s;
}
.cal__b:hover { background: var(--tint-2, hsl(226 8% 23%)); }
.cal__b.is-set { color: var(--ink, #F1F2F3); }

/* Inline, below the field: nothing to reposition on scroll, and the same
   behaviour on a phone as on a desktop. */
.cal-panel {
  grid-column: 1 / -1; width: 100%; max-width: 336px; margin-top: 6px; padding: 12px;
  background: var(--tint, hsl(226 8% 19%)); border: 1px solid var(--rule, hsl(226 8% 26%));
  border-radius: 4px;
  animation: cal-in .2s var(--ease, cubic-bezier(.4, 0, .15, 1));
}
.cal-panel[hidden] { display: none; }
@keyframes cal-in { from { opacity: 0; transform: translateY(-4px); } }

.cal-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-panel__m {
  font-family: var(--mono, ui-monospace, monospace); font-size: var(--type-micro, 11px);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink, #F1F2F3);
}
.cal-nav {
  width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 3px; cursor: pointer;
  font-family: var(--mono, ui-monospace, monospace); font-size: 17px; line-height: 1;
  color: var(--ink-meta, #9A9DA4); transition: color .2s;
}
.cal-nav:hover { color: var(--ink, #F1F2F3); }
.cal-nav:disabled { color: var(--ghost-row, hsl(226 6% 28%)); cursor: default; }

.cal-week, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week {
  margin: 10px 0 2px;
  font-family: var(--mono, ui-monospace, monospace); font-size: var(--type-micro, 11px);
  letter-spacing: .12em; color: var(--ink-meta, #9A9DA4);
}
.cal-week span { text-align: center; }

.cal-day {
  min-height: 40px; min-width: 0; padding: 0; cursor: pointer;
  background: transparent; border: 0; border-radius: 3px;
  font-family: var(--mono, ui-monospace, monospace); font-size: var(--type-meta, 13px);
  letter-spacing: .04em; color: var(--ink-2, #C7C9CE);
  transition: background-color .2s;
}
.cal-day--pad { cursor: default; }
.cal-day:not(:disabled):hover { background: var(--tint-2, hsl(226 8% 23%)); color: var(--ink, #F1F2F3); }
.cal-day:disabled { color: var(--ghost-row, hsl(226 6% 28%)); cursor: default; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--rule, hsl(226 8% 26%)); }
.cal-day.is-in { background: color-mix(in oklab, var(--accent-hi, #F0663A), transparent 84%); color: var(--ink, #F1F2F3); border-radius: 0; }
.cal-day.is-on {
  background: var(--accent-hi, #F0663A);
  color: #17181A; /* #17181A on #F0663A = 5.7:1 */
  box-shadow: none;
}
.cal-day.is-on:hover { background: var(--accent-hi, #F0663A); color: #17181A; }

.cal-hint {
  margin: 8px 0 0;
  font-family: var(--mono, ui-monospace, monospace); font-size: var(--type-micro, 11px);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-meta, #9A9DA4);
}
.cal-hint[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { .cal-panel { animation: none; } }
@media print { .cal-panel { display: none; } }
