@font-face {
  font-family: "YESIF Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f1f6fd;
  --paper: #ffffff;
  --ink: #0b1a47;
  --ink-2: #4f5a7a;
  --ink-3: #5d6886;
  --line: rgb(11 26 71 / 0.1);
  --line-strong: rgb(11 26 71 / 0.18);
  --navy: #001a5a;
  --ice: #c0e5ff;
  --blue: #2b2bff;
  --purple: #7e22ce;
  --warn: #a14d00;
  --err: #c81e3a;
  --soft: #e6eefb;
  --still: #eef2f9;
  --rim: #7d88a6;
  --r: 20px;
  --sans: "YESIF Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 18px 50px rgb(0 26 90 / 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -10%, rgb(192 229 255 / 0.7), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--navy); color: var(--ice);
  padding: 8px 12px; border-radius: 10px; z-index: 20;
}
.skip:focus { top: 12px; }

.top {
  display: flex; align-items: center; gap: 18px; padding: 14px 22px;
  position: sticky; top: 0; z-index: 5;
  background: rgb(241 246 253 / 0.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; }
.brand svg { width: 28px; height: 28px; }
.brand strong { font-weight: 650; letter-spacing: -0.03em; }
.brand span { display: block; color: var(--ink-3); font-size: 12px; }
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a, .nav button {
  border: 0; background: transparent; color: var(--ink-2); text-decoration: none;
  border-radius: 999px; padding: 8px 12px; font-size: 14px;
}
.nav a[aria-current="page"], .nav a:hover, .nav button:hover { background: white; color: var(--ink); }
.sync { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--blue); }
.dot.off { background: var(--warn); }
.who { font-size: 13px; color: var(--ink-2); }

.stage { position: relative; min-height: calc(100vh - 74px); }
.constellation { position: relative; height: min(760px, calc(100vh - 110px)); margin: 8px auto; max-width: 1100px; }
.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.links path { fill: none; stroke: rgb(11 26 71 / 0.16); stroke-width: 1.2; }
.links path.fresh { stroke: var(--blue); stroke-dasharray: 5 8; animation: flow 1.4s linear infinite; }
.node, .heart {
  position: absolute; transform: translate(-50%, -50%);
  border: 0; background: white; border-radius: 22px;
  box-shadow: var(--shadow); text-align: left;
}
.heart {
  width: 148px; height: 148px; border-radius: 40px; display: grid; place-items: center;
  background: var(--navy); color: var(--ice); padding: 0;
}
.heart .beat { animation: lubdub 909ms ease-in-out infinite; display: grid; place-items: center; gap: 6px; }
.heart svg { width: 46px; height: 46px; }
.heart small { font-size: 12px; letter-spacing: 0.01em; }
.node { width: 196px; padding: 12px 12px 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.node i {
  width: 10px; height: 10px; border-radius: 99px; margin-top: 5px; flex: none; background: var(--rim);
  box-shadow: 0 0 0 4px var(--still);
}
.node.running i { background: var(--blue); box-shadow: 0 0 0 4px rgb(43 43 255 / 0.15); animation: pulse 1.6s ease-in-out infinite; }
.node.finished i { background: var(--blue); box-shadow: none; }
.node.error i { background: var(--err); box-shadow: 0 0 0 4px rgb(200 30 58 / 0.12); }
.node.paused i { background: var(--rim); }
.node b { display: block; font-size: 14px; letter-spacing: -0.02em; }
.node em { display: block; margin-top: 3px; font-style: normal; color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.node .meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.group-label {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}

.sheet, .chat {
  position: fixed; inset: 0; background: rgb(241 246 253 / 0.72); z-index: 8;
  display: flex; justify-content: center; padding: 28px 16px;
}
.panel {
  width: min(920px, 100%); background: white; border-radius: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: calc(100vh - 56px); overflow: hidden;
}
.panel header, .chat-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.panel header h1, .chat-head h1 { font-size: 20px; margin: 0; letter-spacing: -0.03em; font-weight: 620; }
.ghost { margin-left: auto; border: 0; background: var(--soft); border-radius: 999px; padding: 8px 12px; }
.timeline { overflow: auto; padding: 8px 18px 22px; }
.timeline article { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 12px 0; }
.timeline article span.mark { width: 10px; height: 10px; border-radius: 99px; background: var(--blue); margin-top: 6px; }
.timeline h2 { margin: 0; font-size: 15px; font-weight: 620; }
.timeline p { margin: 4px 0 0; color: var(--ink-2); line-height: 1.45; }
.cards { display: grid; gap: 10px; padding: 0 18px 18px; }
.card, .src, .row {
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: white;
}
.card a { color: var(--blue); font-weight: 600; }
.page { max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; }
.page h1 { letter-spacing: -0.04em; font-weight: 620; margin: 0 0 6px; }
.lead { color: var(--ink-2); margin: 0 0 18px; line-height: 1.5; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
input, select {
  border: 1px solid var(--line-strong); background: white; border-radius: 12px; padding: 10px 12px;
}
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 4px 8px; }
.ok { background: rgb(43 43 255 / 0.1); color: var(--navy); }
.warn { background: rgb(161 77 0 / 0.12); color: var(--warn); }
.bad { background: rgb(200 30 58 / 0.1); color: var(--err); }
.muted { background: var(--still); color: var(--ink-2); }
.src { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.src p { margin: 4px 0 0; color: var(--ink-2); }
.src .grow { flex: 1; }
.primary { background: var(--navy); color: var(--ice); border: 0; border-radius: 12px; padding: 10px 14px; }
.primary:disabled { opacity: 0.5; }
.linkish { background: none; border: 0; color: var(--ink-3); text-decoration: underline; padding: 0; }
.danger { color: var(--err); }

.chat { padding: 0; background: #e7eef8; }
.chat-panel { width: min(480px, 100%); margin-left: auto; background: #efeae2; display: flex; flex-direction: column; min-height: 100%; }
.chat-head { background: var(--navy); color: white; }
.chat-head svg { width: 36px; height: 36px; flex: none; }
.chat-head p { margin: 2px 0 0; color: var(--ice); font-size: 12px; }
.thread { flex: 1; overflow: auto; padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 80%; padding: 8px 10px 4px; border-radius: 12px; line-height: 1.4; box-shadow: 0 1px 0 rgb(0 0 0 / 0.04); }
.bubble.in { align-self: flex-start; background: white; border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 4px; }
.bubble time, .ticks { display: block; text-align: right; font-size: 11px; color: #667781; margin-top: 2px; }
.ticks.read { color: #53bdeb; }
.ticks.failed { color: var(--err); }
.composer { display: flex; gap: 8px; padding: 10px; background: #f0f2f5; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; border-radius: 16px; border: 0; padding: 12px; }
.filebtn, .send { border: 0; border-radius: 999px; width: 44px; height: 44px; background: white; }
.send { background: var(--navy); color: var(--ice); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 8px; background: #f0f2f5; }
.chips span { background: white; border-radius: 999px; padding: 4px 8px; font-size: 12px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login {
  width: min(420px, 100%); background: white; border-radius: 28px; padding: 28px; box-shadow: var(--shadow);
}
.login h1 { margin: 8px 0; letter-spacing: -0.04em; }
.login p { color: var(--ink-2); line-height: 1.5; }
.login form { display: grid; gap: 12px; }
.err { background: rgb(200 30 58 / 0.08); color: var(--err); border-radius: 12px; padding: 10px 12px; }

.empty, .skeleton { color: var(--ink-2); }
.skeleton .bar { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--soft), white, var(--soft)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; margin: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 550; color: var(--ink-3); font-size: 12px; }
td, th { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.invite { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 16px; background: white; }
.note { background: rgb(43 43 255 / 0.08); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }

.connect { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.connect-card { width: min(520px, 100%); background: white; border-radius: 28px; padding: 28px; box-shadow: var(--shadow); }
.connect-card h1 { letter-spacing: -0.03em; }
.connect-card .hint { color: var(--ink-3); font-size: 13px; }
.connect-card button, .connect-card .primary { margin-top: 8px; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .sync { margin-left: 0; }
  .constellation { height: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; }
  .links, .group-label { display: none; }
  .node, .heart { position: static; transform: none; width: min(100%, 420px); }
  .heart { height: 120px; }
  .chat-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .heart .beat, .node.running i, .links path.fresh, .skeleton .bar { animation: none; }
}

@keyframes lubdub {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(1.045); }
  32% { transform: scale(1); }
  48% { transform: scale(1.03); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
@keyframes flow { to { stroke-dashoffset: -26; } }
@keyframes shimmer { to { background-position: -200% 0; } }
