:root {
  color-scheme: light dark;
  --accent: #55b65b;
  --accent-deep: #2f7439;
  --surface: #edf8ef;
  --surface-strong: rgba(255, 255, 255, 0.82);
  --text: #173021;
  --muted: #68776d;
  --line: rgba(53, 91, 64, 0.14);
  --green-soft: #e1f3e4;
  --yellow-soft: #fff2bd;
  --red-soft: #ffe0de;
  --red: #c83d35;
}
[data-theme="dark"] {
  --surface: #13231a;
  --surface-strong: rgba(31, 52, 39, 0.88);
  --text: #edf8ef;
  --muted: #a9baad;
  --line: rgba(218, 239, 222, 0.18);
  --green-soft: #284b32;
  --yellow-soft: #594e21;
  --red-soft: #5b2d2b;
  --red: #ff8d86;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--surface); }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 8% 2%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 30%),
    radial-gradient(circle at 100% 22%, rgba(86, 183, 222, .16), transparent 34%),
    linear-gradient(155deg, color-mix(in srgb, var(--surface) 92%, white), var(--surface));
  font-family: "Segoe UI", system-ui, sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.app-shell { width: 100%; min-height: 100vh; padding: 12px 12px 22px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 54%, transparent), transparent 68%); }
.app-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; align-items: center; margin-bottom: 12px; padding: 3px 2px 7px; }
.app-logo { width: 40px; height: 40px; padding: 2px; border: 1px solid rgba(255,255,255,.82); border-radius: 12px; background: rgba(255,255,255,.64); box-shadow: 0 7px 18px rgba(43, 102, 60, .12); }
.app-heading { min-width: 0; }
.eyebrow { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; }
h1 { margin: 1px 0 0; overflow: hidden; font-size: clamp(16px, 5vw, 19px); line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
h2 { margin: 0 0 9px; font-size: 20px; }
p { color: var(--muted); }
.round-button, .icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 11px; background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong)); box-shadow: 0 6px 15px rgba(41, 88, 53, .09); cursor: pointer; }
.round-button.primary { color: white; background: linear-gradient(145deg, color-mix(in srgb, var(--accent-deep) 82%, white), var(--accent-deep)); font-size: 23px; font-weight: 300; }
.glass-card, .auth-card { padding: 14px; border: 1px solid rgba(255,255,255,.76); border-radius: 15px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 92%, white), color-mix(in srgb, var(--surface-strong) 82%, transparent)); box-shadow: 0 10px 30px rgba(40, 92, 55, .08); backdrop-filter: blur(18px) saturate(130%); }
.auth-card { margin-top: 8vh; }
label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
input, select { width: 100%; min-width: 0; height: 40px; padding: 0 10px; color: var(--text); border: 1px solid var(--line); border-radius: 11px; outline: none; background: color-mix(in srgb, var(--surface-strong) 90%, white); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.button { min-height: 39px; padding: 7px 13px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 700; }
.button:disabled { cursor: wait; opacity: .55; }
.button.primary { color: white; background: var(--accent-deep); }
.button.secondary { background: var(--green-soft); }
.button.danger { color: var(--red); background: var(--red-soft); }
.auth-card form { display: grid; gap: 12px; }
.auth-actions, .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.feedback { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; }
.add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.wide { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 7px; }
.check-row input { width: 17px; height: 17px; }
.filters { display: grid; gap: 7px; padding: 11px; border: 1px solid rgba(255,255,255,.74); border-radius: 15px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 74%, transparent), color-mix(in srgb, var(--surface-strong) 48%, transparent)); box-shadow: 0 10px 26px rgba(42, 89, 54, .06); backdrop-filter: blur(18px); }
.date-filter { grid-template-columns: auto minmax(125px, 1fr); align-items: center; gap: 9px; }
.date-control { position: relative; display: flex; align-items: center; width: 100%; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--surface-strong) 90%, white); overflow: hidden; }
.date-display { flex: 1; color: var(--text); font-size: 13px; font-weight: 600; text-align: left; }
.calendar-glyph { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 17%, transparent); font-size: 17px; }
.date-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.button-row { display: grid; gap: 7px; }
.button-row.two { grid-template-columns: 1fr 1fr; }
.filter-button, .status-filter { min-height: 37px; border: 1px solid rgba(255,255,255,.52); border-radius: 11px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong)); cursor: pointer; }
.filter-button.selected, .status-filter.selected { color: var(--accent-deep); border-color: color-mix(in srgb, var(--accent) 44%, transparent); background: color-mix(in srgb, var(--accent) 20%, var(--surface-strong)); font-weight: 700; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.segmented button { border-radius: 10px; }
.summary, .sync-banner { padding: 9px 11px; border-radius: 11px; }
.summary { color: #996800; border: 1px solid color-mix(in srgb, #dfc269 65%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--yellow-soft) 82%, transparent), color-mix(in srgb, var(--yellow-soft) 44%, transparent)); font-weight: 750; }
.sync-banner { margin-top: 8px; color: var(--muted); border: 1px solid rgba(255,255,255,.62); background: color-mix(in srgb, var(--surface-strong) 64%, transparent); font-size: 10px; backdrop-filter: blur(12px); }
.sync-banner.error { color: var(--red); background: var(--red-soft); }
.task-groups { display: grid; gap: 11px; margin-top: 11px; }
.task-group { border-radius: 13px; }
.group-heading { display: flex; justify-content: space-between; gap: 8px; padding: 8px 11px; border-radius: 11px; font-size: 12px; font-weight: 800; }
.task-group.overdue .group-heading { color: #a52f29; background: var(--red-soft); }
.task-group.today .group-heading { color: #8e6500; background: var(--yellow-soft); }
.task-group.future .group-heading, .task-group.other .group-heading { color: var(--accent-deep); background: var(--green-soft); }
.task-list { display: grid; gap: 7px; padding-top: 7px; }
.task-item { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 9px; align-items: center; min-height: 62px; padding: 10px 9px 10px 11px; border: 1px solid rgba(255,255,255,.82); border-radius: 13px; background: linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 94%, white), color-mix(in srgb, var(--surface-strong) 78%, transparent)); box-shadow: 0 7px 18px rgba(40, 84, 52, .07); backdrop-filter: blur(16px); }
.task-item input[type="checkbox"] { appearance: none; display: grid; place-items: center; width: 19px; height: 19px; margin: 0; padding: 0; border: 1.5px solid color-mix(in srgb, var(--accent-deep) 68%, var(--muted)); border-radius: 6px; background: transparent; cursor: pointer; }
.task-item input[type="checkbox"]::after { content: "✓"; color: white; font-size: 14px; font-weight: 900; line-height: 1; transform: scale(0); transition: transform .12s ease; }
.task-item input[type="checkbox"]:checked { border-color: var(--accent); background: linear-gradient(145deg, var(--accent), var(--accent-deep)); }
.task-item input[type="checkbox"]:checked::after { transform: scale(1); }
.task-copy { min-width: 0; }
.task-title { overflow-wrap: anywhere; font-size: 13px; font-weight: 600; line-height: 1.3; }
.task-item.done { opacity: .78; }
.task-item.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-meta { margin-top: 2px; color: var(--muted); font-size: 10px; }
.task-time { padding: 5px 8px; border: 1px solid rgba(255,255,255,.54); border-radius: 9px; background: var(--green-soft); font-size: 10px; font-weight: 800; }
.delete-task { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid color-mix(in srgb, var(--red) 20%, transparent); border-radius: 9px; color: var(--red); background: color-mix(in srgb, var(--red-soft) 76%, transparent); cursor: pointer; opacity: .76; transition: transform .14s ease, opacity .14s ease, background .14s ease; }
.task-item:hover .delete-task, .delete-task:focus-visible { background: var(--red-soft); box-shadow: 0 4px 12px color-mix(in srgb, var(--red) 18%, transparent); opacity: 1; transform: translateY(-1px); }
.trash-icon { position: relative; display: block; width: 11px; height: 12px; margin-top: 3px; border: 1.8px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; background: repeating-linear-gradient(90deg, transparent 0 2px, color-mix(in srgb, currentColor 58%, transparent) 2px 3px); }
.trash-icon::before { content: ""; position: absolute; left: -3px; top: -4px; width: 13px; height: 2px; border-radius: 2px; background: currentColor; }
.trash-icon::after { content: ""; position: absolute; left: 3px; top: -7px; width: 5px; height: 3px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.empty-state { padding: 65px 12px 25px; text-align: center; }
.empty-state .checkmark { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 28%, white); font-size: 36px; }
.empty-state p { margin: 0; font-size: 13px; }
dialog { width: calc(100% - 24px); max-width: 390px; padding: 0; color: var(--text); border: 1px solid rgba(255,255,255,.72); border-radius: 17px; background: color-mix(in srgb, var(--surface) 96%, white); box-shadow: 0 24px 70px rgba(20, 48, 30, .28); }
dialog::backdrop { background: rgba(10, 22, 15, .52); backdrop-filter: blur(4px); }
.settings-card, .confirm-card { display: grid; gap: 14px; padding: 18px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; }
.account-block { display: grid; gap: 9px; padding-top: 8px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.privacy-note { margin: 0; font-size: 11px; }
@media (max-width: 330px) {
  .app-shell { padding: 10px; }
  .app-logo { display: none; }
  .app-header { grid-template-columns: minmax(0, 1fr) auto auto; }
  .date-filter, .add-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .task-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .delete-task { grid-column: 3; }
  .task-time { grid-column: 2; width: max-content; }
}
