@font-face { font-family: 'Outfit'; src: url('/fonts/Outfit.ttf') format('truetype'); font-weight: 300 800; font-display: swap; }
:root { --blue: #2563eb; --blue-d: #1d4ed8; --blue-l: #eff6ff; --orange: #ea580c; --orange-l: #fff7ed; --red: #dc2626; --red-l: #fef2f2;
  --green: #16a34a; --ink: #0f172a; --mid: #475569; --soft: #94a3b8; --line: #e2e8f0; --bg: #f1f5f9; --card: #fff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Outfit', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.35; }
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* top bar: logo left, Install top right */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo b { font-size: 17px; letter-spacing: .5px; }
.logo small { color: var(--soft); font-size: 11px; font-weight: 600; white-space: nowrap; }

/* buttons look like buttons */
.btn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; min-height: 38px; line-height: 1.1; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-d); }
.btn.ghost { background: #fff; }
.btn.danger { color: var(--red); border-color: #fecaca; background: var(--red-l); margin-right: auto; }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.icon { width: 38px; padding: 0; font-size: 22px; flex: none; }
.btn.wide { display: block; width: calc(100% - 24px); margin: 12px auto 4px; min-height: 46px; font-size: 15.5px; }
.btn.install { margin-left: auto; flex: none; min-height: 34px; padding: 6px 12px; font-size: 13.5px; background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.add { width: 34px; min-height: 34px; padding: 0; font-size: 18px; color: var(--blue); border-color: #bfdbfe; background: var(--blue-l); flex: none; }
.btn.post { flex: none; align-self: center; min-height: 32px; padding: 5px 10px; font-size: 13px; color: var(--orange); border-color: #fed7aa; background: var(--orange-l); }
.btn.chip { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn.chip.on { background: var(--blue-l); border-color: var(--blue); color: var(--blue-d); }

main { max-width: 560px; margin: 0 auto; padding-bottom: 96px; }

/* month calendar */
.cal { background: var(--card); margin: 12px 12px 0; border-radius: 16px; padding: 10px 10px 8px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.calhead { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.calhead h1, .calhead h3 { flex: 1; text-align: center; margin: 0; font-size: 17px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.grid.wd span { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--soft); padding: 2px 0 4px; }
.grid.wd span:first-child { color: #f87171; }
.day { position: relative; border: 0; background: transparent; border-radius: 10px; height: 40px; font-size: 14.5px; font-weight: 600; padding: 0; }
.day.out { color: #cbd5e1; }
.day.past { color: var(--soft); }
.day.soon { background: #f8fafc; }
.day.today { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.35); }
.day.sel { outline: 2px solid var(--blue); outline-offset: -2px; background: var(--blue-l); color: var(--blue-d); }
.day.today.sel { background: var(--blue); color: #fff; outline-color: var(--orange); }
.day:disabled { color: #cbd5e1; background: transparent; cursor: default; text-decoration: line-through; text-decoration-color: #e2e8f0; }
/* a date with tasks: a coloured tab joined to its opened week below (no dots) */
.grid.wk { margin-top: 3px; }
.day .n { position: absolute; top: 2px; right: 3px; min-width: 15px; height: 15px; border-radius: 8px; font-style: normal; font-size: 10px; line-height: 15px; font-weight: 800; color: #fff; background: var(--orange); padding: 0 3px; }
.day.has { border-radius: 10px 10px 0 0; height: 44px; margin-bottom: -4px; }
.day.has.todo { background: #ffedd5; color: #9a3412; }
.day.has.late { background: #fee2e2; color: #991b1b; }
.day.has.late .n { background: var(--red); }
.day.has.alldone { background: #dcfce7; color: #166534; }
.day.has.alldone .n { background: var(--green); }
.day.has.today { background: var(--blue); color: #fff; }
.day.has.today .n { background: #fff; color: var(--blue-d); }
.wkopen { display: grid; gap: 4px; padding: 6px; border-radius: 0 0 12px 12px; background: #fff7ed; border: 1.5px solid #fed7aa; margin-bottom: 4px; }
.wkday { display: flex; gap: 8px; align-items: flex-start; text-align: left; width: 100%; border: 1.5px solid #fed7aa; background: #fff; border-radius: 10px; padding: 7px 9px; font-size: 13.5px; }
.wkday b { flex: none; min-width: 52px; font-size: 13px; color: #9a3412; }
.wkday.late { border-color: #fecaca; } .wkday.late b { color: var(--red); }
.wkday.alldone { border-color: #bbf7d0; } .wkday.alldone b { color: var(--green); }
.wkday.is-today { border-color: var(--blue); } .wkday.is-today b { color: var(--blue-d); }
.wkt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.wkt span { overflow-wrap: anywhere; font-weight: 500; }
.wkt .dn { text-decoration: line-through; color: var(--soft); }
.wkt .more { color: var(--mid); font-weight: 700; font-size: 12.5px; }

/* sections */
.block { margin: 14px 12px 0; }
.block h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--mid); margin: 0 4px 8px; display: flex; align-items: center; gap: 6px; }
.block.late h2 { color: var(--red); }
.count { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; letter-spacing: 0; }
.block.late .tasks { background: var(--card); border: 1.5px solid #fecaca; border-radius: 14px; padding: 4px 10px; }
.days { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,.06); }

/* a day: one short row when empty, open card with tasks when it has tasks */
.dayrow { border-top: 1px solid var(--line); padding: 6px 10px 6px 12px; transition: background .4s; }
.dayrow:first-child { border-top: 0; }
.dayhead { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.dl { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dl b { font-size: 14.5px; font-weight: 600; }
.dl small { color: var(--soft); font-size: 12.5px; font-weight: 600; }
.dayrow:not(.open) .dl b { font-weight: 500; color: var(--mid); }
.dayrow.sun:not(.open) .dl b { color: #ef4444; }
.dayrow.open { background: #fff; padding-bottom: 8px; }
.dayrow.open .dl b { font-weight: 700; }
.dayrow.is-today { background: var(--blue-l); box-shadow: inset 4px 0 0 var(--blue); }
.dayrow.is-today .dl b { color: var(--blue-d); }
.dayrow.flash { background: #fef3c7; }
.tally { font-size: 12px; font-weight: 600; color: var(--orange); white-space: nowrap; }
.dayrow .tasks { margin-top: 4px; }

/* a task */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.task:first-child { border-top: 0; }
.check { flex: none; width: 28px; height: 28px; margin-top: 3px; border-radius: 50%; border: 2px solid #94a3b8; background: #fff; font-size: 15px; font-weight: 800; color: #fff; padding: 0; line-height: 1; }
.task.done .check { background: var(--green); border-color: var(--green); }
.ttl { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 6px 0; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.ttl span { display: block; }
.ttl small { display: block; color: var(--soft); font-size: 12px; font-weight: 600; margin-top: 2px; }
.ttl .was { color: var(--red); }
.task.done .ttl span { text-decoration: line-through; color: var(--soft); }

.hint { margin: 16px 18px 0; color: var(--mid); font-size: 14px; text-align: center; }
.privacy { margin: 16px 18px 0; color: var(--soft); font-size: 12px; text-align: center; }

/* bottom sheet */
.sheetwrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 18px 18px 0 0;
  padding: 16px 14px; padding-bottom: max(16px, env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet h2 { margin: 0 0 4px; font-size: 18px; }
.sheet .what { margin: 6px 0 2px; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.sheet .from { margin: 0 0 6px; color: var(--mid); font-size: 13.5px; }
.lbl { display: block; font-size: 13.5px; font-weight: 600; color: var(--mid); margin: 10px 0 6px; }
textarea { width: 100%; font: inherit; font-size: 15px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: none; min-height: 46px; overflow-y: auto; }
textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--blue); }
textarea.err { border-color: var(--red); }
.whenrow { font-size: 15px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker { margin-top: 10px; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; }
.picker .day { height: 36px; }
.sheet .tasks { margin: 6px 0; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.actions .btn { min-height: 42px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 8px 8px 14px; font-size: 14px; max-width: calc(100% - 24px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#toast[hidden] { display: none; }
#toast span { overflow-wrap: anywhere; }

/* WhatsApp Help steps aside while a sheet is open, so it never covers Save / Move (it is back when the sheet closes) */
body.noscroll #zk-support { display: none !important; }
.tally.ok { color: var(--green); }
