:root {
  --bg: #f0ecf4;
  --surface: rgba(255, 255, 255, 0.45);
  --surface-solid: rgba(255, 255, 255, 0.55);
  --card-border: rgba(255, 255, 255, 0.6);

  --ink: #1a1424;
  --ink-soft: #4b4159;
  --ink-muted: #756b82;

  --grad: linear-gradient(120deg, #ff8fc7 0%, #b57bff 48%, #5ec4ff 100%);
  --grad-soft: linear-gradient(120deg, #ffd9ec 0%, #e7dcff 50%, #d6efff 100%);
  --accent: #9a59e8;
  --accent-ink: #ffffff;
  --accent-soft-bg: rgba(154, 89, 232, 0.1);
  --accent-soft-ink: #6b35c4;

  --blob-a: #ffc4e2;
  --blob-b: #c9b4ff;
  --blob-c: #a8dcff;

  --error: #c43054;
  --error-bg: rgba(196, 48, 84, 0.12);

  --radius-card: 24px;
  --radius-input: 14px;

  --glass-blur: 40px;
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.7);
  --glass-edge: inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
  --shadow-card: 0 8px 32px -8px rgba(100, 60, 150, 0.18), 0 2px 8px -2px rgba(0, 0, 0, 0.06);
  --shadow-btn: 0 8px 24px -6px rgba(154, 89, 232, 0.45);

  --skeleton-a: rgba(200, 180, 220, 0.2);
  --skeleton-b: rgba(200, 180, 220, 0.08);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0a14;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-solid: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.12);

    --ink: #f2ecfa;
    --ink-soft: #c8bdd6;
    --ink-muted: #9088a0;

    --accent: #c79bff;
    --accent-ink: #0e0a14;
    --accent-soft-bg: rgba(150, 110, 220, 0.14);
    --accent-soft-ink: #d9c2ff;

    --blob-a: #5a2860;
    --blob-b: #3a2870;
    --blob-c: #1a4060;

    --error: #ff9bb4;
    --error-bg: rgba(196, 48, 84, 0.16);

    --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    --glass-edge: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
    --shadow-card: 0 8px 32px -8px rgba(0, 0, 0, 0.5), 0 2px 8px -2px rgba(0, 0, 0, 0.3);
    --shadow-btn: 0 8px 24px -6px rgba(154, 89, 232, 0.4);

    --skeleton-a: rgba(120, 100, 160, 0.15);
    --skeleton-b: rgba(120, 100, 160, 0.06);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

/* ---------- Auth Lock Screen ---------- */
.auth-lock {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 60% 50% at 10% 5%, var(--blob-a) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 90% 10%, var(--blob-b) 0%, transparent 70%),
    var(--bg);
}

.auth-lock[hidden] { display: none; }

.auth-card {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.auth-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 16px;
}

.auth-form input {
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--surface-solid);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-form input::placeholder {
  color: var(--ink-muted);
}

.auth-btn {
  margin-top: 6px;
}

.auth-switch {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-error {
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
  margin: 8px 0 0;
}

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

#app-container[hidden] { display: none; }

/* ---------- Fab Question / Rueckfrage ---------- */
#fab-question[hidden] { display: none; }

.fab-question-card {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.fab-question-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}

.fab-question-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fab-option-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--surface-solid);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.fab-option-btn:active {
  transform: scale(0.97);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.fab-question-custom {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.fab-custom-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--surface-solid);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.fab-custom-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.fab-custom-send {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.fab-custom-send:active { transform: scale(0.95); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 60% 50% at 10% 5%, var(--blob-a) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 90% 10%, var(--blob-b) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 25% 90%, var(--blob-c) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 70%, var(--blob-a) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- Layout ---------- */
.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.wordmark {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.assistant-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.spark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--grad);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(154, 89, 232, 0.6);
  flex-shrink: 0;
}
.spark-lg { width: 16px; height: 16px; }

/* ---------- XP Bar ---------- */
.xp-bar {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 10px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.xp-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.xp-level {
  font-size: 13px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.xp-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
}

.xp-track {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-soft-bg);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: no-preference) {
  .xp-bar.level-up {
    animation: xp-glow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

@keyframes xp-glow {
  0% { box-shadow: var(--glass-highlight), var(--glass-edge); }
  50% { box-shadow: 0 0 20px rgba(154, 89, 232, 0.5), 0 0 40px rgba(94, 196, 255, 0.3); }
  100% { box-shadow: var(--glass-highlight), var(--glass-edge); }
}

/* ---------- Tab bar ---------- */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 24px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  box-shadow: none;
}

.tab:active { transform: none; }
.tab:hover { color: var(--ink-soft); }

.tab.active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), var(--glass-highlight);
}

/* ---------- Back button ---------- */
.back-btn {
  display: inline-flex;
  width: auto;
  padding: 8px 0;
  margin-bottom: 16px;
  background: none;
  border: none;
  color: var(--accent-soft-ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.back-btn:active { transform: none; }
.back-btn:hover { color: var(--accent); }

/* ---------- Greeting ---------- */
.greeting {
  font-size: clamp(26px, 6.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--ink);
}

.greeting-sub {
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 24px;
}

/* ---------- Stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card.grad-bg {
  background: var(--grad);
  border-color: transparent;
}

.stat-card.grad-bg .stat-value,
.stat-card.grad-bg .stat-label {
  color: #fff;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

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

/* ---------- Section heading ---------- */
.section-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.section-heading.nudge {
  color: var(--accent-soft-ink);
}

/* ---------- Focus today ---------- */
#focus-today {
  margin-bottom: 20px;
}

#focus-today[hidden] { display: none; }

#focus-today-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.focus-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 18px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.16s ease;
}

.focus-item:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.focus-item:active { transform: translateY(0); }

.focus-check-box {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: 2.5px solid var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.focus-check-box:hover {
  background: var(--accent-soft-bg);
}

.focus-check-box.checked {
  background: var(--grad);
  border-color: transparent;
}

.focus-content {
  flex: 1;
  min-width: 0;
}

.focus-idea-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-step-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag-list:empty { display: none; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.idea-card .tag-list {
  margin-bottom: 12px;
  margin-top: -4px;
}

/* ---------- Search ---------- */
.search-wrap {
  margin-bottom: 18px;
}

.search-input {
  width: 100%;
  padding: 13px 18px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
}

.search-input::placeholder { color: var(--ink-muted); opacity: 0.7; }

.search-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-bg);
}

/* ---------- Forgotten indicator ---------- */
.idea-card-stale {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-soft-ink);
  margin-top: 8px;
  opacity: 0.8;
}

#forgotten-section {
  margin-top: 24px;
}

#forgotten-section[hidden] { display: none; }

#forgotten-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- New idea button (dashboard) ---------- */
.new-idea-btn {
  margin-bottom: 0;
  gap: 10px;
}

.new-idea-btn .spark {
  width: 10px;
  height: 10px;
}

/* ---------- Idea cards (dashboard) ---------- */
.idea-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  margin-bottom: 10px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.16s ease;
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge);
}

.idea-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge), 0 4px 16px rgba(154, 89, 232, 0.12);
}

.idea-card:active { transform: translateY(0); }

.idea-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idea-card-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.idea-card-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-soft-bg);
  overflow: hidden;
}

.idea-card-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.3s ease;
}

.idea-card-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  color: var(--ink-muted);
  font-size: 15px;
  padding: 40px 20px;
  margin: 0;
}

.empty-state[hidden] { display: none; }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 34px 30px;
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  margin: 0 0 12px;
}

.display {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}

.grad-text {
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hint {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 42ch;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

textarea {
  width: 100%;
  min-height: 120px;
  border: 2px solid transparent;
  border-radius: var(--radius-input);
  background: var(--surface-solid);
  color: var(--ink);
  padding: 16px 18px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  box-shadow: inset 0 0 0 1px rgba(120, 90, 160, 0.12);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

textarea::placeholder { color: var(--ink-muted); opacity: 0.8; }

textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-bg);
}

/* ---------- Buttons ---------- */
button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 17px 24px;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button:active { transform: scale(0.985); }
button:disabled { opacity: 0.65; cursor: progress; }

.primary {
  background: var(--grad);
  background-size: 160% 160%;
  color: var(--accent-ink);
  box-shadow: var(--shadow-btn);
}

.btn-arrow { font-size: 19px; transition: transform 0.2s ease; }

.secondary {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-ink);
  font-weight: 700;
}

.secondary:hover { filter: brightness(0.98); }

.secondary.danger {
  background: var(--error-bg);
  color: var(--error);
}

@media (prefers-reduced-motion: no-preference) {
  .primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -12px rgba(154, 89, 232, 0.7);
    animation: grad-shift 4s ease infinite;
  }
  .primary:hover:not(:disabled) .btn-arrow { transform: translateX(4px); }
}

@keyframes grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- Error ---------- */
.error {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 13px 16px;
  border-radius: var(--radius-input);
  background: var(--error-bg);
  color: var(--error);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
}

.error[hidden] { display: none; }

.error-dot {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}

/* ---------- Focus title ---------- */
.focus-title {
  font-size: clamp(21px, 5.5vw, 26px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  color: var(--ink);
}

/* ---------- Progress ---------- */
.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.progress-track {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-soft-bg);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(120, 90, 160, 0.1);
}

.progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--grad);
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  white-space: nowrap;
  min-width: 3.5ch;
  text-align: right;
}

/* ---------- Done banner ---------- */
.done-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
  text-align: center;
  padding: 15px 16px;
  border-radius: var(--radius-input);
  margin: 0 0 20px;
  box-shadow: var(--shadow-btn);
}

.done-emoji { font-size: 17px; }

.done-banner[hidden] { display: none; }

.done-banner.show {
  animation: pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ---------- Steps list ---------- */
#steps-list, #completed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#steps-list li, #completed-list li {
  border-radius: var(--radius-input);
  background: var(--surface-solid);
  box-shadow: inset 0 0 0 1px rgba(120, 90, 160, 0.1);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
  animation: step-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

#completed-list li {
  opacity: 0.6;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  cursor: pointer;
  min-height: 60px;
}

.step-check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.check-box {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 2.5px solid var(--accent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.check-box .check-mark {
  width: 16px;
  height: 9px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) scale(0.4);
  margin-top: -3px;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-check:checked ~ .check-box {
  background: var(--grad);
  border-color: transparent;
}

.step-check:checked ~ .check-box .check-mark {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.step-check:focus-visible ~ .check-box {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .step-check:checked ~ .check-box { animation: check-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
}

.step-text {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink);
  transition: opacity 0.2s ease;
}

.step-check:checked ~ .step-text {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  opacity: 0.5;
}

/* Zen button in step row */
.step-zen-btn {
  width: auto;
  flex-shrink: 0;
  padding: 5px 12px;
  margin-left: auto;
  border-radius: 8px;
  background: var(--accent-soft-bg);
  color: var(--accent-soft-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.step-row:hover .step-zen-btn,
.step-row:focus-within .step-zen-btn {
  opacity: 1;
}

.step-zen-btn:hover {
  background: var(--grad);
  color: #fff;
}

.step-zen-btn:active { transform: none; }

/* ---------- Step response ---------- */
.step-response-wrap {
  padding: 0 18px 14px 63px;
}

.step-response {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.step-response::placeholder { color: var(--ink-muted); opacity: 0.6; }

.step-response:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-bg);
}

/* ---------- Completed section ---------- */
.completed-section {
  margin-top: 20px;
}

.completed-section[hidden] { display: none; }

.completed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 10px 0;
  list-style: none;
  user-select: none;
}

.completed-toggle::-webkit-details-marker { display: none; }
.completed-toggle::marker { display: none; content: ""; }

.completed-toggle::before {
  content: "▸";
  font-size: 12px;
  transition: transform 0.2s ease;
}

details[open] .completed-toggle::before {
  transform: rotate(90deg);
}

#completed-list {
  margin-top: 10px;
}

/* ---------- Continue button ---------- */
.continue {
  margin-top: 16px;
  background: var(--grad);
  background-size: 160% 160%;
  color: var(--accent-ink);
  box-shadow: var(--shadow-btn);
  font-size: 15.5px;
}

.continue[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .continue:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -12px rgba(154, 89, 232, 0.7);
  }
}

/* ---------- Focus actions ---------- */
.focus-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.focus-actions button {
  margin: 0;
}

/* ---------- Archive ---------- */
.archive-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  margin-bottom: 10px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  cursor: pointer;
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge);
  transition: box-shadow 0.2s ease, transform 0.16s ease;
}

.archive-card:hover {
  transform: translateY(-2px);
}

.archive-card:active { transform: translateY(0); }

.archive-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.archive-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}

.archive-card-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
}

.archive-card-meta {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
}

.archive-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.archive-action-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: none;
}

/* ---------- Loading ---------- */
.loading-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-row {
  height: 60px;
  border-radius: var(--radius-input);
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 37%, var(--skeleton-a) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ---------- Groove (Habit Tracker) ---------- */
.groove-header {
  margin-bottom: 20px;
}

.habit-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid transparent;
  border-radius: var(--radius-input);
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px rgba(120, 90, 160, 0.12);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  margin-bottom: 18px;
}

.habit-input::placeholder { color: var(--ink-muted); opacity: 0.8; }

.habit-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-bg);
}

.freq-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.freq-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 2px solid transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(120, 90, 160, 0.12);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.freq-btn:active { transform: none; }

.freq-btn.active {
  border-color: var(--accent);
  color: var(--accent-soft-ink);
  background: var(--accent-soft-bg);
  box-shadow: none;
}

/* Habit card */
.habit-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 10px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.16s ease;
}

.habit-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge);
}

.habit-card:active { transform: translateY(0); }

.habit-card.checked-today {
  opacity: 0.6;
}

.habit-check-box {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 2.5px solid var(--accent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.habit-check-box.checked {
  background: var(--grad);
  border-color: transparent;
}

.habit-check-box .check-mark {
  width: 16px;
  height: 9px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) scale(0.4);
  margin-top: -3px;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.habit-check-box.checked .check-mark {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

@media (prefers-reduced-motion: no-preference) {
  .habit-check-box.checked { animation: check-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
}

.habit-content {
  flex: 1;
  min-width: 0;
}

.habit-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.habit-card.checked-today .habit-name {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
}

.habit-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  margin-top: 3px;
}

.streak-fire {
  font-size: 14px;
}

.habit-freq-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft-bg);
  color: var(--accent-soft-ink);
  flex-shrink: 0;
}

.habit-delete {
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  box-shadow: none;
  flex-shrink: 0;
}

.habit-card:hover .habit-delete { opacity: 0.5; }
.habit-delete:hover { opacity: 1 !important; background: var(--error-bg); color: var(--error); }
.habit-delete:active { transform: none; }

/* Streak calendar (mini week view) */
.streak-week {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.streak-day {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent-soft-bg);
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
  color: var(--ink-muted);
}

.streak-day.done {
  background: var(--grad);
  color: #fff;
}

.streak-day.today {
  box-shadow: 0 0 0 2px var(--accent);
}

/* ---------- Dashboard actions ---------- */
.dashboard-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.dashboard-actions .new-idea-btn {
  flex: 1;
  margin: 0;
  padding: 14px 20px;
  font-size: 15px;
}

.random-zen-btn {
  flex-shrink: 0;
  width: auto;
  padding: 14px 16px;
  margin: 0;
  font-size: 13.5px;
}

.random-zen-btn[hidden] { display: none; }

/* ---------- Zen Mode ---------- */
#view-zen {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
}

#view-zen[hidden] { display: none; }

.zen-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0 40px;
}

.zen-ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 32px;
}

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

.zen-ring-bg {
  stroke: var(--accent-soft-bg);
}

.zen-ring-fill {
  stroke: url(#zen-gradient);
  stroke-dasharray: 553;
  stroke-dashoffset: 553;
  transition: stroke-dashoffset 0.5s ease;
}

.zen-time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.zen-step {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  max-width: 40ch;
}

.zen-idea {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0 0 28px;
}

.zen-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.zen-preset {
  width: auto;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 2px solid transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glass-highlight), var(--glass-edge);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: border-color 0.18s ease, color 0.18s ease;
}

.zen-preset:active { transform: none; }

.zen-preset.active {
  border-color: var(--accent);
  color: var(--accent-soft-ink);
  background: var(--accent-soft-bg);
}

.zen-toggle {
  width: auto;
  min-width: 180px;
  padding: 17px 40px;
  font-size: 17px;
  margin-bottom: 12px;
}

.zen-done {
  width: auto;
  min-width: 180px;
  padding: 15px 36px;
  margin: 0;
}

/* Zen completion burst */
@media (prefers-reduced-motion: no-preference) {
  .zen-ring-wrap.complete {
    animation: zen-burst 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

@keyframes zen-burst {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- Quick Capture FAB ---------- */
.capture-fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  border: none;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.capture-fab:hover {
  transform: scale(1.08);
}

.capture-fab:active {
  transform: scale(0.95);
}

/* Capture overlay */
.capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.capture-overlay[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .capture-overlay {
    animation: fade-in 0.2s ease both;
  }
  .capture-modal {
    animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.capture-modal {
  width: 100%;
  max-width: 440px;
}

.capture-hint {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 16px;
}

.capture-textarea {
  min-height: 80px;
  margin-bottom: 16px;
}

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

.capture-actions button {
  margin: 0;
}

/* Captures list on dashboard */
#captures-section {
  margin-bottom: 16px;
}

#captures-section[hidden] { display: none; }

.capture-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 8px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  display: flex;
  align-items: center;
  gap: 12px;
}

.capture-text {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.capture-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.capture-action {
  width: auto;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: none;
}

/* ---------- Daily Wins ---------- */
#daily-wins {
  margin-bottom: 20px;
}

#daily-wins[hidden] { display: none; }

.daily-wins-card {
  padding: 22px 24px;
}

.daily-wins-summary {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.4;
}

.daily-wins-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daily-wins-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.4;
}

.win-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--grad);
  display: grid;
  place-items: center;
}

.win-icon .check-mark {
  width: 12px;
  height: 7px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg);
  margin-top: -2px;
}

.daily-wins-closer {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-soft-ink);
  font-style: italic;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: none;
  max-width: calc(100% - 40px);
  text-align: center;
}

.toast[hidden] { display: block; opacity: 0; }

.toast.grad {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .toast.show {
    animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               toast-out 0.3s ease 1.8s forwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast.show { opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.92); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ---------- View transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  main > section {
    animation: view-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  main > section[hidden] { animation: none; }

  .idea-card, .archive-card {
    animation: card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .stats-row .stat-card {
    animation: card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .stats-row .stat-card:nth-child(1) { animation-delay: 40ms; }
  .stats-row .stat-card:nth-child(2) { animation-delay: 100ms; }
  .stats-row .stat-card:nth-child(3) { animation-delay: 160ms; }
}

/* ---------- Completed section expand ---------- */
.completed-section #completed-list {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .completed-section #completed-list {
    animation: expand-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .completed-section:not([open]) #completed-list {
    animation: none;
  }
}

/* ---------- Keyframes ---------- */
@keyframes view-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes expand-in {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}
@keyframes step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes check-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Dashboard reflect section ---------- */
.dashboard-reflect {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

/* ---------- Energy selector ---------- */
.energy-selector {
  margin-bottom: 16px;
}

.energy-options {
  display: flex;
  gap: 6px;
}

.energy-btn {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glass-highlight), var(--glass-edge);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.16s ease;
}

.energy-btn:active { transform: scale(0.97); }

.energy-btn.active {
  border-color: var(--accent);
  color: var(--accent-soft-ink);
  background: var(--accent-soft-bg);
}

/* ---------- Tab badges ---------- */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
}

.tab-badge[hidden] { display: none; }

/* ---------- Improved empty states ---------- */
.empty-state-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
}

.empty-state-card[hidden] { display: none; }

.empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.empty-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
}

.empty-hint {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0;
  max-width: 32ch;
  margin-inline: auto;
  line-height: 1.5;
}

/* ---------- App streak ---------- */
.app-streak {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  text-align: center;
}

.app-streak[hidden] { display: none; }

.streak-chain {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.streak-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-soft-bg);
  transition: background 0.3s ease, transform 0.3s ease;
}

.streak-dot.filled {
  background: var(--grad);
  box-shadow: 0 0 8px rgba(154, 89, 232, 0.4);
}

.streak-dot.today {
  box-shadow: 0 0 0 2.5px var(--accent);
}

.streak-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  margin: 0;
}

/* ---------- Week recap ---------- */
.week-recap {
  margin-bottom: 20px;
}

.week-recap[hidden] { display: none; }

.week-recap-card {
  padding: 20px 24px;
}

.week-recap-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.recap-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.recap-stat-num {
  font-size: 22px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.week-recap-msg {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-soft-ink);
  font-style: italic;
  margin: 0;
}

/* Activity mini chart */
.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 48px;
  margin-bottom: 14px;
}

.week-chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.week-chart-fill {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: var(--grad);
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.week-chart-fill.empty {
  background: var(--accent-soft-bg);
}

.week-chart-day {
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* ---------- Dopamin-Blocker ---------- */
#view-blocker[hidden] { display: none; }

.blocker-container {
  text-align: center;
  padding: 20px 0;
}

.blocker-title {
  font-size: clamp(26px, 6.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--ink);
}

.blocker-hint {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 38ch;
  margin-inline: auto;
}

.blocker-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

.blocker-stat {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 10px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.blocker-stat.grad-bg {
  background: var(--grad);
  border-color: transparent;
}

.blocker-stat.grad-bg .blocker-stat-num,
.blocker-stat.grad-bg .blocker-stat-label { color: #fff; }

.blocker-stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.blocker-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.blocker-btn {
  max-width: 300px;
  margin: 0 auto 16px;
  font-size: 18px;
  padding: 20px 32px;
}

.blocker-today-note {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-soft-ink);
  margin: 0;
  min-height: 20px;
}

/* Blocker countdown */
.blocker-ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 28px;
}

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

.blocker-ring-bg {
  stroke: var(--accent-soft-bg);
}

.blocker-ring-fill {
  stroke: url(#zen-gradient);
  transition: stroke-dashoffset 0.9s ease;
}

.blocker-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 56px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.blocker-breathe {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.blocker-breathe-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .blocker-breathe {
    animation: breathe 4s ease-in-out infinite;
  }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

/* Blocker decision */
.blocker-ask {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 800;
  color: var(--ink);
  margin: 40px 0 8px;
}

.blocker-ask-sub {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0 0 32px;
}

.blocker-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}

.blocker-choice {
  margin: 0;
}

/* Blocker dashboard button */
.blocker-dash-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  font-size: 18px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

/* ---------- Confetti canvas ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 300;
}

/* ---------- REWARDS (Selbstbelohnungen) ---------- */
.rewards-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--card-border);
  margin-bottom: 16px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
}

.rewards-xp-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.rewards-xp-value {
  font-size: 20px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rewards-empty {
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--surface-solid);
  margin-bottom: 8px;
  transition: opacity 0.2s, transform 0.16s;
}

.reward-item:not(.affordable) {
  opacity: 0.45;
}

.reward-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reward-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.reward-cost {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

.reward-buy-btn {
  width: auto;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.16s, opacity 0.2s;
}

.reward-buy-btn:active { transform: scale(0.95); }

.reward-buy-btn.disabled {
  background: var(--accent-soft-bg);
  color: var(--ink-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.reward-delete-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 20px;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.2s, color 0.2s;
  display: grid;
  place-items: center;
  box-shadow: none;
  flex-shrink: 0;
}

.reward-delete-btn:hover {
  opacity: 1;
  color: var(--error);
}

.reward-delete-btn:active { transform: none; }

.rewards-add {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rewards-add-row {
  display: flex;
  gap: 8px;
}

.reward-cost-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-input);
  border: 2px solid transparent;
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  box-shadow: inset 0 0 0 1px rgba(120, 90, 160, 0.12);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.reward-cost-input::placeholder { color: var(--ink-muted); opacity: 0.7; }

.reward-cost-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-bg);
}

.reward-add-btn {
  width: 50px;
  height: 50px;
  padding: 0;
  font-size: 22px;
  border-radius: 14px;
  box-shadow: var(--shadow-btn);
}

.reward-open-btn {
  flex: 1;
  font-size: 14px;
  padding: 14px 16px;
}

.groove-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.groove-actions .new-idea-btn {
  flex: 1;
  margin: 0;
}

/* ---------- 2-MINUTEN-REGEL ---------- */
.twominute-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 32px 16px;
}

.twominute-title {
  font-size: clamp(26px, 6.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}

.twominute-hint {
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 500;
  max-width: 30ch;
  line-height: 1.5;
  margin: 0 auto 24px;
}

.twominute-step {
  font-size: 16px;
  font-weight: 600;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  margin-bottom: 24px;
  max-width: 100%;
  color: var(--ink);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
}

.twominute-step.running {
  font-size: 14px;
  color: var(--ink-muted);
  background: none;
  border: none;
  margin-top: 16px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.twominute-timer {
  font-size: 64px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  animation: pulse-timer 1s ease-in-out infinite alternate;
}

@keyframes pulse-timer {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

.twominute-result-time {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #50c878, #5ec4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.twominute-result-msg {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 32px;
  max-width: 28ch;
  line-height: 1.5;
}

.step-2min-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
}

/* ---------- Quick Wins ---------- */
#quick-wins {
  margin-bottom: 20px;
}

#quick-wins[hidden] { display: none; }

.quick-wins-hint {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}

#quick-wins-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-win-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  cursor: pointer;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: var(--glass-highlight), var(--glass-edge);
  transition: transform 0.16s, box-shadow 0.2s;
}

.quick-win-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.quick-win-item:active {
  transform: scale(0.98);
}

.quick-win-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.quick-win-idea {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ---------- Scratch Card ---------- */
.scratch-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.scratch-overlay[hidden] { display: none; }

.scratch-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-card), var(--glass-highlight), var(--glass-edge);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  max-width: 340px;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .scratch-card {
    animation: modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
}

.scratch-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  margin: 0 0 16px;
}

.scratch-canvas-wrap {
  position: relative;
  width: 280px;
  height: 180px;
  margin: 0 auto 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--card-border);
  touch-action: none;
}

.scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-solid);
}

.scratch-prize-xp {
  font-size: 36px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.scratch-prize-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
}

#scratch-canvas {
  position: relative;
  z-index: 1;
  cursor: crosshair;
  display: block;
}

.scratch-hint {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  margin: 0;
}

/* ---------- Achievements ---------- */
.achievements-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.achievements-overlay[hidden] { display: none; }

.achievements-modal {
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .achievements-modal {
    animation: modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
}

.achievements-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 16px;
}

.achievements-counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-soft-ink);
  margin: 0 0 16px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 6px;
  background: var(--surface-solid);
  border: 1px solid transparent;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.achievement-item.unlocked {
  opacity: 1;
  border-color: var(--card-border);
  box-shadow: var(--glass-highlight);
}

.achievement-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.achievement-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.achievement-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.achievement-desc {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.achievement-item:not(.unlocked) .achievement-name {
  color: var(--ink-muted);
}

/* ---------- Zen button touch fix ---------- */
@media (pointer: coarse) {
  .step-zen-btn {
    opacity: 1;
  }

  .habit-delete {
    opacity: 0.5;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #steps-list li, #completed-list li { animation: none; }
  .done-banner.show { animation: none; }
  .skeleton-row { animation: none; background: var(--skeleton-a); }
  .progress-fill { transition: none; }
  .idea-card, .archive-card { transition: none; }
  * { scroll-behavior: auto; }
  .twominute-timer { animation: none; }
}
