@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- design tokens (light theme) ---------- */
:root {
  --bg: #efebe5;
  --bg-grad: radial-gradient(1200px 700px at 70% -10%, #f8f3ec 0%, #efe9e1 45%, #e8e3dc 100%);
  --surface: #ffffff;
  --surface-2: #f6f4f0;
  --line: #e9e5df;
  --text: #16181b;
  --muted: #74777c;
  --faint: #a3a6aa;
  --accent: #5b4ff5;          /* SiltLoop */
  --accent-soft: #eeedff;
  --today: #e8833a;           /* today's practice */
  --today-soft: #fdf1e6;
  --good: #1f9d55; --good-soft: #e3f5ea;
  --bad: #e5484d;  --bad-soft: #fdecec;
  --sun: #f6d36b;             /* yellow stat card */
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 10px 30px rgba(20, 22, 26, .07);
  --shadow-lg: 0 2px 4px rgba(20, 22, 26, .05), 0 22px 50px rgba(20, 22, 26, .12);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  /* legacy names used by older modules */
  --panel: #ffffff; --panel-solid: #ffffff; --cyan: #5b4ff5; --warn: #e8833a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); background-image: var(--bg-grad); color: var(--text); font-family: var(--font); font-size: 13px; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, select { font-family: inherit; }

#app { position: relative; height: 100vh; }

/* ---------- top bar ---------- */
.topbar { position: absolute; top: 14px; left: 14px; right: 14px; height: 60px; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 0 10px 0 18px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); border-radius: 20px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; letter-spacing: -.4px; }
.mark { width: 26px; height: 26px; position: relative; }
.mark i { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--text); border-right-color: transparent; transform: rotate(-35deg); }
.mark b { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); right: 0; top: 2px; }
.nav { margin: 0 auto; display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.nav button { border: 0; background: transparent; color: #3b3e43; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.nav button:hover { color: var(--text); }
.nav button.on { background: var(--text); color: #fff; }
.nav button .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.right { display: flex; align-items: center; gap: 8px; }
.clock { text-align: right; line-height: 1.2; margin-right: 4px; }
.clock b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.clock div { color: var(--muted); font-size: 11.5px; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--text); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.round.light { background: var(--surface-2); color: var(--text); }
.pillsel { appearance: none; border: 0; background: var(--surface-2); border-radius: 999px; padding: 10px 14px; font-size: 12.5px; color: var(--text); cursor: pointer; }

/* segmented pill (like Private / Team) */
.seg { display: inline-flex; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg button { border: 0; background: transparent; color: #3b3e43; padding: 8px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--text); color: #fff; }

/* ---------- stage ---------- */
.stage { position: absolute; inset: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.on { display: block; }
.view-page { padding: 88px 14px 14px; overflow: auto; }
.twin-canvas { position: absolute; inset: 0; }
.twin-canvas canvas { display: block; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); z-index: 20; background: var(--bg); background-image: var(--bg-grad); }
.loading.done { display: none; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--text); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* twin overlays */
.modebar { position: absolute; top: 88px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 10px; }
.col { position: absolute; top: 88px; z-index: 5; display: flex; flex-direction: column; gap: 12px; width: 270px; }
.col.left { left: 14px; }
.col.right { right: 14px; width: 290px; }
.card { background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.2px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero .num { font-size: 76px; font-weight: 500; letter-spacing: -4px; line-height: .95; font-variant-numeric: tabular-nums; }
.hero .num small { font-size: 18px; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 4px; }
.hero .lbl { margin-top: 8px; color: #3b3e43; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sun { background: var(--sun); }
.sun .stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.sun .stats b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.sun .stats span { font-size: 11.5px; color: #4a4434; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.sim { background: #ece9ff; color: var(--accent); }
.tag.today { background: var(--today-soft); color: #b85d1c; }
.tag.after { background: var(--accent-soft); color: var(--accent); }
.tag.press { background: #eef2f6; color: #47607a; }
.tag.cat { color: #1d2a12; }
.rows { margin-top: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; padding-bottom: 2px; }
.row .k { color: #3b3e43; font-size: 12.5px; }
.row .v { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 7px; }
.row .v s { text-decoration: none; color: var(--faint); font-weight: 500; font-size: 12.5px; }
.delta { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.delta.good { background: var(--good-soft); color: var(--good); }
.delta.bad { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--surface-2); color: var(--muted); }
.caption { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 5; background: rgba(22, 24, 27, .86); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 13px; backdrop-filter: blur(10px); white-space: nowrap; max-width: calc(100% - 640px); overflow: hidden; text-overflow: ellipsis; }
.legend { position: absolute; left: 14px; bottom: 16px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; max-width: 280px; }
.legend span { background: rgba(255, 255, 255, .9); border-radius: 999px; padding: 5px 10px 5px 8px; font-size: 11px; color: #3b3e43; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow); }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.attrib { position: absolute; right: 16px; bottom: 8px; font-size: 10px; color: rgba(40, 42, 46, .6); z-index: 5; }

/* compare split */
.splitter { position: absolute; top: 0; bottom: 0; width: 0; z-index: 4; display: none; }
.splitter.on { display: block; }
.splitter .bar { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.splitter .knob { position: absolute; top: 50%; left: -20px; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: ew-resize; font-size: 13px; color: var(--text); pointer-events: auto; }
.splitter .side { position: absolute; top: 150px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #fff; box-shadow: var(--shadow); }
.splitter .side.l { right: 14px; color: #b85d1c; }
.splitter .side.r { left: 14px; color: var(--accent); }

/* labels in the 3D view */
.twin-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.twin-label { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.twin-label.rig { background: var(--accent); color: #fff; }
.twin-label.site { background: #fff; }
.twin-label.site::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--today); margin-right: 6px; }
.twin-label.poi { width: 20px; height: 20px; padding: 0; display: grid; place-items: center; font-weight: 700; font-size: 10px; color: #fff; }
.twin-label.poi-s { background: #2f6fde; }
.twin-label.poi-h { background: var(--bad); }
.twin-label.heap.burn { background: var(--bad); color: #fff; }
.twin-label.heap.flag { background: var(--accent); color: #fff; }
.twin-label.hub { background: var(--text); color: #fff; padding: 7px 12px; font-size: 11.5px; }
.twin-label.callout { border-radius: 12px; padding: 7px 10px; line-height: 1.35; border-left: 3px solid var(--accent); }
.twin-label.callout b { display: block; font-size: 11.5px; }
.twin-label.callout span { color: var(--muted); font-size: 10.5px; }
.twin-tip { position: absolute; display: none; z-index: 8; pointer-events: none; background: #fff; border-radius: 14px; padding: 10px 12px; font-size: 12px; line-height: 1.55; min-width: 190px; box-shadow: var(--shadow-lg); }
.twin-tip .muted { color: var(--muted); font-size: 11px; }
.twin-tip .bad { color: var(--bad); } .twin-tip .good { color: var(--good); }

.follow-card { position: absolute; z-index: 6; left: 50%; bottom: 64px; transform: translateX(-50%); display: none; gap: 16px; align-items: center; }
.follow-card.on { display: flex; }

@media (max-width: 1360px) {
  .nav button { padding: 8px 10px; font-size: 12px; }
  .col { width: 240px; } .col.right { width: 260px; }
  .hero .num { font-size: 62px; }
  .clock div { display: none; }
}

.row .k { flex: 1; min-width: 0; }
.row .v { white-space: nowrap; }


.twin-label.site.verified::before { background: var(--good); }
.twin-label.site.fixing::before { background: var(--accent); }
.twin-label.site.flagged::before { background: var(--bad); }
.twin-label.site b { font-weight: 600; }


.navhint { position: absolute; right: 14px; bottom: 26px; z-index: 5; background: rgba(255,255,255,.9); border-radius: 999px; padding: 6px 12px; font-size: 11.5px; color: #3b3e43; box-shadow: var(--shadow); }
.twin-canvas canvas { cursor: grab; }
.twin-canvas canvas:active { cursor: grabbing; }


.seg button { white-space: nowrap; }
.modebar { white-space: nowrap; }
@media (max-width: 1360px) { .modebar { gap: 6px; } .seg button { padding: 8px 11px; } }


.splitter .hit { position: absolute; top: 0; bottom: 0; left: -16px; width: 32px; cursor: ew-resize; touch-action: none; pointer-events: auto; }
.splitter .bar { pointer-events: auto; cursor: ew-resize; }
.splitter .knob { touch-action: none; z-index: 1; }
body.splitting, body.splitting * { cursor: ew-resize !important; user-select: none; }


.followsel { appearance: none; border: 0; background: transparent; color: #3b3e43; font: 500 12.5px var(--font); padding: 8px 26px 8px 15px; border-radius: 999px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #3b3e43 50%), linear-gradient(135deg, #3b3e43 50%, transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
