.zgt, .zgc {
  --zt-line: var(--rule);
  --zt-paper: var(--surface);
  --zt-tint: var(--page);
  --zt-ink: var(--ink);
  --zt-soft: var(--muted);
  --zt-green: var(--forest);
  min-width: 0;
  color: var(--zt-ink);
}
.zgt button, .zgc button { font-family: inherit; touch-action: manipulation; cursor: pointer; }
.zgt button:focus-visible, .zgc button:focus-visible {
  z-index: 4;
  outline: 3px solid var(--forest);
  outline-offset: -3px;
}
.zgt-scroll {
  position: relative;
  max-height: 72vh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--zt-line);
  border-radius: 9px;
  background: var(--zt-paper);
}
.zgt-grid {
  --zgt-step: 43px;
  --zgt-stub: 86px;
  width: max(100%, calc(var(--zgt-stub) + var(--zgt-count) * var(--zgt-step)));
  font-variant-numeric: tabular-nums;
}
.zgt-row {
  display: grid;
  grid-template-columns: var(--zgt-stub) repeat(var(--zgt-count), minmax(var(--zgt-step), 1fr));
  border-bottom: 1px solid var(--zt-line);
}
.zgt-head {
  position: sticky;
  top: 0;
  z-index: 6;
  color: var(--zt-soft);
  background: var(--zt-paper);
  font-size: 0.81rem;
}
.zgt-head > span { display: flex; align-items: center; justify-content: center; min-height: 35px; }
.zgt-head .zgt-stub { justify-content: flex-start; }
.zgt-hour { color: var(--zt-ink); font-weight: 650; }
.zgt-minute { border-left: 1px solid var(--rule); }
.zgt-data {
  grid-auto-rows: minmax(49px, auto);
  background-color: var(--zt-paper);
  background-image: repeating-linear-gradient(to right, var(--zt-line) 0 1px, transparent 1px 100%);
  background-size: calc((100% - var(--zgt-stub)) / var(--zgt-count)) 100%;
  background-position: var(--zgt-stub) 0;
}
.zgt-stub {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 4px 9px;
  border-right: 1px solid var(--zt-line);
  color: var(--zt-ink);
  background: var(--zt-paper);
}
.zgt-stub strong { font-size: 0.94rem; }
.zgt-stub small { font-size: 0.75rem; color: var(--zt-soft); }
.zgt-zone { color: var(--zt-soft); background: var(--zt-tint); border-bottom: 1px solid var(--zt-line); }
.zgt-zone span { display: inline-block; position: sticky; left: 0; padding: 5px 9px; font-size: 0.81rem; font-weight: 650; }
.zgt-slot {
  appearance: none;
  min-height: 44px;
  margin: 1px;
  border: 0;
  padding: 0;
  border-radius: 3px;
  color: var(--zt-green);
  background: transparent;
  font-weight: 650;
}
.zgt-slot:hover, .zgt-slot:focus-visible { background: var(--mint); }
.zgt-slot:hover::before, .zgt-slot:focus-visible::before { content: "+"; font-size: 1.2rem; }
.zgt-bar {
  appearance: none;
  z-index: 1;
  min-width: 0;
  min-height: 43px;
  margin: 3px 2px;
  padding: 3px 7px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  border: 0;
  border-left: 3px solid var(--bar-edge);
  border-radius: 5px;
  text-align: left;
  line-height: 1.15;
  background-color: var(--bar-surface);
  color: var(--bar-ink);
}
.zgt-bar > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zgt-bar strong { font-size: 0.85rem; font-weight: 650; }
.zgt-bar span { font-size: 0.76rem; margin-top: 3px; }
.zgt-bar[data-status] { --bar-surface:var(--color-estado); --bar-edge:var(--tinta-estado); --bar-ink:var(--tinta-estado); }
.zgt-bar[data-status="block"] {
  --bar-surface: var(--page); --bar-edge: var(--control); --bar-ink: var(--muted);
  background-image: repeating-linear-gradient(-45deg, transparent 0 5px, #87878720 5px 7px);
}
.zgt-help { margin: 0.65rem 0 0; color: var(--zt-soft); font-size: 0.86rem; }

.zgc { container-type: inline-size; }
.zgc-head, .zgc-paging, .zgc-info { display: flex; flex-wrap: wrap; align-items: center; }
.zgc-head { justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.zgc-head h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.zgc-head h2::first-letter { text-transform: uppercase; }
.zgc-paging { gap: 5px; }
.zgc-month {
  min-height: 42px;
  padding: 6px 11px;
  border: 1px solid var(--zt-line);
  border-radius: 7px;
  background: var(--zt-paper);
  color: var(--zt-ink);
  font-size: 0.875rem;
}
.zgc-month:hover { background: var(--zt-tint); }
.zgc-info { gap: 8px 14px; margin: 0 0 10px; color: var(--zt-soft); font-size: 0.875rem; }
.zgc-sun { color: var(--forest); }
.zgc-moon { color: var(--muted); }
.zgc-calendar { width: 100%; table-layout: fixed; border-spacing: 0; border-collapse: collapse; background: var(--zt-paper); }
.zgc-calendar th, .zgc-calendar td { border: 1px solid var(--zt-line); padding: 0; }
.zgc-calendar th { padding: 6px 0; font-size: 0.82rem; color: var(--zt-soft); font-weight: 600; background: var(--zt-tint); }
.zgc-day {
  appearance: none;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 4px 9px;
  width: 100%;
  min-height: 85px;
  margin: 0;
  padding: 9px;
  border: none;
  background: var(--zt-paper);
  color: var(--zt-ink);
  font-size: 0.87rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.zgc-day[data-adjacent="true"] { background: var(--page); color: var(--zt-soft); }
.zgc-day:is(:hover, :focus-visible) { background: var(--mint); }
.zgc-day[data-selected="true"] { box-shadow: inset 0 0 0 2px var(--zt-green); background: var(--activo); }
.zgc-daynum { width: 100%; font-size: 1rem; margin-bottom: 1px; }
.zgc-day[aria-current="date"] .zgc-daynum { color: var(--zt-green); text-decoration: underline 2px; text-underline-offset: 3px; }
.zgc-count { display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.zgc-count[data-empty="true"] { color: var(--muted); }
.zgc-symbol { font-size: 0.85rem; }
@container (max-width: 570px) {
  .zgc-day { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 1px; min-height: 73px; padding: 5px 4px; }
  .zgc-info { column-gap: 10px; }
}
