:root {
  --ink: #33246e;
  --ink-2: #5b4d99;
  --ink-3: #8a80b8;
  --purple: #8b6cf0;
  --purple-d: #6d4fe0;
  --purple-l: #c9b8ff;
  --lav: #efe9ff;
  --pink: #f472b6;
  --pink-d: #e0458f;
  --pink-l: #ffdcec;
  --mint: #34b878;
  --mint-l: #d9f7e8;
  --blue: #5b85f0;
  --blue-l: #e0e9ff;
  --yellow: #f5b93a;
  --yellow-l: #fff3cf;
  --card: rgba(255, 255, 255, .74);
  --line: rgba(139, 108, 240, .18);
  --shadow: 0 12px 30px -12px rgba(91, 63, 200, .3), 0 2px 6px rgba(91, 63, 200, .06);
  --r-lg: 24px;
  --r-md: 16px;
  --head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background: linear-gradient(160deg, #e5ddff 0%, #f3e8ff 35%, #fde6f2 70%, #e3e8ff 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
h1, h2, h3 { font-family: var(--head); }

/* ---------- Background sky ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.star {
  position: absolute; color: #ffd36a; line-height: 1;
  text-shadow: 0 0 10px rgba(255, 211, 106, .8);
  animation: twinkle 3.2s ease-in-out infinite;
}
.star.w { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, .9); }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.1); } }
.clouds {
  position: absolute; left: -10%; right: -10%; bottom: -60px; height: 200px;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,0)) 0 60px / 280px 170px repeat-x,
    radial-gradient(closest-side, rgba(255,214,236,.8), rgba(255,214,236,0)) 140px 90px / 320px 160px repeat-x,
    radial-gradient(closest-side, rgba(230,220,255,.9), rgba(230,220,255,0)) 60px 20px / 380px 180px repeat-x;
}

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 14px 20px 120px; }

.topbar {
  position: sticky; top: 10px; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 22px; box-shadow: var(--shadow);
}
.logo {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--head); font-weight: 700; font-size: 28px; letter-spacing: -.4px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.logo-moon { font-size: 26px; filter: drop-shadow(0 2px 4px rgba(139,108,240,.35)); }
.logo-spark { font-size: 18px; margin-top: -10px; }
.tagline {
  margin: 0 auto; padding: 8px 20px; border-radius: 999px;
  background: linear-gradient(90deg, #e6dcff, #f2e9ff);
  color: var(--ink-2); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.hello { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; color: var(--ink-2); line-height: 1.2; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, #fff, #ffe1f0); border: 2px solid #fff; box-shadow: var(--shadow);
}
.now-chip {
  display: flex; align-items: center; gap: 8px; max-width: 280px;
  padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #ffe4f2, #efe6ff); color: var(--ink);
  font-weight: 800; font-size: 14px; box-shadow: inset 0 0 0 1.5px #fff, var(--shadow);
}
.now-chip [data-live="chip-title"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-chip b { font-family: var(--head); font-weight: 600; font-variant-numeric: tabular-nums; }
.now-chip.is-over b { color: var(--pink-d); }
.now-chip[hidden] { display: none; }

.bottomnav {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30;
  width: min(760px, calc(100% - 32px));
  display: flex; gap: 6px; padding: 8px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid #fff; border-radius: 999px; box-shadow: var(--shadow);
}
.bottomnav a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 8px; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-family: var(--head); font-weight: 500; font-size: 18px;
  transition: background .2s;
}
.bottomnav a:hover { background: rgba(239, 233, 255, .8); }
.bottomnav a.on {
  background: linear-gradient(135deg, #ffe3f1, #efe6ff); color: var(--pink-d);
  box-shadow: inset 0 0 0 1.5px #fff, 0 6px 16px -8px rgba(244,114,182,.6);
}
.bottomnav svg { width: 25px; height: 25px; }

/* ---------- Cards & common bits ---------- */
.card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-weight: 600; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.card-head .spacer { flex: 1; }
.muted { color: var(--ink-3); font-weight: 700; font-size: 13px; }
.sparkle { color: var(--yellow); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: 0; border-radius: 14px; cursor: pointer;
  font-family: var(--head); font-weight: 500; font-size: 16px; color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 8px -4px rgba(91,63,200,.25);
  transition: transform .12s, box-shadow .12s, filter .12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-pink { color: #fff; background: linear-gradient(135deg, #ff8fc7, #f0569f); box-shadow: 0 10px 20px -8px rgba(240,86,159,.7), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-purple { color: #fff; background: linear-gradient(135deg, #a891ff, #7656ee); box-shadow: 0 10px 20px -8px rgba(118,86,238,.7), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-mint { color: #fff; background: linear-gradient(135deg, #6fe0a7, #35b877); box-shadow: 0 10px 20px -8px rgba(53,184,119,.7), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-ghost { background: rgba(255,255,255,.7); }
.btn-lg { font-size: 20px; padding: 15px 26px; border-radius: 18px; }
.btn-lg svg { width: 22px; height: 22px; }
.btn-sm { font-size: 14px; padding: 7px 12px; border-radius: 10px; }
.btn-link { background: none; border: 0; box-shadow: none; color: var(--ink-3); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; padding: 6px; }

.bar { position: relative; height: 16px; border-radius: 999px; background: #e7e0ff; box-shadow: inset 0 1px 3px rgba(91,63,200,.15); }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #8b6cf0, #b98bff 60%, #f59ad0); transition: width .6s ease; }
.bar > .bar-star { position: absolute; top: 50%; transform: translate(-50%, -52%); font-size: 26px; font-style: normal; filter: drop-shadow(0 2px 3px rgba(150,100,0,.25)); transition: left .6s ease; }
.bar.thin { height: 10px; }
.bar.thin > .bar-star { font-size: 18px; }

.pill { padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; white-space: nowrap; background: var(--pink-l); color: #c0367f; }
.pill.blue { background: var(--blue-l); color: #3d63c9; }
.pill-guess { background: #f1ecff; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px #d4c7ff; }

.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #ddd5f7; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.15); transition: transform .2s; }
.switch input:checked + i { background: linear-gradient(135deg, #ff8fc7, #f0569f); }
.switch input:checked + i::after { transform: translateX(22px); }

.hand-note {
  font-family: var(--hand); font-weight: 700; color: var(--pink-d); font-size: 22px; line-height: 1;
  transform: rotate(-10deg); text-align: center;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 18px 0 16px; padding: 24px 28px; min-height: 150px; border-radius: 28px;
  display: flex; align-items: center; gap: 24px;
  background:
    radial-gradient(ellipse 30% 70% at 85% 100%, rgba(255,255,255,.9), transparent 70%),
    radial-gradient(ellipse 25% 60% at 65% 110%, rgba(255,220,236,.9), transparent 70%),
    linear-gradient(110deg, rgba(255,255,255,.35), rgba(220,205,255,.55) 55%, rgba(200,180,255,.6));
  border: 1px solid rgba(255,255,255,.8);
}
.hero h1 { margin: 0; font-weight: 600; font-size: clamp(32px, 4vw, 46px); letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; }
.hero h1 .heart { color: var(--pink); font-size: .55em; }
.hero p { margin: 4px 0 0; font-size: 19px; font-weight: 700; color: var(--ink-2); }
.hero .hand-note { margin-left: 8px; }
.hero-scene { position: absolute; right: 24px; bottom: 0; top: 0; width: min(46%, 520px); pointer-events: none; }
.hero-scene span { position: absolute; line-height: 1; }
.hero-scene .castle { right: 6%; bottom: 8px; font-size: 96px; filter: saturate(.8) hue-rotate(200deg) drop-shadow(0 6px 10px rgba(91,63,200,.25)); }
.hero-scene .moon { right: 38%; top: 14px; font-size: 50px; animation: float 6s ease-in-out infinite; }
.hero-scene .sleepy { right: 30%; bottom: 14px; font-size: 54px; animation: float 4s ease-in-out infinite; }
.hero-scene .zzz { right: 26%; bottom: 66px; font-size: 22px; color: var(--ink-3); font-family: var(--hand); font-weight: 700; animation: drift 3s ease-in-out infinite; }
.hero-scene .cloud { font-size: 60px; opacity: .95; }
.hero-scene .c1 { right: 22%; bottom: -14px; }
.hero-scene .c2 { right: 44%; bottom: -10px; font-size: 44px; }
.hero-scene .s { color: #ffd36a; font-size: 22px; text-shadow: 0 0 10px rgba(255,211,106,.8); animation: twinkle 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes drift { 0% { opacity: 0; transform: translate(0, 6px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -12px); } }

/* ---------- Today ---------- */
.grid-today { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.progress-card { display: flex; align-items: center; gap: 26px; }
.progress-card .big { font-family: var(--head); font-size: 38px; font-weight: 600; line-height: 1; }
.progress-card .bar { flex: 1; }
.progress-card .pct { font-family: var(--head); font-weight: 600; font-size: 20px; color: var(--ink-2); min-width: 48px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.stat-ic { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--mint-l); }
.stat-ic.blue { background: var(--blue-l); }
.stat-ic.pink { background: var(--pink-l); }
.stat-ic.yellow { background: var(--yellow-l); }
.stat-ic.lav { background: var(--lav); }
.stat-label { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.stat-val { font-family: var(--head); font-size: 28px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.stat-sub { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.stat-sub.up { color: var(--mint); }

.dump { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 2px dashed #cdbfff; border-radius: 18px; background: rgba(255,255,255,.5); }
.dump-plus { width: 44px; height: 44px; margin-top: 2px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700; background: linear-gradient(135deg, #a891ff, #7656ee); box-shadow: 0 6px 14px -6px rgba(118,86,238,.8); }
.dump textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; min-height: 48px; max-height: 220px;
  padding: 12px 14px; border-radius: 12px; background: #fff; color: var(--ink);
  font: 600 17px/1.4 var(--body); box-shadow: inset 0 0 0 1.5px var(--line);
}
.dump textarea::placeholder { color: #aaa1d0; }
.dump textarea:focus { box-shadow: inset 0 0 0 2px var(--purple); }
.dump .btn { height: 48px; }
.dump-preview { min-height: 22px; margin: 8px 6px 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.dump-preview .pill { font-size: 12px; padding: 2px 9px; }

.task-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: rgba(255,255,255,.88); border-radius: 15px; border: 1px solid rgba(139,108,240,.1);
  transition: box-shadow .2s, background .2s, transform .15s;
}
.task.is-active { background: linear-gradient(90deg, #fff0f8, #f3edff); border-color: #f9b4d8; box-shadow: 0 0 0 3px rgba(244,114,182,.15); }
.task.is-done .t-title { text-decoration: line-through; text-decoration-color: var(--purple-l); color: var(--ink-3); }
.task.is-done .t-emoji { opacity: .65; }
.task.dragging { opacity: .4; }
.task.drop-before { box-shadow: 0 -3px 0 var(--purple); }
.task.drop-after { box-shadow: 0 3px 0 var(--purple); }
.drag { cursor: grab; color: #c8bdf2; font-weight: 900; letter-spacing: -3px; user-select: none; padding: 0 2px; }
.task.is-done .drag { visibility: hidden; }
.check {
  width: 26px; height: 26px; flex: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 8px; border: 2px solid #b9a8f5; background: #fff; color: #fff;
}
.check svg { width: 16px; height: 16px; }
.check.on { background: linear-gradient(135deg, #9a7dff, #7656ee); border-color: transparent; }
.t-emoji { font-size: 26px; width: 34px; text-align: center; flex: none; }
.t-main { flex: 1; min-width: 0; cursor: text; }
.t-title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.t-sub .now { color: var(--pink-d); }
.diff { font-weight: 800; }
.diff.over { color: var(--pink-d); }
.diff.under { color: var(--mint); }
.play {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  display: grid; place-items: center; background: linear-gradient(135deg, #a891ff, #7656ee);
  box-shadow: 0 6px 14px -6px rgba(118,86,238,.8); transition: transform .12s;
}
.play:hover { transform: scale(1.08); }
.play svg { width: 16px; height: 16px; }
.play.now { background: linear-gradient(135deg, #ff8fc7, #f0569f); box-shadow: 0 6px 14px -6px rgba(240,86,159,.8); }
.done-badge { width: 40px; height: 32px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--mint-l); color: var(--mint); }
.done-badge svg { width: 18px; height: 18px; }
.icon-btn { width: 30px; height: 30px; flex: none; border: 0; border-radius: 9px; background: transparent; color: #b3a9d9; cursor: pointer; font-size: 14px; font-weight: 800; }
.icon-btn:hover { background: #f1ecff; color: var(--pink-d); }
.task .icon-btn { opacity: 0; transition: opacity .15s; }
.task:hover .icon-btn, .task:focus-within .icon-btn { opacity: 1; }
.edit-input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 9px 12px; border-radius: 10px; font: 700 16px var(--body); color: var(--ink); box-shadow: inset 0 0 0 2px var(--purple); }

.empty { text-align: center; padding: 26px 10px 8px; color: var(--ink-3); font-weight: 700; }
.empty .big-emoji { font-size: 46px; display: block; margin-bottom: 6px; animation: float 4s ease-in-out infinite; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.examples code { font-family: var(--body); font-weight: 800; background: #fff; padding: 4px 10px; border-radius: 8px; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }

.tasks-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.tasks-foot .btn-lg { flex: 1; }

.note-card {
  background: linear-gradient(160deg, #fff6dc, #ffeccf); border: 0;
  transform: rotate(-1.5deg); padding: 22px 24px; overflow: hidden;
}
.note-card h3 { margin: 0 0 6px; font-family: var(--hand); font-size: 34px; font-weight: 700; color: var(--ink); }
.note-card p { margin: 0; font-family: var(--hand); font-size: 24px; line-height: 1.15; color: var(--ink-2); max-width: 75%; }
.note-card .note-art { position: absolute; right: 12px; bottom: 6px; font-size: 52px; }
.intent-card .intent { font-family: var(--hand); font-size: 26px; line-height: 1.15; color: var(--ink); }
.affirm { font-family: var(--hand); font-size: 28px; line-height: 1.15; color: var(--ink-2); padding: 4px 4px 8px; }
.mini-timer { text-align: center; }
.mini-timer .clock { font-size: 56px; }
.mini-timer .mt-task { font-weight: 800; margin-bottom: 4px; }
.day-done { text-align: center; }
.day-done .big-emoji { font-size: 48px; }

/* ---------- Timer ---------- */
.grid-timer { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.current { display: flex; align-items: center; gap: 16px; }
.cur-emoji { width: 76px; height: 76px; flex: none; display: grid; place-items: center; font-size: 42px; border-radius: 20px; background: linear-gradient(135deg, #f1ebff, #ffe7f3); box-shadow: inset 0 0 0 1.5px #fff; }
.cur-title { font-family: var(--head); font-weight: 600; font-size: 32px; line-height: 1.1; }
.cur-sub { font-size: 17px; font-weight: 700; color: var(--purple-d); margin-top: 2px; }

.ring-wrap { position: relative; width: min(380px, 78vw); aspect-ratio: 1; margin: 14px auto 10px; }
.ring-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ring-track { fill: none; stroke: #e7e0ff; }
.ring-prog { fill: none; stroke-linecap: round; transition: stroke-dashoffset .35s linear; }
.is-over .ring-prog { stroke: #f472b6; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.ring-center {
  position: absolute; inset: 11%; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #fff 0%, #f7f1ff 55%, #fde9f4 100%);
  box-shadow: inset 0 0 30px rgba(201,184,255,.55), 0 10px 30px -10px rgba(91,63,200,.3);
}
.ring-mascot { font-size: 44px; line-height: 1; margin-bottom: 6px; animation: float 4s ease-in-out infinite; }
.clock { font-family: var(--head); font-weight: 600; font-size: clamp(50px, 7vw, 80px); line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.is-over .clock { color: var(--pink-d); }
.is-paused .clock { opacity: .45; }
.clock-sub { margin-top: 6px; font-size: 19px; font-weight: 700; color: var(--ink-2); text-align: center; }
.is-over .clock-sub { color: var(--pink-d); }
.ring-star { position: absolute; font-size: 32px; line-height: 1; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 2px 4px rgba(150,100,0,.3)); transition: left .35s linear, top .35s linear; }
.paused-tag { display: none; margin-top: 8px; padding: 3px 12px; border-radius: 999px; background: var(--lav); color: var(--purple-d); font-weight: 800; font-size: 13px; }
.is-paused .paused-tag { display: inline-block; }

.info-pill { display: flex; align-items: center; justify-content: center; gap: 10px; width: fit-content; margin: 0 auto 16px; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); font-weight: 700; font-size: 14px; text-align: left; }
.info-pill .i { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--purple-l); color: #fff; font-weight: 900; font-size: 13px; }
.controls { display: grid; grid-template-columns: 1fr .8fr 1fr; gap: 12px; }
.controls .btn { padding: 16px; font-size: 20px; border-radius: 18px; }

.next-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.next-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.88); border: 1px solid rgba(139,108,240,.1); }
.next-list .n { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--lav); font-weight: 800; color: var(--ink-2); font-size: 14px; }
.next-list .t-main { cursor: default; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-between > .bar { flex: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mini-stats .stat { padding: 10px 12px; background: rgba(255,255,255,.8); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(139,108,240,.1); gap: 10px; }
.mini-stats .stat-ic { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
.mini-stats .stat-val { font-size: 21px; }
.mini-stats .stat-label { font-size: 12px; }

/* ---------- Stats ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-cards .stat { align-items: flex-start; flex-direction: column; gap: 10px; }
.stat-cards .stat-top { display: flex; align-items: center; gap: 12px; }
.stat-cards .goal { width: 100%; }
.stat-cards .goal .muted { display: flex; justify-content: space-between; margin-top: 6px; }
.grid-stats { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }

.week-chart { position: relative; }
.wc-plot { position: relative; height: 200px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; border-bottom: 1.5px solid #ddd4fb; }
.wc-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.wc-val { font-size: 12px; font-weight: 800; color: var(--ink-2); margin-bottom: 4px; white-space: nowrap; }
.wc-bar { width: 100%; max-width: 54px; min-height: 3px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #ad97ff, #8b6cf0); transition: height .6s ease; }
.wc-col.today .wc-bar { background: linear-gradient(180deg, #ffa6d3, #f472b6); }
.wc-col.goal-met .wc-val::before { content: '⭐ '; }
.wc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-top: 8px; text-align: center; font-size: 13px; font-weight: 800; color: var(--ink-3); }
.wc-days .today { color: var(--pink-d); }
.goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(224,69,143,.45); pointer-events: none; }
.goal-line span { position: absolute; right: 0; top: -20px; font-size: 11px; font-weight: 800; color: var(--pink-d); background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 6px; }
.wc-tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); padding: 6px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.wc-col:hover .wc-tip { opacity: 1; }
.wc-col:hover .wc-bar { filter: brightness(1.08); }

.insight { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: linear-gradient(90deg, #fff6dc, #ffeef7); font-weight: 700; color: var(--ink-2); margin-top: 14px; }
.insight .big-emoji { font-size: 30px; }
.acc-big { font-family: var(--head); font-size: 54px; font-weight: 600; line-height: 1; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed #e3dbfb; font-weight: 700; }
.kv:last-child { border-bottom: 0; }
.kv b { font-family: var(--head); font-weight: 600; font-size: 18px; }

.history { display: flex; flex-direction: column; gap: 10px; }
.h-item { background: rgba(255,255,255,.88); border-radius: 16px; border: 1px solid rgba(139,108,240,.1); padding: 12px 16px; }
.h-item summary { list-style: none; display: flex; align-items: center; gap: 14px; cursor: pointer; flex-wrap: wrap; }
.h-item summary::-webkit-details-marker { display: none; }
.h-rate { font-size: 32px; width: 40px; text-align: center; }
.h-date { font-family: var(--head); font-weight: 600; font-size: 18px; min-width: 120px; }
.h-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.h-chip { padding: 4px 10px; border-radius: 999px; background: var(--lav); font-weight: 800; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.h-caret { color: var(--ink-3); transition: transform .2s; }
.h-item[open] .h-caret { transform: rotate(180deg); }
.h-body { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e3dbfb; }
.h-body .q { font-weight: 700; color: var(--ink-2); margin: 0 0 8px; }
.h-body .q b { color: var(--ink); }
.h-tasks { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 700; }
.h-tasks td, .h-tasks th { padding: 6px 8px; text-align: left; border-bottom: 1px solid #f0ebff; }
.h-tasks th { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.h-tasks td.num, .h-tasks th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Settings ---------- */
.grid-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed #e3dbfb; }
.set-row:last-child { border-bottom: 0; }
.set-row label, .set-row .lbl { font-weight: 800; }
.set-row .help { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.num-input, .text-area {
  font: 700 16px var(--body); color: var(--ink); border: 0; outline: 0; border-radius: 10px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line); padding: 8px 10px;
}
.num-input { width: 90px; text-align: right; }
.num-input:focus, .text-area:focus { box-shadow: inset 0 0 0 2px var(--purple); }
.text-area { width: 100%; min-height: 110px; resize: vertical; font-size: 14px; }
input[type=range] { accent-color: var(--pink); width: 160px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.gif-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gif-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(80, 60, 160, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s ease;
}
.modal {
  position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 26px; border-radius: 30px; border: 2px solid #fff;
  background: linear-gradient(180deg, #f3ecff 0%, #fff 45%, #fff7fb 100%);
  box-shadow: 0 30px 80px -20px rgba(70, 40, 160, .5);
  animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1);
}
.modal-x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); cursor: pointer; font-size: 16px; font-weight: 900; color: var(--ink); }
.modal h2 { margin: 0; text-align: center; font-weight: 700; font-size: 34px; letter-spacing: -.5px; }
.modal .lead { text-align: center; margin: 6px 0 18px; font-weight: 700; color: var(--ink-2); font-size: 17px; }
.modal .art { text-align: center; font-size: 72px; line-height: 1; margin-bottom: 8px; }
.modal textarea { width: 100%; min-height: 90px; resize: vertical; border: 0; outline: 0; border-radius: 16px; padding: 14px 16px; font: 600 17px/1.4 var(--body); color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.modal textarea:focus { box-shadow: inset 0 0 0 2px var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; justify-content: center; }
.chip { border: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; color: var(--ink-2); font-size: 14px; }
.chip:hover { background: var(--lav); }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
.modal-actions .btn-lg { min-width: 200px; }

.cele { width: min(680px, 100%); }
.cele-art { position: relative; height: 150px; display: grid; place-items: center; margin: -6px 0 4px; }
.cele-art img.gif { max-height: 150px; max-width: 260px; border-radius: 18px; box-shadow: var(--shadow); }
.dance { font-size: 104px; line-height: 1; display: inline-block; transform-origin: 50% 90%; animation: dance .55s ease-in-out infinite alternate; }
@keyframes dance { 0% { transform: rotate(-14deg) translateY(0) scale(1); } 100% { transform: rotate(14deg) translateY(-16px) scale(1.07); } }
.orbit { position: absolute; font-size: 28px; animation: floatUp 2.4s ease-in-out infinite; }
@keyframes floatUp { 0% { transform: translateY(10px) scale(.8); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-40px) scale(1.15); opacity: 0; } }
.cele h2 {
  font-size: clamp(40px, 6vw, 58px);
  background: linear-gradient(90deg, #6d4fe0, #a24fd8 50%, #e0458f); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cele-task { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); margin-bottom: 12px; }
.cele-task .t-emoji { font-size: 34px; width: 44px; }
.done-tag { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 14px; background: var(--mint-l); color: #1f8a57; font-weight: 800; font-size: 14px; white-space: nowrap; }
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.cmp { padding: 14px 16px; border-radius: 18px; background: var(--blue-l); }
.cmp.actual { background: var(--pink-l); }
.cmp.diff-box { background: var(--yellow-l); }
.cmp .lbl { font-weight: 800; font-size: 14px; color: var(--ink-2); }
.cmp .val { font-family: var(--head); font-weight: 600; font-size: 32px; line-height: 1.15; }
.cmp.actual .val { color: var(--pink-d); }
.cmp .msg { font-family: var(--hand); font-size: 19px; line-height: 1; color: var(--pink-d); }
.cmp .bar { margin-top: 8px; height: 10px; }
.cmp.actual .bar > i { background: linear-gradient(90deg, #ff8fc7, #f0569f); }
.cele-progress { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); margin-bottom: 16px; }
.cele-progress .bar { flex: 1; }
.autonext { text-align: center; margin-top: 10px; font-weight: 700; color: var(--ink-3); font-size: 14px; }

.ratings { display: flex; justify-content: center; gap: 10px; margin: 6px 0 16px; flex-wrap: wrap; }
.rate { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; padding: 12px 6px; border: 0; border-radius: 18px; cursor: pointer; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; font-size: 13px; color: var(--ink-2); transition: transform .15s; }
.rate span { font-size: 38px; line-height: 1; }
.rate:hover { transform: translateY(-3px); }
.rate.on { background: linear-gradient(135deg, #ffe3f1, #efe6ff); box-shadow: inset 0 0 0 2.5px var(--pink); color: var(--pink-d); transform: translateY(-3px) scale(1.05); }
.reflect-sum { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.reflect-intent { text-align: center; font-family: var(--hand); font-size: 24px; color: var(--ink-2); margin: 6px 0 14px; }
.carry-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.carry-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-radius: 12px; font-weight: 800; box-shadow: inset 0 0 0 1px var(--line); }
.carry-list li .pill { margin-left: auto; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(20px); } }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 200;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700;
  box-shadow: 0 12px 30px -10px rgba(51,36,110,.6); animation: popIn .3s ease;
}
.toast[hidden] { display: none; }
.toast button { border: 0; background: rgba(255,255,255,.18); color: #fff; font-weight: 800; padding: 6px 12px; border-radius: 10px; cursor: pointer; }

/* ---------- Zen (picture-in-picture window) ---------- */
body.zen-body {
  min-height: 100vh; margin: 0; display: flex; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 30% at 15% 100%, rgba(255,255,255,.95), transparent 70%),
    radial-gradient(ellipse 60% 30% at 90% 100%, rgba(255,220,236,.9), transparent 70%),
    linear-gradient(170deg, #ece4ff, #f8eaff 50%, #fde8f4);
}
.zen { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 14px 14px; text-align: center; }
.zen-top { display: flex; align-items: center; gap: 6px; font-family: var(--head); font-weight: 600; color: var(--purple-d); font-size: 16px; }
.zen-title { font-family: var(--head); font-weight: 600; font-size: clamp(18px, 6.5vw, 28px); line-height: 1.1; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zen .ring-wrap { width: min(72vw, 44vh); margin: 4px auto; }
.zen .clock { font-size: clamp(30px, min(13vw, 8vh), 56px); }
.zen .clock-sub { font-size: clamp(12px, 3.6vw, 16px); margin-top: 2px; }
.zen .ring-mascot { font-size: clamp(20px, 7vw, 34px); margin-bottom: 2px; }
.zen .ring-star { font-size: 22px; }
.zen .paused-tag { font-size: 11px; margin-top: 4px; }
.zen-meta { font-weight: 800; color: var(--ink-2); font-size: 13px; }
.zen-controls { display: flex; gap: 12px; justify-content: center; margin-top: 4px; }
.round-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink); font-weight: 800; font-size: 12px; }
.round-btn i { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--purple-d); box-shadow: inset 0 0 0 2px #ddd3ff, 0 6px 14px -8px rgba(91,63,200,.6); transition: transform .12s; }
.round-btn:hover i { transform: scale(1.07); }
.round-btn i svg { width: 22px; height: 22px; }
.round-btn.pink i { background: linear-gradient(135deg, #ff8fc7, #f0569f); color: #fff; box-shadow: 0 8px 16px -8px rgba(240,86,159,.9); }
.round-btn.mint i { background: linear-gradient(135deg, #6fe0a7, #35b877); color: #fff; box-shadow: 0 8px 16px -8px rgba(53,184,119,.9); }
.round-btn.purple i { background: linear-gradient(135deg, #a891ff, #7656ee); color: #fff; }
.zen .dance { font-size: clamp(56px, 22vw, 90px); }
.zen h2 { margin: 0; font-size: clamp(24px, 9vw, 36px); background: linear-gradient(90deg, #6d4fe0, #e0458f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.zen .zen-cmp { font-weight: 800; color: var(--ink-2); font-size: 14px; }
.zen-celebrate img { max-width: 80vw; max-height: 34vh; border-radius: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-today, .grid-timer, .grid-stats { grid-template-columns: minmax(0, 1fr); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .hero-scene { opacity: .5; }
  .hero .hand-note { display: none; }
}
@media (max-width: 720px) {
  .app { padding: 10px 16px 110px; }
  .hello span:last-child { display: none; }
  .topbar-right { margin-left: auto; }
  .logo { font-size: 22px; }
  .stat-row, .stat-cards, .grid-settings, .compare, .mini-stats { grid-template-columns: minmax(0, 1fr); }
  .progress-card { flex-wrap: wrap; gap: 12px; }
  .bottomnav a span { display: none; }
  .controls { grid-template-columns: 1fr 1fr 1fr; }
  .controls .btn { font-size: 16px; padding: 14px 8px; }
  .hero-scene { display: none; }
  .dump { flex-wrap: wrap; }
  .dump .btn { width: 100%; }
  .dump-plus { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   Design sheet v2 — night-sky hero, cloud timer, task cards, categories
   ===================================================================== */
:root {
  --night-1: #43358a;
  --night-2: #6a55b4;
  --night-3: #b48ccf;
  --night-4: #f6c3d6;
  --cat-personal: #ec5f9e;
  --cat-outreach: #f0a04b;
  --cat-business: #7c5ce6;
}

/* Illustrations (assets/*.webp, emoji fallback) */
.art { display: block; object-fit: contain; pointer-events: none; }
.art-emoji { display: inline-block; line-height: 1; }

/* CSS clouds */
.cloud { position: absolute; display: block; width: var(--w, 90px); height: calc(var(--w, 90px) * .42); border-radius: 999px; background: var(--c, #fff); pointer-events: none; }
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 52%; height: 125%; left: 12%; bottom: 28%; }
.cloud::after { width: 40%; height: 100%; right: 12%; bottom: 34%; }
.cloud i { display: none; }
.cloud.white { --c: #fff; }
.cloud.pink { --c: #ffd3e4; }
.cloud.lav { --c: #ddd3ff; }

/* Night-sky hero */
.hero {
  min-height: 170px; color: #fff; border: 0;
  background: linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 42%, var(--night-3) 78%, var(--night-4) 100%);
  background-image: url(../assets/sky.webp), linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 42%, var(--night-3) 78%, var(--night-4) 100%);
  background-size: cover; background-position: center 70%;
  box-shadow: 0 18px 40px -18px rgba(67, 53, 138, .6);
}
.hero > div:first-child { position: relative; z-index: 2; }
.hero h1 { color: #fff; text-shadow: 0 2px 12px rgba(40, 20, 100, .35); }
.hero p { color: #efe6ff; }
.hero .hand-note { color: #ffd3e8; position: relative; z-index: 2; }
.hero-scene { width: 100%; right: 0; }
.hero-scene .s { color: #ffe08a; }
.hero-scene .moon { right: 30%; top: 16px; width: 50px; height: 50px; border-radius: 50%; box-shadow: -13px 9px 0 0 #ffe08a; filter: drop-shadow(0 0 10px rgba(255, 224, 138, .6)); animation: float 6s ease-in-out infinite; }
.hero-scene .shooting { position: absolute; right: 16%; top: 26px; width: 90px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,255,255,0), #fff); transform: rotate(-24deg); animation: shoot 6s ease-in-out infinite; }
@keyframes shoot { 0%, 70% { opacity: 0; transform: rotate(-24deg) translateX(-40px); } 80% { opacity: 1; } 100% { opacity: 0; transform: rotate(-24deg) translateX(60px); } }
.hero-scene .hc1 { --w: 220px; right: 46%; bottom: -34px; }
.hero-scene .hc2 { --w: 280px; right: 4%; bottom: -46px; }
.hero-scene .hc3 { --w: 170px; right: 24%; bottom: -30px; }
.hero-scene .sleepy { right: 10%; bottom: 30px; z-index: 1; }
.hero-scene .art.sleep { height: 120px; }
.hero-scene .art-emoji.sleep { font-size: 58px; }
.hero-scene .zzz { right: 7%; bottom: 96px; color: #fff; }

/* Task cards */
.task, .next-list li {
  background: #fff7f3; border: 1.5px solid #ece2fb; border-radius: 16px; padding: 10px 14px;
}
.task:hover { border-color: #d9cbfa; }
.task.is-active { background: #dcd1fc; border-color: #b9a6f6; box-shadow: 0 6px 16px -10px rgba(118, 86, 238, .7); }
.task.is-done { background: #e6f6ec; border-color: #c8ebd5; }
.t-title { font-family: var(--head); font-weight: 500; font-size: 18px; color: #463a7c; }
.check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #c9bdea; }
.check.on { background: #5fcf95; border-color: #5fcf95; }
.check.active { width: 30px; height: 30px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #a891ff, #7656ee); }
.check.active svg { width: 13px; height: 13px; }
.t-time { min-width: 52px; text-align: right; font-family: var(--head); font-weight: 500; font-size: 16px; color: #6b5f99; white-space: nowrap; }
.t-time.guess { color: var(--ink-3); text-decoration: underline dashed #c9bdea; text-underline-offset: 4px; }
.play { width: 36px; height: 36px; background: #f1ecff; color: #7656ee; border: 2px solid #b8a6f0; box-shadow: none; }
.play svg { width: 14px; height: 14px; margin-left: 2px; }
.play:hover { background: #fff; }
.play.now { background: transparent; border-color: transparent; color: #6d4fe0; box-shadow: none; }
.done-badge { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid #8fdcb2; color: #35b877; }
.done-badge svg { width: 16px; height: 16px; }
.eq { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.eq i { width: 3px; border-radius: 2px; background: currentColor; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; } .eq i:nth-child(2) { height: 90%; animation-delay: .2s; } .eq i:nth-child(3) { height: 60%; animation-delay: .4s; } .eq i:nth-child(4) { height: 80%; animation-delay: .1s; }
@keyframes eq { 50% { transform: scaleY(.4); } }
.eq i { transform-origin: bottom; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: 12px; white-space: nowrap; vertical-align: middle; }
.badge.skipped { background: #eeeaf5; color: #7d7699; }
.badge.done { background: #dff5e8; color: #1f8a57; }
.badge.todo { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px #d9cff7; }

/* Categories */
.cat-personal { --cc: var(--cat-personal); }
.cat-outreach { --cc: var(--cat-outreach); }
.cat-business { --cc: var(--cat-business); }
.cat-none { --cc: #cfc8e3; }
.cat-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--cc, #cfc8e3); }
.cat-pick, .cat-badge, .cat-chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; white-space: nowrap;
  font-weight: 800; font-size: 13px; color: var(--ink-2); background: #fff;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cc) 45%, #fff);
}
.cat-pick { position: relative; padding: 4px 10px; cursor: pointer; flex: none; }
.cat-pick select { appearance: none; -webkit-appearance: none; border: 0; background: none; outline: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.cat-pick:focus-within { box-shadow: inset 0 0 0 2px var(--purple); }
.cat-pick.cat-none { color: var(--ink-3); box-shadow: inset 0 0 0 1.5px #e3dcf5; }
.cat-pick.cat-none .cat-dot { display: none; }
.task .cat-pick.cat-none { opacity: 0; transition: opacity .15s; }
.task:hover .cat-pick.cat-none, .task .cat-pick.cat-none:focus-within { opacity: 1; }
.cat-badge { padding: 2px 9px; font-size: 12px; margin-right: 4px; vertical-align: middle; }
.cur-sub .cat-badge { margin-left: 6px; }
.cat-chip { border: 0; padding: 6px 12px; cursor: pointer; font-family: inherit; transition: background .15s; }
.cat-chip:hover { background: color-mix(in srgb, var(--cc) 10%, #fff); }
.cat-chip.on { background: color-mix(in srgb, var(--cc) 20%, #fff); box-shadow: inset 0 0 0 2px var(--cc); color: var(--ink); }
.dump-cats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 4px 0; }
.dump-cats .hint { margin-left: auto; }
.dump-cats .hint b { color: var(--ink-2); }

/* Progress bars (sheet: pink track, lavender fill, star) */
.bar { background: #fbe4ea; box-shadow: inset 0 0 0 1.5px #f2d2dc; }
.bar > i { background: linear-gradient(90deg, #8c75ea, #a796f2 70%, #b9a8f7); }

/* Buttons (sheet style) */
.controls { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.controls .btn { padding: 15px 8px; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 10px 20px -10px rgba(91,63,200,.6); }
.btn-soft { background: #efe9ff; color: var(--purple-d); }
.btn-stop { color: #fff; background: linear-gradient(135deg, #f8909f, #ea627c); box-shadow: 0 10px 20px -8px rgba(234,98,124,.7); }
.btn-mint { background: linear-gradient(135deg, #b3a6f6, #9584ee); }
.controls .btn-mint { background: linear-gradient(135deg, #b3a6f6, #9584ee); }

/* Timer ring with clouds */
.ring-wrap { margin-top: 34px; }
.ring-track { stroke: #ece6ff; }
.ring-peek { position: absolute; left: 50%; top: -8%; width: 28%; transform: translateX(-50%); z-index: 2; display: flex; justify-content: center; }
.ring-peek .art.peek { width: 100%; }
.ring-peek .art-emoji.peek { font-size: clamp(28px, 5vw, 44px); }
.ring-deco { position: absolute; z-index: 2; color: #ffd36a; text-shadow: 0 0 10px rgba(255,211,106,.8); font-size: 26px; line-height: 1; }
.ring-deco.s1 { right: 8%; top: 4%; }
.ring-deco.s2 { left: 4%; top: 34%; font-size: 20px; animation: twinkle 3s ease-in-out infinite; }
.ring-cloud { z-index: 2; }
.ring-cloud.left { --w: 34%; left: 0; bottom: 4%; }
.ring-cloud.right { --w: 30%; right: 0; bottom: 10%; }
.ring-sparkles { position: absolute; inset: 0; pointer-events: none; }
.ring-sparkles i { position: absolute; font-style: normal; color: #d9ccff; font-size: 14px; animation: twinkle 3s ease-in-out infinite; }
.ring-sparkles i:nth-child(1) { left: 22%; top: 24%; }
.ring-sparkles i:nth-child(2) { right: 24%; top: 20%; animation-delay: 1s; }
.ring-sparkles i:nth-child(3) { right: 20%; bottom: 26%; animation-delay: 2s; }
.ring-sparkles i:nth-child(4) { left: 26%; bottom: 22%; animation-delay: 1.5s; font-size: 20px; }
.ring-center .clock { position: relative; }
.is-almost .ring-prog { stroke: #f59ab8; }
.is-almost .clock { color: #d64f8c; }

/* Period tabs */
.period-tabs { display: flex; gap: 4px; width: fit-content; padding: 5px; margin: 0 0 14px; border-radius: 16px; background: rgba(255,255,255,.75); box-shadow: var(--shadow); }
.period-tabs button { border: 0; background: none; cursor: pointer; padding: 10px 34px; border-radius: 12px; font: 500 17px var(--head); color: var(--ink-2); }
.period-tabs button.on { color: #fff; background: linear-gradient(135deg, #a891ff, #7656ee); box-shadow: 0 6px 14px -6px rgba(118,86,238,.8); }

/* Month calendar */
.month-nav { display: flex; gap: 4px; }
.month-nav .icon-btn { font-size: 22px; line-height: 1; color: var(--ink-2); }
.month-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { margin-bottom: 6px; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.cal-cell { position: relative; min-height: 54px; padding: 5px 7px; border-radius: 12px; display: flex; flex-direction: column; justify-content: space-between; background: #f6f3ff; color: var(--ink-2); font-size: 12px; }
.cal-cell b { font-weight: 800; font-size: 12px; }
.cal-cell small { font-weight: 800; font-size: 11px; white-space: nowrap; overflow: hidden; }
.cal-cell em { position: absolute; top: 3px; right: 5px; font-style: normal; font-size: 13px; }
.cal-cell.blank { background: none; }
.cal-cell.lvl-1 { background: #ebe5ff; }
.cal-cell.lvl-2 { background: #d6caff; }
.cal-cell.lvl-3 { background: #b6a1fb; color: #2f2168; }
.cal-cell.lvl-4 { background: #8b6cf0; color: #fff; }
.cal-cell.today { box-shadow: 0 0 0 2.5px var(--pink); }
.cal-cell.future { opacity: .45; }
.cal-legend { display: flex; align-items: center; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.cal-legend .cal-cell { display: inline-block; min-height: 0; width: 16px; height: 16px; padding: 0; border-radius: 5px; }

/* Category donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { width: 180px; height: 180px; flex: none; }
.donut-total { font-family: var(--head); font-weight: 600; font-size: 22px; fill: var(--ink); }
.donut-sub { font-size: 11px; font-weight: 700; fill: var(--ink-3); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 180px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
.legend .lg-label { flex: 1; }
.legend b { font-family: var(--head); font-weight: 600; color: var(--ink); }
.legend .muted { width: 36px; text-align: right; }

/* Estimate vs actual card */
.est-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 18px; background: #fff3f6; box-shadow: inset 0 0 0 1.5px #f6d6e2; }
.est-card b { font-family: var(--head); font-weight: 600; font-size: 28px; }
.est-card .arrow { font-size: 24px; color: var(--ink-2); }
.est-card .est-star { margin-left: auto; font-size: 34px; }

/* Art sizes */
.note-card .note-art { right: 8px; bottom: 4px; }
.note-card .art.note { height: 90px; }
.note-card .art-emoji.note { font-size: 52px; }
.day-done .art.day-art { height: 100px; margin: 0 auto; }
.day-done .art-emoji.day-art { font-size: 48px; }
.cele-art .art.cele-cat { height: 150px; }
.cele-art .art-emoji.cele-cat { font-size: 104px; }

/* Zen (night sky) */
body.zen-body {
  color: #fff;
  background:
    radial-gradient(ellipse 70% 22% at 10% 104%, rgba(255,214,230,.95), transparent 70%),
    radial-gradient(ellipse 70% 22% at 90% 104%, rgba(230,220,255,.95), transparent 70%),
    linear-gradient(180deg, #4a3b8f 0%, #6b56b4 45%, #a985cc 80%, #e8b5d2 100%);
}
body.zen-body::before {
  content: '✦   ★      ✧     ✦  ·   ★   ✦     ✧ ·    ✦'; position: fixed; inset: 8px 10px auto; color: #ffe08a; opacity: .8;
  font-size: 14px; letter-spacing: 6px; white-space: pre-wrap; line-height: 3; pointer-events: none;
}
.zen { z-index: 1; }
.zen-top { width: 100%; justify-content: space-between; color: #e9e0ff; }
.zen-link { display: inline-flex; align-items: center; gap: 2px; border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 999px; padding: 4px 10px 4px 6px; cursor: pointer; font: 700 12px var(--body); }
.zen-link svg { width: 12px; height: 12px; }
.zen-title { color: #fff; text-shadow: 0 2px 10px rgba(40,20,100,.4); }
.zen .cat-badge { background: rgba(255,255,255,.9); }
.zen .ring-wrap { margin-top: 22px; }
.zen .ring-track { stroke: rgba(255,255,255,.35); }
.zen .ring-center { background: radial-gradient(circle at 50% 40%, #7c66c8 0%, #5a4699 75%); box-shadow: inset 0 0 24px rgba(30,10,80,.5), 0 0 0 4px rgba(255,255,255,.5); }
.zen .clock { color: #fff; }
.zen .clock-sub { color: #e6dcff; }
.zen .is-over .clock, .zen .is-over .clock-sub { color: #ffc2dc; }
.zen .ring-sparkles i { color: #ffe08a; }
.zen .ring-deco.s2 { color: #fff; }
.zen-meta { color: #f3ecff; }
.round-btn { color: #fff; }
.round-btn i { background: rgba(255,255,255,.92); color: var(--purple-d); box-shadow: 0 6px 14px -6px rgba(30,10,80,.6); }
.round-btn.stop i { color: #e9607b; box-shadow: inset 0 0 0 2px #f6a3b3, 0 6px 14px -6px rgba(30,10,80,.6); background: #fff; }
.round-btn.pink i { background: #fff; color: #ec5f9e; box-shadow: inset 0 0 0 2px #f8b3d2, 0 6px 14px -6px rgba(30,10,80,.6); }
.round-btn.mint i { background: #fff; color: #35b877; box-shadow: inset 0 0 0 2px #9fe0bd, 0 6px 14px -6px rgba(30,10,80,.6); }
.round-btn.purple i { background: #fff; color: var(--purple-d); }
.zen .art.zen-cat { height: min(30vh, 130px); }
.zen .art-emoji.zen-cat { font-size: clamp(56px, 20vw, 84px); }
.zen h2 { background: none; -webkit-background-clip: initial; background-clip: initial; color: #fff; }
.zen .zen-cmp { color: #f3ecff; }

@media (max-width: 720px) {
  .controls { grid-template-columns: repeat(2, 1fr); }
  .dump-cats .hint { margin-left: 0; width: 100%; }
  .task { flex-wrap: wrap; }
  .cal-cell small { display: none; }
  .period-tabs button { padding: 8px 22px; }
}

/* =====================================================================
   Design kit artwork (assets/)
   ===================================================================== */
.logo-moon { width: 30px; height: 30px; object-fit: contain; }
.logo-spark { width: 26px; height: auto; margin-top: -12px; }
.avatar { overflow: hidden; }
.avatar img { width: 120%; height: 120%; object-fit: cover; object-position: 50% 20%; }
.nav-ico { width: 34px; height: 34px; object-fit: contain; }
.bottomnav a.on .nav-ico { transform: scale(1.08); filter: drop-shadow(0 3px 6px rgba(240,86,159,.35)); }

.ico { width: 34px; height: 34px; object-fit: contain; }
.stat-ic .ico { width: 36px; height: 36px; }
.mini-stats .stat-ic .ico { width: 28px; height: 28px; }
.h-ico { width: 28px; height: 28px; object-fit: contain; }

/* Progress star, ring star */
.bar > .bar-star { width: 28px; height: 28px; font-size: 0; }
.bar > .bar-star img, .ring-star img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bar.thin > .bar-star { width: 20px; height: 20px; }
.ring-star { width: 32px; height: 32px; font-size: 0; }
.zen .ring-star { width: 24px; height: 24px; }

/* Task row image buttons */
.play.img, .play.img:hover { width: 38px; height: 38px; padding: 0; border: 0; background: none; box-shadow: none; }
.btn-ico { width: 100%; height: 100%; object-fit: contain; display: block; }
.done-badge { border: 0; background: none; width: 38px; height: 38px; }
.check.active { background: none; width: 32px; height: 32px; padding: 0; }

/* Cloud images */
.cloud-img { position: absolute; width: var(--w, 90px); height: auto; pointer-events: none; }

/* Hero with the night-sky background */
.hero { background-image: url(../assets/sky.webp), linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 42%, var(--night-3) 78%, var(--night-4) 100%); background-position: center 45%; }
.hero-scene .hc1 { --w: 170px; right: 44%; bottom: -26px; }
.hero-scene .hc2 { --w: 220px; right: 2%; bottom: -40px; }
.hero-scene .hc3 { --w: 150px; right: 24%; bottom: -22px; }
.hero-scene .h-planet { position: absolute; right: 36%; top: 14px; width: 64px; animation: float 7s ease-in-out infinite; }
.hero-scene .h-spark1 { position: absolute; right: 56%; top: 18px; width: 22px; animation: twinkle 3s ease-in-out infinite; }
.hero-scene .h-star1 { position: absolute; right: 22%; top: 12px; width: 26px; animation: twinkle 4s ease-in-out infinite 1s; }
.hero-scene .sleepy { right: 8%; bottom: 6px; }
.hero-scene .art.sleep { height: 140px; filter: drop-shadow(0 8px 14px rgba(40,20,100,.3)); }
.hero-scene .zzz { right: 6%; bottom: 120px; }

/* Timer ring decorations */
.ring-deco { position: absolute; z-index: 2; height: auto; pointer-events: none; }
.ring-deco.s1 { width: 15%; right: 6%; top: 1%; animation: float 5s ease-in-out infinite; }
.ring-deco.s3 { width: 8%; left: 18%; top: 4%; animation: twinkle 3.5s ease-in-out infinite; }
.ring-deco.s2 { width: 11%; left: 0; top: 40%; animation: twinkle 3s ease-in-out infinite 1s; }
.ring-wrap { margin-top: 18px; }
.ring-cloud.left { --w: 38%; left: -4%; bottom: 2%; }
.ring-cloud.right { --w: 32%; right: -3%; bottom: 8%; }

/* Empty states and modal art */
.empty-art { display: block; width: 130px; height: auto; margin: 0 auto 8px; animation: float 4s ease-in-out infinite; }
.empty-art.small { width: 80px; }
.insight-ico { width: 30px; height: 30px; object-fit: contain; flex: none; }
.modal-cat { height: 110px; width: auto; }
.modal-ico { width: 72px; height: 72px; object-fit: contain; }
.modal .art { display: flex; justify-content: center; }

/* Celebration */
.cele-art { height: 170px; }
.cele-art .art.cele-cat { height: 170px; }
.cele-text { position: absolute; width: 130px; height: auto; pointer-events: none; }
.cele-text.left { left: 2%; top: 10px; transform: rotate(-6deg); }
.cele-text.right { right: 2%; top: 48px; transform: rotate(4deg); }
.orbit img { width: 30px; height: 30px; object-fit: contain; display: block; }

/* Zen window: tall night-sky background + image buttons */
body.zen-body {
  background: url(../assets/sky-tall.webp) center bottom / cover no-repeat, linear-gradient(180deg, #4a3b8f 0%, #6b56b4 45%, #a985cc 80%, #e8b5d2 100%);
}
body.zen-body::before { content: none; }
.round-btn.img i { background: none; box-shadow: none; width: 54px; height: 54px; }
.rb-ico { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(30,10,80,.35)); }
.zen .art.zen-cat { height: min(28vh, 140px); }

@media (max-width: 720px) {
  .cele-text { display: none; }
  .hero-scene { display: block; opacity: .5; }
}
.hero { background-image: linear-gradient(90deg, rgba(67,53,138,.82) 0%, rgba(67,53,138,.45) 38%, rgba(67,53,138,0) 62%), url(../assets/sky.webp), linear-gradient(180deg, var(--night-1), var(--night-4)); background-position: 0 0, center 48%, 0 0; background-size: auto, cover, auto; }
.zen-meta { color: var(--ink); background: rgba(255,255,255,.7); padding: 3px 12px; border-radius: 999px; }
.zen .round-btn { color: var(--ink); text-shadow: 0 0 6px rgba(255,255,255,.9); }

/* =====================================================================
   Merged Focus page (tasks + timer)
   ===================================================================== */
.bottomnav { width: min(560px, calc(100% - 32px)); }
.hero { min-height: 128px; padding: 20px 28px; margin: 14px 0 14px; }
.hero h1 { font-size: clamp(30px, 3.6vw, 40px); }
.hero .hand-note { max-width: 260px; font-size: 24px; transform: rotate(-4deg); }
.hero-scene .art.sleep { height: 116px; }

.today-strip { display: flex; align-items: center; gap: 22px; padding: 14px 20px; margin-bottom: 16px; flex-wrap: wrap; }
.today-strip .ts-progress .big { font-family: var(--head); font-size: 30px; font-weight: 600; line-height: 1.05; }
.today-strip > .bar { flex: 1; min-width: 160px; }
.ts-stat { display: flex; align-items: center; gap: 10px; }
.ts-stat .stat-ic { width: 44px; height: 44px; border-radius: 14px; }
.ts-stat .stat-ic .ico { width: 28px; height: 28px; }
.ts-stat .stat-val { font-size: 22px; }

.grid-focus { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 18px; align-items: start; }
.timer-card { position: sticky; top: 90px; }
.timer-card .current { align-items: center; }
.cur-text { flex: 1; min-width: 0; }
.cur-title { font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-sub { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.cur-emoji { width: 60px; height: 60px; font-size: 32px; border-radius: 18px; }
.timer-card .ring-wrap { width: min(340px, 74vw); }
.timer-card.idle .ring-center .clock { opacity: .55; }
.controls.one { grid-template-columns: 1fr; }
.controls.one .btn { font-size: 20px; padding: 18px; }
.timer-card.rest { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 360px; text-align: center; }
.timer-card.rest .empty-art { width: 190px; }
.timer-card.rest h2 { margin: 6px 0 0; }

.tasks-card .dump { border: 0; padding: 0; background: none; }
.tasks-card .dump textarea { font-size: 18px; }
.tasks-card .dump .btn { min-width: 90px; }
.dump-cats { margin-top: 10px; }
.dump-preview:empty { display: none; }
.task-list { margin-top: 14px; }
.t-main:only-child, .t-main { align-self: center; }
.tasks-foot { justify-content: flex-end; }

.sel, .text-input { font: 700 15px var(--body); color: var(--ink); border: 0; outline: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); padding: 8px 10px; }
.text-input { width: 220px; }
.sel:focus, .text-input:focus { box-shadow: inset 0 0 0 2px var(--purple); }
.gif-preview { display: flex; justify-content: center; }
.gif-preview img { max-width: 100%; max-height: 220px; border-radius: 14px; margin-top: 8px; }
.cele-art img.gif { max-height: 180px; max-width: 300px; }

@media (max-width: 1100px) {
  .grid-focus { grid-template-columns: minmax(0, 1fr); }
  .timer-card { position: static; }
}
@media (max-width: 720px) {
  .today-strip { gap: 12px; }
  .today-strip > .bar { order: 3; flex-basis: 100%; }
}

/* Mood on the month calendar */
.cal-cell em.mood { top: 4px; right: 5px; font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(51,36,110,.25)); }
.cal-cell { min-height: 60px; }
.h-item summary { padding: 2px 0; }
.h-item:not([open]):hover { border-color: #d9cbfa; }

/* Focus today/week/month switcher (phones only) */
.fc-nav { display: none; }
.fc-body { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .stat-cards .fc:not(.fc-active) { display: none; }
  .stat-cards .stat-top { width: 100%; }
  .fc-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; align-self: flex-start; }
  .fc-nav .icon-btn { width: 36px; height: 36px; font-size: 24px; line-height: 1; color: var(--ink-2); background: #f1ecff; border-radius: 12px; }
  .fc-dots { display: flex; gap: 4px; padding: 0 4px; }
  .fc-dots i { width: 6px; height: 6px; border-radius: 50%; background: #d9cff7; }
  .fc-dots i.on { background: var(--purple); }
}

/* Today strip on phones: three even columns, progress bar underneath */
@media (max-width: 720px) {
  .today-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; padding: 16px 14px; }
  .today-strip > .bar { grid-column: 1 / -1; order: 3; margin: 2px 4px 4px; }
  .today-strip .ts-stat { flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; }
  .today-strip .ts-stat .stat-ic { width: 42px; height: 42px; }
  .today-strip .ts-stat .stat-val { font-size: 21px; }
  .today-strip .ts-stat .stat-sub { white-space: nowrap; }
  .timer-card.rest { min-height: 240px; }
  .timer-card.rest .empty-art { width: 150px; }
}

/* Never let anything push the page sideways on phones */
html, body { overflow-x: clip; }
.wc-col:nth-child(-n+2) .wc-tip { left: 0; transform: none; }
.wc-col:nth-child(6) .wc-tip, .wc-col:nth-child(7) .wc-tip { left: auto; right: 0; transform: none; }

/* Focus nudge: a soft glow on the timer when the ding plays */
.is-nudge .ring-center { animation: nudgeGlow 2.4s ease-out; }
@keyframes nudgeGlow {
  0% { box-shadow: inset 0 0 30px rgba(201,184,255,.55), 0 0 0 0 rgba(244,114,182,.0); }
  20% { box-shadow: inset 0 0 30px rgba(201,184,255,.55), 0 0 0 14px rgba(244,114,182,.35); }
  100% { box-shadow: inset 0 0 30px rgba(201,184,255,.55), 0 0 0 28px rgba(244,114,182,0); }
}

/* Same width on every page: always reserve the scrollbar's space */
html { overflow-y: scroll; scrollbar-gutter: stable; }

/* Year view: twelve month bars */
.wc-plot.wc-year, .wc-days.wc-year { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.wc-year .wc-col:nth-child(6) .wc-tip, .wc-year .wc-col:nth-child(7) .wc-tip { left: 50%; right: auto; transform: translateX(-50%); }
.wc-year .wc-col:nth-child(n+11) .wc-tip { left: auto; right: 0; transform: none; }
.wc-year .wc-col.future .wc-bar { opacity: .4; }
.wc-year .wc-val { font-size: 11px; }
@media (max-width: 720px) {
  .wc-plot.wc-year, .wc-days.wc-year { gap: 3px; }
  .wc-days.wc-year { font-size: 11px; }
  .wc-year .wc-val { display: none; }
  .period-tabs button { padding: 8px 18px; }
}

/* Sync card */
.sync-help { margin: 0 0 12px; color: var(--ink-2); font-weight: 600; font-size: 14px; line-height: 1.5; }
.sync-who { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-status { text-align: right; }
.sync-status.err { color: var(--pink-d); text-align: left; }
.kv .sync-status.err { text-align: right; }
.btn-google { display: inline-flex; align-items: center; gap: 10px; background: #fff; }
.btn-google:disabled { opacity: .6; cursor: default; }

/* Task rows: on wide screens the extras sit inline; on phones the title gets the full width
   and time, category and delete move to a second line underneath it. */
.t-extra { display: contents; }
.t-extra .t-time { order: 1; }
.t-extra .icon-btn { order: 3; }
.task > .play, .task > .done-badge { order: 2; }
@media (max-width: 720px) {
  .task:not(.editing) { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; align-items: center; padding: 10px 12px; }
  .task .drag { display: none; }
  .task > .check { grid-column: 1; grid-row: 1 / span 2; }
  .task > .t-emoji { grid-column: 2; grid-row: 1 / span 2; width: 30px; font-size: 24px; }
  .task > .t-main { grid-column: 3; grid-row: 1; }
  .task > .play, .task > .done-badge { grid-column: 4; grid-row: 1 / span 2; }
  .t-extra { grid-column: 3; grid-row: 2; display: flex; align-items: center; gap: 10px; min-width: 0; }
  .t-extra .t-time { order: 0; min-width: 0; text-align: left; font-size: 15px; }
  .t-extra .cat-pick { order: 1; padding: 2px 9px; font-size: 12px; }
  .t-extra .icon-btn { order: 2; margin-left: auto; width: 26px; height: 26px; }
  .task .icon-btn, .task .cat-pick.cat-none { opacity: .7; }
  .task .t-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.25; }
}

/* Fullscreen Zen: the picture-in-picture view, laid over the whole page */
.zen-full-btn {
  align-self: flex-start; margin-left: auto; flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 12px; cursor: pointer; color: var(--purple-d); background: #f1ecff;
  box-shadow: inset 0 0 0 1.5px #e3dafd;
}
.zen-full-btn:hover { background: #e9e1ff; }
.zen-full-btn svg { width: 20px; height: 20px; }
.zen-overlay {
  position: fixed; inset: 0; z-index: 150; display: flex; overflow: auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #e5ddff 0%, #f3e8ff 35%, #fde6f2 70%, #e3e8ff 100%);
}
.zen-overlay[hidden] { display: none; }
.timer-card.full { position: relative; top: auto; flex: 1; width: 100%; max-width: 620px; margin: auto; min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.timer-card.full .ring-wrap { width: min(86vw, 52vh, 520px); margin: auto; }
.timer-card.full .clock { font-size: clamp(56px, min(17vw, 10vh), 96px); }
.timer-card.full.rest { justify-content: center; }
.timer-card.full.rest .current { position: absolute; top: 20px; right: 20px; }
html.zen-open, html.zen-open body { overflow: hidden; }
html.zen-open .modal-backdrop { z-index: 170; }

/* Categories card: week / month / year pager */
.cat-pager { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.cat-pager .icon-btn { width: 32px; height: 32px; font-size: 22px; line-height: 1; color: var(--ink-2); background: #f1ecff; border-radius: 10px; }
.cat-pager .icon-btn:hover { background: #e9e1ff; }
.cp-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 86px; }
.cp-mid b { font-size: 14px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.cat-pager .fc-dots { display: flex; gap: 4px; }
.cat-pager .fc-dots i { width: 6px; height: 6px; border-radius: 50%; background: #d9cff7; }
.cat-pager .fc-dots i.on { background: var(--purple); }

/* Celebration close button sat under the artwork and couldn't be clicked */
.modal-x { z-index: 5; }

/* Daily affirmation in the top bar; on phones it gets its own line under the logo */
.tagline { overflow: hidden; text-overflow: ellipsis; max-width: 52%; }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .tagline { order: 3; flex-basis: 100%; max-width: none; margin: 0; padding: 6px 14px; font-size: 13px; text-align: center; white-space: normal; }
}
