:root {
  color-scheme: light;
  --bg: #fff8ee;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #392f38;
  --muted: #786a74;
  --line: #eadedb;
  --purple: #8057e6;
  --purple-deep: #6640c5;
  --purple-soft: #eee7ff;
  --coral: #ee746a;
  --coral-dark: #b93f37;
  --coral-soft: #fff0ee;
  --mint: #dff5e8;
  --mint-ink: #27704c;
  --yellow: #fff0b8;
  --yellow-ink: #8c6104;
  --blue: #dfeaff;
  --blue-ink: #315aa8;
  --shadow: 0 12px 32px rgba(74, 54, 61, .09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(238, 231, 255, .75), transparent 28rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="date"],
input[type="time"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(128, 87, 230, .3);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.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;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(92px + var(--safe-bottom));
}

.hero {
  min-height: calc(205px + var(--safe-top));
  padding: calc(16px + var(--safe-top)) clamp(18px, 4vw, 44px) 30px;
  position: relative;
  overflow: hidden;
  background: #f0e8ff;
  border-radius: 0 0 34px 34px;
}

.hero-orb {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-orb-one {
  width: 164px;
  height: 164px;
  right: -47px;
  top: -45px;
  background: rgba(247, 180, 141, .72);
}

.hero-orb-two {
  width: 80px;
  height: 80px;
  left: 62%;
  bottom: -42px;
  background: rgba(167, 224, 194, .65);
}

.status-row,
.hero-copy,
.avatar-pair {
  position: relative;
  z-index: 1;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--purple);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  transform: rotate(-4deg);
  box-shadow: 0 6px 14px rgba(102, 64, 197, .22);
}

.sync-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .64);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 650;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d89632;
}

.sync-status.online .sync-dot {
  background: #43a675;
}

.sync-status.error .sync-dot {
  background: var(--coral-dark);
}

.hero-copy {
  margin-top: 23px;
}

.eyebrow,
.section-kicker,
.dialog-kicker {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .01em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 570px;
  margin: 0;
  font-size: clamp(27px, 7vw, 42px);
  line-height: 1.06;
  letter-spacing: -.045em;
  font-weight: 780;
}

.avatar-pair {
  position: absolute;
  right: clamp(18px, 4vw, 44px);
  bottom: 24px;
  display: flex;
}

.avatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 3px solid #f0e8ff;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.avatar + .avatar {
  margin-left: -10px;
}

.avatar-marielle {
  background: #c45b82;
}

.avatar-jan {
  background: #4f72cb;
}

.main-content {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 17px clamp(14px, 4vw, 34px) 36px;
}

.view[hidden] {
  display: none;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.overview-card {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 0;
  border-radius: 21px;
  color: var(--ink);
  text-align: left;
}

.urgent-card {
  background: var(--yellow);
}

.open-card {
  background: var(--mint);
}

.overview-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .52);
  font-size: 19px;
}

.overview-card strong,
.overview-card small {
  display: block;
}

.overview-card strong {
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
}

.overview-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 1px 12px;
}

.person-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}

.person-tabs::-webkit-scrollbar {
  display: none;
}

.pill,
.filter-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill {
  padding: 0 15px;
}

.pill.active {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 5px 14px rgba(128, 87, 230, .22);
}

.filter-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.filter-count {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--purple);
  font-size: 10px;
}

.active-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 13px;
  color: var(--purple-deep);
  background: var(--purple-soft);
  font-size: 12px;
  font-weight: 650;
}

.active-filter-summary button {
  min-height: 34px;
  padding: 0;
  border: 0;
  color: var(--purple-deep);
  background: transparent;
  text-decoration: underline;
  font-weight: 750;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(74, 54, 61, .055);
  animation: task-in .24s ease both;
}

@keyframes task-in {
  from { opacity: 0; transform: translateY(5px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.task-check {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #cfbec8;
  border-radius: 12px;
  color: transparent;
  background: transparent;
  font-weight: 900;
}

.task-check:hover,
.task-check:focus-visible {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-soft);
}

.category-bubble {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-size: 20px;
}

.task-main {
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.task-title {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 760;
}

.task-meta {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 580;
}

.task-side {
  max-width: 92px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.due-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 8px;
  border-radius: 9px;
  color: var(--muted);
  background: #f4f0ef;
  font-size: 10px;
  line-height: 1.15;
  text-align: right;
  font-weight: 750;
}

.due-badge.today,
.due-badge.overdue {
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.due-badge.empty {
  visibility: hidden;
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9eb7a9;
  box-shadow: 0 0 0 4px rgba(158, 183, 169, .18);
}

.priority-dot.normal {
  background: #e3a73d;
  box-shadow: 0 0 0 4px rgba(227, 167, 61, .17);
}

.priority-dot.high {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(238, 116, 106, .17);
}

.task-card.completing {
  opacity: .52;
  transform: scale(.985);
}

.empty-state {
  max-width: 430px;
  margin: 34px auto 0;
  padding: 28px 22px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, .52);
}

.empty-state.compact {
  margin-top: 16px;
}

.empty-illustration {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: var(--purple-soft);
  font-size: 28px;
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 19px;
}

.empty-state p {
  margin: 0 auto 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.floating-add {
  width: 58px;
  height: 58px;
  position: fixed;
  z-index: 20;
  right: max(19px, calc((100vw - 1120px) / 2 + 24px));
  bottom: calc(77px + var(--safe-bottom));
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 24px rgba(238, 116, 106, .38);
  font-size: 32px;
  line-height: 1;
}

.floating-add:hover {
  background: #df665c;
  transform: translateY(-2px);
}

.bottom-nav {
  min-height: calc(67px + var(--safe-bottom));
  position: fixed;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px 12px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, .94);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
}

.nav-icon {
  font-size: 19px;
  line-height: 1;
}

.nav-item.active {
  color: var(--purple);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 5px 2px 8px;
}

.section-heading h2,
.dialog-header h2 {
  margin: 0;
  font-size: clamp(25px, 6vw, 34px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.section-description {
  max-width: 680px;
  margin: 0 2px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.round-add-button {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--purple);
  font-size: 25px;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 11px;
}

.category-card {
  min-height: 80px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 21px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.category-card-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 21px;
}

.category-card strong,
.category-card small {
  display: block;
}

.category-card strong {
  font-size: 14px;
}

.category-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.category-card-chevron {
  color: var(--muted);
  font-size: 20px;
}

.archive-list .task-card {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.archive-list .task-check {
  display: none;
}

.archive-actions {
  display: flex;
  gap: 4px;
}

.archive-action {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: #f4f0ef;
  font-size: 16px;
}

.sheet-dialog,
.confirm-dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.sheet-dialog {
  width: min(100% - 18px, 640px);
  max-height: min(88vh, 820px);
  margin: auto auto 0;
  overflow: visible;
}

.sheet-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(44, 35, 43, .45);
  backdrop-filter: blur(3px);
}

.sheet-dialog > form {
  max-height: min(88vh, 820px);
  overflow-y: auto;
  padding: 11px clamp(18px, 4vw, 28px) calc(22px + var(--safe-bottom));
  border-radius: 30px 30px 0 0;
  background: var(--surface-strong);
  box-shadow: 0 -16px 46px rgba(44, 35, 43, .18);
}

.dialog-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 15px;
  border-radius: 999px;
  background: #d9cdd4;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.dialog-header h2 {
  font-size: 28px;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 15px;
  color: var(--muted);
  background: #f4f0ef;
  font-size: 27px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field.full-width {
  margin-bottom: 13px;
}

.field > span,
.category-style-fieldset legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.field > span b {
  color: var(--coral-dark);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fffdfb;
  font-size: 16px;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--coral-dark);
  background: var(--coral-soft);
}

.field-error {
  min-height: 0;
  color: var(--coral-dark);
  font-size: 11px;
  line-height: 1.3;
}

.field-error:empty {
  display: none;
}

.custom-recurrence {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 13px;
  padding: 12px;
  border-radius: 17px;
  background: var(--purple-soft);
}

.custom-recurrence p {
  flex: 1 0 auto;
  margin: 15px 0 0;
  font-size: 13px;
  font-weight: 680;
}

.compact-field {
  flex: 1;
}

.form-note {
  margin: 14px 1px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.split-actions {
  justify-content: space-between;
}

.primary-button,
.secondary-button,
.danger-button,
.danger-ghost-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  font-weight: 760;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 7px 18px rgba(128, 87, 230, .22);
}

.primary-button:hover {
  background: var(--purple-deep);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.danger-button {
  border: 0;
  color: #fff;
  background: var(--coral-dark);
}

.danger-ghost-button {
  border: 0;
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.category-style-fieldset {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.category-style-fieldset legend {
  margin-bottom: 8px;
}

.icon-options,
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-option {
  position: relative;
}

.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-option span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #f5f0f2;
  font-size: 21px;
}

.choice-option input:checked + span {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.choice-option input:focus-visible + span {
  outline: 3px solid rgba(128, 87, 230, .3);
  outline-offset: 2px;
}

.color-options .choice-option span {
  border-radius: 50%;
  background: var(--option-color);
}

.color-options .choice-option input:checked + span {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--purple);
}

.checkbox-field {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.checkbox-field input {
  width: 22px;
  height: 22px;
  accent-color: var(--purple);
}

.confirm-dialog {
  width: min(100% - 30px, 390px);
  margin: auto;
}

.confirm-dialog form {
  padding: 24px;
  border-radius: 26px;
  background: var(--surface-strong);
  text-align: center;
  box-shadow: var(--shadow);
}

.confirm-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 17px;
  color: var(--coral-dark);
  background: var(--coral-soft);
  font-size: 23px;
  font-weight: 800;
}

.confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 20px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(82px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 30px), 420px);
  pointer-events: none;
}

.toast {
  padding: 13px 16px;
  border-radius: 15px;
  color: #fff;
  background: #3d343b;
  box-shadow: 0 10px 30px rgba(44, 35, 43, .24);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  animation: toast-in .2s ease both;
}

.toast.error {
  background: var(--coral-dark);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@media (min-width: 760px) {
  .app-shell {
    padding-bottom: 48px;
  }

  .hero {
    min-height: 228px;
    border-radius: 0 0 46px 46px;
  }

  .hero-copy {
    width: min(100%, 1120px);
    margin: 34px auto 0;
  }

  .avatar-pair {
    right: max(44px, calc((100vw - 1120px) / 2 + 44px));
  }

  .main-content {
    padding-top: 24px;
  }

  .overview-grid {
    max-width: 500px;
  }

  .task-list:not(.archive-list) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    width: 310px;
    min-height: 62px;
    left: 50%;
    right: auto;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }

  .floating-add {
    bottom: 23px;
  }

  .sheet-dialog {
    margin: auto;
  }

  .sheet-dialog > form {
    border-radius: 30px;
    padding-bottom: 25px;
  }

  .dialog-handle {
    display: none;
  }
}

@media (max-width: 430px) {
  .hero {
    min-height: calc(198px + var(--safe-top));
  }

  .hero-copy {
    margin-top: 20px;
  }

  .avatar-pair {
    bottom: 22px;
  }

  .toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .person-tabs {
    width: 100%;
    margin-left: -2px;
  }

  .filter-button {
    margin-left: auto;
  }

  .task-card {
    grid-template-columns: 31px 40px minmax(0, 1fr) auto;
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .task-check {
    width: 31px;
    height: 31px;
  }

  .category-bubble {
    width: 39px;
    height: 39px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .custom-recurrence {
    flex-wrap: wrap;
  }

  .custom-recurrence p {
    flex-basis: 100%;
    margin-top: 0;
  }
}

@media (max-width: 360px) {
  .overview-card {
    gap: 8px;
    padding: 10px;
  }

  .overview-icon {
    width: 34px;
    height: 34px;
  }

  .filter-button {
    padding: 0 10px;
  }

  .task-side {
    max-width: 70px;
  }

  .due-badge {
    padding-inline: 6px;
  }
}
