/* =========================================================
   StudyNet — page compositions
   ========================================================= */

/* ----------------------------- Dashboard ----------------------------- */

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

.stat-card {
  position: relative;
  min-height: 125px;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -25px;
  bottom: -33px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  border: 1px solid var(--stat-soft, rgba(49, 87, 245, 0.12));
  pointer-events: none;
}

.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-card__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--stat-soft, var(--primary-soft));
  color: var(--stat-color, var(--primary));
}

.stat-card__trend {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 600;
}

.stat-card__trend b {
  color: var(--stat-color, var(--primary));
  font-weight: 700;
}

.stat-card__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 13px;
  line-height: 1;
}

.stat-card__value strong {
  font-family: var(--font);
  color: var(--ink);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.stat-card__value span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}

.stat-card__label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.stat-card__bar {
  height: 3px;
  margin-top: 10px;
  border-radius: 9px;
  background: var(--surface-3);
  overflow: hidden;
}

.stat-card__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--stat-color, var(--primary));
  transition: width 0.6s var(--ease);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: 1 / -1;
}

/* Today plan card */

.today-card {
  display: flex;
  flex-direction: column;
  min-height: 410px;
}

.today-card .card__head {
  padding-bottom: 15px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.card-title-icon--coral {
  background: var(--coral-soft);
  color: var(--coral);
}

.card-title-icon--mint {
  background: var(--mint-soft);
  color: var(--mint);
}

.card-title-icon--amber {
  background: var(--amber-soft);
  color: #b27e18;
}

.today-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 15px;
}

.today-progress__track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.today-progress__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #6c85ff);
  transition: width 0.6s var(--ease);
}

.today-progress__label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.today-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 24px;
}

.today-task {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.today-task:last-child {
  border-bottom: 0;
}

.today-task.is-done {
  opacity: 0.52;
}

.today-task.is-done .today-task__title {
  text-decoration: line-through;
}

.task-check {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: none;
  padding: 0;
  border: 1.5px solid #cfc8bc;
  border-radius: 7px;
  background: transparent;
  color: transparent;
  transition: all 0.17s ease;
}

.task-check:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.today-task.is-done .task-check,
.timeline-task.is-done .task-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.today-task__time {
  width: 42px;
  flex: none;
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.today-task__body {
  flex: 1;
  min-width: 0;
}

.today-task__title {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-task__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.today-task .subject-tag {
  height: 20px;
  font-size: 8.5px;
}

.today-task__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cbc5ba;
}

.today-task__priority {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--priority-color, var(--primary));
}

.today-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.today-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 33px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  border-top: 1px dashed var(--line);
}

.today-more:hover {
  color: var(--primary);
}

.today-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 24px 20px;
  padding: 6px 8px 6px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--muted);
  font-size: 10.5px;
  transition: all 0.18s ease;
}

.today-add:hover {
  border-color: var(--primary);
  background: var(--primary-wash);
  color: var(--primary);
}

.today-add span {
  flex: 1;
}

.today-add kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 8px;
}

/* Focus card */

.focus-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 410px;
  padding: 24px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(420px 330px at 90% -15%, rgba(49, 87, 245, 0.45), transparent 64%),
    radial-gradient(280px 260px at -10% 100%, rgba(217, 243, 106, 0.14), transparent 60%),
    linear-gradient(150deg, #17243b, #0b1422 78%);
  color: #eaf0f9;
  box-shadow: 0 30px 60px -32px rgba(12, 19, 33, 0.62);
  overflow: hidden;
}

.focus-card::before {
  content: '';
  position: absolute;
  right: -90px;
  top: 40px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.016), 0 0 0 76px rgba(255, 255, 255, 0.01);
  pointer-events: none;
}

.focus-card__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.focus-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f3f7fd;
  font-family: var(--font-cn);
  font-size: 14.5px;
  font-weight: 700;
}

.focus-card__title .sn-icon {
  color: var(--lime);
}

.focus-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #96a6bd;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.focus-card__status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(217, 243, 106, 0.12);
}

.focus-card__status.is-live i {
  animation: pulse-dot 1.5s ease infinite;
}

@keyframes pulse-dot {
  50% {
    opacity: 0.45;
  }
}

.focus-dial-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 205px;
  padding: 12px 0;
}

.focus-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: conic-gradient(
    var(--lime) calc(var(--progress, 0) * 1%),
    rgba(255, 255, 255, 0.09) calc(var(--progress, 0) * 1%)
  );
  transform: rotate(-90deg);
}

.focus-dial::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #1b2b45, #0e1828 76%);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.035);
}

.focus-dial__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(90deg);
}

.focus-dial__time {
  color: #f8fbff;
  font-family: var(--font);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.focus-dial__label {
  margin-top: 7px;
  color: #7f90a6;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.focus-dial__label strong {
  color: var(--lime);
  font-weight: 700;
}

.focus-card__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-card__actions .btn {
  flex: 1;
}

.focus-card__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #76869b;
  font-size: 8.5px;
}

.focus-card__foot strong {
  color: #dce4ef;
  font-weight: 600;
}

.focus-card__foot .dot {
  background: #435169;
}

/* Mistake preview */

.mistake-preview {
  display: flex;
  flex-direction: column;
  min-height: 346px;
}

.mistake-preview .card__head {
  padding-bottom: 10px;
}

.mistake-preview__count {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
}

.mistake-preview__list {
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  flex: 1;
}

.mini-mistake {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.mini-mistake:last-child {
  border-bottom: 0;
}

.mini-mistake__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--subject-soft);
  color: var(--subject);
  font-family: var(--font-cn);
  font-size: 10px;
  font-weight: 800;
}

.mini-mistake__body {
  flex: 1;
  min-width: 0;
}

.mini-mistake__title {
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-mistake__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.mini-mistake__due {
  flex: none;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--coral-soft);
  color: #b2503e;
  font-size: 7.5px;
  font-weight: 700;
}

.mistake-preview__empty {
  flex: 1;
  display: flex;
  min-height: 200px;
}

.mistake-preview .card__footer {
  margin-top: auto;
}

/* Week card */

.week-card {
  display: flex;
  flex-direction: column;
  min-height: 346px;
}

.week-card__head-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.week-total {
  text-align: right;
}

.week-total strong {
  display: block;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.week-total span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
}

.weekly-chart-wrap {
  flex: 1;
  min-height: 205px;
  padding: 4px 18px 0;
}

.weekly-chart {
  width: 100%;
  height: 100%;
  min-height: 195px;
  overflow: visible;
}

.week-bar__label {
  fill: #a7a294;
  font-family: var(--font-cn);
  font-size: 10px;
  font-weight: 600;
}

.week-bar__label.is-today {
  fill: var(--primary);
  font-weight: 800;
}

.week-bar__value {
  fill: #89909c;
  font-family: var(--font);
  font-size: 8px;
  font-weight: 600;
}

.week-bar.is-today .week-bar__value {
  fill: var(--primary);
  font-weight: 700;
}

.week-card__foot {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px 17px;
  border-top: 1px solid var(--line);
}

.week-foot-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8.5px;
}

.week-foot-item strong {
  color: var(--ink-2);
  font-weight: 700;
}

.week-foot-item i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--primary);
}

.week-foot-item:last-child {
  margin-left: auto;
}

/* Insight */

.insight-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 140px;
  padding: 23px 28px;
  border: 1px solid #e7ddc7;
  border-radius: var(--r-lg);
  background:
    radial-gradient(360px 200px at 92% 10%, rgba(49, 87, 245, 0.11), transparent 65%),
    radial-gradient(280px 200px at 4% 110%, rgba(239, 115, 93, 0.12), transparent 60%),
    #fbf5e8;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.insight-card::after {
  content: '';
  position: absolute;
  right: 90px;
  top: -80px;
  width: 210px;
  height: 210px;
  border: 1px dashed rgba(49, 87, 245, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.insight-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 20px;
  background: radial-gradient(circle at 32% 24%, #8fa4ff, #3157f5 58%, #203bc5);
  color: #f4ffcf;
  box-shadow: 0 16px 30px -18px rgba(49, 87, 245, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  transform: rotate(-3deg);
}

.insight-orb::after {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid #fbf5e8;
}

.insight-card__body {
  flex: 1;
  min-width: 0;
}

.insight-card__eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #94702e;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.insight-card h3 {
  margin-top: 5px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.insight-card__text {
  margin-top: 4px;
  color: #706453;
  font-size: 10.5px;
  line-height: 1.6;
  max-width: 770px;
}

.insight-card__text strong {
  color: #3b3326;
}

.insight-card__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.insight-result {
  position: relative;
  z-index: 2;
  display: none;
  flex: 1;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(49, 87, 245, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.74);
}

.insight-result.is-open {
  display: block;
}

.insight-result .markdown {
  font-size: 11.5px;
  line-height: 1.7;
}

.insight-card.has-result {
  align-items: flex-start;
}

.insight-card.has-result .insight-orb {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.insight-card.has-result .insight-card__actions {
  align-self: flex-start;
}

/* ----------------------------- Chat ----------------------------- */

.page-content--chat {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-h));
  padding-bottom: 18px;
  overflow: hidden;
}

.chat-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 15px;
  flex: none;
}

.chat-page-head h1 {
  font-size: clamp(25px, 2.2vw, 32px);
  letter-spacing: -0.045em;
}

.chat-page-head .page-head__sub {
  margin-top: 3px;
  font-size: 10.5px;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#chat-history-open {
  display: none;
}

.chat-layout {
  position: relative;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chat-history {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #f7f3eb;
}

.chat-history__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 15px 12px;
}

.chat-history__head h2 {
  font-size: 11px;
  font-weight: 700;
}

.chat-history__head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-history-close {
  display: none;
}

.chat-history__head span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
}

.chat-history__list {
  flex: 1;
  min-height: 0;
  padding: 0 9px 12px;
  overflow-y: auto;
}

.chat-history__group {
  padding: 9px 7px 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 8px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s ease;
}

.chat-history-item:hover {
  color: var(--ink);
  background: rgba(255, 253, 249, 0.8);
}

.chat-history-item.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 9px rgba(23, 30, 44, 0.04);
}

.chat-history-item__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--muted);
}

.chat-history-item.is-active .chat-history-item__icon {
  background: var(--primary-soft);
  color: var(--primary);
}

.chat-history-item__body {
  flex: 1;
  min-width: 0;
}

.chat-history-item__title {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-item__meta {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 7.5px;
}

.chat-history-item__delete {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  opacity: 0;
  transition: all 0.16s ease;
}

.chat-history-item:hover .chat-history-item__delete {
  opacity: 1;
}

.chat-history-item__delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.chat-history__empty {
  padding: 24px 12px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.6;
  text-align: center;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(49, 87, 245, 0.023) 0 1px, transparent 1.5px) 0 0 / 18px 18px,
    var(--surface);
}

.chat-main__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.8);
  backdrop-filter: blur(8px);
}

.chat-main__bar-left,
.chat-main__bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-main__bar-left .sn-icon {
  color: var(--primary);
}

.chat-main__bar-title {
  font-size: 10.5px;
  font-weight: 700;
}

.chat-main__bar-title span {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
}

.chat-model-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.chat-model-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
}

.chat-history-toggle {
  display: none;
  width: 33px;
  height: 33px;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  padding: 24px 28px 12px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  max-width: 690px;
  margin: 0 auto;
  padding: 12px 0 26px;
  text-align: center;
}

.chat-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin-bottom: 20px;
  border-radius: 23px;
  background:
    radial-gradient(circle at 32% 21%, rgba(255, 255, 255, 0.44), transparent 24%),
    linear-gradient(145deg, #5b7cff, #2a4be0 55%, #1e38ae);
  color: #f5ffd2;
  box-shadow: 0 22px 40px -25px rgba(49, 87, 245, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  transform: rotate(-3deg);
}

.chat-orb::before,
.chat-orb::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.chat-orb::before {
  inset: -12px;
  border: 1px dashed rgba(49, 87, 245, 0.2);
}

.chat-orb::after {
  right: -6px;
  bottom: -3px;
  width: 17px;
  height: 17px;
  background: var(--lime);
  border: 3px solid var(--surface);
}

.chat-welcome h1 {
  font-size: clamp(23px, 3vw, 31px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.chat-welcome > p {
  max-width: 450px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  margin-top: 24px;
  text-align: left;
}

.prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.82);
  color: var(--ink-2);
  text-align: left;
  transition: all 0.18s ease;
}

.prompt-card:hover {
  border-color: #c9c1b4;
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -22px rgba(20, 28, 43, 0.35);
}

.prompt-card__icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 8px;
  background: var(--prompt-soft, var(--primary-soft));
  color: var(--prompt-color, var(--primary));
}

.prompt-card__body strong {
  display: block;
  font-family: var(--font-cn);
  font-size: 10.5px;
  font-weight: 700;
}

.prompt-card__body small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.chat-context-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 17px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.chat-context-hint .sn-icon {
  color: var(--mint);
}

.chat-messages {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  animation: message-in 0.32s var(--ease-out);
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.message--user {
  flex-direction: row-reverse;
}

.message__avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, #4a6cff, #2646d3);
  color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.message--user .message__avatar {
  background: var(--surface-3);
  color: var(--ink-2);
  font-family: var(--font-cn);
  font-size: 11px;
  font-weight: 700;
}

.message__body {
  min-width: 0;
  max-width: min(680px, 88%);
}

.message--user .message__body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.message__meta strong {
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 700;
}

.message__bubble {
  position: relative;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 5px 16px 16px 16px;
  background: rgba(255, 253, 249, 0.92);
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}

.message--user .message__bubble {
  border: 0;
  border-radius: 16px 5px 16px 16px;
  background: var(--primary);
  color: #f7f9ff;
  box-shadow: 0 10px 20px -16px rgba(49, 87, 245, 0.8);
}

.message--user .message__bubble .markdown,
.message--user .message__bubble .markdown p {
  color: #f7f9ff;
}

.message--user .message__bubble .markdown code {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.message__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  opacity: 0.35;
  transition: opacity 0.18s ease;
}

.message:hover .message__actions,
.message:focus-within .message__actions {
  opacity: 1;
}

.message-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.message-action:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.message-action--accent {
  color: var(--primary);
}

.message__time {
  color: var(--muted-2);
  font-size: 7.5px;
}

.message--error .message__bubble {
  border-color: rgba(217, 77, 66, 0.2);
  background: #fff7f5;
}

.chat-error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: #8e3932;
  font-size: 10px;
  line-height: 1.55;
}

.chat-error .sn-icon {
  flex: none;
  margin-top: 1px;
}

.chat-error a {
  margin-left: 5px;
  font-weight: 700;
  text-decoration: underline;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 17px;
  padding: 0 2px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: typing 1.2s ease infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.13s;
}

.typing i:nth-child(3) {
  animation-delay: 0.26s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--primary);
  animation: blink-cursor 0.9s step-end infinite;
}

@keyframes blink-cursor {
  50% {
    opacity: 0;
  }
}

.chat-scroll__bottom {
  height: 1px;
}

.chat-jump {
  position: absolute;
  left: 50%;
  bottom: 116px;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transform: translateX(-50%);
}

.chat-jump.is-visible {
  display: inline-flex;
}

.chat-composer {
  flex: none;
  padding: 10px 20px 16px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0), var(--surface) 30%);
}

.composer {
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: #fffefa;
  box-shadow: 0 8px 24px -20px rgba(23, 30, 44, 0.3);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.composer:focus-within {
  border-color: rgba(49, 87, 245, 0.6);
  box-shadow: 0 0 0 3px rgba(49, 87, 245, 0.08), 0 12px 30px -22px rgba(23, 30, 44, 0.3);
}

.composer__textarea {
  display: block;
  width: 100%;
  height: 45px;
  max-height: 150px;
  padding: 13px 15px 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 12.5px;
  line-height: 1.6;
  resize: none;
  outline: 0;
}

.composer__textarea::placeholder {
  color: #aca79c;
}

.composer__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 8px 12px;
}

.composer__select {
  height: 27px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--surface-2);
  background-position: right 5px center;
  background-size: 13px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}

.composer__hint {
  flex: 1;
  color: var(--muted-2);
  font-size: 8px;
}

.composer__hint kbd {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: var(--font);
  font-size: 7px;
}

.composer__send {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 9px 16px -12px rgba(49, 87, 245, 0.9);
  transition: all 0.16s ease;
}

.composer__send:hover {
  background: var(--primary-deep);
}

.composer__send:disabled {
  background: #d9d5cc;
  color: #f8f6f1;
  box-shadow: none;
}

.composer__send.is-stop {
  background: var(--ink);
}

.composer__foot {
  max-width: 820px;
  margin: 6px auto 0;
  color: var(--muted-2);
  font-size: 7.5px;
  text-align: center;
}

.chat-history-backdrop {
  display: none;
}

/* ----------------------------- Mistakes ----------------------------- */

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

.mistake-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mistake-stat__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: var(--stat-soft, var(--primary-soft));
  color: var(--stat-color, var(--primary));
}

.mistake-stat__body {
  min-width: 0;
}

.mistake-stat strong {
  display: block;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.mistake-stat span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.due-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  margin-bottom: 16px;
  border: 1px solid #f0d7c8;
  border-radius: 16px;
  background:
    radial-gradient(300px 150px at 90% 0%, rgba(239, 115, 93, 0.14), transparent 65%),
    #fff6ee;
  overflow: hidden;
}

.due-banner__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: var(--coral);
  color: #fff8f2;
  box-shadow: 0 9px 16px -12px rgba(239, 115, 93, 0.9);
}

.due-banner__body {
  flex: 1;
  min-width: 0;
}

.due-banner__body strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
}

.due-banner__body p {
  margin-top: 2px;
  color: #8a6859;
  font-size: 9.5px;
}

.due-banner .btn {
  flex: none;
}

.mistake-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 249, 0.7);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 190px;
}

.search-box .sn-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 37px;
  padding: 0 12px 0 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  outline: 0;
  transition: all 0.16s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(49, 87, 245, 0.08);
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.filter-scroll {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.filter-chip:hover {
  background: var(--surface-2);
  color: var(--ink-2);
}

.filter-chip.is-active {
  background: var(--ink);
  color: #fff;
}

.filter-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--filter-color, currentColor);
}

.filter-chip.is-active i {
  background: var(--lime);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.toolbar-select {
  height: 32px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737a87' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 13px;
}

.view-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-2);
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
}

.view-toggle button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(23, 30, 44, 0.08);
}

.mistake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.mistake-grid.is-list {
  grid-template-columns: 1fr;
}

.mistake-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 213px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.mistake-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  width: 35px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--subject);
}

.mistake-card:hover {
  transform: translateY(-3px);
  border-color: #d3cbbe;
  box-shadow: 0 20px 44px -30px rgba(23, 30, 44, 0.45);
}

.mistake-card__head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mistake-card__date {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 8px;
}

.mistake-card__star {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c5beb2;
}

.mistake-card__star.is-starred {
  color: var(--amber);
  background: var(--amber-soft);
}

.mistake-card__title {
  margin-top: 12px;
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mistake-card__excerpt {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mistake-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.knowledge-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 600;
}

.mistake-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 13px;
}

.mastery {
  flex: 1;
  min-width: 0;
}

.mastery__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 600;
}

.mastery__label strong {
  color: var(--mastery-color, var(--primary));
  font-size: 8px;
}

.mastery__track {
  height: 3px;
  border-radius: 9px;
  background: var(--surface-3);
  overflow: hidden;
}

.mastery__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mastery-color, var(--primary));
}

.due-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  white-space: nowrap;
}

.due-tag.is-due {
  background: var(--coral-soft);
  color: #b24e3b;
}

.due-tag.is-mastered {
  background: var(--mint-soft);
  color: #0e755e;
}

.mistake-grid.is-list .mistake-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(250px, 1.4fr) 160px 170px;
  align-items: center;
  gap: 18px;
  min-height: 0;
  padding: 14px 17px;
}

.mistake-grid.is-list .mistake-card__title {
  margin-top: 0;
}

.mistake-grid.is-list .mistake-card__excerpt,
.mistake-grid.is-list .mistake-card__tags {
  display: none;
}

.mistake-grid.is-list .mistake-card__foot {
  margin-top: 0;
  padding-top: 0;
}

.mistake-grid.is-list .mistake-card__date {
  display: none;
}

/* Mistake drawer content */

.detail-hero {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.detail-hero__top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.detail-hero h2 {
  margin-top: 11px;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.035em;
}

.detail-hero__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-paper {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(rgba(49, 87, 245, 0.022) 1px, transparent 1px) 0 0 / 100% 27px,
    #fffefa;
  color: var(--ink-2);
  font-family: var(--font-cn);
  font-size: 12px;
  line-height: 2.2;
  white-space: pre-wrap;
  word-break: break-word;
}

.answer-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.answer-box {
  padding: 12px;
  border-radius: 11px;
  background: #fff6f3;
  border: 1px solid #f3ddd5;
}

.answer-box--right {
  background: #f0faf6;
  border-color: #d5eee6;
}

.answer-box__label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: #a35443;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.answer-box--right .answer-box__label {
  color: #14745f;
}

.answer-box p {
  color: var(--ink-2);
  font-family: var(--font-cn);
  font-size: 10.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ai-analysis {
  padding: 14px;
  border: 1px solid #dde2f7;
  border-radius: 12px;
  background:
    radial-gradient(300px 160px at 100% 0%, rgba(49, 87, 245, 0.07), transparent 60%),
    #f8f9ff;
}

.ai-analysis__head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 9.5px;
  font-weight: 800;
}

.ai-analysis__summary {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.75;
}

.solution-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.solution-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.6;
}

.solution-step i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 5px;
  background: var(--surface);
  color: var(--primary);
  font-style: normal;
  font-size: 7.5px;
  font-weight: 800;
  box-shadow: var(--shadow-xs);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 15px;
}

.review-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-history__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8.5px;
}

.review-history__item strong {
  color: var(--ink-2);
  font-weight: 600;
}

.review-history__item span:last-child {
  margin-left: auto;
  color: var(--muted-2);
}

.review-mini-empty {
  color: var(--muted-2);
  font-size: 9px;
}

/* Review flow */

.review-sheet {
  text-align: center;
}

.review-sheet__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 9px;
}

.review-progress {
  display: flex;
  gap: 4px;
}

.review-progress i {
  width: 19px;
  height: 3px;
  border-radius: 5px;
  background: var(--line);
}

.review-progress i.is-done {
  background: var(--primary);
}

.review-question {
  margin: 0 auto;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffefa;
  color: var(--ink-2);
  font-family: var(--font-cn);
  font-size: 13px;
  line-height: 1.9;
  text-align: left;
  white-space: pre-wrap;
}

.review-answer {
  display: none;
  margin-top: 10px;
  padding: 13px;
  border-radius: 11px;
  background: var(--mint-soft);
  color: #155f50;
  font-family: var(--font-cn);
  font-size: 11px;
  line-height: 1.8;
  text-align: left;
  white-space: pre-wrap;
}

.review-answer.is-open {
  display: block;
  animation: step-in 0.3s var(--ease-out);
}

.review-reveal {
  margin: 16px auto 0;
}

.review-rating {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 16px;
}

.review-rating.is-open {
  display: grid;
}

.review-rating button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.review-rating button strong {
  color: var(--ink);
  font-size: 10.5px;
}

.review-rating button:hover {
  border-color: var(--rating-color, var(--primary));
  background: var(--rating-soft, var(--primary-soft));
  color: var(--rating-color, var(--primary));
}

.review-rating button:hover strong {
  color: var(--rating-color, var(--primary));
}

/* Report */

.report-sheet {
  padding-bottom: 4px;
}

.report-sheet__hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 15px;
  border-radius: 12px;
  background:
    radial-gradient(260px 120px at 100% 0%, rgba(217, 243, 106, 0.22), transparent 70%),
    linear-gradient(135deg, #15233a, #0f1727);
  color: #edf3fa;
}

.report-sheet__hero .ai-orb-mini {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: var(--lime);
  color: #142033;
}

.report-sheet__hero strong {
  display: block;
  font-size: 12px;
}

.report-sheet__hero span {
  display: block;
  margin-top: 2px;
  color: #7f8ea4;
  font-size: 8.5px;
}

.report-sheet .markdown {
  font-size: 12px;
}

/* ----------------------------- Plan ----------------------------- */

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.week-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 66px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  transition: all 0.18s ease;
}

.week-day:hover {
  background: var(--surface-2);
}

.week-day span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
}

.week-day strong {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.week-day i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: transparent;
}

.week-day.has-tasks i {
  background: var(--primary);
}

.week-day.is-today {
  color: var(--ink);
  background: var(--surface-2);
}

.week-day.is-today strong {
  color: var(--primary);
}

.week-day.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 20px -16px rgba(23, 30, 44, 0.65);
}

.week-day.is-active span {
  color: #9da8bb;
}

.week-day.is-active strong {
  color: #fff;
}

.week-day.is-active i {
  background: var(--lime);
}

.week-day.is-active .week-day__count {
  color: var(--lime);
}

.week-day__count {
  position: absolute;
  top: 5px;
  right: 8px;
  color: var(--muted-2);
  font-size: 6.5px;
  font-weight: 700;
}

.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.plan-main {
  min-height: 460px;
}

.plan-main .card__head {
  align-items: center;
  padding-bottom: 8px;
}

.plan-date-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-date-title h2 {
  font-size: 16px;
  font-weight: 700;
}

.plan-date-title .chip {
  height: 22px;
  font-size: 8px;
}

.plan-date-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.plan-date-actions .icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--surface-2);
  border-color: transparent;
}

.plan-date-actions .icon-btn:hover {
  background: var(--surface-3);
  border-color: transparent;
}

.plan-task-list {
  display: flex;
  flex-direction: column;
  padding: 5px 24px 8px;
}

.timeline-task {
  position: relative;
  display: grid;
  grid-template-columns: 47px 16px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 0;
}

.timeline-task::after {
  content: '';
  position: absolute;
  left: 64px;
  top: 34px;
  bottom: -14px;
  width: 1px;
  background: var(--line);
}

.timeline-task:last-child::after {
  display: none;
}

.timeline-task__time {
  padding-top: 1px;
  text-align: right;
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-task__time strong {
  display: block;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}

.timeline-task__dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin: 5px auto 0;
  border-radius: 50%;
  background: var(--subject);
  box-shadow: 0 0 0 4px var(--subject-soft);
}

.timeline-task__body {
  min-width: 0;
  padding-left: 3px;
}

.timeline-task.is-done {
  opacity: 0.55;
}

.timeline-task.is-done .timeline-task__title {
  text-decoration: line-through;
}

.timeline-task__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-task__title {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.timeline-task__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.timeline-task__meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.timeline-task__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.timeline-task:hover .timeline-task__actions {
  opacity: 1;
}

.timeline-task__actions button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
}

.timeline-task__actions button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.timeline-task__actions button[data-delete]:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.plan-task-check {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.plan-empty {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-main__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 24px 18px;
  border-top: 1px solid var(--line);
}

.plan-main__foot p {
  color: var(--muted-2);
  font-size: 8.5px;
}

.plan-main__foot-actions {
  display: flex;
  gap: 6px;
}

.plan-side {
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}

.plan-goal {
  padding: 21px;
}

.plan-goal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-goal__head h3 {
  font-size: 13px;
  font-weight: 700;
}

.plan-goal__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  margin: 18px auto 6px;
}

.plan-goal__ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ring__track {
  stroke: var(--surface-3);
}

.ring__value {
  transition: stroke-dashoffset 0.7s var(--ease);
}

.plan-goal__ring-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.plan-goal__ring-content strong {
  font-family: var(--font);
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.plan-goal__ring-content span {
  color: var(--muted-2);
  font-size: 8px;
}

.plan-goal__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}

.plan-goal__stat {
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--surface-2);
}

.plan-goal__stat span {
  display: block;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 600;
}

.plan-goal__stat strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
}

.subject-dist {
  padding: 18px;
}

.subject-dist h3 {
  font-size: 12px;
  font-weight: 700;
}

.subject-dist__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.subject-dist__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-dist__name {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 48px;
  flex: none;
  color: var(--muted);
  font-size: 8.5px;
}

.subject-dist__name i {
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: var(--subject);
}

.subject-dist__bar {
  flex: 1;
  height: 4px;
  border-radius: 9px;
  background: var(--surface-3);
  overflow: hidden;
}

.subject-dist__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--subject);
}

.subject-dist__value {
  width: 24px;
  text-align: right;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 600;
}

.plan-tip {
  padding: 17px;
  background: linear-gradient(145deg, #fcf5e4, #f9efd9);
  border-color: #ecdfc2;
}

.plan-tip__head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9b6d14;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.plan-tip p {
  margin-top: 7px;
  color: #72634b;
  font-size: 9px;
  line-height: 1.65;
}

.plan-tip strong {
  color: #433927;
}

/* AI plan modal */

.ai-plan-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-plan-preview {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 340px;
  overflow-y: auto;
}

.ai-plan-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
}

.ai-plan-item input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.ai-plan-item__time {
  width: 42px;
  flex: none;
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 600;
}

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

.ai-plan-item__body strong {
  display: block;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
}

.ai-plan-item__body small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.ai-plan-item .subject-tag {
  height: 20px;
  font-size: 8px;
}

.ai-plan-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.ai-plan-loading__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 17px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--lime);
}

.ai-plan-loading__orb::before {
  content: '';
  position: absolute;
  inset: -10px;
  border: 1px dashed rgba(49, 87, 245, 0.25);
  border-radius: 27px;
  animation: spin 12s linear infinite;
}

.ai-plan-loading h3 {
  font-size: 15px;
}

.ai-plan-loading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.ai-plan-loading__steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 18px;
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8.5px;
  text-align: left;
}

.ai-plan-loading__steps span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-plan-loading__steps .sn-icon {
  color: var(--primary);
}

/* ----------------------------- Focus ----------------------------- */

.focus-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 16px;
  align-items: stretch;
}

.focus-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 620px;
  padding: 34px 28px;
  border-radius: 26px;
  background:
    radial-gradient(520px 380px at 50% -10%, rgba(49, 87, 245, 0.36), transparent 62%),
    radial-gradient(380px 300px at 5% 100%, rgba(217, 243, 106, 0.1), transparent 60%),
    radial-gradient(360px 300px at 100% 85%, rgba(239, 115, 93, 0.11), transparent 60%),
    linear-gradient(155deg, #17243b 0%, #0b1421 78%);
  color: #eef4fb;
  box-shadow: 0 35px 80px -42px rgba(12, 19, 33, 0.65);
  overflow: hidden;
}

.focus-stage::before,
.focus-stage::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.focus-stage::before {
  width: 640px;
  height: 640px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.012), 0 0 0 140px rgba(255, 255, 255, 0.007);
}

.focus-stage::after {
  width: 300px;
  height: 300px;
  right: -90px;
  bottom: -100px;
  border-style: dashed;
  border-color: rgba(217, 243, 106, 0.1);
}

.focus-stage__top {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focus-stage__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8c9baf;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-stage__eyebrow i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
}

.zen-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: #9ba9bd;
  font-size: 8px;
  font-weight: 600;
}

.zen-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.focus-clock {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.focus-clock__sub {
  margin-bottom: 13px;
  color: #8a9bb1;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.focus-clock__sub strong {
  color: #d9e2ee;
}

.focus-ring-wrap {
  position: relative;
  width: clamp(280px, 31vw, 380px);
  aspect-ratio: 1;
}

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

.focus-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.075);
}

.focus-ring__progress {
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(217, 243, 106, 0.25));
  transition: stroke-dashoffset 0.7s linear;
}

.focus-ring__inner {
  position: absolute;
  inset: 16%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.045), transparent 62%);
  box-shadow: inset 0 0 45px rgba(255, 255, 255, 0.02);
}

.focus-time {
  color: #f9fbff;
  font-family: var(--font);
  font-size: clamp(64px, 7.5vw, 96px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.075em;
  font-variant-numeric: tabular-nums;
}

.focus-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: #8d9eb4;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.focus-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lime);
}

.focus-subject {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 25px;
}

.focus-subject button {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #93a2b8;
  font-size: 9px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.focus-subject button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.focus-subject button.is-active {
  border-color: var(--lime);
  background: var(--lime);
  color: #162033;
}

.focus-controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 23px;
}

.focus-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 126px;
  height: 45px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--lime);
  color: #152033;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 16px 30px -20px rgba(217, 243, 106, 0.75);
  transition: all 0.18s ease;
}

.focus-control:hover {
  background: #e6ff85;
}

.focus-control.is-pause {
  background: #f5f8fd;
}

.focus-control--ghost {
  min-width: 45px;
  width: 45px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #c1cad8;
  box-shadow: none;
}

.focus-control--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.focus-durations {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 3px;
  margin-top: 16px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.focus-durations button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7d8da3;
  font-family: var(--font);
  font-size: 8.5px;
  font-weight: 600;
}

.focus-durations button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #eaf0f8;
}

.focus-side {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.focus-side-card {
  padding: 18px;
}

.focus-side-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.focus-side-card__head h3 {
  font-size: 12px;
  font-weight: 700;
}

.focus-side-card__head span {
  color: var(--muted-2);
  font-size: 8px;
}

.focus-today {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 15px;
}

.focus-today__dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 87px;
  height: 87px;
  flex: none;
}

.focus-today__dial svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.focus-today__dial strong {
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.focus-today__dial span {
  color: var(--muted-2);
  font-size: 7px;
}

.focus-today__stats {
  flex: 1;
}

.focus-today__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
}

.focus-today__row:last-child {
  border-bottom: 0;
}

.focus-today__row strong {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.session-item:last-child {
  border-bottom: 0;
}

.session-item__dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--subject);
}

.session-item__body {
  flex: 1;
  min-width: 0;
}

.session-item__body strong {
  display: block;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 600;
}

.session-item__body span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 7.5px;
}

.session-item__mins {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
}

.focus-history-empty {
  padding: 20px 0 5px;
  color: var(--muted-2);
  font-size: 8.5px;
  text-align: center;
}

.focus-method {
  padding: 18px;
  background:
    radial-gradient(200px 130px at 100% 0%, rgba(239, 115, 93, 0.12), transparent 65%),
    #fdf4e9;
  border-color: #ecddc7;
}

.focus-method__head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a96b16;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.focus-method p {
  margin-top: 7px;
  color: #74644d;
  font-size: 9px;
  line-height: 1.65;
}

.zen-exit {
  position: fixed;
  z-index: 100;
  top: 22px;
  right: 22px;
  display: none;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(16, 24, 40, 0.6);
  color: #dce5f2;
  font-size: 9px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

body.focus-zen {
  background: #0b1421;
  overflow: hidden;
}

body.focus-zen .sidebar,
body.focus-zen .topbar,
body.focus-zen .mobile-nav,
body.focus-zen .focus-page-head,
body.focus-zen .focus-side,
body.focus-zen .site-footer {
  display: none !important;
}

body.focus-zen .app-main {
  margin: 0;
  padding: 0;
}

body.focus-zen .page-content {
  max-width: none;
  height: 100dvh;
  padding: 0;
}

body.focus-zen .focus-page-grid {
  display: block;
  height: 100dvh;
}

body.focus-zen .focus-stage {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

body.focus-zen .zen-exit {
  display: inline-flex;
}

body.focus-zen .zen-btn {
  display: none;
}

body.focus-zen .focus-side {
  display: none;
}

/* ----------------------------- Settings ----------------------------- */

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

.settings-main,
.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  padding: 22px 24px;
}

.settings-card--pad-lg {
  padding: 26px;
}

.settings-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-card__head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.settings-card__head h2 .sn-icon {
  color: var(--primary);
}

.settings-card__head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
}

.profile-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 17px;
  background:
    radial-gradient(300px 160px at 92% 0%, rgba(49, 87, 245, 0.12), transparent 65%),
    linear-gradient(135deg, #fbf5e8, #f7efe1);
  border: 1px solid #eadec9;
  overflow: hidden;
}

.profile-banner::after {
  content: '';
  position: absolute;
  right: 25px;
  top: -50px;
  width: 150px;
  height: 150px;
  border: 1px dashed rgba(49, 87, 245, 0.13);
  border-radius: 50%;
}

.profile-banner__avatar {
  display: grid;
  place-items: center;
  width: 67px;
  height: 67px;
  flex: none;
  border-radius: 20px;
  background: linear-gradient(145deg, #f09d82, #df5c67 70%);
  color: #fff;
  font-family: var(--font-cn);
  font-size: 25px;
  font-weight: 700;
  box-shadow: 0 13px 25px -17px rgba(198, 83, 75, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.profile-banner__body {
  flex: 1;
  min-width: 0;
}

.profile-banner__body h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.profile-banner__body p {
  margin-top: 3px;
  color: #786d5b;
  font-size: 9.5px;
}

.profile-banner__tags {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.profile-banner__edit {
  position: relative;
  z-index: 1;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.settings-save-row span {
  color: var(--muted-2);
  font-size: 8.5px;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  margin-bottom: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.api-status__dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--mint-soft);
  color: var(--mint);
}

.api-status.is-off .api-status__dot {
  background: var(--coral-soft);
  color: var(--coral);
}

.api-status__body {
  flex: 1;
  min-width: 0;
}

.api-status__body strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
}

.api-status__body span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-status__badge {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--mint-soft);
  color: #0e735d;
  font-size: 7.5px;
  font-weight: 700;
}

.api-status.is-off .api-status__badge {
  background: var(--coral-soft);
  color: #a74b3a;
}

.settings-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 11px;
  border-radius: 9px;
  background: #f5f1e8;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.settings-note .sn-icon {
  flex: none;
  margin-top: 1px;
  color: var(--mint);
}

.data-action {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.data-action:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.data-action__icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}

.data-action__body {
  flex: 1;
  min-width: 0;
}

.data-action__body strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
}

.data-action__body span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
}

.storage-meter {
  padding: 13px;
  margin-top: 14px;
  border-radius: 10px;
  background: var(--surface-2);
}

.storage-meter__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8.5px;
}

.storage-meter__top strong {
  color: var(--ink-2);
  font-weight: 700;
}

.storage-meter__bar {
  height: 5px;
  margin-top: 7px;
  border-radius: 9px;
  background: #e5e0d6;
  overflow: hidden;
}

.storage-meter__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #8295ff);
}

.storage-meter p {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 7.5px;
}

.danger-zone {
  border-color: #f0d9d4;
}

.danger-zone .settings-card__head h2 .sn-icon {
  color: var(--danger);
}

.danger-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f4e5e1;
}

.danger-action:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.danger-action strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
}

.danger-action span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.about-card {
  padding: 21px;
  background:
    radial-gradient(300px 180px at 100% 0%, rgba(49, 87, 245, 0.13), transparent 65%),
    linear-gradient(145deg, #17243a, #101827);
  border: 0;
  color: #e7edf6;
}

.about-card .brand {
  color: #fff;
}

.about-card__version {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: #74849b;
  font-size: 8px;
}

.about-card__version span {
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.about-card p {
  margin-top: 11px;
  color: #8494aa;
  font-size: 9px;
  line-height: 1.65;
}

.about-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.about-card__links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  color: #a6b4c7;
  font-size: 8px;
}

.about-card__links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.settings-side .card {
  padding: 19px;
}

.settings-side h3 {
  font-size: 12px;
  font-weight: 700;
}

.side-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.side-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.side-info .sn-icon {
  flex: none;
  margin-top: 1px;
  color: var(--primary);
}

/* ----------------------------- Footer ----------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 4px 34px 24px;
  color: var(--muted-2);
  font-size: 8px;
}

.site-footer span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* =========================================================
   Responsive page layouts
   ========================================================= */

@media (max-width: 1240px) {
  .stats-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    min-height: 116px;
  }

  .stat-card__value strong {
    font-size: 24px;
  }

  .today-task__time {
    width: 38px;
  }

  .focus-dial {
    width: 168px;
    height: 168px;
  }

  .focus-dial__time {
    font-size: 36px;
  }

  .plan-layout {
    grid-template-columns: minmax(0, 1fr) 282px;
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .focus-page-grid {
    grid-template-columns: minmax(0, 1fr) 286px;
  }
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 1;
  }

  .span-12 {
    grid-column: 1 / -1;
  }

  .today-card,
  .focus-card {
    min-height: 397px;
  }

  .mistake-preview,
  .week-card {
    min-height: 335px;
  }

  .insight-card {
    min-height: 130px;
  }

  .week-card .weekly-chart-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .plan-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .focus-page-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr) 285px;
  }
}

@media (max-width: 1023px) {
  .stats-strip {
    gap: 10px;
  }

  .chat-layout {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .chat-history {
    display: flex;
  }

  .focus-page-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .focus-stage {
    min-height: 590px;
  }

  .focus-ring-wrap {
    width: clamp(250px, 33vw, 330px);
  }

  .plan-side {
    top: calc(var(--topbar-h) + 10px);
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .settings-side > * {
    height: 100%;
  }

  .about-card {
    height: 100%;
  }
}

@media (max-width: 900px) {
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .today-card,
  .focus-card {
    min-height: 0;
  }

  .today-list {
    min-height: 170px;
  }

  .focus-card {
    min-height: 390px;
  }

  .mistake-preview {
    min-height: 315px;
  }

  .week-card {
    min-height: 330px;
  }

  .plan-layout {
    grid-template-columns: 1fr;
  }

  .plan-side {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .plan-tip {
    grid-column: 1 / -1;
  }

  .focus-page-grid {
    grid-template-columns: 1fr;
  }

  .focus-stage {
    min-height: 590px;
  }

  .focus-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .focus-method {
    grid-column: 1 / -1;
  }

  .settings-side {
    grid-template-columns: 1fr 1fr;
  }

  .about-card {
    grid-column: 1 / -1;
  }

  .mistake-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .chat-scroll {
    padding-left: 19px;
    padding-right: 19px;
  }
}

@media (max-width: 767px) {
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .stat-card {
    min-height: 103px;
    padding: 13px;
    border-radius: 16px;
  }

  .stat-card__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .stat-card__icon .sn-icon {
    width: 16px;
    height: 16px;
  }

  .stat-card__value {
    margin-top: 10px;
  }

  .stat-card__value strong {
    font-size: 23px;
  }

  .stat-card__label {
    margin-top: 5px;
    font-size: 9px;
  }

  .stat-card__trend {
    font-size: 7.5px;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .today-card .card__head {
    padding-bottom: 12px;
  }

  .card-title-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .card-title-icon .sn-icon {
    width: 17px;
    height: 17px;
  }

  .card__title {
    font-size: 14px;
  }

  .today-progress {
    padding: 0 18px 12px;
  }

  .today-list {
    padding: 0 18px;
    min-height: 135px;
  }

  .today-task {
    min-height: 55px;
    gap: 9px;
  }

  .today-task__time {
    width: 34px;
    font-size: 9px;
  }

  .today-task__title {
    font-size: 11.5px;
  }

  .today-task__meta {
    gap: 5px;
  }

  .today-task .subject-tag {
    height: 18px;
    padding: 0 6px;
    font-size: 8px;
  }

  .today-add {
    margin: 2px 18px 16px;
  }

  .today-add kbd {
    display: none;
  }

  .focus-card {
    min-height: 380px;
    padding: 20px;
  }

  .focus-dial {
    width: 164px;
    height: 164px;
  }

  .focus-dial__time {
    font-size: 36px;
  }

  .focus-dial-wrap {
    min-height: 185px;
  }

  .focus-card__foot {
    font-size: 8px;
  }

  .mistake-preview {
    min-height: 0;
  }

  .mistake-preview__list {
    padding: 0 18px;
  }

  .mini-mistake {
    padding: 10px 0;
  }

  .week-card {
    min-height: 300px;
  }

  .week-card__head-actions {
    gap: 9px;
  }

  .week-total strong {
    font-size: 19px;
  }

  .weekly-chart-wrap {
    min-height: 180px;
    padding: 0 7px;
  }

  .weekly-chart {
    min-height: 175px;
  }

  .week-card__foot {
    gap: 11px;
    padding: 10px 18px 14px;
    overflow-x: auto;
  }

  .week-foot-item {
    white-space: nowrap;
  }

  .week-foot-item:last-child {
    display: none;
  }

  .insight-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
    min-height: 0;
    padding: 19px;
  }

  .insight-orb {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .insight-orb .sn-icon {
    width: 22px;
    height: 22px;
  }

  .insight-card h3 {
    font-size: 15.5px;
  }

  .insight-card__text {
    font-size: 10px;
  }

  .insight-card__actions {
    width: 100%;
  }

  .insight-card__actions .btn {
    width: 100%;
  }

  .insight-card.has-result {
    flex-direction: column;
  }

  .insight-card.has-result .insight-card__actions {
    width: 100%;
  }

  /* chat mobile */
  .page-content--chat {
    height: calc(100dvh - var(--topbar-h) - var(--mobile-nav-h) - 16px);
    padding: 0 10px;
    overflow: hidden;
  }

  .chat-page-head {
    display: none;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    border-radius: 19px;
    height: 100%;
  }

  .chat-main__bar {
    min-height: 47px;
    padding: 0 12px;
  }

  .chat-main__bar-title {
    font-size: 10px;
  }

  .chat-main__bar-title span {
    display: none;
  }

  .chat-model-status {
    font-size: 7.5px;
  }

  .chat-history {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 86vw);
    border-right: 0;
    border-radius: 0 22px 22px 0;
    box-shadow: 20px 0 60px rgba(13, 20, 33, 0.2);
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease-out);
  }

  .chat-history.is-open {
    transform: translateX(0);
  }

  .chat-history__head {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .chat-history-close {
    display: grid;
  }

  .chat-history-item__delete {
    opacity: 1;
  }

  .chat-history-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    background: rgba(10, 16, 28, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .chat-history-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  .chat-history-toggle {
    display: grid;
  }

  .chat-scroll {
    padding: 16px 13px 8px;
  }

  .chat-welcome {
    padding: 13px 0 20px;
  }

  .chat-orb {
    width: 60px;
    height: 60px;
    border-radius: 19px;
    margin-bottom: 17px;
  }

  .chat-welcome h1 {
    font-size: 23px;
  }

  .chat-welcome > p {
    font-size: 10.5px;
    line-height: 1.65;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 18px;
  }

  .prompt-card {
    padding: 11px;
  }

  .prompt-card__body small {
    display: none;
  }

  .chat-context-hint {
    margin-top: 13px;
    font-size: 8px;
    text-align: center;
  }

  .chat-messages {
    padding: 0;
  }

  .message {
    gap: 7px;
    margin-bottom: 18px;
  }

  .message__avatar {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }

  .message__avatar .sn-icon {
    width: 15px;
    height: 15px;
  }

  .message__body {
    max-width: calc(100% - 36px);
  }

  .message__bubble {
    padding: 10px 12px;
    border-radius: 4px 14px 14px 14px;
  }

  .message--user .message__bubble {
    border-radius: 14px 4px 14px 14px;
  }

  .message__meta {
    font-size: 7.5px;
  }

  .message__meta strong {
    font-size: 8.5px;
  }

  .message__actions {
    opacity: 1;
  }

  .message-action {
    height: 24px;
    font-size: 8px;
  }

  .markdown {
    font-size: 12px;
    line-height: 1.75;
  }

  .markdown h2 {
    font-size: 15.5px;
  }

  .markdown h3 {
    font-size: 14px;
  }

  .chat-composer {
    padding: 8px 8px 9px;
  }

  .composer {
    border-radius: 14px;
  }

  .composer__textarea {
    height: 42px;
    padding: 11px 12px 3px;
    font-size: 12px;
  }

  .composer__toolbar {
    padding: 5px 6px 6px 9px;
  }

  .composer__hint {
    display: none;
  }

  .composer__send {
    width: 34px;
    height: 34px;
    margin-left: auto;
  }

  .composer__foot {
    display: none;
  }

  .chat-jump {
    bottom: 106px;
  }

  /* mistakes */
  .mistake-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .mistake-stat {
    padding: 12px;
    border-radius: 14px;
  }

  .mistake-stat__icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .mistake-stat strong {
    font-size: 18px;
  }

  .due-banner {
    padding: 12px 13px;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .due-banner__icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .due-banner__body strong {
    font-size: 10.5px;
  }

  .due-banner__body p {
    font-size: 8.5px;
  }

  .due-banner .btn {
    min-height: 32px;
    padding: 0 9px;
    font-size: 9px;
  }

  .mistake-toolbar {
    gap: 7px;
    padding: 9px;
    margin-bottom: 10px;
    border-radius: 13px;
  }

  .search-box {
    flex-basis: 100%;
    min-width: 0;
  }

  .search-box input {
    height: 34px;
    font-size: 10px;
  }

  .filter-chip {
    height: 28px;
    padding: 0 8px;
    font-size: 8.5px;
  }

  .toolbar-divider {
    display: none;
  }

  .toolbar-select {
    height: 29px;
    font-size: 8px;
  }

  .view-toggle {
    margin-left: auto;
  }

  .mistake-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .mistake-card {
    min-height: 195px;
    padding: 15px;
    border-radius: 15px;
  }

  .mistake-grid.is-list .mistake-card {
    display: flex;
    min-height: 195px;
    padding: 15px;
  }

  .mistake-grid.is-list .mistake-card__excerpt,
  .mistake-grid.is-list .mistake-card__tags {
    display: flex;
  }

  .mistake-grid.is-list .mistake-card__foot {
    margin-top: auto;
    padding-top: 13px;
  }

  .answer-compare {
    grid-template-columns: 1fr;
  }

  .question-paper {
    font-size: 11.5px;
    padding: 12px;
  }

  .detail-hero h2 {
    font-size: 18px;
  }

  /* plan */
  .week-strip {
    gap: 3px;
    padding: 7px;
    margin-bottom: 10px;
    border-radius: 15px;
  }

  .week-day {
    min-height: 59px;
    padding: 5px 2px;
    border-radius: 9px;
    gap: 3px;
  }

  .week-day strong {
    font-size: 15px;
  }

  .week-day span {
    font-size: 7px;
  }

  .week-day__count {
    display: none;
  }

  .plan-layout {
    gap: 10px;
  }

  .plan-main .card__head {
    padding: 16px 18px 8px;
  }

  .plan-date-title h2 {
    font-size: 14px;
  }

  .plan-task-list {
    padding: 3px 18px 6px;
  }

  .timeline-task {
    grid-template-columns: 40px 12px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 11px 0;
  }

  .timeline-task::after {
    left: 51px;
    top: 30px;
  }

  .timeline-task__time strong {
    font-size: 10px;
  }

  .timeline-task__time {
    font-size: 8px;
  }

  .timeline-task__dot {
    width: 7px;
    height: 7px;
    margin-top: 4px;
  }

  .timeline-task__title {
    font-size: 11.5px;
  }

  .timeline-task__actions {
    opacity: 1;
  }

  .timeline-task__actions button {
    width: 24px;
    height: 24px;
  }

  .timeline-task__meta {
    gap: 5px;
    font-size: 8px;
  }

  .plan-main__foot {
    padding: 11px 18px 15px;
    flex-wrap: wrap;
  }

  .plan-main__foot p {
    width: 100%;
  }

  .plan-side {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .plan-tip {
    grid-column: auto;
  }

  .plan-goal {
    padding: 18px;
  }

  .plan-goal__ring {
    width: 126px;
    height: 126px;
  }

  .plan-goal__ring-content strong {
    font-size: 26px;
  }

  /* focus */
  .focus-page-grid {
    gap: 10px;
  }

  .focus-stage {
    min-height: 600px;
    justify-content: flex-start;
    padding: 80px 16px 24px;
    border-radius: 22px;
  }

  .focus-stage__top {
    top: 17px;
    left: 16px;
    right: 16px;
  }

  .focus-clock__sub {
    margin-bottom: 10px;
  }

  .focus-stage__eyebrow {
    font-size: 7.5px;
  }

  .focus-ring-wrap {
    width: min(69vw, 272px);
  }

  .focus-time {
    font-size: clamp(58px, 18vw, 78px);
  }

  .focus-subject {
    margin-top: 16px;
    gap: 4px;
  }

  .focus-subject button {
    height: 28px;
    padding: 0 9px;
    font-size: 8.5px;
  }

  .focus-controls {
    margin-top: 18px;
  }

  .focus-control {
    min-width: 114px;
    height: 43px;
  }

  .focus-side {
    display: flex;
    gap: 10px;
  }

  .focus-method {
    grid-column: auto;
  }

  /* settings */
  .settings-grid {
    gap: 10px;
  }

  .settings-main,
  .settings-side {
    gap: 10px;
  }

  .settings-card {
    padding: 18px;
    border-radius: 18px;
  }

  .settings-card__head {
    padding-bottom: 14px;
    margin-bottom: 15px;
  }

  .settings-card__head h2 {
    font-size: 14px;
  }

  .settings-card__head p {
    font-size: 9px;
  }

  .profile-banner {
    padding: 17px;
    border-radius: 15px;
  }

  .profile-banner__avatar {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    font-size: 21px;
  }

  .profile-banner__body h2 {
    font-size: 17px;
  }

  .profile-banner__body p {
    font-size: 8.5px;
  }

  .profile-banner__edit {
    display: none;
  }

  .settings-side {
    display: flex;
  }

  .settings-side > * {
    height: auto;
  }

  .site-footer {
    display: none;
  }

  .settings-form .form-grid--two {
    grid-template-columns: 1fr;
  }

  .data-action {
    flex-wrap: wrap;
  }

  .data-action .btn {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .page-head h1 {
    font-size: 24px;
  }

  .stat-card__value strong {
    font-size: 21px;
  }

  .focus-time {
    font-size: 62px;
  }

  .focus-durations button {
    padding: 0 8px;
  }

  .focus-subject button {
    padding: 0 8px;
  }

  .week-day strong {
    font-size: 14px;
  }

  .composer__select {
    max-width: 82px;
  }

  .due-banner .btn span:not(.sn-icon) {
    display: none;
  }
}

/* =========================================================
   Landscape / tablets and short screens
   ========================================================= */

@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-card,
  .focus-card {
    min-height: 370px;
  }

  .focus-dial {
    width: 156px;
    height: 156px;
  }

  .focus-dial__time {
    font-size: 33px;
  }

  .focus-dial-wrap {
    min-height: 170px;
  }

  .page-head {
    padding-bottom: 18px;
  }

  .page-head h1 {
    font-size: 30px;
  }

  .focus-stage {
    min-height: 540px;
  }

  .focus-ring-wrap {
    width: 280px;
  }

  .chat-page-head {
    padding-bottom: 10px;
  }
}

@media (max-width: 767px) {
  body[data-page='chat'] .app-main {
    padding-bottom: 0;
  }

  body[data-page='chat'] .page-content--chat {
    height: calc(100dvh - var(--topbar-h) - var(--mobile-nav-h) - 10px);
    padding-bottom: 0;
  }

  .focus-page-head {
    flex-direction: row;
    align-items: center;
    padding: 2px 0 13px;
    gap: 0;
  }

  .focus-page-head .page-head__main {
    flex: 1;
  }

  .focus-page-head .page-eyebrow,
  .focus-page-head .page-head__sub,
  .focus-page-head .page-head__actions {
    display: none;
  }

  .focus-page-head h1 {
    font-size: 25px;
  }
}

@media (max-height: 700px) and (min-width: 768px) {
  .onboarding__story-copy {
    margin-top: 25px;
  }

  .onboarding__story-copy h1 {
    font-size: 34px;
  }

  .onboarding__mock {
    min-height: 180px;
  }

  .mock-card--task {
    width: 205px;
  }

  .mock-card--focus {
    top: 70px;
    width: 150px;
  }

  .setup-form {
    padding-top: 20px;
  }

  .setup-title {
    margin-bottom: 18px;
  }

  .setup-title h2 {
    font-size: 26px;
  }

  .focus-stage {
    min-height: 520px;
  }
}
