/* LIFEFLOW – Light, minimal GUI preset
   Palette: soft creams, pale sage, light warm grays, whites. No dark colors. */

:root {
  --cream: #faf8f5;
  --cream-dark: #f5f0e8;
  --sage: #9caf88;
  --sage-soft: #b8c9a8;
  --sage-pale: #e8efe3;
  --warm-gray: #a39e96;
  --warm-gray-light: #d4cfc7;
  --warm-gray-pale: #ebe8e4;
  --white: #ffffff;
  --text: #5c564d;
  --text-soft: #7a7369;
  --accent: #9caf88;
  --accent-soft: #e8efe3;
  --border: rgba(156, 175, 136, 0.25);
  --shadow: 0 2px 12px rgba(92, 86, 77, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --paper: #fdfcfa;
  --gold-pale: #e8dfd0;
  --gold-muted: #c9b896;
  --font-serif: Georgia, "Times New Roman", Cambria, serif;
}

/* Privacy blur – sensitive data until hover/tap (Settings → Privacy blur) */
body.privacy-blur-on [data-privacy-blur] {
  filter: blur(8px);
  transition: filter 0.3s ease;
  cursor: pointer;
  user-select: none;
}
body.privacy-blur-on [data-privacy-blur]:hover,
body.privacy-blur-on [data-privacy-blur]:active,
body.privacy-blur-on [data-privacy-blur]:focus {
  filter: blur(0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.5;
}

/* Toast & banner */
.saved-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--sage);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.saved-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.save-error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #c17a6b;
  color: var(--white);
  padding: 10px 16px;
  font-size: 0.85rem;
  text-align: center;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  cursor: pointer;
  pointer-events: none;
}

.save-error-banner.show {
  transform: translateY(0);
  pointer-events: auto;
}

/* Top navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 16px 32px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 50;
  overflow: visible;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
}
.nav-toggle:hover {
  background: var(--warm-gray-pale);
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.top-nav.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.top-nav.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.top-nav.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--text);
  background: var(--sage-pale);
}

.nav-link.active {
  color: var(--sage);
  background: var(--accent-soft);
}

.nav-search-wrap {
  flex-shrink: 0;
}

.nav-search {
  width: 180px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--warm-gray-pale);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}

.nav-search::placeholder {
  color: var(--warm-gray);
}

.nav-search:focus {
  border-color: var(--sage-soft);
}

/* Utility menu: hamburger + dropdown */
.nav-utility-wrap {
  position: relative;
  overflow: visible;
}
.top-nav-flow .nav-menu-utility,
#nav-menu.nav-menu-utility {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 10px 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 32px rgba(0,0,0,0.12);
  transform: translateY(-4px);
  transition: transform 0.2s ease;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
#nav-menu.nav-menu-utility.is-open,
.top-nav.nav-open .nav-menu-utility {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0);
}
.top-nav-flow .nav-menu-utility .nav-link {
  display: block;
  padding: 12px 16px;
  border-radius: 0;
  border-bottom: none;
  font-size: 0.85rem;
}
.top-nav-flow .nav-menu-utility .nav-link:hover {
  background: var(--sage-pale);
}
.top-nav-flow .nav-menu-utility .nav-link:last-child {
  border-bottom: none;
}

/* Main content – extra padding for fixed bottom nav */
.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  padding-bottom: max(64px, calc(64px + env(safe-area-inset-bottom)) + 72px);
}
.site-footer {
  margin-bottom: max(0, env(safe-area-inset-bottom) + 72px);
}

/* Hero – Today landing */
.hero-today .hero-headline {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0.25rem;
}
.hero-subline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-soft);
  font-weight: 400;
}

/* Activity feed – hybrid scroll (Today tab, below dashboard cards) */
.activity-feed-wrap {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.activity-feed-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 0 0 1rem;
}
.activity-feed-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.activity-feed-date-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.5rem 0;
  margin: 0.75rem 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  background: var(--cream);
}
.activity-feed-date-header:first-child {
  margin-top: 0;
}
.activity-feed-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.activity-feed-card:hover {
  box-shadow: 0 4px 16px rgba(92, 86, 77, 0.08);
}
.activity-feed-card-meta {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--text-soft);
  white-space: nowrap;
}
.activity-feed-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.activity-feed-card-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.activity-feed-card-detail {
  font-size: 0.8rem;
  color: var(--text-soft);
}
.activity-feed-card--finance .activity-feed-card-detail {
  color: var(--sage);
  font-weight: 500;
}
.activity-feed-card--person .activity-feed-card-main {
  border-left: 3px solid var(--sage-soft);
  padding-left: 0.5rem;
}
.activity-feed-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0;
}
.activity-feed-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.activity-feed-skeleton.hidden {
  display: none;
}
.skeleton-card {
  height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--warm-gray-pale) 25%, var(--warm-gray-light) 50%, var(--warm-gray-pale) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.feed-load-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}

/* Bottom navigation – flow-state (PWA); scrolls behind with depth */
.flow-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0;
  padding: 0 12px max(12px, env(safe-area-inset-bottom)) 12px;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 100;
  min-height: 56px;
}
.flow-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s;
  min-height: 48px;
}
.flow-nav-item:hover,
.flow-nav-item[aria-current="true"] {
  color: var(--sage);
}
.flow-nav-item[aria-current="true"] {
  color: var(--sage);
}
.flow-nav-label {
  white-space: nowrap;
}
.flow-nav-action {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  margin-top: -24px;
  margin-bottom: max(0, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sage);
  color: var(--white);
  border: 4px solid var(--cream);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(92, 86, 77, 0.15);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.flow-nav-action:hover {
  background: var(--sage-soft);
  transform: scale(1.05);
}
.flow-nav-plus {
  width: 24px;
  height: 24px;
}
.quick-log-overlay {
  position: fixed;
  inset: 0;
  background: rgba(92, 86, 77, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.quick-log-overlay.hidden {
  display: none;
}
.quick-log-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(92, 86, 77, 0.2);
  max-width: 380px;
  width: 100%;
  padding: 1.75rem;
  position: relative;
}
.quick-log-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.quick-log-hint {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.quick-log-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.quick-log-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--sage-pale);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}
.quick-log-opt:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
}
.quick-log-opt-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
}
.quick-log-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--warm-gray-pale);
}
.quick-log-form.hidden {
  display: none;
}
.quick-log-form-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.quick-log-habit-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.quick-log-habit-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.quick-log-habit-list input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
}
.quick-log-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.quick-log-form input,
.quick-log-form select {
  width: 100%;
  padding: 8px 12px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.quick-log-form .gui-btn {
  margin-top: 0.5rem;
}
.quick-log-empty {
  color: var(--text-soft);
  font-size: 0.9rem;
  padding: 8px 0;
}
.quick-log-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-soft);
  cursor: pointer;
  line-height: 1;
}
.quick-log-close:hover {
  color: var(--text);
}

/* Main content */

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Hero headline */
.hero {
  margin-bottom: 48px;
  text-align: center;
}

.hero-headline {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* Today: Focus Sphere + Energy & Focus side by side */
.today-focus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  justify-content: center;
}
.today-focus-row .focus-sphere-wrap {
  flex: 0 1 auto;
}
.today-focus-row .snapshot-energy--today {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 340px;
}

/* Focus Sphere – Deep Work Timer (Visual Commitment card) */
.focus-sphere-wrap {
  margin-bottom: 0;
  max-width: 420px;
}
.focus-sphere-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 2px 12px rgba(92, 86, 77, 0.06);
}
.focus-sphere-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.focus-sphere-view.hidden {
  display: none;
}
.focus-sphere-circle {
  --focus-size: 200px;
  width: var(--focus-size);
  height: var(--focus-size);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.focus-sphere-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.focus-sphere-circle .focus-sphere-sweep {
  transition: stroke-dasharray 0.5s linear;
}
.focus-sphere-bg {
  transition: fill 0.3s ease;
}
.focus-sphere-bg--solid {
  fill: #7d9369;
}
.focus-sphere-time {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.focus-sphere-time--dim {
  color: var(--text-soft);
  opacity: 0.85;
}
.focus-sphere-time--white {
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
/* Running: slow pulse (4s breath) */
.focus-sphere-circle--running {
  animation: focus-sphere-pulse 4s ease-in-out infinite;
}
@keyframes focus-sphere-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.92; transform: scale(0.98); }
}
/* Paused: soft grey */
.focus-sphere-circle--paused .focus-sphere-bg {
  fill: var(--warm-gray-pale);
}
/* Celebration: pulse-and-bloom */
.focus-sphere-circle--celebrate .focus-sphere-bg {
  fill: #7d9369;
}
.focus-sphere-circle--bloom {
  animation: focus-sphere-bloom 2s ease-out forwards;
}
@keyframes focus-sphere-bloom {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(125, 147, 105, 0.4); }
  40% { transform: scale(1.08); opacity: 1; box-shadow: 0 0 0 20px rgba(125, 147, 105, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(125, 147, 105, 0); }
}
/* Ocean wave text for objective when running */
.focus-sphere-objective--wave {
  font-size: 0.95rem;
  color: var(--text-soft);
  font-weight: 500;
  max-width: 280px;
  animation: focus-text-wave 3s ease-in-out infinite;
}
.focus-sphere-objective--dim {
  font-size: 0.9rem;
  color: var(--text-soft);
  opacity: 0.8;
  max-width: 280px;
}
@keyframes focus-text-wave {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}
.focus-sphere-hint {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 0;
}
.focus-sphere-objective-input {
  width: 100%;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--white);
  color: var(--text);
}
.focus-sphere-objective-input::placeholder {
  color: var(--text-soft);
  opacity: 0.8;
}
.focus-sphere-duration-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.focus-sphere-duration-label {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0;
}
.focus-sphere-duration-select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--white);
  color: var(--text);
}
.focus-sphere-btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.focus-sphere-btn--start,
.focus-sphere-btn--primary {
  background: var(--sage);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(156, 175, 136, 0.35);
}
.focus-sphere-btn--start:hover,
.focus-sphere-btn--primary:hover {
  background: var(--sage-strong);
  box-shadow: 0 2px 10px rgba(156, 175, 136, 0.45);
}
.focus-sphere-btn--pause {
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--border);
}
.focus-sphere-btn--pause:hover {
  background: var(--warm-gray-pale);
}
.focus-sphere-btn--reset {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.focus-sphere-btn--reset:hover {
  color: var(--text);
  background: var(--warm-gray-pale);
}
.focus-sphere-btn--outline {
  background: transparent;
  color: var(--sage);
  border: 1px solid var(--sage-soft);
}
.focus-sphere-btn--outline:hover {
  background: var(--sage-pale);
  color: var(--sage-strong);
}
.focus-sphere-report-content {
  padding: 0.5rem 0;
}
.focus-sphere-report-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.35rem;
}
.focus-sphere-report-message {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin: 0 0 1.25rem;
  line-height: 1.4;
}
.focus-sphere-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (max-width: 480px) {
  .focus-sphere-wrap {
    margin-bottom: 1.25rem;
    padding-left: 0;
    padding-right: 0;
  }
  .focus-sphere-card {
    padding: 1.25rem 1rem;
  }
  .focus-sphere-circle {
    --focus-size: 180px;
  }
  .focus-sphere-time {
    font-size: 1.75rem;
  }
  .focus-sphere-btn {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
  }
}

/* Dashboard cards: four equal columns, aligned row */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}
.dashboard-cards .gui-card {
  min-height: 280px;
}

.gui-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gui-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: var(--warm-gray-pale);
  border-bottom: 1px solid var(--border);
}
.gui-card-header-title {
  min-width: 0;
}
.gui-card-add {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.gui-card-add:hover {
  color: var(--sage);
  border-color: var(--sage-soft);
  background: var(--sage-pale);
}

.gui-card-body {
  padding: 20px 18px;
  flex: 1;
  position: relative;
}

/* Card 1: Habit Tracker */
.habit-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.habit-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text);
}

.habit-checklist input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--warm-gray-light);
  accent-color: var(--sage);
  cursor: pointer;
}

.habit-checklist-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.habit-add-prompt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  color: var(--sage);
  text-decoration: none;
  border: 1px dashed var(--sage-soft);
  border-radius: var(--radius-sm);
  background: var(--sage-pale);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.habit-add-prompt:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--text);
}

/* Daily Insight widget inside Habit Tracker card (dashboard home) */
.dashboard-daily-insight-widget {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--sage-pale);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dashboard-daily-insight-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}
.dashboard-daily-insight-text {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}
.dashboard-daily-insight-text.dashboard-daily-insight-empty {
  color: var(--text-soft);
  font-style: italic;
}
.dashboard-daily-insight-edit {
  font-size: 0.8rem;
  color: var(--sage);
  text-decoration: none;
}
.dashboard-daily-insight-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.dashboard-daily-insight-ai-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--sage);
  cursor: pointer;
  font-family: inherit;
}
.dashboard-daily-insight-ai-btn:hover {
  text-decoration: underline;
}
.dashboard-daily-insight-ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.dashboard-daily-insight-edit:hover {
  text-decoration: underline;
}

.habit-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--sage-soft);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
}

/* Daily Snapshot */
.daily-snapshot-wrap {
  max-width: 900px;
}
.snapshot-north-star {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 0 1.5rem;
  font-weight: 500;
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.snapshot-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.snapshot-card-header {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: var(--warm-gray-pale);
  border-bottom: 1px solid var(--border);
}
.snapshot-card-body {
  padding: 1.25rem;
}
.snapshot-insight-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.snapshot-ai-btn {
  font-size: 0.85rem;
}
.snapshot-insight-ai-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
}
.snapshot-energy .snapshot-card-body,
.snapshot-deepwork .snapshot-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
/* Energy & Focus card – warmer, more inviting */
.snapshot-energy {
  background: linear-gradient(160deg, var(--white) 0%, var(--sage-pale) 100%);
  border-color: var(--sage-soft);
  box-shadow: 0 2px 12px rgba(156, 175, 136, 0.15);
}
.snapshot-energy .snapshot-card-header {
  background: linear-gradient(90deg, var(--sage-pale) 0%, var(--white) 100%);
  color: var(--sage);
  font-weight: 700;
}
.energy-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.energy-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.energy-slider {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #d4a574 0%, #e8c9a0 35%, var(--sage-soft) 70%, var(--sage) 100%);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.energy-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sage) 0%, #7d9369 100%);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(156, 175, 136, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.energy-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(156, 175, 136, 0.55);
}
.energy-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sage) 0%, #7d9369 100%);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(156, 175, 136, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.energy-slider::-moz-range-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(156, 175, 136, 0.55);
}
.energy-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sage);
  letter-spacing: 0.02em;
}
.energy-quote {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-soft);
  font-style: italic;
  min-height: 2.8em;
}
.energy-trend-wrap {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(156, 175, 136, 0.2);
}
.energy-trend-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
  letter-spacing: 0.03em;
}
.energy-trend-chart {
  height: 28px;
  width: 100%;
}
.energy-trend-svg {
  width: 100%;
  height: 100%;
  color: var(--sage-soft);
}
.energy-trend-line {
  stroke: var(--sage);
  stroke-width: 2;
  filter: drop-shadow(0 1px 1px rgba(156, 175, 136, 0.3));
}

/* Deep Work card – clear focus, progress feel */
.snapshot-deepwork {
  background: linear-gradient(160deg, var(--white) 0%, rgba(232, 239, 227, 0.6) 100%);
  border-color: var(--sage-soft);
  box-shadow: 0 2px 12px rgba(156, 175, 136, 0.12);
}
.snapshot-deepwork .snapshot-card-header {
  background: linear-gradient(90deg, var(--sage-pale) 0%, var(--white) 100%);
  color: var(--sage);
  font-weight: 700;
}
.deepwork-ring-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.deepwork-ring {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(156, 175, 136, 0.25));
}
.deepwork-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.deepwork-ring-bg {
  fill: none;
  stroke: var(--sage-pale);
  stroke-width: 4;
}
.deepwork-ring-fill {
  fill: none;
  stroke: url(#deepwork-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s ease;
  filter: drop-shadow(0 0 6px rgba(156, 175, 136, 0.35));
}
.deepwork-values {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.deepwork-sep,
.deepwork-unit {
  font-weight: 400;
  color: var(--text-soft);
  font-size: 1rem;
}
.snapshot-input-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}
.snapshot-input-num {
  width: 80px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.snapshot-target-label {
  margin-top: 0.5rem;
}
.snapshot-insight-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 72px;
}
/* Consistency – one card per habit, Week / Month / Year heatmap */
.habit-heatmap-card .snapshot-card-body.habit-consistency-body {
  padding: 1rem 1.25rem;
}
.habit-heatmap-range-selector {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--warm-gray-pale);
  border-radius: var(--radius);
  width: fit-content;
}
.habit-heatmap-range-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.habit-heatmap-range-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}
.habit-heatmap-range-btn.active {
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.habit-consistency-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.habit-consistency-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(92, 86, 77, 0.06);
}
.habit-consistency-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.habit-consistency-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.habit-consistency-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.habit-consistency-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.habit-consistency-subtitle {
  font-size: 0.72rem;
  color: var(--text-soft);
}
.habit-consistency-meta {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}
.habit-consistency-streak {
  white-space: nowrap;
}
.habit-consistency-days {
  color: var(--text-soft);
  opacity: 0.9;
}
.habit-consistency-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}
.habit-consistency-icon {
  padding: 0.25rem;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.65;
  border-radius: 4px;
}
.habit-consistency-icon:hover {
  opacity: 1;
  background: var(--warm-gray-pale);
}
.habit-consistency-icon-delete:hover {
  background: rgba(200, 80, 80, 0.12);
}

/* Heatmap area: Last 365 days + month row + legend, then day labels + grid */
.habit-consistency-heat-wrap {
  --cell-size: 8px;
  --gap: 2px;
  --cols: 53;
}
.habit-consistency-top-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.habit-consistency-label {
  font-size: 0.72rem;
  color: var(--text-soft);
  flex-shrink: 0;
  padding-top: 0.15rem;
}
.habit-consistency-top-spacer {
  width: 2rem;
  flex-shrink: 0;
}
.habit-consistency-month-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 53), var(--cell-size, 8px));
  gap: var(--gap, 2px);
  flex: 1;
  min-width: 0;
  max-width: calc((var(--cell-size, 8px) + var(--gap, 2px)) * var(--cols, 53) - var(--gap, 2px));
}
.habit-consistency-month {
  font-size: 0.65rem;
  color: var(--text-soft);
  grid-row: 1;
}
.habit-consistency-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  color: var(--text-soft);
  flex-shrink: 0;
}
.habit-consistency-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.habit-consistency-legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.habit-consistency-grid-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  overflow: hidden;
}
.habit-consistency-day-labels {
  display: grid;
  grid-template-rows: repeat(var(--rows, 7), calc(var(--cell-size, 8px) + var(--gap, 2px)));
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.habit-consistency-day-label {
  font-size: 0.6rem;
  color: var(--text-soft);
  line-height: calc(var(--cell-size, 8px) + var(--gap, 2px));
}
.habit-consistency-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 53), var(--cell-size, 8px));
  grid-template-rows: repeat(var(--rows, 7), var(--cell-size, 8px));
  gap: var(--gap, 2px);
  flex-shrink: 0;
}
.habit-consistency-cell {
  width: var(--cell-size, 8px);
  height: var(--cell-size, 8px);
  min-width: var(--cell-size, 8px);
  min-height: var(--cell-size, 8px);
  border-radius: 2px;
  background: var(--warm-gray-pale);
  transition: background 0.15s ease;
}
.habit-consistency-cell.empty {
  background: transparent;
}
.habit-consistency-cell.skip {
  background: var(--warm-gray-pale);
}
.habit-consistency-cell.done {
  /* background set inline via habit.color */
}
.habit-consistency-cell:hover:not(.empty) {
  filter: brightness(1.1);
}
.habit-heatmap-empty {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 0;
  padding: 0.5rem 0;
}

/* Habit form color dropdown */
.habit-color-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  min-width: 120px;
}
.habit-color-select option {
  background: var(--white);
}

/* Subtle Stats bar — debt data feed */
.subtle-stats-bar {
  display: block;
  padding: 8px 14px;
  background: var(--warm-gray-pale);
  border-bottom: 1px solid var(--warm-gray-light);
  margin-bottom: 1rem;
  transition: background 0.2s;
}
.subtle-stats-bar:hover {
  background: var(--cream-dark);
}
.subtle-stats-text {
  font-size: 0.8rem;
  color: var(--text-soft);
}
.subtle-stats-link {
  color: var(--text-soft);
  text-decoration: none;
}
.subtle-stats-link:hover {
  color: var(--sage);
  text-decoration: underline;
}
.subtle-stats-bar a {
  color: var(--sage);
  text-decoration: none;
}
.subtle-stats-bar a:hover {
  text-decoration: underline;
}
.subtle-stats-chart {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  margin-top: 0;
}
.subtle-stats-bar:hover .subtle-stats-chart {
  max-height: 56px;
  margin-top: 6px;
}
.subtle-stats-chart-empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-soft);
}
.subtle-stats-chart-svg {
  width: 100%;
  max-width: 220px;
  height: 44px;
  display: block;
  color: var(--sage-soft);
}
.subtle-stats-trend-line {
  stroke: var(--sage);
}

.card-decoration {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 64px;
  height: 64px;
  color: var(--sage);
  opacity: 0.4;
  pointer-events: none;
}

.card-decoration svg {
  width: 100%;
  height: 100%;
}

.card-floral {
  width: 72px;
  height: 72px;
}

/* Card 2: Financial */
.finance-total {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--text);
}

.finance-total strong {
  color: var(--text);
}

.finance-progress-wrap {
  margin-bottom: 16px;
}

.finance-row {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.progress-bar {
  height: 8px;
  background: var(--warm-gray-pale);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-sm {
  height: 5px;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--sage);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.finance-block {
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.finance-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.finance-block-head .finance-block-title {
  margin: 0;
}
.finance-block-add {
  width: 24px;
  height: 24px;
  font-size: 1.1rem;
}
.finance-block-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}
.finance-block-head + .goals-preview-list,
.finance-block-head + .debt-list {
  margin-top: 0;
}

.goals-preview-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}
.goals-preview-empty-item,
.debt-list-empty-item,
.appointments-preview-empty-item {
  font-size: 0.85rem;
  color: var(--text-soft);
  padding: 6px 0;
}

.goal-preview-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.goal-preview-item:last-child {
  border-bottom: none;
}

.goal-preview-name {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
}

.goal-preview-amounts {
  display: block;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.goal-preview-item .progress-bar {
  margin-top: 0;
}

.goal-preview-empty {
  font-size: 0.85rem;
  color: var(--text-soft);
  padding: 4px 0;
}

.goals-preview-empty,
.debt-list-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px 0;
}

.goals-preview-empty li,
.debt-list-empty li {
  width: 100%;
  display: flex;
  justify-content: center;
}

.debt-list-empty li {
  padding: 0;
  border: none;
}

.dashboard-add-prompt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  color: var(--sage);
  text-decoration: none;
  border: 1px dashed var(--sage-soft);
  border-radius: var(--radius-sm);
  background: var(--sage-pale);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.dashboard-add-prompt:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--text);
}

.dashboard-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--sage-soft);
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1;
}

.appointments-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.appointments-preview-empty li {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.gui-link-sm {
  font-size: 0.8rem;
}

.debt-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}

.debt-list li {
  padding: 4px 0;
}

.finance-cashflow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.cashflow-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sage);
  font-weight: 500;
}

.gui-link {
  font-size: 0.85rem;
  color: var(--sage);
  text-decoration: none;
}

.gui-link:hover {
  text-decoration: underline;
}

.card-money {
  width: 36px;
  height: 36px;
  opacity: 0.35;
}

.card-money svg {
  width: 100%;
  height: 100%;
}

/* Card 3: Appointments */
.appointments-preview {
  list-style: none;
  margin: 0;
  padding: 0;
}

.appointments-preview li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.appointments-preview li:last-child {
  border-bottom: none;
}

.appt-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--sage);
  opacity: 0.8;
}

.appt-icon svg {
  width: 100%;
  height: 100%;
}

.appt-label {
  font-weight: 500;
  color: var(--text-soft);
  min-width: 72px;
}

/* Buttons */
.gui-btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  background: var(--sage);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.gui-btn:hover {
  background: var(--sage-soft);
}

.gui-btn-outline {
  background: transparent;
  color: var(--sage);
  border: 1px solid var(--sage);
}

.gui-btn-outline:hover {
  background: var(--accent-soft);
}

/* Section pages */
.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.page-title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.habits-header-row {
  margin-bottom: 20px;
}

.habit-form-panel {
  margin-top: 20px;
}

.habit-form-panel.hidden,
.hidden {
  display: none !important;
}

.habit-types-label {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0 0 8px;
}

.habit-types-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.habit-type-chip {
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--sage);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.habit-type-chip:hover {
  background: var(--sage-pale);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
}

.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
}

.stack-form input,
.stack-form textarea {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
}

.stack-form input:focus,
.stack-form textarea:focus {
  border-color: var(--sage-soft);
}

.habit-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.layout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Consistency card header: title + Add habit */
.habit-heatmap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.habit-heatmap-add-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
}
.habit-heatmap-add-btn:hover {
  color: var(--text);
  border-color: var(--sage);
  background: var(--sage-pale);
}

/* Habits – Active habit cards (high-fidelity, minimalist) */
.habits-cards-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 100%;
}

.habit-card-active {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 1px 3px rgba(92, 86, 77, 0.04);
  min-height: 260px;
}

.habit-card-active-title {
  margin: 0 0 20px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.habit-progress-ring-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.habit-progress-ring {
  width: 100px;
  height: 100px;
  position: relative;
}

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

.habit-ring-bg {
  fill: none;
  stroke: var(--warm-gray-pale);
  stroke-width: 3;
}

.habit-ring-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s ease;
}

.habit-streak {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.02em;
}

.habit-complete-btn {
  width: 100%;
  max-width: 160px;
  padding: 12px 20px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.habit-complete-btn:hover {
  background: var(--gold-pale);
  border-color: var(--gold-muted);
  color: var(--text);
}

.habit-complete-btn.done {
  background: var(--sage-pale);
  border-color: var(--sage-soft);
  color: var(--sage);
}

.habit-complete-btn.done:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--white);
}

.habit-card-active-actions {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.habit-card-meta-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.habit-card-meta-btn:hover {
  color: var(--sage);
}

.habit-card-meta-btn.danger:hover {
  color: #a65d4d;
}

.habit-card-meta-sep {
  margin: 0 6px;
  opacity: 0.6;
}

.habits-empty {
  text-align: center;
  color: var(--text-soft);
  padding: 48px 24px;
  font-size: 0.95rem;
  grid-column: 1 / -1;
}

/* Goals circles */
.goals-circles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.progress-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.progress-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(var(--sage) calc(var(--pct, 0) * 1%), var(--warm-gray-pale) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-circle-value {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sage);
}

.progress-circle-label {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.progress-circle-label strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}

/* Debt list full */
.debt-list-full {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.debt-list-full li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}

.debt-list-full li:last-child {
  border-bottom: none;
}

/* Appointments list full */
.appointments-list-full {
  list-style: none;
  margin: 0;
  padding: 0;
}

.appointments-list-full li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}

.appointments-list-full li:last-child {
  border-bottom: none;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
}

.tiny-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: var(--warm-gray-pale);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 999px;
  cursor: pointer;
}

.tiny-btn.danger {
  border-color: #c17a6b;
  color: #a65d4d;
}

/* Profile */
/* Profile – Two-column, Personal Control Center */
.profile-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}

.profile-sidebar {
  position: sticky;
  top: 24px;
}

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

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.profile-nav-item:hover {
  background: var(--sage-pale);
  color: var(--text);
}

.profile-nav-item.active {
  background: var(--sage-pale);
  color: var(--sage);
}

.profile-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.profile-nav-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.75;
}

.profile-main {
  background: var(--paper);
  padding: 32px 36px 48px;
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(92, 86, 77, 0.06);
}

.profile-control-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.profile-control-subtitle {
  margin: 0 0 28px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.profile-section {
  display: none;
}
.profile-section.active {
  display: block;
}

.life-totals-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  font-size: 0.9rem;
  color: var(--text);
}
.life-total-item {
  font-weight: 500;
}

.profile-account-history {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.profile-char-count {
  font-weight: 400;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.profile-input {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
}
.profile-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-row .profile-input {
  max-width: 140px;
}
.profile-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--sage);
}

.profile-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.profile-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.profile-radio input {
  accent-color: var(--sage);
}

.profile-btn-outline {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.profile-btn-outline:hover {
  background: var(--warm-gray-pale);
  color: var(--text);
}
.profile-btn.tiny {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.profile-field-indent {
  margin-left: 24px;
  margin-top: 4px;
}

.profile-2fa-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-2fa-status {
  font-size: 0.9rem;
  color: var(--text-soft);
}
.profile-sessions-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text);
}
.profile-sessions-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.profile-backup-reminder {
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--sage-pale);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
}
.profile-backup-reminder strong {
  color: var(--text);
}

.profile-savings-bucket-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.profile-savings-bucket-item input {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.profile-card-hint {
  margin: 0;
  padding: 0 20px 8px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.profile-hero-inline {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}

.profile-details-fields {
  flex: 1;
  min-width: 200px;
}

.profile-name-wrap,
.profile-mission-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-name-wrap .profile-name,
.profile-mission-wrap .profile-mission {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.profile-name-input,
.profile-mission-input {
  display: none;
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
}

.profile-name-wrap.edit .profile-name,
.profile-mission-wrap.edit .profile-mission { display: none; }
.profile-name-wrap.edit .profile-name-input,
.profile-mission-wrap.edit .profile-mission-input { display: block; }
.profile-name-wrap.edit .profile-inline-edit,
.profile-mission-wrap.edit .profile-inline-edit { display: none; }

.profile-inline-edit {
  padding: 4px 12px;
  font-size: 0.8rem;
  color: var(--sage);
  background: var(--sage-pale);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.profile-inline-edit:hover {
  background: var(--sage-soft);
  color: var(--text);
}

.profile-hero {
  text-align: center;
  margin-bottom: 36px;
}

.profile-avatar-wrap {
  display: block;
  cursor: pointer;
  margin-bottom: 0;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--sage-pale);
  background-size: cover;
  background-position: center;
  margin: 0 0 8px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.profile-hero-inline .profile-avatar-wrap .profile-avatar {
  margin: 0 0 8px;
}

.profile-avatar .profile-monogram {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.profile-avatar.has-image .profile-monogram {
  display: none;
}

.profile-avatar-edit {
  font-size: 0.8rem;
  color: var(--sage);
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.profile-mission {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(92, 86, 77, 0.05);
  margin-bottom: 24px;
}

.profile-card:last-child {
  margin-bottom: 0;
}

.profile-card-header {
  padding: 14px 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}

.profile-card-body {
  padding: 20px;
}

.profile-field {
  display: block;
  margin-bottom: 18px;
}

.profile-field:last-of-type {
  margin-bottom: 0;
}

.profile-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.profile-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  cursor: pointer;
}

.profile-toggle-label {
  font-size: 0.9rem;
  color: var(--text);
}

.profile-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  background: var(--warm-gray-pale);
  border-radius: 999px;
  transition: background 0.25s;
}

.profile-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.25s;
}

.profile-toggle:checked + .profile-toggle-slider {
  background: var(--sage-soft);
}

.profile-toggle:checked + .profile-toggle-slider::after {
  transform: translateX(20px);
}

.profile-privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-btn {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.profile-btn-export {
  background: var(--sage-pale);
  color: var(--sage);
  border: 1px solid var(--sage-soft);
}

.profile-btn-export:hover {
  background: var(--sage-soft);
  color: var(--text);
}

.profile-btn-deactivate {
  background: var(--warm-gray-pale);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.profile-btn-deactivate:hover {
  background: var(--warm-gray-light);
  color: var(--text);
}

.profile-btn-save {
  margin-top: 8px;
  background: var(--sage);
  color: var(--white);
  border: 1px solid var(--sage-soft);
}
.profile-btn-save:hover {
  background: var(--sage-soft);
  color: var(--text);
}

.profile-date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 32px;
  background: var(--white);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-soft);
}

.footer-copy {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-soft);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--sage);
}

/* Responsive – mobile-first PWA layout; utility menu stays as dropdown */
@media (max-width: 768px) {
  .nav-search-wrap {
    display: none;
  }

  .main-wrap {
    padding: 24px 16px 48px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .dashboard-cards .gui-card {
    min-height: 240px;
  }

  .gui-card-body {
    padding: 16px 14px;
  }

  .gui-btn,
  .gui-btn-outline {
    min-height: 44px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .people-modal {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    align-items: flex-end;
  }
  .people-modal-inner {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  .add-to-circle-overlay {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    align-items: flex-end;
  }
  .add-to-circle-card {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
  }

  .subtle-stats-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .section-inner {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 900px) {
  .top-nav {
    padding: 12px 20px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .main-wrap {
    padding: 32px 20px 48px;
  }

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

  .habits-cards-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2,
  .layout-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-nav-item {
    padding: 8px 12px;
    font-size: 0.7rem;
  }

  .profile-main {
    padding: 24px 20px 40px;
  }

  .profile-hero-inline {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .hero {
    margin-bottom: 28px;
  }
  .hero-headline {
    font-size: 1.35rem;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .habit-card-active {
    min-height: 240px;
    padding: 22px 20px 20px;
  }

  .profile-privacy-actions {
    flex-direction: column;
  }

  .profile-btn {
    width: 100%;
  }

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

  /* Habit tab PWA: compact consistency cards, larger tap targets */
  .daily-snapshot-wrap {
    padding-bottom: 1rem;
  }
  .habit-heatmap-card .snapshot-card-body.habit-consistency-body {
    padding: 0.75rem 1rem;
  }
  .habit-heatmap-range-selector {
    margin-bottom: 0.75rem;
    width: 100%;
    justify-content: stretch;
  }
  .habit-heatmap-range-btn {
    flex: 1;
    min-height: 44px;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
  .habit-consistency-card {
    padding: 0.75rem 1rem;
  }
  .habit-consistency-card-header {
    margin-bottom: 0.5rem;
    gap: 0.4rem 0.5rem;
  }
  .habit-consistency-title {
    font-size: 0.9rem;
  }
  .habit-consistency-subtitle {
    display: none;
  }
  .habit-consistency-icon {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    font-size: 1rem;
  }
  .habit-consistency-heat-wrap {
    --cell-size: 10px;
    --gap: 3px;
  }
  .habit-consistency-card--week .habit-consistency-heat-wrap,
  .habit-consistency-card--month .habit-consistency-heat-wrap {
    --cell-size: 12px;
    --gap: 3px;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .main-wrap {
    padding: 20px 12px 40px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .hero-headline {
    font-size: 1.2rem;
  }
  .gui-card-header {
    padding: 12px 14px;
    font-size: 0.75rem;
  }
  .gui-card-body {
    padding: 14px 12px;
  }
  input[type="text"],
  input[type="number"],
  input[type="search"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px; /* avoids iOS zoom on focus */
  }
  textarea {
    min-height: 88px;
  }
}

/* People / Personal CRM */
.people-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .people-layout {
    grid-template-columns: 1fr;
  }
  .people-detail-panel {
    order: -1;
  }
}
.people-toolbar {
  margin-bottom: 1rem;
}
.people-form-wrap.hidden {
  display: none;
}
.people-directory {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.people-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.people-card:hover {
  background: var(--sage-pale);
  border-color: var(--sage);
}
.people-card-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--sage-pale);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.people-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.people-card-name {
  font-weight: 600;
  color: var(--text);
}
.people-card-connection {
  font-size: 0.8rem;
  color: var(--text-soft);
}
.people-card-meta {
  font-size: 0.75rem;
  color: var(--text-soft);
}
.people-card-note {
  font-size: 0.8rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.people-detail-panel {
  position: sticky;
  top: 1rem;
  background: var(--paper);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.people-detail-empty {
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}
.people-detail-content.hidden {
  display: none;
}
.people-identity-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--warm-gray-pale);
}
.people-detail-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--sage-pale);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.people-detail-name {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  color: var(--text);
}
.people-connection-type {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}
.people-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.people-identity-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.people-delete-btn {
  color: var(--text-soft);
  border-color: var(--warm-gray-light);
}
.people-delete-btn:hover {
  background: var(--warm-gray-pale);
  border-color: var(--warm-gray);
  color: var(--text);
}
.people-section {
  margin-bottom: 1rem;
}
.people-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.people-notes-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.9rem;
  resize: vertical;
}
.people-ledger-card {
  margin-top: 1rem;
}
.ledger-balance-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.ledger-balance {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.ledger-status {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.ledger-status-owed {
  background: var(--sage-pale);
  color: var(--sage);
}
.ledger-status-you-owe {
  background: var(--warm-gray-pale);
  color: var(--warm-gray);
}
.ledger-status.hidden {
  display: none;
}
.ledger-linked {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.debt-due-banner {
  background: var(--gold-pale);
  border-color: var(--gold-muted);
}
.debt-due-banner:not(.hidden) {
  color: var(--text);
}
.ledger-transactions {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.ledger-transactions li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--warm-gray-pale);
}
.ledger-transactions li:last-child {
  border-bottom: none;
}
.ledger-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gui-btn-ghost {
  background: transparent;
  border: 1px solid var(--sage-soft);
  color: var(--sage);
}
.gui-btn-ghost:hover {
  background: var(--sage-pale);
  border-color: var(--sage);
}
.gui-btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}
.people-modal {
  position: fixed;
  inset: 0;
  background: rgba(92, 86, 77, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.people-modal.hidden {
  display: none;
}
.people-modal-inner {
  background: var(--paper);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
}
.people-modal-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text);
}
.people-tx-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.people-boundary-banner {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--sage-pale);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.people-boundary-banner.hidden {
  display: none;
}
.people-boundary-banner a {
  color: var(--sage);
  font-weight: 600;
  text-decoration: none;
}
.people-boundary-banner a:hover {
  text-decoration: underline;
}
.people-preview-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 0.9rem;
}
.people-preview-list li {
  padding: 0.25rem 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.people-preview-name {
  font-weight: 500;
  color: var(--text);
}
.people-preview-meta {
  color: var(--text-soft);
  font-size: 0.85rem;
}
.people-preview-empty {
  color: var(--text-soft);
  font-size: 0.9rem;
}
.gui-card-people .gui-btn-outline {
  margin-top: 0.5rem;
}

/* Add to Your Circle modal */
.add-to-circle-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 240, 232, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}
.add-to-circle-overlay.hidden {
  display: none;
}
.add-to-circle-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(92, 86, 77, 0.12);
  max-width: 420px;
  width: 100%;
  padding: 2rem;
}
.add-to-circle-form-wrap.hidden,
.add-to-circle-success-wrap.hidden {
  display: none;
}
.add-to-circle-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.add-to-circle-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  color: var(--sage);
  margin-bottom: 0.75rem;
}
.add-to-circle-icon svg {
  width: 32px;
  height: 32px;
}
.add-to-circle-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.01em;
}
.add-to-circle-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.add-to-circle-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.add-to-circle-label-text {
  font-size: 0.85rem;
  color: var(--text-soft);
}
.add-to-circle-optional {
  font-weight: 400;
  opacity: 0.8;
}
.add-to-circle-input {
  font-size: 1rem;
  padding: 0.5rem 0 0.6rem;
  border: none;
  border-bottom: 1px solid var(--warm-gray-light);
  background: transparent;
  color: var(--text);
  transition: border-color 0.2s;
}
.add-to-circle-input::placeholder {
  color: var(--text-soft);
  opacity: 0.8;
}
.add-to-circle-input:focus {
  outline: none;
  border-bottom-color: var(--sage);
}
.add-to-circle-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23a39e96' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 1.5rem;
}
.add-to-circle-toggle-wrap {
  padding-top: 0.25rem;
}
.add-to-circle-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}
.add-to-circle-toggle-text {
  font-size: 0.95rem;
  color: var(--text);
}
.add-to-circle-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.add-to-circle-toggle-slider {
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: var(--warm-gray-pale);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}
.add-to-circle-toggle-slider::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.2s;
}
.add-to-circle-toggle:checked + .add-to-circle-toggle-slider {
  background: var(--sage);
}
.add-to-circle-toggle:checked + .add-to-circle-toggle-slider::after {
  transform: translateX(20px);
}
.add-to-circle-link-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-left: 0.25rem;
}
.add-to-circle-link-btn {
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
  background: var(--sage-pale);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  color: var(--sage);
  cursor: pointer;
  width: fit-content;
  transition: background 0.2s, border-color 0.2s;
}
.add-to-circle-link-btn:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
}
.add-to-circle-habit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.add-to-circle-link-label {
  font-size: 0.875rem;
  color: var(--text-soft);
}
.add-to-circle-habit-select {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  min-width: 140px;
}
.add-to-circle-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--sage);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.add-to-circle-submit:hover {
  background: var(--sage-soft);
  filter: brightness(0.97);
}
.add-to-circle-success-wrap {
  text-align: center;
  padding: 1rem 0;
}
.add-to-circle-success-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--sage-pale);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  animation: add-to-circle-pulse 1s ease-in-out;
}
@keyframes add-to-circle-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.95; }
}
.add-to-circle-success-check {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  color: var(--sage);
}
.add-to-circle-success-check svg {
  width: 100%;
  height: 100%;
}
.add-to-circle-success-text {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
  font-family: var(--font-serif);
}
