/* ROOVI area styles: task detail (#/task/:key, brief 5.5). Owned by the task area owner.
   Uses the tokens and components from css/app.css. Every selector is scoped under a "task-" class
   so areas never collide. Mobile first (390px); one column, cards stacked with a 12px gap. */

.task-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.task-body > .card + .card { margin-top: 0; }
.task-body > * { scroll-margin-top: calc(var(--topbar-h) + var(--demo-h) + var(--space-4)); }

/* ----- summary ----- */
.task-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.task-description { color: var(--text); }
.task-waiting-for { margin-bottom: var(--space-3); font-size: 14px; color: var(--text-secondary); }
.task-waiting-label { font-weight: 700; }
.task-waiting-for .link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--amber-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.task-done-line {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.task-done-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--accent-strong);
}
.task-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

/* ----- deadline ----- */
.task-deadline-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.task-deadline-date { font-size: 18px; font-weight: 700; }
/* The lead of the deadline note is always visible (what kind of date this is); the rest hides in details. */
.task-deadline-note { margin-top: var(--space-2); font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.task-deadline-note p { margin: 0; }
.task-deadline-expected { color: var(--text-secondary); }
.task-why { margin-top: var(--space-1); }
.task-why > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
}
.task-why > summary::-webkit-details-marker { display: none; }
.task-why > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s var(--ease);
}
.task-why[open] > summary::after { transform: rotate(-135deg); }
.task-why-text { padding-top: var(--space-1); font-size: 14px; color: var(--text-secondary); }

/* ----- next step and municipality ----- */
.task-next-text { margin-bottom: var(--space-1); }
.task-muni {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.task-muni-title { margin-bottom: var(--space-2); font-size: 15px; font-weight: 700; }
.task-muni-facts { margin-top: var(--space-1); }
.task-muni-facts .link { display: inline-flex; align-items: center; min-height: var(--tap); }
.task-muni-noneu { margin-top: var(--space-2); }
.task-muni-info {
  margin-top: var(--space-3);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.task-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.task-buttons-center { justify-content: center; }
.task-buttons > .btn { flex: 1 1 auto; }

/* ----- Dutch-only booking page (SPEC 16.5): notice, translate tip, steps, English link, alternative ----- */
.task-buttons > .task-lang-chip { align-self: center; }
.task-lang-tip { margin-top: var(--space-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.task-lang-tip > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-strong);
}
.task-lang-tip > summary::-webkit-details-marker { display: none; }
.task-muni-links { margin-top: var(--space-2); }
.task-muni-links .link { display: inline-flex; align-items: center; min-height: var(--tap); overflow-wrap: anywhere; }
.task-muni-phonenote { margin-top: var(--space-1); }
.task-steps {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
/* display:flex drops the native marker in some browsers, so the disclosure draws its own chevron. */
.task-steps > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
}
.task-steps > summary::-webkit-details-marker { display: none; }
.task-steps > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s var(--ease);
}
.task-steps[open] > summary::after { transform: rotate(-135deg); }
.task-steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding-left: 1.4em;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}
.task-muni-alt {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.task-muni-alt-title { margin-bottom: var(--space-1); font-weight: 700; }
.task-muni-alt .helper { margin-top: var(--space-1); }

/* ----- appointment ----- */
.task-appt .banner { margin-bottom: var(--space-3); }
.task-appt-form { margin-top: var(--space-3); }
.task-appt-form .field { margin-bottom: 0; }
.task-appt .task-buttons { margin-top: var(--space-3); }
.task-appt .helper { margin-top: var(--space-3); }
.task-appt-locked .banner { margin-bottom: 0; }

/* ----- documents ----- */
.task-docs-progress {
  margin-top: var(--space-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ----- partner ----- */
.task-partner + .task-partner {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.task-partner-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.task-partner-name { font-size: 16px; font-weight: 700; }
.task-partner-role { margin-top: 4px; font-size: 14px; color: var(--text-secondary); }
.task-partner .task-buttons { margin-top: var(--space-3); }

/* ----- status control ----- */
.task-status-label { display: block; margin-bottom: var(--space-2); font-size: 15px; font-weight: 600; }
.task-status-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.task-status-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.task-status-btn:hover:not(:disabled) { border-color: var(--text-tertiary); }
.task-status-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.task-status-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  color: #fff;
}
.task-status-btn.is-current { border-color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.task-status-btn.is-current .task-status-mark { background: var(--accent); border-color: var(--accent); }
.task-status-btn:disabled {
  background: var(--surface-2);
  border-style: dashed;
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}
.task-status.is-busy { opacity: 0.7; pointer-events: none; }
.task-status-card .banner { margin-top: var(--space-3); }
.task-blocked { margin-top: var(--space-3); }
.task-blocked .banner { margin-top: 0; }
.task-blockers {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}
.task-blockers li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.task-blockers .link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--amber-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----- closing actions ----- */
.task-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.task-actions .helper { margin-top: 0; }

/* ----- completion banner ----- */
.task-banner .task-buttons { margin-top: var(--space-3); }
.task-banner-next { font-weight: 600; }

/* ----- help sheet and list ----- */
.task-help-form .field:last-of-type { margin-bottom: 0; }
.task-help-form .muted { margin-bottom: var(--space-4); }
.task-help-problem:not(:empty) { margin-top: var(--space-3); }
.task-help-sent-link { margin-top: var(--space-3); }
.task-help-sent-link .link { display: inline-flex; align-items: center; min-height: var(--tap); }
.task-help-all { margin-top: var(--space-3); }
.task-help-all .link { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ----- choice blocks under next step (SPEC 16.3 insurer, 16.4 bank) ----- */
.task-choices { display: flex; flex-direction: column; gap: var(--space-3); }
.task-choice-intro { margin: 0; }
.task-choice-step { margin: var(--space-4) 0 var(--space-2); font-size: 15px; font-weight: 700; }
.task-choice-types { min-width: 0; margin: 0; padding: 0; border: 0; }
.task-choice-types > legend { padding: 0; }
.task-choice-type-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.task-choice-type {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.task-choice-type:hover { border-color: var(--text-tertiary); }
.task-choice-type:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.task-choice-type:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.task-choice-type input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.task-choice-type-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-choice-type-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.task-choice-pick { margin: var(--space-2) 0 0; }
.task-choice-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-top: var(--space-2); }
.task-choice-option {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.task-choice-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.task-choice-desc { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.task-choice-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.task-choice-bsn,
.task-choice-notes { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.task-choice-packages { display: flex; flex-direction: column; gap: var(--space-1); }
.task-choice-sub { margin: 0; font-size: 14px; font-weight: 700; }
.task-choice-list { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.task-choice-li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 14px; line-height: 1.45; }
.task-choice-li > svg { flex: none; margin-top: 2px; color: var(--accent-strong); }
.task-choice-li-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.task-choice-note { font-size: 13px; color: var(--text-secondary); }
.task-choice-estimate { margin: 0; font-size: 15px; font-weight: 700; }
.task-choice-option .btn { margin-top: var(--space-1); }
.task-choice-checklist { margin-top: var(--space-4); }
.task-choice-price {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.task-choice-price > svg { flex: none; margin-top: 2px; }
.task-choice-bank > .banner,
.task-choice-insurer > .banner { margin-top: var(--space-3); }

/* ----- wider screens ----- */
@media (min-width: 560px) {
  .task-status-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .task-buttons > .btn { flex: 0 1 auto; }
  .task-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Housing guide handles the task (SPEC 16.6): the guide's status line replaces the status buttons. */
.task-status-guide .task-guide-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; }
.task-status-guide .task-guide-text { font-weight: 600; }

/* SPEC 19.6: health insurance starts with "Do this now"; the rest is folded with native <details>. */
.task-do-now-steps { margin: 0 0 var(--space-3); padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--space-2); }
.task-do-now-steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-2); align-items: start; }
.task-do-now-steps li::before {
  content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--text);
}
.task-do-now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.task-do-now-option { display: flex; flex-direction: column; gap: var(--space-1); justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2); }
.task-do-now-option .task-choice-name { margin: 0; }
.task-do-now-free { margin: var(--space-2) 0 0; font-size: 14px; color: var(--text-secondary); }
.task-fold { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 var(--space-3); }
.task-fold + .task-fold { margin-top: var(--space-2); }
.task-fold-summary { cursor: pointer; padding: var(--space-3) 0; font-weight: 600; }
.task-fold-body { padding-bottom: var(--space-3); display: grid; gap: var(--space-3); }
