/* ══════════════════════════════════════════
   FOKUS — CSS
   Minimalistisk, editorial mobildesign
══════════════════════════════════════════ */

/* ── Variabler ── */
:root {
  --bg:           #F5F0F8;
  --surface:      #FDFAFF;
  --surface2:     #EDE8F2;

  --primary:      #48426D;
  --primary-lt:   #DDD8EE;

  --green:        #48426D;
  --green-lt:     #DDD8EE;
  --orange:       #C4875A;
  --orange-lt:    #F5E0CC;
  --red:          #B84040;
  --red-lt:       #F0D0D0;

  --text:         #312C51;
  --text2:        #48426D;
  --muted:        #8878A0;

  --border:       #C8C0D8;
  --sep:          rgba(49,44,81,.08);

  --r:            14px;
  --r-sm:         8px;
  --r-lg:         20px;

  --shadow:       none;
  --shadow-sm:    none;

  --nav-h:        64px;
  --hdr-h:        70px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bot:     env(safe-area-inset-bottom, 0px);
}

/* ── Mørk tilstand ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #1E1A2E;
    --surface:   #272240;
    --surface2:  #312C51;
    --primary:   #F0C38E;
    --primary-lt:#3A2F18;
    --green:     #F0C38E;
    --green-lt:  #3A2F18;
    --orange:    #F1AA9B;
    --orange-lt: #3D2420;
    --red:       #E07878;
    --red-lt:    #3D1E1E;
    --text:      #F0ECF8;
    --text2:     #C4BCCE;
    --muted:     #887898;
    --border:    #48426D;
    --sep:       rgba(255,255,255,.08);
  }
}

[data-theme="dark"] {
  --bg:        #1E1A2E;
  --surface:   #272240;
  --surface2:  #312C51;
  --primary:   #F0C38E;
  --primary-lt:#3A2F18;
  --green:     #F0C38E;
  --green-lt:  #3A2F18;
  --orange:    #F1AA9B;
  --orange-lt: #3D2420;
  --red:       #E07878;
  --red-lt:    #3D1E1E;
  --text:      #F0ECF8;
  --text2:     #C4BCCE;
  --muted:     #887898;
  --border:    #48426D;
  --sep:       rgba(255,255,255,.08);
}

[data-theme="light"] {
  --bg:        #F5F0F8;
  --surface:   #FDFAFF;
  --surface2:  #EDE8F2;
  --primary:   #48426D;
  --primary-lt:#DDD8EE;
  --green:     #48426D;
  --green-lt:  #DDD8EE;
  --orange:    #C4875A;
  --orange-lt: #F5E0CC;
  --red:       #B84040;
  --red-lt:    #F0D0D0;
  --text:      #312C51;
  --text2:     #48426D;
  --muted:     #8878A0;
  --border:    #C8C0D8;
  --sep:       rgba(49,44,81,.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  height: 100%;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input  { font-family: inherit; }

/* ── App shell ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Header ── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--hdr-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  z-index: 200;
  max-width: 480px;
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: var(--hdr-h);
  padding: 0 20px 12px;
  gap: 12px;
}

.header-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.8px;
  color: var(--text);
  line-height: 1;
}

.header-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 400;
  letter-spacing: .1px;
}

/* ── Tema-toggle ── */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background .15s;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.theme-toggle:active { background: var(--border); }

/* ── Main (scrollable) ── */
.main {
  position: fixed;
  top: calc(var(--hdr-h) + var(--safe-top));
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bot));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 96px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Views ── */
.view { display: flex; flex-direction: column; gap: 12px; }
.view.hidden { display: none; }

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
}

/* ── Progress card ── */
.progress-card {
  padding: 16px 18px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.progress-frac {
  font-weight: 700;
  color: var(--primary);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  width: 0%;
  transition: width .4s cubic-bezier(.4,0,.2,1),
              background .3s ease;
}

/* ── Habit card ── */
.habit-card {
  display: flex;
  flex-direction: column;
  transition: opacity .15s;
}

.habit-card.done { opacity: .5; }

.habit-card-top {
  display: flex;
  align-items: center;
  padding: 16px 16px 16px 18px;
  gap: 14px;
  width: 100%;
}

.habit-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  min-width: 0;
}

.habit-emoji-wrap {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
}

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

.habit-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.2px;
}

.habit-name.crossed { text-decoration: line-through; color: var(--muted); }

.habit-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 500;
}

/* Check button */
.habit-check {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  transition: background .2s, border-color .2s, transform .15s;
  color: white;
}

.habit-check:active { transform: scale(.88); }

.habit-check.done {
  border-color: transparent;
  background: var(--primary);
}

/* ── Filter chips (todos) ── */
.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
  letter-spacing: .1px;
}

.chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── Todo item ── */
.todo-item {
  display: flex;
  flex-direction: column;
  transition: opacity .15s;
}

.todo-item-top {
  display: flex;
  align-items: flex-start;
  padding: 16px 18px;
  gap: 14px;
  width: 100%;
}

.todo-item.done { opacity: .45; }

.todo-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 11px;
  color: white;
  transition: background .2s, border-color .2s, transform .15s;
}

.todo-check:active { transform: scale(.85); }

.todo-check.done {
  background: var(--primary);
  border-color: transparent;
}

.todo-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.todo-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  letter-spacing: -.1px;
}

.todo-title.crossed {
  text-decoration: line-through;
  color: var(--muted);
}

.todo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.prio-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prio-dot.high   { background: var(--red); }
.prio-dot.medium { background: var(--orange); }
.prio-dot.low    { background: var(--primary); }

.todo-emoji {
  margin-right: 4px;
  font-style: normal;
}

.todo-edit-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: background .15s;
}
.todo-edit-btn:active { background: var(--surface2); }

/* ── Done section (todos) ── */
.done-wrapper { margin-top: 4px; }

.done-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.done-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: transform .25s;
  display: inline-block;
}

.done-arrow.open { transform: rotate(90deg); }

/* ── FAB ── */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--nav-h) + var(--safe-bot) + 16px);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: transform .15s, opacity .15s;
}

.fab:active {
  transform: scale(.92);
  opacity: .85;
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: var(--bg);
  border-top: 1.5px solid var(--border);
  display: flex;
  z-index: 200;
  max-width: 480px;
  margin: 0 auto;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  transition: color .15s;
  padding-top: 6px;
}

.nav-btn.active { color: var(--text); }

.nav-icon { display: block; }

.nav-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Empty state ── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
  text-align: center;
}

.empty.hidden { display: none; }

.empty-icon { font-size: 44px; margin-bottom: 16px; }

.empty-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.3px;
}

.empty-sub {
  font-size: 14px;
  color: var(--muted);
}

/* ── Overlay + Sheet ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in .2s ease;
}

.overlay.hidden { display: none; }

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

.sheet {
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border: 1.5px solid var(--border);
  border-bottom: none;
  padding: 0 20px calc(20px + var(--safe-bot));
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slide-up .3s cubic-bezier(.4,0,.2,1);
}

.sheet-tall { max-height: 96vh; }

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-drag {
  width: 36px; height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 12px auto 20px;
}

.sheet-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 22px;
  letter-spacing: -.4px;
  color: var(--text);
}

/* ── Form fields ── */
.field-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  margin-top: 20px;
}

.field-lbl:first-of-type { margin-top: 0; }

.optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

.field-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}

.field-input:focus { border-color: var(--primary); background: var(--surface); }

/* ── Emoji picker ── */
.emoji-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emoji-selected-display {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  background: var(--primary-lt);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  align-self: flex-start;
  transition: background .2s;
}

.emoji-selected-display.emoji-optional {
  background: var(--surface2);
  border-color: var(--border);
}

.emoji-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.emoji-cats::-webkit-scrollbar { display: none; }

.emoji-cat {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1.5px solid transparent;
  transition: border-color .15s, background .15s;
}

.emoji-cat.active {
  border-color: var(--primary);
  background: var(--primary-lt);
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 148px;
  overflow-y: auto;
  scrollbar-width: none;
  padding-right: 2px;
}
.emoji-picker-grid::-webkit-scrollbar { display: none; }

.emoji-opt {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1.5px solid transparent;
  transition: border-color .12s, transform .1s, background .12s;
  line-height: 1;
}

.emoji-opt.active {
  border-color: var(--primary);
  background: var(--primary-lt);
  transform: scale(1.1);
}

.emoji-opt:active { transform: scale(.9); }

/* ── Segmented control ── */
.seg {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 3px;
  border: 1.5px solid var(--border);
}

.seg-btn {
  flex: 1 1 auto;
  padding: 9px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

/* ── Color picker ── */
.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  outline: 2px solid transparent;
  transition: outline-color .15s, transform .1s;
}

.color-btn.active {
  outline-color: currentColor;
  outline-offset: 2px;
  transform: scale(1.15);
}

/* ── Priority selector ── */
.prio-row {
  display: flex;
  gap: 8px;
}

.prio-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}

.prio-btn.active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* ── Underopgaver på kort ── */
.subtask-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.subtask-toggle-btn:active { background: var(--sep); }
.subtask-toggle-count { font-variant-numeric: tabular-nums; }
.subtask-toggle-arrow { font-size: 9px; }

.subtasks-section {
  border-top: 1.5px solid var(--sep);
  padding: 8px 18px 12px 18px;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.subtask-check-btn {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  color: white;
  transition: background .15s, border-color .15s, transform .1s;
}

.subtask-check-btn:active { transform: scale(.85); }

.subtask-check-btn.done {
  background: var(--primary);
  border-color: transparent;
}

.subtask-label {
  font-size: 14px;
  color: var(--text2);
  flex: 1;
  text-align: left;
}

.subtask-label.crossed {
  text-decoration: line-through;
  color: var(--muted);
}

/* ── Note på habit-kort ── */
.habit-note-section {
  border-top: 1.5px solid var(--sep);
  padding: 8px 16px 12px 16px;
}
.habit-note-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 0;
}

/* Note-felt i formular */
.habit-note-input {
  resize: vertical;
  min-height: 90px;
}

/* ── Underopgaver i formular ── */
.subtask-form-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

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

.subtask-form-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}

.subtask-form-input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.subtask-form-delete {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--red-lt);
  color: var(--red);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-subtask-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1.5px dashed var(--border);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: background .15s;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.add-subtask-btn:active { background: var(--primary-lt); }

/* ── Time-of-day selector ── */
.time-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.time-btn {
  padding: 11px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}

.time-btn.active {
  border-color: var(--primary);
  background: var(--primary-lt);
  color: var(--primary);
}

/* ── Time-of-day group headers ── */
.time-group-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 20px 4px 6px;
}

.time-group-header:first-child {
  padding-top: 4px;
}

/* ── Sheet actions ── */
.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
}

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: opacity .15s, transform .1s;
  letter-spacing: .1px;
}

.btn:active { opacity: .75; transform: scale(.98); }

.btn-primary  { background: var(--text); color: var(--bg); }
.btn-secondary{ background: var(--surface2); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost    { background: transparent; color: var(--muted); font-weight: 600; }
.btn-danger   { background: var(--red-lt); color: var(--red); }
.btn.hidden   { display: none; }

/* ── History sheet ── */
.hist-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.hist-emoji {
  font-size: 32px;
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
}

/* ── Stats row ── */
.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.stat-box {
  flex: 1;
  background: var(--surface2);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.5px;
}

.stat-lbl-sm {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ── Calendar ── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 12px;
}

.cal-wrap { overflow-x: auto; padding-bottom: 4px; }

.cal-labels {
  display: grid;
  grid-template-rows: repeat(7, 18px);
  grid-auto-flow: column;
  gap: 3px;
  float: left;
  margin-right: 6px;
  padding-top: 1px;
}

.cal-labels span {
  font-size: 10px;
  color: var(--muted);
  height: 18px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.cal-grid {
  display: grid;
  grid-template-rows: repeat(7, 18px);
  grid-auto-flow: column;
  grid-auto-columns: 18px;
  gap: 3px;
  overflow-x: auto;
}

.cal-cell {
  width: 18px; height: 18px;
  border-radius: 3px;
  background: var(--border);
  transition: background .2s;
}

.cal-cell.today {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.cal-cell.future { opacity: .2; }

.cal-cell.empty-cell { background: transparent; }

/* Weekly habit calendar */
.cal-weekly {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.cal-week-cell {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.cal-week-cell.filled { color: white; }

.cal-week-cell.this-week {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  clear: both;
}

.cal-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.cal-dot.empty { background: var(--border); }
.cal-dot.full  { background: var(--primary); }

/* ── Udsæt-knap ── */
.habit-postpone {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
  transition: background .15s, color .15s, border-color .15s;
}

.habit-postpone:active {
  background: var(--orange-lt);
  color: var(--orange);
  border-color: var(--orange);
}

/* ── Udsæt-badges ── */
.postpone-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.postpone-badge--in {
  color: var(--orange);
  background: var(--orange-lt);
}

.postpone-badge--out {
  color: var(--muted);
  background: var(--surface2);
}

/* ── Divider between cards ── */
#habits-list .habit-card + .habit-card,
#todos-active .todo-item + .todo-item,
#todos-done .todo-item + .todo-item {
  border-top: 1.5px solid var(--sep);
}

#habits-list .habit-card:first-child { border-radius: var(--r) var(--r) 0 0; }
#habits-list .habit-card:last-child  { border-radius: 0 0 var(--r) var(--r); }
#habits-list .habit-card:only-child  { border-radius: var(--r); }

#todos-active .todo-item:first-child,
#todos-done   .todo-item:first-child { border-radius: var(--r) var(--r) 0 0; }
#todos-active .todo-item:last-child,
#todos-done   .todo-item:last-child  { border-radius: 0 0 var(--r) var(--r); }
#todos-active .todo-item:only-child,
#todos-done   .todo-item:only-child  { border-radius: var(--r); }

/* ══════════════════════════════════════════
   UGESTRIP
══════════════════════════════════════════ */

.week-strip {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.week-arrow {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  font-size: 20px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  line-height: 1;
}

.week-arrow:active { background: var(--border); }

.week-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  border-radius: var(--r-sm);
  transition: background .15s;
  position: relative;
}

.day-btn:active { background: var(--surface2); }

.day-btn-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.day-btn-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  transition: background .15s, color .15s;
}

.day-btn.is-today .day-btn-lbl { color: var(--primary); }
.day-btn.is-today .day-btn-num { color: var(--primary); }

.day-btn.selected .day-btn-num {
  background: var(--text);
  color: var(--bg);
}

.day-btn.is-today.selected .day-btn-num {
  background: var(--primary);
  color: white;
}

.day-btn-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  transition: opacity .15s;
}

.day-btn.has-habits .day-btn-dot { opacity: 1; }
.day-btn.selected    .day-btn-dot { opacity: 0; }

.day-btn.future .day-btn-num { color: var(--muted); opacity: .4; }

.today-btn {
  align-self: center;
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  transition: background .15s;
}

.today-btn:active { background: var(--border); }

/* ══════════════════════════════════════════
   DAG-VÆLGER
══════════════════════════════════════════ */

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-tog {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
  border: 1.5px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}

.day-tog.active {
  background: var(--primary-lt);
  color: var(--primary);
  border-color: var(--primary);
}

/* ══════════════════════════════════════════
   STATISTIK
══════════════════════════════════════════ */

.period-row {
  display: flex;
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 4px;
  gap: 4px;
}

.period-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  transition: background .15s, color .15s;
}

.period-btn.active {
  background: var(--text);
  color: var(--bg);
}

.score-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-wrap { flex-shrink: 0; }

.donut {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, var(--border) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .5s ease;
}

.donut-inner {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}

.score-info { flex: 1; min-width: 0; }

.score-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 4px;
}

.score-big {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.5px;
}

.score-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}

.score-period-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.stats-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 0 2px;
  margin-top: 6px;
}

.habit-stat-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.habit-stat-card + .habit-stat-card { margin-top: 8px; }

.hsc-emoji {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
}

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

.hsc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
  letter-spacing: -.1px;
}

.hsc-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 5px;
}

.hsc-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.hsc-meta {
  font-size: 12px;
  color: var(--muted);
}

.hsc-right {
  text-align: right;
  flex-shrink: 0;
}

.hsc-rate {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: block;
  letter-spacing: -.3px;
}

.hsc-streak {
  font-size: 12px;
  color: var(--muted);
}

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

.highlight-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.highlight-card.full-width {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.hl-icon { font-size: 22px; }

.hl-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.hl-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.4px;
}

.hl-name {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ══════════════════════════════════════════
   PLANLAGTE OPGAVER
══════════════════════════════════════════ */

.schedule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 6px;
}

.schedule-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.scheduled-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  background: var(--surface);
  transition: opacity .15s;
}

.scheduled-item.done { opacity: .45; }

.scheduled-check {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  color: white;
  transition: background .2s, border-color .2s, transform .1s;
}

.scheduled-check:active { transform: scale(.85); }

.scheduled-check.done {
  background: var(--primary);
  border-color: transparent;
}

.scheduled-body {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.scheduled-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scheduled-title.crossed {
  text-decoration: line-through;
  color: var(--muted);
}

.scheduled-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.task-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-lt);
  padding: 3px 9px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .4px;
}

#scheduled-list .scheduled-item:first-child { border-radius: var(--r) var(--r) 0 0; }
#scheduled-list .scheduled-item:last-child  { border-radius: 0 0 var(--r) var(--r); }
#scheduled-list .scheduled-item:only-child  { border-radius: var(--r); }
#scheduled-list .scheduled-item + .scheduled-item { border-top: 1.5px solid var(--sep); }

/* ══════════════════════════════════════════
   DATO-FELT
══════════════════════════════════════════ */

.date-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-input { flex: 1; min-width: 0; }

input[type="date"].field-input {
  -webkit-appearance: none;
  appearance: none;
  color: var(--text);
}

input[type="date"].field-input::-webkit-calendar-picker-indicator {
  opacity: .4;
  cursor: pointer;
}

.date-today-btn {
  flex-shrink: 0;
  padding: 13px 14px;
  border-radius: var(--r-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity .15s;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.date-today-btn:active { opacity: .75; }

.date-clear-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: var(--red-lt);
  color: var(--red);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.date-clear-btn:active { background: var(--border); }

.todo-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-lt);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ── Søgefelt ── */
.search-wrap {
  position: relative;
  margin-bottom: 2px;
}

.search-input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
  font-weight: 500;
}

.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--muted); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  color: var(--muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--surface);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tilbagevendende opgaver ── */
.recur-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recur-btn {
  padding: 11px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}

.recur-btn.active {
  border-color: var(--primary);
  background: var(--primary-lt);
  color: var(--primary);
}

.recur-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-lt);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ── Dag-i-måneden vælger ── */
.monthday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.monthday-btn {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
  border: 1.5px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}

.monthday-btn.active {
  background: var(--primary-lt);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Fortryd udsætning ── */
.postpone-undo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
  transition: background .15s, color .15s, border-color .15s;
}

.postpone-undo:active {
  background: var(--primary-lt);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Postpone datovælger popup ── */
.postpone-picker {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,.45);
}
.postpone-picker.hidden { display: none; }

.postpone-picker-inner {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 36px;
  width: 100%;
  max-width: 480px;
}

.postpone-picker-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  margin-bottom: 16px;
}

.postpone-date-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.postpone-date-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.postpone-date-btn .pdb-day { font-size: 11px; color: var(--text2); }
.postpone-date-btn .pdb-num { font-size: 20px; font-weight: 700; }
.postpone-date-btn:active,
.postpone-date-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.postpone-date-btn:active .pdb-day,
.postpone-date-btn:hover .pdb-day { color: rgba(255,255,255,.8); }

.postpone-cancel-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border-radius: 14px;
  border: none;
  background: var(--sep);
  color: var(--text2);
  font-size: 15px;
  font-weight: 600;
}

/* ── Settings beskrivelse ── */
.settings-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Pause-badge i statistik ── */
.hsc-pause-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  background: var(--orange-lt);
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ══════════════════════════════════════════
   FAB MENU
══════════════════════════════════════════ */

.fab {
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .15s;
}

.fab.menu-open {
  transform: rotate(45deg);
}

.fab.menu-open:active {
  transform: rotate(45deg) scale(.92);
}

.fab-menu {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h) + var(--safe-bot) + 76px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  z-index: 151;
  min-width: 172px;
  animation: slide-up .2s cubic-bezier(.4,0,.2,1);
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background .15s;
}

.fab-menu-item:active { background: var(--surface2); }

.fab-menu-item + .fab-menu-item {
  border-top: 1.5px solid var(--sep);
}

.fab-menu-icon { font-size: 19px; }

.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 149;
}

/* ══════════════════════════════════════════
   PAUSE
══════════════════════════════════════════ */

.hist-pause-wrap {
  margin-bottom: 22px;
}

.pause-active-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--orange-lt);
  border: 1.5px solid var(--orange);
  border-radius: var(--r);
}

.pause-icon { font-size: 20px; }

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

.pause-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.pause-dates-display {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 3px;
}

.pause-clear-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}

.pause-clear-btn:active { opacity: .7; }

.set-pause-btn { width: 100%; }

.pause-form { margin-top: 12px; }

.pause-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ══════════════════════════════════════════
   KONFETTI
══════════════════════════════════════════ */

#confetti-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: absolute;
  top: 0;
  animation: confetti-fall linear forwards;
}

/* ══════════════════════════════════════════
   STATISTIK — HERO + HEATMAP
══════════════════════════════════════════ */

.stats-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 18px 0 8px;
}

/* Hero-kort */
.hero-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  margin-bottom: 4px;
}

/* Ring */
.hero-ring-wrap { flex-shrink: 0; }
.hero-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, var(--sep) 0%);
  display: flex; align-items: center; justify-content: center;
  transition: background .4s;
}
.hero-ring-inner {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
}
.hero-pct      { font-size: 22px; font-weight: 700; line-height: 1; }
.hero-pct-label { font-size: 11px; color: var(--text2); }

/* Right column */
.hero-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero-motiv { font-size: 14px; font-weight: 600; margin: 0; }
.hero-sub   { font-size: 12px; color: var(--text2); margin: 0; }
.hero-streak { font-size: 12px; color: var(--text2); margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Uge-stave */
.week-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 52px;
  margin-top: 8px;
}
.week-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.week-bar-col.today .week-bar-label { color: var(--primary); font-weight: 700; }
.week-bar-label { font-size: 10px; color: var(--text2); }
.week-bar-track {
  width: 100%;
  max-width: 22px;
  height: 28px;
  background: var(--sep);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.week-bar-fill {
  width: 100%;
  border-radius: 3px;
  transition: height .3s;
  min-height: 2px;
}
.week-bar-num { font-size: 9px; color: var(--text2); }

/* Heatmap-kort */
.hm-card {
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.hm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.hm-emoji {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.hm-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-name  { font-size: 15px; font-weight: 600; }
.hm-freq  { font-size: 12px; color: var(--text2); }
.hm-stats-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hm-pct       { font-size: 20px; font-weight: 700; }
.hm-pct-label { font-size: 11px; color: var(--text2); }

/* Heatmap grid */
.hm-grid {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.hm-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hm-cell {
  width: 12px; height: 12px;
  border-radius: 2px;
}
.hm-done     { /* color set inline */ }
.hm-miss     { background: var(--red); opacity: .5; }
.hm-inactive { background: var(--sep); }
.hm-future   { background: transparent; border: 1px dashed var(--border); }

/* Footer */
.hm-footer {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text2);
  flex-wrap: wrap;
}
.hm-foot-sep { color: var(--border); }
.hm-foot-item strong { color: var(--text); }

/* ══════════════════════════════════════════
   INDKØBSLISTE
══════════════════════════════════════════ */

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 8px;
}
.shop-item.done { opacity: .55; }

.shop-item-emoji {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.shop-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--card);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.shop-check.done { background: var(--green); border-color: var(--green); color: #fff; }

.shop-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-title { font-size: 15px; }
.shop-title.crossed { text-decoration: line-through; color: var(--text2); }
.shop-promo-badge { font-size: 11px; color: var(--text2); }

.shop-promo-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 0 4px;
  cursor: pointer;
  opacity: .6;
  flex-shrink: 0;
}
.shop-promo-btn:active { opacity: 1; }

.shop-delete-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 14px;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: .5;
}
.shop-delete-btn:active { opacity: 1; }

.shop-add-wrap { margin-top: 16px; text-align: center; }
.shop-add-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.shop-add-btn:active { opacity: .8; }

/* Dato-vælger */
.shop-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}
.shop-picker.hidden { display: none !important; }
.shop-picker-inner {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px;
  width: 100%;
}
.shop-picker-title {
  font-size: 15px; font-weight: 600;
  text-align: center; margin: 0 0 14px;
}
.shop-date-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.shop-date-btn {
  background: var(--sep);
  border: none;
  border-radius: 10px;
  padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
}
.shop-date-btn:active { opacity: .7; }
.shop-date-day { font-size: 11px; color: var(--text2); }
.shop-date-num { font-size: 13px; font-weight: 600; }
.shop-cancel-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  color: var(--text2);
  cursor: pointer;
}

/* ══════════════════════════════════════════
   PROJEKTER
══════════════════════════════════════════ */

/* Projektkort */
.proj-card {
  padding: 14px 14px 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .1s;
}
.proj-card:active { transform: scale(.98); }
.proj-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.proj-card-title  { font-size: 16px; font-weight: 600; }
.proj-card-pct    { font-size: 15px; font-weight: 700; }
.proj-card-desc   { font-size: 13px; color: var(--text2); margin: 0 0 8px; }
.proj-card-no-steps { font-size: 12px; color: var(--text2); margin: 4px 0 0; }
.proj-card-progress { display: flex; align-items: center; gap: 8px; }
.proj-card-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--sep);
  border-radius: 3px;
  overflow: hidden;
}
.proj-card-bar  { height: 100%; border-radius: 3px; transition: width .4s; }
.proj-card-frac { font-size: 12px; color: var(--text2); white-space: nowrap; }

/* Fuld-skærm detalje */
.proj-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.proj-detail-overlay.hidden { display: none !important; }

.proj-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sep);
  flex-shrink: 0;
}
.proj-detail-back {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.proj-detail-edit-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 15px;
  cursor: pointer;
}

.proj-detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 80px;
}
.proj-detail-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.2;
}
.proj-detail-desc {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 0 0 20px;
}
.proj-detail-desc.empty { display: none; }
.proj-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 10px;
}
.proj-links-section { margin-bottom: 20px; }
.proj-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-radius: 10px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--primary);
}
.proj-link-icon  { font-size: 16px; flex-shrink: 0; }
.proj-link-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Trin i detalje */
.proj-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border-radius: 10px;
  margin-bottom: 8px;
}
.proj-step.done { opacity: .55; }
.proj-step-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: #fff;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.proj-step-check.done { background: var(--green); border-color: var(--green); }
.proj-step-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.proj-step-title { font-size: 15px; }
.proj-step-title.crossed { text-decoration: line-through; color: var(--text2); }
.proj-step-badge { font-size: 11px; color: var(--text2); }
.proj-step-cal {
  background: transparent; border: none;
  font-size: 18px; padding: 0 4px; cursor: pointer; opacity: .6; flex-shrink: 0;
}
.proj-step-cal:active { opacity: 1; }
.proj-step-delete {
  background: transparent; border: none;
  color: var(--text2); font-size: 14px; padding: 0 2px; cursor: pointer; opacity: .5; flex-shrink: 0;
}
.proj-steps-empty { font-size: 13px; color: var(--text2); }

.proj-quick-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.proj-quick-add .field-input { flex: 1; margin: 0; }
.proj-quick-add-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.proj-quick-add-btn:active { opacity: .8; }

/* Formular */
.proj-color-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px;
}
.proj-color-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}
.proj-color-dot.active { border-color: var(--text); transform: scale(1.15); }
.proj-link-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.proj-link-url, .proj-link-lbl { font-size: 13px; }
.proj-link-del {
  background: transparent; border: none;
  color: var(--text2); font-size: 15px; cursor: pointer; padding: 4px;
}
.proj-step-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.btn-sm { font-size: 13px; padding: 6px 12px; margin-bottom: 4px; }
.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  width: 100%;
  cursor: pointer;
  margin-top: 8px;
}
.sheet-tall { max-height: 92vh; overflow-y: auto; }

/* ══════════════════════════════════════════
   MÅNEDSOVERBLIK
══════════════════════════════════════════ */

.month-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.month-row-emoji {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.month-row-mid  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.month-row-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-row-bar-wrap {
  height: 6px;
  background: var(--sep);
  border-radius: 3px;
  overflow: hidden;
}
.month-row-bar  { height: 100%; border-radius: 3px; transition: width .4s; min-width: 2px; }
.month-row-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0;
}
.month-row-pct    { font-size: 18px; font-weight: 700; }
.month-row-streak { font-size: 11px; color: var(--text2); }
.month-empty      { font-size: 13px; color: var(--text2); margin: 4px 0 12px; }

/* Nulstil streaks */
.reset-streaks-wrap { margin: 4px 0 20px; text-align: center; }
.reset-streaks-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.reset-streaks-btn.confirm {
  border-color: var(--red);
  color: var(--red);
}
.reset-streaks-btn:active { opacity: .7; }

/* ══════════════════════════════════════════
   RAPPORTER
══════════════════════════════════════════ */

.report-card {
  padding: 14px;
  margin-bottom: 10px;
}
.report-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.report-icon  { font-size: 24px; flex-shrink: 0; }
.report-label { font-size: 15px; font-weight: 600; }
.report-range { font-size: 12px; color: var(--text2); }
.report-score { font-size: 24px; font-weight: 700; margin-left: auto; }
.report-grade { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.report-empty { font-size: 13px; color: var(--text2); margin: 4px 0 0; }

.report-rows  { display: flex; flex-direction: column; gap: 8px; }
.report-row   {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  align-items: center;
  gap: 6px;
}
.report-row-emoji { font-size: 15px; }
.report-row-name  { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-row-bar-wrap {
  height: 6px;
  background: var(--sep);
  border-radius: 3px;
  overflow: hidden;
}
.report-row-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s;
}
.report-row-pct { font-size: 12px; font-weight: 600; min-width: 34px; text-align: right; }

/* ── Utilities ── */
.hidden     { display: none !important; }
.text-muted { font-size: 13px; color: var(--muted); }
