/* Spawn's hosted connect page — the PRODUCT's home screen, not a separate login design.
   Tokens and type are the app's own (web/handoff XenoSpawn.dc.html + web/src/chrome.css):
   #E9E6E1 frame, #FFFFFF page, #1F1F1F ink, DM Sans, 5-6px radii. No inline styles anywhere:
   the page's CSP allows style-src 'self' only, so every rule below is a class. */
:root {
  --frame: #e9e6e1;
  --page: #ffffff;
  --ink: #1f1f1f;
  --ink2: #6e6a64;
  --ink3: #9c978f;
  --line: #dedad4;
  --hover: rgba(31, 31, 31, 0.06);
  --accent: #1f1f1f;
  --on-accent: #faf9f7;
  --err: #b4541a;
  --font: "DM Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--frame);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
code { font-family: var(--mono); font-size: 12px; background: var(--hover); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
a { color: var(--ink); text-underline-offset: 2px; }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- the app's home screen */
.home {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100dvh;
}
.home-head { display: flex; align-items: center; gap: 12px; }
.home-mark { width: 28px; height: 28px; display: block; }
.home-id { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-id h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.home-id p { margin: 0; font-size: 13px; color: var(--ink2); }
.home-host {
  font-family: var(--mono); font-size: 11px; color: var(--ink3);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; background: var(--page);
  white-space: nowrap;
}

.mode-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; padding: 2px; border-radius: 6px; background: var(--hover); }
.seg-btn {
  height: 30px; padding: 0 16px; border: 0; border-radius: 4px; background: transparent;
  color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer;
}
.seg-btn.selected { background: var(--page); box-shadow: 0 1px 2px rgba(31, 31, 31, 0.14); }
.soon {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink3); margin-left: 6px;
}
.mode-note { font-size: 12.5px; color: var(--ink2); }
.lede { margin: 0; max-width: 640px; font-size: 15px; line-height: 1.55; color: var(--ink2); }

.steps {
  list-style: none; margin: 0; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--page); border: 1px solid var(--line); border-radius: 8px;
}
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink2); }
.steps li > span {
  width: 20px; height: 20px; border-radius: 4px; background: var(--hover);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--ink);
}
.steps b { color: var(--ink); font-weight: 600; }

.pair {
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  background: var(--page); border: 1px solid var(--line); border-radius: 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink3);
}
.field input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--frame); color: var(--ink); font: inherit; font-size: 14px; outline: none;
}
.field input:focus { border-color: #8c867c; }
.field input::placeholder { color: var(--ink3); }

.consent {
  display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start;
  font-size: 13px; line-height: 1.5; color: var(--ink2); cursor: pointer;
}
.consent input { margin: 3px 0 0; accent-color: var(--accent); }
.actions { display: flex; gap: 10px; }
.primary {
  height: 36px; padding: 0 16px; border: 0; border-radius: 5px;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.primary:disabled { opacity: 0.45; cursor: default; }
.ghost {
  height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px;
  background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer;
}
.ghost:hover { border-color: #8c867c; }

.message { margin: 0; min-height: 20px; font-size: 13px; color: var(--err); }
.message:empty { display: none; }
.note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink3); }
.home-foot { margin-top: auto; padding-top: 18px; font-size: 12px; color: var(--ink3); }

/* ------------------------------------------------------------- the paired workspace */
.workspace, .board {
  max-width: 1100px; margin: 0 auto; padding: 24px; min-height: 100dvh;
  display: flex; flex-direction: column;
}
.workspace-head { display: flex; align-items: center; gap: 12px; height: 44px; flex: none; }
.workspace-head b { font-size: 13px; font-weight: 600; }
.board-count { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
#workspace-frame { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--page); }
#workspace-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.grant, .session { margin: 6px 0; font-size: 13px; color: var(--ink2); }
.session { color: var(--ink3); }
.projects { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); margin-top: 16px; }
.pnode {
  position: relative; display: block; padding: 12px 14px 11px;
  background: var(--page); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: 12px;
}
.pnode:hover { border-color: #8c867c; }
.pnode-name { display: block; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 4px; }
.pnode-root { display: block; font-family: var(--mono); font-size: 10px; color: var(--ink3); overflow-wrap: anywhere; }
.pnode-meta { display: block; margin-top: 8px; font-size: 10px; letter-spacing: 0.06em; color: var(--ink2); }
.pnode[data-running="1"]::after {
  content: ""; position: absolute; right: 10px; top: 10px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--ink);
}
.empty {
  grid-column: 1 / -1; padding: 18px; border: 1px dashed var(--line); border-radius: 6px;
  font-size: 12px; color: var(--ink2);
}

/* ------------------------------------------------------------------------ the 404 page */
.bar {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px;
  background: var(--page); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink2);
}
.brand { letter-spacing: 0.14em; font-size: 11px; color: var(--ink2); }
.brand b { color: var(--ink); font-weight: 600; }
.sep { width: 1px; height: 14px; background: var(--line); }
.mode { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink2); }
.root { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
.notfound { max-width: 34rem; margin: 0 auto; padding: 5rem 20px; }
.notfound h1 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 10px; color: var(--ink); }
.notfound .lede { font-size: 14px; color: var(--ink2); line-height: 1.6; }

@media (max-width: 560px) {
  .home { padding: 28px 16px 24px; }
  .home-host { display: none; }
  .workspace, .board { padding: 14px; }
  .projects { grid-template-columns: 1fr; }
}
