.weekly-learning {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #4694d9;
  border-radius: 16px;
  background: radial-gradient(ellipse at 12% 0%, #16598e 0%, transparent 52%),
    linear-gradient(165deg, #0d3155, #091c35 66%, #0b2847);
  box-shadow: inset 0 1px 12px #469de04d, 0 0 0 1px #63b7f226, 0 5px 16px #102d4a25;
  color: #eef7ff;
  container-type: inline-size;
}
.weekly-learning[hidden] { display: none; }
.weekly-learning h3, .weekly-learning h4, .weekly-learning p { margin: 0; }
.weekly-learning h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.weekly-learning h3::before {
  content: "";
  flex: 0 0 15px;
  height: 14px;
  color: #a4f0ff;
  background:
    linear-gradient(currentColor, currentColor) left bottom / 3px 5px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 3px 13px no-repeat;
}
.weekly-learning-dates, .weekly-learning-rule, .weekly-learning-help {
  color: #bfd8f0;
  font-size: 12px;
  line-height: 1.5;
}
.weekly-learning .weekly-learning-dates { margin: 5px 0 10px; }
.weekly-learning-controls, .weekly-learning-controls label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}
.weekly-learning-controls input {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #6196c1;
  border-radius: 6px;
  color-scheme: dark;
  background: #0b223d;
  color: #eef7ff;
  font: inherit;
}
.weekly-learning :is(input, button):focus-visible {
  outline: 2px solid #91edff;
  outline-offset: 2px;
}
.weekly-learning-content { margin: 12px 0; }
.weekly-learning-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.weekly-learning-metric {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  min-width: 0;
  align-content: start;
  padding: 3px clamp(7px, 2cqi, 15px);
}
.weekly-learning-metric + .weekly-learning-metric {
  border-inline-start: 1px solid #5289b06b;
}
.weekly-learning-metric h4 {
  grid-row: 2;
  padding: 4px 0 8px;
  font-size: 13px;
  line-height: 1.3;
}
.weekly-learning-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  min-height: 20px;
  color: #bfd8f0;
  font-size: 12px;
}
.weekly-learning-value:first-of-type { grid-row: 1; }
.weekly-learning-value strong {
  color: #dcf6ff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.weekly-learning-value:first-of-type strong {
  order: -1;
  color: #a4f0ff;
  font-size: clamp(18px, 5.1cqi, 28px);
  line-height: 1.12;
  text-shadow: 0 0 14px #54d7ff55;
}
.weekly-learning-value:last-of-type {
  padding-top: 6px;
  border-top: 1px solid #5289b054;
}
.weekly-learning-value small:empty { display: none; }

@container (max-width: 270px) {
  .weekly-learning-metrics { grid-template-columns: 1fr; }
  .weekly-learning-metric {
    grid-row: auto;
    grid-template-rows: auto auto auto;
    padding: 8px 0;
  }
  .weekly-learning-metric + .weekly-learning-metric {
    border-inline-start: 0;
    border-top: 1px solid #5289b06b;
  }
}

.weekly-trend {
  border-top: 1px solid #365575;
  margin-top: 16px;
  padding-top: 16px;
}
.weekly-trend[hidden], .weekly-trend [hidden] { display: none; }
.weekly-trend-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  flex-wrap: wrap;
}
.weekly-trend-heading h4 { font-size: 16px; }
.weekly-trend-period { color: #bfd8f0; font-size: 12px; }
.weekly-trend-semester { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.weekly-trend-semester select {
  max-width: 100%;
  color: #eef7ff;
  background: #0b223d;
  border: 1px solid #436f9b;
  border-radius: 6px;
  padding: 4px 7px;
  font: inherit;
}
.weekly-trend-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: 11px 0;
}
.weekly-trend-controls button {
  color: #d4eaff;
  border: 1px solid #446d94;
  background: #132f4d;
  border-radius: 7px;
  padding: 6px 10px;
  min-height: 34px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.weekly-trend-controls [aria-pressed="true"] {
  color: #b7f4ff;
  background: #18445f;
  border-color: #6ce0f3;
}
.weekly-trend-chart {
  background: #081d35;
  border: 1px solid #315883;
  border-radius: 10px;
  padding: 5px 5px 1px;
}
.weekly-trend canvas { display: block; width: 100%; height: 230px; }
.weekly-trend canvas:focus-visible { outline: 2px solid #a4f0ff; outline-offset: 1px; }
.weekly-learning .weekly-trend-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
  margin-top: 8px;
  padding: 6px 9px;
  background: #102f4c;
  border-radius: 6px;
  color: #c6ddf4;
  font-size: 13px;
}
.weekly-trend-details strong { color: #a4f0ff; font-size: 14px; font-variant-numeric: tabular-nums; }
@container (max-width: 450px) {
  .weekly-trend canvas { height: 195px; }
}
