/* 01. Font imports and base tokens */

@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&family=Special+Elite&display=swap");

:root {
  --ink: #f7f3ff;
  --muted: #aaa2b8;
  --line: rgba(255, 255, 255, 0.09);
  --panel: #171320;
  --panel-soft: #211a2d;
  --purple: #8954ff;
  --pink: #ff4fa7;
  --lime: #b9ef63;
}
* {
  box-sizing: border-box;
}
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font:
    500 15px/1.4 "DM Sans",
    sans-serif;
  background: #100d18;
  overflow-x: hidden;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(185, 239, 99, 0.7);
  outline-offset: 3px;
}
.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}
.ambient-one {
  width: 460px;
  height: 460px;
  left: -150px;
  top: -180px;
  background: radial-gradient(
    circle,
    rgba(129, 63, 248, 0.26),
    transparent 67%
  );
}
.ambient-two {
  width: 560px;
  height: 560px;
  right: -240px;
  bottom: -280px;
  background: radial-gradient(
    circle,
    rgba(255, 60, 151, 0.12),
    transparent 68%
  );
}
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1600px;
  margin: auto;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 34px 20px 22px 26px;
  border-right: 1px solid var(--line);
  background: rgba(21, 17, 31, 0.68);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font:
    700 26px/1 Outfit,
    sans-serif;
  text-decoration: none;
  letter-spacing: -1px;
  padding: 0 8px;
}
.brand > span:last-child span {
  color: var(--pink);
}
.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  padding: 4px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  transform: rotate(-8deg);
}
.brand-mark i {
  width: 5px;
  border-radius: 5px;
  background: white;
  display: block;
}
.brand-mark i:nth-child(1) {
  height: 8px;
}
.brand-mark i:nth-child(2) {
  height: 15px;
}
.brand-mark i:nth-child(3) {
  height: 20px;
}
.main-nav {
  display: grid;
  gap: 7px;
  margin-top: 60px;
}
.nav-item {
  border: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  color: #aaa3b7;
  background: transparent;
  text-align: left;
  transition: 0.2s ease;
}
.nav-item span {
  width: 18px;
  color: #867d93;
  font-size: 19px;
  text-align: center;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f7f3ff;
}
.nav-item.is-active {
  background: linear-gradient(
    90deg,
    rgba(137, 84, 255, 0.25),
    rgba(137, 84, 255, 0.04)
  );
  color: white;
}
.nav-item.is-active span {
  color: #bd9dff;
}
.sidebar-quote {
  margin: auto 8px 24px;
  padding: 17px;
  border: 1px solid rgba(173, 129, 255, 0.2);
  border-radius: 17px;
  background: linear-gradient(
    150deg,
    rgba(137, 84, 255, 0.13),
    rgba(255, 79, 167, 0.04)
  );
}
.quote-spark {
  color: #ddbdff;
  font-size: 18px;
}
.sidebar-quote p {
  margin: 7px 0 5px;
  font:
    600 15px/1.45 Outfit,
    sans-serif;
}
.sidebar-quote small {
  color: #938a9f;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 7px 0;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #2d2039;
  font-weight: 800;
  background: linear-gradient(135deg, #e4c3ff, #fe9ccc);
}
.profile-card div {
  display: grid;
  gap: 1px;
  flex: 1;
}
.profile-card strong {
  font-size: 13px;
}
.profile-card small {
  color: #928b9d;
  font-size: 11px;
}
/* The profile option sits in the topbar's top-right corner. */
.topbar-actions .profile-card {
  display: flex;
  width: auto;
  gap: 8px;
  padding: 5px 9px;
  border-top: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.topbar-actions .profile-card:hover {
  background: rgba(127, 127, 127, 0.14);
}
.topbar-actions .profile-card .avatar {
  transition: transform 0.2s ease;
}
.topbar-actions .profile-card:hover .avatar {
  transform: scale(1.06);
}
.workspace {
  min-width: 0;
  padding: 0 clamp(22px, 4vw, 64px) 55px;
}
.topbar {
  height: 93px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.date-label {
  color: #aaa3b7;
  font-size: 13px;
}
.topbar-actions {
  display: flex;
  gap: 11px;
  align-items: center;
}
.quiet-button,
.icon-button {
  border: 0;
  background: transparent;
}
.quiet-button {
  padding: 9px 12px;
  border-radius: 10px;
  color: #cbc5d5;
}
.quiet-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}
.night-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 30px;
  padding: 0;
  border: 1px solid #a99f92;
  border-radius: 999px;
  overflow: hidden;
  color: #fffaf0;
  background: #29244b;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  transition: 0.2s ease;
}
.night-toggle:before {
  content: "✦  ·";
  position: absolute;
  right: 7px;
  top: 4px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 9px;
  letter-spacing: 3px;
}
.night-toggle-moon {
  position: absolute;
  z-index: 1;
  left: 3px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #453c66;
  background: #fffdf7;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}
.night-toggle.is-on {
  background: #17182b;
}
.night-toggle.is-on .night-toggle-moon {
  left: 27px;
  color: #fff3c7;
  background: #d8d1ff;
}
.primary-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 11px 15px;
  border-radius: 11px;
  color: #21162a;
  font-weight: 700;
  background: linear-gradient(135deg, #c5f777, #a5db51);
  box-shadow: 0 8px 24px rgba(173, 235, 86, 0.13);
}
.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #aaa2b8;
  font-size: 19px;
}
.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}
.mobile-menu {
  display: none;
}
.view-content {
  padding-top: 42px;
  animation: arrive 0.3s ease;
}
@keyframes arrive {
  from {
    opacity: 0.3;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.eyebrow {
  margin: 0 0 8px;
  color: #bc92ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
}
.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.title-row h1,
.title-row h2,
.modal-heading h2 {
  margin: 0;
  font:
    700 clamp(29px, 3vw, 40px) / 1.06 Outfit,
    sans-serif;
  letter-spacing: -1.35px;
}
.title-row .subtle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 20px;
  margin-top: 27px;
}
.hero-card,
.streak-card,
.habit-card,
.insight-card,
.calendar-card,
.progress-panel {
  border: 1px solid var(--line);
  background: linear-gradient(
    145deg,
    rgba(39, 32, 54, 0.9),
    rgba(25, 20, 35, 0.91)
  );
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.15);
}
.hero-card {
  position: relative;
  min-height: 214px;
  overflow: hidden;
  padding: 25px;
  border-radius: 23px;
  background: linear-gradient(116deg, #5a2bb4 0%, #35216e 52%, #1d1a43 100%);
}
.hero-card:after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -90px;
  bottom: -222px;
  border-radius: 50%;
  border: 54px solid rgba(255, 255, 255, 0.05);
}
.hero-card:before {
  content: "";
  position: absolute;
  width: 180px;
  height: 220px;
  right: 15%;
  top: -140px;
  background: rgba(255, 96, 176, 0.18);
  filter: blur(30px);
  border-radius: 50%;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
}
.hero-copy {
  max-width: 365px;
}
.hero-copy .eyebrow {
  color: #e7ccff;
}
.hero-copy h2 {
  margin: 0;
  font:
    700 clamp(23px, 2.4vw, 31px) / 1.14 Outfit,
    sans-serif;
  letter-spacing: -0.8px;
}
.hero-copy p {
  margin: 12px 0 0;
  color: #ded5ef;
  max-width: 315px;
}
.score-ring {
  align-self: center;
  position: relative;
  width: 117px;
  height: 117px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(#d0f97e var(--score), rgba(255, 255, 255, 0.13) 0);
}
.score-ring:before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #38236d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.score-ring div {
  position: relative;
  text-align: center;
}
.score-ring strong {
  display: block;
  font:
    700 26px Outfit,
    sans-serif;
}
.score-ring span {
  display: block;
  font-size: 10px;
  color: #d8ccec;
}
.streak-card {
  padding: 21px;
  border-radius: 23px;
}
.card-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.streak-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 16px;
}
.streak-count strong {
  font:
    700 41px/1 Outfit,
    sans-serif;
  letter-spacing: -2px;
}
.streak-count span {
  color: #bdadca;
  font-size: 13px;
}
.fire {
  font-size: 19px;
  filter: drop-shadow(0 0 11px #ff8b35);
}
.week-strip {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.week-strip .week-dot {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-size: 10px;
  color: #82788e;
  background: rgba(255, 255, 255, 0.055);
}
.week-strip .week-dot.done {
  color: #253516;
  background: #c2f26e;
}
.week-strip .week-dot.today {
  box-shadow: 0 0 0 2px #ec92d7;
  color: white;
  background: #e44d9b;
}
.weekly-note {
  margin: 13px 0 0;
  color: #958ba3;
  font-size: 11px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 16px;
}
.section-heading h2 {
  margin: 0;
  font:
    600 20px Outfit,
    sans-serif;
}
.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.day-selector {
  display: flex;
  gap: 6px;
}
.day-chip {
  min-width: 48px;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #968d9f;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  transition: 0.2s;
}
.day-chip strong,
.day-chip span {
  display: block;
}
.day-chip strong {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.day-chip span {
  margin-top: 2px;
  font-size: 13px;
}
.day-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.day-chip.is-selected {
  border-color: rgba(196, 158, 255, 0.6);
  color: white;
  background: rgba(137, 84, 255, 0.25);
}
.day-chip.is-today:not(.is-selected) span {
  color: #cbf579;
}
.habit-list {
  display: grid;
  gap: 12px;
}
.habit-card {
  --habit: #8954ff;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(170px, 0.8fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 17px;
  border-radius: 18px;
  overflow: hidden;
  transition: 0.22s ease;
}
.habit-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--habit) 56%, transparent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.19);
}
.habit-card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--habit);
}
.habit-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 22px;
  background: color-mix(in srgb, var(--habit) 23%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--habit) 25%, transparent);
}
.habit-name {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.habit-name strong {
  display: block;
  color: #fbf9ff;
  font:
    600 16px Outfit,
    sans-serif;
}
.habit-name small {
  display: block;
  max-width: 300px;
  overflow: hidden;
  margin-top: 3px;
  color: #90879c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-track {
  display: flex;
  gap: 5px;
  align-items: center;
}
.mini-day {
  width: 100%;
  height: 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.095);
}
.mini-day.is-done {
  background: var(--habit);
  box-shadow: 0 0 9px color-mix(in srgb, var(--habit) 35%, transparent);
}
.mini-day.is-active {
  outline: 1px solid color-mix(in srgb, var(--habit) 80%, white);
  outline-offset: 2px;
}
.completion-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition: 0.2s;
}
.completion-toggle:hover {
  border-color: white;
}
.completion-toggle.is-complete {
  border-color: var(--habit);
  background: var(--habit);
  color: #1f1426;
  box-shadow: 0 5px 15px color-mix(in srgb, var(--habit) 25%, transparent);
}
.empty-state {
  padding: 44px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  color: #a69eaf;
  text-align: center;
}
.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: white;
  font:
    600 18px Outfit,
    sans-serif;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  margin-top: 27px;
}
.insight-card,
.progress-panel,
.calendar-card {
  border-radius: 20px;
  padding: 21px;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.panel-title h3 {
  margin: 0;
  font:
    600 17px Outfit,
    sans-serif;
}
.panel-title p {
  margin: 4px 0 0;
  color: #938a9f;
  font-size: 12px;
}
.badge {
  padding: 5px 8px;
  border-radius: 8px;
  color: #d0f880;
  background: rgba(185, 239, 99, 0.1);
  font-size: 10px;
}
.goal-rows {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.goal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
}
.goal-row span {
  font-size: 12px;
  color: #d8d2dd;
}
.goal-row b {
  font-size: 12px;
}
.bar {
  grid-column: 1/-1;
  height: 7px;
  overflow: hidden;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
}
.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9e6aff, #f15eae);
}
.progress-card-text {
  margin: 21px 0 0;
  padding: 13px;
  border-radius: 12px;
  color: #c9b7d9;
  background: rgba(137, 84, 255, 0.1);
  font-size: 12px;
}
.progress-card-text strong {
  color: white;
}
.month-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.month-switch strong {
  min-width: 115px;
  text-align: center;
  font:
    600 15px Outfit,
    sans-serif;
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  margin-top: 28px;
}
.calendar-card {
  min-height: 490px;
}
.weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.weekdays {
  margin-top: 25px;
}
.weekdays span {
  color: #90879c;
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
}
.calendar-days {
  margin-top: 10px;
}
.calendar-day {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #b8b0c0;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  transition: 0.18s;
}
.calendar-day:hover {
  border-color: rgba(255, 255, 255, 0.27);
  background: rgba(255, 255, 255, 0.09);
}
.calendar-day.is-outside {
  opacity: 0.29;
}
.calendar-day.is-today:after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  bottom: 6px;
  left: 50%;
  border-radius: 50%;
  background: #caf876;
  transform: translateX(-50%);
}
.calendar-day.has-progress {
  color: #1e1426;
  font-weight: 700;
  background: linear-gradient(135deg, #beec6c, #7ce1b5);
}
.calendar-day.partial {
  color: white;
  background: linear-gradient(135deg, #9157f3, #df5cbe);
}
.calendar-day.is-selected {
  box-shadow:
    0 0 0 2px white,
    0 0 0 4px rgba(196, 155, 255, 0.48);
  z-index: 1;
}
.calendar-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.summary-intro {
  padding: 22px;
  border-radius: 19px;
  background: linear-gradient(145deg, #ff5faa, #a94ccf);
  overflow: hidden;
  position: relative;
}
.summary-intro:after {
  content: "✦";
  position: absolute;
  right: 15px;
  top: 13px;
  color: rgba(255, 255, 255, 0.22);
  font-size: 74px;
}
.summary-intro p {
  margin: 0 0 8px;
  color: #ffe4f2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
}
.summary-intro strong {
  display: block;
  max-width: 175px;
  font:
    600 22px/1.1 Outfit,
    sans-serif;
}
.summary-stat {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}
.summary-stat span {
  display: block;
  color: #9d93a8;
  font-size: 11px;
}
.summary-stat strong {
  display: block;
  margin-top: 5px;
  font:
    700 31px/1 Outfit,
    sans-serif;
}
.summary-stat em {
  font-style: normal;
  color: #c8f87d;
  font-size: 12px;
}
.month-habits {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}
.month-habits p {
  margin: 0 0 4px;
  color: #9c93a6;
  font-size: 11px;
}
.month-habit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.month-habit span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}
.tiny-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
}
.insights-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 20px;
  margin-top: 28px;
}
.heat-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(
    145deg,
    rgba(39, 32, 54, 0.9),
    rgba(25, 20, 35, 0.91)
  );
}
.heat-map {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 8px;
  margin-top: 28px;
}
.heat-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
}
.heat-cell.level-1 {
  background: rgba(159, 105, 255, 0.42);
}
.heat-cell.level-2 {
  background: #9d62ef;
}
.heat-cell.level-3 {
  background: #e66dbf;
}
.heat-cell.level-4 {
  background: #c5f46e;
  box-shadow: 0 0 11px rgba(197, 244, 110, 0.24);
}
.heat-cell:hover:after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 3;
  width: max-content;
  padding: 4px 7px;
  border-radius: 6px;
  color: #251935;
  background: white;
  font-size: 10px;
  transform: translateX(-50%);
}
.heat-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: #92889e;
  font-size: 11px;
}
.legend-squares {
  display: flex;
  gap: 4px;
}
.legend-squares i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}
.legend-squares i:nth-child(2) {
  background: rgba(159, 105, 255, 0.42);
}
.legend-squares i:nth-child(3) {
  background: #e66dbf;
}
.legend-squares i:nth-child(4) {
  background: #c5f46e;
}
.highlights {
  display: grid;
  gap: 12px;
}
.highlight-card {
  display: flex;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}
.highlight-card .highlight-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: rgba(255, 177, 73, 0.14);
  font-size: 19px;
}
.highlight-card:nth-child(2) .highlight-icon {
  background: rgba(185, 239, 99, 0.14);
}
.highlight-card:nth-child(3) .highlight-icon {
  background: rgba(255, 79, 167, 0.14);
}
.highlight-card p {
  margin: 1px 0 3px;
  color: #fff;
  font:
    600 14px Outfit,
    sans-serif;
}
.highlight-card small {
  color: #958b9f;
  font-size: 11px;
}
.modal {
  width: min(610px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 23px;
  color: var(--ink);
  background: #201a2a;
  box-shadow: 0 24px 85px rgba(0, 0, 0, 0.55);
}
.modal::backdrop {
  background: rgba(8, 5, 15, 0.72);
  backdrop-filter: blur(5px);
}
.modal-card {
  padding: 27px;
}
.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 25px;
}
.modal-heading h2 {
  font-size: 26px;
}
.modal-heading .eyebrow {
  color: #c0ef6b;
}
.modal-card label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #d4ceda;
  font-size: 12px;
  font-weight: 600;
}
.modal-card input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: white;
  background: rgba(255, 255, 255, 0.05);
}
.modal-card input::placeholder {
  color: #82798b;
}
.modal-card fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.modal-card legend {
  margin-bottom: 10px;
  color: #d4ceda;
  font-size: 12px;
  font-weight: 600;
}
.icon-picker,
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.picker-option {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  color: white;
  background: rgba(255, 255, 255, 0.04);
  font-size: 19px;
}
.picker-option:hover,
.picker-option.is-picked {
  border-color: #c7f378;
  background: rgba(185, 239, 99, 0.12);
}
.color-option {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
}
.color-option.is-picked {
  box-shadow:
    0 0 0 2px #201a2a,
    0 0 0 4px var(--swatch);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 27px;
}
.detail-modal {
  width: min(850px, calc(100% - 28px));
}
.detail-card {
  padding: 27px;
}
.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.detail-title {
  display: flex;
  gap: 14px;
  align-items: center;
}
.detail-title .habit-icon {
  width: 54px;
  height: 54px;
  font-size: 26px;
}
.detail-title h2 {
  margin: 0;
  font:
    600 25px Outfit,
    sans-serif;
}
.detail-title p {
  margin: 3px 0;
  color: #9c93a5;
  font-size: 12px;
}
.detail-progress {
  display: flex;
  gap: 11px;
  margin-top: 24px;
}
.detail-metric {
  flex: 1;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}
.detail-metric span {
  display: block;
  color: #9a90a4;
  font-size: 11px;
}
.detail-metric strong {
  display: block;
  margin-top: 5px;
  font:
    700 27px Outfit,
    sans-serif;
}
.detail-calendar {
  margin-top: 22px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.025);
}
.detail-calendar .calendar-days {
  gap: 7px;
}
.detail-calendar .calendar-day {
  border-radius: 9px;
}
.detail-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}
.danger-button {
  border: 0;
  padding: 9px 11px;
  border-radius: 10px;
  color: #ffa1c8;
  background: rgba(255, 79, 167, 0.12);
}
.danger-button:hover {
  background: rgba(255, 79, 167, 0.22);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 27px;
  z-index: 20;
  padding: 11px 15px;
  border: 1px solid rgba(185, 239, 99, 0.3);
  border-radius: 12px;
  color: #eaffbf;
  background: #25202e;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: 0.24s;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 02. Base app layout and navigation  */

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .sidebar {
    padding: 29px 12px 18px;
    align-items: center;
  }
  .brand {
    padding: 0;
  }
  .brand > span:last-child,
  .nav-item:not(:hover)::after,
  .sidebar-quote,
  .profile-card div {
    display: none;
  }
  .main-nav {
    margin-top: 58px;
  }
  .nav-item {
    width: 48px;
    height: 48px;
    justify-content: center;
    padding: 0;
  }
  .nav-item span {
    font-size: 20px;
  }
  .profile-card {
    padding: 13px 0 0;
  }
  .calendar-layout,
  .insights-grid {
    grid-template-columns: 1fr;
  }
  .calendar-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .summary-intro {
    min-height: 142px;
  }
}
@media (max-width: 680px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 66px;
    height: 66px;
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    border-right: 0;
    flex-direction: row;
    background: rgba(22, 18, 31, 0.92);
    backdrop-filter: blur(18px);
  }
  .brand,
  .sidebar-quote,
  .profile-card {
    display: none;
  }
  .main-nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: 0;
  }
  .nav-item {
    position: relative;
    display: grid;
    width: auto;
    height: 52px;
    padding: 4px 20px;
    gap: 0;
    background: transparent !important;
    text-align: center;
  }
  .nav-item span {
    width: auto;
    font-size: 18px;
  }
  .nav-item .nav-label {
    display: block;
    font-size: 10px;
    line-height: 1;
  }
  .nav-item.is-active {
    color: #ccf776;
  }
  .nav-item.is-active span {
    color: #ccf776;
  }
  .workspace {
    padding: 0 17px 85px;
  }
  .topbar {
    height: 73px;
  }
  .mobile-menu {
    display: none;
  }
  .date-label {
    font-size: 11px;
  }
  .quiet-button {
    display: none;
  }
  .primary-button {
    padding: 10px 11px;
    font-size: 12px;
  }
  .view-content {
    padding-top: 29px;
  }
  .title-row {
    align-items: flex-start;
  }
  .title-row h1,
  .title-row h2 {
    font-size: 30px;
  }
  .title-row .subtle {
    max-width: 145px;
    text-align: right;
    font-size: 12px;
  }
  .overview {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }
  .hero-card {
    min-height: 190px;
    padding: 20px;
  }
  .hero-copy h2 {
    font-size: 25px;
  }
  .score-ring {
    width: 94px;
    height: 94px;
  }
  .score-ring:before {
    inset: 7px;
  }
  .score-ring strong {
    font-size: 22px;
  }
  .section-heading {
    align-items: flex-start;
    margin-top: 31px;
  }
  .section-heading > div:first-child {
    min-width: 0;
  }
  .section-heading h2 {
    font-size: 19px;
  }
  .day-selector {
    gap: 3px;
  }
  .day-chip {
    min-width: 34px;
    padding: 7px 3px;
  }
  .day-chip strong {
    font-size: 9px;
  }
  .habit-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    padding: 13px 14px;
  }
  .habit-card .mini-track {
    grid-column: 2/-1;
    grid-row: 2;
    margin-top: -4px;
  }
  .habit-card .habit-icon {
    width: 39px;
    height: 39px;
    font-size: 19px;
  }
  .habit-name strong {
    font-size: 15px;
  }
  .habit-name small {
    max-width: 195px;
  }
  .completion-toggle {
    width: 37px;
    height: 37px;
  }
  .bottom-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 17px;
  }
  .calendar-card {
    padding: 16px;
    min-height: auto;
  }
  .calendar-layout {
    margin-top: 18px;
  }
  .weekdays,
  .calendar-days {
    gap: 4px;
  }
  .calendar-day {
    border-radius: 8px;
    font-size: 11px;
  }
  .calendar-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .summary-intro {
    grid-column: 1/-1;
    min-height: auto;
  }
  .month-habits {
    grid-column: 1/-1;
  }
  .heat-card {
    padding: 17px;
  }
  .heat-map {
    gap: 5px;
    margin-top: 20px;
  }
  .highlights {
    grid-template-columns: 1fr;
  }
  .detail-card,
  .modal-card {
    padding: 20px;
  }
  .detail-title h2 {
    font-size: 21px;
  }
  .detail-progress {
    gap: 8px;
  }
  .detail-metric {
    padding: 13px;
  }
  .detail-metric strong {
    font-size: 23px;
  }
  .detail-calendar {
    padding: 13px;
  }
  .detail-header {
    align-items: center;
  }
  .detail-actions {
    align-items: center;
  }
  .modal-heading h2 {
    font-size: 22px;
  }
}

/* 03. Paper journal visual system. */

/* Paper-journal redesign inspired by a hand-marked habit tracker. */
:root {
  --ink: #292721;
  --muted: #796f63;
  --line: #bdb4a6;
  --panel: #fffcf4;
  --panel-soft: #f6f0e5;
  --purple: #a64d57;
  --pink: #a64d57;
  --lime: #738168;
}
body {
  color: var(--ink);
  background-color: #eee9de;
  background-image: radial-gradient(
    rgba(81, 72, 59, 0.24) 0.7px,
    transparent 0.9px
  );
  background-size: 14px 14px;
  font-family: "DM Sans", sans-serif;
}
.ambient {
  display: none;
}
.app-shell {
  max-width: 1460px;
}
.sidebar {
  border-right: 1.5px solid var(--ink);
  background: rgba(250, 247, 238, 0.9);
}
.brand {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand > span:last-child span {
  color: #a64d57;
}
.brand-mark {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #f8f2e6;
  transform: rotate(-4deg);
}
.brand-mark:after {
  content: "×";
  color: #a64d57;
  font:
    700 32px/0.8 Caveat,
    cursive;
}
.brand-mark i {
  display: none;
}
.main-nav {
  margin-top: 54px;
  gap: 3px;
}
.nav-item {
  color: #675e54;
  border-radius: 0;
  padding: 11px 13px;
  font-family: "Special Elite", monospace;
}
.nav-item span {
  color: #675e54;
}
.nav-item:hover {
  color: var(--ink);
  background: #eee7d8;
}
.nav-item.is-active {
  color: var(--ink);
  background: #eaded0;
}
.nav-item.is-active:before {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: -7px;
  border-radius: 50%;
  background: #a64d57;
}
.nav-item.is-active span {
  color: #a64d57;
}
.sidebar-quote {
  border: 1px dashed #a69b8e;
  border-radius: 0;
  background: #f6f0e5;
  transform: rotate(-1deg);
}
.quote-spark {
  color: #a64d57;
}
.sidebar-quote p {
  color: var(--ink);
  font-family: "Caveat", cursive;
  font-size: 20px;
  line-height: 1.2;
}
.sidebar-quote small {
  color: #796f63;
}
.profile-card {
  border-top: 1px solid #bdb4a6;
}
.avatar {
  border-radius: 50%;
  color: #fffdf7;
  background: #68775e;
}
.profile-card strong {
  color: var(--ink);
}
.profile-card small {
  color: #796f63;
}
.workspace {
  padding-bottom: 62px;
}
.topbar {
  border-bottom: 1px dashed #a69b8e;
}
.date-label {
  color: #71675d;
  font-family: "Special Elite", monospace;
}
.quiet-button {
  color: #5e554c;
  border-radius: 0;
  font-family: "Special Elite", monospace;
}
.quiet-button:hover {
  color: var(--ink);
  background: #f0eadf;
}
.primary-button {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: #fffdf7;
  background: #a64d57;
  box-shadow: 3px 3px 0 #292721;
  font-family: "Special Elite", monospace;
}
.primary-button:hover {
  color: #fffdf7;
  background: #8e414a;
  filter: none;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #292721;
}
.icon-button {
  border-radius: 0;
  color: #5f564c;
}
.icon-button:hover {
  color: var(--ink);
  background: #eee7da;
}
.eyebrow {
  color: #a64d57;
  font-family: "Special Elite", monospace;
  letter-spacing: 1px;
}
.title-row h1,
.title-row h2,
.modal-heading h2 {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.title-row .subtle {
  color: #71675d;
  font-family: "Caveat", cursive;
  font-size: 19px;
}
.overview {
  gap: 18px;
}
.hero-card,
.streak-card,
.habit-card,
.insight-card,
.calendar-card,
.progress-panel,
.heat-card {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fffcf4;
  box-shadow: 3px 3px 0 rgba(41, 39, 33, 0.16);
}
.hero-card {
  min-height: 205px;
  background: #f7f0e4;
}
.hero-card:before,
.hero-card:after {
  display: none;
}
.hero-copy .eyebrow {
  color: #a64d57;
}
.hero-copy h2 {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.hero-copy p {
  color: #665d53;
}
.score-ring {
  width: 112px;
  height: 112px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fffdf7;
  transform: rotate(3deg);
}
.score-ring:before {
  display: none;
}
.score-ring:after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed #bdb4a6;
}
.score-ring div {
  z-index: 1;
}
.score-ring strong {
  color: #a64d57;
  font-family: "Caveat", cursive;
  font-size: 35px;
  letter-spacing: 0;
}
.score-ring span {
  color: #645a50;
  font-family: "Special Elite", monospace;
}
.streak-card {
  background: #fbf7ee;
}
.card-label {
  color: #655b51;
  font-family: "Special Elite", monospace;
}
.streak-count strong {
  color: #a64d57;
  font-family: "Caveat", cursive;
  font-size: 51px;
  letter-spacing: 0;
}
.streak-count span {
  color: #70665c;
}
.week-strip {
  padding: 8px 0;
  border-top: 1px dashed #bdb4a6;
  border-bottom: 1px dashed #bdb4a6;
}
.week-strip .week-dot {
  border: 1px solid #bdb4a6;
  border-radius: 0;
  color: #71675d;
  background: #fffdf7;
}
.week-strip .week-dot.done {
  color: #a64d57;
  background: #fffdf7;
  font-family: "Caveat", cursive;
  font-size: 18px;
}
.week-strip .week-dot.done:before {
  content: "×";
  position: absolute;
}
.week-strip .week-dot.done {
  font-size: 0;
}
.week-strip .week-dot.today {
  color: #fffdf7;
  background: #68775e;
  box-shadow: none;
}
.weekly-note {
  color: #796f63;
  font-family: "Caveat", cursive;
  font-size: 17px;
}
.section-heading h2,
.panel-title h3 {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.section-heading p,
.panel-title p {
  color: #796f63;
  font-family: "Caveat", cursive;
  font-size: 16px;
}
.day-selector {
  gap: 5px;
}
.day-chip {
  min-width: 45px;
  border: 1px solid transparent;
  border-radius: 0;
  color: #746a60;
  background: transparent;
}
.day-chip:hover {
  color: var(--ink);
  background: #eee7da;
}
.day-chip.is-selected {
  border-color: var(--ink);
  color: var(--ink);
  background: #f8f2e6;
  box-shadow: 2px 2px 0 #a64d57;
}
.day-chip.is-today:not(.is-selected) span {
  color: #a64d57;
}
.day-chip strong {
  font-family: "Special Elite", monospace;
}
.day-chip span {
  font-family: "Caveat", cursive;
  font-size: 19px;
}
.calendar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #a64d57;
  color: #a64d57;
  background: #fffdf7;
  font:
    400 12px "Special Elite",
    monospace;
}
.calendar-link:hover {
  color: #fffdf7;
  background: #a64d57;
}
.habit-list {
  gap: 10px;
}
.habit-card {
  grid-template-columns: auto minmax(155px, 0.85fr) minmax(235px, 1.2fr) auto;
  gap: 15px;
  padding: 13px 15px;
  background: #fffdf7;
  box-shadow: none;
}
.habit-card:before {
  width: 0;
  background: none;
}
.habit-card:hover {
  border-color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--habit) 55%, transparent);
}
.habit-icon {
  border: 1px solid color-mix(in srgb, var(--habit) 55%, #fff);
  border-radius: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--habit) 16%, #fff);
  box-shadow: none;
}
.habit-name strong {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.habit-name small {
  color: #766c61;
  font-family: "Caveat", cursive;
  font-size: 16px;
}
.mini-track {
  align-items: center;
  gap: 5px;
}
.mini-day {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 24px;
  height: 31px;
  margin: 0;
  padding: 0;
  border: 1px solid #bdb4a6;
  border-radius: 0;
  color: transparent;
  background: #fffdf7;
  font:
    700 29px/0.8 Caveat,
    cursive;
  transition: 0.15s;
}
.mini-day:hover {
  border-color: var(--ink);
  background: #f5eee1;
}
.mini-day.is-done {
  color: var(--habit);
  background: #fffdf7;
  box-shadow: none;
}
.mini-day.is-active {
  outline: 1.5px solid var(--ink);
  outline-offset: 2px;
}
.completion-toggle {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: transparent;
  background: #fffdf7;
  font:
    700 34px/0.8 Caveat,
    cursive;
}
.completion-toggle:hover {
  border-color: #a64d57;
  color: #c8878e;
}
.completion-toggle.is-complete {
  border-color: #a64d57;
  color: #a64d57;
  background: #fffdf7;
  box-shadow: none;
}
.empty-state {
  border: 1.5px dashed #9e9387;
  border-radius: 0;
  color: #766c61;
  background: #f7f1e5;
  font-family: "Caveat", cursive;
  font-size: 18px;
}
.empty-state strong {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.bottom-grid {
  gap: 18px;
}
.badge {
  border: 1px solid #68775e;
  border-radius: 0;
  color: #526149;
  background: #edf1e7;
  font-family: "Special Elite", monospace;
}
.goal-row span {
  color: #534b43;
}
.goal-row b {
  color: #a64d57;
  font-family: "Special Elite", monospace;
}
.bar {
  border: 1px solid #c8beb0;
  border-radius: 0;
  background: #f5eee1;
}
.bar i {
  border-radius: 0 !important;
  background: #a64d57 !important;
}
.progress-card-text {
  border-left: 3px solid #a64d57;
  border-radius: 0;
  color: #5f554b;
  background: #f6efe3;
  font-family: "Caveat", cursive;
  font-size: 18px;
}
.progress-card-text strong {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-size: 13px;
}
.calendar-layout,
.insights-grid {
  gap: 18px;
}
.calendar-card {
  background: #fffdf7;
}
.month-switch strong {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.weekdays {
  border-bottom: 1px solid #bdb4a6;
  padding-bottom: 7px;
}
.weekdays span {
  color: #675e54;
  font-family: "Special Elite", monospace;
}
.calendar-days {
  gap: 5px;
}
.calendar-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #c2b8ab;
  border-radius: 0;
  color: #5a5047;
  background: #fffdf7;
  font-family: "Special Elite", monospace;
}
.calendar-day:hover {
  border-color: var(--ink);
  background: #f1ebdf;
}
.calendar-day.is-outside {
  opacity: 0.28;
}
.calendar-day.has-progress {
  color: #a64d57;
  background: #fffdf7;
  font-family: "Caveat", cursive;
  font-size: 19px;
}
.calendar-day.partial {
  color: #8f756d;
  background: #f6ece5;
}
.calendar-day.is-today:after {
  width: 4px;
  height: 4px;
  background: #68775e;
}
.calendar-day.is-selected {
  box-shadow: 2px 2px 0 #a64d57;
  outline: none;
}
.day-marker {
  position: absolute;
  margin-top: 10px;
  color: #a64d57;
  font:
    700 22px/0.7 Caveat,
    cursive;
}
.day-marker.is-partial {
  color: #8e8174;
  font-size: 26px;
}
.summary-intro {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #e5dccd;
}
.summary-intro:after {
  color: rgba(41, 39, 33, 0.16);
}
.summary-intro p {
  color: #a64d57;
  font-family: "Special Elite", monospace;
}
.summary-intro strong {
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.summary-stat,
.month-habits {
  border: 1px solid #bdb4a6;
  border-radius: 0;
  background: #fffdf7;
}
.summary-stat span,
.month-habits p {
  color: #796f63;
  font-family: "Special Elite", monospace;
}
.summary-stat strong {
  color: #a64d57;
  font-family: "Caveat", cursive;
  letter-spacing: 0;
}
.summary-stat em {
  color: #68775e;
}
.month-habit {
  color: #544c43;
}
.tiny-icon {
  border-radius: 0;
  background: #efe8db;
}
.heat-cell {
  border-radius: 0;
  background: #e7dfd2;
}
.heat-cell.level-1 {
  background: #d6c9be;
}
.heat-cell.level-2 {
  background: #c69a9d;
}
.heat-cell.level-3 {
  background: #a64d57;
}
.heat-cell.level-4 {
  background: #68775e;
  box-shadow: none;
}
.heat-legend {
  color: #776d61;
}
.legend-squares i {
  border-radius: 0;
  background: #e7dfd2;
}
.legend-squares i:nth-child(2) {
  background: #d6c9be;
}
.legend-squares i:nth-child(3) {
  background: #a64d57;
}
.legend-squares i:nth-child(4) {
  background: #68775e;
}
.highlight-card {
  border: 1px solid #bdb4a6;
  border-radius: 0;
  background: #fffdf7;
}
.highlight-card .highlight-icon,
.highlight-card:nth-child(2) .highlight-icon,
.highlight-card:nth-child(3) .highlight-icon {
  border-radius: 0;
  background: #eee5d6;
}
.highlight-card p {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.highlight-card small {
  color: #746a60;
  font-family: "Caveat", cursive;
  font-size: 15px;
}
.modal {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 7px 7px 0 rgba(41, 39, 33, 0.35);
}
.modal::backdrop {
  background: rgba(48, 42, 34, 0.36);
}
.modal-heading .eyebrow {
  color: #a64d57;
}
.modal-card label,
.modal-card legend {
  color: #554c43;
  font-family: "Special Elite", monospace;
}
.modal-card input {
  border: 1px solid #a99f92;
  border-radius: 0;
  color: var(--ink);
  background: #fffdf7;
}
.modal-card input::placeholder {
  color: #9c9184;
}
.picker-option {
  border: 1px solid #a99f92;
  border-radius: 0;
  color: var(--ink);
  background: #fffdf7;
}
.picker-option:hover,
.picker-option.is-picked {
  border-color: #a64d57;
  background: #f4e6e1;
}
.color-option.is-picked {
  box-shadow:
    0 0 0 2px #fffaf0,
    0 0 0 4px var(--swatch);
}
.detail-title h2 {
  color: var(--ink);
  font-family: "Special Elite", monospace;
  font-weight: 400;
}
.detail-title p,
.detail-metric span {
  color: #746a60;
  font-family: "Caveat", cursive;
  font-size: 16px;
}
.detail-metric {
  border: 1px solid #bdb4a6;
  border-radius: 0;
  background: #fffdf7;
}
.detail-metric strong {
  color: #a64d57;
  font-family: "Caveat", cursive;
  letter-spacing: 0;
}
.detail-calendar {
  border: 1px solid #bdb4a6;
  border-radius: 0;
  background: #faf5ea;
}
.danger-button {
  border: 1px solid #a64d57;
  border-radius: 0;
  color: #a64d57;
  background: #fff4f4;
  font-family: "Special Elite", monospace;
}
.danger-button:hover {
  background: #f5dfdf;
}
.toast {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 3px 3px 0 #a64d57;
  font-family: "Special Elite", monospace;
}
@media (max-width: 940px) {
  .sidebar {
    background: rgba(250, 247, 238, 0.94);
  }
  .nav-item.is-active:before {
    display: none;
  }
  .calendar-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 680px) {
  body {
    background-size: 12px 12px;
  }
  .sidebar {
    border-top: 1.5px solid var(--ink);
    background: rgba(250, 247, 238, 0.96);
    backdrop-filter: blur(16px);
  }
  .nav-item {
    font-family: "Special Elite", monospace;
  }
  .nav-item.is-active {
    color: #a64d57;
  }
  .nav-item.is-active span {
    color: #a64d57;
  }
  .primary-button {
    box-shadow: 2px 2px 0 #292721;
  }
  .habit-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
  }
  .habit-card .mini-track {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    grid-column: 1/-1;
    grid-row: 2;
    margin: 2px 0 0;
  }
  .mini-day {
    height: 29px;
  }
  .habit-name small {
    max-width: 190px;
  }
  .calendar-days {
    gap: 4px;
  }
  .calendar-day {
    font-size: 10px;
  }
  .day-marker {
    font-size: 18px;
  }
  .summary-intro {
    grid-column: 1/-1;
  }
  .modal {
    box-shadow: 4px 4px 0 rgba(41, 39, 33, 0.35);
  }
}

/* 04. Dated check-in strip  */

/* Dated check-in strip: every X belongs to the date directly beneath it. */

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #776d61;
  font:
    600 14px "Caveat",
    cursive;
}
.back-dates {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: 2px 2px 0 #a64d57;
  font:
    400 30px/0.8 "Special Elite",
    monospace;
  transition: 0.16s;
}
.back-dates:hover {
  color: #fffdf7;
  background: #a64d57;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #292721;
}
.habit-card {
  grid-template-columns: auto minmax(155px, 0.85fr) minmax(270px, 1.35fr);
}
.mini-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  align-items: start;
}
.mini-day {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-family: "DM Sans", sans-serif;
}
.mini-day:hover {
  border: 0;
  background: transparent;
}
.check-box {
  display: grid;
  place-items: center;
  width: 100%;
  height: 38px;
  border: 1.5px solid #a99f92;
  color: transparent;
  background: #fffdf7;
  font:
    700 34px/0.74 "Caveat",
    cursive;
  transition: 0.15s;
}
.mini-day:hover .check-box {
  border-color: var(--ink);
  background: #f5eee1;
}
.mini-day.is-done {
  color: var(--habit);
  background: transparent;
  box-shadow: none;
}
.mini-day.is-done .check-box {
  border-color: var(--habit);
  color: var(--habit);
  background: #fffdf7;
}
.mini-day.is-today .check-box {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
}
.mini-date {
  display: grid;
  gap: 0;
  color: #6e6459;
  text-align: center;
}
.mini-date small {
  font:
    400 9px/1 "Special Elite",
    monospace;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.mini-date b {
  color: var(--ink);
  font:
    600 18px/1.05 "Caveat",
    cursive;
}
@media (max-width: 680px) {
  .section-heading {
    gap: 12px;
  }
  .history-controls {
    gap: 7px;
    font-size: 13px;
  }
  .back-dates {
    width: 33px;
    height: 31px;
    font-size: 26px;
  }
  .habit-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
  }
  .habit-card .mini-track {
    grid-column: 1/-1;
    grid-row: 2;
    margin: 4px 0 0;
    gap: 6px;
  }
  .mini-day {
    height: auto;
  }
  .check-box {
    height: 35px;
  }
  .mini-date b {
    font-size: 17px;
  }
  .mini-date small {
    font-size: 8px;
  }
}

/* 05. Habit board and shared date header                                     */

/* One continuous habit table: dates appear once above every check-in row. */
.habit-board {
  overflow: hidden;
  border: 1.5px solid var(--ink);
  background: #fffdf7;
  box-shadow: 3px 3px 0 rgba(41, 39, 33, 0.16);
}
.habit-board-header {
  display: grid;
  grid-template-columns: minmax(245px, 1fr) minmax(330px, 1.2fr);
  gap: 15px;
  align-items: end;
  padding: 13px 15px 10px;
  border-bottom: 1.5px solid var(--ink);
  background: #f7f0e4;
}
.habit-board-label {
  color: #645a50;
  font:
    400 11px "Special Elite",
    monospace;
  letter-spacing: 0.9px;
}
.tracker-date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}
.tracker-date {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 0;
  padding: 2px 0 0;
  color: #6e6459;
  text-align: center;
}
.tracker-date small {
  font:
    400 9px/1 "Special Elite",
    monospace;
  text-transform: uppercase;
}
.tracker-date b {
  color: var(--ink);
  font:
    600 19px/0.98 "Caveat",
    cursive;
}
.tracker-date.is-anchor {
  border-bottom: 2px solid #a64d57;
}
.tracker-date.is-today b {
  color: #a64d57;
}
.habit-list {
  display: grid;
  gap: 0;
}
.habit-card {
  display: grid;
  grid-template-columns: minmax(245px, 1fr) minmax(330px, 1.2fr);
  gap: 15px;
  align-items: center;
  padding: 14px 15px;
  border: 0;
  border-bottom: 1px solid #bdb4a6;
  border-radius: 0;
  background: #fffdf7;
  box-shadow: none;
}
.habit-card:last-child {
  border-bottom: 0;
}
.habit-card:hover {
  border-color: #bdb4a6;
  background: #faf5ea;
  box-shadow: none;
  transform: none;
}
.habit-info {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}
.habit-name {
  min-width: 0;
}
.habit-name small {
  max-width: none;
}
.form-hint {
  margin: 6px 0 0;
  color: #796f63;
  font:
    15px "Caveat",
    cursive;
}
.edit-button {
  border: 1px solid #68775e;
  padding: 8px 11px;
  color: #526149;
  background: #edf1e7;
  font:
    400 12px "Special Elite",
    monospace;
}
.edit-button:hover {
  color: #fffdf7;
  background: #68775e;
}
.profile-modal {
  width: min(570px, calc(100% - 28px));
}
.profile-preview-row {
  display: flex;
  align-items: center;
  gap: 15px;
}
.profile-preview {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  font-size: 24px;
}
.avatar.has-photo {
  color: transparent;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.photo-label {
  flex: 1;
}
.photo-label input {
  padding: 8px 0;
  border: 0;
  background: transparent;
}
.modal-card select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #a99f92;
  border-radius: 0;
  color: var(--ink);
  background: #fffdf7;
}
.toggle-label {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
}
.toggle-label input {
  width: 18px;
  height: 18px;
  accent-color: #a64d57;
}
.theme-sage .primary-button {
  background: #68775e;
}
.theme-sage .eyebrow,
.theme-sage .habit-delete,
.theme-sage .calendar-link {
  color: #68775e;
}
.theme-sage .calendar-link {
  border-color: #68775e;
}
.theme-rose .primary-button {
  background: #c77982;
}
.theme-rose .eyebrow,
.theme-rose .habit-delete,
.theme-rose .calendar-link {
  color: #a64d57;
}

/* 06. Legacy dark-mode compatibility overrides */

.night-mode {
  color: #f5f0e7;
  background-color: #202220;
  background-image: radial-gradient(
    rgba(220, 210, 190, 0.1) 0.7px,
    transparent 0.9px
  );
}
.night-mode .sidebar,
.night-mode .topbar,
.night-mode .habit-board,
.night-mode .habit-card,
.night-mode .calendar-card,
.night-mode .insight-card,
.night-mode .progress-panel,
.night-mode .heat-card,
.night-mode .highlight-card,
.night-mode .modal {
  border-color: #655f55;
  background: #2b2d2a;
}
.night-mode .habit-board-header {
  border-color: #655f55;
  background: #363833;
}
.night-mode .habit-name strong,
.night-mode .title-row h1,
.night-mode .title-row h2,
.night-mode .panel-title h3,
.night-mode .detail-title h2,
.night-mode .modal-heading h2,
.night-mode .profile-card strong {
  color: #f5f0e7;
}
.night-mode .habit-name small,
.night-mode .section-heading p,
.night-mode .panel-title p,
.night-mode .detail-title p,
.night-mode .form-hint {
  color: #c1b8aa;
}
.night-mode .calendar-day,
.night-mode .modal-card input,
.night-mode .modal-card select {
  color: #f5f0e7;
  background: #363833;
  border-color: #756d60;
}
.night-mode .profile-card {
  border-color: #655f55;
}
.night-mode .calendar-link {
  color: #d4e0c5;
  background: #363833;
  border-color: #91a681;
}
.night-mode .calendar-link:hover {
  color: #202220;
  background: #c4d4b4;
}
.profile-auth-actions {
  display: flex;
  gap: 9px;
  margin-top: 17px;
}
.profile-action {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid #68775e;
  color: #526149;
  background: #edf1e7;
  font:
    400 12px "Special Elite",
    monospace;
}
.profile-action:hover {
  color: #fffdf7;
  background: #68775e;
}
.habit-delete {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  color: #a64d57;
  background: transparent;
  font:
    700 24px/0.8 "Caveat",
    cursive;
}
.habit-delete:hover {
  border-color: #a64d57;
  background: #f5dfdf;
}
.habit-card .mini-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}
.habit-card .mini-day {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.habit-card .mini-day:hover {
  border: 0;
  background: transparent;
}
.habit-card .check-box {
  width: 100%;
  height: 39px;
}
.habit-card .mini-day.is-done {
  background: transparent;
}
.habit-card .mini-day.is-done .check-box {
  color: var(--habit);
}
.habit-board .empty-state {
  margin: 15px;
}
@media (max-width: 680px) {
  .habit-board-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .tracker-date-strip {
    gap: 6px;
  }
  .tracker-date small {
    font-size: 8px;
  }
  .tracker-date b {
    font-size: 17px;
  }
  .habit-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 13px 12px;
  }
  .habit-card .mini-track {
    grid-column: auto;
    grid-row: auto;
    gap: 6px;
    margin: 0;
  }
  .habit-card .check-box {
    height: 36px;
  }
  .habit-info {
    gap: 11px;
  }
  .habit-board .empty-state {
    margin: 12px;
  }
}

/* 07. Profile appearance controls  */

/* Personal appearance controls. */
.profile-card {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  background: transparent;
}
.profile-label {
  font-size: 13px;
}
.photo-picker {
  display: flex !important;
  align-items: center;
  gap: 14px;
  margin-top: 0 !important;
  cursor: pointer;
}
.profile-preview {
  position: relative;
  overflow: hidden;
}
.photo-picker:hover .profile-preview,
.photo-picker:focus-within .profile-preview {
  outline: 2px solid var(--custom-accent, #a64d57);
  outline-offset: 3px;
}
.photo-picker-text {
  color: var(--muted);
  font:
    400 14px "Caveat",
    cursive;
}
.photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.avatar.has-photo::after {
  content: "✎";
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 2px solid #fffdf7;
  border-radius: 50%;
  color: #fffdf7;
  background: var(--custom-accent, #a64d57);
  font:
    700 13px/1 "DM Sans",
    sans-serif;
}
.appearance-settings {
  margin-top: 20px;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid #bdb4a6;
}
.appearance-settings legend {
  margin-bottom: 4px;
  color: var(--ink);
  font:
    600 16px "Special Elite",
    monospace;
}
.appearance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.appearance-settings input[type="color"] {
  height: 42px;
  padding: 4px;
}
.theme-sage,
.theme-rose,
.theme-ocean,
.theme-sunset {
  --custom-accent: var(--custom-accent, #a64d57);
}
.theme-sage {
  --custom-accent: #68775e;
}
.theme-rose {
  --custom-accent: #c77982;
}
.theme-ocean {
  --custom-accent: #3f7180;
}
.theme-sunset {
  --custom-accent: #c06c3d;
}
.theme-sage .primary-button,
.theme-ocean .primary-button,
.theme-sunset .primary-button {
  background: var(--custom-accent);
  color: #fffdf7;
}
.theme-rose .primary-button {
  background: var(--custom-accent);
}
.theme-sage .eyebrow,
.theme-ocean .eyebrow,
.theme-sunset .eyebrow,
.theme-rose .eyebrow,
.theme-sage .habit-delete,
.theme-ocean .habit-delete,
.theme-sunset .habit-delete,
.theme-rose .habit-delete {
  color: var(--custom-accent);
}
.theme-ocean .habit-board-header {
  background: #e4f0f0;
}
.theme-ocean .habit-board,
.theme-ocean .habit-card {
  background: #f7fbfa;
}
.theme-sunset .habit-board-header {
  background: #f8e8dc;
}
.theme-sunset .habit-board,
.theme-sunset .habit-card {
  background: #fffaf5;
}
.font-dm-sans {
  font-family: "DM Sans", sans-serif;
}
.font-special-elite {
  font-family: "Special Elite", monospace;
}
.font-caveat {
  font-family: "Caveat", cursive;
}
.font-dm-sans .brand,
.font-dm-sans .title-row h1,
.font-dm-sans .title-row h2,
.font-dm-sans .section-heading h2,
.font-dm-sans .panel-title h3,
.font-dm-sans .modal-heading h2 {
  font-family: "DM Sans", sans-serif;
}
.font-caveat .brand,
.font-caveat .title-row h1,
.font-caveat .title-row h2,
.font-caveat .section-heading h2,
.font-caveat .panel-title h3,
.font-caveat .modal-heading h2 {
  font-family: "Caveat", cursive;
}
@media (max-width: 680px) {
  .appearance-grid {
    grid-template-columns: 1fr;
  }
  .appearance-settings {
    padding-top: 14px;
  }
}

/* 08. Dedicated authentication page   */

.auth-page {
  min-height: 100vh;
  background: #eee9de;
}
.auth-shell {
  width: min(520px, calc(100% - 32px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: auto;
  padding: 32px 0;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--ink);
  font:
    400 18px "Special Elite",
    monospace;
  text-decoration: none;
}
.auth-brand strong {
  color: #a64d57;
  font-weight: 400;
}
.auth-brand .brand-mark {
  width: 30px;
  height: 30px;
}
.auth-card {
  padding: 30px;
  border: 1.5px solid var(--ink);
  background: #fffdf7;
  box-shadow: 5px 5px 0 rgba(41, 39, 33, 0.14);
}
.auth-card h1 {
  margin: 0;
  color: var(--ink);
  font:
    600 38px/1.05 "Caveat",
    cursive;
}
.auth-intro {
  margin: 8px 0 22px;
  color: var(--muted);
}
.auth-card label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.auth-card input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #a99f92;
  border-radius: 0;
  color: var(--ink);
  background: #fffdf7;
}
.auth-card .primary-button {
  width: 100%;
  justify-content: center;
  margin-top: 21px;
  background: #68775e;
  color: #fffdf7;
}
.auth-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #68775e;
  font-size: 12px;
}
.auth-message.is-error {
  color: #a64d57;
}
.auth-switch,
.auth-back {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  color: #68775e;
  background: transparent;
  font:
    400 14px "Caveat",
    cursive;
  text-align: center;
  text-decoration: none;
}
.auth-switch:hover,
.auth-back:hover {
  color: #a64d57;
  text-decoration: underline;
}
.auth-back {
  margin-top: 9px;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
}
@media (max-width: 560px) {
  .auth-card {
    padding: 22px;
  }
  .auth-card h1 {
    font-size: 33px;
  }
}

/* 09. Insights heat-map palettes  */

.insight-palette-moss .heat-cell {
  background: #d5dfc9;
}
.insight-palette-moss .heat-cell.level-1 {
  background: #a8bf8f;
}
.insight-palette-moss .heat-cell.level-2 {
  background: #6f9662;
}
.insight-palette-moss .heat-cell.level-3 {
  background: #4f7c53;
}
.insight-palette-moss .heat-cell.level-4 {
  background: #2f5e43;
  box-shadow: 0 0 11px rgba(47, 94, 67, 0.24);
}
.insight-palette-ocean .heat-cell {
  background: #c9dfe1;
}
.insight-palette-ocean .heat-cell.level-1 {
  background: #8fbfc4;
}
.insight-palette-ocean .heat-cell.level-2 {
  background: #4c96a3;
}
.insight-palette-ocean .heat-cell.level-3 {
  background: #337985;
}
.insight-palette-ocean .heat-cell.level-4 {
  background: #28606d;
  box-shadow: 0 0 11px rgba(40, 96, 109, 0.24);
}
.insight-palette-sunset .heat-cell {
  background: #f0d2b7;
}
.insight-palette-sunset .heat-cell.level-1 {
  background: #e3a27b;
}
.insight-palette-sunset .heat-cell.level-2 {
  background: #c86b58;
}
.insight-palette-sunset .heat-cell.level-3 {
  background: #aa4f4c;
}
.insight-palette-sunset .heat-cell.level-4 {
  background: #8f3e4b;
  box-shadow: 0 0 11px rgba(143, 62, 75, 0.24);
}
.insight-palette-moss .legend-squares i {
  background: #d5dfc9;
}
.insight-palette-moss .legend-squares i:nth-child(2) {
  background: #a8bf8f;
}
.insight-palette-moss .legend-squares i:nth-child(3) {
  background: #6f9662;
}
.insight-palette-moss .legend-squares i:nth-child(4) {
  background: #2f5e43;
}
.insight-palette-ocean .legend-squares i {
  background: #c9dfe1;
}
.insight-palette-ocean .legend-squares i:nth-child(2) {
  background: #8fbfc4;
}
.insight-palette-ocean .legend-squares i:nth-child(3) {
  background: #4c96a3;
}
.insight-palette-ocean .legend-squares i:nth-child(4) {
  background: #28606d;
}
.insight-palette-sunset .legend-squares i {
  background: #f0d2b7;
}
.insight-palette-sunset .legend-squares i:nth-child(2) {
  background: #e3a27b;
}
.insight-palette-sunset .legend-squares i:nth-child(3) {
  background: #c86b58;
}
.insight-palette-sunset .legend-squares i:nth-child(4) {
  background: #8f3e4b;
}
.insight-palette-journal .heat-cell {
  background: #e7dfd2;
}
.insight-palette-journal .heat-cell.level-1 {
  background: #a12521;
}
.insight-palette-journal .heat-cell.level-2 {
  background: #ca4613;
}
.insight-palette-journal .heat-cell.level-3 {
  background: #f8b026;
}
.insight-palette-journal .heat-cell.level-4 {
  background: #7f8a52;
  box-shadow: 0 0 11px rgba(127, 138, 82, 0.24);
}
.insight-palette-journal .legend-squares i {
  background: #a12521;
}
.insight-palette-journal .legend-squares i:nth-child(2) {
  background: #ca4613;
}
.insight-palette-journal .legend-squares i:nth-child(3) {
  background: #f8b026;
}
.insight-palette-journal .legend-squares i:nth-child(4) {
  background: #7f8a52;
}
.insight-month-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}
.insight-month-switch strong {
  min-width: 112px;
  color: var(--ink);
  font:
    400 13px "Special Elite",
    monospace;
  text-align: center;
}
.month-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

/* 10. Final dark-mode surface overrides */

/* Keep every paper surface dark when the user selects dark mode. */
.night-mode,
.night-mode body {
  color: #eee9de !important;
  background-color: #171916 !important;
  background-image: radial-gradient(
    rgba(220, 210, 190, 0.08) 0.7px,
    transparent 0.9px
  ) !important;
}
.night-mode .sidebar,
.night-mode .topbar,
.night-mode .habit-board,
.night-mode .habit-card,
.night-mode .calendar-card,
.night-mode .insight-card,
.night-mode .progress-panel,
.night-mode .heat-card,
.night-mode .highlight-card,
.night-mode .summary-stat,
.night-mode .month-habits,
.night-mode .detail-metric,
.night-mode .detail-calendar,
.night-mode .modal,
.night-mode .toast {
  color: #eee9de !important;
  border-color: #5e655a !important;
  background: #252a26 !important;
}
.night-mode .sidebar {
  background: rgba(27, 31, 28, 0.96) !important;
}
.night-mode .habit-board-header {
  border-color: #5e655a !important;
  background: #303730 !important;
}
.night-mode .hero-card {
  border-color: #687563 !important;
  background: #303b32 !important;
}
.night-mode .streak-card {
  background: #292f2a !important;
}
.night-mode .empty-state {
  color: #c6c0b5 !important;
  border-color: #687563 !important;
  background: #252a26 !important;
}
.night-mode .summary-intro {
  color: #eee9de !important;
  border-color: #687563 !important;
  background: #39483a !important;
}
.night-mode .calendar-day,
.night-mode .mini-day,
.night-mode .check-box,
.night-mode .completion-toggle,
.night-mode .day-chip,
.night-mode .week-strip .week-dot {
  color: #d8d1c5 !important;
  border-color: #5e655a !important;
  background: #303630 !important;
}
.night-mode .calendar-day:hover,
.night-mode .mini-day:hover .check-box,
.night-mode .day-chip:hover {
  background: #3a433b !important;
}
.night-mode .calendar-day.has-progress,
.night-mode .calendar-day.partial {
  background: #303630 !important;
}
.night-mode .habit-name strong,
.night-mode .title-row h1,
.night-mode .title-row h2,
.night-mode .section-heading h2,
.night-mode .panel-title h3,
.night-mode .detail-title h2,
.night-mode .modal-heading h2,
.night-mode .profile-card strong,
.night-mode .hero-copy h2,
.night-mode .summary-intro strong,
.night-mode .highlight-card p {
  color: #f3eee5 !important;
}
.night-mode .habit-name small,
.night-mode .title-row .subtle,
.night-mode .section-heading p,
.night-mode .panel-title p,
.night-mode .detail-title p,
.night-mode .detail-metric span,
.night-mode .form-hint,
.night-mode .weekly-note,
.night-mode .heat-legend,
.night-mode .highlight-card small,
.night-mode .date-label,
.night-mode .card-label {
  color: #c1b9ad !important;
}
.night-mode .hero-copy p,
.night-mode .goal-row span,
.night-mode .month-habit,
.night-mode .weekdays span {
  color: #d2cabe !important;
}
.night-mode .quiet-button,
.night-mode .icon-button {
  color: #d8d1c5 !important;
}
.night-mode .quiet-button:hover,
.night-mode .icon-button:hover {
  color: #fffaf0 !important;
  background: #394139 !important;
}
.night-mode .modal-card label,
.night-mode .modal-card legend {
  color: #e2dbd0 !important;
}
.night-mode .modal-card input,
.night-mode .modal-card select,
.night-mode .auth-card input {
  color: #f3eee5 !important;
  border-color: #687563 !important;
  background: #303630 !important;
}
.night-mode .modal-card input::placeholder {
  color: #aaa296 !important;
}
.night-mode .picker-option {
  color: #eee9de !important;
  border-color: #687563 !important;
  background: #303630 !important;
}
.night-mode .profile-action,
.night-mode .edit-button,
.night-mode .badge {
  color: #d9e6d1 !important;
  border-color: #687563 !important;
  background: #344236 !important;
}
.night-mode .bar {
  border-color: #5e655a !important;
  background: #303630 !important;
}
.night-mode .progress-card-text {
  color: #d2cabe !important;
  background: #303a31 !important;
}
.night-mode .modal::backdrop {
  background: rgba(0, 0, 0, 0.78) !important;
}
.night-mode .auth-page {
  background: #171916 !important;
}

/* ========================================================================== */
/* 11. Cross-device layout refinements                                        */
/* ========================================================================== */

html {
  min-width: 320px;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.workspace,
.view-content,
.today-view,
.calendar-view,
.insight-view {
  min-width: 0;
}

.topbar-actions,
.title-row,
.section-heading,
.panel-title,
.detail-header,
.detail-actions {
  min-width: 0;
}

@media (min-width: 1440px) {
  .workspace {
    padding-right: clamp(48px, 5vw, 96px);
    padding-left: clamp(48px, 5vw, 96px);
  }
}

@media (max-width: 1100px) {
  .overview,
  .bottom-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

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

  .calendar-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .habit-card {
    grid-template-columns: auto minmax(0, 1fr) minmax(220px, 1.1fr) auto;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding-right: 20px;
    padding-left: 20px;
  }

  .topbar {
    min-height: 73px;
    height: auto;
    padding: 14px 0;
    gap: 12px;
  }

  .date-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-actions .profile-card strong {
    display: none;
  }

  .hero-inner {
    align-items: center;
  }

  .hero-copy {
    min-width: 0;
  }

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

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

  .habit-card .mini-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .insight-month-switch strong {
    min-width: 90px;
    font-size: 12px;
  }

  .detail-progress {
    flex-wrap: wrap;
  }

  .detail-metric {
    min-width: calc(50% - 6px);
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .detail-actions .primary-button {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    gap: 6px;
  }

  .night-toggle {
    width: 46px;
  }

  .night-toggle.is-on .night-toggle-moon {
    left: 21px;
  }

  .primary-button {
    max-width: 100%;
    white-space: normal;
  }

  .title-row {
    flex-direction: column;
    gap: 8px;
  }

  .title-row .subtle {
    max-width: none;
    text-align: left;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .score-ring {
    align-self: flex-end;
    width: 86px;
    height: 86px;
  }

  .calendar-summary {
    grid-template-columns: 1fr;
  }

  .summary-intro,
  .month-habits {
    grid-column: auto;
  }

  .section-heading {
    flex-direction: column;
    gap: 10px;
  }

  .day-selector {
    width: 100%;
  }

  .day-chip {
    flex: 1;
    min-width: 0;
  }

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

  .habit-info {
    min-width: 0;
  }

  .habit-delete {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .habit-name small {
    max-width: 100%;
  }

  .habit-card .mini-track {
    grid-column: 1 / -1;
  }

  .heat-map {
    gap: 4px;
  }

  .heat-cell:hover::after {
    display: none;
  }

  .insight-month-switch strong {
    min-width: 84px;
  }

  .modal {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .modal-card {
    padding: 18px;
  }

  .modal-actions,
  .profile-auth-actions {
    flex-wrap: wrap;
  }

  .modal-actions > button,
  .profile-auth-actions > button {
    flex: 1 1 100%;
  }

  .photo-picker {
    width: 100%;
  }

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

  .auth-shell {
    width: calc(100% - 24px);
    padding: 20px 0;
  }

  .auth-card {
    padding: 20px;
  }
}


/* ========================================================================== */
/* 12. Home-page SEO content — the habit tracker guide                        */
/* ========================================================================== */

.seo-content {
  --seo-bg: #fffcf4;
  --seo-text: #292721;
  --seo-muted: #555045;
  --seo-line: #ddd6c8;
  --seo-accent: #a64d57;
  --seo-chip: #f7f1e5;
  --seo-cta-text: #fffcf4;
  position: relative;
  border-top: 1.5px solid #292721;
  background: var(--seo-bg);
  color: var(--seo-text);
  padding: 74px 26px 86px;
}

.night-mode .seo-content {
  --seo-bg: #252a26;
  --seo-text: #eee9de;
  --seo-muted: #bdb5a7;
  --seo-line: #5e655a;
  --seo-accent: #d9979e;
  --seo-chip: #2e342f;
  --seo-cta-text: #1e211d;
  border-top-color: #5e655a;
}

.seo-inner {
  max-width: 1060px;
  margin: 0 auto;
}

.seo-eyebrow {
  margin: 0 0 14px;
  color: var(--seo-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.seo-content h1 {
  margin: 0 0 18px;
  color: var(--seo-text);
  font:
    400 clamp(30px, 4vw, 46px) / 1.16 "Special Elite",
    "Outfit",
    monospace;
  letter-spacing: 0.3px;
}

.seo-content h2 {
  margin: 46px 0 14px;
  color: var(--seo-text);
  font:
    400 clamp(21px, 2.3vw, 27px) / 1.3 "Special Elite",
    "Outfit",
    monospace;
  letter-spacing: 0.2px;
}

.seo-content h3 {
  margin: 0 0 6px;
  color: var(--seo-text);
  font:
    700 17px/1.4 "DM Sans",
    sans-serif;
}

.seo-content p {
  margin: 0 0 16px;
  max-width: 84ch;
  color: var(--seo-muted);
  font:
    400 16.5px/1.75 "DM Sans",
    sans-serif;
}

.seo-content .seo-lead {
  max-width: 74ch;
  color: var(--seo-text);
  font-size: 18.5px;
}

.seo-content .seo-lead strong {
  color: var(--seo-accent);
}

.seo-content a {
  color: var(--seo-accent);
}

.seo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 10px 26px;
  margin: 8px 0 22px;
  padding: 0;
  max-width: 960px;
  list-style: none;
}

.seo-list li {
  position: relative;
  padding: 11px 15px 11px 40px;
  border: 1px solid var(--seo-line);
  border-radius: 11px;
  background: var(--seo-chip);
  color: var(--seo-text);
  font-size: 15px;
  line-height: 1.5;
}

.seo-list li::before {
  content: "\2713";
  position: absolute;
  left: 15px;
  top: 11px;
  color: var(--seo-accent);
  font-weight: 700;
}

.seo-faq {
  display: grid;
  gap: 12px;
  max-width: 880px;
}

.seo-faq-item {
  padding: 18px 20px;
  border: 1px solid var(--seo-line);
  border-radius: 12px;
  background: var(--seo-chip);
}

.seo-faq-item p {
  margin-bottom: 0;
  font-size: 15.5px;
}

.seo-content .seo-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 15px 28px;
  border-radius: 999px;
  background: var(--seo-accent);
  color: var(--seo-cta-text);
  font:
    700 15px/1 "DM Sans",
    sans-serif;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    filter 0.16s ease;
}

.seo-cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

/* Typeface preference chosen in Profile also applies to the guide headings. */
.font-dm-sans .seo-content h1,
.font-dm-sans .seo-content h2 {
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.font-caveat .seo-content h1,
.font-caveat .seo-content h2 {
  font-family: "Caveat", cursive;
  font-weight: 700;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .seo-content {
    padding: 50px 20px 60px;
  }

  .seo-content h2 {
    margin-top: 36px;
  }

  .seo-content .seo-lead {
    font-size: 17px;
  }

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

  .seo-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}


/* ========================================================================== */
/* 13. Static content pages: about, privacy, terms, contact                   */
/* ========================================================================== */

/* The brand mark lost contrast in dark mode; keep it readable everywhere. */
.night-mode .brand {
  color: #eee9de;
}
.night-mode .brand > span:last-child span {
  color: #e7a4ad;
}

.site-header,
.site-footer {
  --ui-text: #292721;
  --ui-muted: #5f594e;
  --ui-line: #bdb4a6;
  --ui-accent: #a64d57;
  --ui-surface: #f7f1e5;
}

.night-mode .site-header,
.night-mode .site-footer {
  --ui-text: #eee9de;
  --ui-muted: #bdb5a7;
  --ui-line: #5e655a;
  --ui-accent: #d9979e;
  --ui-surface: #2e342f;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 26px clamp(20px, 4vw, 44px);
}

/* Full-bleed hairline under the header, even though the content is centred */
.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  border-bottom: 1.5px solid var(--ui-line);
}

.site-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-nav a,
.footer-links a {
  color: var(--ui-muted);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--ui-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-nav a[aria-current="page"],
.footer-links a[aria-current="page"] {
  color: var(--ui-accent);
}

/* Reading column for long-form pages */
.static-page {
  border-top: 0;
  padding-top: 58px;
}

.crumbs {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--seo-muted);
}

.crumbs a {
  color: var(--seo-muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--seo-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crumbs .crumb-sep {
  margin: 0 8px;
  opacity: 0.55;
}

.page-updated {
  margin: -8px 0 26px;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--seo-muted);
}

.static-page ul.plain {
  margin: 0 0 18px;
  padding-left: 22px;
}

.static-page ul.plain li {
  margin-bottom: 9px;
  color: var(--seo-muted);
  font:
    400 16.5px/1.75 "DM Sans",
    sans-serif;
}

.static-page ul.plain li::marker {
  color: var(--seo-accent);
}

.static-page ul.plain strong {
  color: var(--seo-text);
}

.static-page .seo-faq,
.static-page .seo-list {
  margin-bottom: 22px;
}

.email-card {
  display: inline-block;
  margin: 8px 0 18px;
  padding: 18px 24px;
  border: 1px solid var(--seo-line);
  border-radius: 14px;
  background: var(--seo-chip);
  color: var(--seo-text);
  font:
    700 clamp(18px, 2.4vw, 22px) / 1.3 "DM Sans",
    sans-serif;
  text-decoration: none;
}

.email-card:hover {
  border-color: var(--seo-accent);
  color: var(--seo-accent);
}

.page-note {
  padding: 16px 20px;
  border: 1px solid var(--seo-line);
  border-left: 4px solid var(--seo-accent);
  border-radius: 10px;
  background: var(--seo-chip);
}

.site-footer {
  border-top: 1.5px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-muted);
  padding: 42px clamp(20px, 4vw, 44px) 38px;
}

.footer-inner {
  display: grid;
  gap: 18px;
  max-width: 1460px;
  margin: 0 auto;
}

.footer-tagline {
  margin: 8px 0 0;
  max-width: 56ch;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ui-muted);
}

.footer-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ui-muted);
}

/* Compact cards when the checking-list style is used for feature blurbs */
.static-page .seo-list li h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.static-page .seo-list li p {
  max-width: none;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
}

.static-page code {
  padding: 2px 7px;
  border: 1px solid var(--seo-line);
  border-radius: 6px;
  background: var(--seo-chip);
  color: var(--seo-text);
  font:
    600 13.5px/1 Consolas,
    "Liberation Mono",
    monospace;
}

@media (max-width: 760px) {
  .site-header {
    padding: 20px;
  }

  .static-page {
    padding-top: 44px;
  }

  .site-footer {
    padding: 34px 20px 32px;
  }
}

/* ========================================================================== */
/* 14. Error pages: 404.html and 500.html                                     */
/* ========================================================================== */

.error-page .seo-inner {
  max-width: 760px;
}

/* Giant stamped status code above the heading (decorative only). */
.error-code {
  margin: 0 0 10px;
  color: var(--seo-accent);
  font:
    400 clamp(76px, 15vw, 132px) / 1 "Special Elite",
    "Outfit",
    monospace;
  letter-spacing: 3px;
  user-select: none;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.error-links a {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--seo-line);
  border-radius: 999px;
  background: var(--seo-chip);
  color: var(--seo-text);
  font:
    600 14.5px/1 "DM Sans",
    sans-serif;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.error-links a:hover {
  border-color: var(--seo-accent);
  color: var(--seo-accent);
  transform: translateY(-1px);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}

.error-actions .seo-cta {
  margin-top: 0;
}

/* The "Try again" CTA on 500.html is a <button>; strip the UA border. */
.error-actions button.seo-cta {
  border: 0;
  cursor: pointer;
}

.error-alt {
  margin: 0;
  color: var(--seo-muted);
  font:
    400 15px/1.6 "DM Sans",
    sans-serif;
}

.error-alt a {
  color: var(--seo-accent);
}

.error-page .page-note {
  margin-top: 30px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--seo-muted);
}

.error-page .page-note strong {
  color: var(--seo-text);
}

@media (max-width: 760px) {
  .error-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .error-actions .seo-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
