*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0B0F1A;
  --card: #161C2B;
  --card-hi: #1D2537;
  --text: #F3F6FF;
  --dim: #7F89A3;
  --accent: #5B8CFF;
}

html, body { margin: 0; min-height: 100%; background: var(--bg); }

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; touch-action: manipulation; }

.app {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 20px) 18px calc(env(safe-area-inset-bottom) + 110px);
}

/* header */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim);
}
h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.022em;
}
.ghost {
  background: none;
  border: 0;
  padding: 8px 2px;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
.ghost[hidden] { display: none; }

/* install hint */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 11px 8px 11px 13px;
  border-radius: 14px;
  background: rgba(91, 140, 255, .12);
  border: 1px solid rgba(91, 140, 255, .24);
  color: #C6D4FF;
  font-size: 13.5px;
  line-height: 1.4;
}
.banner[hidden] { display: none; }
.banner b { color: #fff; font-weight: 600; }
.banner button {
  margin-left: auto;
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* list */
.list { margin-top: 22px; }
.row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: var(--card);
  cursor: pointer;
  transition: background .18s ease, transform .12s ease;
}
.row:active { background: var(--card-hi); }
.row.editing:active { background: var(--card); }

.check {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, .16);
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.check svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.55);
  transition: opacity .16s ease, transform .26s cubic-bezier(.34, 1.56, .64, 1);
}
.check.done { background: var(--c); border-color: var(--c); }
.check.done svg { opacity: 1; transform: none; }
.check.pop { animation: pop .34s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop {
  0% { transform: scale(.88); }
  55% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

.meta { min-width: 0; }
.name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dim);
}

.week { display: flex; gap: 5px; align-items: center; }
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
}
.dot.on { background: var(--c); }

.del {
  display: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 92, 138, .16);
  color: #FF6B8A;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.row.editing .del { display: grid; place-items: center; }

/* empty */
.empty { margin: 54px auto 0; text-align: center; max-width: 260px; }
.empty[hidden] { display: none; }
.empty-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--dim);
}
.empty-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.empty-title { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.empty-sub { margin: 0; font-size: 14px; line-height: 1.45; color: var(--dim); }

/* dock */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 14px 18px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(to top, rgba(11, 15, 26, .99) 58%, rgba(11, 15, 26, 0));
}
.add {
  width: 100%;
  max-width: 524px;
  height: 54px;
  border: 0;
  border-radius: 17px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.add:active { transform: scale(.985); filter: brightness(.94); }

/* sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
}
.sheet[hidden] { display: none; }
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 14, .6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
.sheet.open .scrim { opacity: 1; }

.panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 26px 26px 0 0;
  background: #121828;
  transform: translateY(102%);
  transition: transform .34s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -22px 60px rgba(0, 0, 0, .55);
}
.sheet.open .panel { transform: translateY(calc(-1 * var(--kb, 0px))); }

.grabber {
  width: 36px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .18);
}
.panel-title { margin: 0 0 16px; font-size: 21px; font-weight: 700; letter-spacing: -.015em; }

.field {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: #1B2336;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .18s ease;
}
.field::placeholder { color: #5E6880; }
.field:focus { border-color: var(--accent); }

.swatches { display: flex; gap: 12px; margin: 18px 0 22px; }
.swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .16s ease, transform .16s ease;
}
.swatch.sel {
  box-shadow: 0 0 0 3px #121828, 0 0 0 5px #fff;
  transform: scale(1.06);
}

.save {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 17px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
.save:active { filter: brightness(.94); }
