/* ═══════════════════════════════════════════════════════════
   tidy — soft & friendly: muted pastels, rounded, airy
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream:      #FAF6EF;
  --cream-deep: #F3EDE1;
  --ink:        #3E4239;
  --ink-soft:   #7C8074;
  --ink-faint:  #A9AC9F;

  --sage:       #86A68F;
  --sage-soft:  #DCE8DD;
  --sage-tint:  #EEF4EE;
  --rose:       #D9A5A0;
  --rose-tint:  #F7E9E6;
  --butter:     #E9D8A6;
  --butter-tint:#FAF3DE;
  --sky:        #A8C3CF;
  --sky-tint:   #E7F0F3;
  --lilac:      #B9AECB;
  --lilac-tint: #EEEAF4;

  --card:       #FFFFFF;
  --line:       #EAE4D6;
  --danger:     #C97B72;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 1px 2px rgba(62,66,57,.04), 0 8px 24px rgba(62,66,57,.06);
  --shadow-lift: 0 2px 4px rgba(62,66,57,.05), 0 14px 34px rgba(62,66,57,.10);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", -apple-system, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* subtle atmosphere: two soft pastel washes */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 40% at 85% -5%, var(--rose-tint) 0%, transparent 70%),
    radial-gradient(70% 45% at 5% 100%, var(--sage-tint) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 100px);
}

.hidden { display: none !important; }

/* ── type ─────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 28px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sage);
  margin-bottom: 2px;
}

/* ── auth ─────────────────────────────────────────────────── */
.auth-card {
  margin-top: 8vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 36px 26px 30px;
  text-align: center;
}
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 0 0 1.5px var(--line); }
.brand h1 { font-size: 40px; font-weight: 600; }
.tagline { color: var(--ink-soft); margin: 14px 0 28px; font-size: 15px; }

#auth-form { text-align: left; }
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"] {
  width: 100%;
  font: inherit;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.field input:focus { border-color: var(--sage); background: #fff; }
.field input::placeholder { color: var(--ink-faint); }
.field-opt { font-style: normal; font-weight: 500; color: var(--ink-faint); font-size: 12px; }

.form-error { color: var(--danger); font-size: 13.5px; min-height: 18px; margin: -6px 0 8px; }

.link-btn {
  background: none; border: none; font: inherit;
  color: var(--ink-soft); cursor: pointer; margin-top: 18px;
}
.link-btn strong { color: var(--sage); }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  font: inherit; font-weight: 700;
  border: none; border-radius: 999px;
  padding: 14px 22px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  width: 100%;
  background: var(--sage); color: #fff;
  box-shadow: 0 6px 16px rgba(134,166,143,.35);
}
.btn-primary:disabled { opacity: .6; }
.btn-ghost { background: var(--cream-deep); color: var(--ink-soft); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 50%; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ── topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.sort-toggle {
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
  transition: all .15s;
}
.sort-toggle[aria-pressed="true"] { background: var(--sage-tint); color: var(--sage); border-color: var(--sage); }

/* ── today rows & tags ────────────────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 10px; }

.area-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent, var(--sage)); background: var(--accent-tint, var(--sage-tint));
  padding: 3px 9px; border-radius: 999px; flex: none;
}
.tag-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--cream-deep);
  padding: 3px 9px; border-radius: 999px; flex: none;
}
.prio-mark {
  font-size: 12px; font-weight: 800; line-height: 1;
  color: var(--rose); flex: none;
}
.extra-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-tint, rgba(212, 175, 55, .15));
  padding: 3px 9px; border-radius: 999px; flex: none;
}

.empty {
  text-align: center; padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-spark { font-size: 42px; color: var(--butter); margin-bottom: 14px; }

#today-more { margin-top: 18px; text-align: center; }
#today-vacation .btn-more { margin-top: 16px; }
.btn-more {
  font: inherit; font-weight: 700;
  background: var(--card); color: var(--sage);
  border: 1.5px dashed var(--sage);
  border-radius: 999px; padding: 13px 26px; cursor: pointer;
  transition: transform .12s, background .15s;
}
.btn-more:active { transform: scale(.97); background: var(--sage-tint); }

/* ── similar chores ("Fler som passar") ── */
.similar { margin-top: 18px; }
.similar-toggle {
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 700;
  color: var(--sage); background: none; border: none;
  padding: 6px 0; cursor: pointer;
}
.similar-toggle svg { width: 15px; height: 15px; flex: none; transition: transform .25s; }
.similar-toggle[aria-expanded="true"] svg { transform: rotate(45deg); }
.similar-toggle:active { opacity: .7; }
.similar-list { display: flex; flex-direction: column; gap: 8px; }
.similar-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
  animation: rise .3s cubic-bezier(.32,.72,.25,1) both;
}
.similar-item:nth-child(2) { animation-delay: .05s; }
.similar-item:nth-child(3) { animation-delay: .1s; }
.similar-item .info { flex: 1; min-width: 0; }
.similar-item .info strong { display: block; font-size: 14px; line-height: 1.3; }
.similar-item .info small { color: var(--ink-faint); font-size: 12px; }
.similar-add {
  font: inherit; font-size: 12.5px; font-weight: 700; flex: none;
  color: var(--sage); background: var(--sage-tint);
  border: none; border-radius: 999px; padding: 7px 13px; cursor: pointer;
  transition: transform .12s;
}
.similar-add:active { transform: scale(.95); }
.similar-empty { font-size: 13px; color: var(--ink-faint); padding: 4px 0; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.done-section { margin-top: 28px; }
.done-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  font: inherit; background: none; border: none; padding: 0;
  cursor: pointer; margin-bottom: 10px;
}
.done-toggle svg {
  width: 14px; height: 14px; color: var(--ink-faint);
  transition: transform .22s ease;
}
.done-toggle.collapsed svg { transform: rotate(-90deg); }
.done-count {
  font-size: 11px; font-weight: 700; color: var(--sage);
  background: var(--sage-tint); border-radius: 999px; padding: 2px 8px;
}
.done-heading {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
}
#today-done-list { display: flex; flex-direction: column; gap: 10px; }
#today-done-list .list-item { cursor: default; }

.offline-pill {
  margin: 22px auto 0; width: fit-content;
  font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft);
  background: var(--butter-tint);
  border: 1.5px dashed var(--butter);
  padding: 8px 16px; border-radius: 999px;
}

/* ── all-chores list ──────────────────────────────────────── */
.search-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}
.search-field svg { width: 17px; height: 17px; color: var(--ink-faint); flex: none; }
.search-field input {
  flex: 1; font: inherit; border: none; outline: none;
  background: transparent; color: var(--ink);
  -webkit-appearance: none;
}
.search-field input::placeholder { color: var(--ink-faint); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  flex: none; width: 22px; height: 22px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--line); color: var(--ink-soft);
  cursor: pointer; padding: 0; margin-left: -4px;
}
.search-clear svg { width: 11px; height: 11px; }
.search-clear:active { transform: scale(.92); }
.search-clear.hidden { display: none; }

#chore-list { display: flex; flex-direction: column; gap: 10px; }
.list-done-head {
  display: flex; align-items: center; gap: 8px;
  margin: 26px 0 10px;
}

.list-item {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 13px 16px;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
/* pinned (in-progress): a thin ring in the room's accent color —
   the FÄST chip's quieter replacement. Compensate the border width in
   padding so the card doesn't jump when the ring appears. */
.list-item.is-pinned {
  border: 1.5px solid var(--accent, var(--sage));
  padding: 11.5px 14.5px;
}
.row-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-main { display: flex; align-items: center; gap: 12px; }
.list-item.done-today { opacity: .55; }
.list-item.done-today .info strong { text-decoration: line-through; }
.list-item.paused { opacity: .45; }

/* urgency dot: small colored dot next to the title.
   Escalates with ratio: soon → due → critical. Never-done = no dot. */
.due-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-left: 7px;
  vertical-align: 1px;
}
.due-dot.due-soon { background: #E3C87E; }
.due-dot.due-now { background: #E8A87C; }
.due-dot.due-critical { background: var(--rose); }

.pause-btn {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--ink-faint);
  background: transparent; color: var(--ink-faint);
  cursor: pointer; padding: 0;
}
.pause-btn svg { width: 12px; height: 12px; }


.complete-btn {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--accent, var(--sage));
  background: transparent; color: transparent;
  cursor: pointer; padding: 0;
  transition: background .15s, color .15s, transform .12s;
}
.complete-btn svg { width: 15px; height: 15px; }
.complete-btn:active { transform: scale(.9); background: var(--accent, var(--sage)); color: #fff; }
.list-item.done-today .complete-btn { background: var(--accent, var(--sage)); color: #fff; }
.list-item .dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--accent, var(--sage)); }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info strong { display: block; font-size: 15px; line-height: 1.3; }
.list-item .info small { color: var(--ink-faint); font-size: 12.5px; }
.list-item .snoozed-tag {
  font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--ink-soft);
  background: var(--cream-deep); padding: 3px 9px; border-radius: 999px;
  border: none; cursor: pointer; flex: none;
  transition: background .15s, color .15s;
}
.list-item .snoozed-tag:active { background: var(--rose); color: #fff; }

/* ── tab bar ──────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 14px);
  display: flex; gap: 4px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-lift);
  z-index: 50;
}
.tabbar::before {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px;
  left: var(--tab-left, 6px);
  width: var(--tab-width, 60px);
  border-radius: 999px;
  background: var(--sage-tint);
  z-index: 0;
  transition: left .28s cubic-bezier(.32,.72,.28,1), width .28s cubic-bezier(.32,.72,.28,1);
  opacity: 0;
}
.tabbar[data-active]::before { opacity: 1; }
.tab {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit; font-size: 11px; font-weight: 700;
  color: var(--ink-faint);
  background: none; border: none; border-radius: 999px;
  padding: 8px 22px 6px; cursor: pointer;
  transition: color .15s;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--sage); }

/* ── sheets ───────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(62,66,57,.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 90;
  animation: fade .2s ease both;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  margin: 0 auto; max-width: 480px;
  max-height: 92vh; max-height: 92dvh;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 14px 24px calc(var(--safe-bottom) + 26px);
  box-shadow: 0 -12px 40px rgba(62,66,57,.16);
  z-index: 100;
  animation: sheet-up .32s cubic-bezier(.32,.72,.25,1) both;
}
.sheet-grab {
  position: relative;
  width: 56px; height: 6px; border-radius: 999px;
  background: var(--line); margin: 6px auto 16px;
  cursor: grab; touch-action: none;
}
.sheet-grab::before { content: ""; position: absolute; inset: -18px; }
.sheet h3 { font-size: 24px; margin-bottom: 20px; touch-action: none; cursor: grab; }
.sheet-actions {
  display: flex; gap: 12px;
  position: sticky;
  bottom: calc(-26px - var(--safe-bottom));
  margin: 18px -24px calc(-26px - var(--safe-bottom));
  padding: 12px 24px calc(26px + var(--safe-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
}
.sheet-actions .btn { flex: 1; }

/* segmented controls */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-type { margin-bottom: 18px; }
.seg-type button { flex: 1; text-align: center; }
.seg button {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 14px;
  background: var(--cream); color: var(--ink-soft);
  border: 1.5px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.seg button.on {
  background: var(--sage-tint); color: var(--sage);
  border-color: var(--sage);
}

.custom-freq {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
}
.custom-freq input {
  width: 74px; font: inherit; font-size: 16px; text-align: center;
  padding: 9px 8px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--cream); color: var(--ink); outline: none;
  -webkit-appearance: none;
}
.custom-freq input:focus { border-color: var(--sage); background: #fff; }


/* snooze menu */
.snooze-menu {
  position: fixed; z-index: 120;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  display: flex; flex-direction: column; min-width: 190px;
  animation: pop-in .18s ease both;
}
.snooze-menu button {
  font: inherit; font-size: 14.5px; font-weight: 600;
  text-align: left; padding: 11px 14px;
  background: none; border: none; border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.snooze-menu button:active { background: var(--cream-deep); }
.snooze-menu button.danger { color: var(--danger); }
#status-menu button { display: flex; align-items: center; gap: 10px; }
#status-menu button svg { width: 17px; height: 17px; flex: none; }

/* toast */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 92px);
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: var(--cream);
  font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lift);
  z-index: 200;
  animation: toast-in .3s ease both;
  white-space: nowrap;
}
.toast-action {
  font: inherit; font-size: 13.5px; font-weight: 700;
  background: none; border: none; cursor: pointer;
  color: var(--butter); letter-spacing: .02em;
}

/* ── animations ───────────────────────────────────────────── */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* delete-in-sheet + area suggestions */

.area-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; margin-bottom: 10px; }
.area-suggestions:empty { display: none; }
.area-sugg {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
}
.area-sugg:active { background: var(--sage-tint); color: var(--sage); border-color: var(--sage); }
.area-sugg.on { background: var(--sage-tint); color: var(--sage); border-color: var(--sage); }

.tag-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; margin-bottom: 10px; }
.tag-suggestions:empty { display: none; }
.tag-sugg {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
}
.tag-sugg.on { background: var(--sage-tint); color: var(--sage); border-color: var(--sage); }

.area-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.area-pill {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); cursor: pointer;
}
.area-pill.on { background: var(--sage-tint); color: var(--sage); border-color: var(--sage); }

/* ── settings view ────────────────────────────────────────── */
.settings-card {
  background: var(--card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 4px 18px; margin-bottom: 12px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-bottom: 1.5px solid var(--line);
  font-weight: 600; font-size: 15px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row > span { font-weight: 600; font-size: 15px; }
.settings-row .seg { flex: none; flex-wrap: nowrap; gap: 4px; }
.settings-row .seg button { padding: 7px 11px; font-size: 13px; }
.settings-row small { color: var(--ink-faint); font-weight: 500; font-size: 13px; display: block; margin-top: 2px; }
#view-settings .notify-hint { flex-basis: 100%; margin: 0; }
#view-settings .settings-row { flex-wrap: wrap; }

/* ── notifications toggle (settings view) ────────────────── */
.notify-field { margin-top: 4px; }
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notify-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notify-label {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.notify-copy small { font-size: 13px; line-height: 1.4; color: var(--ink-faint); }
.switch {
  position: relative; flex: none;
  width: 52px; height: 32px;
  border: none; border-radius: 16px;
  background: var(--line);
  cursor: pointer; padding: 0;
  transition: background .2s ease;
}
.switch[aria-checked="true"] { background: var(--sage); }
.switch:disabled { opacity: .5; cursor: default; }
.switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(62,66,57,.28);
  transition: transform .22s cubic-bezier(.32,.72,.25,1);
}
.switch[aria-checked="true"] .switch-thumb { transform: translateX(20px); }
.notify-hint {
  margin-top: 10px;
  font-size: 13px; line-height: 1.45;
  color: var(--ink-soft);
  background: var(--butter-tint);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ── history view (Historik) ──────────────────────────────── */
#history-list { display: flex; flex-direction: column; gap: 8px; }
.log-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 11px 14px;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  animation: rise .3s cubic-bezier(.32,.72,.25,1) both;
}
.log-row .log-icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-tint, var(--sage-tint));
  color: var(--accent, var(--sage));
}
.log-row .log-icon svg { width: 15px; height: 15px; }
.log-row.orphan .log-icon { background: var(--cream-deep); color: var(--ink-faint); }
.log-row .log-what { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-row .log-what strong { font-size: 14.5px; line-height: 1.3; }
.log-row.orphan .log-what strong { color: var(--ink-faint); font-weight: 600; font-style: italic; }
.log-row .log-when { color: var(--ink-faint); font-size: 12.5px; flex: none; }
.history-more { margin-top: 16px; text-align: center; }

/* confirm + date sheets (leafy-style) */
.confirm-msg { color: var(--ink-soft); margin: -8px 0 20px; }
.btn-danger { background: var(--danger); box-shadow: 0 6px 16px rgba(201,123,114,.35); }
.field input[type="date"] { min-height: 48px; }

/* ── statistik (leafy-inspired) ── */
.stat-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.stat-tile {
  background: var(--card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-tile-val {
  font-family: var(--font-display); font-size: 26px; font-weight: 600;
  color: var(--ink);
}
.stat-tile-label { font-size: 12.5px; color: var(--ink-soft); }

.stat-highlight {
  background: var(--butter-tint); border-radius: var(--radius-md);
  padding: 13px 16px; margin-bottom: 12px;
  font-size: 14px; color: var(--ink);
}

.stat-card {
  background: var(--card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px; margin-bottom: 12px;
}
.stat-card h4 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.stat-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.stat-medal { width: 26px; flex: none; text-align: center; font-size: 15px; }
.stat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-name .stat-area { color: var(--ink-faint); font-weight: 500; }
.stat-val { color: var(--ink-soft); font-weight: 700; font-size: 13px; flex: none; }
.stat-hint { color: var(--ink-faint); font-size: 13.5px; }

/* horizontal bars (weekday, time of day) */
.stat-hbar-row { display: flex; align-items: center; gap: 10px; padding: 3.5px 0; font-size: 13px; }
.stat-hbar-label { width: 92px; flex: none; color: var(--ink-soft); }
.stat-hbar-track { flex: 1; height: 10px; border-radius: 99px; background: var(--cream-deep); overflow: hidden; }
.stat-hbar-fill { display: block; height: 100%; border-radius: 99px; background: var(--sage); transition: width .4s ease; }
.stat-hbar-val { width: 26px; flex: none; text-align: right; color: var(--ink-faint); font-weight: 700; font-size: 12px; }

/* vertical bars (season curve) */
.stat-bars {
  display: flex; align-items: flex-end; gap: 5px;
  height: 112px; margin-top: 6px;
}
.stat-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.stat-bar-num { font-size: 10px; font-weight: 700; color: var(--ink-soft); line-height: 1; min-height: 10px; }
.stat-bar { width: 100%; border-radius: 5px 5px 2px 2px; background: var(--sage); min-height: 3px; }
.stat-bar.zero { background: var(--cream-deep); }
.stat-bar-labels { display: flex; gap: 5px; margin-top: 6px; }
.stat-bar-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-faint); }

/* ═══════════════════════════════════════════════════════════
   päivän sana — app-specific components
   ═══════════════════════════════════════════════════════════ */

/* ── word card (today) ──────────────────────────────────── */
.word-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 180px;
  padding: 30px 28px;
  background: var(--card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.word-card:active { transform: scale(.98); }
.word-card.revealed {
  background: var(--sage-tint);
}

.word-side {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sage);
}
.word-text {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: break-word;
}
.word-hint {
  display: block;
  min-height: 17px;   /* reserve one line so the word never jumps on flip */
  font-size: 13px; color: var(--ink-faint);
}

/* loading state */
.word-card.loading { cursor: default; }
.word-card.loading:active { transform: none; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--sage-tint);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: ps-spin .8s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13.5px; color: var(--ink-soft); }

/* ── history ────────────────────────────────────────────── */
.search-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}
.search-field svg { width: 17px; height: 17px; color: var(--ink-faint); flex: none; }
.search-field input {
  flex: 1; font: inherit; border: none; outline: none;
  background: transparent; color: var(--ink);
  -webkit-appearance: none;
}
.search-field input::placeholder { color: var(--ink-faint); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field:focus-within { border-color: var(--sage); }
.search-clear {
  flex: none; width: 22px; height: 22px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--line); color: var(--ink-soft);
  cursor: pointer; padding: 0;
}
.search-clear svg { padding: 0; }

.word-row {
  display: flex; align-items: baseline; gap: 8px;
  width: 100%;
  padding: 14px 16px;
  background: var(--card);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  font: inherit;
  text-align: left;
}
.word-row-fi { font-weight: 700; color: var(--ink); overflow-wrap: break-word; }
.word-row-sep { color: var(--ink-faint); flex: none; }
.word-row-sv { color: var(--ink-soft); overflow-wrap: break-word; }
.word-row-date {
  margin-left: auto; flex: none;
  font-size: 12px; color: var(--ink-faint);
}

/* ── admin ──────────────────────────────────────────────── */
.admin-form {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 20px;
  margin-bottom: 26px;
}
.admin-section { margin-bottom: 26px; }
.admin-heading {
  font-size: 15px; font-weight: 800;
  margin-bottom: 10px; color: var(--ink);
}
.admin-heading span { color: var(--ink-faint); font-weight: 700; }
.admin-row { cursor: default; }
.row-delete {
  margin-left: auto; flex: none;
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: var(--cream-deep); color: var(--ink-soft);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.row-delete:active { transform: scale(.9); }
.row-delete:hover { background: var(--rose-tint); color: var(--danger); }

/* ── misc ───────────────────────────────────────────────── */
.empty-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 30px 10px;
}

/* tabbar (reuse tidy's if present, else define) */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 14px);
  display: flex; gap: 4px;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  padding: 6px;
  z-index: 10;
  max-width: calc(100vw - 24px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 12px;
  border: none; border-radius: 999px;
  background: none; color: var(--ink-soft);
  font: inherit; font-size: 10.5px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { background: var(--sage-tint); color: var(--sage); }

/* ── exercise (type-the-finnish-word) ───────────────────── */
.exercise {
  margin-top: 14px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}
.exercise .field { margin-bottom: 12px; }

.feedback {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}
.feedback.good { background: var(--sage-tint); color: var(--sage); }
.feedback.bad  { background: var(--rose-tint); color: var(--danger); }

.done-note {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ── practice: reveal answer inside the card ────────────── */
.answer-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%;
}
.answer-divider {
  width: 44px; height: 1.5px;
  background: var(--line);
  margin: 8px 0;
}
.answer-text { font-size: 26px; }

.selfgrade { margin-top: 14px; text-align: center; }
.selfgrade-q { font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }
.selfgrade-btns { display: flex; gap: 10px; }
.selfgrade-btns .btn { flex: 1; }

.next-btn { width: 100%; margin-top: 14px; }

/* ── word detail modal ──────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(62, 66, 57, .35);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative; z-index: 1;
  max-width: 400px;
  min-height: 200px;
}
.modal-close {
  position: absolute; z-index: 2;
  top: calc(var(--safe-top) + 18px);
  right: 18px;
}

/* ── settings ───────────────────────────────────────────── */
.settings-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  cursor: pointer;
}
.toggle-title { font-weight: 800; font-size: 15px; }
.toggle-desc { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.toggle {
  appearance: none; -webkit-appearance: none;
  width: 52px; height: 32px; flex: none;
  border-radius: 999px;
  background: var(--cream-deep);
  position: relative; cursor: pointer;
  transition: background .2s;
  outline: none; margin: 0;
}
.toggle::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(62,66,57,.2);
  transition: transform .2s;
}
.toggle:checked { background: var(--sage); }
.toggle:checked::after { transform: translateX(20px); }
.toggle:disabled { opacity: .5; cursor: default; }
.settings-note {
  margin-top: 14px; padding-top: 14px;
  border-top: 1.5px solid var(--line);
  color: var(--ink-soft); font-size: 13.5px;
}

/* ── push onboarding card ───────────────────────────────── */
.onboarding-card {
  margin-top: 14px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px 22px;
  text-align: center;
}
.onboarding-icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--sage-tint);
  border-radius: 50%;
  color: var(--sage);
}
.onboarding-icon svg { width: 26px; height: 26px; }
.onboarding-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.onboarding-desc { color: var(--ink-soft); font-size: 14px; margin: 6px 0 16px; }
.onboarding-btns { display: flex; gap: 10px; }
.onboarding-btns .btn { flex: 1; }

/* ── Mer popover menu (same pattern as tidy's snooze menu) ── */
.popover-menu {
  position: fixed; z-index: 120;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  display: flex; flex-direction: column; min-width: 200px;
  animation: ps-pop .18s ease both;
}
.popover-menu button {
  display: flex; align-items: center; gap: 10px;
  font: inherit; font-size: 14.5px; font-weight: 600;
  text-align: left; padding: 11px 14px;
  background: none; border: none; border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.popover-menu button svg { width: 18px; height: 18px; flex: none; color: var(--ink-soft); }
.popover-menu button:active { background: var(--cream-deep); }
.popover-menu button.danger { color: var(--danger); }
.popover-menu button.danger svg { color: var(--danger); }
@keyframes ps-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── example sentence on word cards ─────────────────────── */
.word-example {
  font-size: 14.5px; font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
  max-width: 34ch;
}
.word-card.revealed .word-example { color: var(--ink-soft); }

/* admin rows with example subtitle */
.row-text {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  min-width: 0;
}
.word-row-ex {
  flex-basis: 100%;
  font-size: 12.5px; font-style: italic;
  color: var(--ink-faint);
  margin-top: 2px;
}

.search-clear svg { width: 11px; height: 11px; }
.search-clear:active { transform: scale(.92); }
.search-clear.hidden { display: none; }

/* ── practice result ──────────────────────────────────── */
.practice-result {
  margin-top: 14px;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
}
.practice-result.hidden { display: none; }
.practice-result.good { background: var(--sage-tint); }
.practice-result.bad  { background: var(--rose-tint); }
.practice-result-verdict {
  font-weight: 700; font-size: 15px; margin: 0 0 8px;
}
.practice-result.good .practice-result-verdict { color: var(--sage); }
.practice-result.bad  .practice-result-verdict { color: var(--danger); }
.practice-result-row {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 14px; padding: 3px 0;
}
.pr-label { color: var(--ink-soft); font-weight: 600; flex: none; }
.pr-value { font-weight: 700; color: var(--ink); overflow-wrap: break-word; }
.practice-result.bad .practice-result-row:first-of-type .pr-value { color: var(--danger); }
