:root {
  color-scheme: light;
  --bg: #f4efe6;
  --surface: #fffdf9;
  --ink: #2a2520;
  --ink-soft: #5e554c;
  --muted: #9a9086;
  --line: #ebe3d7;
  --accent: #3d6b55;
  --accent-ink: #ffffff;
  --accent-soft: #e2ebe3;
  --warm: #c9693f;
  --radius: 16px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

#app {
  max-width: 580px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 96px) max(16px, env(safe-area-inset-left));
}

.top { display: flex; align-items: flex-end; justify-content: space-between; margin: 8px 4px 18px; }
.date { margin: 0 0 2px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .01em; }
h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; }
.top-right { display: flex; align-items: center; gap: 10px; }
.sync { font-size: 13px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 15px; font-weight: 700;
  display: grid; place-items: center;
}

.composer {
  position: sticky; top: calc(env(safe-area-inset-top) + 8px); z-index: 2;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px;
  padding-inline-start: 18px;
  box-shadow: 0 1px 0 rgba(60, 40, 20, .04), 0 6px 20px -8px rgba(60, 40, 20, .16);
  margin-bottom: 18px;
  transition: box-shadow .2s var(--ease);
}
.composer:focus-within { box-shadow: 0 0 0 2px var(--accent), 0 6px 20px -8px rgba(60, 40, 20, .2); }
.composer input {
  flex: 1; min-width: 0;
  text-align: right;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 17px; color: var(--ink);
  padding: 10px 0;
}
.composer input::placeholder { color: var(--muted); }
.add {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  transition: transform .15s var(--ease), opacity .15s;
}
.add svg { width: 20px; height: 20px; }
.add:active { transform: scale(.92); }

.list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.list:empty { display: none; }

.item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  padding-block: 8px;
  padding-inline: 12px 14px;
}
.item.fresh { animation: enter .28s var(--ease); }
.item + .item::before {
  content: ""; position: absolute; top: 0; inset-inline: 52px 0;
  border-top: 1px solid var(--line);
}
@keyframes enter { from { opacity: 0; transform: translateY(-6px); } }

.check {
  flex: none; width: 30px; height: 30px; margin: -3px 0;
  display: grid; place-items: center;
}
.check span {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #cfc5b8;
  display: grid; place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.check svg { width: 14px; height: 14px; stroke: var(--accent-ink); stroke-width: 3; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .25s var(--ease); }
.check:active span { transform: scale(.88); }
.item.is-done .check span { background: var(--accent); border-color: var(--accent); }
.item.is-done .check svg { opacity: 1; transform: none; }

.title {
  flex: 1; min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  cursor: text;
  transition: color .25s;
  padding: 4px 0;
}
.item.is-done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(154, 144, 134, .6); }

.who {
  flex: none;
  font-size: 12px; font-weight: 700;
  color: var(--warm);
  background: #f8e9e0;
  border-radius: 999px;
  padding: 2px 8px;
}

.edit {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--ink);
  text-align: right;
  padding: 4px 0;
}
.trash {
  flex: none; width: 36px; height: 36px; margin-block: -4px; margin-inline-end: -6px;
  border-radius: 10px; color: #b4534a;
  display: grid; place-items: center;
}
.trash svg { width: 19px; height: 19px; stroke-width: 2; }
.trash:active { background: #f6e4e1; }

.empty {
  margin: 36px 0; text-align: center;
  color: var(--muted); font-size: 16px;
}

.done-section { margin-top: 22px; }
.done-toggle {
  display: flex; align-items: center; gap: 6px;
  margin: 0 4px 10px; color: var(--ink-soft);
  font-size: 15px; font-weight: 650;
}
.done-toggle svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.done-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.list-done .item { min-height: 50px; }
.clear {
  display: block; margin: 12px auto 0;
  color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px;
}
.clear:active { background: var(--line); }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: #f7f2ea;
  border-radius: 14px;
  padding: 12px;
  padding-inline-start: 18px;
  font-size: 15px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4);
  animation: rise .25s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast button { color: #9fd0b4; font-weight: 700; padding: 4px 8px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.menu {
  position: fixed; z-index: 5;
  top: calc(env(safe-area-inset-top) + 76px);
  inset-inline-end: max(16px, calc((100vw - 580px) / 2 + 16px));
  background: var(--surface);
  border-radius: 14px;
  padding: 12px;
  min-width: 200px;
  box-shadow: 0 12px 32px -10px rgba(60, 40, 20, .3);
}
.menu p { margin: 2px 6px 10px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.menu button { width: 100%; text-align: start; padding: 10px 6px; border-radius: 8px; font-weight: 600; }
.menu button:active { background: var(--bg); }

.signin {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.signin img { border-radius: 18px; margin-bottom: 18px; }
.signin p { color: var(--ink-soft); margin: 8px 0 28px; }
.google {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface); color: var(--ink);
  text-decoration: none; font-weight: 650;
  padding: 14px 22px; border-radius: 14px;
  box-shadow: 0 1px 0 rgba(60, 40, 20, .05), 0 6px 20px -8px rgba(60, 40, 20, .2);
}
.google svg { width: 20px; height: 20px; }
.signin-note { font-size: 14px; margin-top: 20px !important; color: #b4534a !important; max-width: 300px; }

@media (hover: hover) {
  .item:hover { background: #fcf8f2; }
  .add:hover { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
