:root {
  --bg: #f7f8f3;
  --paper: #fffefa;
  --ink: #293e34;
  --muted: #6b766d;
  --green: #365c46;
  --line: #e1e6da;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: default; }
a { color: var(--green); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #9cb579; outline-offset: 3px; }
[hidden] { display: none !important; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 21px; letter-spacing: -.8px; font-weight: 750; }
.brand-dot { margin-left: -8px; color: #96ae71; }
.brand-mark { width: 31px; height: 32px; position: relative; display: inline-block; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 19px; height: 26px; border-radius: 14px; background: var(--green); top: 3px; transform: rotate(-25deg); }
.brand-mark::after { background: #a6bd77; left: 12px; transform: rotate(25deg); mix-blend-mode: multiply; }
.shell { max-width: 720px; margin: auto; min-height: 100dvh; }
.topbar { padding: max(14px, env(safe-area-inset-top)) 20px 13px; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sync { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #97ae76; }
.avatar { background: #e4ebd8; border: 1px solid #d8e1cc; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 650; width: 44px; height: 44px; }
.main { padding: 9px 20px calc(114px + env(safe-area-inset-bottom)); }
.intro { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 23px; gap: 15px; }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -1.2px; font-weight: 650; margin: 0 0 7px; overflow-wrap: anywhere; }
.intro p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.intro p > span { padding: 0 5px; color: #a7b09c; }
.text-button { background: none; border: 0; color: var(--green); padding: 10px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.intro .text-button { padding: 0; min-height: 32px; }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 9px; background: var(--green); border: 0; color: white; border-radius: 12px; padding: 13px 20px; min-height: 48px; font-size: 15px; font-weight: 550; }
.primary:hover { background: #294b37; }
.desktop-add { display: none; }
.full { width: 100%; }
.filter-row { margin-bottom: 17px; }
.tabs { display: flex; background: #eaf0e2; border-radius: 12px; padding: 4px; gap: 2px; }
.tab { flex: 1; min-width: 0; min-height: 44px; padding: 9px 8px; background: none; border: 0; border-radius: 9px; font-size: 13px; color: #68775d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.active { background: var(--paper); box-shadow: 0 1px 4px #293e3412; color: var(--ink); font-weight: 650; }
.list-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 19px; }
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap > span { position: absolute; left: 13px; top: 9px; font-size: 23px; color: #7c8870; pointer-events: none; }
input, select, textarea { width: 100%; border: 1px solid #dbe2d3; background: var(--paper); border-radius: 10px; color: var(--ink); padding: 13px 12px; font-size: 16px; margin-top: 7px; min-height: 48px; }
.search { padding-left: 38px; margin: 0; background: #f0f3e9; border-color: transparent; }
.category-filter { width: 126px; margin: 0; background: transparent; font-size: 13px; padding: 10px; }
.list-heading { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 9px; padding: 0 2px; }
#task-list { display: grid; gap: 10px; }
.task { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: start; column-gap: 6px; padding: 13px 8px 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.check { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: white; padding: 0; font-size: 13px; isolation: isolate; }
.check::before { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #bccbb0; z-index: -1; }
.check:hover::before { background: #e4edd9; border-color: #8ba573; }
.done .check::before { background: #8da575; border-color: #8da575; }
.task-main { min-width: 0; padding-top: 10px; }
.task-title { font-size: 15px; line-height: 1.45; font-weight: 550; overflow-wrap: anywhere; }
.task.done .task-title { color: #75816e; text-decoration: line-through; }
.task-note { font-size: 13px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.task-meta { display: flex; align-items: center; gap: 7px 9px; flex-wrap: wrap; font-size: 11px; line-height: 1.5; color: #73816a; margin-top: 10px; }
.tag { padding: 3px 7px; background: #edf1e4; border-radius: 5px; color: #5c704c; }
.tag[data-category="Administratif"] { background: #eee9f1; color: #806e8a; }
.tag[data-category="Santé"] { background: #f4e9dd; color: #926b46; }
.tag[data-category="Courses"] { background: #edeedb; color: #72743e; }
.overdue { color: #a46643; }
.task-person { display: inline-flex; align-items: center; gap: 5px; }
.tiny-avatar { width: 18px; height: 18px; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 50%; font-size: 9px; background: #e5ebda; color: var(--green); }
.task-actions { display: contents; }
.edit-button { grid-column: 3; grid-row: 1; width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 24px; color: #7b8971; padding: 0; border-radius: 8px; }
.edit-button:hover { background: #edf1e5; }
.take-button, .release-button { grid-column: 2 / 4; grid-row: 2; justify-self: start; min-height: 44px; margin: 7px 0 0; border: 0; background: none; color: var(--green); padding: 8px 0; font-size: 13px; font-weight: 550; }
.take-button::before { content: "+"; margin-right: 6px; }
.release-button { font-size: 12px; font-weight: 400; color: var(--muted); }
.quick-add { display: flex; gap: 8px; margin-top: 15px; }
.quick-add input { margin: 0; min-width: 0; background: none; border-style: dashed; }
.quick-add button { width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #eaf0e1; flex-shrink: 0; font-size: 24px; }
.empty { padding: 46px 15px; text-align: center; }
.empty-symbol { display: block; color: #a1b58b; font-size: 30px; margin-bottom: 15px; }
.empty h2 { font-size: 17px; font-weight: 550; margin: 0; }
.empty p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.bottom-nav { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; gap: 10px; padding: 11px max(16px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--paper); }
.bottom-tab { border: 0; background: none; color: #78856e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; font-size: 11px; position: relative; }
.bottom-tab > span { font-size: 21px; line-height: 1; }
.bottom-tab.active { color: var(--green); font-weight: 700; }
.bottom-tab small { position: absolute; top: 0; left: calc(50% + 9px); font-size: 9px; border-radius: 7px; background: #e6eddb; padding: 2px 4px; }
.nav-add { min-width: 0; }
.nav-add > span { font-size: 23px; font-weight: 400; }
.offline-banner { padding: 13px; margin-bottom: 18px; background: #f3e9d9; color: #865f37; font-size: 13px; line-height: 1.6; border-radius: 10px; }
.install-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: #edf1e4; border-radius: 10px; padding: 12px; margin-top: 20px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.install-banner > span { flex: 1; }
.install-banner button { border: 0; background: none; color: var(--green); text-decoration: underline; font-size: 12px; min-height: 44px; }
dialog { position: fixed; inset: auto 0 0; margin: 0 auto; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); width: 100%; max-width: 600px; max-height: calc(100dvh - max(16px, env(safe-area-inset-top))); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); box-shadow: 0 -8px 60px #203c3020; }
dialog::backdrop { background: #20352e65; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { font-size: 10px; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; }
.icon-button { min-width: 44px; min-height: 44px; border: 0; background: none; border-radius: 8px; font-size: 26px; }
dialog h2 { margin: 6px 0 24px; font-size: 24px; letter-spacing: -.7px; font-weight: 600; }
dialog > p { color: var(--muted); font-size: 14px; line-height: 1.7; }
label { display: block; margin-bottom: 17px; font-size: 13px; font-weight: 550; }
.optional { margin-left: 4px; font-size: 11px; font-weight: 400; color: var(--muted); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-grid input, .form-grid select { min-width: 0; padding-left: 8px; padding-right: 8px; }
.form-error { color: #a3523c; font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.hint { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; margin-top: 7px; }
.delete-task { width: 100%; min-height: 48px; background: none; border: 0; color: #a25d44; font-size: 13px; margin-top: 12px; }
.account-panel { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-panel strong { font-size: 14px; overflow-wrap: anywhere; }
.account-panel .hint { margin-top: 3px; }
.account-panel > div { min-width: 0; }
.account-panel button { flex-shrink: 0; font-size: 12px; }
#toast { position: fixed; z-index: 10; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 10px); max-width: calc(100vw - 32px); padding: 13px 18px; background: #293f32; color: white; font-size: 13px; border-radius: 10px; box-shadow: 0 4px 20px #20352e20; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.auth-layout { min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 24px max(30px, env(safe-area-inset-bottom)); max-width: 440px; margin: auto; }
.auth-header { margin-bottom: 49px; }
.auth-form h1 { font-size: 28px; margin-bottom: 28px; }
.auth-form > p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: -12px 0 25px; }
.auth-form .primary { margin-top: 8px; }
.auth-mode { text-align: center; margin-top: 22px; color: var(--muted); font-size: 13px; }
.auth-switch { display: inline-block; background: none; border: 0; min-height: 44px; color: var(--green); text-decoration: underline; text-underline-offset: 3px; padding: 10px 5px; font-size: 13px; }
.auth-form > .hint { margin-top: 14px; }
@media (min-width: 768px) {
  .shell { max-width: 820px; padding: 10px 28px; }
  .topbar { padding: 16px 12px 20px; border-bottom: 1px solid var(--line); }
  .main { padding: 24px 12px 120px; }
  .intro { padding: 5px 0 28px; }
  h1 { font-size: 36px; }
  .desktop-add { display: inline-flex; }
  .nav-add { display: none; }
  .bottom-nav { grid-template-columns: 1fr 1fr; max-width: 360px; margin: auto; bottom: 20px; border: 1px solid var(--line); border-radius: 16px; padding: 8px 20px; box-shadow: 0 4px 25px #293e3410; }
  .bottom-tab { flex-direction: row; gap: 9px; font-size: 13px; }
  .bottom-tab small { position: static; }
  .tabs { max-width: 460px; }
  .list-tools { margin-top: 20px; }
  .category-filter { width: 160px; }
  .task { padding: 15px 14px; column-gap: 10px; }
  dialog { inset: 0; margin: auto; max-width: 500px; max-height: calc(100dvh - 64px); border-radius: 20px; padding: 25px; }
  .auth-layout { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* Person colours are separate from neutral category labels. */
[data-color="neutral"] { --person: #8b9389; --person-light: #f0f2ed; }
[data-color="sage"] { --person: #42754f; --person-light: #e6efdf; }
[data-color="blue"] { --person: #396fa8; --person-light: #e5edf7; }
[data-color="terracotta"] { --person: #b46643; --person-light: #f7e9df; }
[data-color="purple"] { --person: #8259a9; --person-light: #efe8f7; }
[data-color="rose"] { --person: #b55279; --person-light: #f8e6ed; }
[data-color="gold"] { --person: #96751e; --person-light: #f5edcd; }
.person-dot { display: inline-block; width: 9px; height: 9px; min-width: 9px; border-radius: 50%; background: var(--person, #8b9389); }
.avatar[data-color] { background: var(--person-light); color: var(--person); border-color: var(--person); }
.task[data-color] { background: var(--person-light); }
.task .chip:not(.overdue) { background: #ffffffb3; }
.view-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; flex-shrink: 0; }
.view-switch button { min-height: 40px; padding: 7px 10px; background: transparent; border: 0; border-radius: 7px; font-size: 12px; }
.view-switch button[aria-pressed="true"] { background: #e7eddf; color: var(--green); font-weight: 650; }
.composer { margin: 0 0 23px; border: 1px solid #ccd8bf; padding: 10px; border-radius: 14px; background: var(--paper); }
.composer-line { display: flex; align-items: center; gap: 8px; }
.composer-line input { min-width: 0; border: 0; background: transparent; margin: 0; padding-left: 5px; }
.composer-submit { width: 44px; min-width: 44px; min-height: 44px; padding: 0; font-size: 24px; }
.chips { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 9px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; border: 1px solid transparent; background: #f0f2eb; color: #62705c; border-radius: 8px; padding: 8px; font-size: 11px; line-height: 1.5; max-width: 100%; overflow-wrap: anywhere; }
.chip:hover { border-color: #c8d4bc; }
.chip.overdue { color: #a45a37; background: #f7eae0; }
.chip.person-chip { background: var(--person-light); color: var(--person); }
.task .chips { margin-left: -2px; }
.task-main { padding-top: 9px; }
.task { grid-template-columns: 36px minmax(0, 1fr) 36px; column-gap: 4px; }
.task .check, .task .edit-button { width: 36px; min-height: 44px; }
.task .chip { min-height: 44px; }
.task .edit-button { font-size: 22px; }
.task .take-button { margin-top: 2px; }
.intro { align-items: flex-start; }
.choice-list { display: grid; gap: 4px; max-height: 42dvh; overflow-y: auto; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; text-align: left; padding: 12px; border: 0; border-radius: 9px; background: #f2f5ec; font-size: 15px; overflow-wrap: anywhere; }
.choice > span:last-child { margin-left: auto; }
.choice:hover { background: #e7eddc; }
.inline-form { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.inline-form input { margin: 0; min-width: 0; }
.inline-form .primary { padding: 10px 15px; }
.date-shortcuts { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.date-shortcuts .chip { min-height: 44px; font-size: 13px; }
.save-status { font-size: 12px; color: var(--green); min-height: 19px; }
.dialog-heading { margin-bottom: 20px; gap: 12px; }
.dialog-heading h2 { margin: 0; }
#picker-content details { margin: 0 0 20px; }
#picker-content summary { min-height: 44px; cursor: pointer; font-size: 13px; padding: 12px 0; }
.color-field { border: 0; padding: 0; margin: 0 0 15px; }
.color-field legend { font-size: 13px; font-weight: 550; margin-bottom: 12px; }
.color-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.color-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 0; padding: 12px 5px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.color-option input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; width: 100%; height: 100%; cursor: pointer; }
.color-swatch { width: 25px; height: 25px; border-radius: 50%; background: var(--person); }
.color-option:has(input:checked) { border-color: var(--person); background: var(--person-light); }
.color-option:has(input:checked) .color-swatch::after { content: '✓'; color: white; display: grid; place-items: center; height: 100%; }
.color-option:has(input:disabled) { opacity: .4; cursor: default; }
.color-option:has(input:focus-visible) { outline: 3px solid #9cb579; outline-offset: 3px; }
.share-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.share-section h3 { margin: 0 0 14px; font-size: 15px; }
.share-section p { font-size: 13px; color: var(--muted); line-height: 1.7; }
#calendar { margin-bottom: 22px; padding: 8px 10px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-heading h2 { font-size: 16px; font-weight: 600; text-transform: capitalize; margin: 0; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-week { font-size: 11px; color: var(--muted); text-align: center; padding: 12px 0 6px; }
.calendar-day { min-width: 0; min-height: 47px; padding: 6px 0 4px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 5px; background: transparent; }
.calendar-day.is-today > span:first-child { color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.calendar-day[aria-pressed="true"] { background: #e7eedc; border-color: #c0d0ab; }
.calendar-dots { min-height: 6px; display: flex; justify-content: center; gap: 3px; }
.calendar-dots .person-dot { width: 5px; height: 5px; min-width: 5px; }
.calendar-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 5px; margin-top: 8px; }
.calendar-footer .text-button { font-size: 12px; text-decoration: none; }
.calendar-footer [aria-pressed="true"] { font-weight: 700; }
@media (max-width: 359px) {
  .main { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 29px; }
  .view-switch button { padding-left: 7px; padding-right: 7px; }
  .intro { gap: 8px; }
}
@media (min-width: 768px) {
  .task { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .task .check, .task .edit-button { width: 44px; }
  .view-switch button { font-size: 13px; padding: 10px 16px; }
  #calendar { max-width: 470px; margin-left: auto; margin-right: auto; }
}
/* Mobile date sheet: direct day selection, optional native time control. */
.picker-calendar { margin-bottom: 14px; }
.picker-calendar .calendar-heading h3 { margin: 0; font-size: 16px; font-weight: 600; text-transform: capitalize; }
.picker-calendar .calendar-day { justify-content: center; min-height: 44px; gap: 0; }
.date-shortcuts [aria-pressed="true"] { background: #e5edd9; border-color: #bfceac; color: var(--green); }
.picker-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 9px 0; min-height: 62px; }
.picker-time label { display: flex; align-items: center; gap: 16px; margin: 0; flex: 1; }
.picker-time input { width: 135px; min-width: 0; margin: 0; font-size: 18px; font-variant-numeric: tabular-nums; text-align: center; }
.picker-time .text-button { flex-shrink: 0; text-decoration: none; }
.picker-repeat { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 0; }
.picker-repeat select { width: auto; max-width: 70%; margin: 0; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
