:root {
  --bg: #1b1c20;
  --panel: rgba(38, 40, 46, .72);
  --panel-solid: #26282e;
  --panel-2: rgba(52, 54, 61, .6);
  --line: rgba(236,238,241, .09);
  --line-2: rgba(236,238,241, .16);
  --text: #eceef1;
  --text-2: rgba(236,238,241, .66);
  --text-3: rgba(236,238,241, .40);
  --accent: #c9ccd2;
  --accent-2: #eef0f3;
  --accent-dim: rgba(201,204,210, .16);
  --danger: #c98e8e;
  --radius: 14px;
  --radius-sm: 9px;
  --hour: 56px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  font-family: "quador-display", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg) url("assets/bg.svg") center / cover fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea, [contenteditable] { user-select: text; }
::selection { background: var(--accent-dim); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(236,238,241,.12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: rgba(20, 21, 25, .62);
  backdrop-filter: blur(24px) saturate(1.2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  overflow-y: auto;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px; }
.brand-logo { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 4px 16px rgba(0,0,0,.5), 0 0 0 1px var(--line-2); }
.brand-name { font-weight: 750; font-size: 19px; letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  all: unset; display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav button:hover { background: rgba(236,238,241,.05); color: var(--text); }
.nav button.active { background: var(--accent-dim); color: var(--accent-2); }
.nav button svg { width: 18px; height: 18px; flex: none; }
.nav .kbd { margin-left: auto; font-size: 11px; color: var(--text-3); }

.side-section { border-top: 1px solid var(--line); padding-top: 14px; }
.side-title { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); margin: 0 6px 8px; display: flex; justify-content: space-between; align-items: center; }

.mini-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 6px; font-weight: 600; font-size: 13px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; font-size: 11.5px; }
.mini-grid .dow { color: var(--text-3); font-size: 10px; padding: 2px 0; }
.mini-grid .d { padding: 4px 0; border-radius: 50%; cursor: pointer; position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.mini-grid .d:hover { background: rgba(236,238,241,.07); }
.mini-grid .d.out { color: var(--text-3); }
.mini-grid .d.today { background: var(--accent); color: #1b1c20; font-weight: 700; }
.mini-grid .d.sel:not(.today) { box-shadow: inset 0 0 0 1px var(--accent); }
.mini-grid .d.has::after { content: ""; position: absolute; bottom: 2px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.mini-grid .d.today.has::after { background: #1b1c20; }

.cal-item { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.cal-item:hover { background: rgba(236,238,241,.05); }
.cal-item .sw { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--c); }
.cal-item.on .sw { background: var(--c); }

.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #7d838d); color: #1b1c20; display: grid; place-items: center; font-weight: 750; font-size: 13px; }
.side-foot .who { font-weight: 600; font-size: 13px; }
.side-foot .lvl { font-size: 11px; color: var(--text-3); }

/* ---------- Main ---------- */
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 20px 28px 14px; flex-wrap: wrap; }
.topbar h1 { font-size: 26px; font-weight: 750; margin: 0; letter-spacing: -.01em; }
.topbar .sub { color: var(--text-3); font-size: 13px; margin-top: 1px; }
.topbar .spacer { flex: 1; }
.content { flex: 1; overflow: auto; padding: 4px 28px 28px; }
.view-enter { animation: rise .32s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  all: unset; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 13px;
  background: rgba(236,238,241,.07); border: 1px solid var(--line-2); color: var(--text);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: rgba(236,238,241,.12); }
.btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #16171b; border-color: transparent;
  box-shadow: 0 4px 14px rgba(201,204,210,.28), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.primary:hover { box-shadow: 0 6px 20px rgba(201,204,210,.4), inset 0 1px 0 rgba(255,255,255,.4); filter: brightness(1.04); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(236,238,241,.07); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.icon { padding: 7px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.seg { display: inline-flex; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { all: unset; padding: 5px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: rgba(236,238,241,.13); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---------- Cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(18px); padding: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--text-3); }
.empty { text-align: center; padding: 28px 10px; color: var(--text-3); }
.empty img { width: 84px; opacity: .9; margin-bottom: 8px; }

/* ---------- Today ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px;
  background: linear-gradient(120deg, rgba(201,204,210,.14), rgba(38,40,46,.6) 55%), var(--panel);
  border: 1px solid var(--line-2); display: flex; align-items: center; gap: 28px;
}
.hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 260px; height: 260px; background: url("assets/star.svg") center / contain no-repeat; opacity: .32; pointer-events: none; }
.hero h2 { margin: 0; font-size: 28px; font-weight: 750; }
.hero p { margin: 6px 0 0; color: var(--text-2); max-width: 520px; }
.hero .quote { font-style: italic; color: var(--text-3); margin-top: 12px; font-size: 13px; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-size: 26px; font-weight: 750; display: block; line-height: 1; }
.ring .lbl span { font-size: 11px; color: var(--text-3); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 24px; font-weight: 750; margin-top: 2px; }
.stat .v small { font-size: 13px; color: var(--text-3); font-weight: 500; }

.check-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; transition: background .15s; }
.check-row:hover { background: rgba(236,238,241,.04); }
.check-row .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: color-mix(in srgb, var(--c) 18%, transparent); flex: none; }
.check-row .t { flex: 1; min-width: 0; }
.check-row .t b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-row .t span { font-size: 12px; color: var(--text-3); }
.check-row.done .t b { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--text-3); }

.tick {
  all: unset; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, var(--c, var(--accent)) 70%, transparent);
  display: grid; place-items: center; transition: background .15s, transform .15s;
}
.tick:hover { transform: scale(1.08); }
.tick svg { width: 14px; height: 14px; opacity: 0; color: #1b1c20; }
.tick.on { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.tick.on svg { opacity: 1; }
.tick.partial { background: conic-gradient(var(--c) calc(var(--p) * 1%), transparent 0); }
.tick.pop { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.25); } }
.count-pill { font-size: 11px; font-weight: 700; color: var(--text-2); min-width: 34px; text-align: right; }

.agenda-item { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item .bar { width: 4px; border-radius: 4px; background: var(--c); flex: none; }
.agenda-item .tm { width: 62px; font-size: 12px; color: var(--text-2); flex: none; padding-top: 1px; font-variant-numeric: tabular-nums; }
.agenda-item b { font-weight: 600; }
.agenda-item .n { font-size: 12px; color: var(--text-3); }

.routine-mini { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.18); margin-bottom: 8px; }
.prog { height: 6px; border-radius: 6px; background: rgba(236,238,241,.08); overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 6px; transition: width .4s; }

/* ---------- Habits ---------- */
.habit-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.habit-table th { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 0 4px 10px; text-align: center; }
.habit-table th:first-child { text-align: left; }
.habit-table th.today { color: var(--accent-2); }
.habit-table td { padding: 8px 4px; border-top: 1px solid var(--line); text-align: center; }
.habit-table td:first-child { text-align: left; }
.habit-table tr:hover td { background: rgba(236,238,241,.025); }
.habit-table tr.sel td { background: rgba(201,204,210,.06); }
.hname { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hname .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.hname b { font-weight: 600; display: block; }
.hname span { font-size: 11.5px; color: var(--text-3); }
.cell { all: unset; cursor: pointer; width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: rgba(236,238,241,.05); transition: transform .12s, background .15s; font-size: 11px; font-weight: 700; }
.cell:hover { transform: scale(1.1); background: rgba(236,238,241,.1); }
.cell.on { background: var(--c); color: #1b1c20; }
.cell.part { background: color-mix(in srgb, var(--c) 40%, transparent); }
.cell.off { opacity: .25; cursor: default; background: transparent; }
.cell.off:hover { transform: none; }
.cell svg { width: 14px; height: 14px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; }
.streak svg { width: 15px; height: 15px; color: var(--accent); }

.split { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: rgba(236,238,241,.06); }
.heat i.l1 { background: color-mix(in srgb, var(--c) 35%, transparent); }
.heat i.l2 { background: color-mix(in srgb, var(--c) 65%, transparent); }
.heat i.l3 { background: var(--c); }
.heat i.na { background: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { all: unset; cursor: pointer; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; background: rgba(236,238,241,.06); color: var(--text-2); border: 1px solid var(--line); }
.chip.on { background: var(--accent-dim); color: var(--accent-2); border-color: rgba(201,204,210,.4); }

/* ---------- Routines ---------- */
.routines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.routine-card { position: relative; overflow: hidden; }
.routine-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.routine-card .rh { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.routine-card .rh .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: color-mix(in srgb, var(--c) 20%, transparent); }
.routine-card .rh b { font-size: 16px; font-weight: 700; display: block; }
.routine-card .rh span { font-size: 12px; color: var(--text-3); }
.step { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 8px; }
.step .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: rgba(236,238,241,.07); color: var(--text-2); flex: none; }
.step.done .num { background: var(--c); color: #1b1c20; }
.step.done .st { color: var(--text-3); text-decoration: line-through; }
.step .st { flex: 1; cursor: pointer; }
.step .dur { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dayrow { display: flex; gap: 4px; margin-top: 12px; }
.dayrow span { flex: 1; text-align: center; font-size: 10.5px; font-weight: 700; padding: 3px 0; border-radius: 6px; background: rgba(236,238,241,.04); color: var(--text-3); }
.dayrow span.on { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); }

/* Player */
.player { position: fixed; inset: 0; z-index: 60; background: rgba(12,12,15,.82); backdrop-filter: blur(20px); display: grid; place-items: center; animation: fade .25s; }
.player-box { width: min(560px, 92vw); text-align: center; }
.player-box .rname { color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.player-box h2 { font-size: 34px; margin: 10px 0 4px; font-weight: 750; }
.timer { font-size: 72px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 18px 0; }
.player .orb { width: 220px; height: 220px; margin: 10px auto 0; position: relative; }
.player .orb img { position: absolute; inset: 30px; width: 160px; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12) rotate(8deg); } }
.player .ctrl { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.player .dots { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.player .dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(236,238,241,.15); }
.player .dots i.done { background: var(--c); }
.player .dots i.cur { background: var(--text); transform: scale(1.3); }

/* ---------- Week agenda ---------- */
.week-board { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 8px; }
.wcol { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 440px; display: flex; flex-direction: column; }
.wcol.today { border-color: rgba(201,204,210,.45); box-shadow: 0 0 0 1px rgba(201,204,210,.15), 0 10px 30px rgba(201,204,210,.07); }
.wcol .wh { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.wcol .wh .dn { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.wcol .wh .dd { font-size: 22px; font-weight: 750; }
.wcol.today .wh .dd { color: var(--accent-2); }
.wcol .wb { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.wcol .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: 6px 4px 0; }
.wev { padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--c) 16%, rgba(0,0,0,.2)); border-left: 3px solid var(--c); font-size: 12.5px; cursor: pointer; }
.wev:hover { filter: brightness(1.15); }
.wev b { font-weight: 600; display: block; }
.wev span { font-size: 11px; color: var(--text-2); }
.whab { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 4px; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.whab:hover { background: rgba(236,238,241,.05); }
.whab .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); flex: none; }
.whab.on .dot { background: var(--c); }
.whab.on { color: var(--text-3); text-decoration: line-through; }
.wadd { all: unset; cursor: pointer; text-align: center; color: var(--text-3); font-size: 12px; padding: 6px; border-radius: 8px; border: 1px dashed var(--line-2); margin-top: auto; }
.wadd:hover { color: var(--accent-2); border-color: var(--accent); }
.wday-bar { height: 3px; background: rgba(236,238,241,.07); }
.wday-bar i { display: block; height: 100%; background: var(--accent); }

.goal { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.goal .tick { width: 20px; height: 20px; }
.goal .tick svg { width: 11px; height: 11px; }
.goal span { flex: 1; }
.goal.done span { text-decoration: line-through; color: var(--text-3); }
.goal .x { opacity: 0; }
.goal:hover .x { opacity: 1; }
textarea.notes { width: 100%; min-height: 120px; resize: vertical; background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; line-height: 1.5; }
textarea.notes:focus { border-color: rgba(201,204,210,.5); }

/* ---------- Calendar ---------- */
.cal-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 28px 24px; }
.cal { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; backdrop-filter: blur(18px); }
.tg-head { display: grid; border-bottom: 1px solid var(--line); }
.tg-head .c { padding: 10px 8px 8px; text-align: center; border-left: 1px solid var(--line); cursor: pointer; }
.tg-head .c:first-child { border-left: 0; cursor: default; }
.tg-head .dn { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.tg-head .dd { font-size: 22px; font-weight: 700; display: inline-grid; place-items: center; min-width: 36px; height: 36px; border-radius: 50%; margin-top: 2px; }
.tg-head .c.today .dd { background: var(--accent); color: #1b1c20; }
.tg-allday { display: grid; border-bottom: 1px solid var(--line); min-height: 28px; }
.tg-allday > div { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.tg-allday > div:first-child { border-left: 0; font-size: 10px; color: var(--text-3); display: grid; place-items: center; }
.tg-body { flex: 1; overflow-y: auto; position: relative; }
.tg-grid { display: grid; position: relative; }
.tg-times { position: relative; }
.tg-times div { height: var(--hour); font-size: 10.5px; color: var(--text-3); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); cursor: crosshair; }
.tg-col.today { background-color: rgba(201,204,210,.035); }
.tg-col.wkend { background-color: rgba(0,0,0,.08); }
.ev {
  position: absolute; left: 2px; right: 3px; border-radius: 7px; padding: 4px 7px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 26%, #23252b); border-left: 3px solid var(--c);
  font-size: 12px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3); line-height: 1.3;
  transition: box-shadow .15s;
}
.ev:hover { box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 5; }
.ev b { font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { font-size: 11px; color: var(--text-2); }
.ev.routine { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, #23252b) 0 6px, color-mix(in srgb, var(--c) 22%, #23252b) 6px 12px); border-left-style: dashed; }
.ev.dragging { opacity: .85; box-shadow: 0 10px 30px rgba(0,0,0,.6); z-index: 10; cursor: grabbing; }
.ev.ghost { background: rgba(201,204,210,.25); border-left-color: var(--accent); pointer-events: none; }
.ev .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
.chipev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 30%, transparent); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 6; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

.month { flex: 1; display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.month-dows { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.month-dows div { padding: 9px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; text-align: right; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; min-height: 0; }
.mcell { border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 5px 6px; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; cursor: pointer; }
.mcell:nth-child(7n+1) { border-left: 0; }
.mcell:nth-child(-n+7) { border-top: 0; }
.mcell:hover { background: rgba(236,238,241,.025); }
.mcell.out { opacity: .4; }
.mcell .mn { align-self: flex-end; font-size: 13px; font-weight: 650; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.mcell.today .mn { background: var(--accent); color: #1b1c20; }
.mcell .more { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.mcell .mdots { display: flex; gap: 3px; padding: 0 4px; margin-top: auto; }
.mcell .mdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }

/* ---------- Insights ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 4px 4px 2px 2px; min-height: 2px; position: relative; opacity: .85; transition: opacity .15s; }
.bars .b:hover { opacity: 1; }
.bars .b.zero { background: rgba(236,238,241,.08); }
.bars .b:hover::after { content: attr(data-t); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; background: #0e0f12; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); z-index: 3; }
.bar-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-top: 6px; }
.rate-row { display: grid; grid-template-columns: 180px 1fr 48px; gap: 12px; align-items: center; padding: 7px 0; }
.rate-row .prog { height: 8px; }
.dow-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 130px; }
.dow-chart div { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--text-3); }
.dow-chart div i { width: 100%; border-radius: 6px; background: rgba(141,155,171,.75); }
.badge-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 14px 8px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--line); }
.badge .bi { font-size: 28px; filter: grayscale(1) opacity(.35); }
.badge.got .bi { filter: none; }
.badge.got { border-color: rgba(201,204,210,.35); background: rgba(201,204,210,.07); }
.badge b { display: block; font-size: 12.5px; margin-top: 4px; }
.badge span { font-size: 11px; color: var(--text-3); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,8,10,.55); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 94vw); max-height: 88vh; overflow: auto; background: #25272d; border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); animation: pop-in .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop-in { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-h h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.modal-b { padding: 10px 20px 4px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; gap: 8px; padding: 16px 20px 18px; justify-content: flex-end; }
.modal-f .left { margin-right: auto; }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.inp { width: 100%; background: rgba(0,0,0,.25); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,204,210,.15); }
.inp.big { font-size: 17px; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { all: unset; cursor: pointer; width: 28px; height: 28px; border: 1px solid rgba(0,0,0,.35); border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; }
.swatches button.on { box-shadow: 0 0 0 2px #25272d, 0 0 0 4px var(--c); }
.icons { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.icons button { all: unset; cursor: pointer; text-align: center; font-size: 18px; padding: 5px 0; border-radius: 8px; }
.icons button:hover { background: rgba(236,238,241,.07); }
.icons button.on { background: var(--accent-dim); box-shadow: inset 0 0 0 1px var(--accent); }
.days { display: flex; gap: 5px; }
.days button { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 7px 0; border-radius: 8px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.22); border: 1px solid var(--line); color: var(--text-3); }
.days button.on { background: var(--accent-dim); color: var(--accent-2); border-color: rgba(201,204,210,.45); }
.steps-edit .se { display: grid; grid-template-columns: 18px 1fr 74px 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.steps-edit .se .grip { color: var(--text-3); cursor: grab; text-align: center; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.toggle i { width: 36px; height: 20px; border-radius: 20px; background: rgba(236,238,241,.15); position: relative; transition: background .2s; flex: none; }
.toggle i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(16px); background: #1b1c20; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80;
  background: #eceef1; color: #1b1c20; padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: all .25s; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; pointer-events: none; z-index: 90; width: 8px; height: 8px; border-radius: 2px; animation: conf 1s ease-out forwards; }
@keyframes conf { to { transform: translate(var(--x), var(--y)) rotate(540deg); opacity: 0; } }

.settings-list .srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.settings-list .srow:last-child { border-bottom: 0; }
.settings-list .srow b { font-weight: 600; display: block; }
.settings-list .srow span { font-size: 12px; color: var(--text-3); }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Icon art ---------- */
img.hicon { width: 1.35em; height: 1.35em; vertical-align: -0.35em; border-radius: 24%; }
.ico:has(img.hicon) { background: none; padding: 0; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent), 0 4px 12px rgba(0,0,0,.4); border-radius: 26%; overflow: hidden; }
.ico img.hicon { width: 100%; height: 100%; border-radius: 0; vertical-align: top; display: block; }
.routine-mini > div:first-child img.hicon { width: 36px; height: 36px; }
.icons button img.hicon { width: 30px; height: 30px; vertical-align: middle; }
.icons { grid-template-columns: repeat(10, 1fr); }
.player .rname img.hicon { width: 1.8em; height: 1.8em; vertical-align: middle; margin-right: 4px; }

/* ---------- Hold to complete ---------- */
.tick, .cell, .whab .dot, .step .num { position: relative; }
.step[data-hold], .whab[data-hold] { cursor: pointer; }
.holding {
  z-index: 20;
  transform: translateX(var(--hx, 0px)) scale(var(--hs, 1)) !important;
  transition: none !important;
  box-shadow: 0 0 calc(var(--hg, 0) * 28px) calc(var(--hg, 0) * 4px) color-mix(in srgb, var(--c, #eceef1) 55%, transparent);
}
.hold-cancel { transform: scale(1) !important; transition: transform .42s cubic-bezier(.34, 1.4, .64, 1), box-shadow .42s ease !important; }
.hold-complete {
  z-index: 20;
  transform: scale(1) !important;
  transition: transform .36s cubic-bezier(.34, 1.56, .64, 1), box-shadow .36s ease !important;
  box-shadow: 0 0 0 0 transparent;
}
.hold-ring { position: absolute; inset: -5px; pointer-events: none; border-radius: 50%; animation: ringIn .2s ease-out; }
.cell .hold-ring { border-radius: 12px; }
.hold-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.hold-ring circle { fill: none; }
.hold-ring .trk { stroke: color-mix(in srgb, var(--c, #eceef1) 22%, transparent); stroke-width: 3; }
.hold-ring .arc { stroke: var(--c, #eceef1); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 3px var(--c, #eceef1)); }
.hold-ring .fill { fill: var(--c, #eceef1); opacity: .15; }
.hold-ring.out { animation: ringOut .4s ease forwards; }
.hold-complete .hold-ring { animation: ringFlash .36s ease-out forwards; }
@keyframes ringIn { from { opacity: 0; transform: scale(.7); } }
@keyframes ringOut { to { opacity: 0; transform: scale(.85); } }
@keyframes ringFlash { 0% { filter: brightness(1.6); } 100% { opacity: 0; transform: scale(1.5); } }

.just-done { animation: jdPop .6s cubic-bezier(.34, 1.56, .64, 1); }
.just-done::after {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--c, #eceef1); animation: jdRipple .8s ease-out forwards;
}
.just-done svg { animation: jdDraw .5s .08s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes jdPop { 0% { transform: scale(.82); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes jdRipple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }
@keyframes jdDraw { from { opacity: 0; transform: scale(.3) rotate(-25deg); } }
.spark { position: fixed; z-index: 90; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 6px currentColor; animation: spark .65s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes spark { to { transform: translate(var(--x), var(--y)) scale(.2); opacity: 0; } }

/* ---------- Temple ---------- */
.temple-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 0 28px 22px; }
.temple-head { text-align: center; max-width: 560px; }
.temple-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); }
.temple-head h2 { font-size: 34px; margin: 6px 0 4px; font-weight: 700; letter-spacing: -.01em; }
.temple-head p { margin: 0; color: var(--text-2); font-style: italic; }
.temple-stage { flex: 1; min-height: 0; width: 100%; position: relative; }
.temple-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; display: block; }
.temple-canvas.grab { cursor: grabbing; }
.temple-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.temple-count { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.temple-steps { display: flex; gap: 5px; }
.temple-steps span { width: 22px; height: 5px; border-radius: 5px; background: rgba(236,238,241,.1); transition: background .3s; }
.temple-steps span.on { background: var(--accent-2); }
.temple-steps span.next { background: rgba(236,238,241,.28); animation: nextPulse 1.8s ease-in-out infinite; }
@keyframes nextPulse { 50% { background: rgba(236,238,241,.5); } }
.temple-card { cursor: pointer; transition: border-color .2s; }
.temple-card:hover { border-color: var(--line-2); }
.temple-card .temple-steps span { flex: 1; width: auto; }
/* The 3D canvas fills the whole area behind the title and counter and fades out at its
   edges, so a zoomed-in slab never ends in a hard horizontal cut. */
.temple-wrap { position: relative; justify-content: space-between; padding: 0 28px 22px; }
.temple-wrap .temple-stage { position: absolute; inset: 0; flex: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 86%, transparent 100%); }
.temple-head, .temple-foot { position: relative; z-index: 1; pointer-events: none; }

/* ---------- XP ---------- */
.xp-bar { width: min(460px, 80vw); display: grid; gap: 6px; margin-bottom: 6px; pointer-events: auto; }
.xp-row { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.xp-row b { font-size: 15px; }
.xp-row.muted { font-size: 12px; }
.xp-track { height: 10px; border-radius: 10px; background: rgba(236,238,241,.1); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.xp-track i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, #9ea4ad, var(--accent-2)); box-shadow: 0 0 12px rgba(238,240,243,.35); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.xp-track.mini { height: 4px; margin-top: 4px; box-shadow: none; }
.xp-track.mini i { box-shadow: none; }
.xp-pop { position: fixed; z-index: 95; transform: translate(-50%, -50%); pointer-events: none; font-weight: 700; font-size: 18px; color: var(--accent-2);
  text-shadow: 0 0 12px rgba(238,240,243,.6), 0 2px 6px rgba(0,0,0,.6); animation: xpRise 1.25s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes xpRise { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.temple-foot { background: rgba(22, 23, 27, .6); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; padding: 14px 22px 12px; }

/* ---------- Trophies ---------- */
.ach-summary { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ach-shelf { display: flex; gap: 0; min-height: 56px; align-items: center; }
.ach-shelf img { width: 56px; height: 56px; margin-left: -10px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.ach-shelf img:first-child { margin-left: 0; }
.ach-group { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: 6px 0 10px; font-weight: 600; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ach { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.ach.on { border-color: var(--line-2); }
.ach.on:hover { transform: translateY(-2px); }
.ach-img { position: relative; width: 76px; height: 76px; flex: none; }
.ach-img img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }
.ach:not(.on) .ach-img img { filter: grayscale(1) brightness(.55) contrast(.9); opacity: .55; }
.ach-img .lock { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-solid); border: 1px solid var(--line-2); color: var(--text-2); }
.ach-img .lock svg { width: 13px; height: 13px; }
.ach-meta { min-width: 0; display: grid; gap: 2px; flex: 1; }
.ach-meta b { font-size: 15px; }
.ach-meta span { font-size: 12.5px; color: var(--text-2); }
.ach-meta em { font-style: normal; font-size: 12px; color: var(--accent-2); margin-top: 4px; }
.ach:not(.on) .ach-meta b { color: var(--text-2); }
.ach-prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ach-prog .xp-track { flex: 1; margin: 0; }
.ach-prog small { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ach-unlock { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(8,8,10,.55); backdrop-filter: blur(6px); animation: fade .25s; cursor: pointer; }
.ach-unlock.out { animation: fade .35s reverse forwards; }
.ach-unlock-card { text-align: center; padding: 26px 40px 30px; animation: pop-in .5s cubic-bezier(.34,1.56,.64,1); }
.ach-unlock-k { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-2); }
.ach-unlock-card img { width: 200px; height: 200px; margin: 14px auto 6px; display: block; filter: drop-shadow(0 14px 30px rgba(0,0,0,.6)); animation: trophySpin .9s cubic-bezier(.2,.8,.2,1); }
.ach-unlock-card h3 { font-size: 30px; margin: 6px 0 2px; }
.ach-unlock-card p { margin: 0; color: var(--text-2); }
@keyframes trophySpin { from { transform: scale(.4) rotateY(180deg); opacity: 0; } to { transform: none; opacity: 1; } }
.temple-mini { position: relative; height: 210px; margin: -4px -8px 10px; border-radius: 12px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 85%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 85%, transparent 100%); }
.temple-card { cursor: default; }

/* ---------- Calendar of Life ---------- */
:root { --past: #c9473f; --ahead: #2f9e4a; }
.life-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.life-big { font-size: 40px; font-weight: 700; line-height: 1; }
.life-big small { font-size: 15px; color: var(--text-2); font-weight: 400; }
.life-side { min-width: 220px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); text-align: right; }
.life-year { display: grid; grid-template-columns: 30px repeat(13, 1fr); gap: 6px; align-items: center; }
.life-years { display: grid; grid-template-columns: 34px repeat(10, 1fr); gap: 6px; align-items: center; }
.life-lbl { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lsq { display: grid; place-items: center; aspect-ratio: 1; border-radius: 5px; transition: transform .15s; }
.lsq:hover { transform: scale(1.12); }
.lsq.past { background: var(--past); }
.lsq.ahead { background: var(--ahead); }
.lsq.now { background: transparent; box-shadow: inset 0 0 0 2px var(--text); animation: lifeNow 1.8s ease-in-out infinite; }
.lsq.none { visibility: hidden; }
.lsq b { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.75); }
.lsq.now b { color: var(--text); }
@keyframes lifeNow { 50% { box-shadow: inset 0 0 0 2px var(--text), 0 0 14px rgba(236,238,241,.45); } }
.life-legend { display: flex; gap: 18px; margin-top: 16px; font-size: 12.5px; color: var(--text-2); }
.life-legend span { display: flex; align-items: center; gap: 7px; }
.life-legend .lsq { width: 14px; animation: none; border-radius: 4px; }
.life-edit { font-size: 12.5px; margin-top: 12px; }
.life-edit a { color: var(--text-2); }
.life-setup p { color: var(--text-2); margin: 0 0 14px; }
.life-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.life-form label { display: grid; gap: 6px; font-size: 12px; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .lsq.now { animation: none; } }
.life-years { grid-template-columns: 34px repeat(10, minmax(0, 52px)); justify-content: start; }

/* ---------- Today top row: hero + temple + life ---------- */
.today-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.today-top .hero { padding: 22px 24px; gap: 20px; }
.today-top .hero::after { width: 190px; height: 190px; right: -40px; top: -40px; }
.today-top .hero h2 { font-size: 24px; }
.today-top .ring { width: 96px; height: 96px; }
.today-top .card { padding: 14px 16px; display: flex; flex-direction: column; min-height: 190px; }
.mini-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.mini-h b { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 13px; }
.mini-f { font-size: 12px; color: var(--text-2); margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-top .temple-mini { flex: 1; height: auto; min-height: 120px; margin: 0 -10px; }
.life-mini { cursor: pointer; gap: 6px; transition: border-color .2s; }
.life-mini:hover { border-color: var(--line-2); }
.lm-cap { font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.lm-grid { display: grid; gap: 2px; }
.lm-grid i { aspect-ratio: 1; border-radius: 2px; }
.lm-grid i.past { background: var(--past); }
.lm-grid i.ahead { background: var(--ahead); }
.lm-grid i.now { background: var(--text); box-shadow: 0 0 6px rgba(236,238,241,.7); }
@media (max-width: 1250px) { .today-top { grid-template-columns: 1fr 1fr; } .today-top .hero { grid-column: 1 / -1; } }
.hero .quote { cursor: pointer; transition: color .2s; }
.hero .quote:hover { color: var(--text-2); }
.hero .quote.swap { animation: quoteSwap .32s ease; }
@keyframes quoteSwap { 50% { opacity: 0; transform: translateY(-4px); } }

/* ---------- Drifting clouds ----------
   The static base keeps the glows; two tileable stain layers slide sideways at different
   speeds (transform only, so it stays on the GPU) for a slow parallax drift. */
body { background: radial-gradient(45% 45% at 18% 8%, rgba(201,204,210,.13), transparent), radial-gradient(40% 40% at 88% 96%, rgba(141,155,171,.08), transparent), var(--bg); position: relative; }
body::before, body::after {
  content: ""; position: fixed; top: 0; left: 0; height: 100vh; width: calc(100vw + 1600px);
  background-repeat: repeat; pointer-events: none; z-index: 0; will-change: transform;
}
body::before {
  background-image: url("assets/clouds.svg"); background-size: 1600px 1000px;
  animation: cloudDrift 240s linear infinite;
}
body::after { background-image: url("assets/clouds2.svg"); background-size: 1600px 1000px; opacity: .55; animation: cloudDrift 150s linear infinite reverse; }
@keyframes cloudDrift { from { transform: translateX(0); } to { transform: translateX(-1600px); } }
.app { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }

/* ---------- Goals ---------- */
.goals-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 16px; align-items: start; }
.goal-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.goal-col { display: grid; gap: 10px; }
.goal-col-h { display: flex; align-items: baseline; gap: 10px; }
.goal-col-h h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.goal-col-h .muted { font-size: 12px; flex: 1; }
.goal-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, transform .2s; }
.goal-card:hover { transform: translateY(-1px); border-color: var(--line-2); }
.goal-card.sel { border-color: var(--text-2); box-shadow: 0 0 0 1px var(--text-2); }
.goal-card.done { opacity: .7; }
.goal-img { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex: none; background: rgba(0,0,0,.25); box-shadow: 0 0 0 1px var(--line-2), 0 4px 12px rgba(0,0,0,.35); }
.goal-img.ph { display: grid; place-items: center; color: var(--text-3); }
.goal-img.ph svg { width: 26px; height: 26px; }
.goal-img.big { width: 128px; height: 128px; border-radius: 22px; }
.goal-img.big.ph svg { width: 48px; height: 48px; }
.gc-meta { min-width: 0; flex: 1; display: grid; gap: 3px; }
.gc-meta b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-meta span { font-size: 12px; color: var(--text-2); }
.gc-meta span.late { color: var(--danger); }
.gc-meta .xp-track { margin-top: 4px; }
.goal-empty { padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-3); font-size: 13px; text-align: center; }
.goal-detail { position: sticky; top: 0; display: grid; gap: 16px; }
.gd-top { display: flex; gap: 18px; align-items: center; }
.gd-imgwrap { position: relative; border-radius: 22px; flex: none; }
.gd-imgwrap .gd-drop { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(10,10,12,.65); border: 2px dashed var(--text-2); opacity: 0; transition: opacity .2s; pointer-events: none; }
.gd-imgwrap.over .gd-drop, .gd-imgwrap:hover .gd-drop { opacity: 1; }
.gd-head { min-width: 0; display: grid; gap: 6px; }
.gd-head h2 { margin: 0; font-size: 24px; line-height: 1.15; text-wrap: balance; }
.gd-when { font-size: 13px; color: var(--text-2); }
.gd-time { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.gd-desc { white-space: pre-wrap; line-height: 1.55; color: var(--text); font-size: 14.5px; }
.gd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gd-achieve { gap: 10px; }
.gd-achieve .tick { width: 22px; height: 22px; border-color: rgba(22,23,27,.5); }
.gd-achieve .tick svg { opacity: .35; color: #16171b; }
.gd-notes h3 { margin-bottom: 8px; }
.gd-note-btn { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 12px; font-size: 11.5px; }
.gd-note { border-left: 2px solid var(--line-2); padding: 4px 0 10px 12px; }
.gd-note-h { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-3); }
.gd-note-h .btn { opacity: 0; }
.gd-note:hover .gd-note-h .btn { opacity: 1; }
.gd-note p { margin: 2px 0 0; white-space: pre-wrap; font-size: 14px; }
.goal-form { display: grid; grid-template-columns: 160px 1fr; gap: 16px; }
.goal-drop { width: 160px; height: 160px; border-radius: 22px; border: 2px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; background: rgba(0,0,0,.2); transition: border-color .2s, background .2s; }
.goal-drop:hover, .goal-drop.over { border-color: var(--text-2); background: rgba(236,238,241,.05); }
.goal-drop #goalImgPrev { display: grid; place-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--text-3); padding: 10px; width: 100%; height: 100%; }
.goal-drop #goalImgPrev svg { width: 30px; height: 30px; }
.goal-drop img { width: 100%; height: 100%; object-fit: cover; }
#goalImgRm { margin-top: 6px; }
@media (max-width: 1250px) { .goals-layout { grid-template-columns: 1fr; } .goal-detail { position: static; } }
@media (max-width: 900px) { .goal-lists { grid-template-columns: 1fr; } }

/* ---------- Clock ---------- */
.topbar { position: relative; }
.topbar-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -38%); }
.today-clock { display: flex; align-items: center; gap: 14px; padding: 6px 18px 6px 6px; border-radius: 40px; background: rgba(22,23,27,.5); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.clock-logo { all: unset; cursor: pointer; width: 48px; height: 48px; border-radius: 50%; transition: transform .25s cubic-bezier(.34,1.56,.64,1), filter .2s; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.clock-logo img { width: 100%; height: 100%; display: block; }
.clock-logo:hover { transform: rotate(-12deg) scale(1.08); }
.clock-logo:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.tc-time { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tc-time small, .cn-time small { font-size: .45em; color: var(--text-2); margin-left: 3px; letter-spacing: .06em; }
.topbar-center:has(.pw-face) { transform: translate(-50%, -48%); }
.pw-face { all: unset; cursor: pointer; display: block; width: 80px; transition: transform .3s cubic-bezier(.34,1.56,.64,1); filter: drop-shadow(0 6px 14px rgba(0,0,0,.55)); }
.pw-face svg { display: block; width: 100%; }
.pw-face:hover { transform: rotate(-6deg) scale(1.05); }
.pw-face:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 50%; }
.tc-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
@media (max-width: 1200px) { .topbar-center { position: static; transform: none; order: 3; width: 100%; display: flex; justify-content: center; } }

.clock-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 16px; align-items: start; }
.clock-main { display: grid; gap: 14px; }
.clock-now { text-align: center; padding: 26px; }
.cn-time { font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cn-sub { color: var(--text-2); margin-top: 8px; font-size: 14px; }
.clock-now .pw-face { width: 120px; margin: 0 auto; }
.clock-tabs { justify-self: center; }
.clock-tabs button { padding: 7px 22px; }
.clock-list { display: grid; gap: 8px; }
.alarm-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--line); }
.alarm-row.off { opacity: .5; }
.ar-time { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 130px; }
.ar-time small { font-size: .5em; color: var(--text-2); }
.ar-meta { flex: 1; display: grid; }
.ar-meta span { font-size: 12px; color: var(--text-2); }
.alarm-time-inp { font-size: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.timer-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.timer-new { display: grid; grid-template-columns: 1fr 64px 70px 70px auto; gap: 8px; margin-bottom: 14px; }
.timer-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s; }
.timer-row.sel { border-color: var(--text-2); }
.timer-row.done .tr-left { color: var(--danger); }
.tr-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tr-main b { font-size: 13px; color: var(--text-2); font-weight: 600; }
.tr-left { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tr-ctl { display: flex; gap: 4px; }
.sw-read { font-size: 72px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .02em; padding: 10px 0 6px; }
.sw-ctl { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.lap-row { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: 14px; }
.sand-card { position: sticky; top: 0; padding: 10px 18px 20px; text-align: center; overflow: hidden;
  background: radial-gradient(60% 50% at 50% 45%, rgba(255,230,190,.06), transparent), var(--panel); }
.sand-stage { position: relative; height: 430px; }
.sand-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.sand-cap { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); }
.sand-read { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.ringer { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; background: rgba(8,8,10,.7); backdrop-filter: blur(10px); animation: fade .25s; }
.ringer-card { text-align: center; padding: 30px 46px; animation: pop-in .45s cubic-bezier(.34,1.56,.64,1); }
.ringer-card img { width: 150px; height: 150px; animation: ringShake 1.5s ease-in-out infinite; filter: drop-shadow(0 12px 28px rgba(0,0,0,.6)); }
.ringer-k { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-2); margin-top: 10px; }
.ringer-card h2 { font-size: 34px; margin: 6px 0 4px; }
.ringer-card p { color: var(--text-2); margin: 0 0 20px; }
.ringer-btns { display: flex; gap: 10px; justify-content: center; }
@keyframes ringShake { 0%, 50%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(-10deg); } 10%, 20%, 30% { transform: rotate(10deg); } }
@media (max-width: 1100px) { .clock-layout { grid-template-columns: 1fr; } .sand-card { position: static; } }
@media (prefers-reduced-motion: reduce) { .ringer-card img { animation: none; } }

/* ---------- World clocks ---------- */
.clock-layout.solo { grid-template-columns: minmax(0, 860px); justify-content: center; }
.world-add { display: flex; gap: 8px; margin-bottom: 12px; }
.world-add .inp { flex: 1; }
.world-compare { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.world-compare input { flex: 1; accent-color: var(--accent-2); }
.world-compare output { min-width: 170px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.world-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--line); }
.world-row.pinned { border-color: var(--text-2); }
.wr-sky { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .3s; }
.wr-sky svg { width: 18px; height: 18px; }
.wr-sky.day { background: rgba(236,238,241,.14); color: var(--text); }
.wr-sky.night { background: rgba(10,12,20,.6); color: #9fb2cc; box-shadow: inset 0 0 0 1px var(--line); }
.wr-meta { flex: 1; min-width: 0; display: grid; }
.wr-meta b { font-size: 16px; }
.wr-meta span { font-size: 12px; color: var(--text-3); }
.wr-time { text-align: right; }
.wr-time div { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wr-time small { font-size: .5em; color: var(--text-2); margin-left: 2px; }
.wr-time span { font-size: 12px; color: var(--text-2); }
.world-row .btn.on { color: var(--text); background: rgba(236,238,241,.1); }
.tc-2 { padding-left: 14px; margin-left: 2px; border-left: 1px solid var(--line-2); cursor: pointer; }
.tc2-time { font-size: 18px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tc2-time small { font-size: .5em; color: var(--text-2); margin-left: 2px; }

/* ---------- Globe ---------- */
.globe-card { margin: -4px -4px 16px; border-radius: 14px; overflow: hidden; background: radial-gradient(55% 60% at 50% 45%, rgba(159,178,204,.10), transparent 70%); }
.globe-stage { position: relative; height: 420px; }
.globe-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; }
.globe-canvas.grab, .sand-canvas.grab { cursor: grabbing; }
.sand-canvas { cursor: grab; }
.globe-tip { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .15s; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px; background: rgba(14,15,18,.85); border: 1px solid var(--line-2); white-space: nowrap; }
.globe-pick { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(0,0,0,.18); min-height: 64px; font-size: 13px; }
.gp-where { flex: 1; min-width: 0; display: grid; }
.gp-where b { font-size: 17px; }
.gp-where span { font-size: 12px; color: var(--text-2); }
.gp-time { text-align: right; }
.gp-time div { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.gp-time small { font-size: .5em; color: var(--text-2); }
.gp-time span { font-size: 12px; color: var(--text-2); }

/* ---------- Pocket watch ---------- */
.watch-card { margin: -4px -4px 0; padding-bottom: 14px; border-radius: 14px; overflow: hidden; text-align: center;
  background: radial-gradient(50% 55% at 50% 42%, rgba(217,173,85,.12), transparent 70%); }
.watch-stage { position: relative; height: 480px; }
.watch-read { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.watch-read small { font-size: .5em; color: var(--text-2); margin-left: 2px; }
