/* ---------- Cards & overview ---------- */

.card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014));
  box-shadow: 0 20px 50px -40px #000;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.card-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.card-head .small {
  margin-top: 3px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.overview-grid > * {
  min-width: 0;
}

.overview-grid .card {
  height: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.pill.good {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

.pill.warn {
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.pill.bad {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
}

.big-number {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.big-number .unit {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.big-number .muted {
  margin-left: 4px;
  font-size: 16px;
  font-weight: 600;
}

/* Progress card */

.progress-body {
  display: flex;
  align-items: center;
  gap: 22px;
}

.ring {
  position: relative;
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.075);
  stroke-width: 9;
}

.ring-fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.ring-label strong {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.ring-label span {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.progress-info {
  min-width: 0;
  flex: 1;
}

.progress-info > .small {
  margin-top: 5px;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mini-stats span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-stats strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-footnote {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.progress-footnote svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: #6ee7b7;
}

/* Today card */

.today-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.today-main .small {
  margin-top: 3px;
}

.today-main .pill {
  margin-bottom: 3px;
}

.bar {
  height: 8px;
  margin-top: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.bar.green > span {
  background: linear-gradient(90deg, #10b981, #6ee7b7);
}

.bar.amber > span {
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
}

.today-card .hint {
  min-height: 34px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.today-card .btn {
  margin-top: 13px;
}

/* Exam card */

.exam-name {
  overflow: hidden;
  margin-top: -9px;
  margin-bottom: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-card .big-number {
  margin-top: 2px;
  font-size: clamp(38px, 4vw, 52px);
  background: linear-gradient(100deg, #f8fafc, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.exam-card .big-number .unit {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  -webkit-text-fill-color: var(--muted);
}

.exam-card .exam-date {
  margin-top: 3px;
}

.exam-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.exam-footer > div span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exam-footer > div strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
}

.exam-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 4px;
}

.exam-empty .big-number {
  font-size: 28px;
}

/* ---------- Stats strip ---------- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  min-width: 0;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.13);
  color: var(--violet-light);
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-icon.cyan {
  background: rgba(34, 211, 238, 0.1);
  color: #67e8f9;
}

.stat-icon.amber {
  background: rgba(251, 146, 60, 0.11);
  color: #fdba74;
}

.stat-icon.green {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

.stat-text {
  min-width: 0;
}

.stat-label {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  overflow: hidden;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- Chart ---------- */

.chart-card {
  margin-top: 16px;
  padding: 24px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chart-head h2 {
  font-size: 17px;
}

.chart-head .small {
  margin-top: 4px;
}

.chart-kpis {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.chart-kpi span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-kpi strong {
  display: block;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.chart {
  --chart-bar-h: 150px;
  --chart-labels: 30px;
  position: relative;
  padding-top: 6px;
}

.chart-cols {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
  height: 184px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.chart-bar-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 150px;
}

.chart-bar {
  position: relative;
  width: 100%;
  max-width: 32px;
  min-height: 3px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #8b5cf6, #5b21b6);
  transition: height 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), filter 0.15s ease;
}

.chart-bar.empty {
  background: rgba(255, 255, 255, 0.075);
}

.chart-col:hover .chart-bar {
  filter: brightness(1.25);
}

.chart-col.today .chart-bar {
  background: linear-gradient(180deg, #67e8f9, #0e7490);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.25);
}

.chart-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 3;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #1a2339;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.chart-col:hover .chart-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.chart-day {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.chart-day b {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.chart-col.today .chart-day,
.chart-col.today .chart-day b {
  color: #67e8f9;
}

.chart-goal {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 2;
  border-top: 1.5px dashed rgba(251, 191, 36, 0.55);
  pointer-events: none;
}

.chart-goal span {
  position: absolute;
  right: 0;
  top: -10px;
  padding: 1px 7px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 999px;
  background: #1a1b26;
  color: #fcd34d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.chart-empty {
  position: absolute;
  inset: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(180deg, #8b5cf6, #5b21b6);
}

.legend-dot.cyan {
  background: linear-gradient(180deg, #67e8f9, #0e7490);
}

.legend-line {
  width: 16px;
  height: 0;
  border-top: 1.5px dashed rgba(251, 191, 36, 0.7);
}

/* ---------- Section / playlists ---------- */

.section {
  margin-top: 46px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-top: 6px;
  font-size: clamp(23px, 2.6vw, 29px);
  font-weight: 800;
}

.section-head p:not(.eyebrow) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.demo-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 16px;
  padding: 11px 15px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 13px;
  background: rgba(251, 191, 36, 0.055);
  color: #fcd34d;
  font-size: 12px;
}

.demo-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.demo-note p {
  flex: 1 1 260px;
}

.demo-note .btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}

.demo-note .icon-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: #fcd34d;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.playlist-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow: 0 20px 45px -40px #000;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.playlist-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2.5px;
  background: var(--pc);
  opacity: 0.85;
}

.playlist-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.playlist-card.done {
  border-color: rgba(52, 211, 153, 0.2);
}

.pl-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pl-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  background: color-mix(in srgb, var(--pc) 15%, transparent);
  color: var(--pc);
}

.pl-icon svg {
  width: 18px;
  height: 18px;
}

.pl-title-wrap {
  min-width: 0;
  flex: 1;
}

.pl-title-wrap h3 {
  overflow: hidden;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-title-wrap p {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
}

.pl-progress {
  margin-top: 18px;
}

.pl-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.pl-progress-top strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

.pl-progress .bar {
  margin-top: 8px;
}

.pl-progress .bar > span {
  background: var(--pc);
}

.pl-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
}

.pl-next {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
}

.pl-next strong {
  overflow: hidden;
  color: var(--text-soft);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.pl-next .pl-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6ee7b7;
  font-weight: 700;
}

.pl-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 13px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.pl-toggle:hover {
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
}

.pl-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.pl-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.video-list {
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.video-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 9px;
  transition: background 0.13s ease;
}

.video-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.check svg {
  width: 12px;
  height: 12px;
}

.check:hover {
  border-color: var(--pc);
  transform: scale(1.06);
}

.check.done {
  border-color: var(--pc);
  background: var(--pc);
  color: #08111f;
}

.video-info {
  min-width: 0;
  flex: 1;
}

.video-title {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-row.watched .video-title {
  color: var(--muted-2);
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.4);
}

.video-meta {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
}

.video-date {
  width: 108px;
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  outline: none;
}

.video-date:hover,
.video-date:focus {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.video-del {
  opacity: 0;
  color: var(--muted-2);
  transition: opacity 0.15s ease, color 0.15s ease;
}

.video-row:hover .video-del,
.video-del:focus-visible {
  opacity: 1;
}

.video-del:hover {
  color: #fda4af !important;
  background: rgba(244, 63, 94, 0.08) !important;
}

.video-empty {
  padding: 12px 6px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.add-video {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.add-video .input {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11.5px;
}

.add-video input[name="title"] {
  flex: 1;
  min-width: 0;
}

.add-video input[name="duration"] {
  width: 64px;
  flex: 0 0 auto;
  text-align: center;
}

.add-video .btn {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 11px;
}

.empty-playlists {
  grid-column: 1 / -1;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.018);
  text-align: center;
}

.empty-playlists .empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--violet-light);
}

.empty-playlists .empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-playlists h3 {
  font-size: 18px;
}

.empty-playlists p {
  max-width: 430px;
  margin: 6px auto 18px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Bottom grid / achievements / history ---------- */

.bottom-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 16px;
  margin-top: 46px;
  align-items: start;
}

.bottom-grid > * {
  min-width: 0;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.badge.unlocked {
  border-color: rgba(139, 92, 246, 0.18);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(34, 211, 238, 0.035));
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-size: 18px;
  filter: grayscale(1);
  opacity: 0.5;
}

.badge.unlocked .badge-icon {
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.13);
  filter: none;
  opacity: 1;
}

.badge-text {
  min-width: 0;
  flex: 1;
}

.badge-text strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-text span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.unlocked .badge-text span {
  color: var(--muted);
}

.badge-lock {
  flex: 0 0 auto;
  font-size: 10px;
  opacity: 0.5;
}

.badge-check {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
  font-size: 10px;
  font-weight: 900;
}

.history-card {
  min-height: 100%;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-height: 470px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar,
.quick-list::-webkit-scrollbar {
  width: 5px;
}

.history-list::-webkit-scrollbar-thumb,
.quick-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.history-day {
  position: relative;
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.history-day::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -3.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

.history-day.today::before {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
}

.history-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.history-date span {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 7px;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.history-item .dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pc);
}

.history-item .title {
  overflow: hidden;
  flex: 1;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .min {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.history-item .history-time {
  color: var(--cyan);
}

.history-item .icon-btn {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  opacity: 0;
}

.history-item:hover .icon-btn,
.history-item .icon-btn:focus-visible {
  opacity: 1;
}

.history-empty {
  padding: 28px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.history-card .btn.full {
  margin-top: 14px;
}

@media (hover: none) {
  .video-del,
  .history-item .icon-btn {
    opacity: 1;
  }
}

/* ---------- Daily plan & pace simulator ---------- */

.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.focus-grid > * {
  min-width: 0;
}

.plan-card,
.sim-card {
  align-self: start;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 5px;
  border-radius: 10px;
}

.plan-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.plan-item .check {
  width: 24px;
  height: 24px;
}

.plan-info {
  min-width: 0;
  flex: 1;
}

.plan-title {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-meta .dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pc);
}

.plan-info .bar.mini {
  margin-top: 6px;
}

.plan-play {
  flex: 0 0 auto;
  color: var(--violet-light);
}

.plan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.plan-empty {
  padding: 22px 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

.plan-empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.bar.mini {
  height: 5px;
  margin-top: 7px;
}

.plan-card .bar.mini > span,
.video-bar > span {
  background: var(--pc, var(--violet));
}

.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-control label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sim-control label strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.sim-control input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sim-control input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #0f1626;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.5);
  appearance: none;
  -webkit-appearance: none;
}

.sim-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #0f1626;
  border-radius: 50%;
  background: #a78bfa;
}

.sim-result {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.sim-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sim-date span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sim-date strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.sim-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.sim-kpis div {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.sim-kpis span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sim-kpis strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-note {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.sim-note.good {
  color: #6ee7b7;
}

.sim-note.warn {
  color: #fcd34d;
}

.sim-need,
.sim-compare {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.sim-need strong,
.sim-compare strong {
  color: var(--text-soft);
}

/* ---------- Calendar & retrospectives ---------- */

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.calendar-layout > * {
  min-width: 0;
}

.calendar-card {
  padding: 22px;
}

.calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.calendar-head h3 {
  font-size: 18px;
  font-weight: 800;
}

.calendar-head .small {
  margin-top: 3px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.calendar-nav .btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 48px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.cal-day:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.cal-day.blank {
  border-color: transparent;
  background: transparent;
}

.cal-num {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.cal-min {
  min-height: 11px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.cal-day.lvl-1 {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.18);
  color: #ddd1ff;
}

.cal-day.lvl-2 {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.28);
  color: #ede9fe;
}

.cal-day.lvl-3 {
  background: rgba(34, 211, 238, 0.2);
  border-color: rgba(34, 211, 238, 0.26);
  color: #cffafe;
}

.cal-day.lvl-4 {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.55), rgba(34, 211, 238, 0.35));
  border-color: rgba(167, 139, 250, 0.45);
  color: #fff;
}

.cal-day.rest {
  border-style: dashed;
}

.cal-day.rest.lvl-0 {
  background: rgba(255, 255, 255, 0.012);
}

.cal-day.frozen {
  border-color: rgba(96, 165, 250, 0.35);
}

.cal-day.today {
  box-shadow: 0 0 0 1.5px var(--cyan), 0 0 16px rgba(34, 211, 238, 0.18);
}

.cal-day.future {
  opacity: 0.35;
}

.cal-freeze {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  color: #93c5fd;
}

.cal-freeze svg {
  width: 9px;
  height: 9px;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cal-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.cal-swatch.lvl-1 { background: rgba(139, 92, 246, 0.2); }
.cal-swatch.lvl-2 { background: rgba(139, 92, 246, 0.38); }
.cal-swatch.lvl-3 { background: rgba(34, 211, 238, 0.35); }
.cal-swatch.lvl-4 { background: linear-gradient(135deg, #8b5cf6, #22d3ee); }
.cal-swatch.rest { border-style: dashed; }
.cal-swatch.frozen { border-color: rgba(96, 165, 250, 0.5); }

.retro-grid {
  display: grid;
  gap: 16px;
}

.retro-card {
  padding: 19px;
}

.retro-card .card-head {
  margin-bottom: 10px;
}

.retro-card h3 {
  font-size: 14px;
  font-weight: 800;
}

.retro-main {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.retro-main strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.retro-main span {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
}

.delta {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.delta.up {
  background: rgba(52, 211, 153, 0.11);
  color: #6ee7b7;
}

.delta.down {
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
}

.delta.flat {
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted-2);
}

.retro-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  height: 64px;
  margin-top: 12px;
  padding-top: 4px;
}

.retro-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  min-width: 0;
}

.retro-bar i {
  width: 100%;
  max-width: 20px;
  min-height: 2px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #8b5cf6, #5b21b6);
}

.retro-bar.rest i {
  background: rgba(255, 255, 255, 0.09);
}

.retro-bar.future {
  opacity: 0.35;
}

.retro-bar span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.retro-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.retro-kpis span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.retro-kpis strong {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.retro-top {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.retro-top strong {
  color: var(--text-soft);
}

.retro-card .hint {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

/* ---------- Streak freeze ---------- */

.freeze-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 4px 9px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.08);
  color: #93c5fd;
  font-size: 10px;
  font-weight: 800;
  transition: background 0.15s ease, transform 0.15s ease;
}

.freeze-btn:hover {
  background: rgba(96, 165, 250, 0.16);
  transform: translateY(-1px);
}

.freeze-btn svg {
  width: 12px;
  height: 12px;
}

.freeze-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
}

.freeze-note svg {
  width: 11px;
  height: 11px;
  color: #93c5fd;
}

.hero-progress-note {
  color: #c4b5fd;
  font-weight: 700;
}

/* ---------- Video partial progress / YouTube ---------- */

.video-row {
  flex-wrap: wrap;
}

.video-row.partial .video-title {
  color: #ddd1ff;
}

.video-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.step-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.step-btn:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  color: var(--violet-light);
}

.step-btn.plus {
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.07);
  color: #6ee7b7;
}

.step-btn.plus:hover {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.14);
}

.video-play {
  color: var(--violet-light);
}

.video-play:hover {
  background: rgba(139, 92, 246, 0.14) !important;
}

.video-row .video-date {
  width: 98px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.history-play {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  opacity: 0;
}

.history-item:hover .history-play,
.history-item .history-play:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .history-play {
    opacity: 1;
  }
}

/* ---------- Downloads offline ---------- */

.offline-slot {
  display: inline-flex;
  align-items: center;
}

.video-download {
  color: #67e8f9;
}

.video-download:hover {
  background: rgba(34, 211, 238, 0.12) !important;
}

.offline-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.offline-chip svg {
  width: 12px;
  height: 12px;
}

.offline-chip.ready {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

.offline-chip.downloading {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
}

.offline-chip.error {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  cursor: pointer;
}

.offline-chip.unavailable {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
}

.offline-spinner {
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: offline-spin 0.8s linear infinite;
}

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

button.offline-chip {
  font-family: inherit;
  cursor: pointer;
}

button.offline-chip:hover {
  filter: brightness(1.15);
}

/* ---------- Área de downloads offline ---------- */

.downloads-card {
  padding: 14px;
}

.downloads-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.download-row.is-job {
  border-style: dashed;
}

.download-art {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--pc, #8b5cf6), rgba(34, 211, 238, 0.75));
  color: #08111f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.download-art svg {
  width: 20px;
  height: 20px;
}

.download-art.downloading {
  background: rgba(139, 92, 246, 0.14);
  color: var(--violet-light);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.download-art.error {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.28);
}

.download-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.download-title {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.download-actions .btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 11px;
}

.download-actions .icon-btn {
  opacity: 1;
}

.download-progress {
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.download-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 0.25s ease;
}

.download-empty {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 16px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.download-empty p {
  max-width: 560px;
  line-height: 1.65;
}

.download-empty code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 11px;
}

@media (max-width: 860px) {
  .downloads-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .downloads-card {
    padding: 10px;
  }

  .download-row {
    flex-wrap: wrap;
    gap: 9px;
    padding: 10px;
  }

  .download-info {
    flex: 1 1 0;
  }

  .download-title {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .download-meta {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .download-actions {
    align-self: flex-start;
    flex: 0 0 auto;
  }
}
