/* Today, task cards, Quick Add and task pages (views/today.js, task.js, quickadd.js,
   taskactions.js). Big touch targets: these screens are used with wet hands. */

/* category colours (one token pair per category) */
.cat-green { --cat: var(--green); --catSoft: var(--greenSoft); }
.cat-rose { --cat: var(--rose); --catSoft: var(--roseSoft); }
.cat-amber { --cat: var(--amber); --catSoft: var(--amberSoft); }
.cat-slate { --cat: var(--slate); --catSoft: var(--slateSoft); }
.cat-gold { --cat: var(--gold); --catSoft: var(--goldSoft); }
.cat-plum { --cat: var(--plum); --catSoft: var(--plumSoft); }
.cat-berry { --cat: var(--berry); --catSoft: var(--berrySoft); }

.big-tap { min-height: 48px; font-size: 15px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9.5px; border-width: 1px; vertical-align: middle; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--panel3); color: var(--muted); font-size: 12px; font-weight: 800; vertical-align: 2px; }

/* ---------- Today ---------- */
.today-view { max-width: 760px; margin: 0 auto; }
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 2px 10px; }
.today-head h2 { margin: 0; font-size: 22px; }
.today-head p { margin: 2px 0 0; }
.today-filter, .today-cats { margin-bottom: 6px; }
.today-cats .chip .icon, .today-filter .chip .avatar { width: 16px; height: 16px; }
.today-sec { margin: 14px 0 6px; }
.today-sec > h3 { margin: 0 2px 8px; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.today-sec.overdue > h3 { color: var(--red); }
.today-sec.overdue > h3 .count-pill { background: var(--redSoft); color: var(--red); }
.today-sec.now > h3 { color: var(--gold); }
.today-sec.now > h3 .count-pill { background: var(--goldSoft); color: var(--gold); }
.today-cat h4, .today-day h4 { margin: 12px 2px 6px; font-size: 13px; color: #57544d; display: flex; align-items: center; gap: 6px; }
.today-cat h4 .icon { width: 16px; height: 16px; }
.today-empty { margin-top: 12px; }
.today-empty > .icon { width: 34px; height: 34px; color: var(--green); display: block; margin: 0 auto 6px; }
.today-done { margin-top: 16px; }
.today-foot { text-align: center; margin-top: 16px; }
.tl-dot.ok { background: var(--greenSoft); color: var(--green); }

/* one task card: tap the body for the menu, DONE is one tap */
.tcard {
  display: flex; align-items: stretch; gap: 0; background: var(--panel); border: 1px solid var(--line);
  border-left: 6px solid var(--cat, var(--green)); border-radius: 15px; margin: 0 0 9px; overflow: hidden;
  box-shadow: 0 3px 12px rgba(20, 30, 24, .05); transition: opacity .25s, transform .25s;
}
.tcard.leaving { opacity: .35; transform: translateX(8px); }
.tcard.high { box-shadow: 0 0 0 2px var(--redSoft), 0 3px 12px rgba(20, 30, 24, .06); }
.today-sec.overdue .tcard { border-color: #e6b9b3; background: #fffafa; border-left-color: var(--cat, var(--red)); }
.tcard-body {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 11px 12px; display: flex; flex-direction: column; gap: 3px;
  color: var(--ink); cursor: pointer;
}
.tcard-body:focus-visible { outline: 3px solid var(--greenSoft); outline-offset: -3px; }
.tcard-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--cat, var(--green)); }
.tcard-cat .icon { width: 14px; height: 14px; }
.tcard-title { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.tcard-ctx { font-size: 13px; color: #57544d; font-weight: 650; }
.tcard-note { font-size: 13px; color: var(--muted); }
.tcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; }
.tcard-due { font-weight: 800; color: #57544d; }
.today-sec.overdue .tcard-due { color: var(--red); }
.today-sec.now .tcard-due { color: var(--gold); }
.tcard-due.snoozed { color: var(--slate); }
.tcard-people { display: inline-flex; gap: 2px; margin-left: auto; }
.tcard-meta .badge .icon { width: 12px; height: 12px; vertical-align: -2px; }
.tcard-actions { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px; border-left: 1px solid var(--line2); background: var(--panel2); }
.done-btn { min-width: 74px; min-height: 52px; flex-direction: column; gap: 1px; font-size: 13px; border-radius: 12px; padding: 6px 8px; }
.done-btn .icon { width: 22px; height: 22px; }
.snooze-btn { min-height: 38px; padding: 6px; border-radius: 11px; }
.snooze-btn .icon { width: 19px; height: 19px; }

/* ---------- sheets: snooze, action menu, quick add ---------- */
.snooze-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.action-sheet { display: grid; gap: 8px; }
.action-sheet .btn { justify-content: flex-start; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.qa { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.qa > *, .qa-block, .qa-block > * { min-width: 0; }
.qa #qaText { font-size: 17px; min-height: 50px; }
.qa-understood { min-height: 18px; margin-top: 5px; color: var(--green); }
.qa-understood .icon { width: 14px; height: 14px; vertical-align: -2px; }
.qa-block > .field { display: block; margin-bottom: 6px; }
.qa .chips { flex-wrap: wrap; overflow: visible; }
.qa-presets { margin-bottom: 8px; }
.qa-presets .chip { min-height: 42px; }
.qa-presets .chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.qa-when { align-items: end; }
.qa-allday { padding-bottom: 12px; }
.qa-days { margin-top: 8px; }
.qa-rule { margin-top: 6px; color: var(--green); font-weight: 700; }
.qa-more summary { font-weight: 800; }
.qa [hidden] { display: none !important; }

/* checkbox / radio chips */
.chip-check { position: relative; display: inline-flex; flex: none; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: #fff; font-weight: 750; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.chip-check > span .icon { width: 16px; height: 16px; color: var(--cat, var(--green)); }
.chip-check input:checked + span { background: var(--cat, var(--green)); border-color: var(--cat, var(--green)); color: #fff; }
.chip-check input:checked + span .icon { color: #fff; }
.chip-check input:focus-visible + span { outline: 3px solid var(--greenSoft); }
.people-chips { flex-wrap: wrap; }

/* segmented control (notification mode) */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; }
.seg-opt span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; font-weight: 800; font-size: 13.5px; cursor: pointer; border-right: 1px solid var(--line2); }
.seg-opt:last-child span { border-right: 0; }
.seg-opt .icon { width: 17px; height: 17px; }
.seg-opt input:checked + span { background: var(--green); color: #fff; }
.seg-opt input[value="alarm"]:checked + span { background: var(--red); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--greenSoft); outline-offset: -3px; }

/* ---------- one task ---------- */
.task-view { max-width: 760px; margin: 0 auto; }
.task-hero { border-left: 6px solid var(--cat, var(--green)); }
.task-hero h2 { margin: 6px 0 2px; font-size: 22px; }
.task-dl { margin-top: 10px; }
.task-dl dd .icon { width: 14px; height: 14px; vertical-align: -2px; }
.task-notes { white-space: pre-wrap; background: var(--panel2); border: 1px solid var(--line2); border-radius: 11px; padding: 10px 12px; margin-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.timeline li { padding-left: 14px; border-left: 3px solid var(--greenSoft); }
.timeline li.future { border-left-color: var(--slateSoft); color: var(--slate); }
.hist-table td { vertical-align: top; }

/* ---------- shell additions ---------- */
.bottom-nav .nav-add { color: #fff; }
.bottom-nav .nav-add .icon { width: 26px; height: 26px; background: var(--green); border-radius: 14px; padding: 5px; box-sizing: content-box; box-shadow: 0 4px 12px rgba(47, 91, 70, .35); }
.bottom-nav .nav-add span { color: var(--green); }
.top-add { white-space: nowrap; }
.sync-dot.pending::before { background: var(--gold); }
@media (max-width: 760px) {
  .top-add { display: none; }
  .sync-dot.pending .txt, .sync-dot.offline .txt { display: inline; }
  .today-head h2 { font-size: 19px; }
  .view-today .today-head .btn[data-action=quick-add] { display: none; }
  .view-today .today-head .btn[data-action=send-note] { padding: 8px 11px; min-height: 40px; font-size: 13px; }
  .tcard-title { font-size: 16px; }
}
@media print {
  .tcard-actions, .today-filter, .today-cats { display: none; }
}
.timeline li.push { border-left-color: var(--goldSoft); color: #57544d; }
.app-banner { margin-bottom: 8px; }
.app-banner.offline { border-color: #c9d3de; background: var(--slateSoft); }
/* installed app: feels like an app, not a page */
@media (display-mode: standalone) {
  html { overscroll-behavior-y: contain; }
  .footer { display: none; }
  body { -webkit-user-select: none; user-select: none; }
  input, textarea, select, [contenteditable], .task-notes, .tcard-note, .timeline { -webkit-user-select: text; user-select: text; }
}


/* ---------- chores & entities ---------- */
.fields [hidden], .stack [hidden] { display: none !important; }
.code { white-space: nowrap; font: 700 11.5px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--panel3); border-radius: 6px; padding: 1px 6px; color: #57544d; }
.code-big { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 2px; font: 800 20px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; padding: 6px 12px; border: 2px dashed var(--line); border-radius: 12px; }
.code-big .icon { width: 22px; height: 22px; }
.tree { list-style: none; margin: 4px 0; padding-left: 16px; border-left: 2px solid var(--line2); }
.card > .tree { padding-left: 0; border-left: 0; }
.tree li { margin: 5px 0; }
.tree a { font-weight: 750; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; min-height: 30px; }
.tree .icon { width: 16px; height: 16px; color: var(--amber); }
.who-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.who-col { background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px; }
.who-col h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.who-col ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.who-col li.done { color: var(--muted); list-style: none; margin-left: -18px; }
.plain { margin: 0; padding-left: 18px; font-size: 13.5px; }
.pre { white-space: pre-wrap; }
.tpl-pick .check-line { font-weight: 650; }

/* ---------- cultures ---------- */
.culture-card { display: flex; padding: 0; overflow: hidden; border-left: 6px solid var(--cat, var(--gold)); margin-bottom: 9px; }
.culture-card .cc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; color: var(--ink); text-decoration: none; }
.run-plan { margin: 0; padding-left: 20px; font-size: 13.5px; display: grid; gap: 3px; }
.recipe-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.recipe-steps li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line2); }
.recipe-steps li:last-child { border-bottom: 0; }
.rs-when { display: flex; flex-direction: column; }
@media (max-width: 430px) { .recipe-steps li { grid-template-columns: 1fr; gap: 2px; } .rs-when { flex-direction: row; gap: 8px; } }

/* ---------- module tiles, calendar, search ---------- */
.module-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 2px 0 10px; }
.module-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); color: #3d3b36; text-decoration: none; font-size: 11.5px; font-weight: 800; min-height: 58px; justify-content: center; }
.module-tile .icon { width: 22px; height: 22px; color: var(--green); }
.module-tile b { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--gold); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; }
@media (max-width: 560px) { .module-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.calendar-view { max-width: 980px; margin: 0 auto; }
.cal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-views { min-width: 240px; }
.cal-nav { align-items: center; gap: 6px; }
.cal-nav .btn { min-width: 40px; font-size: 18px; }
.cal-day { margin-bottom: 12px; }
.cal-day h3 { margin: 8px 2px 6px; font-size: 13px; letter-spacing: .04em; color: #57544d; }
.cal-day.is-today h3 { color: var(--green); }
.cal-item { display: grid; grid-template-columns: 64px 24px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 9px 10px; margin-bottom: 5px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--cat, var(--green)); color: var(--ink); text-decoration: none; min-height: 44px; }
.cal-item.planned { opacity: .62; border-style: dashed; border-left-style: solid; }
.cal-item.closed .cal-title { text-decoration: line-through; color: var(--muted); }
.cal-time { font-size: 12.5px; font-weight: 800; color: #57544d; }
.cal-dot .icon { width: 17px; height: 17px; color: var(--cat, var(--green)); }
.cal-title { font-weight: 750; overflow-wrap: anywhere; }
.cal-people { display: inline-flex; gap: 2px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-week .cal-item { grid-template-columns: 1fr; gap: 1px; padding: 6px 7px; }
.cal-week .cal-dot, .cal-week .cal-people { display: none; }
@media (max-width: 760px) { .cal-week { grid-template-columns: 1fr; } .cal-week .cal-item { grid-template-columns: 64px minmax(0, 1fr); } .cal-week .cal-time { grid-row: 1; } }
.cal-month { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.cal-dow, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: 6px; font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; background: var(--panel3); }
.cal-cell { min-height: 84px; border: 0; border-top: 1px solid var(--line2); border-right: 1px solid var(--line2); background: none; padding: 5px; text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-cell:nth-child(7) { border-right: 0; }
.cal-cell.other { background: var(--panel2); color: #a19d94; }
.cal-cell.is-today .n { background: var(--green); color: #fff; border-radius: 99px; padding: 0 6px; }
.cal-cell.sel { outline: 3px solid var(--greenSoft); outline-offset: -3px; }
.cal-cell .n { font-weight: 800; font-size: 13px; align-self: flex-start; }
.cal-cell .dots { display: none; gap: 3px; flex-wrap: wrap; align-items: center; }
.cal-cell .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--green)); display: inline-block; }
.cal-cell .dots b { font-size: 10px; }
.cal-cell-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell-titles span { font-size: 11px; line-height: 1.25; padding: 1px 4px; border-radius: 5px; background: var(--catSoft, var(--greenSoft)); color: var(--cat, var(--green)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .cal-cell { min-height: 52px; } .cal-cell-titles { display: none; } .cal-cell .dots { display: flex; } }

.search-view { max-width: 760px; margin: 0 auto; }
.search-box.big { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 4px 12px; margin-bottom: 12px; }
.search-box.big .icon { width: 20px; height: 20px; color: var(--muted); }
.search-box.big input { border: 0; box-shadow: none; font-size: 17px; min-height: 46px; padding: 0; }
@media (min-width: 761px) { .cal-week .cal-title { font-size: 13px; line-height: 1.3; } .cal-week .cal-time { font-size: 11.5px; } }

/* Settings → Notifications: phone setup steps on plain http */
.setup-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.setup-steps li { line-height: 1.5; }
.setup-steps .btn { margin: 2px 0; }
.setup-steps code, .notice code { overflow-wrap: anywhere; }

/* Settings → Security */
#securityForm fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#securityForm .check-line { align-items: flex-start; }
#securityForm .check-line input { margin-top: 4px; flex: none; }
#securityForm code { overflow-wrap: anywhere; }

/* Settings → Even G2 glasses */
.pair-code { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--goldSoft); }
.pair-code strong { font-size: 34px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.g2-install { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.g2-install img { border-radius: 8px; background: #fff; padding: 6px; image-rendering: pixelated; }
.g2-install p { flex: 1 1 200px; margin: 0; }

/* ---------- partner notes & shopping list ---------- */
.note-banner { background: var(--greenSoft); border-color: #bcd8c7; margin-bottom: 8px; }
.note-banner.urgent { background: var(--redSoft); border-color: #efc5c0; animation: note-pulse 1.6s ease-in-out 3; }
.note-banner strong { font-size: 16px; overflow-wrap: anywhere; }
@keyframes note-pulse { 50% { box-shadow: 0 0 0 5px rgba(180, 60, 50, .18); } }
@media (prefers-reduced-motion: reduce) { .note-banner.urgent { animation: none; } }
.note-to .chip, .note-presets .chip { cursor: pointer; }
.note-to .chip:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.note-count { text-align: right; margin-top: 2px; }
.note-sent .title { font-weight: 700; overflow-wrap: anywhere; }
.shop-add { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.shop-add input { flex: 1; min-width: 0; font-size: 16px; }
.shop-item { align-items: center; }
.shop-tick { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--green); background: var(--panel); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.shop-tick[aria-pressed="true"] { background: var(--green); }
.shop-tick .icon { width: 20px; height: 20px; }
.shop-qty { color: var(--muted); font-weight: 700; }
.shop-item .icon-btn.small { width: 32px; height: 32px; }
.shop-view .today-sec > h3 { display: flex; align-items: center; gap: 8px; }
.shop-view .today-sec > h3 .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
