/* Life OS — 30-day overview (landscape + portrait). */

#view-overview {
  container-type: size;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ov {
  width: 100cqw;
  height: 100cqh;
  display: grid;
  grid-template-rows: auto minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2cqh;
  padding: 3cqh 3.4cqw 3cqh;
}
#view-overview[data-orient="portrait"] .ov {
  width: min(100cqw, 100cqh * 0.62);
  grid-template-rows: auto minmax(0, 1.25fr) minmax(0, 1fr);
  padding: 2.4cqh 18px;
}

.ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ov-head-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ov-title {
  font-size: clamp(18px, 3.4cqh, 40px);
  font-weight: 800;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-shadow: 0 0 calc(24px * var(--glow)) rgba(var(--accent-rgb), 0.5);
}
.ov-range {
  font-size: clamp(11px, 1.8cqh, 20px);
  font-weight: 600;
  color: var(--ink-3);
}
.ov-flip {
  background: rgba(8, 10, 28, 0.6);
  border-color: var(--line);
}

/* ---- the 30 squares ---- */
.ov-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 1cqh, 12px);
  min-height: 0;
}
#view-overview[data-orient="portrait"] .ov-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
}
.ov-day {
  --c-rgb: 150, 162, 255;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  padding: clamp(5px, 1cqh, 12px);
  border-radius: clamp(8px, 1.6cqh, 16px);
  border: 1px solid rgba(var(--c-rgb), 0.45);
  background: rgba(8, 10, 28, 0.55);
  color: #fff;
  text-align: start;
  cursor: pointer;
  transition: transform 0.24s var(--ease), border-color 0.2s ease, box-shadow 0.25s ease;
}
.ov-day:hover,
.ov-day:focus-visible {
  transform: perspective(700px) translateZ(16px);
  border-color: rgb(var(--c-rgb));
  box-shadow: 0 0 calc(22px * var(--glow)) rgba(var(--c-rgb), calc(0.45 * var(--glow)));
  z-index: 1;
}
/* the day's activities, in time order, as the square's colour */
.ov-fill {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), #000 55%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), #000 55%);
}
.ov-day > :not(.ov-fill) {
  position: relative;
}
.ov-day.is-empty {
  border-style: dashed;
  border-color: var(--line-2);
  color: var(--ink-3);
}
.ov-day.is-today {
  border-color: #fff;
  box-shadow: 0 0 0 1px #fff, 0 0 calc(26px * var(--glow)) rgba(var(--accent-rgb), 0.6);
}
.ov-dow {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(9px, 1.5cqh, 15px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.ov-num {
  font-size: clamp(16px, 4.2cqh, 54px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}
.ov-month {
  position: absolute !important;
  bottom: clamp(5px, 1cqh, 12px);
  inset-inline-end: clamp(5px, 1cqh, 12px);
  font-size: clamp(8px, 1.3cqh, 13px);
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.ov-mark {
  position: absolute !important;
  top: clamp(4px, 0.8cqh, 10px);
  inset-inline-end: clamp(4px, 0.8cqh, 10px);
  min-width: 1.7em;
  padding: 0.1em 0.4em;
  border-radius: 99px;
  background: #fff;
  color: #0a0b18;
  font-size: clamp(9px, 1.4cqh, 13px);
  font-style: normal;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* ---- what stands out ---- */
.ov-next {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1.2cqh;
  min-height: 0;
}
.ov-next-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(11px, 1.8cqh, 18px);
  font-weight: 800;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: rgb(var(--accent-rgb));
}
.ov-next-title span {
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-2);
  letter-spacing: 0;
}
.ov-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: min-content;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}
#view-overview[data-orient="portrait"] .ov-list {
  grid-template-columns: minmax(0, 1fr);
}
.ov-item {
  --c-rgb: 150, 162, 255;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--r-m);
  border: 1px solid rgba(var(--c-rgb), 0.45);
  background: linear-gradient(90deg, rgba(var(--c-rgb), 0.2), rgba(var(--c-rgb), 0.04)), rgba(8, 10, 28, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.2s ease, box-shadow 0.25s ease;
}
html[dir="rtl"] .ov-item {
  background: linear-gradient(270deg, rgba(var(--c-rgb), 0.2), rgba(var(--c-rgb), 0.04)), rgba(8, 10, 28, 0.6);
}
.ov-item:hover,
.ov-item:focus-visible {
  transform: perspective(700px) translateZ(12px);
  border-color: rgb(var(--c-rgb));
  box-shadow: 0 0 calc(20px * var(--glow)) rgba(var(--c-rgb), calc(0.35 * var(--glow)));
}
.ov-item-icon {
  --icn: 20px;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-rgb));
  background: rgba(var(--c-rgb), 0.4);
  color: #fff;
}
.ov-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.ov-item-title,
.ov-item-note,
.ov-item-when {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-item-title {
  font-size: 14px;
  font-weight: 700;
}
.ov-item-note {
  font-size: 12px;
  color: var(--ink-2);
}
.ov-item-when {
  font-size: 11.5px;
  font-weight: 600;
  color: rgb(var(--c-rgb));
  font-variant-numeric: tabular-nums;
}
.ov-item-links {
  flex: none;
  display: flex;
  gap: 4px;
  color: var(--ink-2);
}
.ov-none {
  max-width: 560px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* portrait squares are shorter: give the grid more of the height and scale the text down */
#view-overview[data-orient="portrait"] .ov {
  grid-template-rows: auto minmax(0, 2.4fr) minmax(0, 1fr);
}
#view-overview[data-orient="portrait"] .ov-num {
  font-size: clamp(14px, 3cqh, 40px);
}
#view-overview[data-orient="portrait"] .ov-dow {
  font-size: clamp(8px, 1.25cqh, 13px);
}
#view-overview[data-orient="portrait"] .ov-mark {
  font-size: clamp(8px, 1.15cqh, 12px);
}

/* ------------------------------------------------------------------ kinds legend + glow */

.ov-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.ov-kind {
  --c-rgb: 150, 162, 255;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: rgba(8, 10, 28, 0.55);
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}
.ov-kind i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--ink-4);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.ov-kind:hover {
  transform: perspective(500px) translateZ(8px);
}
.ov-kind.is-on {
  color: #fff;
  border-color: rgb(var(--c-rgb));
  background: rgba(var(--c-rgb), 0.18);
  box-shadow: 0 0 calc(16px * var(--glow)) rgba(var(--c-rgb), calc(0.4 * var(--glow)));
}
.ov-kind.is-on i {
  background: rgb(var(--c-rgb));
  box-shadow: 0 0 8px rgb(var(--c-rgb));
}

/* every square with something in it glows in its leading colour */
.ov-day:not(.is-empty) {
  border-color: rgba(var(--c-rgb), 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 calc(18px * var(--glow)) rgba(var(--c-rgb), calc(0.42 * var(--glow))),
    0 0 calc(3px * var(--glow)) rgba(var(--c-rgb), 0.9);
}
.ov-day:not(.is-empty):hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 calc(32px * var(--glow)) rgba(var(--c-rgb), calc(0.7 * var(--glow))),
    0 0 calc(4px * var(--glow)) rgb(var(--c-rgb));
}
.ov-day.is-empty {
  opacity: 0.5;
}
.ov-day.is-today,
.ov-day.is-today:not(.is-empty) {
  border-color: #fff;
  box-shadow: 0 0 0 1.5px #fff, 0 0 calc(30px * var(--glow)) rgba(var(--c-rgb), calc(0.75 * var(--glow)));
}
.ov-item {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 calc(18px * var(--glow)) rgba(var(--c-rgb), calc(0.3 * var(--glow)));
}
#view-overview[data-orient="portrait"] .ov-head {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#view-overview[data-orient="portrait"] .ov-legend {
  justify-content: flex-start;
}
