/* Today (plan 13). Everything under .today-view; tokens only. */
.today-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.today-view .today-head h1 {
  margin: 2px 0 0;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.6px;
}
.today-view .today-date {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.today-view .today-h2 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.today-view .today-welcome-slot:empty {
  display: none;
}

/* --- Welcome (guests, first visit) --- */
.today-view .welcome {
  position: relative;
  padding: 22px 22px 20px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: radial-gradient(120% 140% at 0% 0%, var(--primary-soft), transparent 55%), var(--surface-color);
}
.today-view .welcome-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--text-muted);
}
.today-view .welcome-close .icon {
  width: 18px;
  height: 18px;
}
.today-view .welcome-title {
  margin: 0 40px 6px 0;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
}
.today-view .welcome-line {
  margin: 0 0 18px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 56ch;
}
.today-view .welcome-about {
  color: var(--text-color);
  white-space: nowrap;
}
.today-view .welcome-paths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.today-view .welcome-path {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.today-view .welcome-path:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.today-view .welcome-path-icon {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}
.today-view .welcome-path-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.today-view .welcome-path-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* --- Study card --- */
.today-view .study-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
}
.today-view .study-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
.today-view .study-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}
.today-view .study-icon .icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.today-view .study-text {
  flex: 1;
  min-width: 0;
}
.today-view .study-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  letter-spacing: -0.3px;
}
.today-view .study-line {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}
.today-view .study-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}
.today-view .study-streak .icon {
  width: 16px;
  height: 16px;
}
.today-view .study-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.92rem;
}
.today-view .study-resume:hover {
  border-color: var(--primary);
}
.today-view .study-resume .icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.today-view .study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.today-view .study-start {
  min-width: 180px;
}
.today-view .hands-free-btn .icon {
  width: 18px;
  height: 18px;
}

/* --- Recents --- */
.today-view .recents-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.today-view .recent {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-color);
  text-decoration: none;
  min-width: 0;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.today-view .recent:hover {
  border-color: var(--surface-hover);
  background: var(--surface-hover);
}
.today-view .recent-thumb {
  width: 48px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--primary);
  background: var(--primary-soft);
}
.today-view .recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.today-view .recent-thumb[data-kind="note"] {
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
}
.today-view .recent-thumb[data-kind="course"] {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}
.today-view .recent-thumb[data-kind="deck"] {
  color: var(--easy);
  background: rgba(56, 189, 248, 0.12);
}
.today-view .recent-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.today-view .recent-kind {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.today-view .recent-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.today-view .recent-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-view .recent-progress {
  margin-top: auto;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-hover);
  overflow: hidden;
}
.today-view .recent-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-gradient);
}

/* --- Start something --- */
.today-view .start-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.today-view .start-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-color);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.today-view .start-tile:hover {
  background: var(--surface-hover);
}
.today-view .start-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--text-color);
  background: var(--surface-hover);
}
.today-view .start-tile:hover .start-icon {
  background: var(--bg-color);
}
.today-view .start-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.today-view .start-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.today-view .start-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.today-view .start-go {
  display: none;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .today-view {
    gap: 24px;
  }
  .today-view .today-head h1 {
    font-size: 1.7rem;
  }
  .today-view .welcome {
    padding: 18px 16px 16px;
  }
  .today-view .welcome-paths,
  .today-view .start-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .today-view .welcome-path {
    padding: 12px;
  }
  .today-view .welcome-line {
    font-size: 0.92rem;
    margin-bottom: 14px;
  }
  .today-view .welcome-path-icon {
    width: 34px;
    height: 34px;
  }
  .today-view .study-card {
    padding: 18px;
    gap: 16px;
  }
  .today-view .study-main {
    align-items: flex-start;
    gap: 14px;
  }
  .today-view .study-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .today-view .study-line {
    font-size: 0.9rem;
  }
  .today-view .study-actions > * {
    flex: 1 1 100%;
  }
  .today-view .start-go {
    display: block;
  }
  /* Recents scroll sideways on a phone */
  .today-view .recents-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 4px;
    scrollbar-width: none;
  }
  .today-view .recents-row::-webkit-scrollbar {
    display: none;
  }
  .today-view .recent {
    flex: 0 0 78%;
    scroll-snap-align: start;
    scroll-margin-left: var(--gutter);
  }
}
