/* tm2027 board · space title in two lines
   Palette is the application's own: root #0b0f14, panel #10151c,
   border #252d38, text #e8edf2 / #a9b3c1, quiet #56606f. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --root: #0b0f14;
  --panel: #10151c;
  --panel-2: #11161d;
  --border: #252d38;
  --guide: #232b37;
  --ink: #e8edf2;
  --body: #c2ccd9;
  --dim: #a9b3c1;
  --quiet: #56606f;
  --hover: #202734;
  --focus: #3f6fd1;
  --working: #62d6a7;
  --done: #7fa7ff;
  --idle: #d5a64a;
  --unknown: #738199;
  --mono: "Hack", "Cascadia Mono", Consolas, monospace;
}

html { background: var(--root); }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--root);
  color: var(--body);
  padding-bottom: 84px; /* room for the pick bar */
}

/* ---------- masthead ---------- */

.masthead {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 8px;
}
.mast-brand {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--quiet);
}
.mast-title {
  font-size: 30px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 6px 0 12px;
  text-wrap: balance;
}
.mast-note {
  font-size: 14px;
  line-height: 1.55;
  max-width: 68ch;
}

/* ---------- board grid ---------- */

.board {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 20px;
}
@media (max-width: 580px) {
  .board { grid-template-columns: 1fr; padding: 16px; }
}

/* ---------- variant card ---------- */

.variant {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.variant:hover { border-color: #354052; }
.variant:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}
.variant.picked {
  border-color: var(--focus);
  box-shadow: 0 6px 24px -12px rgba(63, 111, 209, 0.55);
}

.v-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.v-letter {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  flex-shrink: 0;
}
.variant.picked .v-letter { border-color: var(--focus); color: #cddcff; }
.v-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.v-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--quiet);
  flex-shrink: 0;
  position: relative;
  transition: border-color 160ms;
}
.variant.picked .v-radio { border-color: var(--focus); }
.variant.picked .v-radio::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--focus);
}

/* ---------- the rail mock ---------- */

.railwrap {
  padding: 20px;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(32, 44, 66, 0.25), transparent 70%),
    var(--root);
  overflow-x: auto;
}
.rail {
  width: 292px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding-bottom: 10px;
  font-size: 11px;
  color: var(--dim);
  user-select: none;
}

.server-head {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.srv { color: var(--ink); font-weight: 600; letter-spacing: 0.04em; }
.srv-kind { color: var(--quiet); font-size: 9px; letter-spacing: 0.08em; }
.live {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--working);
}
.live::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--working);
  margin-right: 5px;
  vertical-align: 1px;
}

.guide {
  margin-left: 8px;
  border-left: 1px solid var(--guide);
}
.subguide {
  margin-left: 14px;
  border-left: 1px solid var(--guide);
  margin-bottom: 2px;
}

/* base row — one line, as the app draws it today */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  line-height: 14px;
}
.row:hover { background: var(--hover); }
.row.sel { color: var(--ink); }

.tri {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  fill: var(--unknown);
}
.folder {
  width: 11px;
  height: 8px;
  border: 1px solid var(--unknown);
  border-radius: 3px;
  flex-shrink: 0;
}

.title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch {
  font-size: 8.5px;
  color: var(--quiet);
  white-space: nowrap;
  flex-shrink: 0;
}
.meta {
  font-size: 9px;
  color: var(--quiet);
  white-space: nowrap;
  flex-shrink: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px;
  border: 1px solid #2a3546;
  border-radius: 4px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.st-working { color: var(--working); }
.st-done { color: var(--done); }
.st-idle { color: var(--idle); }
.chip.owned { color: var(--done); border-color: #2a3546; }
.chip.attach { color: var(--unknown); }

/* tab + pane context rows */
.row.tab { font-size: 10.5px; padding: 3px 8px; }
.row.pane { font-size: 10.5px; padding: 3px 8px; }
.agent { color: var(--dim); flex-shrink: 0; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptitle { flex: 1; min-width: 0; color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- variant A: wrap to two lines on demand, cluster stays right ---- */
.va .row { align-items: center; }
.va .row .title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.va .row.tab .title,
.va .row.pane .ptitle {
  display: block;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

/* ---- variants B and D: two-storey row, facts on the lower floor ---- */
.vb .row:not(.tab):not(.pane),
.vd .row:not(.tab):not(.pane) {
  display: block;
  padding: 4px 8px 5px;
}
.line1 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.line1 .tri { margin-top: 3px; }
.line1 .folder { margin-top: 3px; }
.line2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 0 27px; /* under the text start: tri 8 + gap 8 + folder 11 */
}

/* B wraps the full-width title to two lines */
.vb .line1 .title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* D keeps a single full-width line */
.vd .line1 .title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- variant C: every title slot is two lines tall ---- */
.vc .row:not(.tab):not(.pane) .title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  min-height: 28px; /* two 14px lines, short names keep the slot */
}

/* ---------- body under each mock ---------- */

.v-body {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
  display: grid;
  gap: 8px;
}
.v-body b { color: var(--ink); font-weight: 600; }
.v-body .cost { color: var(--dim); }
.v-body .impl { color: var(--quiet); }
.v-body .impl b { color: var(--dim); }
.v-body code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
}

/* ---------- pick bar ---------- */

.pickbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(17, 22, 29, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.pick-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--quiet);
  flex-shrink: 0;
}
.pick-value { color: var(--ink); font-weight: 600; }
.pick-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pick-copy {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--focus);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 140ms;
}
.pick-copy:hover { background: #1a2438; }
.pick-copy:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-copy.copied { color: var(--working); border-color: var(--working); }

@media (max-width: 700px) {
  .pick-link { display: none; }
}
