/* ============ Nag · design system ============ */
:root {
  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: 'Bricolage Grotesque', var(--font);
  --r: 14px; --r-lg: 20px; --r-xl: 26px;
  --h: 52px; /* calendar hour height */
  --coin: #ffc93c; --coin-ink: #2b1d00;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -12px rgba(0,0,0,.45);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.6);
  color-scheme: dark;
}
@media (max-width: 640px) { :root { --h: 46px; } }
:root, [data-theme="midnight"] {
  --bg: #0b0b12; --glow1: rgba(124,92,255,.20); --glow2: rgba(200,255,62,.07);
  --surface: #14141d; --surface2: #1c1c28; --surface3: #262635; --line: rgba(255,255,255,.07);
  --text: #f4f2ee; --muted: #8d8c9f; --accent: #c8ff3e; --accent-ink: #12160a; --accent2: #8b6cff;
  --danger: #ff5470; --warn: #ffb02e; --ok: #3ee08f;
}
[data-theme="daylight"] {
  color-scheme: light;
  --bg: #f5f4ef; --glow1: rgba(124,92,255,.10); --glow2: rgba(255,184,0,.08);
  --surface: #ffffff; --surface2: #f2f1eb; --surface3: #e7e5dd; --line: rgba(20,20,40,.08);
  --text: #17171f; --muted: #6d6c78; --accent: #6d4aff; --accent-ink: #fff; --accent2: #ff7a45;
  --danger: #e5284f; --warn: #d98200; --ok: #12a150; --coin: #f0a500;
  --shadow: 0 1px 2px rgba(20,20,40,.04), 0 10px 30px -14px rgba(20,20,40,.18); --shadow-lg: 0 30px 80px -20px rgba(20,20,40,.3);
}
[data-theme="neon"] {
  --bg: #05050b; --glow1: rgba(0,240,255,.16); --glow2: rgba(255,43,214,.13);
  --surface: #0d0d19; --surface2: #151527; --surface3: #1e1e37; --line: rgba(0,240,255,.12);
  --text: #eafcff; --muted: #7f8fb0; --accent: #00f0ff; --accent-ink: #001417; --accent2: #ff2bd6;
}
[data-theme="bubblegum"] {
  color-scheme: light;
  --bg: #fff0f7; --glow1: rgba(255,79,163,.16); --glow2: rgba(124,92,255,.12);
  --surface: #ffffff; --surface2: #ffe6f2; --surface3: #ffd3e8; --line: rgba(130,20,80,.10);
  --text: #3a1030; --muted: #9a6688; --accent: #ff4fa3; --accent-ink: #fff; --accent2: #7c5cff;
  --danger: #e5284f; --warn: #d98200; --ok: #12a150; --coin: #f0a500;
  --shadow: 0 1px 2px rgba(130,20,80,.05), 0 10px 30px -14px rgba(130,20,80,.2);
}
[data-theme="sunset"] {
  --bg: #170d12; --glow1: rgba(255,138,61,.20); --glow2: rgba(255,77,141,.15);
  --surface: #21131a; --surface2: #2c1a23; --surface3: #39222e; --line: rgba(255,200,180,.08);
  --text: #fff1e8; --muted: #c49a9a; --accent: #ff8a3d; --accent-ink: #1f0c00; --accent2: #ff4d8d;
}
[data-theme="vapor"] {
  --bg: #170d2f; --glow1: rgba(255,113,206,.22); --glow2: rgba(1,205,254,.16);
  --surface: #221343; --surface2: #2d1b58; --surface3: #3a246d; --line: rgba(255,180,240,.10);
  --text: #fff1fb; --muted: #b9a2d8; --accent: #ff71ce; --accent-ink: #2a0520; --accent2: #01cdfe;
}
[data-theme="matrix"] {
  --display: ui-monospace, 'SF Mono', Menlo, monospace;
  --bg: #020803; --glow1: rgba(57,255,106,.10); --glow2: rgba(0,200,83,.08);
  --surface: #06120a; --surface2: #0b1d10; --surface3: #112816; --line: rgba(57,255,106,.12);
  --text: #c8ffd4; --muted: #5f9a6b; --accent: #39ff6a; --accent-ink: #021006; --accent2: #00c853;
}
[data-theme="elephant"] {
  --bg: #222429; --glow1: rgba(184,196,214,.10); --glow2: rgba(243,166,192,.08);
  --surface: #2b2e34; --surface2: #353840; --surface3: #40444d; --line: rgba(255,255,255,.07);
  --text: #eef0f3; --muted: #a3a9b3; --accent: #b8c4d6; --accent-ink: #1b1f26; --accent2: #f3a6c0;
}
[data-theme="gold"] {
  --bg: #0b0905; --glow1: rgba(245,197,66,.18); --glow2: rgba(255,138,61,.10);
  --surface: #17130a; --surface2: #221c0f; --surface3: #2e2615; --line: rgba(245,197,66,.12);
  --text: #fff8e6; --muted: #a89a78; --accent: #f5c542; --accent-ink: #1f1600; --accent2: #ff8a3d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.4; min-height: 100dvh;
  background:
    radial-gradient(1100px 600px at 0% -10%, var(--glow1), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, var(--glow2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.hidden { display: none !important; }
.ic { flex: none; display: block; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ============ layout ============ */
.shell { min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; }
.page { max-width: 780px; margin: 0 auto; padding: 6px 16px calc(112px + env(safe-area-inset-bottom)); }
.page.wide { max-width: none; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100dvh;
    padding: 22px 14px; border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(20px);
  }
  .mhead, .tabbar { display: none !important; }
  .page { padding: 34px 36px 60px; }
  .page.wide { padding: 22px 24px 22px; }
}

/* sidebar */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.brand-dot { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-size: 17px; box-shadow: 0 6px 20px -6px var(--accent); }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; }
.profile-card:hover { transform: translateY(-1px); }
.pc-top { display: flex; gap: 12px; align-items: center; }
.pc-top .mascot { font-size: 38px; width: 52px; height: 52px; border-radius: 16px; background: var(--surface2); }
.pc-lvl { font-size: 12px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.pc-title { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.15; }
.pc-stats { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav button:hover { background: var(--surface2); color: var(--text); }
.nav button.on { background: var(--surface2); color: var(--text); }
.nav button.on::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--danger); color: #fff; }
.nav .count.coin { background: var(--coin); color: var(--coin-ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-add { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: 0 10px 24px -10px var(--accent); }
.side-add kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); }

/* mobile header */
.mhead {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.mhead .avatar { width: 44px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 28px; flex: none; }
.mhead .mini { flex: 1; min-width: 0; }
.mhead .mini b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhead .mini b span { color: var(--accent); }
.mhead .icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; color: var(--muted); font-size: 11px; font-weight: 700; position: relative; }
.tabbar button.on { color: var(--text); }
.tabbar button.on .ic { color: var(--accent); }
.tabbar .dot { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; }
.tabbar .dot.coin { background: var(--coin); color: var(--coin-ink); }
.tabbar .fab-wrap { display: grid; place-items: center; }
.fab {
  width: 56px; height: 56px; border-radius: 20px; margin-top: -26px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent2)));
  color: var(--accent-ink); box-shadow: 0 12px 28px -8px var(--accent), 0 0 0 5px var(--bg);
  transition: transform .15s;
}
.tabbar .fab { color: var(--accent-ink); padding: 0; display: grid; gap: 0; }
.fab:active { transform: scale(.92); }

/* ============ shared components ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.card h3 { font-size: 18px; margin-bottom: 4px; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.05; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.summary { color: var(--muted); margin: 6px 0 0; font-weight: 500; }
.summary b { color: var(--text); }
.summary .bad { color: var(--danger); }
@media (min-width: 900px) { .page-head h1 { font-size: 36px; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 13px; font-weight: 800; font-size: 14.5px; transition: transform .1s, filter .15s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface2); color: var(--text); }
.btn.ghost:hover { background: var(--surface3); filter: none; }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 50%, transparent); }
.btn.coin { background: var(--coin); color: var(--coin-ink); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }

.coins { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 8px; border-radius: 99px; background: color-mix(in srgb, var(--coin) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--coin) 30%, transparent); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coins .c { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--coin) 45%, #c98a00); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); display: grid; place-items: center; font-size: 11px; color: var(--coin-ink); font-weight: 900; }
.coins.bump { animation: bump .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 40% { transform: scale(1.18); } }
.coin-ic { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; vertical-align: -.15em; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--coin) 45%, #c98a00); box-shadow: inset 0 -1.5px 0 rgba(0,0,0,.2); }

.xpbar { height: 7px; border-radius: 99px; background: var(--surface3); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .9s cubic-bezier(.2,.9,.3,1); }

.seg { display: inline-flex; background: var(--surface2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 12px; border-radius: 9px; font-size: 13.5px; color: var(--muted); font-weight: 700; transition: all .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.seg.accent button.on { background: var(--accent); color: var(--accent-ink); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.inp { background: var(--surface2); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; outline: none; min-width: 0; transition: border-color .15s, background .15s; }
.inp:focus { border-color: var(--accent); background: var(--surface); }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--surface2); white-space: nowrap; font-weight: 600; }
.chip.hot { background: color-mix(in srgb, var(--accent) 22%, var(--surface2)); color: var(--text); }
.chip.boss { background: color-mix(in srgb, var(--accent2) 30%, var(--surface2)); }
.chip i, .area-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; display: inline-block; }

.mascot { position: relative; display: inline-grid; place-items: center; line-height: 1; flex: none; }
.mascot .fish { display: block; transition: transform .5s cubic-bezier(.3,1.6,.5,1), filter .4s; }
.mascot .hat { position: absolute; top: -.36em; left: 52%; transform: translateX(-50%) rotate(-10deg); font-size: .58em; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.mascot .hat-shades { top: .2em; left: 30%; font-size: .4em; transform: rotate(-4deg); }
.mascot .hat-headphones { top: -.22em; font-size: .72em; transform: translateX(-50%); }
.mascot .hat-flower { top: -.2em; left: 70%; }
.mascot .hat-crown { top: -.42em; transform: translateX(-50%) rotate(-6deg); }
.mascot.meh .fish { animation: wobble 2.4s ease-in-out infinite; }
.mascot.sad .fish { animation: shiver .25s linear infinite; filter: saturate(.35); }
.mascot.dead .fish { transform: rotate(180deg); filter: grayscale(1); }
.mascot.party .fish { animation: bounce .8s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes shiver { 0%,100% { transform: translateX(0); } 50% { transform: translateX(1.5px); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ============ today ============ */
.hello { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin: 8px 0 18px; }
.hello h1 { font-size: 28px; line-height: 1.1; }
@media (min-width: 900px) { .hello h1 { font-size: 36px; } .hello { margin-top: 0; } }
.effects { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.effect { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--accent2) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent); }
.effect.boost { background: color-mix(in srgb, var(--coin) 16%, var(--surface)); border-color: color-mix(in srgb, var(--coin) 40%, transparent); }

.drop-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); margin-bottom: 14px; cursor: pointer;
  background: linear-gradient(110deg, color-mix(in srgb, var(--coin) 26%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--coin) 40%, transparent); box-shadow: var(--shadow); transition: transform .15s;
}
.drop-banner:hover { transform: translateY(-1px); }
.drop-banner .big { font-size: 34px; animation: jiggle 2.2s ease-in-out infinite; }
.drop-banner b { display: block; font-size: 15.5px; }
.drop-banner small { color: var(--muted); }
@keyframes jiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg) scale(1.1); } 88% { transform: rotate(10deg) scale(1.1); } 92% { transform: rotate(-6deg); } }

.qstrip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.qmini { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; cursor: pointer; transition: transform .15s, border-color .15s; min-width: 0; }
.qmini:hover { transform: translateY(-1px); }
.qmini .qt { display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qmini .qt span:last-child { overflow: hidden; text-overflow: ellipsis; }
.qmini .xpbar { height: 5px; margin: 8px 0 5px; }
.qmini small { font-size: 11.5px; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; }
.qmini.ready { border-color: var(--coin); box-shadow: 0 0 22px -6px var(--coin); animation: glow 1.6s ease-in-out infinite; }
.qmini.ready small b { color: var(--coin); }
.qmini.claimed { opacity: .5; }
@keyframes glow { 50% { box-shadow: 0 0 30px -4px var(--coin); } }
@media (max-width: 520px) { .qmini .qt span:last-child { display: none; } .qmini .qt { justify-content: center; font-size: 18px; } }

.addbar { position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 20; margin: 0 -4px 6px; padding: 4px; border-radius: 20px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); }
@media (min-width: 900px) { .addbar { top: 10px; } }
.addbar form { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 17px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.addbar form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow); }
.addbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; padding: 9px 0; font-weight: 500; }
.addbar input::placeholder { color: var(--muted); }
.addbar .go { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.addbar .chips { padding: 8px 6px 2px; }
.addbar .chips:empty { display: none; }

.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 4px; padding: 4px 16px; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); transition: all .15s; }
.filters button:hover { color: var(--text); }
.filters button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters button em { font-style: normal; opacity: .55; font-size: 12px; }
@media (min-width: 900px) { .filters { margin: 8px 0 4px; padding: 4px 0; flex-wrap: wrap; } }

.sec { margin-top: 22px; }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 0 2px 9px; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 800; }
.sec-h .n { background: var(--surface2); color: var(--text); border-radius: 99px; padding: 1px 8px; font-size: 11.5px; letter-spacing: 0; }
.sec-h .toggle { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--muted); font-size: 12.5px; }
.sec.overdue .sec-h { color: var(--danger); }
.sec.overdue .sec-h .n { background: var(--danger); color: #fff; }
.list { display: flex; flex-direction: column; gap: 6px; }

.task {
  --c: var(--muted);
  position: relative; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .25s, opacity .25s, background .15s, border-color .15s; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.task:hover { background: var(--surface2); }
.sec.overdue .task { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.task.boss { background: linear-gradient(105deg, color-mix(in srgb, var(--accent2) 20%, var(--surface)), var(--surface) 55%); border-color: color-mix(in srgb, var(--accent2) 35%, var(--line)); }
.check {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--c) 75%, transparent); flex: none;
  display: grid; place-items: center; color: transparent; transition: all .18s;
}
.check:hover { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.task.done .check { background: var(--c); border-color: var(--c); color: #fff; transform: scale(1.1); }
.task.done .t-title { text-decoration: line-through; opacity: .5; }
.task.leaving { transform: translateX(30px) scale(.98); opacity: 0; }
.t-body { flex: 1; min-width: 0; cursor: pointer; }
.t-title { font-size: 15.5px; font-weight: 650; overflow-wrap: anywhere; line-height: 1.3; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.t-meta .area { display: inline-flex; align-items: center; gap: 5px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; background: var(--surface2); font-weight: 700; color: var(--text); }
.pill.late { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.pill.soon { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.loot { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; opacity: .75; transition: opacity .15s; }
.loot b { color: var(--accent); font-weight: 800; }
.task:hover .loot { opacity: 1; }
@media (max-width: 520px) { .loot .lc { display: none; } }
.donelist .task { background: transparent; box-shadow: none; padding: 8px 12px; border-style: dashed; }
.donelist .t-title { font-size: 14.5px; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .mascot { font-size: 64px; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 17px; font-family: var(--display); margin-bottom: 4px; }

/* ============ quests ============ */
.quest { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quest + .quest { margin-top: 10px; }
.quest .qe { width: 52px; height: 52px; border-radius: 16px; background: var(--surface2); display: grid; place-items: center; font-size: 26px; flex: none; }
.quest .qb { flex: 1; min-width: 0; }
.quest .qn { font-weight: 750; font-size: 15.5px; }
.quest .xpbar { height: 8px; margin: 8px 0 4px; }
.quest small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.quest.ready { border-color: var(--coin); animation: glow 1.6s ease-in-out infinite; }
.quest.claimed { opacity: .55; }
.quest .claimed-tag { font-weight: 800; color: var(--ok); font-size: 13px; }
.chest-card { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: var(--r-xl); background: linear-gradient(120deg, color-mix(in srgb, var(--coin) 26%, var(--surface)), color-mix(in srgb, var(--accent2) 18%, var(--surface))); border: 1px solid color-mix(in srgb, var(--coin) 35%, transparent); box-shadow: var(--shadow); margin-bottom: 14px; }
.chest-card .big { font-size: 54px; animation: jiggle 2.2s ease-in-out infinite; }
.chest-card.opened .big { animation: none; filter: grayscale(.6); opacity: .6; }
.chest-card h3 { font-size: 20px; }
.streak-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.streak-card .num { font-family: var(--display); font-size: 46px; font-weight: 800; line-height: 1; color: var(--warn); }
.howto { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.howto div { background: var(--surface2); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.howto b { color: var(--text); display: block; font-size: 15px; }

/* ============ shop ============ */
.wallet { display: flex; align-items: center; gap: 10px; }
.wallet .coins { font-size: 18px; padding: 8px 14px 8px 10px; }
.wallet .coins .c { width: 26px; height: 26px; font-size: 13px; }
.shop-tabs { margin-bottom: 16px; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs button { flex: none; }
.featured { display: flex; gap: 18px; align-items: center; padding: 18px 20px; border-radius: var(--r-xl); margin-bottom: 18px; position: relative; overflow: hidden;
  background: radial-gradient(400px 200px at 0% 0%, color-mix(in srgb, var(--accent2) 45%, transparent), transparent), radial-gradient(400px 200px at 100% 100%, color-mix(in srgb, var(--coin) 35%, transparent), transparent), var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.featured .big { font-size: 60px; animation: jiggle 2.6s ease-in-out infinite; }
.featured h3 { font-size: 21px; }
.featured p { margin: 4px 0 12px; color: var(--muted); font-size: 13.5px; }
.shop-sec { margin-top: 22px; }
.shop-sec h2 { font-size: 19px; margin: 0 2px 10px; display: flex; align-items: baseline; gap: 8px; }
.shop-sec h2 small { font-family: var(--font); font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 400px) { .shop-grid { grid-template-columns: 1fr 1fr; } }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; position: relative; }
.item:hover { transform: translateY(-2px); }
.item.equipped { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.item-prev { height: 92px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; font-size: 42px; position: relative; overflow: hidden; }
.item-prev .mascot { font-size: 46px; }
.item.locked .item-prev > * { filter: grayscale(1) blur(1.5px); opacity: .5; }
.item-prev .lockicon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); filter: none !important; opacity: 1 !important; }
.item-prev .play { width: 46px; height: 46px; border-radius: 50%; background: var(--surface3); display: grid; place-items: center; color: var(--text); font-size: 20px; }
.item-prev .bubble-s { font-size: 12px; font-weight: 700; padding: 8px 10px; margin: 8px; border-radius: 12px; background: var(--surface3); line-height: 1.3; text-align: left; }
.item-prev .cnt { position: absolute; top: 8px; right: 8px; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--text); color: var(--bg); }
.theme-prev { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }
.theme-prev i { display: block; height: 10px; border-radius: 5px; }
.item-name { font-weight: 750; font-size: 14px; line-height: 1.2; padding: 0 2px; }
.item-desc { font-size: 12px; color: var(--muted); padding: 0 2px; line-height: 1.35; flex: 1; }
.item .act { margin-top: auto; }
.item .act .btn { width: 100%; }
.item .tag { display: block; text-align: center; font-weight: 800; font-size: 13px; padding: 8px; border-radius: 10px; }
.item .tag.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.item .tag.lock { color: var(--muted); background: var(--surface2); }
.btn.buy.confirm { background: var(--ok); color: #04210f; animation: bump .4s; }

/* ============ me ============ */
.hero { text-align: center; padding: 28px 18px 22px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto; height: 260px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent2) 35%, transparent), transparent); pointer-events: none; }
.hero .mascot { font-size: 92px; margin: 12px 0 6px; }
.hero .lv { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; position: relative; }
.hero h2 { font-size: 30px; margin: 4px 0 12px; position: relative; }
.hero .xpbar { height: 10px; max-width: 380px; margin: 0 auto 8px; position: relative; }
.hero small { color: var(--muted); font-weight: 600; position: relative; }
.hero .quote { margin: 14px auto 0; max-width: 420px; font-weight: 650; position: relative; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface2); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--surface2); display: block; }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--accent) 30%, var(--surface2)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--accent) 55%, var(--surface2)); }
.heat i[data-l="3"] { background: color-mix(in srgb, var(--accent) 78%, var(--surface2)); }
.heat i[data-l="4"] { background: var(--accent); }
.heat i.future { visibility: hidden; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.inv-item { display: flex; align-items: center; gap: 12px; background: var(--surface2); border-radius: 14px; padding: 10px 12px; }
.inv-item .e { font-size: 26px; }
.inv-item div { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.inv-item small { display: block; color: var(--muted); font-weight: 600; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ach { background: var(--surface2); border-radius: 14px; padding: 12px 8px; text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ach .e { font-size: 30px; display: block; margin-bottom: 4px; }
.ach b { display: block; font-size: 12.5px; color: var(--text); }
.ach.locked { opacity: .45; }
.ach.locked .e { filter: grayscale(1) blur(1px); }
.road { display: flex; flex-direction: column; gap: 6px; }
.road .r { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--surface2); }
.road .r .l { width: 44px; font-weight: 800; color: var(--accent); flex: none; font-size: 13px; }
.road .r.locked { opacity: .5; }
.road .r.locked .l { color: var(--muted); }
.road .r.cur { box-shadow: inset 0 0 0 1.5px var(--accent); }
.road .r .what { font-size: 13.5px; flex: 1; min-width: 0; }
.road .r .what small { color: var(--muted); display: block; }
.road .r .rw { font-size: 12.5px; font-weight: 800; white-space: nowrap; }

/* ============ settings ============ */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:first-of-type { border-top: 0; }
.row label { font-weight: 700; }
.row small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 650; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.tip { font-size: 14px; color: var(--muted); }
.tip ol { margin: 6px 0 0; padding-left: 20px; }
.tip b { color: var(--text); }

/* ============ sheets / modals ============ */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; animation: fade .2s; backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: up .32s cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 26px; border-bottom: 1px solid var(--line); animation: pop .22s cubic-bezier(.2,.9,.3,1); max-height: 88dvh; }
}
@keyframes up { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(-48%) scale(.96); } }
.grab { width: 40px; height: 5px; background: var(--surface3); border-radius: 99px; margin: 0 auto 14px; }
@media (min-width: 700px) { .grab { display: none; } .sheet { padding-top: 22px; } }
.sheet-title { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.title-in { width: 100%; font-family: var(--display); font-size: 22px; font-weight: 700; background: transparent; border: 0; outline: none; resize: none; padding: 2px 0; line-height: 1.25; }
.qa-input { width: 100%; font-size: 19px; font-weight: 600; background: var(--surface2); border: 1.5px solid transparent; border-radius: 14px; outline: none; padding: 14px 16px; }
.qa-input:focus { border-color: var(--accent); }
.f { margin-top: 16px; }
.f > .lbl { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 800; margin-bottom: 7px; }
.area-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.area-pick button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 99px; background: var(--surface2); font-size: 13px; font-weight: 700; border: 1.5px solid transparent; color: var(--muted); }
.area-pick button.on { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 14%, var(--surface2)); }
.when { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.when .inp { flex: 1; min-width: 120px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 22px; align-items: center; }
.sheet-actions .grow { flex: 1; }
.snoozes { display: flex; gap: 6px; flex-wrap: wrap; }
.snoozes button { padding: 8px 12px; border-radius: 11px; background: var(--surface2); font-size: 13px; font-weight: 700; }
.snoozes button:hover { background: var(--surface3); }
.qa-when { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.qa-when button { padding: 8px 12px; border-radius: 99px; background: var(--surface2); font-size: 13px; font-weight: 700; color: var(--muted); border: 1.5px solid transparent; }
.qa-when button.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface2)); }

/* toasts + floating juice */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toasts { bottom: 24px; left: 260px; } }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); border-radius: 16px; padding: 11px 14px; max-width: 480px; width: 100%; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-lg); animation: tup .35s cubic-bezier(.3,1.5,.5,1); font-weight: 650; font-size: 14px; }
.toast .x { font-weight: 800; white-space: nowrap; display: flex; gap: 8px; }
.toast .x .xp { color: var(--accent2); }
.toast .x .co { color: #c98a00; }
.toast .msg { flex: 1; }
.toast button { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.toast.out { opacity: 0; transform: translateY(10px); transition: all .25s; }
@keyframes tup { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.floatxp { position: fixed; z-index: 90; font-weight: 900; font-size: 18px; pointer-events: none; animation: floatup 1.1s ease-out forwards; text-shadow: 0 2px 12px rgba(0,0,0,.5); color: var(--accent); white-space: nowrap; }
@keyframes floatup { to { transform: translateY(-64px) scale(1.25); opacity: 0; } }
.flycoin { position: fixed; z-index: 91; width: 20px; height: 20px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--coin) 45%, #c98a00); box-shadow: 0 0 12px var(--coin); transition: transform .75s cubic-bezier(.5,-0.3,.3,1), opacity .2s .65s; }

.overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); animation: fade .3s; padding: 24px; }
.reveal { text-align: center; max-width: 420px; }
.reveal .big { font-size: 110px; line-height: 1; display: inline-block; }
.reveal .big.shake { animation: boxshake .9s ease-in-out; }
.reveal .big.boom { animation: boom .6s cubic-bezier(.3,1.7,.5,1); }
.reveal h1 { font-size: 44px; margin: 14px 0 0; color: var(--accent); line-height: 1; }
.reveal h2 { font-size: 21px; margin: 10px 0 16px; }
.reveal p { color: var(--muted); }
.reveal ul { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 6px; }
.reveal li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-weight: 650; }
.reveal .btn { font-size: 16px; padding: 14px 28px; }
@keyframes boxshake { 0%,100% { transform: rotate(0); } 15% { transform: rotate(-14deg) scale(1.05); } 30% { transform: rotate(12deg) scale(1.1); } 45% { transform: rotate(-10deg) scale(1.12); } 60% { transform: rotate(8deg) scale(1.16); } 80% { transform: scale(1.3); } }
@keyframes boom { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }

.gate { text-align: center; width: 100%; max-width: 360px; }
.gate .mascot { font-size: 84px; }
.gate h1 { font-size: 34px; margin: 10px 0 4px; }
.gate p { color: var(--muted); margin: 0 0 20px; }
.gate .inp { width: 100%; text-align: center; font-size: 19px; margin-bottom: 10px; padding: 14px; }
.gate .btn { width: 100%; font-size: 17px; padding: 14px; }
.gate .err { color: var(--danger); min-height: 22px; margin-top: 10px; font-weight: 700; }
.shake { animation: shakeX .4s; }
@keyframes shakeX { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.sync { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; font-size: 12px; background: var(--warn); color: #000; padding: 4px 11px; border-radius: 99px; font-weight: 800; }
.bubble { position: absolute; left: 0; top: calc(100% + 10px); z-index: 50; width: max-content; max-width: min(280px, calc(100vw - 32px)); background: var(--text); color: var(--bg); padding: 10px 12px; border-radius: 14px; font-size: 13.5px; font-weight: 650; box-shadow: var(--shadow-lg); animation: fade .2s; text-align: left; line-height: 1.35; }

/* ============ calendar ============ */
.cal { display: flex; flex-direction: column; height: calc(100dvh - 158px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 420px; }
@media (min-width: 900px) { .cal { height: calc(100dvh - 44px); } }
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-bar h1 { font-size: 22px; margin-right: auto; white-space: nowrap; }
@media (min-width: 900px) { .cal-bar h1 { font-size: 26px; order: 0; } }
.cal-bar .nav-btns { display: flex; gap: 4px; }
.cal-bar .icon-btn { background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 640px) {
  .cal-bar { gap: 6px; }
  .cal-bar h1 { font-size: 20px; order: -2; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .cal-bar [data-cal="tray"] { order: -1; }
  .cal-bar .seg { flex: 1; flex-wrap: nowrap; min-width: 0; }
  .cal-bar .seg button { flex: 1; padding: 7px 4px; font-size: 13px; }
  .cal-bar .break { flex-basis: 100%; height: 0; }
}
.cal-bar .break { display: none; }
@media (max-width: 640px) { .cal-bar .break { display: block; } }
.cal-wrap { flex: 1; min-height: 0; display: flex; gap: 12px; }
.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.cal-scroll { flex: 1; overflow: auto; position: relative; overscroll-behavior: contain; scrollbar-width: thin; }
.cal-sticky { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-row { display: grid; grid-template-columns: 50px repeat(var(--n), minmax(0, 1fr)); }
.ch-day { text-align: center; padding: 8px 0 6px; cursor: pointer; border-radius: 10px; }
.ch-day:hover .num { background: var(--surface2); }
.ch-day .dow { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; font-weight: 800; }
.ch-day .num { display: grid; place-items: center; width: 34px; height: 34px; margin: 2px auto 0; border-radius: 50%; font-size: 17px; font-weight: 750; font-family: var(--display); transition: background .15s; }
.ch-day.today .dow { color: var(--accent); }
.ch-day.today .num { background: var(--accent); color: var(--accent-ink); }
.ch-day.past { opacity: .6; }
.ad-label { font-size: 10px; color: var(--muted); font-weight: 700; text-align: right; padding: 8px 6px 0 0; text-transform: uppercase; }
.ad-cell { min-height: 32px; padding: 3px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-body { display: grid; grid-template-columns: 50px repeat(var(--n), minmax(0, 1fr)); position: relative; }
.hours { position: relative; height: calc(24 * var(--h)); }
.hours span { position: absolute; right: 7px; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.daycol {
  position: relative; height: calc(24 * var(--h)); border-left: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 100% var(--h), 100% calc(var(--h) / 2);
}
.daycol.today { background-color: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.daycol.weekend { background-color: color-mix(in srgb, var(--text) 1.5%, transparent); }
.ev {
  --c: var(--muted);
  position: absolute; border-radius: 8px; padding: 3px 6px 3px 7px; overflow: hidden; font-size: 12px; line-height: 1.25; cursor: grab;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); border-left: 3px solid var(--c); color: var(--text);
  box-shadow: 0 1px 0 rgba(0,0,0,.15); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: box-shadow .15s, opacity .15s;
}
.ev:hover { box-shadow: 0 4px 14px -4px rgba(0,0,0,.45); z-index: 2; }
.ev.ghost { opacity: .5; border-left-style: dashed; cursor: pointer; background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.ev.late { --c: var(--danger); }
.ev.boss { background: color-mix(in srgb, var(--accent2) 30%, var(--surface)); }
.ev-t { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-m { color: var(--muted); font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.ev.short { display: flex; gap: 6px; align-items: center; padding-top: 1px; padding-bottom: 1px; }
.ev.short .ev-t { flex: 1; min-width: 0; }
.ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; touch-action: none; }
.ev-resize::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 18px; height: 3px; margin-left: -9px; border-radius: 3px; background: var(--c); opacity: 0; transition: opacity .15s; }
.ev:hover .ev-resize::after { opacity: .8; }
.ev.src { opacity: .3; }
.nowline { position: absolute; left: -1px; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.selbox { position: absolute; left: 3px; right: 3px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 26%, transparent); border: 2px solid var(--accent); pointer-events: none; z-index: 4; font-size: 11px; font-weight: 800; padding: 2px 6px; color: var(--text); }
.adchip, .mchip, .tchip {
  --c: var(--muted);
  flex: none; display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 6px; border-radius: 6px; min-width: 0;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.adchip span, .mchip span, .tchip span { overflow: hidden; text-overflow: ellipsis; }
.adchip i, .mchip i, .tchip i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.adchip.ghost, .mchip.ghost { opacity: .5; cursor: pointer; }
.adchip.late, .mchip.late { --c: var(--danger); }
.done-chip { font-size: 11px; font-weight: 800; color: var(--ok); padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--ok) 12%, transparent); text-align: left; }
.drop-hi { outline: 2px dashed var(--accent); outline-offset: -3px; background-color: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; padding: 7px 11px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 750; font-size: 13px; transform: translate(-50%, calc(-100% - 14px)); box-shadow: var(--shadow-lg); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

.month { display: flex; flex-direction: column; height: 100%; }
.mhead-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.mhead-row div { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 0; }
.mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); min-height: 0; }
.mcell { border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 4px; min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; cursor: pointer; transition: background .15s; }
.mcell:nth-child(7n+1) { border-left: 0; }
.mcell:nth-child(-n+7) { border-top: 0; }
.mcell:hover { background: var(--surface2); }
.mcell.other { opacity: .4; }
.mcell[data-heat="1"] { background: color-mix(in srgb, var(--ok) 5%, transparent); }
.mcell[data-heat="2"] { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.mcell[data-heat="3"] { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.mtop { display: flex; align-items: center; justify-content: space-between; }
.mnum { font-size: 12.5px; font-weight: 750; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.mnum:hover { background: var(--surface3); }
.mcell.today .mnum { background: var(--accent); color: var(--accent-ink); }
.mdone { font-size: 10.5px; font-weight: 800; color: var(--ok); }
.mmore { font-size: 11px; color: var(--muted); font-weight: 750; padding-left: 4px; }
.mdots { display: flex; flex-wrap: wrap; gap: 3px; padding: 2px 3px; }
.mdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.mdots i.ghost { opacity: .45; }
.mdots i.late { background: var(--danger); }
.mdots em { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 800; line-height: 6px; }
@media (max-width: 640px) {
  .mchip { font-size: 10px; padding: 1px 3px; gap: 3px; }
  .mchip i { display: none; }
  .mcell { padding: 2px; }
}

.tray { width: 250px; flex: none; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.tray-h { padding: 14px 14px 6px; }
.tray-h b { font-family: var(--display); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.tray-h small { color: var(--muted); font-size: 12px; font-weight: 600; display: block; margin-top: 2px; }
.tray-list { overflow-y: auto; padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tray-g { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 2px 4px; }
.tray-g.bad { color: var(--danger); }
.tchip { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface2); border-left: 3px solid var(--c); }
.tchip i { display: none; }
.tchip:hover { background: var(--surface3); }
.tchip.placing { outline: 2px solid var(--accent); }
.tray-empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }
@media (max-width: 899px) {
  .cal-wrap { flex-direction: column; gap: 8px; }
  .tray { width: auto; flex-direction: row; align-items: center; border-radius: 14px; }
  .tray-h { padding: 8px 4px 8px 12px; flex: none; }
  .tray-h b { font-size: 13px; }
  .tray-h small { display: none; }
  .tray-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; scrollbar-width: none; }
  .tray-list::-webkit-scrollbar { display: none; }
  .tray-g { display: none; }
  .tchip { flex: none; max-width: 180px; padding: 6px 9px; font-size: 12.5px; }
  .tray.closed { display: none; }
}
@media (min-width: 900px) { .tray.closed { display: none; } }
.placing-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: 13.5px; margin-bottom: 8px; animation: fade .2s; }
.placing-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placing-bar button { font-weight: 800; text-decoration: underline; }
.placing .daycol, .placing .mcell, .placing .ad-cell { cursor: copy; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { .ev.short .ev-m { display: none; } .ev { padding-left: 5px; padding-right: 4px; } }
