/* =========================================================
   SOL · UI Refresh — "Sunroom" dashboard
   A new visual layer loaded after the original stylesheet.
   ========================================================= */

:root {
  --bg: #f2ede3;
  --surface: #fffcf6;
  --cream: #f7f0e3;
  --cream-deep: #e9dfce;
  --ink: #14231d;
  --ink-2: #22362c;
  --ink-soft: #45534a;
  --muted: #6e766b;
  --muted-2: #939a8f;
  --line: #ded4c3;
  --line-strong: #c8bca9;
  --terracotta: #e25a33;
  --terracotta-dark: #b94321;
  --terracotta-soft: #f8d8cb;
  --saffron: #f2b63f;
  --saffron-soft: #f8e7bc;
  --olive: #3b5845;
  --olive-dark: #13251f;
  --olive-soft: #e2e8d7;
  --sage-soft: #dce8df;
  --rose-soft: #f1dad1;
  --success: #446b44;
  --success-soft: #e2ecdc;
  --danger: #b54b35;
  --danger-soft: #f7dfd8;
  --line-soft: rgba(20, 35, 29, 0.09);
  --rail: #12231c;
  --rail-text: #f8f2e6;
  --shadow-sm: 0 1px 0 rgba(20, 35, 29, 0.03), 0 8px 24px rgba(57, 42, 23, 0.045);
  --shadow-md: 0 18px 44px rgba(57, 42, 23, 0.08);
  --shadow-lg: 0 28px 75px rgba(28, 38, 28, 0.2);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --sidebar-w: 92px;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 78% -12%, rgba(242, 182, 63, 0.16), transparent 30rem),
    radial-gradient(circle at 100% 60%, rgba(226, 90, 51, 0.045), transparent 32rem),
    var(--bg);
  background-attachment: fixed;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

.app-shell::before {
  position: fixed;
  inset: -18%;
  z-index: -1;
  background:
    radial-gradient(circle at 24% 18%, rgba(242, 182, 63, 0.36), transparent 24%),
    radial-gradient(circle at 82% 64%, rgba(226, 90, 51, 0.16), transparent 24%),
    radial-gradient(circle at 60% 100%, rgba(59, 88, 69, 0.12), transparent 25%);
  filter: blur(88px);
  content: "";
  opacity: 0.7;
  pointer-events: none;
}

@supports not (backdrop-filter: blur(1px)) {
  .app-shell::before {
    display: none;
  }
}

.app-shell::after {
  position: fixed;
  bottom: -190px;
  left: 30%;
  z-index: -1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: rgba(226, 90, 51, 0.12);
  filter: blur(115px);
  content: "";
  pointer-events: none;
}

::selection {
  background: var(--saffron);
  color: var(--ink);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(20, 35, 29, 0.055) 0.6px, transparent 0.6px);
  background-size: 8px 8px;
  content: "";
  opacity: 0.28;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000, transparent 65%);
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

.btn {
  border-radius: 11px;
  letter-spacing: -0.01em;
}

.btn-sm {
  border-radius: 9px;
}

.btn-primary {
  background: var(--ink);
  color: #fff9ed;
}

.btn-primary:hover {
  background: var(--ink-2);
}

.btn-accent {
  background: var(--terracotta);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 252, 246, 0.62);
}

.eyebrow {
  color: var(--terracotta);
  letter-spacing: 0.16em;
}

.chip {
  border-color: var(--line);
  background: rgba(255, 252, 246, 0.7);
}

.topbar {
  height: 64px;
  padding: 0 36px;
  border-bottom: 1px solid rgba(222, 212, 195, 0.82);
  background: rgba(242, 237, 227, 0.62);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.42) inset;
  backdrop-filter: blur(26px) saturate(1.35);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
}

.topbar-kicker {
  color: var(--terracotta);
}

.topbar-date {
  color: var(--muted);
}

.topbar-goal {
  color: var(--ink-soft);
}

.streak-pill {
  border-color: #ead3a8;
  color: #715015;
  background: rgba(250, 240, 215, 0.8);
}

.view {
  max-width: 1420px;
  padding: 30px 38px 74px;
}

/* ---------- Desktop navigation rail ---------- */

@media (min-width: 1081px) {
  .sidebar {
    flex: 0 0 92px;
    width: 92px;
    height: 100vh;
    padding: 20px 9px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    background: var(--rail);
    backdrop-filter: none;
    align-items: center;
  }

  .sidebar-head {
    width: 100%;
    justify-content: center;
    padding: 0;
  }

  .brand {
    flex-direction: column;
    gap: 2px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    color: var(--saffron);
  }

  .brand-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .brand-name {
    color: #fbf6eb;
    font-size: 19px;
    line-height: 1;
  }

  .brand-sub {
    display: none;
  }

  .brand-dot {
    color: var(--saffron);
  }

  .side-nav {
    width: 100%;
    margin-top: 19px;
    gap: 11px;
    align-items: center;
    overflow-y: auto;
    padding: 0 0 8px;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    width: 100%;
    align-items: center;
    gap: 2px;
  }

  .nav-label {
    display: none;
  }

  .nav-item {
    width: 100%;
    min-height: 50px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    border-color: transparent;
    border-radius: 11px;
    color: rgba(255, 250, 240, 0.56);
    font-size: 8.5px;
    font-weight: 680;
    letter-spacing: 0.005em;
    line-height: 1.15;
    text-align: center;
  }

  .nav-item .icon {
    width: 18px;
    height: 18px;
    margin-bottom: 1px;
    color: rgba(255, 250, 240, 0.58);
  }

  .nav-item:hover {
    color: #fff9ed;
    background: rgba(255, 255, 255, 0.065);
  }

  .nav-item:hover .icon {
    color: var(--saffron);
  }

  .nav-item.active {
    border-color: transparent;
    color: var(--ink);
    background: #f7ecda;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  }

  .nav-item.active .icon {
    color: var(--terracotta);
  }

  .nav-item.active::after {
    top: 7px;
    right: 8px;
    width: 4px;
    height: 4px;
    background: var(--terracotta);
  }

  .nav-count {
    display: none;
  }

  .sidebar-bottom {
    width: 100%;
    align-items: center;
    gap: 8px;
    padding-top: 11px;
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .sidebar-goal {
    flex-direction: column;
    width: 100%;
    justify-content: center;
    gap: 3px;
    padding: 2px 0 7px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .sidebar-goal::after {
    color: rgba(255, 250, 240, 0.38);
    font-size: 7px;
    font-weight: 650;
    letter-spacing: 0.08em;
    content: "TODAY";
  }

  .goal-ring {
    width: 37px;
    height: 37px;
    background: conic-gradient(var(--saffron) calc(var(--p) * 1%), rgba(255, 255, 255, 0.14) 0);
  }

  .goal-ring-inner {
    width: 29px;
    height: 29px;
    background: var(--rail);
  }

  .goal-ring-inner .icon {
    width: 12px;
    height: 12px;
  }

  .sidebar-goal-copy,
  .sidebar-goal-settings {
    display: none;
  }

  .sidebar-profile {
    width: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 2px;
    border-radius: 50%;
  }

  .sidebar-profile-copy,
  .sidebar-profile > .icon {
    display: none;
  }

  .sidebar-profile .avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .sidebar .sidebar-close {
    display: none;
  }

  .view {
    padding-top: 26px;
  }
}

/* ---------- Mobile shell refresh ---------- */

@media (max-width: 1080px) {
  .mobile-header {
    height: 62px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(222, 212, 195, 0.82);
    background: rgba(242, 237, 227, 0.64);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
  }

  .brand-mobile .brand-name {
    color: var(--ink);
  }

  .mobile-nav {
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(18, 35, 28, 0.8);
    box-shadow: 0 16px 38px rgba(17, 29, 23, 0.24);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
  }

  .mobile-nav-item {
    min-height: 50px;
    color: rgba(255, 250, 240, 0.53);
    font-size: 8px;
  }

  .mobile-nav-item .icon {
    color: inherit;
  }

  .mobile-nav-item.active {
    color: var(--ink);
    background: var(--saffron);
  }

  .mobile-header .icon-btn {
    border-color: var(--line);
    color: var(--ink-soft);
    background: rgba(255, 252, 246, 0.7);
  }

  .page-head h1 {
    font-size: clamp(32px, 5vw, 44px);
  }
}

/* ---------- Home dashboard ---------- */

.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  padding: 11px 0 28px;
}

.home-head-copy {
  min-width: 0;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.home-kicker-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--terracotta);
}

.home-kicker-sep {
  color: var(--muted-2);
}

.home-head h1 {
  max-width: 820px;
  margin-top: 9px;
  font-size: clamp(39px, 4.4vw, 58px);
  font-weight: 800;
  letter-spacing: -0.068em;
  line-height: 1.02;
}

.home-head h1 span {
  color: var(--terracotta);
}

.home-head p {
  max-width: 570px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.home-head-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 19px;
  padding-bottom: 4px;
}

.home-head-ring {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--terracotta) calc(var(--p) * 1%), rgba(20, 35, 29, 0.11) 0);
  transition: --p 0.65s var(--ease);
}

.home-head-ring > div {
  display: flex;
  width: 68px;
  height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  line-height: 1.1;
}

.home-head-ring strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.home-head-ring strong small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 650;
}

.home-head-ring span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 650;
}

.home-head-streak {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
  padding-left: 19px;
  border-left: 1px solid var(--line-strong);
}

.home-head-streak > span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-head-streak > span .icon {
  width: 11px;
  height: 11px;
  color: var(--terracotta);
}

.home-head-streak strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.home-head-streak strong small {
  margin-left: 2px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 650;
}

.home-head-streak a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.home-head-streak a .icon {
  width: 10px;
  height: 10px;
}

.home-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 15px;
}

.home-label {
  color: var(--terracotta);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.home-hero {
  position: relative;
  display: grid;
  grid-column: span 8;
  min-height: 414px;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: 22px;
  overflow: hidden;
  padding: 29px;
  border-radius: 29px;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 100%, rgba(255, 250, 239, 0.25), transparent 19rem),
    var(--saffron);
  box-shadow: 0 16px 36px rgba(132, 89, 17, 0.1);
}

.home-hero::before {
  position: absolute;
  top: -80px;
  left: 27%;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(20, 35, 29, 0.1);
  border-radius: 50%;
  content: "";
}

.home-hero::after {
  position: absolute;
  top: 24%;
  left: 19%;
  z-index: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 250, 239, 0.28);
  filter: blur(48px);
  content: "";
  pointer-events: none;
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.home-hero .home-label {
  padding: 5px 8px;
  border: 1px solid rgba(20, 35, 29, 0.13);
  border-radius: 99px;
  color: rgba(20, 35, 29, 0.66);
  background: rgba(255, 250, 239, 0.22);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.home-hero h2 {
  max-width: 550px;
  margin-top: 14px;
  font-size: clamp(33px, 3.7vw, 48px);
  font-weight: 800;
  letter-spacing: -0.062em;
  line-height: 1.04;
}

.home-hola {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.12em;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.85;
  transform: translateY(2px);
}

.home-hola::after {
  position: absolute;
  right: -2px;
  bottom: -5px;
  left: -2px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.6);
  content: "";
  z-index: -1;
}

.home-hero-copy > p {
  max-width: 440px;
  margin-top: 14px;
  color: rgba(20, 35, 29, 0.7);
  font-size: 11.5px;
  line-height: 1.75;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 19px;
}

.home-hero .btn-primary {
  color: #fff9ed;
  background: var(--ink);
  box-shadow: 0 9px 20px rgba(20, 35, 29, 0.18);
}

.home-hero .btn-primary:hover {
  background: var(--ink-2);
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 4px;
  color: rgba(20, 35, 29, 0.75);
  font-size: 9.5px;
  font-weight: 750;
}

.home-link .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.18s var(--ease);
}

.home-link:hover {
  color: var(--ink);
}

.home-link:hover .icon {
  transform: translate(2px, -2px);
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 21px;
  width: 100%;
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px solid rgba(20, 35, 29, 0.16);
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.home-stat strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.home-stat span {
  color: rgba(20, 35, 29, 0.59);
  font-size: 7.5px;
  font-weight: 650;
}

.home-poster {
  position: relative;
  z-index: 1;
  min-height: 100%;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 0, rgba(242, 182, 63, 0.15), transparent 12rem),
    var(--olive-dark);
  box-shadow: 0 18px 32px rgba(62, 49, 17, 0.14);
}

.home-poster::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 250, 240, 0.15) 0.7px, transparent 0.7px);
  background-size: 12px 12px;
  content: "";
  opacity: 0.28;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.poster-sun {
  position: absolute;
  top: -42px;
  right: -30px;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #f9d78c 0%, #edb35b 55%, #d4813d 100%);
  box-shadow: 0 0 70px rgba(242, 182, 63, 0.32);
}

.poster-orbit {
  position: absolute;
  top: -68px;
  right: -54px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 250, 240, 0.15);
  border-radius: 50%;
}

.poster-arch {
  position: absolute;
  right: 10%;
  bottom: -104px;
  width: 80%;
  height: 260px;
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 50% 50% 0 0;
}

.poster-card {
  position: absolute;
  z-index: 2;
  top: 55px;
  right: 17px;
  left: 17px;
  padding: 17px 17px 15px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(251, 245, 232, 0.91);
  box-shadow: 0 20px 35px rgba(9, 18, 12, 0.28);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  transform: rotate(-2deg);
  transition: transform 0.35s var(--ease);
}

.home-poster:hover .poster-card {
  transform: rotate(0deg) translateY(-2px);
}

.poster-label {
  color: var(--terracotta);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.poster-es {
  margin-top: 11px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.poster-zh {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9.5px;
}

.poster-pron {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.poster-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.poster-play {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: #fff9ed;
  background: var(--terracotta);
}

.poster-play .icon {
  width: 11px;
  height: 11px;
  margin-left: 1px;
  fill: currentColor;
  stroke: none;
}

.poster-actions span {
  color: var(--muted);
  font-size: 7.5px;
}

.poster-note {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  left: 13px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  color: #fbf5e8;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.poster-note span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 250, 240, 0.48);
  font-family: var(--font-sans);
  font-size: 7px;
}

.poster-coords {
  position: absolute;
  right: 11px;
  bottom: 14px;
  color: rgba(255, 250, 240, 0.35);
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
}

.home-route {
  display: flex;
  min-height: 100%;
  grid-column: span 4;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(222, 212, 195, 0.9);
  border-radius: 26px;
  background: rgba(255, 252, 246, 0.76);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}

.home-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.home-panel-head h2 {
  margin-top: 3px;
  font-size: 21px;
}

.home-badge {
  min-width: 31px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--cream);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.home-route-progress {
  height: 4px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--cream-deep);
}

.home-route-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--terracotta);
  transition: width 0.4s var(--ease);
}

.home-task-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 7px;
}

.home-task {
  display: grid;
  min-height: 57px;
  flex: 1;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.home-task-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: var(--terracotta);
  background: var(--terracotta-soft);
}

.home-task:nth-child(2) .home-task-icon {
  color: #765313;
  background: var(--saffron-soft);
}

.home-task:nth-child(3) .home-task-icon {
  color: var(--olive);
  background: var(--olive-soft);
}

.home-task-icon .icon {
  width: 14px;
  height: 14px;
}

.home-task.done .home-task-icon {
  color: var(--success);
  background: var(--success-soft);
}

.home-task-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.home-task-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-task-copy small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.home-task-go {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.home-task-go .icon {
  width: 12px;
  height: 12px;
}

.home-task.done .home-task-go {
  color: var(--success);
}

.home-task:hover .home-task-copy strong {
  color: var(--terracotta-dark);
}

.home-task:hover .home-task-go .icon {
  transform: translateX(2px);
}

.home-task-go .icon {
  transition: transform 0.16s var(--ease);
}

.home-route-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 8px;
}

.home-route-foot button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.home-route-foot button:hover {
  color: var(--terracotta);
}

.home-continue {
  position: relative;
  display: flex;
  min-height: 242px;
  grid-column: span 4;
  flex-direction: column;
  overflow: hidden;
  padding: 21px;
  border-radius: 24px;
  color: #fbf5e8;
  background:
    radial-gradient(circle at 100% 0, rgba(242, 182, 63, 0.2), transparent 14rem),
    var(--olive-dark);
}

.home-continue::before {
  position: absolute;
  right: -58px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.home-continue .home-panel-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 250, 240, 0.5);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-continue .home-panel-top span:first-child {
  color: var(--saffron);
  letter-spacing: 0.14em;
}

.home-continue-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 19px;
}

.home-continue-number {
  color: var(--saffron);
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -0.09em;
  line-height: 0.8;
}

.home-continue-copy {
  min-width: 0;
}

.home-continue-copy h3 {
  color: #fbf5e8;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.home-continue-copy span {
  display: block;
  margin-top: 2px;
  color: var(--saffron);
  font-family: var(--font-display);
  font-size: 12px;
}

.home-continue-copy p {
  margin-top: 5px;
  color: rgba(255, 250, 240, 0.55);
  font-size: 8.5px;
  line-height: 1.6;
}

.home-continue-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 17px;
}

.home-continue-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 250, 240, 0.46);
  font-size: 7px;
}

.home-continue .btn-sun {
  width: 100%;
  color: var(--ink);
  background: var(--saffron);
}

.home-continue .btn-sun:hover {
  background: #f8c95f;
}

.home-continue .progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.home-continue .progress > span {
  background: var(--saffron);
}

.home-phrase {
  position: relative;
  display: flex;
  min-height: 242px;
  grid-column: span 4;
  flex-direction: column;
  overflow: hidden;
  padding: 21px;
  border-radius: 24px;
  color: #fff9ed;
  background:
    radial-gradient(circle at 100% 100%, rgba(255, 249, 237, 0.16), transparent 12rem),
    var(--terracotta);
}

.home-phrase::after {
  position: absolute;
  right: -24px;
  top: -30px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(255, 249, 237, 0.25);
  border-radius: 50%;
  content: "";
}

.home-phrase .home-label {
  color: rgba(255, 249, 237, 0.64);
}

.home-phrase-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-phrase .chip {
  border-color: rgba(255, 255, 255, 0.21);
  color: rgba(255, 249, 237, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

.home-phrase-es {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(27px, 2.7vw, 35px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.home-phrase-zh {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  color: rgba(255, 249, 237, 0.72);
  font-size: 9.5px;
}

.home-phrase-pron {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: rgba(255, 249, 237, 0.48);
  font-size: 8px;
}

.home-phrase-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.home-phrase-foot .speak-btn {
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff9ed;
  background: rgba(255, 255, 255, 0.1);
}

.home-phrase-foot .speak-btn:hover {
  color: var(--terracotta-dark);
  background: #fff9ed;
}

.home-week {
  display: flex;
  min-height: 242px;
  grid-column: span 4;
  flex-direction: column;
  padding: 21px;
  border: 1px solid rgba(205, 220, 209, 0.9);
  border-radius: 24px;
  background: rgba(220, 232, 223, 0.8);
  backdrop-filter: blur(18px) saturate(1.04);
  -webkit-backdrop-filter: blur(18px) saturate(1.04);
}

.home-week .home-label {
  color: var(--olive);
}

.home-week-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.home-week-head h2 {
  margin-top: 3px;
  font-size: 20px;
}

.home-week-total {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.home-week-total small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 650;
}

.home-week-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 7px;
  height: 94px;
  margin-top: 15px;
  padding: 0 1px;
}

.week-col {
  display: flex;
  flex: 1;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.week-col-track {
  display: flex;
  width: 100%;
  max-width: 24px;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
}

.week-col-track i {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 5px 5px 3px 3px;
  background: var(--olive);
  opacity: 0.75;
  transition: height 0.45s var(--ease), background 0.18s var(--ease);
}

.week-col.is-today .week-col-track i {
  background: var(--terracotta);
  opacity: 1;
}

.week-col span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 650;
}

.week-col.is-today span {
  color: var(--terracotta);
  font-weight: 800;
}

.home-week-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(59, 88, 69, 0.16);
  color: var(--muted);
  font-size: 7.5px;
}

.home-week-foot strong {
  color: var(--ink-soft);
  font-weight: 750;
}

.home-week-goal {
  display: flex;
  width: 42%;
  flex-direction: column;
  gap: 3px;
}

.home-week-goal .progress {
  height: 3px;
  background: rgba(59, 88, 69, 0.15);
}

.home-week-goal .progress > span {
  background: var(--terracotta);
}

.home-roadmap-section,
.home-tools-section {
  margin-top: 29px;
}

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

.home-section-head h2 {
  margin-top: 3px;
  font-size: 24px;
}

.home-section-head p {
  max-width: 550px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.home-section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 750;
  white-space: nowrap;
}

.home-section-link .icon {
  width: 12px;
  height: 12px;
}

.home-section-link:hover {
  color: var(--terracotta);
}

.home-roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-stage {
  position: relative;
  display: flex;
  min-height: 151px;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.home-stage::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--stage-color, var(--saffron));
  content: "";
}

.home-stage:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.home-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-stage-number {
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.home-stage-level {
  color: var(--terracotta);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.home-stage h3 {
  margin-top: 13px;
  font-size: 16px;
}

.home-stage-es {
  margin-top: 1px;
  color: var(--terracotta);
  font-family: var(--font-display);
  font-size: 10px;
}

.home-stage-desc {
  margin-top: 5px;
  flex: 1;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.home-stage-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.home-stage-foot .progress {
  flex: 1;
  height: 3px;
}

.home-stage-foot .progress > span {
  background: var(--stage-color, var(--saffron));
}

.home-stage-foot span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 650;
}

.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-tool {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 13px;
  border: 1px solid rgba(222, 212, 195, 0.9);
  border-radius: 15px;
  background: rgba(255, 252, 246, 0.58);
  backdrop-filter: blur(14px) saturate(1.04);
  -webkit-backdrop-filter: blur(14px) saturate(1.04);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.home-tool:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-2px);
}

.home-tool-icon {
  display: grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  color: var(--terracotta);
  background: var(--terracotta-soft);
}

.home-tool:nth-child(2) .home-tool-icon {
  color: #7b5a18;
  background: var(--saffron-soft);
}

.home-tool:nth-child(3) .home-tool-icon {
  color: var(--olive);
  background: var(--olive-soft);
}

.home-tool:nth-child(4) .home-tool-icon {
  color: #5b5374;
  background: #e9e4ef;
}

.home-tool-icon .icon {
  width: 16px;
  height: 16px;
}

.home-tool-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.home-tool-copy strong {
  font-size: 10.5px;
  font-weight: 750;
}

.home-tool-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-tool > .icon {
  width: 12px;
  height: 12px;
  color: var(--muted-2);
}

.home-culture {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 29px;
  padding: 19px 22px;
  border: 1px solid #cedcc8;
  border-radius: 20px;
  background: var(--olive-soft);
}

.home-culture-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #77530e;
  background: rgba(255, 252, 246, 0.6);
}

.home-culture-icon .icon {
  width: 18px;
  height: 18px;
}

.home-culture-copy {
  min-width: 0;
  flex: 1;
}

.home-culture-copy .home-label {
  color: var(--olive);
}

.home-culture-copy h3 {
  margin-top: 3px;
  font-size: 15px;
}

.home-culture-copy p {
  max-width: 820px;
  margin-top: 3px;
  color: #5e6b53;
  font-size: 9px;
  line-height: 1.6;
}

.home-culture-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  color: var(--olive);
  font-size: 8px;
  font-weight: 750;
}

.home-culture-link .icon {
  width: 11px;
  height: 11px;
}

/* ---------- Broad page refinement ---------- */

.page-head {
  margin: 2px 0 23px;
}

.page-head h1 {
  font-size: clamp(34px, 3.7vw, 46px);
  font-weight: 800;
  letter-spacing: -0.062em;
  line-height: 1.06;
}

.page-head h1 .head-es {
  color: var(--terracotta);
  font-size: 0.43em;
  font-weight: 500;
}

.page-head p {
  max-width: 640px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-head-actions {
  gap: 7px;
}

.page-head-stat {
  border-radius: 11px;
  background: rgba(255, 252, 246, 0.58);
}

.section-head h2 {
  font-size: 24px;
}

.section-head p {
  color: var(--muted);
  font-size: 11px;
}

.progress-panel,
.profile-panel,
.panel,
.grammar-item,
.lesson-head,
.step-content {
  border-radius: 20px;
}

.step-tabs {
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.62);
}

.step-tab {
  border-radius: 9px;
}

.step-tab.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(20, 35, 29, 0.05);
}

.step-tab.is-active .step-tab-no {
  background: var(--terracotta);
}

.lesson-head {
  background:
    radial-gradient(circle at 100% 0, rgba(242, 182, 63, 0.13), transparent 17rem),
    var(--surface);
}

.lesson-goal-card {
  border-radius: 14px;
  background: rgba(247, 240, 227, 0.7);
}

.stage-block {
  border-radius: 24px;
}

.stage-main {
  background: var(--surface);
}

.lesson-card {
  border-radius: 14px;
}

.phrase-card {
  border-radius: 13px;
  background: rgba(255, 252, 246, 0.7);
}

.phrase-card:hover {
  background: var(--surface);
}

.flash-card {
  border-radius: 24px;
}

.deck-panel {
  border-radius: 24px;
}

.deck-main {
  background:
    radial-gradient(circle at 100% 0, rgba(242, 182, 63, 0.2), transparent 16rem),
    var(--olive-dark);
}

.mini-stat {
  border-radius: 13px;
  background: rgba(255, 252, 246, 0.68);
}

.listen-panel,
.speaking-card,
.continue-card {
  border-radius: 21px;
}

.resource-card {
  border-radius: 13px;
}

.profile-hero {
  background:
    radial-gradient(circle at 82% -10%, rgba(242, 182, 63, 0.38), transparent 22rem),
    linear-gradient(135deg, #1c3429 0%, #10221b 100%);
}

.profile-panel {
  border-radius: 20px;
}

.settings-drawer {
  background: var(--bg);
}

.settings-group {
  border-radius: 14px;
  background: var(--surface);
}

.topbar-settings-btn {
  border-color: var(--line);
}

.settings-scrim {
  background: rgba(16, 28, 21, 0.24);
  backdrop-filter: blur(18px) saturate(0.88);
  -webkit-backdrop-filter: blur(18px) saturate(0.88);
}

.settings-drawer {
  background: rgba(247, 240, 228, 0.86);
  backdrop-filter: blur(30px) saturate(1.12);
  -webkit-backdrop-filter: blur(30px) saturate(1.12);
}

.settings-head {
  background: linear-gradient(180deg, rgba(250, 244, 233, 0.94) 0%, rgba(250, 244, 233, 0.7) 100%);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
}

.settings-group {
  background: rgba(255, 252, 246, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-root {
  background: rgba(14, 25, 19, 0.34);
  backdrop-filter: blur(20px) saturate(0.9);
  -webkit-backdrop-filter: blur(20px) saturate(0.9);
}

.page-head-stat {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-panel {
  background: rgba(255, 252, 246, 0.72);
  backdrop-filter: blur(16px) saturate(1.03);
  -webkit-backdrop-filter: blur(16px) saturate(1.03);
}

.footer-line > span:last-child {
  color: var(--muted);
}

.site-footer {
  border-top-color: var(--line);
}

/* ---------- Motion details ---------- */

.home-head,
.home-bento {
  animation: homeEnter 0.55s var(--ease) both;
}

.home-bento {
  animation-delay: 0.06s;
}

.home-stage,
.home-tool {
  animation: itemIn 0.45s var(--ease) both;
}

.home-stage:nth-child(2) { animation-delay: 0.04s; }
.home-stage:nth-child(3) { animation-delay: 0.08s; }
.home-stage:nth-child(4) { animation-delay: 0.12s; }
.home-tool:nth-child(2) { animation-delay: 0.04s; }
.home-tool:nth-child(3) { animation-delay: 0.08s; }
.home-tool:nth-child(4) { animation-delay: 0.12s; }

@keyframes homeEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive dashboard ---------- */

@media (max-width: 1250px) and (min-width: 1081px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(205px, 0.9fr);
    padding: 24px;
  }

  .home-hero h2 {
    font-size: 37px;
  }

  .home-route {
    padding: 19px;
  }

  .home-task {
    padding: 9px 0;
  }
}

@media (max-width: 1080px) {
  .home-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
  }

  .home-head h1 {
    font-size: clamp(38px, 7vw, 54px);
  }

  .home-head-status {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
  }

  .home-head-ring {
    width: 72px;
    height: 72px;
  }

  .home-head-ring > div {
    width: 57px;
    height: 57px;
  }

  .home-head-ring strong {
    font-size: 18px;
  }

  .home-head-streak {
    min-width: 0;
    padding-left: 16px;
  }

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

  .home-hero {
    grid-column: span 2;
    grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
    min-height: 380px;
  }

  .home-route {
    grid-column: span 1;
    min-height: 320px;
  }

  .home-continue,
  .home-phrase,
  .home-week {
    grid-column: span 1;
  }

  .home-week {
    grid-column: span 2;
    min-height: 210px;
  }

  .home-week-bars {
    height: 78px;
  }

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

  .home-culture {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .view {
    padding: 18px 16px 34px;
  }

  .home-head h1 {
    font-size: clamp(35px, 10.5vw, 48px);
  }

  .home-head p {
    font-size: 11.5px;
  }

  .home-head-status {
    gap: 13px;
  }

  .home-head-ring {
    width: 66px;
    height: 66px;
  }

  .home-head-ring > div {
    width: 52px;
    height: 52px;
  }

  .home-head-ring strong {
    font-size: 17px;
  }

  .home-head-streak strong {
    font-size: 23px;
  }

  .home-bento {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .home-hero,
  .home-route,
  .home-continue,
  .home-phrase,
  .home-week {
    grid-column: span 1;
  }

  .home-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px;
    border-radius: 24px;
  }

  .home-hero h2 {
    font-size: clamp(34px, 9.3vw, 45px);
  }

  .home-hero-copy > p {
    font-size: 11px;
  }

  .home-poster {
    min-height: 278px;
  }

  .poster-card {
    top: 30px;
  }

  .poster-es {
    font-size: 37px;
  }

  .home-route {
    min-height: 300px;
    padding: 19px;
  }

  .home-continue,
  .home-phrase {
    min-height: 224px;
  }

  .home-week {
    min-height: 200px;
    padding: 18px;
  }

  .home-roadmap-grid,
  .home-tools-grid {
    grid-template-columns: 1fr;
  }

  .home-stage {
    min-height: 0;
  }

  .home-stage-desc {
    flex: 0;
  }

  .home-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .home-section-head h2 {
    font-size: 22px;
  }

  .home-tool {
    min-height: 62px;
  }

  .home-culture {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 11px;
    padding: 16px;
  }

  .home-culture-copy {
    min-width: 0;
  }

  .home-culture-link {
    margin-left: 53px;
  }

  .home-head .home-kicker {
    font-size: 8px;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  .mobile-header {
    background: var(--bg);
  }

  .mobile-nav {
    background: var(--rail);
  }

  .settings-scrim,
  .modal-root {
    background: rgba(20, 32, 25, 0.6);
  }

  .settings-drawer,
  .settings-group,
  .settings-head {
    background: var(--bg);
  }

  .home-route,
  .home-week,
  .home-tool,
  .page-head-stat,
  .profile-panel {
    background: var(--surface);
  }
}

/* =========================================================
   Global frosted-card layer
   ========================================================= */

:root {
  --glass-blur: 15px;
  --glass-blur-sm: 10px;
  --glass-surface: rgba(255, 252, 246, 0.72);
  --glass-surface-soft: rgba(255, 252, 246, 0.67);
}

/* Large surfaces, panels and hero-level cards. */
:is(
  .panel,
  .progress-panel,
  .profile-panel,
  .profile-heatmap-panel,
  .profile-favorites-panel,
  .profile-badges-panel,
  .profile-preferences,
  .profile-hero-card,
  .stage-block,
  .stage-aside,
  .lesson-head,
  .step-content,
  .step-tabs,
  .pron-intro,
  .stress-panel,
  .deck-panel,
  .deck-main,
  .flash-card,
  .scenario-list,
  .roleplay-panel,
  .roleplay-head,
  .next-card,
  .level-card,
  .listen-panel,
  .speaking-card,
  .home-hero,
  .home-route,
  .home-continue,
  .home-phrase,
  .home-week,
  .home-culture,
  .home-stage,
  .home-poster,
  .poster-card,
  .phrase-toolbar,
  .settings-group,
  .settings-profile-strip,
  .modal,
  .profile-hero
) {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
}

/* Smaller cards, repeated cards and rows. */
:is(
  .lesson-card,
  .vocab-card,
  .quiz-card,
  .how-card,
  .phrase-card,
  .core-phrase,
  .dialogue-bubble,
  .vowel-card,
  .sound-card,
  .shadow-card,
  .grammar-item,
  .achievement,
  .resource-card,
  .stat-tile,
  .mini-stat,
  .profile-stat,
  .profile-favorite,
  .profile-achievement,
  .home-tool,
  .tip-strip,
  .lesson-goal-card,
  .culture-note
) {
  -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(1.035);
  backdrop-filter: blur(var(--glass-blur-sm)) saturate(1.035);
}

/* Transparent tints let the blurred canvas show through. */
:is(
  .panel,
  .progress-panel,
  .profile-panel,
  .profile-heatmap-panel,
  .profile-favorites-panel,
  .profile-badges-panel,
  .profile-preferences,
  .stage-block,
  .lesson-head,
  .step-content,
  .step-tabs,
  .pron-intro,
  .deck-panel,
  .flash-card,
  .scenario-list,
  .roleplay-panel,
  .phrase-toolbar,
  .settings-group,
  .settings-profile-strip,
  .modal
) {
  background-color: rgba(255, 252, 246, 0.82);
}

:is(
  .lesson-card,
  .vocab-card,
  .quiz-card,
  .how-card,
  .phrase-card,
  .core-phrase,
  .dialogue-bubble,
  .vowel-card,
  .sound-card,
  .shadow-card,
  .grammar-item,
  .achievement,
  .resource-card,
  .stat-tile,
  .mini-stat,
  .profile-stat,
  .profile-favorite,
  .profile-achievement,
  .home-stage,
  .home-tool,
  .lesson-goal-card,
  .culture-note
) {
  background-color: var(--glass-surface-soft);
}

.home-route {
  background-color: rgba(255, 252, 246, 0.7);
}

.home-week {
  background-color: rgba(220, 232, 223, 0.72);
}

.home-culture,
.tip-strip,
.stress-panel {
  background-color: rgba(226, 232, 215, 0.7);
}

.next-card,
.culture-note {
  background-color: rgba(251, 240, 216, 0.76);
}

.achievement.is-unlocked,
.profile-achievement.is-unlocked {
  background-color: rgba(241, 245, 235, 0.74);
}

.lesson-card.is-done {
  background-color: rgba(243, 246, 237, 0.76);
}

/* Colored and dark cards keep their identity, but let light through. */
.home-hero {
  background:
    radial-gradient(circle at 0% 100%, rgba(255, 250, 239, 0.25), transparent 19rem),
    rgba(242, 182, 63, 0.88);
}

.home-continue {
  background:
    radial-gradient(circle at 100% 0, rgba(242, 182, 63, 0.2), transparent 14rem),
    rgba(19, 37, 31, 0.9);
}

.home-phrase {
  background:
    radial-gradient(circle at 100% 100%, rgba(255, 249, 237, 0.16), transparent 12rem),
    rgba(226, 90, 51, 0.88);
}

.home-poster {
  background:
    radial-gradient(circle at 90% 0, rgba(242, 182, 63, 0.15), transparent 12rem),
    rgba(19, 37, 31, 0.88);
}

.deck-main {
  background:
    radial-gradient(circle at 92% 15%, rgba(236, 182, 75, 0.22), transparent 16rem),
    linear-gradient(140deg, rgba(47, 64, 52, 0.9) 0%, rgba(36, 53, 42, 0.88) 100%);
}

.level-card {
  background:
    radial-gradient(circle at 92% 8%, rgba(236, 182, 75, 0.35), transparent 14rem),
    linear-gradient(135deg, rgba(48, 66, 54, 0.9), rgba(34, 51, 42, 0.88));
}

.listen-panel {
  background:
    radial-gradient(circle at 90% 0, rgba(236, 182, 75, 0.25), transparent 16rem),
    linear-gradient(135deg, rgba(45, 64, 51, 0.9), rgba(35, 52, 42, 0.88));
}

.speaking-card {
  background:
    radial-gradient(circle at 92% 10%, rgba(236, 182, 75, 0.23), transparent 12rem),
    rgba(19, 37, 31, 0.89);
}

.roleplay-head {
  background:
    radial-gradient(circle at 92% 0, rgba(236, 182, 75, 0.24), transparent 13rem),
    rgba(19, 37, 31, 0.89);
}

.profile-hero {
  background:
    radial-gradient(circle at 82% -10%, rgba(242, 182, 63, 0.38), transparent 22rem),
    linear-gradient(135deg, rgba(28, 52, 41, 0.93) 0%, rgba(16, 34, 27, 0.9) 100%);
}

.stage-aside {
  background-color: color-mix(in srgb, var(--stage-bg, var(--saffron-soft)) 82%, transparent);
}

/* Keep the glass look on hover instead of snapping back to an opaque panel. */
.phrase-card:hover,
.core-phrase:hover {
  background-color: rgba(255, 252, 246, 0.82);
}

.lesson-card:hover {
  background-color: rgba(255, 252, 246, 0.8);
}

.home-tool:hover {
  background-color: rgba(255, 252, 246, 0.76);
}

/* The repeated cards on phrase/grammar pages should stay light on GPU. */
@media (max-width: 760px) {
  :root {
    --glass-blur: 9px;
    --glass-blur-sm: 7px;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :is(
    .panel,
    .progress-panel,
    .profile-panel,
    .profile-heatmap-panel,
    .profile-favorites-panel,
    .profile-badges-panel,
    .profile-preferences,
    .stage-block,
    .lesson-head,
    .step-content,
    .step-tabs,
    .pron-intro,
    .deck-panel,
    .flash-card,
    .scenario-list,
    .roleplay-panel,
    .phrase-toolbar,
    .settings-group,
    .settings-profile-strip,
    .modal,
    .lesson-card,
    .vocab-card,
    .quiz-card,
    .how-card,
    .phrase-card,
    .core-phrase,
    .dialogue-bubble,
    .vowel-card,
    .sound-card,
    .shadow-card,
    .grammar-item,
    .achievement,
    .resource-card,
    .stat-tile,
    .mini-stat,
    .profile-stat,
    .profile-favorite,
    .profile-achievement,
    .home-stage,
    .home-tool,
    .lesson-goal-card,
    .culture-note
  ) {
    background-color: var(--surface);
  }
}

@media (max-width: 420px) {
  .home-head h1 {
    font-size: 34px;
  }

  .home-head-streak {
    padding-left: 12px;
  }

  .home-hero-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .home-hero-actions .btn {
    width: 100%;
  }

  .home-link {
    justify-content: center;
  }

  .home-stats {
    gap: 15px;
  }

  .home-head-status {
    justify-content: space-between;
  }
}
