/* Reference colour treatment, intentionally scoped to the Today card only. */
:root {
  --today-ref-lavender: #fefbf5;
  --today-ref-blush: #f7ecdd;
  --today-ref-glow: #ead7bf;
  --today-ref-ink: #453d34;
  --today-ref-muted: #7f7468;
  --today-ref-track: #eadfce;
  --today-ref-accent: #c7a77e;
}

.apple-home .today-card {
  border-color: rgba(255, 255, 255, .88) !important;
  outline-color: rgba(255, 255, 255, .24) !important;
  background:
    radial-gradient(ellipse 62% 54% at 92% -6%, rgba(255, 255, 255, .76) 0%, rgba(255, 255, 255, .18) 48%, transparent 72%),
    radial-gradient(ellipse 70% 64% at 4% 112%, rgba(231, 207, 177, .34) 0%, transparent 68%),
    linear-gradient(180deg, var(--today-ref-lavender) 0%, #fbf6ee 34%, var(--today-ref-blush) 68%, var(--today-ref-glow) 100%) !important;
  box-shadow:
    0 4px 10px rgba(133, 105, 72, .045),
    0 20px 45px rgba(139, 112, 78, .10),
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 -1px 0 rgba(153, 125, 101, .10) !important;
  backdrop-filter: blur(16px) saturate(110%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(110%) !important;
}

.apple-home .today-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, .52) 0%, rgba(255, 255, 255, .12) 35%, transparent 56%) !important;
  opacity: .72 !important;
  mix-blend-mode: soft-light !important;
}

.apple-home .today-card::after {
  content: none !important;
}

.apple-home .today-card .progress-line span,
.apple-home .today-card .focus-time span,
.apple-home .today-card .progress-note span,
.apple-home .today-promise { color: var(--today-ref-muted) !important; }

.apple-home .today-card .progress-copy > p:first-child,
.apple-home .today-card .progress-line strong,
.apple-home .today-card .focus-time strong,
.apple-home .today-card .progress-note strong { color: var(--today-ref-ink) !important; }

.apple-home .today-card .bar {
  background: var(--today-ref-track) !important;
  box-shadow: inset 0 1px 2px rgba(89, 72, 52, .07), 0 1px 0 rgba(255, 255, 255, .58) !important;
}

.apple-home .today-card .bar span {
  background: var(--today-ref-accent) !important;
  box-shadow: none !important;
}

.apple-home .today-plan-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .54);
  border-radius: 999px;
  color: var(--today-ref-ink) !important;
  background: linear-gradient(135deg, rgba(255, 252, 246, .88) 0%, rgba(238, 219, 195, .76) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), 0 4px 12px rgba(122, 94, 61, .07);
}
.apple-home .today-card .focus-time,
.apple-home .today-card .progress-note { border-left-color: rgba(122, 138, 151, .2) !important; }

/* Focus distribution: an airy willow-yellow to sea-blue diagonal wash. */
.apple-home .focus-distribution.card-surface {
  border-color: rgba(219, 229, 204, .68) !important;
  background:
    radial-gradient(ellipse 72% 92% at -8% -20%, rgba(228, 242, 155, .32) 0%, transparent 68%),
    radial-gradient(ellipse 76% 96% at 108% 118%, rgba(203, 238, 247, .38) 0%, transparent 70%),
    linear-gradient(135deg, rgba(247, 250, 223, .74) 0%, rgba(255, 255, 255, .9) 48%, rgba(226, 245, 249, .72) 100%) !important;
  box-shadow:
    0 10px 26px rgba(93, 118, 103, .045),
    inset 0 1px 0 rgba(255, 255, 255, .94) !important;
  backdrop-filter: blur(12px) saturate(108%);
  -webkit-backdrop-filter: blur(12px) saturate(108%);
}

.apple-home .focus-distribution .focus-pie-hole {
  fill: rgba(251, 253, 247, .9) !important;
  stroke: rgba(211, 226, 220, .76) !important;
}

/* Streak card: an intentionally faint bamboo-inspired wash. */
.apple-home .streak.card-surface {
  border-color: rgba(217, 216, 190, .56) !important;
  background:
    radial-gradient(ellipse 86% 90% at -8% -18%, rgba(243, 233, 220, .42) 0%, transparent 69%),
    radial-gradient(ellipse 86% 96% at 108% 118%, rgba(200, 230, 201, .34) 0%, transparent 72%),
    linear-gradient(145deg, rgba(255, 255, 255, .94) 0%, rgba(255, 248, 225, .38) 52%, rgba(241, 249, 241, .72) 100%) !important;
  box-shadow:
    0 10px 26px rgba(100, 104, 79, .045),
    inset 0 1px 0 rgba(255, 255, 255, .92) !important;
}

/* Weekly activity: a near-white breath of blue and green. */
.apple-home .weekly.card-surface {
  border-color: rgba(216, 229, 224, .72) !important;
  background:
    radial-gradient(ellipse 82% 96% at -8% -18%, rgba(224, 242, 241, .56) 0%, transparent 68%),
    radial-gradient(ellipse 84% 96% at 108% 118%, rgba(232, 245, 233, .52) 0%, transparent 70%),
    linear-gradient(145deg, rgba(255, 255, 255, .90) 0%, rgba(240, 248, 255, .50) 52%, rgba(232, 245, 233, .54) 100%) !important;
  box-shadow:
    0 10px 26px rgba(86, 111, 106, .055),
    inset 0 1px 0 rgba(255, 255, 255, .94) !important;
}

/* Calendar card stays restrained; the reference gradient belongs to its action only. */
.apple-home .calendar-home-card {
  border-color: rgba(229, 222, 205, .62) !important;
  background:
    radial-gradient(ellipse 76% 120% at -6% -38%, rgba(237, 231, 246, .42) 0%, transparent 70%),
    radial-gradient(ellipse 76% 130% at 106% 138%, rgba(255, 243, 205, .34) 0%, transparent 72%),
    linear-gradient(118deg, rgba(255, 255, 255, .95) 0%, rgba(255, 253, 231, .34) 54%, rgba(255, 249, 226, .66) 100%) !important;
  box-shadow:
    0 10px 26px rgba(116, 102, 78, .04),
    inset 0 1px 0 rgba(255, 255, 255, .94) !important;
}

.apple-home .calendar-home-link {
  border: 1px solid rgba(255, 255, 255, .92) !important;
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, .58) 0%, transparent 34%),
    linear-gradient(108deg, #d6edf2 0%, #e7f0ed 42%, #f7ecdd 72%, #f4dfd2 100%) !important;
  color: #526765 !important;
  box-shadow:
    0 8px 16px rgba(88, 119, 121, .14),
    inset 0 1px 0 rgba(255, 255, 255, .88),
    inset 0 -1px 0 rgba(196, 174, 154, .12) !important;
}

@media (hover: hover) and (pointer: fine) {
  .apple-home .calendar-home-link:hover {
    background:
      radial-gradient(circle at 14% 18%, rgba(255, 255, 255, .62) 0%, transparent 34%),
      linear-gradient(108deg, #d1eaf0 0%, #e3eeeb 42%, #f5e9d9 72%, #f1daca 100%) !important;
    box-shadow:
      0 10px 20px rgba(88, 119, 121, .17),
      inset 0 1px 0 rgba(255, 255, 255, .92) !important;
  }
}

/* Plan cards: gentle colour pencils over the same warm paper as the page. */
.apple-home .quick-card.study-link {
  --plan-left: #ebdff0;
  --plan-left-glow: rgba(210, 183, 225, .34);
  --plan-right: #e5f0db;
  --plan-right-glow: rgba(183, 215, 170, .30);
}

.apple-home .quick-card.workout-link {
  --plan-left: #f6e0e5;
  --plan-left-glow: rgba(239, 176, 192, .30);
  --plan-right: #e6f0dd;
  --plan-right-glow: rgba(170, 210, 177, .29);
}

.apple-home .quick-card.pending-link {
  --plan-left: #f9ecd3;
  --plan-left-glow: rgba(235, 205, 144, .30);
  --plan-right: #e4efda;
  --plan-right-glow: rgba(169, 209, 178, .29);
}

.apple-home .quick-card.study-link,
.apple-home .quick-card.workout-link,
.apple-home .quick-card.pending-link {
  isolation: isolate;
  border-color: rgba(255, 255, 255, .8) !important;
  background:
    radial-gradient(ellipse 82% 128% at -8% -28%, var(--plan-left-glow) 0%, transparent 68%),
    radial-gradient(ellipse 84% 128% at 108% 132%, var(--plan-right-glow) 0%, transparent 70%),
    linear-gradient(108deg, var(--plan-left) 0%, #fbf1df 42%, #faf1e1 58%, var(--plan-right) 100%) !important;
  box-shadow:
    0 10px 24px rgba(123, 107, 86, .07),
    inset 0 1px 0 rgba(255, 255, 255, .86),
    inset 0 -1px 0 rgba(255, 255, 255, .36) !important;
}

.apple-home .quick-card.study-link .quick-icon,
.apple-home .quick-card.workout-link .quick-icon,
.apple-home .quick-card.pending-link .quick-icon {
  border: 1px solid rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .46) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .68);
}

.apple-home .quick-card.study-link .quick-icon { color: #718344 !important; }
.apple-home .quick-card.workout-link .quick-icon { color: #a64f65 !important; }
.apple-home .quick-card.pending-link .quick-icon { color: #5f8f7c !important; }
.apple-home .quick-card.study-link .quick-icon .lucide,
.apple-home .quick-card.workout-link .quick-icon .lucide,
.apple-home .quick-card.pending-link .quick-icon .lucide { width: 22px !important; height: 22px !important; stroke-width: 1.85; }
.apple-home .quick-card.study-link .quick-count,
.apple-home .quick-card.workout-link .quick-count,
.apple-home .quick-card.pending-link .quick-count { background: rgba(255, 255, 255, .5) !important; }

@media (max-width: 720px) {
  .apple-home .quick-card.study-link .quick-icon .lucide,
  .apple-home .quick-card.workout-link .quick-icon .lucide,
  .apple-home .quick-card.pending-link .quick-icon .lucide { width: 20px !important; height: 20px !important; }
}

@media (hover: hover) and (pointer: fine) {
  .apple-home .quick-card.study-link:hover,
  .apple-home .quick-card.workout-link:hover,
  .apple-home .quick-card.pending-link:hover {
    border-color: rgba(255, 255, 255, .96) !important;
    box-shadow:
      0 13px 27px rgba(123, 107, 86, .09),
      inset 0 1px 0 rgba(255, 255, 255, .93),
      inset 0 -1px 0 rgba(255, 255, 255, .4) !important;
  }
}

/* Reference pair: lemon-to-blue and lemon-to-peach translucent glass. */
.apple-home .header-actions .hero-entry-recap,
.apple-home .header-actions .hero-entry-whisper {
  border-width: 1px !important;
  border-style: solid !important;
  backdrop-filter: blur(18px) saturate(132%) brightness(1.025) !important;
  -webkit-backdrop-filter: blur(18px) saturate(132%) brightness(1.025) !important;
}

.apple-home .header-actions .hero-entry-recap {
  border-color: rgba(255, 255, 255, .9) !important;
  color: #496a82 !important;
  background:
    radial-gradient(circle at 8% -12%, rgba(255, 255, 255, .68) 0%, transparent 42%),
    radial-gradient(circle at 102% 122%, rgba(150, 195, 239, .32) 0%, transparent 60%),
    linear-gradient(135deg, rgba(250, 246, 234, .94) 0%, rgba(248, 246, 235, .86) 48%, rgba(190, 217, 244, .62) 100%) !important;
  box-shadow:
    0 2px 5px rgba(66, 103, 132, .045),
    0 10px 22px rgba(78, 125, 164, .09),
    inset 0 1px 0 rgba(255, 255, 255, .94),
    inset 0 -1px 0 rgba(115, 165, 213, .18) !important;
}

.apple-home .header-actions .hero-entry-whisper {
  border-color: rgba(255, 255, 255, .9) !important;
  color: #8b5263 !important;
  background:
    radial-gradient(circle at 8% -12%, rgba(255, 255, 255, .68) 0%, transparent 42%),
    radial-gradient(circle at 102% 122%, rgba(245, 143, 167, .3) 0%, transparent 60%),
    linear-gradient(135deg, rgba(250, 246, 234, .94) 0%, rgba(250, 242, 230, .86) 48%, rgba(249, 178, 192, .6) 100%) !important;
  box-shadow:
    0 2px 5px rgba(133, 70, 91, .045),
    0 10px 22px rgba(176, 82, 112, .09),
    inset 0 1px 0 rgba(255, 255, 255, .94),
    inset 0 -1px 0 rgba(218, 110, 139, .18) !important;
}

.apple-home .header-actions .hero-entry-recap::before,
.apple-home .header-actions .hero-entry-whisper::before {
  background: linear-gradient(118deg, rgba(255, 255, 255, .68) 0%, rgba(255, 255, 255, .14) 34%, transparent 52%, rgba(255, 255, 255, .22) 76%, transparent 100%) !important;
  opacity: .82 !important;
}

.apple-home .header-actions .hero-entry-recap .hero-entry-label > i { color: #477da5 !important; }
.apple-home .header-actions .hero-entry-whisper .hero-entry-label > i { color: #a94f6d !important; }

@media (hover: hover) and (pointer: fine) {
  .apple-home .header-actions .hero-entry-recap:hover {
    box-shadow: 0 3px 6px rgba(66, 103, 132, .06), 0 13px 26px rgba(78, 125, 164, .13), inset 0 1px 0 rgba(255, 255, 255, .97), inset 0 -1px 0 rgba(115, 165, 213, .2) !important;
  }
  .apple-home .header-actions .hero-entry-whisper:hover {
    box-shadow: 0 3px 6px rgba(133, 70, 91, .06), 0 13px 26px rgba(176, 82, 112, .13), inset 0 1px 0 rgba(255, 255, 255, .97), inset 0 -1px 0 rgba(218, 110, 139, .2) !important;
  }
}

@media (max-width: 720px) {
  .apple-home .header-actions {
    display: grid !important;
    grid-template-columns: minmax(0, .44fr) minmax(0, .56fr);
    width: 100% !important;
  }
  .apple-home .header-actions .hero-entry { width: 100%; min-width: 0; }
  .apple-home .today-card {
    background:
      radial-gradient(ellipse 74% 48% at 96% -4%, rgba(255, 255, 255, .72) 0%, rgba(255, 255, 255, .16) 50%, transparent 72%),
      radial-gradient(ellipse 82% 62% at 2% 110%, rgba(231, 207, 177, .32) 0%, transparent 68%),
      linear-gradient(180deg, var(--today-ref-lavender) 0%, #fbf6ee 34%, var(--today-ref-blush) 68%, var(--today-ref-glow) 100%) !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .apple-home .today-card { background: linear-gradient(180deg, #fefbf5 0%, #f7ecdd 58%, #ead7bf 100%) !important; }
  .apple-home .focus-distribution.card-surface { background: linear-gradient(135deg, #f5f8dd, #ffffff 48%, #e2f3f7) !important; }
  .apple-home .header-actions .hero-entry-recap { background: linear-gradient(135deg, #faf6ea, #dbe8f5) !important; }
  .apple-home .header-actions .hero-entry-whisper { background: linear-gradient(135deg, #faf6ea, #f5ced5) !important; }
}

/* Sidebar arrival: a brief edge light sampled from the destination card itself. */
.apple-home .nav-arrival:not(.quick-links) {
  outline: 2px solid transparent;
  outline-offset: 2px;
  animation: lifeflow-nav-arrival 940ms cubic-bezier(.23, 1, .32, 1) both;
}

.apple-home .today-card.nav-arrival--overview {
  --arrival-edge: rgba(199, 167, 126, .62);
  --arrival-glow: rgba(234, 215, 191, .58);
}

.apple-home .quick-links.nav-arrival--plans .quick-card.study-link {
  --arrival-edge: rgba(173, 191, 145, .66);
  --arrival-glow: rgba(218, 231, 196, .62);
}

.apple-home .quick-links.nav-arrival--plans .quick-card.workout-link {
  --arrival-edge: rgba(222, 158, 175, .62);
  --arrival-glow: rgba(246, 218, 221, .68);
}

.apple-home .quick-links.nav-arrival--plans .quick-card.pending-link {
  --arrival-edge: rgba(183, 193, 137, .64);
  --arrival-glow: rgba(235, 226, 185, .62);
}

.apple-home .quick-links.nav-arrival--plans .quick-card {
  outline: 2px solid transparent;
  outline-offset: 2px;
  animation: lifeflow-nav-arrival 940ms cubic-bezier(.23, 1, .32, 1) both;
}

.apple-home .focus-distribution.nav-arrival--progress {
  --arrival-edge: rgba(157, 202, 211, .64);
  --arrival-glow: rgba(219, 239, 225, .68);
}

.apple-home .calendar-home-card.nav-arrival--calendar {
  --arrival-edge: rgba(173, 211, 207, .72);
  --arrival-glow: rgba(229, 205, 211, .66);
}

@keyframes lifeflow-nav-arrival {
  0% { outline-color: transparent; filter: drop-shadow(0 0 0 transparent); }
  26%, 62% { outline-color: var(--arrival-edge); filter: drop-shadow(0 0 9px var(--arrival-glow)); }
  100% { outline-color: transparent; filter: drop-shadow(0 0 0 transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .apple-home .nav-arrival:not(.quick-links),
  .apple-home .quick-links.nav-arrival--plans .quick-card {
    animation-duration: .01ms;
  }
}
