/* Daily Momentum: frosted glass over a deep-blue gradient.
   Palette: navy, cyan (you), coffee-cream (partner and main actions).
   One list at a time, with a bottom tab bar to switch between you and your partner. */

:root {
  --text: #f1f6fc;
  --muted: #a3b8d2;
  --cyan: #46c9ec;
  --warm: #e2b184;        /* coffee cream */
  --danger: #ff9d9d;
  --acc: var(--cyan);

  --glass: linear-gradient(145deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  --glass-strong: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .10));
  --edge: rgba(255, 255, 255, .17);
  --well: rgba(6, 16, 36, .38);
  --blur: blur(20px) saturate(150%);
  --lift: 0 14px 34px rgba(2, 8, 22, .38), inset 0 1px 0 rgba(255, 255, 255, .14);
  --lift-sm: 0 6px 16px rgba(2, 8, 22, .30), inset 0 1px 0 rgba(255, 255, 255, .14);

  --font-display: 'Syne', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; background: #0a1d3a; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(60% 38% at 12% 0%, rgba(70, 201, 236, .34), transparent 62%),
    radial-gradient(52% 34% at 105% 32%, rgba(90, 130, 255, .26), transparent 62%),
    radial-gradient(60% 40% at 0% 100%, rgba(226, 177, 132, .18), transparent 62%),
    linear-gradient(165deg, #1b3d6e 0%, #12305a 42%, #0a1d3a 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 560px; margin: 0 auto;
  padding: 14px 16px 128px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ---------- surfaces ---------- */

.card {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 28px;
  box-shadow: var(--lift);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  padding: 20px;
}

.pill.inset {
  background: var(--well);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
}

.round {
  display: grid; place-items: center;
  width: 52px; height: 52px; flex: none;
  border: 1px solid var(--edge); border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .07));
  box-shadow: var(--lift-sm);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.round.sm { width: 40px; height: 40px; }
.round:active { transform: scale(.94); background: rgba(255, 255, 255, .26); }

/* ---------- header ---------- */

.hero { padding: 16px 16px 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-top h1 { min-width: 0; flex: 1; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 5.4vw, 22px);
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-side { display: flex; align-items: center; flex: none; }

.together {
  display: flex; align-items: center; gap: 12px;
  margin-right: 4px; padding: 11px 16px;
}
.together-label, .together-count {
  font: 700 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.together-count { color: var(--text); min-width: 34px; text-align: right; }

.bar {
  flex: 1; height: 8px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, .14);
}
.bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--warm));
  transition: width .5s cubic-bezier(.3, .8, .3, 1);
}

/* ---------- you / partner: bottom tab bar ---------- */

.seg {
  position: fixed; z-index: 15;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 32px), 528px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 6px; border-radius: 999px;
  background: rgba(10, 26, 54, .58);
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 16px 40px rgba(2, 8, 22, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.seg button {
  --dot: var(--cyan);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 0; height: 54px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  color: var(--muted); cursor: pointer;
  font: 700 15px var(--font);
  transition: background .2s, border-color .2s, color .2s;
}
.seg button[data-seg="partner"] { --dot: var(--warm); }
.seg-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); opacity: .5; transition: opacity .2s, box-shadow .2s; }
.seg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-count { flex: none; font: 700 12px var(--font); letter-spacing: .02em; opacity: .8; font-variant-numeric: tabular-nums; }
.seg button[aria-selected="true"] {
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .10));
  border-color: rgba(255, 255, 255, .22);
}
.seg button[aria-selected="true"] .seg-dot { opacity: 1; box-shadow: 0 0 10px var(--dot); }

/* ---------- list ---------- */

.cols { display: flex; flex-direction: column; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; animation: swap .25s ease both; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } }
.col[data-who="partner"] { --acc: var(--warm); }

.col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px;
}
.who { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eyebrow {
  font: 700 11px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
h2 {
  margin: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub { font: 600 14px var(--font); color: var(--acc); }

.ring { position: relative; width: 68px; height: 68px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 4.5; }
.ring-track { stroke: rgba(255, 255, 255, .15); }
.ring-fill {
  stroke: var(--acc); stroke-linecap: round;
  stroke-dasharray: 113.1; stroke-dashoffset: 113.1;
  transition: stroke-dashoffset .6s cubic-bezier(.3, .8, .3, 1);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--acc) 65%, transparent));
}
.ring b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 14px var(--font); letter-spacing: .02em; font-variant-numeric: tabular-nums;
}

.list-card { padding: 22px 20px 20px; }
/* Today is the brighter frosted panel */
.col-head + .list-card { background: var(--glass-strong); }

.label {
  margin: 0 0 18px 2px;
  font: 700 12px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ---------- tasks ---------- */

.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }

.task {
  display: grid; grid-template-columns: 1fr 44px; column-gap: 14px; align-items: start;
  animation: pop .25s ease both;
  transition: background .2s;
}
.task.mine { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.task.open {
  background: rgba(255, 255, 255, .08);
  border-radius: 20px;
  margin: -8px -12px; padding: 8px 12px;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }

.check {
  width: 44px; height: 44px; padding: 0;
  border: 2px solid rgba(255, 255, 255, .34); border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .07);
  color: #06202e;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.check:disabled { cursor: default; }
.check svg { width: 24px; height: 24px; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .2s; }
.task.done .check {
  background: var(--acc); border-color: transparent;
  box-shadow: 0 0 16px color-mix(in srgb, var(--acc) 50%, transparent);
}
.task.done .check svg { opacity: 1; transform: none; }

.dot {
  width: 12px; height: 12px; margin: 16px; border-radius: 50%;
  background: var(--acc); opacity: .85;
  box-shadow: 0 0 10px color-mix(in srgb, var(--acc) 60%, transparent);
}

.txt {
  font-size: 18px; line-height: 1.35; padding-top: 9px; min-width: 0;
  overflow-wrap: anywhere; transition: color .2s;
}
.task.done .txt {
  color: var(--muted);
  text-decoration: line-through; text-decoration-color: rgba(163, 184, 210, .55);
}

.acts { grid-column: 1 / -1; display: none; gap: 12px; flex-wrap: wrap; padding: 12px 0 2px; }
.task.open .acts { display: flex; }

.chip {
  border: 1px solid var(--edge); border-radius: 999px; padding: 12px 18px;
  font: 700 14px var(--font); color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .07));
  cursor: pointer;
}
.chip:active { background: rgba(255, 255, 255, .26); }
.chip.danger { color: var(--danger); }

.hint { margin: 0; padding: 0 12px; text-align: center; font: 500 13px/1.45 var(--font); color: var(--muted); }

.empty { margin: 0 0 0 2px; font-size: 15px; line-height: 1.45; color: var(--muted); }

/* ---------- add form ---------- */

.add { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.add input {
  flex: 1; min-width: 0; height: 54px; padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; outline: none;
  background: var(--well);
  color: var(--text); font: 500 17px var(--font);
  transition: border-color .2s, box-shadow .2s;
}
.add input::placeholder, .field input::placeholder { color: rgba(163, 184, 210, .7); }
.add input:focus, .field input:focus {
  border-color: rgba(70, 201, 236, .75);
  box-shadow: 0 0 0 4px rgba(70, 201, 236, .16);
}
.add .round { width: 54px; height: 54px; color: var(--cyan); }

/* ---------- overlays ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center; padding: 20px;
  background: rgba(5, 12, 28, .62);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sheet {
  width: 100%; max-width: 380px; padding: 28px 24px 22px; border-radius: 32px;
  background: linear-gradient(145deg, rgba(48, 84, 138, .78), rgba(14, 34, 70, .88));
}
.sheet-title {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: .98;
  letter-spacing: .02em; text-transform: uppercase;
}
.sheet-title.sm { font-size: 24px; }
.sheet-sub { margin: 0 0 20px; color: var(--muted); font-size: 15px; line-height: 1.45; }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; margin: 0 0 8px 6px;
  font: 700 11px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.field input {
  width: 100%; height: 54px; padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; outline: none;
  background: var(--well);
  color: var(--text); font: 500 17px var(--font);
}

.form-msg { margin: 0 0 12px 6px; font-size: 14px; line-height: 1.4; color: var(--danger); }
.form-msg.ok { color: var(--cyan); }

.primary {
  width: 100%; height: 54px; margin-top: 4px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(145deg, #f2c995, #d9a674);
  color: #2b1a06; font: 800 16px var(--font); letter-spacing: .03em;
  box-shadow: 0 10px 24px rgba(226, 177, 132, .28), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .6; }
.primary.ghost {
  background: linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .07));
  border: 1px solid var(--edge); color: var(--text); box-shadow: none;
}
.sheet .primary + .primary { margin-top: 12px; }

.picker-list { display: grid; gap: 12px; margin-bottom: 16px; }
.picker-list:empty { display: none; }

.link {
  display: block; width: 100%; margin-top: 12px; padding: 10px;
  border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 600 15px var(--font);
}

/* ---------- history ---------- */

.sheet-tall { max-width: 520px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; padding-bottom: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head .sheet-title { margin: 0; }

.filter {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
  padding: 5px; margin-bottom: 18px; border-radius: 999px;
  background: var(--well); border: 1px solid rgba(255, 255, 255, .10);
}
.filter button {
  min-width: 0; height: 40px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  color: var(--muted); font: 700 14px var(--font); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filter button:disabled { opacity: .4; cursor: default; }
.filter button[aria-selected="true"] {
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .09));
  border-color: rgba(255, 255, 255, .2);
}

.history-list {
  flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -8px; padding: 0 8px 4px;
  display: flex; flex-direction: column; gap: 24px;
}
.h-day-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px;
  font: 700 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.h-day-head b { font: 700 12px var(--font); letter-spacing: .04em; color: var(--text); }
.h-task { --c: var(--cyan); display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; }
.h-task.partner { --c: var(--warm); }
.h-tick {
  flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c); color: #06202e;
}
.h-tick svg { width: 14px; height: 14px; }
.h-text { flex: 1; min-width: 0; padding-top: 2px; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.h-who { flex: none; padding-top: 5px; font: 700 11px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--c); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translateX(-50%);
  max-width: calc(100% - 40px); padding: 13px 20px; border-radius: 999px;
  background: rgba(10, 26, 54, .82);
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--lift-sm);
  font: 600 14px var(--font); text-align: center;
}

@media (min-width: 560px) {
  #app { padding-top: 28px; }
  .txt { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
