/* Reminders' look: Apple's, in light and dark. The app puts it in the page (reminders.App imports it as a file of
   the codebase, its text). */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card: #fff;
  --fg: #000;
  --dim: #8a8a8e;
  --rule: rgba(60, 60, 67, 0.18);
  --press: rgba(0, 0, 0, 0.06);
  --blue: #007aff;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --green: #34c759;
  --purple: #af52de;
  --brown: #a2845e;
  --gray: #8e8e93;
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --card: #1c1c1e;
    --fg: #fff;
    --dim: #98989f;
    --rule: rgba(84, 84, 88, 0.6);
    --press: rgba(255, 255, 255, 0.08);
    --blue: #0a84ff;
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --green: #30d158;
    --purple: #bf5af2;
    --brown: #ac8e68;
    --gray: #98989d;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.blue { --c: var(--blue); } .red { --c: var(--red); } .orange { --c: var(--orange); } .yellow { --c: var(--yellow); }
.green { --c: var(--green); } .purple { --c: var(--purple); } .brown { --c: var(--brown); } .gray { --c: var(--gray); }

.app {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* the lists */
.home { padding: 20px 16px 88px; border-right: 0.5px solid var(--rule); overflow-y: auto; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  display: grid;
  grid-template: "icon count" auto "name name" auto / 1fr auto;
  gap: 6px;
  padding: 10px 12px 9px;
  background: var(--card);
  border-radius: 12px;
}
.tile:active, .group a:active { background: var(--press); }
.tile[aria-current="page"] { background: var(--c); color: #fff; }
.tile[aria-current="page"] .icon { background: #fff; color: var(--c); }
.tile[aria-current="page"] .name { color: #fff; }
.icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
}
.icon svg { width: 18px; height: 18px; }
.tile .count { grid-area: count; font-size: 28px; font-weight: 700; line-height: 30px; }
.tile .name { grid-area: name; color: var(--dim); font-weight: 600; font-size: 15px; }
.home h2 { font-size: 22px; font-weight: 700; margin: 26px 4px 8px; }
.group { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.group a { display: flex; align-items: center; gap: 12px; padding: 8px 14px; min-height: 48px; }
.group li + li a { box-shadow: inset 52px 0 var(--card), inset 0 0.5px var(--rule); }
.group .icon { width: 30px; height: 30px; flex: none; }
.group .name { flex: 1; }
.group .count, .chevron { color: var(--dim); }
.chevron { font-size: 22px; line-height: 1; }
.group a[aria-current="page"] { background: var(--press); }
.bar { position: fixed; bottom: 0; left: 0; width: 340px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); }
.text { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 500; }
.text:disabled { opacity: 0.4; }
.danger { color: var(--red); }

/* a list */
.list { padding: 20px 28px 120px; min-width: 0; }
.list header { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 12px; }
.list header .title { flex: 1; min-width: 0; margin: 0; font-size: 34px; font-weight: 700; color: var(--c); }
.list header input.title { background: none; border: 0; padding: 0; outline: none; }
.list header .count { font-size: 34px; font-weight: 700; color: var(--c); }
.back { display: none; color: var(--blue); font-size: 17px; }
.colors { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.colors legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.swatch { appearance: none; -webkit-appearance: none; margin: 0; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--c); padding: 0; cursor: pointer; }
.swatch:checked { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.colors .danger { margin-left: auto; }
.reminders { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0 0; }
.row .body { flex: 1; min-width: 0; padding-bottom: 10px; border-bottom: 0.5px solid var(--rule); }
.tick {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--gray);
  background: none;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.tick:checked { border-color: var(--c); background: radial-gradient(circle, var(--c) 0 6.5px, transparent 7px); }
.body input { display: block; width: 100%; border: 0; padding: 0; background: none; outline: none; }
.body .notes { font-size: 15px; color: var(--dim); }
.body .notes:placeholder-shown:not(:focus) { display: none; }
.done .body .title { color: var(--dim); }
.meta { display: flex; gap: 8px; font-size: 15px; color: var(--dim); }
.overdue { color: var(--red); }
.due, .flag, .delete { flex: none; position: relative; display: grid; place-items: center; width: 28px; height: 28px; color: var(--dim); opacity: 0; background: none; border: 0; padding: 0; border-radius: 6px; }
.due input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.due input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.row:hover :is(.due, .flag, .delete), .row:focus-within :is(.due, .flag, .delete), .flag.on { opacity: 1; }
.flag.on { color: var(--orange); }
.flag.on svg path { fill: currentColor; }
.delete { font-size: 22px; }
.empty { color: var(--dim); padding: 24px 0; text-align: center; list-style: none; }
.new { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.new .plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; }
.new input { flex: 1; border: 0; background: none; outline: none; padding: 0; }
.new input::placeholder { color: var(--c); }
.hint { font-size: 15px; color: var(--dim); }

/* what the app says about itself */
.status { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pill {
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(30, 30, 30, 0.86);
  color: #fff;
  font-size: 15px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.pill button { margin-left: 8px; background: none; border: 0; padding: 0; color: #64d2ff; font-weight: 600; }

/* a phone: a page at a time */
@media (max-width: 720px) {
  .app { display: block; }
  .app[data-open="list"] .home, .app[data-open="home"] .list { display: none; }
  .home { border: 0; padding: 12px 16px 88px; }
  .bar { width: 100%; }
  .list { padding: 8px 20px 120px; }
  .back { display: inline-block; padding: 6px 0; }
  .tile[aria-current="page"] { background: var(--card); color: inherit; }
  .tile[aria-current="page"] .icon { background: var(--c); color: #fff; }
  .tile[aria-current="page"] .name { color: var(--dim); }
  .group a[aria-current="page"] { background: none; }
  .due, .flag, .delete { opacity: 1; }
  .status { left: 16px; right: 16px; align-items: center; bottom: calc(64px + env(safe-area-inset-bottom)); }
}
