:root {
  --txt: #eef3f7;
  --mut: rgba(238, 243, 247, 0.62);
  --mut2: rgba(238, 243, 247, 0.38);
  --line: rgba(238, 243, 247, 0.14);
  --panel: rgba(12, 16, 22, 0.46);
  --panel-strong: rgba(10, 14, 19, 0.62);
  --accent: #7dd3fc;
  --up: #4ade80;
  --down: #fb7185;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  font-family: "PingFang SC", "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--txt);
  overflow: hidden;
}

/* ---------- sky background ---------- */
#sky {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(to bottom, #05070d, #05070d);
  transition: background 3s linear;
  overflow: hidden;
}
#stars {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 3s linear;
}
#stars span {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
}
#groundLine {
  position: absolute; left: 0; right: 0; top: 68%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.25), transparent);
}
#ground {
  position: absolute; left: 0; right: 0; top: 68%; bottom: 0;
  background: linear-gradient(to bottom, rgba(4,6,10,0.55), rgba(2,3,6,0.9));
}
/* sits above .wrap so the frosted-glass cards' backdrop-filter never blurs the sun/moon */
#skyFront {
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
}
.sky-path {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.sky-path path { fill: none; stroke-width: 1.4; }
.body-marker {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 2s linear, top 2s linear, opacity 1s linear;
  pointer-events: none;
}
#sunMarker {
  background: radial-gradient(circle, #fff9e6 0%, #ffd27a 45%, rgba(255,180,60,0) 75%);
  box-shadow: 0 0 26px 8px rgba(255, 200, 100, 0.5);
}
#moonMarker {
  background: #dfe6ee;
  box-shadow: 0 0 14px 4px rgba(220, 230, 245, 0.4);
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* ---------- layout ---------- */
.wrap {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 18px;
  height: 100vh;
  padding: 22px;
}
.col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 20px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
  font-weight: 700;
}

/* life calendar */
#lifeCard { text-align: center; padding: 24px 18px; }
#lifeDay {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent);
}
#lifeDay small { font-size: 15px; color: var(--mut); font-weight: 600; margin-left: 4px; }
#lifeSub { margin-top: 8px; font-size: 12px; color: var(--mut); }

/* ledger */
#ledgerCard { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ledger-balance { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.ledger-balance.neg { color: var(--down); }
.ledger-balance.pos { color: var(--up); }
.ledger-form { display: flex; gap: 6px; margin-bottom: 10px; }
.ledger-form input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-size: 12.5px;
  padding: 7px 8px;
  min-width: 0;
}
.ledger-form input[type="number"] { flex: 0 0 74px; }
.ledger-form input[type="text"] { flex: 1; }
.ledger-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto;
}
.ledger-toggle button {
  border: none; background: transparent; color: var(--mut);
  font-size: 12px; padding: 7px 9px; cursor: pointer;
}
.ledger-toggle button.active.income { background: rgba(74,222,128,0.22); color: var(--up); }
.ledger-toggle button.active.expense { background: rgba(251,113,133,0.22); color: var(--down); }
.ledger-add {
  border: none; border-radius: 8px; background: var(--accent); color: #05222b;
  font-weight: 700; font-size: 12px; padding: 7px 11px; cursor: pointer; flex: 0 0 auto;
}
.ledger-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ledger-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; padding: 6px 2px; border-bottom: 1px dashed var(--line);
}
.ledger-item .note { color: var(--txt); }
.ledger-item .cat { color: var(--mut2); font-size: 10.5px; margin-left: 6px; }
.ledger-item .amt.income { color: var(--up); font-weight: 700; }
.ledger-item .amt.expense { color: var(--down); font-weight: 700; }
.ledger-item .del {
  background: none; border: none; color: var(--mut2); cursor: pointer; font-size: 13px; margin-left: 8px;
}
.ledger-empty { color: var(--mut2); font-size: 12px; text-align: center; padding: 18px 0; }

/* project tray */
#trayCard { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tray-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.tray-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--txt);
  transition: background 0.15s;
}
.tray-item:hover { background: rgba(255,255,255,0.06); }
.tray-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.tray-name { font-size: 14px; font-weight: 600; }
.tray-tagline { font-size: 11.5px; color: var(--mut); margin-top: 1px; }
.tray-arrow { margin-left: auto; color: var(--mut2); font-size: 13px; }

/* work links */
#linksCard { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.links-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.link-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none; color: var(--txt);
}
.link-item:hover { background: rgba(255,255,255,0.06); }
.link-item .del {
  margin-left: auto; background: none; border: none; color: var(--mut2); cursor: pointer;
}
.link-placeholder {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--mut2);
  font-size: 12px;
  text-align: center;
}
.links-add {
  display: flex; gap: 6px; margin-top: 10px;
}
.links-add input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-size: 12px;
  padding: 7px 8px;
}
.links-add button {
  border: none; border-radius: 8px; background: var(--accent); color: #05222b;
  font-weight: 700; font-size: 12px; padding: 7px 11px; cursor: pointer;
}

/* geo indicator */
#geoTag {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 3;
  font-size: 10.5px; color: var(--mut2);
  letter-spacing: 0.04em;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

@media (max-width: 980px) {
  .wrap { grid-template-columns: 1fr; overflow-y: auto; height: auto; min-height: 100vh; }
  html, body { overflow: auto; }
}
