#mhp-wrapper {
  max-width: 750px;
  margin: 1.5em 0;
  font-family: inherit;
}

/* Planningsconflict-box: same amber advisory tone as the tip banner below,
   deliberately not red/error-colored - it's "please fix", not a broken app. */
#mhp-conflict-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  background: #fff8e6;
  border: 1px solid #f0e0b0;
  border-radius: 8px;
  padding: 0.85em 1em;
  margin-bottom: 1.25em;
  font-size: 0.9em;
  color: #6b5a1f;
}

.mhp-conflict-icon {
  flex-shrink: 0;
  margin-top: 0.15em;
  color: #b8952f;
}

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

.mhp-conflict-header {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.mhp-conflict-title {
  font-weight: 600;
  margin: 0;
  flex: 1;
}

/* Shared enlarged collapse chevron for the dates banner and the conflict
   box - bigger than the category-row .mhp-chev since these sit in a taller,
   more prominent header rather than a dense task-list row. */
.mhp-section-collapse-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  color: inherit;
}

.mhp-section-collapse-btn .mhp-chev {
  font-size: 1.4em;
}

/* Same glyphs as the dates-banner button (guarantees identical rendered
   size); this one just mirrors horizontally since it sits on the right of
   its header instead of the left, so "collapsed" should point left. */
#mhp-conflict-collapse-btn .mhp-chev {
  display: inline-block;
  transform: scaleX(-1);
}

.mhp-conflict-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5em;
}

.mhp-conflict-table td {
  padding: 0.4em 0;
  border-top: 1px solid #f0e0b0;
  line-height: 1.4;
  vertical-align: middle;
}

.mhp-conflict-table tr:first-child td {
  border-top: none;
}

.mhp-conflict-fix-cell {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.8em !important;
  text-align: right;
}

.mhp-conflict-fix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 0.3em;
  border: 1px solid #d9c98a;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.mhp-conflict-fix-btn:hover {
  background: #fff2cc;
}

#mhp-tip-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  background: #fff8e6;
  border: 1px solid #f0e0b0;
  border-radius: 8px;
  padding: 0.75em 1em;
  margin-bottom: 1.25em;
  font-size: 0.9em;
  color: #6b5a1f;
}

.mhp-tip-icon {
  flex-shrink: 0;
  margin-top: 0.1em;
  color: #b8952f;
}

.mhp-tip-text {
  line-height: 1.4;
  flex: 1;
}

.mhp-tip-label {
  color: #b8952f;
}

#mhp-tip-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #6b5a1f;
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2em;
}

#mhp-tip-close:hover {
  color: #3d3211;
}

/* Dates banner: one merged box holding all 4 anchor dates, each as its own
   row. A global toggle switches every row at once between the plain date
   picker and the slider - not per row. */
#mhp-dates-banner {
  background: #f4f6fb;
  border: 1px solid #dde3f0;
  border-radius: 8px;
  padding: 1em 1.25em;
  margin-bottom: 1.5em;
}

#mhp-dates-header {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-bottom: 0.9em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid #dde3f0;
}

#mhp-dates-banner.mhp-dates-collapsed #mhp-dates-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#mhp-dates-header-title {
  font-weight: 600;
  font-size: 0.95em;
}

/* Collapsed-state summary: an icon + short date per anchor, replacing the
   row list entirely while collapsed. */
#mhp-dates-header-summary {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  font-size: 0.88em;
  font-weight: 600;
  color: #333;
}

.mhp-dates-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-variant-numeric: tabular-nums;
}

.mhp-mode-toggle {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid #dde3f0;
  border-radius: 6px;
  overflow: hidden;
}

.mhp-mode-btn {
  display: flex;
  align-items: center;
  padding: 0.35em 0.55em;
  background: #fff;
  border: none;
  cursor: pointer;
  color: #666;
}

.mhp-mode-btn + .mhp-mode-btn {
  border-left: 1px solid #dde3f0;
}

.mhp-mode-btn-active {
  background: #2c3e83;
  color: #fff;
}

.mhp-date-row + .mhp-date-row {
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px solid #dde3f0;
}

.mhp-date-row-overdue {
  margin-left: 0.5em;
  font-size: 0.85em;
  font-weight: 600;
  color: #c0392b;
  text-transform: none;
  letter-spacing: normal;
}

.mhp-countdown {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  flex-wrap: wrap;
  margin-bottom: 0.4em;
}

.mhp-days-num {
  font-size: 1.8em;
  font-weight: 700;
  color: #2c3e83;
  line-height: 1;
}

.mhp-days-label {
  font-weight: 600;
  color: #333;
  font-size: 0.95em;
}

.mhp-date-display {
  color: #666;
  font-size: 0.85em;
}

.mhp-change-date-btn {
  padding: 0.35em 0.7em;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  font-size: 0.85em;
}

.mhp-date-form {
  display: flex;
  gap: 0.5em;
  align-items: center;
  margin-top: 0.4em;
}

.mhp-date-form input[type="date"] {
  padding: 0.4em;
}

.mhp-date-form button {
  padding: 0.4em 0.9em;
  cursor: pointer;
}

.mhp-date-error {
  color: #c0392b;
  font-size: 0.85em;
  margin-top: 0.5em;
  margin-bottom: 0;
}

/* Add-task form */
#mhp-add-form {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
  flex-wrap: wrap;
}

#mhp-add-form input[type="text"] {
  flex: 1;
  min-width: 150px;
  padding: 0.5em;
}

#mhp-add-form select,
#mhp-add-form input[type="date"] {
  padding: 0.5em;
}

#mhp-add-form button {
  padding: 0.5em 1em;
  cursor: pointer;
}

/* Task table. table-layout: fixed makes every column width an exact,
   guaranteed pixel/em value from the CSS below - with the default
   "auto" layout, a wide header word (like "Voltooid") silently forces
   its whole column wider than the checkbox/icon it contains, no matter
   what padding is set on the data cells. Every column below has an
   explicit width so they sum to 100% and nothing can inflate them. */
#mhp-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#mhp-table th,
#mhp-table td {
  padding: 0.6em 0.5em;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

#mhp-table th {
  font-size: 0.85em;
  text-transform: uppercase;
  color: #666;
}

/* Category header rows */
.mhp-cat-header td {
  padding: 0;
  border-bottom: 1px solid #e0e0e0;
}

/* Checkbox column: just wide enough for the checkbox. The header shows
   a checkmark symbol instead of the word "Voltooid" (which is kept for
   screen readers via .mhp-sr-only) so the column can stay narrow. */
.mhp-check-col {
  width: 20px;
  padding-right: 0.2em !important;
  text-align: left;
}

.mhp-check-col input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
}

.mhp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anchor icon column (key = handover, truck = moving day): just wide
   enough for the 16px icon, no left margin, so it sits flush against
   the checkbox column. */
.mhp-anchor-col {
  width: 22px;
  padding-left: 0 !important;
  padding-right: 0.3em !important;
  text-align: left !important;
}

/* Task name column: takes all remaining width once the other columns'
   fixed widths are subtracted */
.mhp-task-name {
  width: auto;
}

/* Date column: wide enough for "16 Okt" without wrapping */
.mhp-task-date {
  width: 4.5em;
  white-space: nowrap;
}

/* Days-remaining column: just a number (or "X te laat") */
.mhp-task-remaining {
  width: 4.5em;
  white-space: nowrap;
}

/* Delete-button column */
.mhp-delete-col {
  width: 2em;
  text-align: center;
}

.mhp-anchor-icon {
  display: inline-flex;
  vertical-align: middle;
}

/* Task name cell */
.mhp-task-name-text {
  line-height: 1.3;
}

.mhp-task-row.mhp-done .mhp-task-name-text {
  text-decoration: line-through;
  opacity: 0.6;
}

.mhp-cat-header-row {
  display: flex;
  align-items: center;
  background: #f4f6fb;
}

.mhp-cat-header-row:hover {
  background: #eaeef8;
}

.mhp-cat-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: none;
  border: none;
  padding: 0.7em 0.75em;
  cursor: pointer;
  font-size: 1em;
  text-align: left;
}

.mhp-chev {
  font-style: normal;
  width: 0.9em;
  display: inline-block;
  color: #666;
}

.mhp-cat-label {
  font-weight: 600;
  color: #2c3e83;
}

.mhp-cat-count {
  margin-left: auto;
  font-size: 0.85em;
  color: #777;
  font-weight: normal;
}

.mhp-overdue-text {
  color: #c0392b;
  font-weight: bold;
}

.mhp-delete {
  background: none;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  color: #999;
}

.mhp-delete:hover {
  color: #c0392b;
}

/* "Toon meer/minder" - lives in the category header row itself now */
.mhp-showmore-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #2c3e83;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35em 0.7em;
  margin-right: 0.75em;
}

.mhp-showmore-btn:hover {
  text-decoration: underline;
}

#mhp-empty-msg {
  color: #888;
  font-style: italic;
}

.mhp-cat-notstarted-msg {
  padding: 0.8em 0.9em;
  font-size: 0.85em;
  color: #888;
  font-style: italic;
}

#mhp-tip-reshow-row {
  margin-top: 1.5em;
}

#mhp-tip-reshow-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.85em;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#mhp-tip-reshow-btn:hover {
  color: #b8952f;
}

#mhp-reset-row {
  margin-top: 1.5em;
}

#mhp-reset-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.85em;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#mhp-reset-btn:hover {
  color: #c0392b;
}

#mhp-sync-row {
  margin-top: 1em;
  background: #eef2fb;
  border: 1px solid #cdd8f0;
  border-radius: 8px;
  padding: 0.9em 1.1em;
}

#mhp-sync-btn {
  background: #2c3e83;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1em;
  font-size: 0.9em;
  cursor: pointer;
}

#mhp-sync-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.mhp-sync-hint {
  margin: 0.6em 0 0;
  font-size: 0.82em;
  color: #555;
}

.mhp-sync-result {
  margin: 0.6em 0 0;
  font-size: 0.85em;
  font-weight: 600;
  color: #2c3e83;
}

#mhp-full-reset-row {
  margin-top: 1em;
  background: #fbeaea;
  border: 1px solid #eec7c7;
  border-radius: 8px;
  padding: 0.9em 1.1em;
}

#mhp-full-reset-btn {
  background: #a33333;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1em;
  font-size: 0.9em;
  cursor: pointer;
}

.mhp-full-reset-hint {
  margin: 0.6em 0 0;
  font-size: 0.82em;
  color: #555;
}

.mhp-date-block-title {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 0.5em;
  font-size: 0.85em;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mhp-date-block-title .mhp-anchor-icon {
  flex-shrink: 0;
}

/* Slider mode pane */
.mhp-slider-wrap {
  position: relative;
  padding-top: 1.6em;
}

.mhp-slider-bubble {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.12s;
  background: #2c3e83;
  color: #fff;
  font-size: 0.78em;
  font-weight: 600;
  padding: 0.15em 0.6em;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.mhp-slider-bubble.mhp-visible {
  opacity: 1;
}

.mhp-date-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: var(--mhp-track-gradient, #e0e0e0);
  cursor: pointer;
}

.mhp-date-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2c3e83;
  border: 2px solid #fff;
  box-shadow: 0 0 0 var(--mhp-ring-width, 0px) var(--mhp-ring-color, transparent), 0 0 0 1px #dde3f0;
  cursor: grab;
}

.mhp-date-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #2c3e83;
  box-shadow: 0 0 0 var(--mhp-ring-width, 0px) var(--mhp-ring-color, transparent), 0 0 0 1px #dde3f0;
  cursor: grab;
}

.mhp-date-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--mhp-track-gradient, #e0e0e0);
}

#mhp-showall-row {
  margin: 0.75em 0 1em;
  font-size: 0.9em;
  color: #555;
}

#mhp-showall-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  cursor: pointer;
}

#mhp-week-showall-row {
  margin: 0.75em 0 1em;
  font-size: 0.9em;
  color: #555;
}

#mhp-week-showall-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  cursor: pointer;
}

#mhp-progress {
  margin: 0.5em 0 1.25em;
}

.mhp-progress-track {
  height: 8px;
  background: #eceff5;
  border-radius: 4px;
  overflow: hidden;
}

.mhp-progress-fill {
  height: 100%;
  background: #3b6d11;
  border-radius: 4px;
}


#mhp-view-toggle {
  display: inline-flex;
  gap: 0.25em;
  margin-bottom: 1em;
  background: #f4f6fb;
  border: 1px solid #dde3f0;
  border-radius: 8px;
  padding: 0.2em;
}

.mhp-view-btn {
  border: none;
  background: none;
  padding: 0.4em 0.9em;
  font-size: 0.9em;
  color: #555;
  cursor: pointer;
  border-radius: 6px;
}

.mhp-view-btn:hover {
  background: #eaeef8;
}

.mhp-view-btn-active {
  background: #2c3e83;
  color: #fff;
}

#mhp-priority-undo-btn {
  display: flex;
  align-items: center;
  margin-left: 0.4em;
  padding: 0.4em 0.6em;
  border: none;
  border-left: 1px solid #dde3f0;
  border-radius: 0;
  background: none;
  color: #555;
  cursor: pointer;
}

#mhp-priority-undo-btn:hover:not(:disabled) {
  color: #2c3e83;
}

#mhp-priority-undo-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Prioriteit view: the "Prio" column becomes a colored progress bar (blue =
   just started, red = due/overdue) and hides the day-count text; the
   "Deadline" date column stays as its own separate column, unchanged. Both
   elements always exist in the cell; #mhp-wrapper.mhp-view-priority just
   flips which one is visible, so no per-row DOM changes are needed when
   switching views. */
.mhp-remaining-text {
  display: inline;
}

.mhp-priority-bar {
  display: none;
  align-items: center;
  width: 44px;
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  overflow: hidden;
}

.mhp-priority-fill {
  display: block;
  height: 100%;
  border-radius: 4px 0 0 4px;
  width: 0%;
}

#mhp-wrapper.mhp-view-priority .mhp-remaining-text {
  display: none;
}

#mhp-wrapper.mhp-view-priority .mhp-priority-bar {
  display: inline-flex;
}

.mhp-week-header td {
  background: #f4f6fb;
  font-weight: 600;
  color: #2c3e83;
  padding: 0.7em 0.75em;
}

.mhp-week-count {
  margin-left: 0.4em;
  font-size: 0.85em;
  color: #777;
  font-weight: normal;
}

.mhp-week-empty-msg {
  margin-left: 0.6em;
  font-size: 0.85em;
  color: #888;
  font-style: italic;
  font-weight: normal;
}

#mhp-csv-issues {
  margin-top: 1.5em;
  background: #fff8e6;
  border: 1px solid #f0d090;
  border-radius: 8px;
  padding: 0.9em 1.1em;
  font-size: 0.85em;
  color: #6b4a1f;
}

.mhp-csv-issues-title {
  font-weight: 600;
  margin: 0 0 0.5em;
}

#mhp-csv-issues ul {
  margin: 0;
  padding-left: 1.2em;
}

#mhp-csv-issues li {
  margin-bottom: 0.3em;
}

#mhp-csv-issues li:last-child {
  margin-bottom: 0;
}

/* Mobile stacked-card layout for the task table below ~480px. The table
   itself becomes block-level, and each task row becomes a small card
   laid out on a 2-row grid: checkbox/icon/name on top, date/remaining
   underneath - avoids cramming 6 table columns into a phone width. */
@media (max-width: 480px) {
  #mhp-table, #mhp-table tbody {
    display: block;
    width: auto;
  }

  #mhp-table thead {
    display: none;
  }

  #mhp-table tr {
    display: block;
    width: auto;
  }

  #mhp-table td, #mhp-table th {
    display: block;
    width: auto;
  }

  #mhp-table tr.mhp-task-row {
    position: relative;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "check icon name name"
      ".     .    date remain";
    column-gap: 0.5em;
    row-gap: 0.3em;
    align-items: start;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 0.65em 2.1em 0.65em 0.65em;
    margin: 0 0 0.5em;
  }

  #mhp-table tr.mhp-task-row td {
    padding: 0;
    border-bottom: none;
  }

  #mhp-table tr.mhp-cat-header td,
  #mhp-table tr.mhp-week-header td,
  #mhp-table tr.mhp-cat-notstarted-row td {
    padding: 0;
  }

  .mhp-check-col {
    grid-area: check;
    margin-top: 0.15em;
  }

  .mhp-anchor-col {
    grid-area: icon;
    padding: 0 !important;
  }

  .mhp-task-name {
    grid-area: name;
  }

  .mhp-task-date {
    grid-area: date;
    font-size: 0.8em;
    color: #777;
  }

  .mhp-task-remaining {
    grid-area: remain;
    font-size: 0.8em;
    color: #777;
    display: flex;
    justify-content: flex-end;
  }

  .mhp-delete-col {
    position: absolute;
    top: 0.5em;
    right: 0.4em;
    width: auto;
    text-align: right;
  }
}
