:root {
  --brand-accent: #2454dd; /* //RULES// interactive blue */
  --bg: #ffffff;
  --side: #ffffff;
  --text: #111820;
  --muted: #52606b;
  --faint: #52606b;
  --line: #d6dce1;
  --hover: rgba(17, 24, 32, .04);
  --chip: rgba(17, 24, 32, .04);
  --accent: #111820;
  --on-accent: #ffffff;
  --good: #1a7f37;
  --warn: #9a6700;
  --bad: #c62828;
  --radius: 0;
  --shadow: none;
  /* Matches infinitum-corporation.vercel.app */
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* same stack as infinitum-corporation.vercel.app */
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; }
body { font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.03em; }
/* Trademark mark, matching the Infinitum site: small, raised, regular weight */
sup.tm { font-size: .38em; vertical-align: super; line-height: 0; margin-left: .08em; letter-spacing: 0; font-weight: 400; }
/* As on the site (.pillars .tm, .catalog-status .tm): a larger mark in small text so it stays legible. */
.muted .tm, .faint .tm, .small .tm, .title .tm, .sub .tm { font-size: .65em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 0; border: 1px solid var(--line);
  background: var(--bg); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--on-accent) !important; border-color: var(--accent); }
.btn.primary:hover { background: var(--brand-accent); border-color: var(--brand-accent); }
.btn.ghost { border-color: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); outline: none;
}
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--text); box-shadow: none; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* Sign-in */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 360px; text-align: center; display: grid; gap: 14px; }
.logo { font-weight: 400; font-size: 34px; letter-spacing: -0.055em; line-height: 1.03; }
.logo span { font-weight: 400; color: var(--muted); letter-spacing: -0.03em; }
.auth-card .btn { width: 100%; height: 48px; }
.social { display: grid; gap: 10px; }
.social:empty { display: none; }
.input.code { text-align: center; letter-spacing: .4em; font-size: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { color: var(--bad); font-size: 13px; min-height: 18px; }

/* Shell */
.shell { display: grid; grid-template-columns: 260px 1fr; height: 100%; }
.side { background: var(--side); display: flex; flex-direction: column; padding: 12px; gap: 2px; overflow-y: auto; }
.side .brand { padding: 10px 12px 18px; font-weight: 400; font-size: 22px; letter-spacing: -0.04em; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 0;
  text-decoration: none; color: var(--text);
}
.nav a:hover { background: var(--hover); }
.nav a.active { background: rgba(17, 24, 32, .07); font-weight: 500; }
.nav svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
main { overflow-y: auto; position: relative; }
.page { max-width: 1040px; margin: 0 auto; padding: 32px 32px 120px; }
.page.narrow { max-width: 768px; }
.page.wide { max-width: 1480px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; letter-spacing: -0.045em; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.open .side { transform: none; }
  .menu-btn { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 10; }
  .page { padding: 64px 16px 120px; }
}

/* Ask (ChatGPT-style) */
.hero { text-align: center; padding: 8vh 0 28px; }
.hero h1 { font-size: 40px; font-weight: 400; letter-spacing: -0.055em; }
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 18px;
  border: 1px solid var(--line); border-radius: 0; background: var(--bg); box-shadow: var(--shadow);
}
.composer textarea { flex: 1; border: 0; outline: none; resize: none; max-height: 200px; padding: 9px 0; background: transparent; line-height: 1.4; }
.composer .send { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.composer .send svg { width: 18px; height: 18px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.suggestions button { border: 1px solid var(--line); background: var(--bg); border-radius: 0; padding: 7px 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.suggestions button:hover { background: var(--hover); color: var(--text); }
.thread { display: grid; gap: 18px; margin: 8px 0 22px; }
.msg.user { justify-self: end; background: var(--chip); padding: 10px 16px; border-radius: 0; max-width: 80%; white-space: pre-wrap; }
.msg.ai { white-space: pre-wrap; }
.msg.ai.notice { color: var(--muted); }
.typing { color: var(--faint); }

/* Sections & lists */
.section { margin-top: 36px; }
.section h2 { font-size: 15px; margin-bottom: 10px; }
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; background: var(--bg); width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--hover); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 500; }
.item .sub { color: var(--muted); font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 0; background: var(--chip); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pill.p1, .pill.high { background: transparent; border: 1px solid currentColor; color: var(--bad); }
.pill.p2, .pill.medium { background: transparent; border: 1px solid currentColor; color: var(--warn); }
.pill.low, .pill.won { background: transparent; border: 1px solid currentColor; color: var(--good); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; margin-top: 2px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.simple td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.simple td.num, table.simple th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--side); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.col-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; padding: 4px 6px 10px; text-transform: capitalize; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 0; padding: 12px; margin-bottom: 8px; cursor: pointer; display: block; width: 100%; text-align: left; }
.card:hover { box-shadow: var(--shadow); }
.card .name { font-weight: 500; }
.card .meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
.bar { height: 4px; border-radius: 0; background: var(--line); margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.18); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); z-index: 31; overflow-y: auto; padding: 24px 28px 60px; box-shadow: none; }
.drawer .close { position: absolute; top: 16px; right: 16px; }
.factor { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.factor .up { color: var(--good); }
.factor .down { color: var(--bad); }
.next { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.next .act { font-weight: 500; }
.timeline .ev { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline .ev .when { color: var(--faint); font-size: 12px; }
.hash { font-family: monospace; font-size: 11px; color: var(--faint); }

/* Dialog */
dialog { border: 0; border-radius: 0; padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: none; }
dialog::backdrop { background: rgba(0,0,0,.25); }
#modal-form { padding: 24px; display: grid; gap: 14px; }
#modal-form h2 { font-size: 18px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent); color: var(--on-accent); padding: 10px 18px; border-radius: 0; font-size: 14px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%); }

.pad6 { padding: 6px; }
.wrap { flex-wrap: wrap; }
.mb10 { margin-bottom: 10px; }
.mt10 { margin-top: 10px; }

/* Agents (SCALVS.ai) */
.badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 0; background: var(--accent); color: var(--on-accent); font-size: 11px; display: inline-grid; place-items: center; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 24px; }
.agent-card { display: flex; flex-direction: column; justify-content: flex-start; text-align: left; border: 1px solid var(--line); border-radius: 0; background: var(--bg); padding: 14px 16px; cursor: pointer; font: inherit; color: var(--text); }
.agent-card:hover { background: var(--hover); }
.agent-card.active { border-color: var(--text); }
.agent-card .title { font-size: 15px; margin-bottom: 4px; }
.agent-card .sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.run { margin-top: 18px; }
.run-output { white-space: pre-wrap; line-height: 1.6; }
.steps { margin-top: 12px; font-size: 13px; color: var(--muted); }
.steps summary { cursor: pointer; }
.steps ol { margin: 8px 0 0; padding-left: 20px; }
.proposal .btn { margin-left: 6px; }
.run-item summary { list-style: none; cursor: pointer; display: flex; }
.run-item summary::-webkit-details-marker { display: none; }
.run-item[open] { display: block; }
.run-item .run-output { margin-top: 10px; font-size: 14px; }
.notice { border: 1px solid var(--line); border-radius: 0; padding: 12px 14px; margin-bottom: 18px; color: var(--muted); }
.hidden { display: none !important; }

/* Conjure */
.chart { width: 100%; height: auto; margin: 12px 0 4px; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--text); stroke-width: 2; }
.chart .dot { fill: var(--text); }
.chart .lbl { font-size: 10px; fill: var(--faint); }
.split { display: flex; height: 6px; width: 120px; border-radius: 0; overflow: hidden; background: var(--line); flex: none; }
.split .for { background: var(--good); } .split .und { background: var(--line); } .split .ag { background: var(--bad); }
.split-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.split-row .split { width: 220px; }
.sim-q { font-size: 26px; line-height: 1.2; }
.sim-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.inject { display: flex; gap: 8px; margin: 10px 0 4px; }
.inject .input { flex: 1; }
.feed { display: grid; gap: 10px; }
.post { border: 1px solid var(--line); border-radius: 0; padding: 10px 14px; }
.post.news { background: var(--chip); }
.post .sub { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.report .outcome { font-size: 17px; }
.report ul { margin: 4px 0 12px; padding-left: 20px; }
.iv-log { max-height: 300px; overflow: auto; margin-bottom: 8px; }
