/* ═══════════════════════════════════════════
   EFTERPLAN — Stylesheet
   Tone: Calm, trustworthy, minimal
════════════════════════════════════════════ */


:root {
  --bg:           #F8F7F5;
  --bg-card:      #FFFFFF;
  --text-primary: #1C2333;
  --text-soft:    #5A6A7E;
  --text-muted:   #718096;  /* darkened from #94A3B8 — passes WCAG AA on white */
  --text-secondary: #5A6A7E;
  --border:       #E2E8F0;
  --accent:       #2C4A6E;
  --accent-dark:  #1a2f48;  /* hover state */
  --accent-light: #EDF2F7;
  --disabled-bg:  #D1D5DB;  /* disabled button */
  --red:          #B91C1C;
  --red-bg:       #FEF2F2;
  --yellow:       #92400E;
  --yellow-bg:    #FFFBEB;
  --grey:         #718096;
  --grey-bg:      #F1F5F9;
  --green:         #3a7d5a;  /* ob-check-note, success */
  --danger:        #c0392b;  /* notify remove hover */
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(44,74,110,0.08);
  --transition:   0.2s ease;
  --font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height:   57px;
  --bottom-nav-height: 58px;
}

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

/* ─── SKIP LINK ──────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ─── FOCUS STYLES ──────────────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── SCREENS ──────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }
.screen.active#screen-onboarding { display: flex; }

/* ─── NAV ───────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-light {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-plan { padding: 12px 20px; }
.logo-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
  line-height: 1.2;
}
.logo-tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
@media (max-width: 420px) {
  .logo-tagline { display: none; }
}
.nav-actions {
  display: none;
  gap: 8px;
}

/* ─── BUTTONS ────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled {
  background: var(--disabled-bg);
  cursor: not-allowed;
}
.btn-primary.btn-large {
  padding: 16px 36px;
  font-size: 1.1rem;
  width: auto;
  border-radius: 10px;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(44, 74, 110, 0.35); }
  50%       { box-shadow: 0 0 0 12px rgba(44, 74, 110, 0); }
}
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn-ghost:hover { background: var(--border); }
.btn-ghost.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
  width: auto;
}
.back-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0 16px 0;
  display: block;
}
.back-btn:hover { color: var(--text-primary); }

/* ─── NAV LANDING LINKS ──────────────────────── */
.nav-landing-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-text-link {
  font-size: 0.88rem;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-text-link:hover { color: var(--text-primary); }

/* ─── NAV PLAN ACTIONS ───────────────────────── */
.nav-plan-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.plan-participants {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}
.plan-participant-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px dashed var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.plan-participant-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.plan-participant-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.plan-participant-chip--deceased {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(44,74,110,0.25);
}

/* ─── LANDING ────────────────────────────────── */
#screen-landing .nav {
  background: transparent;
}
.landing-hero {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(160deg, #F8F7F5 0%, #EDF2F7 100%);
}
.landing-content {
  max-width: 620px;
  text-align: center;
}
.landing-brand {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.landing-eyebrow {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
  /* h1 reset — behåller eyebrow-utseendet oavsett tagg */
  line-height: 1.2;
  padding: 0;
}
.landing-headline {
  font-size: clamp(1.35rem, 3.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.landing-sub {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.landing-payoff {
  list-style: none;
  padding: 0;
  margin: 0 auto 28px;
  max-width: 380px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.landing-payoff li {
  font-size: 0.9rem;
  color: var(--text-soft);
  padding-left: 20px;
  position: relative;
}
.landing-payoff li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.landing-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── LANDING SECTIONS (Om / Integritet) ────── */
.landing-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 20px;
  border-top: 1px solid var(--border);
}
.landing-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.landing-section p {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 10px;
}
.landing-section p:last-child { margin-bottom: 0; }
.landing-contact-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.landing-contact-link:hover { text-decoration: underline; }
/* Fix #16: ta bort !important — mer specifik selektor räcker */
.landing-section .legal-disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--grey-bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 10px;
  line-height: 1.6;
}
.faq-item {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.faq-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.faq-item p {
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.75;
  margin: 0;
}
.privacy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

/* ─── LANDING FOOTER ─────────────────────────── */
.landing-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.5);
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
}
.landing-footer a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}
.landing-footer a:hover { color: #fff; text-decoration: underline; }

/* ─── ONBOARDING (fullscreen conversational) ─── */
#screen-onboarding {
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.ob-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  flex-shrink: 0;
}

.ob-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 0;
  font-family: var(--font);
  transition: var(--transition);
  width: 80px;
  text-align: left;
}
.ob-back:hover { color: var(--text-primary); }

.ob-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ob-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}
.ob-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 3px;
}
.ob-dot.done { background: var(--accent); opacity: 0.4; }

.ob-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px 72px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.ob-step {
  display: none;
  width: 100%;
  max-width: 480px;
  animation: obFadeIn 0.35s ease;
}
.ob-step.active { display: block; }
.ob-step.exit {
  animation: obFadeOut 0.2s ease forwards;
}

@keyframes obFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes obFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

.ob-content { width: 100%; }

.ob-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.ob-reassure {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 28px;
  padding: 8px 12px;
  background: var(--accent-light);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.ob-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.ob-hint {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 36px;
  line-height: 1.5;
}

.ob-skip {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 14px 0 20px;
}

/* Choices (auto-advance) */
.ob-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-choice {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  color: var(--text-primary);
  width: 100%;
}
.ob-choice:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.ob-choice.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 2px 14px rgba(44, 74, 110, 0.15);
}

/* Checkboxes */
.ob-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.ob-check {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: var(--transition);
}
.ob-check:hover { border-color: var(--accent); }
.ob-check input {
  /* visually hidden but accessible to screen readers */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.ob-check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-check input:checked ~ .ob-check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.ob-check input:checked ~ .ob-check-box::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: 800;
}
.ob-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}
.ob-check-label {
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ob-check-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.3;
}
.ob-check-note {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--green);
  line-height: 1.3;
  margin-top: 1px;
}

/* Text input */
.ob-text-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 12px 4px;
  font-size: 1.4rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: transparent;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0;
}
.ob-text-input:focus {
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 0 var(--accent); /* synligt fokusindikator för tangentbord */
}
.ob-text-input::placeholder { color: var(--text-muted); }

/* Next button */
.ob-next-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  margin-top: 8px;
}
.ob-next-btn:hover { background: var(--accent-dark); }
.ob-next-btn:disabled {
  background: var(--disabled-bg);
  color: var(--text-muted);
  cursor: not-allowed;
}
.ob-next-btn:disabled:hover { background: var(--disabled-bg); }
.ob-check-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 16px 0 6px;
}

/* ─── CHOICE GRID ────────────────────────────── */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.choice-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  color: var(--text-primary);
}
.choice-btn:hover { border-color: var(--accent); }
.choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.choice-grid-sm { margin-bottom: 20px; }
.choice-btn-sm {
  padding: 10px 14px;
  font-size: 0.9rem;
}

/* ─── CHECKBOX GRID ──────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.checkbox-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.checkbox-btn:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}
.checkbox-btn input { accent-color: var(--accent); width: 16px; height: 16px; }
.checkbox-label { font-size: 0.9rem; font-weight: 500; }

/* ─── TEXT INPUT ─────────────────────────────── */
.text-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition);
  outline: none;
}
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 80px; }

/* ─── TABS ───────────────────────────────────── */
.plan-tabs-bar {
  background: var(--bg);
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 95;
}
.plan-tabs {
  max-width: 100%;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.plan-tab {
  background: none;
  border: none;
  padding: 16px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-align: center;
  justify-content: center;
  transition: var(--transition);
}
.plan-tab:hover { color: var(--text-primary); }
.plan-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.plan-tab-content { display: none; }
.plan-tab-content.active { display: block; }

/* ─── PLAN ───────────────────────────────────── */
.plan-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 140px; /* extra bottom for nav + safe area */
}
.plan-header { margin-bottom: 40px; }
.plan-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.plan-sub {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.plan-dodsbo-def {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--accent-light);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.plan-dodsbo-def:empty { display: none; }
.progress-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.progress-summary strong { color: var(--accent); }

/* ─── TASK SECTIONS ──────────────────────────── */
.task-sections { display: flex; flex-direction: column; gap: 36px; }
.task-section {}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red    { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-grey   { background: var(--grey); }
.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--text-soft);
}
.section-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── TASK CARD ──────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-wrap { display: flex; flex-direction: column; }
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.task-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.task-card.expanded {
  border-radius: var(--radius) var(--radius) 0 0;
  border-color: var(--accent);
}
.task-card.done {
  opacity: 0.72;
  cursor: pointer;  /* klickbar för att visa Ångra */
}
.task-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: var(--bg-card);
}
.task-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.task-check.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 0.97rem; font-weight: 600; margin-bottom: 3px; }
.task-desc { font-size: 0.85rem; color: var(--text-soft); line-height: 1.4; }
.task-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}
.task-chevron {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}
.task-chevron.open { transform: rotate(90deg); }

/* Accordion expand panel */
.task-expand {
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px 20px 20px 56px;
  animation: expandIn 0.2s ease;
}
.task-expand.hidden { display: none; }
@keyframes expandIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task-expand-desc {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 12px;
}
.task-expand-desc strong {
  color: var(--text-primary);
  font-weight: 600;
}
.task-expand-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
  text-decoration: none;
}
.task-expand-link:hover { text-decoration: underline; }
.task-expand-phone {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
  margin-left: 16px;
  text-decoration: none;
}
.task-expand-phone:hover { text-decoration: underline; }
.task-notes {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  resize: vertical;
  line-height: 1.5;
}
.task-notes:focus { outline: none; border-color: var(--accent); }
.task-expand-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.task-expand-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.task-expand-btn:hover { background: var(--accent-dark); }
.task-expand-doc {
  background: none;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.task-expand-doc:hover { background: var(--accent); color: #fff; }
.task-expand-done {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.task-expand-undo-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 8px;
}
.task-expand-undo-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ─── BULK UPPSÄGNING ────────────────────────── */
.doc-bulk-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: var(--transition);
}
.doc-bulk-cta:hover { background: var(--accent-dark); }
.doc-bulk-icon { font-size: 1.4rem; flex-shrink: 0; }
.doc-bulk-text { flex: 1; }
.doc-bulk-title { display: block; font-size: 1rem; font-weight: 700; }
.doc-bulk-sub { display: block; font-size: 0.82rem; opacity: 0.8; margin-top: 2px; }
.doc-bulk-arrow { font-size: 1.2rem; flex-shrink: 0; opacity: 0.7; }

.bulk-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.bulk-row .text-input { flex: 1; min-width: 0; }
.bulk-row .bulk-custnr { max-width: 120px; flex-shrink: 0; }
.bulk-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
}
.bulk-remove:hover { color: var(--red); }
.add-row-btn {
  background: none;
  border: 1.5px dashed var(--border);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  margin-bottom: 24px;
  transition: var(--transition);
}
.add-row-btn:hover { border-color: var(--accent); background: var(--accent-light); }

.bulk-letter {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.bulk-letter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
}
.bulk-letter-head .btn-sm { flex-shrink: 0; width: auto; }
.bulk-row { flex-wrap: wrap; }
.bulk-row .bulk-custnr { max-width: 100%; }
.bulk-letter-name { font-weight: 700; font-size: 0.95rem; color: var(--accent); }
.bulk-letter .doc-output { border: none; border-radius: 0; background: var(--bg-card); }
.bulk-letter .copied-msg { margin: 0 16px 12px; }
.btn-sm { padding: 8px 14px !important; font-size: 0.82rem !important; }


/* ─── MODALS ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-sm { max-width: 400px; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.3px; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  margin: -8px -8px 0 0;
}
.modal-close:hover { color: var(--text-primary); background: var(--grey-bg); }
.modal-sub {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 20px;
}

/* ─── DOC TYPE GRID ──────────────────────────── */
.doc-type-grid { display: flex; flex-direction: column; gap: 10px; }
.doc-type-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
}
.doc-type-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.doc-icon {
  grid-row: 1 / 3;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
}
.doc-type-title { font-size: 0.97rem; font-weight: 600; }
.doc-type-sub { font-size: 0.83rem; color: var(--text-soft); }

/* ─── FORM ERROR ─────────────────────────────── */
.form-error {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(185, 28, 28, 0.2);
  margin-bottom: 12px;
}
.form-error.hidden { display: none; }

/* ─── BÖRJA HÄR ──────────────────────────────── */
.start-here {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.start-here:hover { background: var(--accent-dark); }
.start-here.hidden { display: none; }
.start-here-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.75;
  margin-bottom: 3px;
}
.start-here-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.start-here-arrow { margin-left: auto; font-size: 1.5rem; flex-shrink: 0; opacity: 0.8; }
.task-card--next { border-color: var(--accent) !important; }
.task-card--next .task-next-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: middle;
}
.task-next-badge { display: none; }

/* ─── DOC FORMS ──────────────────────────────── */
#doc-chooser.hidden { display: none; }
.doc-form { display: flex; flex-direction: column; gap: 0; }
.doc-form.hidden { display: none; }
.form-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.required { color: var(--red); }
.form-label-hint { font-weight: 400; color: var(--text-muted); }
.phrase-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.phrase-chip {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
.phrase-chip.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ─── DOC OUTPUT ─────────────────────────────── */
.doc-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  font-family: 'Georgia', serif;
  margin-bottom: 16px;
  max-height: 480px;
  overflow-y: auto;
}
.result-note {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.result-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.copied-msg {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}
.copied-msg.hidden { display: none; }

/* ─── TASK MODAL ─────────────────────────────── */
.task-modal-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 12px;
}
.task-modal-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 20px;
}
#task-modal-link a {
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: block;
}
.task-modal-actions { display: flex; flex-direction: column; gap: 10px; }

/* ─── SHARE ──────────────────────────────────── */
.share-url-wrap {
  margin-bottom: 16px;
}
.share-url-box {
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-soft);
  word-break: break-all;
  line-height: 1.5;
  user-select: all;
}
.share-confirm {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
}
.share-confirm.hidden { display: none; }

/* ─── UNDO TOAST ─────────────────────────────── */
.undo-toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 300;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  white-space: normal;
  max-width: calc(100vw - 32px);
  animation: toastIn 0.25s ease;
}
.undo-toast.hidden { display: none; }
.undo-toast button {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  transition: background 0.15s;
}
.undo-toast button:hover { background: rgba(255,255,255,0.12); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── SHARED BANNER ──────────────────────────── */
.shared-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 12px 20px;
  font-size: 0.9rem;
  z-index: 100;
}
.shared-banner.hidden { display: none; }

/* ─── STARTED TASK STATE ─────────────────────── */
.task-card.started {
  border-color: var(--accent);
  background: var(--accent-light);
}
.task-check.started {
  border-color: var(--accent);
  background: var(--accent-light);
}
.task-check.started::after {
  content: '–';
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.task-started-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 7px;
  vertical-align: middle;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
/* ─── ASSIGNEE BADGE (task card) ─────────────── */
.task-assignee-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 7px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}
.task-assignee-badge.hidden { display: none; }

/* ─── ASSIGNEE PICKER (expand panel) ─────────── */
.task-assignee-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.task-assignee-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.assignee-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.assignee-chip {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.assignee-chip:hover { border-color: var(--accent); }
.assignee-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.assignee-add-btn {
  font-size: 1rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px dashed var(--border);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.assignee-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.assignee-add-hint {
  font-size: 0.78rem;
  color: var(--accent);
  background: none;
  border: 1px dashed var(--accent);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.assignee-add-hint:hover { background: var(--accent-light); }
.assignee-new-input {
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  background: var(--bg-input, var(--bg-card));
  color: var(--text-primary);
  width: 110px;
}
.assignee-new-input:focus { outline: none; border-color: var(--accent); }
.assignee-new-input.hidden { display: none; }

/* ─── NOTIFY LIST (kontaktrundringen task) ─── */
.notify-list-section {
  margin: 12px 0 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.notify-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.notify-list-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.notify-counter {
  font-size: 0.72rem;
  color: var(--text-soft);
}
.notify-list-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.notify-empty {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0;
  padding: 2px 0;
}
.notify-person {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notify-person.notified .notify-name {
  text-decoration: line-through;
  color: var(--text-soft);
}
.notify-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
}
.notify-check:hover { border-color: var(--accent); }
.notify-check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.notify-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.notify-remove {
  font-size: 1rem;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  opacity: 0.5;
}
.notify-remove:hover { opacity: 1; color: var(--danger); }
.notify-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.notify-new-input {
  flex: 1;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  background: var(--bg);
  color: var(--text-primary);
  min-width: 0;
}
.notify-new-input:focus { outline: none; border-color: var(--accent); }
.notify-add-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.notify-add-btn:hover {
  background: var(--accent);
  color: #fff;
}
.notify-notifier-select {
  font-size: 0.75rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-soft);
  padding: 2px 4px;
  cursor: pointer;
  max-width: 100px;
}
.notify-notifier-select:focus { outline: none; border-color: var(--accent); }

/* ─── Onboarding progress bar ─── */
.ob-progress-bar-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 10;
}
.ob-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 0.35s ease;
  width: 0%;
}

/* ─── Offline banner ─── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #92400E;
  color: #fff;
  text-align: center;
  padding: 9px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  pointer-events: none;
}
.offline-banner.is-offline {
  transform: translateY(0);
}

/* ─── Onboarding participants ─── */
.ob-participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 16px;
  margin-bottom: 12px;
}
.ob-participant-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.ob-participant-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding: 0 0 0 4px;
  line-height: 1;
}
.ob-participant-chip button:hover { color: var(--danger); }
.ob-participant-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ob-participant-add .ob-text-input {
  flex: 1;
  margin-bottom: 0;
}
.ob-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  margin-top: 16px;
}
.ob-field-label:first-of-type { margin-top: 0; }
.ob-participant-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ob-participant-input-row .ob-text-input {
  flex: 1;
  margin-bottom: 0;
}
.ob-participant-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding: 0 0 0 4px;
  line-height: 1;
}
.ob-participant-remove:hover { color: var(--danger); }
.ob-why {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 16px;
  font-style: italic;
}

.task-expand-start-btn {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.task-expand-start-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}

/* ─── TASK RESOURCES ─────────────────────────── */
.task-resources {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.task-resource-link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  padding: 2px 0;
}
.task-resource-link:hover { color: var(--accent); text-decoration: underline; }

/* ─── OB OPTIONAL LABEL ──────────────────────── */
.ob-optional {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── PROGRESS BAR ───────────────────────────── */
.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── COMPLETION STATE ───────────────────────── */
.completion-message {
  display: none;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 32px;
  text-align: center;
}
.completion-message.visible { display: block; }
.completion-message p {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

/* ─── TASK ENTRANCE ANIMATION ────────────────── */
@keyframes taskIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task-anim-in {
  animation: taskIn 0.3s ease both;
}

/* ─── TASK CARD KEYBOARD ─────────────────────── */
.task-card[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ─── RESPONSIVE (desktop up) ────────────────── */
@media (min-width: 601px) {
  :root {
    --nav-height: 65px;
    --bottom-nav-height: 0px;
  }
  .nav { padding: 20px 40px; }
  .nav-plan { padding: 16px 40px; }
  .plan-wrap { padding: 40px 20px 80px; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .modal { padding: 32px; }
  .nav-actions { display: flex; }
  .task-expand { padding: 14px 20px 18px 52px; }

  /* ── Top tab navigation (desktop) ── */
  .plan-tabs-bar {
    position: sticky;
    top: var(--nav-height);
    bottom: auto;
    left: auto;
    right: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    z-index: 90;
  }
  .plan-tabs {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
  }
  .plan-tab {
    padding: 14px 20px;
    font-size: 0.95rem;
    text-align: left;
    justify-content: flex-start;
  }

  /* Undo toast above fold on desktop */
  .undo-toast {
    bottom: 24px;
    white-space: nowrap;
    max-width: none;
  }
}

/* ═══════════════════════════════════════════
   SECTION DONE BADGE
════════════════════════════════════════════ */
.section-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--green);
  background: #EBF5EE;
  border: 1px solid #C3DFC9;
  padding: 2px 8px;
  border-radius: 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.section-done-badge.hidden {
  display: none;
}

/* ═══════════════════════════════════════════
   PDF / PRINT BUTTON (floating)
════════════════════════════════════════════ */
.plan-print-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(44,74,110,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 80;
  transition: background 0.15s, transform 0.15s;
}
.plan-print-btn:hover  { background: var(--accent-dark); transform: scale(1.06); }
.plan-print-btn:active { transform: scale(0.96); }
@media (min-width: 601px) {
  .plan-print-btn { bottom: 24px; right: 24px; width: 48px; height: 48px; }
}

/* ── Tablet (601–1023px) ── */
@media (min-width: 601px) and (max-width: 1023px) {
  .plan-wrap { padding: 24px 32px 100px; }
  .seo-article { max-width: 660px; }
}

/* ── Desktop large (1024px+) ── */
@media (min-width: 1024px) {
  .plan-wrap { max-width: 860px; padding: 40px 40px 80px; }
  .nav { padding: 20px 60px; }
  .nav-plan { padding: 16px 60px; }
  .plan-tabs { max-width: 860px; padding: 0 40px; }
  .seo-article { max-width: 740px; }
}

/* ═══════════════════════════════════════════
   PAYWALL CARD
════════════════════════════════════════════ */
.paywall-card {
  border: 1.5px solid #C8D6E5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #EDF2F7 0%, #F8F7F5 100%);
  padding: 28px 24px;
  text-align: center;
  margin-top: 16px;
}
.paywall-card.hidden { display: none; }

.paywall-lock {
  font-size: 2rem;
  margin-bottom: 10px;
  line-height: 1;
}
.paywall-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.paywall-desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-bottom: 20px;
  line-height: 1.5;
}
.paywall-cta {
  width: 100%;
  max-width: 260px;
  padding: 13px 20px;
  font-size: 0.95rem;
}
.paywall-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ═══════════════════════════════════════════
   PRINT / PDF EXPORT
════════════════════════════════════════════ */
@media print {
  /* Hide everything except the plan screen */
  body > *:not(#screen-plan) { display: none !important; }
  #screen-plan { display: block !important; }

  /* Hide interactive chrome */
  .nav, .plan-tabs-bar, .bottom-nav,
  .plan-print-btn, .plan-fab,
  .btn-ghost, .task-expand-actions,
  .undo-toast, .offline-banner,
  .skip-link, #completion-message { display: none !important; }

  /* Reset colors for legibility on paper */
  body { background: #fff; color: #000; }
  .task-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .section-header { border-bottom: 1px solid #ccc; padding-bottom: 6px; margin-bottom: 8px; }
  .task-title { font-size: 0.9rem; }

  /* Show all task sections regardless of tab */
  .task-section { display: block !important; }

  /* Expand all tasks slightly */
  .task-card { margin-bottom: 6px; }

  /* Remove rounded corners and shadows */
  .task-card, .plan-header, .progress-wrap { border-radius: 0; box-shadow: none; }

  /* Footer with URL */
  #screen-plan::after {
    content: "Efterplan — efterplan.se";
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
  }
}

/* ═══════════════════════════════════════════
   COMPLETION OVERLAY
════════════════════════════════════════════ */
.completion-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  animation: co-fade-in 0.5s ease forwards;
}
.completion-overlay.hidden { display: none; }

@keyframes co-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.completion-overlay-inner {
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: co-rise 0.5s ease 0.1s both;
}
@keyframes co-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.co-check { width: 72px; height: 72px; margin: 0 auto 24px; }
.co-check-svg { width: 72px; height: 72px; }
.co-check-circle {
  stroke: var(--green); stroke-width: 2.5;
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: co-circle 0.6s ease 0.3s forwards;
}
.co-check-mark {
  stroke: var(--green); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: co-checkmark 0.4s ease 0.85s forwards;
}
@keyframes co-circle   { to { stroke-dashoffset: 0; } }
@keyframes co-checkmark { to { stroke-dashoffset: 0; } }

.co-title {
  font-size: 2rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.co-name {
  font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 20px; font-weight: 500;
}
.co-body {
  font-size: 1rem; color: var(--text-soft);
  line-height: 1.75; margin-bottom: 20px;
}
.co-next-steps {
  list-style: none; padding: 0; margin: 0 0 28px;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
}
.co-next-steps li { font-size: 0.9rem; color: var(--text-soft); padding-left: 18px; position: relative; }
.co-next-steps li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }
.co-link { color: var(--accent); text-decoration: underline; }
.co-actions { display: flex; flex-direction: column; gap: 10px; }
.co-pdf-btn  { width: 100%; }
.co-close-btn { width: 100%; font-size: 0.9rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════
   PHONE 2 (secondary action, e.g. 1177)
════════════════════════════════════════════ */
.task-expand-phone--secondary {
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
}
.task-expand-phone--secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════
   TASK CHECKLIST (e.g. digitala konton)
════════════════════════════════════════════ */
.task-checklist {
  margin: 14px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.task-checklist-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px 6px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
}
.task-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.1s;
}
.task-checklist-item:last-child { border-bottom: none; }
.task-checklist-item:hover { background: var(--accent-light); }
.task-checklist-item.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}
.task-checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* ═══════════════════════════════════════════
   PLAN DONE FOOTER
════════════════════════════════════════════ */
.plan-done-footer {
  text-align: center;
  padding: 48px 24px 72px;
  max-width: 700px;
  margin: 0 auto;
}
.plan-done-footer.hidden { display: none; }
.plan-done-icon {
  font-size: 2.8rem;
  color: var(--green);
  margin-bottom: 12px;
}
.plan-done-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.plan-done-sub {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto 20px;
}

/* ═══════════════════════════════════════════
   PARTICIPANTS MODAL — personnr inputs
════════════════════════════════════════════ */
.modal-participant-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.modal-participant-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.modal-participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.modal-participant-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}
.modal-participant-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-participant-remove:hover { color: var(--danger); }
.participant-personnr-input {
  width: 100%;
  font-size: 0.8rem;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font);
}
.participant-personnr-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ═══ BILLS (T067) ═══════════════════════════ */
.bills-section { margin: 24px 0 0; }
.bills-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bills-add-btn { font-size: 0.85rem; padding: 6px 12px; }
.bills-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bill-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.bill-item.paid .bill-desc { text-decoration: line-through; color: var(--text-soft); }
.bill-check { width: 20px; height: 20px; padding: 12px; margin: -12px; border: 2px solid var(--border); border-radius: 50%; background: none; cursor: pointer; flex-shrink: 0; transition: background 0.15s, border-color 0.15s; }
.bill-item.paid .bill-check { background: var(--green); border-color: var(--green); }
.bill-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bill-desc { font-size: 0.9rem; }
.bill-amount { font-size: 0.8rem; color: var(--text-soft); }
.bill-delete { background: none; border: none; color: var(--text-soft); font-size: 1.2rem; cursor: pointer; min-width: 44px; min-height: 44px; padding: 0 10px; display: flex; align-items: center; justify-content: center; }
.bill-delete:hover { color: var(--red); }
.bills-empty { color: var(--text-soft); font-size: 0.85rem; text-align: center; padding: 16px 0; }
.bill-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.bill-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; width: 100%; box-sizing: border-box; background: #fff; }
.bill-amount-input { max-width: 160px; }
.bill-form-actions { display: flex; gap: 8px; }

/* ═══ SEO PAGES (T061) ════════════════════════ */
.seo-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.seo-main { max-width: 680px; margin: 0 auto; padding: 40px 24px; }
.seo-article h1 { font-size: 1.8rem; margin-bottom: 24px; line-height: 1.25; }
.seo-article h2 { font-size: 1.15rem; font-weight: 700; margin: 32px 0 12px; }
.seo-article p { line-height: 1.75; color: var(--text-primary); margin-bottom: 16px; }
.seo-article ul { padding-left: 20px; margin-bottom: 16px; }
.seo-article li { line-height: 1.7; margin-bottom: 6px; }
.seo-cta { background: var(--accent-light, #f0f4f8); padding: 24px; border-radius: var(--radius); text-align: center; margin: 40px 0; }
.seo-cta p { margin-bottom: 12px; font-weight: 600; }
.seo-footer { text-align: center; padding: 24px; color: var(--text-soft); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: 40px; }
.seo-footer-links { font-size: 0.8rem; margin-top: 6px; opacity: 0.8; }
.seo-footer-links a { color: inherit; }
.landing-footer-links { font-size: 0.8rem; margin-top: 6px; opacity: 0.7; }
.landing-footer-links a { color: inherit; }
