/* ──────────────────────────────────────────────────────────
   Tidvattnaren — botanisk & jordnära
   ────────────────────────────────────────────────────────── */

:root {
  /* Skog — default */
  --bg:           #EDE6D2;
  --bg-card:      #FBF7EA;
  --bg-deep:      #E1D9BE;
  --bg-tonal:     #F4EFDD;
  --ink:          #28321B;
  --ink-muted:    #5A6B47;
  --ink-subtle:   #8B9778;
  --ink-faint:    #B5BCA0;
  --primary:      #4F7E2C;
  --primary-deep: #355B1B;
  --primary-soft: #C9DDA9;
  --primary-wash: #E5EED2;
  --accent:       #D27B3A;
  --accent-soft:  #F2D5B4;
  --accent-wash:  #FBE9D5;
  --water:        #5093B5;
  --water-soft:   #C8E0EB;
  --water-wash:  #E5EFF5;
  --rain:         #3F7298;
  --warn:         #C0612E;
  --gold:         #D9A04A;

  --line:         rgba(40,50,27,0.07);
  --line-strong:  rgba(40,50,27,0.13);
  --shadow-card:  0 1px 0 rgba(40,50,27,0.04), 0 6px 18px rgba(40,50,27,0.06);
  --shadow-pop:   0 1px 0 rgba(40,50,27,0.05), 0 14px 30px rgba(40,50,27,0.13);

  --r-card: 22px;
  --r-inner: 14px;
  --r-pill: 999px;

  --pad-card: 18px;
  --gap-stack: 16px;
  --gap-section: 22px;
}

[data-density="compact"] {
  --pad-card: 14px;
  --gap-stack: 11px;
  --gap-section: 16px;
}
[data-density="airy"] {
  --pad-card: 22px;
  --gap-stack: 20px;
  --gap-section: 28px;
}

/* Äng — soft yellow-green meadow */
[data-theme="ang"] {
  --bg:           #F2EFD0;
  --bg-card:      #FFFCEB;
  --bg-deep:      #E5E0BE;
  --bg-tonal:     #F8F4D9;
  --ink:          #2F3D1F;
  --ink-muted:    #677252;
  --ink-subtle:   #939E7B;
  --ink-faint:    #BFC5A4;
  --primary:      #7BA15C;
  --primary-deep: #557A3A;
  --primary-soft: #D6E3B4;
  --primary-wash: #ECF1D5;
  --accent:       #E89A6E;
  --accent-soft:  #F8DBC5;
  --accent-wash:  #FCEDDF;
}

/* Kust — coastal off-white + teal */
[data-theme="kust"] {
  --bg:           #E8EDE6;
  --bg-card:      #F8FAF5;
  --bg-deep:      #DAE2D7;
  --bg-tonal:     #EEF1EC;
  --ink:          #1F3138;
  --ink-muted:    #4F6770;
  --ink-subtle:   #7E939B;
  --primary:      #2F7A77;
  --primary-deep: #1F5755;
  --primary-soft: #B6D3CF;
  --primary-wash: #DCE9E6;
  --accent:       #D9613D;
  --accent-soft:  #F0C9B6;
  --accent-wash:  #F8E2D3;
}

/* Skymning — warm dusk */
[data-theme="skymning"] {
  --bg:           #ECE2D5;
  --bg-card:      #F8EFE2;
  --bg-deep:      #DDD0BE;
  --bg-tonal:     #F1E8DA;
  --ink:          #2D2233;
  --ink-muted:    #6B5466;
  --ink-subtle:   #978294;
  --primary:      #7B4A78;
  --primary-deep: #553052;
  --primary-soft: #D5BFD3;
  --primary-wash: #ECDFE9;
  --accent:       #C77A5C;
  --accent-soft:  #ECCBB7;
  --accent-wash:  #F6E4D5;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Geist', -apple-system, system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 50% -200px, color-mix(in srgb, var(--primary-soft) 35%, transparent), transparent),
    radial-gradient(800px 400px at 100% 100%, color-mix(in srgb, var(--accent-soft) 25%, transparent), transparent);
  min-height: 100vh;
  transition: background-color .3s ease;
}

/* Mobile-first viewport. Vid ≥1024px byter vi till sidebar + main-layout. */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 600px) and (max-width: 1023px) {
  body { padding: 24px 0; }
  .app-shell {
    min-height: calc(100vh - 48px);
    background: var(--bg);
    background-image:
      radial-gradient(900px 400px at 20% -100px, color-mix(in srgb, var(--primary-soft) 35%, transparent), transparent),
      radial-gradient(700px 300px at 100% 100%, color-mix(in srgb, var(--accent-soft) 28%, transparent), transparent);
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(40,50,27,0.12), 0 0 0 1px rgba(40,50,27,0.06);
    overflow: hidden;
  }
}

/* ─── Desktop-layout ─── */
.app-sidebar { display: none; }
.app-topbar-desktop { display: none; }

@media (min-width: 1024px) {
  body { padding: 0; }
  .app-shell {
    max-width: none;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
  }
  /* Mobil-topbar och bottom-nav döljs på desktop */
  .app-topbar-mobile { display: none !important; }
  .bnav { display: none !important; }

  .app-sidebar {
    display: flex; flex-direction: column;
    width: 280px; flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--line);
    padding: 24px 16px 16px;
    box-shadow: var(--shadow-card);
    z-index: 1;
  }
  .app-main {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 8px;
  }
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 16px;
}
.sidebar-brand .serif { font-size: 22px; }

.sidebar-section {
  font: 600 10px/1 'Geist', system-ui, sans-serif;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 14px 8px 6px;
}

.sidebar-item {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-muted);
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font: 500 14px/1 'Geist', system-ui, sans-serif;
  width: 100%; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.sidebar-item:hover { background: var(--bg-deep); color: var(--ink); }
.sidebar-item.active {
  background: var(--ink); color: var(--bg-card);
}
.sidebar-item.active:hover { background: var(--primary-deep); }
.sidebar-item .count {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-deep); color: var(--ink-muted);
}
.sidebar-item.active .count {
  background: rgba(251,247,234,0.18); color: var(--bg-card);
}
.sidebar-item .badge {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

.sidebar-spacer { flex: 1; }

.sidebar-add {
  appearance: none; border: 1px dashed var(--line-strong);
  background: transparent; color: var(--ink-muted);
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px; border-radius: 10px;
  font: 500 13px/1 'Geist', system-ui, sans-serif;
  cursor: pointer; margin-top: 6px;
  transition: all .15s ease;
}
.sidebar-add:hover { border-color: var(--primary); color: var(--primary-deep); background: var(--primary-wash); }

/* ─── Plant grid ─── */
.plants-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-stack);
}
@media (min-width: 760px) {
  .plants-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1240px) {
  .plants-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Hem-vyns max-bredd på desktop så hero/stats inte sträcks ut för mycket */
.home-wrap {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* Dölj mobil-tabs när sidebar finns på desktop */
@media (min-width: 1024px) {
  .mobile-only-zonetabs { display: none; }
}

/* ─── Sheet/modal ─── */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28,32,18,0.35);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s ease;
}
.sheet-body {
  width: 100%; max-width: 480px; max-height: 88vh;
  background: var(--bg);
  border-top-left-radius: 28px; border-top-right-radius: 28px;
  overflow: auto;
  animation: sheet-up .28s cubic-bezier(.2,.8,.3,1);
}
@media (min-width: 1024px) {
  .sheet-overlay { align-items: center; padding: 24px; }
  .sheet-body {
    max-width: 560px; max-height: 84vh;
    border-radius: 22px;
    animation: modal-in .25s ease;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.sheet-grabber {
  display: flex; justify-content: center; padding: 10px 0 4px;
}
.sheet-grabber div {
  width: 38px; height: 4px; border-radius: 999px; background: var(--line-strong);
}
@media (min-width: 1024px) { .sheet-grabber { display: none; } }

/* ─── Form fields (admin) ─── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font: 500 12px/1 'Geist', system-ui, sans-serif;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 6px;
}
.form-input, .form-select {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 44px;
  padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card); color: var(--ink);
  font: 500 15px/1 'Geist', system-ui, sans-serif;
  outline: none;
  transition: border-color .15s ease;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }
.form-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235A6B47' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-row {
  display: flex; gap: 10px;
}
.form-row > * { flex: 1; }

.hue-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.hue-swatch {
  appearance: none; border: 0; cursor: pointer;
  height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease;
}
.hue-swatch:hover { transform: translateY(-1px); }
.hue-swatch.active {
  box-shadow: 0 0 0 2px var(--ink), 0 4px 10px rgba(0,0,0,0.12);
}
.hue-swatch svg { display: block; }

.form-segment {
  display: flex; padding: 3px;
  background: var(--bg-deep); border-radius: 12px; gap: 4px;
}
.form-segment button {
  flex: 1; appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-muted);
  padding: 9px 10px; border-radius: 9px;
  font: 500 13px/1 'Geist', system-ui, sans-serif;
}
.form-segment button.active {
  background: var(--bg-card); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.form-checkbox {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  cursor: pointer;
}
.form-checkbox input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.form-actions {
  display: flex; gap: 10px; margin-top: 22px;
}
.form-actions .btn-secondary {
  flex: 1; appearance: none; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-muted);
  height: 46px; border-radius: 12px; cursor: pointer;
  font: 500 14.5px/1 'Geist', system-ui, sans-serif;
}
.form-actions .btn-secondary:hover { background: var(--bg-deep); color: var(--ink); }
.form-actions .btn-primary {
  flex: 2; appearance: none; border: 0;
  background: var(--primary); color: #fff;
  height: 46px; border-radius: 12px; cursor: pointer;
  font: 600 14.5px/1 'Geist', system-ui, sans-serif;
}
.form-actions .btn-primary:hover { background: var(--primary-deep); }
.form-actions .btn-primary:disabled { opacity: 0.6; cursor: progress; }
.form-actions .btn-danger {
  appearance: none; border: 0;
  background: transparent; color: var(--warn);
  height: 46px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  font: 500 13px/1 'Geist', system-ui, sans-serif;
  display: inline-flex; align-items: center; gap: 6px;
}
.form-actions .btn-danger:hover { background: #F7E0CF; }

.form-help {
  font-size: 12.5px; color: var(--ink-subtle);
  margin-top: 6px; line-height: 1.45;
}

/* ─── Chat ─── */
.chat-screen {
  display: flex; flex-direction: column;
  height: 100%;
}

.chat-sessions {
  display: flex; gap: 6px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-sessions::-webkit-scrollbar { display: none; }

.chat-session-pill {
  appearance: none; border: 0; cursor: pointer;
  background: var(--bg-card); color: var(--ink-muted);
  padding: 8px 12px; border-radius: var(--r-pill);
  font: 500 12.5px/1 'Geist', system-ui, sans-serif;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-card);
  transition: background .15s ease, color .15s ease;
}
.chat-session-pill:hover { background: var(--primary-wash); color: var(--primary-deep); }
.chat-session-pill.active {
  background: var(--ink); color: var(--bg-card); box-shadow: none;
}
.chat-session-pill.scope-plant { border: 1px solid var(--accent); }
.chat-session-pill.scope-plant.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.chat-new {
  appearance: none; border: 1px dashed var(--line-strong);
  background: transparent; color: var(--ink-muted);
  padding: 8px 12px; border-radius: var(--r-pill);
  font: 500 12.5px/1 'Geist', system-ui, sans-serif;
  cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.chat-new:hover { border-color: var(--primary); color: var(--primary-deep); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex; flex-direction: column; gap: 12px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14.5px; line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--ink);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-card);
  padding: 12px 16px;
}

/* Markdown-rendering inuti assistant-bubblor */
.chat-msg.assistant > *:first-child { margin-top: 0; }
.chat-msg.assistant > *:last-child { margin-bottom: 0; }
.chat-msg.assistant p { margin: 0 0 8px; line-height: 1.5; }
.chat-msg.assistant h3, .chat-msg.assistant h4,
.chat-msg.assistant h5, .chat-msg.assistant h6 {
  font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.25;
}
.chat-msg.assistant h3 { font-size: 17px; margin: 14px 0 6px; }
.chat-msg.assistant h4 { font-size: 15.5px; margin: 12px 0 5px; }
.chat-msg.assistant h5, .chat-msg.assistant h6 { font-size: 14.5px; margin: 10px 0 4px; }
.chat-msg.assistant ul, .chat-msg.assistant ol {
  margin: 6px 0 8px; padding-left: 22px;
}
.chat-msg.assistant li { margin: 0 0 3px; line-height: 1.45; }
.chat-msg.assistant li:last-child { margin-bottom: 0; }
.chat-msg.assistant strong { font-weight: 600; color: var(--ink); }
.chat-msg.assistant em { font-style: italic; }
.chat-msg.assistant code {
  background: var(--bg-deep);
  padding: 1px 6px; border-radius: 5px;
  font: 0.88em ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: var(--primary-deep);
}
.chat-msg.assistant pre {
  background: var(--bg-deep);
  padding: 10px 12px; border-radius: 10px;
  margin: 8px 0;
  overflow-x: auto;
}
.chat-msg.assistant pre code {
  background: transparent; padding: 0;
  font-size: 12.5px; line-height: 1.5; color: var(--ink);
}
.chat-msg.assistant a {
  color: var(--primary-deep); text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-msg.assistant a:hover { color: var(--primary); }
.chat-msg-time {
  font-size: 10.5px;
  color: var(--ink-faint);
  align-self: flex-end;
  margin-top: -6px;
  padding: 0 6px;
}

.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px;
  color: var(--ink-muted);
}
.chat-empty .serif { font-size: 22px; margin-bottom: 6px; color: var(--ink); }

.chat-suggestions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px; width: 100%; max-width: 320px;
}
.chat-suggestion {
  appearance: none; border: 1px solid var(--line-strong); cursor: pointer;
  background: var(--bg-card); color: var(--ink);
  padding: 12px 14px; border-radius: 14px;
  text-align: left;
  font: 500 13.5px/1.4 'Geist', system-ui, sans-serif;
  transition: all .15s ease;
}
.chat-suggestion:hover {
  border-color: var(--primary);
  background: var(--primary-wash);
  color: var(--primary-deep);
}

.chat-input-wrap {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.chat-input {
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; resize: none;
  min-height: 44px; max-height: 140px;
  padding: 11px 14px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  font: 400 14px/1.4 'Geist', system-ui, sans-serif;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}
.chat-input textarea:focus { border-color: var(--primary); }
.chat-input button {
  appearance: none; border: 0; cursor: pointer;
  background: var(--primary); color: #fff;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, transform .12s ease;
}
.chat-input button:hover { background: var(--primary-deep); }
.chat-input button:active { transform: scale(0.94); }
.chat-input button:disabled { opacity: 0.5; cursor: progress; }

.chat-typing {
  align-self: flex-start;
  display: flex; gap: 4px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-card);
}
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-subtle);
  animation: typing-bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-scope-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin: 0 16px 12px;
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: 12px;
  font-size: 12.5px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.chat-scope-banner strong { color: #8B4516; }

.serif { font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.serif-italic { font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 400; }
.numerical { font-variant-numeric: tabular-nums; }

.btn-water {
  appearance: none; border: 0; cursor: pointer;
  background: var(--primary); color: #fff;
  padding: 0 18px; height: 44px; border-radius: var(--r-pill);
  font: 600 15px/1 'Geist', system-ui, sans-serif;
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 -1px 0 rgba(0,0,0,0.08) inset, 0 2px 6px rgba(40,50,27,0.18);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn-water:hover { background: var(--primary-deep); }
.btn-water:active { transform: scale(0.96); }
.btn-water.compact { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-water.muted {
  background: var(--bg-tonal); color: var(--primary-deep);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
}
.btn-water.muted:hover { background: var(--primary-wash); }
.btn-water:disabled { opacity: 0.6; cursor: progress; }

.btn-snooze {
  appearance: none; border: 0; cursor: pointer; background: transparent;
  color: var(--ink-muted); padding: 8px 10px; border-radius: 10px;
  font: 500 13px/1 'Geist', system-ui, sans-serif;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-snooze:hover { background: var(--bg-deep); color: var(--ink); }

.card {
  background: var(--bg-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: var(--r-pill);
  font: 500 11.5px/1 'Geist', system-ui, sans-serif;
  letter-spacing: 0.01em;
}
.pill.primary { background: var(--primary-wash); color: var(--primary-deep); }
.pill.accent  { background: var(--accent-wash); color: #8B4516; }
.pill.water   { background: var(--water-wash); color: var(--rain); }
.pill.tonal   { background: var(--bg-deep); color: var(--ink-muted); }
.pill.warn    { background: #F7E0CF; color: var(--warn); }

@keyframes drop-rise {
  0%   { transform: translateY(8px) scale(0.6); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(-22px) scale(1); opacity: 0; }
}
.drop-burst {
  position: absolute; pointer-events: none;
  width: 14px; height: 18px;
  animation: drop-rise .9s cubic-bezier(.2,.8,.4,1) forwards;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-6deg); }
  60% { transform: rotate(5deg); }
}
.wiggle { animation: wiggle .5s ease; }

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}

.h-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.h-scroll::-webkit-scrollbar { display: none; }

.no-select { user-select: none; -webkit-user-select: none; }

.disc {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.disc svg { display: block; }

.zone-tab {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-muted);
  padding: 8px 14px; border-radius: var(--r-pill);
  font: 500 13.5px/1 'Geist', system-ui, sans-serif;
  white-space: nowrap;
  transition: all .15s ease;
}
.zone-tab.active {
  background: var(--ink); color: var(--bg-card);
}
.zone-tab:not(.active):hover { background: var(--bg-deep); color: var(--ink); }

.bnav {
  display: flex; gap: 6px;
  padding: 8px 16px 14px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.bnav-btn {
  flex: 1; appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-subtle);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 14px;
  font: 500 10.5px/1.2 'Geist', system-ui, sans-serif;
  letter-spacing: 0.02em;
}
.bnav-btn.active { color: var(--primary-deep); }

.leaf-stamp {
  background-image:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--primary-soft) 60%, transparent) 0%, transparent 25%),
    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--accent-soft) 50%, transparent) 0%, transparent 28%);
}

.progress-track {
  height: 6px; border-radius: 999px;
  background: var(--bg-deep); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-soft), var(--primary));
  transition: width .4s ease;
}

h1,h2,h3,h4 { margin: 0; font-weight: 500; }
.eyebrow {
  font: 600 10.5px/1 'Geist', system-ui, sans-serif;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-subtle);
}

.cal-day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 0; border-radius: 12px;
}
.cal-day.today { background: var(--ink); color: var(--bg-card); }
.cal-day .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}

/* Loader */
.loader {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; color: var(--ink-subtle);
  font: 500 14px/1.4 'Geist', system-ui, sans-serif;
}

/* Settings sheet (ersätter tweaks-panelen) */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 4px;
}
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-label { font-size: 13.5px; color: var(--ink-muted); font-weight: 500; }
.settings-segment {
  display: flex; gap: 4px; padding: 3px;
  background: var(--bg-deep); border-radius: 10px;
}
.settings-segment button {
  appearance: none; border: 0; cursor: pointer;
  padding: 6px 10px; border-radius: 7px;
  background: transparent; color: var(--ink-muted);
  font: 500 12.5px/1 'Geist', system-ui, sans-serif;
}
.settings-segment button.active {
  background: var(--bg-card); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
