:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #fffaf2;
  --ink: #18201d;
  --muted: #68746e;
  --primary: #2f5d50;
  --primary-strong: #20443b;
  --accent: #ad5638;
  --blue: #476f95;
  --line: #ded7ca;
  --shadow: 0 18px 48px rgba(42, 45, 41, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-left: 64px;
  background: linear-gradient(145deg, rgba(47, 93, 80, 0.08), transparent 42%), var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button,
select,
input,
textarea {
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease,
    color 160ms ease, transform 160ms ease;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.nav-button:focus-visible,
.menu-trigger:focus-visible,
.menu-close:focus-visible,
.profile-back-link:focus-visible {
  outline: 3px solid rgba(71, 111, 149, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(132px, 1fr) minmax(0, 2.2fr) minmax(132px, 1fr);
  gap: 18px;
  padding: 8px 0 20px;
  text-align: center;
}

.topbar > div {
  grid-column: 2;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  grid-column: 3;
  justify-content: end;
}

.language-control {
  position: relative;
}

.language-flag {
  border: 1px solid rgba(24, 32, 29, 0.14);
  border-radius: 2px;
  flex: 0 0 auto;
  height: 14px;
  object-fit: cover;
  width: 21px;
}

.language-trigger,
.language-option {
  align-items: center;
  background: rgba(255, 250, 242, 0.96);
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-weight: 700;
  gap: 9px;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  text-align: left;
  width: 148px;
}

.language-trigger {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 44px;
  padding: 0 13px 0 10px;
}

.language-trigger:hover,
.language-trigger[aria-expanded="true"] {
  border-color: var(--blue);
}

.language-trigger:focus-visible,
.language-option:focus-visible {
  box-shadow: 0 0 0 3px rgba(71, 111, 149, 0.18);
  outline: 0;
}

.language-chevron {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  height: 7px;
  margin-left: 4px;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
  width: 7px;
}

.language-trigger[aria-expanded="true"] .language-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.language-menu {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(42, 45, 41, 0.16);
  display: grid;
  gap: 3px;
  min-width: 100%;
  padding: 5px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.language-option {
  border-radius: 6px;
  min-height: 40px;
  padding: 7px 9px;
  width: 100%;
}

.language-option:hover,
.language-option:focus-visible,
.language-option[aria-selected="true"] {
  background: rgba(47, 93, 80, 0.09);
}

.language-option[aria-selected="true"]::after {
  color: var(--primary);
  content: "\2713";
  font-weight: 800;
  grid-column: 3;
}

.eyebrow,
.day-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.98;
  margin-bottom: 0;
}

h2 {
  font-size: 1.4rem;
  line-height: 1.15;
  margin-bottom: 8px;
}

.menu-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.menu-trigger img {
  height: 19px;
  opacity: 0.74;
  width: 19px;
}

.menu-trigger:hover {
  background: rgba(47, 93, 80, 0.08);
}

.menu-trigger:hover img {
  opacity: 1;
}

.app-menu {
  background: rgba(255, 253, 249, 0.98);
  border-right: 1px solid var(--line);
  bottom: 0;
  box-shadow: 4px 0 18px rgba(24, 32, 29, 0.04);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  left: 0;
  overflow: hidden;
  padding: 8px 9px 10px;
  position: fixed;
  top: 0;
  transition: box-shadow 180ms ease, width 180ms ease;
  width: 64px;
  z-index: 100;
}

.app-menu[data-expanded="true"] {
  box-shadow: 12px 0 36px rgba(24, 32, 29, 0.14);
  width: 264px;
}

.app-menu-header {
  align-items: center;
  display: flex;
  flex: 0 0 44px;
  gap: 12px;
  min-width: 246px;
}

.app-menu-brand {
  color: var(--primary-strong);
  font-size: 0.94rem;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-5px);
  transition: opacity 120ms ease, transform 180ms ease;
  white-space: nowrap;
}

.app-menu[data-expanded="true"] .app-menu-brand {
  opacity: 1;
  transform: translateX(0);
}

.app-menu-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  min-height: 0;
  min-width: 246px;
}

.nav-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-weight: 720;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 44px;
  padding: 0;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.nav-icon {
  align-items: center;
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.nav-icon img {
  height: 20px;
  opacity: 0.72;
  width: 20px;
}

.nav-button:hover,
.nav-button[aria-current="page"] {
  background: rgba(47, 93, 80, 0.08);
  color: var(--primary-strong);
}

.nav-button:hover img,
.nav-button[aria-current="page"] img {
  opacity: 1;
}

.nav-label {
  opacity: 0;
  overflow: hidden;
  padding-right: 12px;
  transform: translateX(-5px);
  transition: opacity 120ms ease, transform 180ms ease;
  white-space: nowrap;
}

.app-menu[data-expanded="true"] .nav-label {
  opacity: 1;
  transform: translateX(0);
}

#logoutButton {
  margin-top: auto;
}

#profileButton {
  order: 4;
}

.tools-directory {
  display: grid;
  gap: 24px;
  margin: 14px 0 28px;
}

.tools-heading {
  margin: 0 auto;
  max-width: 660px;
  text-align: center;
}

.tools-heading h2 {
  font-size: 1.8rem;
  margin: 4px 0 10px;
}

.tools-heading p:last-child {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

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

.tool-card {
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 210px;
  padding: 22px;
}

.tool-card-active {
  background: var(--panel);
  border-color: rgba(47, 93, 80, 0.42);
}

.tool-icon {
  background: rgba(71, 111, 149, 0.1);
  border-radius: 8px;
  height: 42px;
  padding: 10px;
  width: 42px;
}

.tool-card:nth-child(2) .tool-icon {
  background: rgba(47, 93, 80, 0.11);
}

.tool-card:nth-child(3) .tool-icon {
  background: rgba(71, 111, 149, 0.12);
}

.tool-card:nth-child(4) .tool-icon {
  background: rgba(173, 86, 56, 0.1);
}

.tool-card h3 {
  font-size: 1.08rem;
  margin: 9px 0 7px;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.tool-status {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
}

.tool-status.available {
  color: var(--primary);
}

.tool-link {
  align-items: center;
  color: var(--primary);
  display: inline-flex;
  font-weight: 760;
  gap: 8px;
  grid-column: 2;
  justify-self: start;
  text-decoration: none;
}

.tool-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-link img {
  height: 17px;
  width: 17px;
}

.auth-panel,
.profile-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  margin-bottom: 22px;
  padding: 28px;
}

.auth-panel {
  align-items: start;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.auth-panel p:last-child {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
  max-width: 58ch;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-options {
  display: grid;
  gap: 14px;
}

.google-auth {
  min-height: 44px;
}

.google-sign-in-button {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 44px;
  width: 100%;
}

.google-sign-in-button > div,
.google-sign-in-button iframe {
  max-width: 100%;
}

.auth-status {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 8px 0 0;
  min-height: 1.2em;
  text-align: center;
}

.auth-status.error {
  color: #9b2f2f;
}

.auth-divider {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  gap: 10px;
  grid-template-columns: 1fr auto 1fr;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--line);
  content: "";
  height: 1px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form span {
  color: var(--muted);
  font-weight: 720;
}

.auth-data-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
}

input {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 48px;
  padding: 0 12px;
  width: 100%;
}

.app-content {
  display: block;
}

.profile-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 26px;
  padding: 0;
}

.profile-page-heading {
  display: flex;
  justify-content: flex-end;
}

.profile-back-link {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  text-decoration: none;
}

.profile-hero {
  align-items: center;
  display: grid;
  justify-items: center;
  text-align: center;
}

.profile-avatar-button {
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.profile-avatar-preview {
  align-items: center;
  background: #dce9df;
  border: 1px solid rgba(24, 32, 29, 0.1);
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(42, 45, 41, 0.14);
  display: flex;
  height: 144px;
  justify-content: center;
  width: 144px;
}

.profile-avatar-preview img {
  height: 68px;
  width: 68px;
}

.profile-avatar-preview[data-avatar="tree-pine"] { background: #d2e2d8; }
.profile-avatar-preview[data-avatar="bird"] { background: #dce8f2; }
.profile-avatar-preview[data-avatar="fish"] { background: #d5ece9; }
.profile-avatar-preview[data-avatar="rabbit"] { background: #ebe0e6; }
.profile-avatar-preview[data-avatar="bug"] { background: #f0dfd7; }
.profile-avatar-preview[data-avatar="snail"] { background: #eee7cf; }

.profile-hero h2 {
  font-size: 2rem;
  margin: 18px 0 14px;
}

.profile-edit-button {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(42, 45, 41, 0.1);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 720;
  gap: 9px;
  min-height: 46px;
  padding: 0 17px;
}

.profile-edit-button:hover {
  border-color: var(--primary);
}

.profile-edit-button img {
  height: 18px;
  width: 18px;
}

.profile-stats {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(42, 45, 41, 0.1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
  max-width: 760px;
  width: 100%;
}

.profile-stats div {
  display: grid;
  gap: 5px;
  padding: 20px 14px;
  text-align: center;
}

.profile-stats div + div {
  border-left: 1px solid var(--line);
}

.profile-stats strong {
  color: var(--primary-strong);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-account-details {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 760px;
  width: 100%;
}

.profile-account-details h3 {
  font-size: 1rem;
  margin: 0;
}

.profile-edit-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  width: min(720px, calc(100% - 28px));
}

.profile-edit-dialog::backdrop {
  background: rgba(24, 32, 29, 0.38);
}

.profile-edit-form {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.profile-edit-header {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.profile-edit-header h2 {
  font-size: 1.7rem;
  margin: 4px 0 0;
}

.profile-name-field {
  display: grid;
  gap: 7px;
}

.profile-name-field > span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 720;
}

.profile-symbol-picker {
  display: grid;
  gap: 16px;
}

.profile-symbol-picker h3 {
  font-size: 1rem;
  margin: 0 0 5px;
}

.profile-symbol-picker p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}

.profile-symbol-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(68px, 1fr));
}

.profile-symbol-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 7px;
  justify-items: center;
  min-height: 94px;
  padding: 6px 3px;
}

.profile-symbol-visual {
  align-items: center;
  background: #dce9df;
  border: 2px solid transparent;
  border-radius: 50%;
  display: flex;
  height: 64px;
  justify-content: center;
  width: 64px;
}

.profile-symbol-visual img {
  height: 30px;
  opacity: 0.76;
  width: 30px;
}

.profile-symbol-option:hover {
  background: rgba(47, 93, 80, 0.04);
  color: var(--ink);
}

.profile-symbol-option.selected {
  color: var(--primary-strong);
}

.profile-symbol-option.selected .profile-symbol-visual {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.14);
}

.profile-symbol-option.selected img {
  opacity: 1;
}

.profile-symbol-option[data-avatar="tree-pine"] .profile-symbol-visual { background: #d2e2d8; }
.profile-symbol-option[data-avatar="bird"] .profile-symbol-visual { background: #dce8f2; }
.profile-symbol-option[data-avatar="fish"] .profile-symbol-visual { background: #d5ece9; }
.profile-symbol-option[data-avatar="rabbit"] .profile-symbol-visual { background: #ebe0e6; }
.profile-symbol-option[data-avatar="bug"] .profile-symbol-visual { background: #f0dfd7; }
.profile-symbol-option[data-avatar="snail"] .profile-symbol-visual { background: #eee7cf; }

.profile-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.profile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 0;
}

.profile-grid div {
  background: rgba(47, 93, 80, 0.06);
  border: 1px solid rgba(47, 93, 80, 0.12);
  border-radius: 8px;
  padding: 12px;
}

.profile-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
  margin-bottom: 5px;
}

.profile-grid dd {
  font-weight: 760;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-data-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.today-panel {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(255, 250, 242, 0.95), rgba(255, 250, 242, 0.72)),
    repeating-linear-gradient(45deg, rgba(47, 93, 80, 0.08) 0 2px, transparent 2px 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr auto;
  margin-bottom: 18px;
  padding: 28px;
}

.today-copy p:last-child {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 62ch;
}

.primary-button {
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 760;
  min-height: 48px;
  padding: 0 22px;
}

.secondary-button {
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 760;
  min-height: 48px;
  padding: 0 18px;
}

.secondary-button:hover {
  background: rgba(47, 93, 80, 0.08);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.primary-button:disabled {
  background: #9aa59f;
  cursor: default;
}

.secondary-button:disabled {
  border-color: #aab3ae;
  color: #7d8882;
  cursor: default;
}

.text-button,
.text-link {
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  font-weight: 720;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger-text {
  color: #993d36;
}

.progress-strip {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr;
  margin: 22px 0 34px;
}

.progress-strip strong {
  display: block;
  font-size: 1.6rem;
}

.progress-strip span {
  color: var(--muted);
}

progress {
  accent-color: var(--primary);
  height: 14px;
  width: 100%;
}

.summary-panel {
  background: #eef4f6;
  border: 1px solid rgba(71, 111, 149, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  margin: 0 0 34px;
  padding: 24px;
}

.summary-header p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.summary-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-stat {
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid rgba(71, 111, 149, 0.18);
  border-radius: 8px;
  padding: 14px;
}

.summary-stat strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 6px;
}

.summary-stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.analytics-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.analytics-card {
  background: rgba(255, 250, 242, 0.74);
  border: 1px solid rgba(71, 111, 149, 0.18);
  border-radius: 8px;
  padding: 16px;
}

.analytics-card h3 {
  font-size: 1rem;
  margin: 0 0 14px;
}

.bar-chart,
.wellbeing-chart {
  display: grid;
  gap: 12px;
}

.bar-row,
.wellbeing-row {
  display: grid;
  gap: 6px;
}

.bar-label,
.wellbeing-label {
  align-items: center;
  display: flex;
  font-size: 0.9rem;
  font-weight: 720;
  justify-content: space-between;
}

.bar-label span,
.wellbeing-label span {
  color: var(--muted);
  font-weight: 650;
}

.bar-track,
.wellbeing-track {
  background: rgba(104, 116, 110, 0.16);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.bar-fill,
.wellbeing-fill {
  background: var(--primary);
  border-radius: inherit;
  height: 100%;
  min-width: 2px;
}

.wellbeing-fill.before {
  background: var(--blue);
}

.wellbeing-fill.after {
  background: var(--accent);
}

.wellbeing-pair {
  display: grid;
  gap: 5px;
}

.empty-chart {
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.challenge-plan {
  border-top: 1px solid rgba(71, 111, 149, 0.2);
  margin-top: 4px;
  padding-top: 18px;
}

.challenge-plan h3 {
  font-size: 1rem;
  margin: 0 0 5px;
}

.challenge-plan > p {
  color: var(--muted);
  margin: 0 0 12px;
}

.challenge-plan ol {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.challenge-plan li {
  border-left: 3px solid var(--primary);
  display: grid;
  gap: 3px;
  padding: 8px 10px;
}

.challenge-plan li strong,
.challenge-plan li small {
  color: var(--muted);
  font-size: 0.76rem;
}

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

.section-heading p {
  color: var(--muted);
  margin-bottom: 8px;
}

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

.day-card {
  aspect-ratio: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 5px;
  grid-template-rows: 1fr auto auto 1fr;
  min-width: 0;
  padding: 12px;
  position: relative;
  text-align: center;
}

.day-card > *:first-child {
  align-self: end;
  grid-row: 2;
}

.day-card > *:last-child {
  align-self: start;
  grid-row: 3;
}

.day-card:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(42, 45, 41, 0.1);
  transform: translateY(-1px);
}

.day-card:disabled {
  color: #8d958f;
  cursor: default;
  opacity: 0.56;
}

.day-number {
  font-size: 1.75rem;
  font-weight: 820;
  line-height: 1;
}

.day-theme {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  justify-items: center;
  line-height: 1.2;
  max-width: 100%;
  min-height: 2.4em;
  overflow-wrap: anywhere;
}

.day-card.completed {
  background: #eaf2ee;
  border-color: rgba(47, 93, 80, 0.42);
}

.day-card.completed::after {
  background: var(--primary);
  border-radius: 999px;
  color: #fff;
  content: "✓";
  font-size: 0.8rem;
  height: 22px;
  line-height: 22px;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
}

.exercise-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: min(680px, calc(100% - 28px));
  padding: 0;
  width: 100%;
}

.exercise-dialog::backdrop {
  background: rgba(24, 32, 29, 0.42);
}

.exercise-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

.close-button {
  position: absolute;
  right: 16px;
  top: 16px;
}

.dialog-body {
  padding: 34px;
}

.dialog-body > .day-label {
  max-width: calc(100% - 76px);
}

.practice-source {
  color: var(--blue);
  font-weight: 720;
}

.science-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  display: inline-grid;
  font-weight: 760;
  gap: 9px;
  grid-template-columns: 22px auto 8px;
  margin: 4px 0 12px;
  padding: 7px 0;
}

.info-icon {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.science-chevron {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  height: 7px;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
  width: 7px;
}

.science-toggle[aria-expanded="true"] .science-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.science-panel {
  background: rgba(71, 111, 149, 0.06);
  border-bottom: 1px solid rgba(71, 111, 149, 0.2);
  border-left: 3px solid var(--blue);
  border-top: 1px solid rgba(71, 111, 149, 0.2);
  margin: 0 0 20px;
  padding: 20px 22px;
}

.science-panel h3 {
  font-size: 1.05rem;
  margin: 0 0 9px;
}

.science-panel > p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.science-details {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  margin: 18px 0;
}

.science-details strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.science-details p {
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

.science-source-link {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 760;
  text-underline-offset: 3px;
}

.science-caution {
  border-top: 1px solid rgba(71, 111, 149, 0.16);
  font-size: 0.8rem;
  margin-top: 16px !important;
  padding-top: 12px;
}

.steps-list {
  color: var(--ink);
  line-height: 1.55;
  padding-left: 24px;
}

.steps-list li + li {
  margin-top: 8px;
}

.reflection-field {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.reflection-field span {
  color: var(--muted);
  font-weight: 720;
}

.reflection-field small {
  color: var(--muted);
  font-size: 0.78rem;
}

.complete-exercise-button {
  margin-top: 4px;
}

.rating-block {
  margin-top: 20px;
}

.rating-block h3 {
  font-size: 1rem;
  margin: 0 0 10px;
}

.rating-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rating-button {
  align-content: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 82px;
  min-width: 0;
  padding: 10px 5px;
  text-align: center;
}

.rating-button:hover,
.rating-button.selected {
  background: #eaf2ee;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(47, 93, 80, 0.1);
  transform: translateY(-1px);
}

.rating-button strong {
  align-items: center;
  background: rgba(47, 93, 80, 0.08);
  border-radius: 50%;
  display: flex;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  height: 30px;
  justify-content: center;
  line-height: 1;
  width: 30px;
}

.rating-button.selected strong {
  background: var(--primary);
  color: #fff;
}

.rating-button span {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.72rem;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.4em;
  overflow-wrap: anywhere;
  width: 100%;
}

.rating-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 10px 0 0;
}

.rating-block .text-button {
  margin-top: 8px;
}

.assessment-progress-row {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 0.82rem;
  font-weight: 720;
  gap: 12px;
  grid-template-columns: auto 1fr;
  margin-top: 22px;
}

.assessment-progress-row progress {
  height: 8px;
}

.assessment-list {
  display: grid;
  gap: 0;
  margin: 10px 0 22px;
}

.assessment-item {
  display: grid;
  gap: 18px;
  min-height: 190px;
  padding: 18px 0 8px;
}

.assessment-label {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 14px;
  font-weight: 720;
  justify-content: space-between;
  line-height: 1.3;
}

.assessment-label output {
  align-items: center;
  background: hsl(var(--score-hue, 72) 55% 93%);
  border: 1px solid hsl(var(--score-hue, 72) 38% 72%);
  border-radius: 8px;
  color: hsl(var(--score-hue, 72) 48% 29%);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  height: 34px;
  justify-content: center;
  min-width: 138px;
  padding: 0 8px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.assessment-item.unanswered .assessment-label output {
  background: rgba(104, 116, 110, 0.08);
  border-color: var(--line);
  color: var(--muted);
}

.assessment-why {
  color: var(--muted);
  font-size: 0.9rem;
}

.assessment-why strong {
  color: var(--primary);
  font-weight: 720;
}

.assessment-why p {
  line-height: 1.5;
  margin: 8px 0 0;
}

.assessment-range-wrap {
  display: grid;
  gap: 4px;
}

.assessment-scale {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  height: 12px;
  line-height: 1;
  position: relative;
  user-select: none;
}

.assessment-scale span {
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
}

.assessment-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.assessment-actions > :only-child,
.assessment-actions .primary-button:last-child {
  width: 100%;
}

.assessment-skip {
  display: block;
  margin: 12px auto 0;
}

.assessment-description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

input[type="range"] {
  -webkit-appearance: none;
  accent-color: var(--primary);
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 28px;
  margin: 0;
  padding: 0;
  width: 100%;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--primary) 0 var(--range-progress, 50%),
    rgba(104, 116, 110, 0.2) var(--range-progress, 50%) 100%
  );
  border-radius: 999px;
  height: 6px;
}

input[type="range"]::-webkit-slider-thumb {
  background: var(--primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow: 0 1px 5px rgba(24, 32, 29, 0.24);
  height: 20px;
  margin-top: -7px;
  width: 20px;
  -webkit-appearance: none;
}

input[type="range"]:focus-visible {
  outline: 0;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(47, 93, 80, 0.18), 0 1px 5px rgba(24, 32, 29, 0.24);
}

input[type="range"]::-moz-range-track {
  background: rgba(104, 116, 110, 0.2);
  border-radius: 999px;
  height: 6px;
}

input[type="range"]::-moz-range-progress {
  background: var(--primary);
  border-radius: 999px;
  height: 6px;
}

input[type="range"]::-moz-range-thumb {
  background: var(--primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow: 0 1px 5px rgba(24, 32, 29, 0.24);
  height: 20px;
  width: 20px;
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(47, 93, 80, 0.18), 0 1px 5px rgba(24, 32, 29, 0.24);
}

textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 116px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.full-width {
  width: 100%;
}

.app-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: 40px;
  padding: 20px 0 0;
}

.app-footer p {
  line-height: 1.5;
  margin: 0;
  max-width: 68ch;
}

.app-footer > div {
  align-items: flex-start;
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
}

.privacy-copy {
  display: grid;
  gap: 12px;
}

.privacy-copy p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 1000px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar > div,
  .topbar-actions {
    grid-column: 1;
  }

  .topbar-actions {
    justify-content: center;
  }

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

@media (max-width: 820px) {
  .profile-symbol-options {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
  }

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

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

@media (max-width: 620px) {
  body {
    padding-left: 52px;
  }

  .app-menu {
    padding-left: 4px;
    padding-right: 4px;
    width: 52px;
  }

  .app-menu[data-expanded="true"] {
    width: min(264px, calc(100vw - 12px));
  }

  .app-menu-header,
  .app-menu-nav {
    min-width: 256px;
  }

  .app-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 18px;
  }

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

  .topbar > div,
  .topbar-actions {
    grid-column: 1;
  }

  .topbar-actions {
    justify-content: center;
  }

  .auth-panel,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 0;
  }

  .profile-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-back-link {
    width: 100%;
  }

  .profile-avatar-preview {
    height: 128px;
    width: 128px;
  }

  .profile-avatar-preview img {
    height: 60px;
    width: 60px;
  }

  .profile-edit-dialog {
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin: auto 0 0;
    max-height: 90dvh;
    width: 100%;
  }

  .profile-edit-form {
    padding: 22px 18px;
  }

  .profile-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .today-panel,
  .progress-strip,
  .summary-panel,
  .section-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .summary-stats,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

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

  .day-card {
    padding: 8px;
  }

  .day-number {
    font-size: 1.35rem;
  }

  .dialog-body {
    padding: 28px 20px 22px;
  }

  .science-details {
    grid-template-columns: 1fr;
  }

  .science-panel {
    padding: 18px 16px;
  }

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

  .rating-button {
    min-height: 78px;
  }

  .rating-button span {
    min-height: auto;
  }

  .app-footer,
  .app-footer > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer > div {
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .profile-symbol-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calendar-grid {
    gap: 8px;
  }

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

  .rating-button:last-child {
    grid-column: 1 / -1;
  }

  .assessment-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .assessment-label output {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
