:root {
  --paper: #faf9f6;
  --paper-alt: #f1efe8;
  --paper-muted: #e8e6dd;
  --ink: #23282b;
  --ink-soft: #8a8d84;
  --line: #ddd9cd;
  --teal: #2b6e63;
  --teal-dark: #1f5049;
  --teal-hover: #1f5049;
  --ochre: #a9713a;
  --ochre-bg: #f2e6d5;
  --brick: #b3492f;
  --surface: #ffffff;
  --on-accent: #ffffff;
  --backdrop: rgba(35, 40, 43, 0.35);
  color-scheme: light;
  --shadow: 0 10px 30px rgba(35, 40, 43, 0.12);
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --paper: #151819;
  --paper-alt: #1d2122;
  --paper-muted: #272c2d;
  --ink: #e6e4de;
  --ink-soft: #8d9189;
  --line: #333839;
  --teal: #2f8171;
  --teal-dark: #4aa896;
  --teal-hover: #256a5c;
  --ochre: #dba56b;
  --ochre-bg: #3a2f22;
  --brick: #e27a5e;
  --surface: #1e2223;
  --on-accent: #ffffff;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Grijs: rustiger dan licht, minder zwart dan donker. */
:root[data-theme="gray"] {
  --paper: #383b3e;
  --paper-alt: #414548;
  --paper-muted: #4d5155;
  --ink: #efede8;
  --ink-soft: #bcbfb9;
  --line: #585d62;
  --teal: #6cc0ac;
  --teal-dark: #8fd1c1;
  --teal-hover: #8fd1c1;
  --ochre: #e4b37e;
  --ochre-bg: #4b4135;
  --brick: #f2877c;
  --surface: #44484c;
  --on-accent: #10231f;
  --backdrop: rgba(0, 0, 0, 0.5);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: center;
  margin: 0 8px 8px 0;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand img {
  display: block;
  border-radius: 8px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
}

.settings-toggle {
  margin-left: auto;
}

.settings-toggle + .theme-toggle {
  margin-left: -14px;
}

.theme-toggle {
  margin-left: auto;
  align-self: center;
  margin-bottom: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

/* De knop toont de volgende stand: licht -> grijs -> donker -> licht. */
#themeToggle svg {
  display: none;
}

:root:not([data-theme="gray"]):not([data-theme="dark"]) #themeToggle .icon-gray,
:root[data-theme="gray"] #themeToggle .icon-moon,
:root[data-theme="dark"] #themeToggle .icon-sun {
  display: block;
}

.tab {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 2px 12px;
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

#monthLabel {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 30px;
  margin: 0;
  min-width: 220px;
  text-transform: capitalize;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: var(--paper-alt);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view-toggle {
  flex-shrink: 0;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle-btn {
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: none;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--line);
}

.view-toggle-btn.active {
  background: var(--teal);
  color: var(--on-accent);
}

.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--teal);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--teal-hover);
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-quiet:hover {
  background: var(--paper-alt);
}

.btn-danger {
  background: transparent;
  color: var(--brick);
  border-color: var(--brick);
}

.btn-danger:hover {
  background: rgba(179, 73, 47, 0.08);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 1px;
}

.weekday-row div {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.day-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 108px;
  min-width: 0;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s ease;
}

.day-cell:hover {
  background: var(--paper-alt);
}

.day-cell.outside {
  color: var(--ink-soft);
  background: var(--paper-alt);
}

.day-number {
  font-family: var(--font-serif);
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-cell.today .day-number {
  background: var(--teal);
  color: var(--on-accent);
  border-radius: 50%;
}

.day-cell.week-cell {
  min-height: 260px;
}

.event-chip {
  background: var(--ochre-bg);
  color: var(--ochre);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-chip:hover {
  filter: brightness(0.95);
}

.task-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--teal);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 500;
  padding: 1px 6px 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.task-chip .chip-check {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: var(--on-accent);
}

.task-chip .chip-check:hover {
  background: var(--paper-muted);
}

.task-chip.done .chip-check {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.task-chip .chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.task-chip.drag-source {
  opacity: 0.35;
}

.day-cell.drop-target {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  background: var(--paper-alt);
}

.task-chip.done {
  border-color: var(--line);
  color: var(--ink-soft);
  text-decoration: line-through;
}

.more-events {
  font-size: 11px;
  color: var(--ink-soft);
  padding: 0 6px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px;
  z-index: 10;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.overlay-top {
  z-index: 30;
}

.sheet {
  margin-bottom: 24px;
}

.overlay.open {
  display: flex;
}

.sheet {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sheet-header h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.field span small {
  font-weight: 400;
  color: var(--ink-soft);
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.field textarea {
  resize: vertical;
}

.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.sheet-actions-left {
  display: flex;
  gap: 8px;
}

.sheet-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.tasks-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 26px;
  margin: 0;
}

.task-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.task-add-row input[type="text"] {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.task-add-row input[type="date"] {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.task-add-row input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.task-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--ink-soft);
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

.task-title {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.task-title:hover {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.task-due {
  cursor: pointer;
}

.task-edit {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.task-edit:hover {
  color: var(--teal-dark);
}

.matrix-task-title {
  cursor: pointer;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.task-due {
  font-size: 12px;
  color: var(--ochre);
  background: var(--ochre-bg);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.task-item.done .task-due {
  color: var(--ink-soft);
  background: var(--paper-alt);
}

.task-delete {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.task-delete:hover {
  color: var(--brick);
}

.task-empty {
  color: var(--ink-soft);
  font-size: 14px;
  padding: 24px 4px;
  text-align: center;
}

.date-field-wrap {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.date-field-wrap input {
  flex: 1;
  min-width: 0;
}

.date-picker-btn,
.time-picker-btn {
  width: 38px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
  cursor: pointer;
}

.date-picker-btn:hover,
.time-picker-btn:hover {
  background: var(--paper-alt);
}

.mini-calendar {
  position: absolute;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px;
  width: 240px;
}

.mini-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 14px;
  text-transform: capitalize;
}

.mini-calendar-header .icon-btn {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.mini-calendar-weekdays,
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.mini-calendar-weekdays div {
  font-size: 10px;
  color: var(--ink-soft);
  text-align: center;
  padding: 2px 0;
}

.mini-cal-day {
  aspect-ratio: 1;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
}

.mini-cal-day:hover {
  background: var(--paper-alt);
}

.mini-cal-day.outside {
  color: var(--ink-soft);
  opacity: 0.5;
}

.mini-cal-day.today {
  background: var(--teal);
  color: var(--on-accent);
}

.day-detail-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border-top: 1px solid var(--line);
  max-height: 320px;
  overflow-y: auto;
}

.day-detail-item {
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.day-detail-item:hover {
  background: var(--paper-alt);
}

.day-detail-add {
  width: 100%;
}

.time-picker {
  position: absolute;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: 140px;
}

.time-picker-cols {
  display: flex;
  max-height: 220px;
}

.time-picker-col {
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
}

.time-picker-col:first-child {
  border-right: 1px solid var(--line);
}

.time-picker-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  text-align: center;
  padding: 6px 0;
  cursor: pointer;
}

.time-picker-item:hover {
  background: var(--paper-alt);
}

.time-picker-item.selected {
  background: var(--teal);
  color: var(--on-accent);
}

.search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.search-input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.search-results {
  position: absolute;
  z-index: 15;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}

.search-result-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 12px 4px;
}

.search-result-item {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.search-result-item:hover {
  background: var(--paper-alt);
}

.search-result-item .sr-date {
  color: var(--ink-soft);
  font-size: 12px;
  margin-right: 6px;
}

.search-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.task-override-select {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 9px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.task-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.matrix-quadrant {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.matrix-quadrant h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.matrix-quadrant h3 small {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 11px;
  display: block;
}

.matrix-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 24px;
}

.matrix-task-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.matrix-task-item .task-checkbox {
  flex-shrink: 0;
}

.matrix-task-item .matrix-task-title {
  flex: 1;
  min-width: 80px;
}

.matrix-task-item.done .matrix-task-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.matrix-task-item select {
  font-size: 11px;
  padding: 3px 4px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.matrix-empty {
  color: var(--ink-soft);
  font-size: 12px;
  padding: 6px 0;
}

@media (max-width: 640px) {
  .task-matrix {
    grid-template-columns: 1fr;
  }
  .page {
    padding: 20px 12px 48px;
  }
  #monthLabel {
    font-size: 22px;
    min-width: 0;
  }
  .day-cell {
    min-height: 76px;
    padding: 5px;
  }
  .day-cell.week-cell {
    min-height: 160px;
  }
  .event-chip {
    font-size: 10px;
  }
  .task-add-row {
    flex-wrap: wrap;
  }
  .task-add-row input[type="text"] {
    flex-basis: 100%;
  }
}

.matrix-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px 4px 0;
  color: var(--ink-soft);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.matrix-task-item {
  -webkit-touch-callout: none;
}

.matrix-task-item.drag-source {
  opacity: 0.35;
}

.drag-ghost {
  position: fixed;
  z-index: 50;
  max-width: 240px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--teal);
  border-radius: 6px;
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-quadrant.drop-target {
  border-color: var(--teal);
  background: var(--paper-alt);
}

body.dragging-task {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

/* ---------- Telefoon: compact rooster + dagpaneel ---------- */
.btn-plus {
  display: none;
}

.day-panel {
  display: none;
  margin-top: 18px;
}

.day-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.day-panel-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.day-panel-date {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.day-panel-nav {
  display: flex;
  gap: 8px;
}

.day-panel-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border-top: 1px solid var(--line);
}

.day-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--ochre);
  padding: 12px 6px 12px 10px;
  font-family: var(--font-sans);
  color: var(--ink);
  cursor: pointer;
}

.day-panel-item.task {
  border-left-color: var(--teal);
  align-items: center;
}

.day-panel-item.done .dp-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.dp-time {
  min-width: 46px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.dp-time span:nth-child(2) {
  color: var(--ink-soft);
}

.dp-allday {
  font-size: 12px;
  color: var(--ink-soft);
}

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

.dp-title {
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.dp-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-panel-empty {
  padding: 22px 4px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.day-panel-add {
  width: 100%;
}

.day-dots {
  display: flex;
  gap: 3px;
  height: 5px;
}

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.day-dot.event {
  background: var(--ochre);
}

.day-dot.task {
  background: var(--teal);
}

@media (max-width: 640px) {
  .day-panel {
    display: block;
  }
  .tabs {
    margin-bottom: 14px;
  }
  .search-wrap {
    margin-bottom: 12px;
  }
  .topbar {
    margin-bottom: 10px;
    gap: 10px;
  }
  #newEventBtn {
    padding: 6px 16px;
  }
  #newEventBtn .btn-label {
    display: none;
  }
  #newEventBtn .btn-plus {
    display: inline;
    font-size: 20px;
    line-height: 1.2;
  }
  .weekday-row div {
    text-align: center;
  }
  .grid.compact .day-cell,
  .grid.compact .day-cell.week-cell {
    min-height: 46px;
    padding: 4px 0 3px;
    align-items: center;
    gap: 3px;
  }
  .grid.compact .day-cell:hover {
    background: transparent;
  }
  .grid.compact .day-cell.outside:hover {
    background: var(--paper-alt);
  }
  .grid.compact .day-number {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .grid.compact .day-cell.selected .day-number {
    outline: 2px solid var(--teal);
    outline-offset: 1px;
  }
}

.share-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}


/* ---------- Herhalen ---------- */
.series-note {
  margin: 0 0 14px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ochre);
  background: var(--ochre-bg);
  border-radius: 6px;
}

.repeat-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 12px;
  font-size: 13px;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.repeat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.repeat-row > .date-field-wrap {
  flex: 1;
}

.repeat-box input,
.repeat-box select,
.inline-number input,
.date-field-wrap.narrow input {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}

.repeat-box input[type="number"],
.inline-number input {
  width: 72px;
}

.repeat-row select {
  flex: 1;
}

.repeat-box input:focus,
.repeat-box select:focus,
.inline-number input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.weekday-toggles {
  display: flex;
  gap: 4px;
}

.weekday-toggles button {
  flex: 1;
  min-width: 0;
  padding: 7px 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.weekday-toggles button[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--on-accent);
}

.repeat-summary {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.event-reminder option[hidden],
#eventReminder option[hidden] {
  display: none;
}

/* ---------- Taak bewerken / instellingen / keuzevraag ---------- */
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}

.settings-heading {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 10px;
}

.settings-heading:first-of-type {
  margin-top: 0;
}

.settings-note {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.settings-note.small {
  font-size: 11.5px;
}

.settings-note.error {
  color: var(--brick);
}

.settings-note.good {
  color: var(--teal-dark);
}

.inline-number {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.date-field-wrap.narrow {
  max-width: 150px;
}

.test-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.test-row .settings-note {
  margin: 0;
  flex: 1;
  min-width: 180px;
}

#settingsForm .sheet-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 6px;
}

#settingsForm .sheet-actions .settings-note {
  margin: 0;
}

.scope-sheet {
  max-width: 380px;
}

.scope-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.scope-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scope-actions .btn {
  width: 100%;
  text-align: center;
  padding: 11px 16px;
}

/* ---------- Taken in het dagpaneel (telefoon) ---------- */
.day-panel-item.task .dp-body {
  cursor: pointer;
}

.day-panel-item.task .drag-handle {
  padding-right: 2px;
}

.day-panel-item.drag-source {
  opacity: 0.35;
}

@media (max-width: 640px) {
  .overlay {
    padding: 4vh 12px;
  }
  .brand-name {
    display: none;
  }
  .tabs {
    gap: 18px;
  }
  .settings-toggle + .theme-toggle {
    margin-left: -10px;
  }
}

.day-detail-task {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-detail-task .is-done {
  text-decoration: line-through;
  color: var(--ink-soft);
}
