/* Concorde design system — academic, serif, square, subtle pastel accent.
   Loaded by the console, member, and verifier pages for one cohesive look.
   Aesthetic: paper-and-ink, hairline rules, Times New Roman, no rounded
   corners, a restrained periwinkle pastel used sparingly. */
:root {
  color-scheme: light dark;
  --bg: #f7f6f1;          /* warm paper */
  --surface: #fffffe;
  --surface-2: #efede6;
  --border: #d8d4c8;       /* hairline */
  --text: #1b1a17;         /* ink */
  --muted: #6f6b62;
  --accent: #6d74b5;       /* periwinkle, white ink readable */
  --accent-ink: #ffffff;
  --accent-soft: #ecedf6;  /* pastel wash */
  --ok: #3a6b3a;
  --bad: #9b2c2c;
  --warn: #8a6d1f;
  --radius: 0px;
  --shadow: none;
  --maxw: 1000px;
  --serif: "Times New Roman", Times, Georgia, "Liberation Serif", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a; --surface: #1c1c22; --surface-2: #24242c; --border: #34343f;
    --text: #e9e7e0; --muted: #9b978d; --accent: #9aa0e0; --accent-ink: #16161a;
    --accent-soft: #24263a; --ok: #7fb07f; --bad: #d98a8a; --warn: #cdab63;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--serif);
  background: var(--bg); color: var(--text); line-height: 1.55; font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }

/* top bar — a ruled masthead */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--text); }
.topbar .wrap { display: flex; align-items: center; gap: .9rem; height: 60px; }
.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; display: flex; align-items: center; gap: .55rem; }
.brand .dot { width: 10px; height: 10px; background: var(--accent); display: inline-block; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: .85rem; font-style: italic; }

/* headings — journal style */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.01em; margin: 1.4rem 0 .35rem; line-height: 1.2; }
h2 { font-size: 1.3rem; font-weight: 700; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin: .2rem 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }

/* cards — bordered plates, no shadow */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: 1.15rem 1.3rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.cards .card { border: none; }            /* hairline grid between plates */
.agent-card { cursor: pointer; transition: background .1s ease; }
.agent-card:hover { background: var(--accent-soft); }
.agent-card .name { font-weight: 700; font-size: 1.1rem; }

/* forms — academic uppercase labels, square fields */
label { display: block; font-family: var(--serif); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; font-size: .7rem; color: var(--muted); margin: .95rem 0 .3rem; }
input, textarea, select {
  width: 100%; padding: .55rem .65rem; font-family: var(--serif); font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 0; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
textarea { min-height: 5rem; resize: vertical; line-height: 1.5; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* buttons — square, ruled */
button, .btn {
  font-family: var(--serif); font-size: .95rem; font-weight: 700; cursor: pointer; border-radius: 0;
  padding: .5rem 1.05rem; border: 1px solid var(--text); background: var(--surface); color: var(--text);
  transition: background .1s ease, color .1s ease;
}
button:hover, .btn:hover { background: var(--text); color: var(--bg); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-danger:hover { background: var(--bad); color: var(--bg); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }

/* pills & badges — small ruled tags */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .08rem .5rem; border-radius: 0; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; border: 1px solid var(--border); color: var(--muted); background: transparent; }
.pill.active { color: var(--ok); border-color: var(--ok); }
.pill.paused { color: var(--warn); border-color: var(--warn); }
.pill.retired { color: var(--muted); }
.pill.pending { color: var(--warn); border-color: var(--warn); }

/* tabs — underlined section heads */
.tabs { display: flex; gap: 1.2rem; border-bottom: 1px solid var(--text); margin: 1.1rem 0 1.3rem; flex-wrap: wrap; }
.tab { padding: .5rem 0; border: none; background: transparent; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 0; font-weight: 700; }
.tab:hover { background: transparent; color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

/* steps */
.steps { display: flex; gap: .5rem; margin: 1rem 0 1.4rem; }
.step { flex: 1; height: 3px; background: var(--border); }
.step.on { background: var(--accent); }

/* chat — squared notes */
.chat { display: flex; flex-direction: column; gap: .7rem; max-height: 56vh; overflow-y: auto; padding: .4rem; }
.msg { max-width: 80%; padding: .55rem .8rem; border-radius: 0; white-space: pre-wrap; border: 1px solid var(--border); }
.msg.user { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent); }
.msg.bot { align-self: flex-start; background: var(--surface-2); }
.chat-input { display: flex; gap: .6rem; margin-top: .8rem; }
.chat-input textarea { min-height: 2.6rem; max-height: 8rem; }

/* misc */
pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); padding: .7rem .8rem; border-radius: 0; overflow: auto; }
.code { font-family: var(--mono); background: var(--surface-2); padding: .12rem .35rem; border-radius: 0; font-size: .8rem; border: 1px solid var(--border); }
.banner { display: flex; align-items: center; gap: .8rem; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 0; padding: .7rem .95rem; margin: 1rem 0; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .55rem 1rem; border-radius: 0; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; }
.list-item { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.ok { color: var(--ok); font-weight: 700; } .bad { color: var(--bad); font-weight: 700; }
.hidden { display: none !important; }
.grow { flex: 1; }
.stat { display: inline-block; margin-right: 1.4rem; }
.stat b { font-size: 1.15rem; }
.empty { text-align: center; color: var(--muted); padding: 2.4rem 1rem; font-style: italic; }
