:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --card: #fffcf6;
  --card-2: #fbf6ec;
  --ink: #221f1a;
  --ink-soft: #615b50;
  --ink-faint: #948c7e;
  --line: #e4dac9;
  --line-strong: #d6c9b4;
  --accent: #d4552b;
  --accent-deep: #b4441f;
  --accent-soft: #f7e1d4;
  --sage: #4f7c68;
  --sage-soft: #e4eee6;
  --gold: #c08a2e;
  --gold-soft: #f5e9d2;
  --danger: #b23a2a;
  --danger-solid: #b23a2a;
  --danger-solid-hover: #962d20;
  --accent-ink: #fff;
  --check-ink: #fff;
  --streak-ink: #aa751d;
  --shadow-sm: 0 1px 2px rgba(50, 40, 25, 0.06);
  --shadow-md: 0 12px 30px -18px rgba(50, 40, 25, 0.35);
  --radius: 16px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-a: #f3ecdd;
  --sidebar-b: #eee5d4;
  --nav-hover: rgba(255, 252, 246, 0.6);
  --btn-light-bg: #fff7ec;
  --btn-light-hover: #ffefda;
  --btn-light-ink: #221f1a;
  --danger-soft: #fbeeeb;
  --danger-line: #e6c3bc;
  --dark-card-bg: #221f1a;
  --dark-card-ink: #f7f1e6;
  --dark-card-muted: #bdb3a3;
  --dark-card-line: #2e2a24;
  --toast-bg: #221f1a;
  --toast-ink: #f7f1e6;
  --toast-action: #f2b48f;
  --toast-action-hover: #ffd9c4;
  --overdue-bg: #f7e3df;
  --overdue-line: #efd0c9;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23615b50' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

:root[data-bg="sage"] {
  --paper: #eff3ea;
  --paper-2: #e6ece1;
  --card: #fcfff9;
  --card-2: #f5f9f2;
  --line: #dce5d6;
  --line-strong: #cbd7c3;
  --sidebar-a: #eaf0e5;
  --sidebar-b: #e1e9db;
}

:root[data-bg="rose"] {
  --paper: #f9efec;
  --paper-2: #f2e3df;
  --card: #fffaf8;
  --card-2: #fcf3ef;
  --line: #ecd8d3;
  --line-strong: #dfc8c2;
  --sidebar-a: #f6e9e5;
  --sidebar-b: #f0dfda;
}

:root[data-bg="slate"] {
  --paper: #eef1f4;
  --paper-2: #e5e9ed;
  --card: #fbfcfd;
  --card-2: #f4f6f8;
  --line: #dbe0e5;
  --line-strong: #cbd2d9;
  --sidebar-a: #e9edf1;
  --sidebar-b: #e1e6eb;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191714;
  --paper-2: #201d19;
  --card: #242019;
  --card-2: #2a251f;
  --ink: #f1eade;
  --ink-soft: #bdb3a3;
  --ink-faint: #8e8576;
  --line: #39332b;
  --line-strong: #4a4338;
  --accent: #e06a3d;
  --accent-deep: #c9542a;
  --accent-soft: #3a281f;
  --sage: #8bb9a2;
  --sage-soft: #22302a;
  --gold: #d9aa55;
  --gold-soft: #362d1d;
  --danger: #e07a67;
  --danger-solid: #b8503d;
  --danger-solid-hover: #c8604c;
  --accent-ink: #241a15;
  --check-ink: #14201a;
  --streak-ink: #e1b464;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 34px -18px rgba(0, 0, 0, 0.8);
  --sidebar-a: #211e19;
  --sidebar-b: #1b1915;
  --nav-hover: rgba(255, 255, 255, 0.055);
  --btn-light-bg: #f4e8d5;
  --btn-light-hover: #ecdcc3;
  --btn-light-ink: #221f1a;
  --danger-soft: #33211d;
  --danger-line: #57362e;
  --dark-card-bg: #2c2721;
  --dark-card-ink: #f6efe3;
  --dark-card-muted: #b5ab9b;
  --dark-card-line: #3c352c;
  --toast-bg: #f1eadd;
  --toast-ink: #221f1a;
  --toast-action: #b4441f;
  --toast-action-hover: #8f2f12;
  --overdue-bg: #3a221d;
  --overdue-line: #5d342a;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bcb3a4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

:root[data-theme="dark"][data-bg="sage"] {
  --paper: #161a16;
  --paper-2: #1b211b;
  --card: #1e2620;
  --card-2: #232c25;
  --line: #303b32;
  --line-strong: #3d4a3f;
  --sidebar-a: #1b211b;
  --sidebar-b: #171c17;
}

:root[data-theme="dark"][data-bg="rose"] {
  --paper: #1d1616;
  --paper-2: #241b1a;
  --card: #291f1d;
  --card-2: #2f2421;
  --line: #42322e;
  --line-strong: #523e39;
  --sidebar-a: #241b1a;
  --sidebar-b: #1e1716;
}

:root[data-theme="dark"][data-bg="slate"] {
  --paper: #16181c;
  --paper-2: #1c1f24;
  --card: #20242a;
  --card-2: #262b32;
  --line: #333942;
  --line-strong: #414955;
  --sidebar-a: #1c1f24;
  --sidebar-b: #171a1e;
}

:root[data-font="clean"] {
  --font-display: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-font="humanist"] {
  --font-display: "Trebuchet MS", Candara, "Segoe UI", sans-serif;
  --font-body: "Trebuchet MS", Candara, "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(224, 106, 61, 0.1), transparent 62%),
    radial-gradient(760px 540px at -12% 104%, rgba(139, 185, 162, 0.08), transparent 60%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(212, 85, 43, 0.075), transparent 62%),
    radial-gradient(760px 540px at -12% 104%, rgba(79, 124, 104, 0.07), transparent 60%);
}

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}

.skip-link:focus-visible {
  transform: none;
}

.main:focus {
  outline: none;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  max-width: 1560px;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 256px;
  flex: 0 0 256px;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sidebar-a), var(--sidebar-b));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: var(--accent);
  color: #fff6ea;
  display: grid;
  place-items: center;
  box-shadow: 0 7px 18px -9px rgba(180, 68, 31, 0.85);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.brand-tag {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-faint);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  margin: 0 12px 8px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  flex: none;
}

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

.nav-link.is-active {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.nav-link.is-active svg {
  color: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 8px;
}

.free-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.privacy {
  display: flex;
  gap: 7px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-faint);
}

.privacy svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 1px;
}

/* ---------- Layout & headers ---------- */

.main {
  flex: 1;
  min-width: 0;
  padding: 44px clamp(24px, 4vw, 60px) 80px;
}

.view {
  max-width: 1100px;
  margin: 0 auto;
  animation: viewIn 0.42s cubic-bezier(0.22, 0.75, 0.25, 1) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.lede {
  margin: 10px 0 0;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 15px;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Buttons & controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px -12px rgba(180, 68, 31, 0.9);
}

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

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-light {
  background: var(--btn-light-bg);
  color: var(--btn-light-ink);
}

.btn-light:hover {
  background: var(--btn-light-hover);
}

.btn-danger {
  background: var(--danger-solid);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-solid-hover);
}

.btn-sm {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary,
.btn-light {
  position: relative;
  overflow: hidden;
}

.btn-primary::after,
.btn-light::after {
  content: "";
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -72%;
  width: 46%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  opacity: 0;
  transform: skewX(-18deg) translateX(0);
  pointer-events: none;
}

.btn-light span[aria-hidden="true"] {
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.22, 0.75, 0.25, 1);
}

@media (hover: hover) {
  .btn-primary:hover,
  .btn-light:hover {
    transform: translateY(-1px);
  }

  .btn-primary:active,
  .btn-light:active {
    transform: translateY(0) scale(0.985);
  }

  .btn-primary:hover::after,
  .btn-light:hover::after {
    animation: btnSheen 0.62s cubic-bezier(0.22, 0.75, 0.25, 1);
  }

  .btn-light:hover span[aria-hidden="true"] {
    transform: translateX(4px);
  }
}

@keyframes btnSheen {
  0% {
    opacity: 0;
    transform: skewX(-18deg) translateX(0);
  }
  18% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: skewX(-18deg) translateX(390%);
  }
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-faint);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.icon-btn:hover {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.text-link {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.danger-link {
  color: var(--danger);
}

.danger-link:hover {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pill {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 16px;
}

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

.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.stat-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.stat-icon svg {
  width: 15px;
  height: 15px;
}

.stat:nth-child(2) .stat-icon {
  background: var(--sage-soft);
  color: var(--sage);
}

.stat:nth-child(3) .stat-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.stat:nth-child(4) .stat-icon {
  background: var(--paper-2);
  color: var(--ink-soft);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-of {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-faint);
  margin-left: 1px;
}

.stat-unit {
  margin-left: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-faint);
}

.stat-bar {
  height: 5px;
  margin-top: 3px;
  border-radius: 4px;
  background: var(--paper-2);
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.stat:nth-child(2) .stat-bar span {
  background: var(--sage);
}

.stat:nth-child(3) .stat-bar span {
  background: var(--gold);
}

.stat-foot {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.stat--plain {
  gap: 12px;
}

.insights-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

/* ---------- Today ---------- */

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.dark-card {
  position: relative;
  overflow: hidden;
  background: var(--dark-card-bg);
  color: var(--dark-card-ink);
  border-color: var(--dark-card-line);
}

.dark-card::after {
  content: "";
  position: absolute;
  top: -62px;
  right: -54px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 85, 43, 0.38), transparent 70%);
  pointer-events: none;
}

.dark-card .eyebrow {
  margin-bottom: 12px;
  color: var(--dark-card-muted);
}

.dark-card .eyebrow::before {
  background: var(--accent);
}

.focus-big {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
}

.focus-big strong {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.focus-big span {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dark-card-muted);
}

.dark-card p:not(.eyebrow) {
  margin: 8px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dark-card-muted);
}

.dark-card .btn {
  position: relative;
  z-index: 1;
  width: 100%;
}

.quick-habits {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-habit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: left;
  transition: background 0.15s ease;
}

.quick-habit:hover {
  background: var(--card-2);
}

.quick-habit-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-habit .check {
  cursor: pointer;
}

.quick-habit.is-done .quick-habit-name {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.quick-streak {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Task form */

.task-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.task-form input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--card-2);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.task-form input[type="text"]::placeholder {
  color: var(--ink-faint);
}

.task-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.task-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-form-row select {
  flex: 1;
  min-width: 0;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--card-2);
  color: var(--ink-soft);
  font-size: 13px;
  appearance: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.task-form-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.task-form-row .btn {
  flex: none;
}

/* Task list */

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 8px;
  border-top: 1px solid var(--line);
  transition: background 0.15s ease;
}

.task:first-child {
  border-top: 0;
}

.task:hover {
  background: var(--card-2);
  border-radius: 10px;
}

.check {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-grid;
  place-items: center;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.check:hover {
  border-color: var(--sage);
}

.check-sm {
  width: 20px;
  height: 20px;
}

.check-sm svg {
  width: 12px;
  height: 12px;
}

.task.is-done .check,
.quick-habit.is-done .check {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--check-ink);
}

.task.is-done .check svg,
.quick-habit.is-done .check svg {
  opacity: 1;
  transform: none;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.task.is-done .task-title {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(148, 140, 126, 0.6);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.chip-goal {
  border-color: transparent;
  background: var(--sage-soft);
  color: var(--sage);
}

.chip-high {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.task-del {
  opacity: 0;
  margin-top: -3px;
}

.task:hover .task-del,
.task-del:focus-visible {
  opacity: 1;
}

.list-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.empty {
  list-style: none;
  padding: 34px 20px 26px;
  text-align: center;
  color: var(--ink-faint);
}

.empty p {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-soft);
}

.empty span {
  display: block;
  max-width: 36ch;
  margin: 0 auto;
  font-size: 13.5px;
  line-height: 1.5;
}

.empty svg {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  color: var(--line-strong);
}

.empty-compact {
  padding: 24px 20px 18px;
}

.empty-compact p {
  font-size: 18px;
}

.mini-empty {
  margin: 0;
  padding: 10px 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-faint);
  list-style: none;
}

/* ---------- Goals ---------- */

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

.goal-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.goal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goal-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.goal-why {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.goal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.meta-chip svg {
  width: 12px;
  height: 12px;
}

.meta-chip.overdue {
  border-color: var(--overdue-line);
  background: var(--overdue-bg);
  color: var(--danger);
}

.goal-progress-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.progress {
  height: 8px;
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #e68a4d);
  transition: width 0.35s ease;
}

.progress.is-complete span {
  background: linear-gradient(90deg, var(--sage), #7ba58f);
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-faint);
}

.goal-steps {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.goal-steps h4 {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.milestone-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 13.5px;
}

.milestone > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.milestone.is-done > span {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.mini-check {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--card);
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mini-check svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.mini-check:hover {
  border-color: var(--sage);
}

.milestone.is-done .mini-check {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--check-ink);
}

.milestone.is-done .mini-check svg {
  opacity: 1;
  transform: none;
}

.milestone .icon-btn {
  width: 24px;
  height: 24px;
  opacity: 0;
}

.milestone:hover .icon-btn,
.milestone .icon-btn:focus-visible {
  opacity: 1;
}

.milestone-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.milestone-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
}

.milestone-form input:focus {
  outline: none;
  border-style: solid;
  border-color: var(--accent);
  background: var(--card);
}

.milestone-form .icon-btn {
  width: 30px;
  height: 30px;
  border-color: var(--line);
  background: var(--paper-2);
}

.empty-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 48px 24px;
  text-align: center;
}

.empty-card p {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink-soft);
}

.empty-card span {
  max-width: 44ch;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.empty-card .btn {
  margin-top: 18px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

/* ---------- Habits ---------- */

.habit-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.habit-add-card {
  padding: 16px 18px;
}

.habit-form {
  display: flex;
  gap: 10px;
}

.habit-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-2);
  font-size: 14px;
}

.habit-form input::placeholder {
  color: var(--ink-faint);
}

.habit-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.week-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.week-bar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.week-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.week-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.week-label {
  min-width: 152px;
  padding: 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.habit-scroll {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px 4px;
}

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

.habit-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.day-cells {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
}

.habit-row.habit-head {
  padding: 0 0 6px;
  border-top: 0;
}

.day-head {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.day-head strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.day-head.is-today {
  color: var(--accent);
}

.day-head.is-today strong {
  color: var(--accent);
}

.habit-name {
  position: relative;
  display: flex;
  flex: 0 0 32%;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  max-width: 360px;
  padding-right: 30px;
}

.habit-title {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.streak svg {
  width: 12px;
  height: 12px;
}

.habit-del {
  position: absolute;
  top: -2px;
  right: 0;
  opacity: 0;
}

.habit-row:hover .habit-del,
.habit-del:focus-visible {
  opacity: 1;
}

.day-cell {
  display: flex;
  justify-content: center;
}

.day-dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.day-dot svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.day-dot:hover:not(:disabled) {
  border-color: var(--sage);
  background: var(--sage-soft);
}

.day-dot.is-done {
  border-color: var(--sage);
  background: var(--sage);
  color: var(--check-ink);
}

.day-dot.is-done svg {
  opacity: 1;
  transform: none;
}

.day-dot.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--accent-soft);
}

.day-dot.is-today.is-done {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--sage-soft);
}

.day-dot:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.habit-empty {
  padding: 34px 20px 26px;
  text-align: center;
  color: var(--ink-faint);
}

.habit-empty .empty-icon {
  margin: 0 auto 12px;
}

.habit-empty p {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-soft);
}

.habit-empty span {
  font-size: 13.5px;
}

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

.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 24px 26px;
}

.mode-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}

.mode-tabs button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-tabs button:hover {
  color: var(--ink);
}

.mode-tabs button.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.timer-wrap {
  position: relative;
  width: 270px;
  height: 270px;
  max-width: 100%;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--paper-2);
  stroke-width: 10;
}

.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s ease;
}

.timer-card[data-mode="short"] .ring-progress,
.timer-card[data-mode="long"] .ring-progress {
  stroke: var(--sage);
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.timer-time {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.timer-mode {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.timer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.focus-task {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 340px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.focus-task select {
  width: 100%;
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--card-2);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  appearance: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.focus-task select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.focus-task select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--paper-2);
}

.focus-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 4px;
}

.focus-total strong {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.focus-total span {
  font-size: 12px;
  color: var(--ink-faint);
}

.session-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

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

.session-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.session-main strong {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-main span {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.session-mins {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tip-card {
  background: var(--card-2);
}

.tip-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.tip-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- Insights ---------- */

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.chart-card {
  padding: 18px;
  min-width: 0;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.chart-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chart-head span {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  height: 160px;
  padding-top: 4px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.bar-value {
  height: 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 33.333%;
  background-position: bottom;
}

.bar-fill {
  width: 100%;
  border-radius: 5px 5px 2px 2px;
  background: var(--accent);
  transition: height 0.4s ease;
}

.bar-fill.sage {
  background: var(--sage);
}

.bar-fill.gold {
  background: var(--gold);
}

.bar-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.bar-label em {
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.bar-col.is-today .bar-label,
.bar-col.is-today .bar-label em {
  color: var(--accent);
}

.bar-col.is-today .bar-label {
  font-weight: 700;
}

.summary-card {
  margin-bottom: 18px;
}

.summary-card p {
  margin: 0;
  max-width: 72ch;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.summary-card strong {
  color: var(--accent);
  font-weight: 600;
}

.data-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.data-card h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.data-card p {
  margin: 0;
  max-width: 52ch;
  font-size: 13px;
  color: var(--ink-faint);
}

.data-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Dialogs & toasts ---------- */

dialog.sheet {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(40, 30, 20, 0.5);
}

dialog.sheet::backdrop {
  background: rgba(34, 31, 26, 0.38);
  backdrop-filter: blur(3px);
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-hint {
  font-weight: 500;
  color: var(--ink-faint);
}

.field input,
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-2);
  font-size: 14px;
  font-weight: 400;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sheet-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 8px;
}

.sheet-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px 24px;
}

#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 360px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-size: 13px;
  pointer-events: auto;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease both;
}

.toast-text {
  flex: 1;
  min-width: 0;
}

.toast-action {
  flex: none;
  padding: 3px 2px;
  border: 0;
  background: none;
  color: var(--toast-action);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toast-action:hover {
  color: var(--toast-action-hover);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.boot-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Accounts ---------- */

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.account-chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.account-chip:active {
  transform: translateY(0);
}

.account-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.account-avatar svg {
  width: 17px;
  height: 17px;
}

.account-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-chip.is-signed-in .account-avatar {
  background: var(--accent);
  color: var(--accent-ink);
}

.account-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.account-copy strong,
.account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.account-copy span {
  font-size: 11px;
  color: var(--ink-faint);
}

.account-chip.is-admin #accountSub {
  color: var(--accent-deep);
  font-weight: 600;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.7;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.account-chevron {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--ink-faint);
}

.account-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
  box-shadow: 0 9px 22px -12px rgba(212, 85, 43, 0.9);
}

.avatar-editor {
  position: relative;
  flex: none;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: none;
  color: inherit;
  cursor: pointer;
}

.avatar-editor:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.avatar-editor:hover .account-avatar-lg {
  filter: brightness(1.05);
}

.avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
}

.avatar-edit svg {
  width: 10px;
  height: 10px;
}

dialog.sheet.auth-sheet {
  width: min(432px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.auth-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px 24px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-emblem {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff6ea;
  box-shadow: 0 8px 20px -10px rgba(212, 85, 43, 0.85);
}

.auth-emblem svg {
  width: 22px;
  height: 22px;
}

.auth-wrap h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.auth-intro {
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
}

.auth-tabs button {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tabs button:hover {
  color: var(--ink);
}

.auth-tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form[hidden],
.form-error[hidden] {
  display: none;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px 16px;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  width: 100%;
  padding-right: 60px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--paper-2);
  color: var(--ink-soft);
}

.form-error {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--danger-line);
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.45;
}

.auth-note,
.account-note {
  margin: 2px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.55;
}

dialog.sheet.account-sheet {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.account-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.account-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-identity {
  flex: 1;
  min-width: 0;
}

.account-identity h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-identity p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
}

.account-since {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
}

.account-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
}

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

.account-stats strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
}

.account-stats span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.settings-block {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-block h3 {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.profile-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

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

.profile-form input {
  width: 100%;
}

.profile-photo-row {
  padding-top: 2px;
}

.photo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.setting-row-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.setting-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.setting-copy strong {
  font-size: 13.5px;
  font-weight: 600;
}

.setting-copy span {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.segmented button {
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.swatches {
  display: flex;
  gap: 9px;
}

.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--sw-light);
  box-shadow: inset 0 0 0 1px rgba(120, 100, 75, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.swatch::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sw-dark);
  box-shadow: 0 0 0 2px var(--sw-light);
}

.swatch:hover {
  transform: translateY(-1px) scale(1.04);
}

.swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.swatch-warm {
  --sw-light: #f6f1e7;
  --sw-dark: #1a1815;
}

.swatch-sage {
  --sw-light: #eff3ea;
  --sw-dark: #161a16;
}

.swatch-rose {
  --sw-light: #f9efec;
  --sw-dark: #1d1616;
}

.swatch-slate {
  --sw-light: #eef1f4;
  --sw-dark: #16181c;
}

.font-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.font-options button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.font-options button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.font-options button.is-active {
  border-color: var(--accent);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.font-sample {
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.1;
}

.font-sample-editorial {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.font-sample-clean {
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

.font-sample-humanist {
  font-family: "Trebuchet MS", Candara, "Segoe UI", sans-serif;
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-actions .btn {
  flex: 1;
}

.account-note {
  margin: 0;
}

dialog.sheet.admin-sheet {
  width: min(600px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.admin-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.admin-avatar svg {
  width: 24px;
  height: 24px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-row:hover {
  border-color: var(--line-strong);
}

.admin-row.is-owner {
  background: var(--card-2);
}

.admin-row .account-avatar {
  width: 34px;
  height: 34px;
  font-size: 12.5px;
}

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

.admin-copy strong {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.admin-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-email {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-meta {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.45;
}

.admin-row .btn {
  flex: none;
}

.role-tag.is-you {
  border-color: var(--sage);
  background: var(--sage-soft);
  color: var(--streak-ink, var(--sage));
}

.admin-empty {
  padding: 24px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-faint);
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 920px) {
  .sidebar-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .account-chip {
    width: auto;
    max-width: 55%;
    padding: 5px 8px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .account-chip:hover {
    background: var(--nav-hover);
    box-shadow: none;
    transform: none;
  }

  .account-chevron {
    display: none;
  }

  .account-copy strong {
    font-size: 12.5px;
  }

  .account-copy span {
    font-size: 10.5px;
  }
}

@media (max-width: 680px) {
  .account-copy span {
    display: none;
  }

  .account-avatar {
    width: 29px;
    height: 29px;
  }

  .account-avatar.account-avatar-lg {
    width: 44px;
    height: 44px;
  }

  .auth-wrap,
  .account-wrap,
  .admin-wrap {
    padding: 20px 18px 22px;
  }

  .account-actions .btn {
    flex: 1 1 100%;
  }

  .account-stats strong {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .font-options {
    grid-template-columns: 1fr 1fr;
  }

  .admin-row {
    flex-wrap: wrap;
  }

  .admin-row .btn {
    width: 100%;
  }

  .font-options button:last-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}

/* ---------- Motion language ---------- */

.spark-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  overflow: hidden;
  pointer-events: none;
}

.ember {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff1c9, #f08a44 55%, rgba(212, 85, 43, 0) 74%);
  transform: translate3d(var(--x), var(--y), 0);
  animation: emberFly var(--dur) cubic-bezier(0.16, 0.7, 0.3, 1) var(--delay) both;
}

.spark-layer.is-gold .ember {
  background: radial-gradient(circle at 35% 35%, #fff8dc, #e4b455 55%, rgba(192, 138, 46, 0) 74%);
}

@keyframes emberFly {
  0% {
    opacity: 0;
    transform: translate3d(var(--x), var(--y), 0) scale(0.35);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy)), 0) scale(0.08);
  }
}

.tap-ripple {
  position: fixed;
  z-index: 96;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 1.5px solid var(--sage);
  border-radius: 50%;
  pointer-events: none;
  animation: rippleOut 0.68s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.tap-ripple.is-gold {
  border-color: var(--gold);
}

@keyframes rippleOut {
  0% {
    opacity: 0.7;
    transform: scale(0.35);
  }
  100% {
    opacity: 0;
    transform: scale(3.1);
  }
}

.check.is-fresh,
.mini-check.is-fresh,
.day-dot.is-fresh {
  animation: checkPop 0.5s cubic-bezier(0.2, 1.2, 0.35, 1) both;
}

.check.is-fresh svg,
.mini-check.is-fresh svg,
.day-dot.is-fresh svg {
  stroke-dasharray: 20;
  animation: checkDraw 0.46s ease-out 0.04s both;
}

@keyframes checkPop {
  0% {
    transform: scale(0.74);
  }
  45% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkDraw {
  0% {
    stroke-dashoffset: 20;
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.goal-card.is-sealed {
  animation: goalSeal 1.4s cubic-bezier(0.22, 0.75, 0.25, 1);
}

.goal-card.is-sealed .progress.is-complete span {
  animation: completeGlow 1.3s ease-out;
}

@keyframes goalSeal {
  0% {
    box-shadow: var(--shadow-sm);
  }
  30% {
    box-shadow: 0 0 0 1px rgba(192, 138, 46, 0.5), 0 20px 46px -22px rgba(192, 138, 46, 0.65);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}

@keyframes completeGlow {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(79, 124, 104, 0);
  }
  35% {
    filter: brightness(1.18);
    box-shadow: 0 0 14px rgba(79, 124, 104, 0.55);
  }
  100% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(79, 124, 104, 0);
  }
}

.streak.is-lit {
  color: var(--streak-ink);
}

.streak.is-lit svg {
  transform-origin: 50% 82%;
  animation: flameBreathe 2.6s ease-in-out infinite;
}

@keyframes flameBreathe {
  0%,
  100% {
    opacity: 0.9;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px) scale(1.12);
  }
}

.timer-wrap::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 85, 43, 0.16), transparent 68%);
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  transition: opacity 0.55s ease;
}

.timer-card[data-running="true"] .timer-wrap::before {
  opacity: 1;
  animation: focusBreath 5.6s ease-in-out infinite;
}

.timer-card[data-running="true"][data-mode="short"] .timer-wrap::before,
.timer-card[data-running="true"][data-mode="long"] .timer-wrap::before {
  background: radial-gradient(circle, rgba(79, 124, 104, 0.2), transparent 68%);
}

@keyframes focusBreath {
  0%,
  100% {
    opacity: 0.32;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.78;
    transform: scale(1.035);
  }
}

.timer-card.is-finished {
  animation: timerFinish 1.35s cubic-bezier(0.22, 0.75, 0.25, 1);
}

.timer-card.is-finished .timer-wrap {
  animation: ringNudge 1.1s cubic-bezier(0.22, 0.75, 0.25, 1);
}

@keyframes timerFinish {
  0% {
    box-shadow: var(--shadow-sm);
  }
  30% {
    box-shadow: 0 0 0 7px rgba(212, 85, 43, 0.07), 0 22px 50px -24px rgba(212, 85, 43, 0.5);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}

@keyframes ringNudge {
  0% {
    transform: scale(1);
  }
  32% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

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

@media (hover: none) {
  .task-del,
  .habit-del,
  .milestone .icon-btn {
    opacity: 0.7;
  }
}

@media (max-width: 1120px) {
  .today-grid,
  .focus-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 920px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    flex: none;
    gap: 14px;
    padding: 16px 18px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 0 2px;
  }

  .brand-tag {
    display: none;
  }

  .nav {
    flex-direction: row;
    gap: 4px;
    margin: 0 -4px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .nav-link {
    flex: none;
    padding: 8px 12px;
    font-size: 13.5px;
  }

  .nav-link svg {
    width: 17px;
    height: 17px;
  }

  .main {
    padding: 28px 22px 60px;
  }

  .view-head {
    margin-bottom: 20px;
  }

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

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

@media (max-width: 680px) {
  .main {
    padding: 22px 16px 52px;
  }

  .sidebar {
    padding: 14px 14px 10px;
  }

  .nav {
    gap: 2px;
    overflow: visible;
    margin: 0;
  }

  .nav-link {
    flex: 1 1 0;
    justify-content: center;
    gap: 0;
    padding: 9px 2px;
    font-size: 12.5px;
  }

  .nav-link svg {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 21px;
    height: 21px;
  }

  .brand-name {
    font-size: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .lede {
    font-size: 14px;
  }

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 14px;
  }

  .stat-value {
    font-size: 28px;
  }

  .stat:nth-child(3) {
    grid-column: 1 / -1;
  }

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

  .insights-stats .stat:nth-child(3),
  .insights-stats .stat:nth-child(4) {
    grid-column: auto;
  }

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

  .task-form-row {
    flex-wrap: wrap;
  }

  .task-form-row select {
    flex: 1 1 42%;
  }

  .task-form-row .btn {
    width: 100%;
  }

  .habit-form {
    flex-direction: column;
  }

  .habit-scroll {
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .habit-head .habit-name {
    display: none;
  }

  .habit-row:not(.habit-head) {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 12px 0;
  }

  .habit-row:not(.habit-head) .habit-name {
    flex: none;
    width: 100%;
    max-width: none;
  }

  .day-cells {
    gap: 2px;
  }

  .day-dot {
    width: 30px;
    height: 30px;
  }

  .week-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .timer-wrap {
    width: 235px;
    height: 235px;
  }

  .timer-time {
    font-size: 48px;
  }

  .mode-tabs button {
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .timer-card {
    padding: 22px 16px;
  }

  .chart-grid {
    gap: 12px;
  }

  .bar-chart {
    gap: 6px;
  }

  .data-card {
    align-items: flex-start;
  }

  .data-actions {
    width: 100%;
  }

  .data-actions .btn {
    flex: 1;
  }

  #toasts {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .toast {
    max-width: none;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .timer-wrap::before,
  .streak.is-lit svg {
    animation: none !important;
  }

  .timer-card[data-running="true"] .timer-wrap::before {
    opacity: 0.45;
  }

  .btn-primary::after,
  .btn-light::after {
    display: none;
  }
}
