/* Private console. Same identity as the profile page: paper, oxblood, Fraunces. */

:root {
  --paper: #F7F5F0;
  --paper-deep: #F1EDE4;
  --card: #FFFDFA;
  --ink: #1A1917;
  --body-ink: #57524A;
  --muted: #7C766B;
  --faint: #A39C8E;
  --rule: #DED8CC;
  --accent: #7C2D2A;
  --accent-deep: #5C1F1D;
  --ok: #3F6B4B;
  --bad: #9B2C22;
  --warm: #8A7B56;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- login shell ---------- */

.split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
}

.split.single { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); }

.identity {
  background: var(--paper-deep);
  border-right: 1px solid var(--rule);
  padding: clamp(30px, 4.4vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(26px, 4vh, 48px);
}

.identity.compact { justify-content: flex-start; }

.id-top { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }

.id-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  color: inherit;
  text-decoration: none;
}

.id-link:hover { text-decoration: none; }
.id-link:hover h1 { color: var(--accent); }

.id-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 3px;
}

.title-link { color: inherit; text-decoration: none; }
.title-link:hover { color: var(--accent); text-decoration: none; }
.title-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.monogram {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--card);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.portrait {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--card);
}

.identity h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(27px, 3.2vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.identity h1 .esq { font-style: italic; }

.role {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.credentials {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 16px;
}

.credentials div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
}

.credentials dt {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}

.credentials dd {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: #2B2823;
}

.id-foot {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: clamp(32px, 5vw, 64px);
}

.auth-foot {
  margin: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- forms ---------- */

.form {
  width: 100%;
  max-width: 392px;
  display: flex;
  flex-direction: column;
}

.form-wide { max-width: 420px; }

.kicker {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.form h2 {
  margin: 10px 0 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(23px, 2.5vw, 29px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

label {
  margin: 14px 0 7px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
}

input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 45, 42, 0.12);
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 84px;
}

textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 45, 42, 0.12);
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.88em;
  background: rgba(26, 25, 23, 0.05);
  padding: 1px 4px;
  border-radius: 2px;
}

.codeblock {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: #FBF9F4;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.75;
  color: #2B2823;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.alt-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 12.5px;
}

.alt-login .rule { height: 1px; background: var(--rule); }

.alt-login .alt-label {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.alt-login a { grid-column: 1 / -1; text-align: center; }

.add-key {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--rule);
}

.shell-hint { margin-top: 22px; }
.shell-hint .hint { margin: 0 0 6px; }
.shell-hint strong { font-weight: 500; color: var(--ink); }

.code-input {
  font-size: 24px;
  letter-spacing: 0.45em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.secret-box {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: #FBF9F4;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  padding: 14px 16px;
  overflow-wrap: anywhere;
  margin: 14px 0 8px;
  max-width: 420px;
}

.pw-field { position: relative; }
.pw-field input { padding-right: 66px; }

.pw-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.pw-toggle:hover { color: var(--accent); }

.btn {
  margin-top: 24px;
  height: 48px;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.btn:hover { background: var(--accent-deep); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

.btn-inline { width: auto; padding: 0 24px; margin-top: 18px; }
.btn-quiet { background: transparent; color: var(--accent); border: 1px solid var(--rule); }
.btn-quiet:hover { background: rgba(124, 45, 42, 0.06); }

.alert,
.notice {
  margin: 14px 0 4px;
  padding: 11px 14px;
  border-left: 2px solid var(--bad);
  background: #FBF1EF;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  color: #7A2118;
  border-radius: 2px;
}

.notice { border-left-color: var(--ok); background: #F1F5F0; color: #2F5238; }

.alert code,
.notice code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.hint {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 18px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12.5px;
}

.form-foot .hint { margin: 0; }

/* ---------- project tiles ---------- */

.tgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 16px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--card);
}

.tile:hover { border-color: #CFC7B8; }

.thead { display: flex; align-items: baseline; gap: 10px; }

.thead .dot { margin-top: 0; }

.thead h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  min-width: 0;
}

.thead h3 a { color: var(--ink); text-decoration: none; }
.thead h3 a:hover { color: var(--accent); }

.thead .state { margin-left: auto; }

.tblurb {
  margin: 0;
  flex: 1;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body-ink);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 3px 7px;
  background: #FBF9F4;
}

.chips-inline { margin-top: 10px; }

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.facts dt {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.facts dd {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tfoot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.pfacts {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
}

.pfact { margin-right: 14px; white-space: nowrap; }
.pfact b { font-weight: 500; color: var(--faint); }

body.view-tiles .plist { display: none; }
body.view-list .tgrid { display: none; }

/* ---------- console shell ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.wordmark:hover { color: var(--accent); text-decoration: none; }

.bar nav { display: flex; align-items: center; gap: 22px; }

.bar nav a,
.linklike {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.bar nav a:hover,
.linklike:hover { color: var(--accent); text-decoration: none; }
.bar nav a.active { color: var(--accent); }

.inline { display: inline; margin: 0; }

.linklike.danger { color: var(--bad); font-size: 10.5px; }
.linklike.danger:hover { color: #7A2118; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(30px, 4.6vw, 56px) 24px 56px;
}

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  margin-bottom: clamp(24px, 3.6vw, 40px);
}

.head-main { min-width: 0; }

.viewswitch {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.viewswitch button {
  background: var(--card);
  border: 0;
  padding: 9px 16px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.viewswitch button + button { border-left: 1px solid var(--rule); }
.viewswitch button:hover { color: var(--accent); }
.viewswitch button.active { background: var(--accent); color: #fff; }

.head h1 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.8vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.subline {
  margin: 14px 0 0;
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-ink);
}

.head .notice,
.head .alert { max-width: 64ch; }

.group { margin-top: 38px; }

.group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.group-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.count {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--faint);
}

.plist { list-style: none; margin: 0; padding: 0; }

.prow {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 132px;
  gap: 16px;
  padding: 20px 8px 20px 0;
  border-bottom: 1px solid var(--rule);
}

.prow.plain { grid-template-columns: minmax(0, 1fr) 132px; }
.prow:hover { background: rgba(124, 45, 42, 0.035); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 8px;
  background: var(--faint);
}

.dot-up { background: var(--ok); }
.dot-down { background: var(--bad); }
.dot-source { background: var(--warm); }

.ptitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }

.ptitle a,
.ptitle > span:not(.pmeta):not(.tag) {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}

.ptitle a:hover { color: var(--accent); text-decoration: none; }

.ptitle .pmeta {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.pblurb {
  margin: 6px 0 0;
  max-width: 74ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--body-ink);
}

.pside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.state {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.state-up { color: var(--ok); }
.state-down { color: var(--bad); }
.state-source { color: var(--warm); }

.go {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.go:hover { text-decoration: none; color: var(--accent-deep); }

.ptitle .tag {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(124, 45, 42, 0.32);
  padding: 2px 6px;
  border-radius: 2px;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.log li {
  display: grid;
  grid-template-columns: 148px 176px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.log .lw { color: var(--faint); }
.log .le { color: var(--ink); }
.log .ld { overflow-wrap: anywhere; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- error ---------- */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
}

.error-page h1 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
}

.error-actions { display: flex; gap: 12px; margin-top: 20px; }

/* ---------- agent console ---------- */

.agent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.agent-main, .agent-side { min-width: 0; }

/* The agent page keeps its prompt box on screen: compact head, viewport-fit transcript. */
.agent-page .wrap { padding-top: clamp(20px, 2.6vw, 32px); padding-bottom: 36px; }
.agent-page .head { margin-bottom: 20px; }
.agent-page .head h1 { margin-top: 8px; font-size: clamp(26px, 3vw, 34px); }
.agent-page .subline { margin-top: 8px; font-size: 14.5px; max-width: 78ch; }
.agent-page .foot { margin-top: 30px; }

.agent-bar {
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) minmax(170px, 1.35fr) minmax(105px, 0.7fr) auto auto;
  gap: 10px 16px;
  align-items: end;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: var(--paper-deep);
}

.agent-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.agent-field label { margin: 0; }

.agent select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  text-overflow: ellipsis;
}

.custom-model {
  height: 30px;
  margin-top: 4px;
  padding: 0 8px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.custom-model[hidden] { display: none; }

.agent select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 45, 42, 0.12);
}

.agent-session { display: flex; align-items: center; gap: 10px; min-width: 0; }

.agent-session-label {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.agent-session code {
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--body-ink);
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.mini:hover { background: rgba(124, 45, 42, 0.06); }
.mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.agent-state {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.agent-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.agent-state[data-state="running"] { color: var(--accent); }
.agent-state[data-state="running"]::before { background: var(--accent); }
.agent-state[data-state="done"] { color: var(--ok); }
.agent-state[data-state="done"]::before { background: var(--ok); }
.agent-state[data-state="error"] { color: var(--bad); }
.agent-state[data-state="error"]::before { background: var(--bad); }
.agent-state[data-state="stopped"]::before { background: var(--bad); }

.transcript {
  height: clamp(280px, calc(100vh - 530px), 620px);
  min-height: 280px;
  overflow-y: auto;
  padding: 20px 18px;
  border: 1px solid var(--rule);
  background: var(--card);
}

.entry { margin: 0 0 20px; }
.entry:last-child { margin-bottom: 0; }

.entry-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.entry-user .entry-label { color: var(--accent); }

.entry-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink);
}

.entry-text pre {
  margin: 10px 0;
  padding: 12px 14px;
  background: #FBF9F4;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

.entry-text code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12.5px;
}

.entry-text strong { font-weight: 600; }

.entry-tool details {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #FBF9F4;
}

.entry-tool summary {
  cursor: pointer;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--body-ink);
}

.entry-tool .toolname {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  color: var(--accent);
}

.entry-tool pre {
  margin: 0;
  padding: 0 12px 10px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #2B2823;
}

.entry-note {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.entry-error .entry-note { color: var(--bad); }

.empty-state {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
}

.composer {
  padding: 14px;
  border: 1px solid var(--rule);
  border-top: 0;
  border-radius: 0 0 3px 3px;
  background: var(--card);
}

.composer.dropping {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(124, 45, 42, 0.12);
  background: #FBF6F4;
}

.composer textarea {
  min-height: 62px;
  font-family: var(--sans);
  font-size: 14px;
}

.attach {
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-deep);
}

.attach[hidden] { display: none; }

.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attach-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--body-ink);
  max-width: 100%;
}

.attach-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--rule);
}

.attach-name {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-remove {
  border: 0;
  background: none;
  padding: 0 2px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.attach-remove:hover { color: var(--bad); }

.attach-busy { font-family: var(--sans); font-size: 11.5px; color: var(--muted); }

.entry-progress .entry-note {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
}
.entry-progress { padding: 6px 0; }

.attach-item-file { padding-left: 6px; }

.file-ext {
  display: inline-block;
  min-width: 34px;
  padding: 3px 4px;
  border-radius: 2px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--body-ink);
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-deep);
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--body-ink);
  text-decoration: none;
  max-width: 260px;
}

.file-chip:hover { border-color: var(--ink); }

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* typing indicator */
.typing {
  width: 30px;
  height: 16px;
  position: relative;
}
.typing::before,
.typing::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1.2s infinite ease-in-out;
}
.typing::after {
  left: 12px;
  animation-delay: 0.3s;
}
.typing { /* third dot via box-shadow style below */ }
.typing span { display: none; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* side panels */
.side-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.side-tab {
  border: 0;
  background: none;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.side-tab.active {
  color: var(--body-ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}
.side-pane[hidden] { display: none; }
.side-attach-list {
  flex-direction: column;
  align-items: stretch;
}
.side-empty {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.agent-side .field {
  margin-bottom: 12px;
}
.agent-side .field-label {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.agent-side textarea,
.agent-side select {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--body-ink);
}
.gen-status {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
  margin: 10px 0 4px;
}
.gen-status[data-state="bad"] { color: var(--bad); }
.genlist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gen-item img {
  width: 100%;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-deep);
}
.gen-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}
.gen-name {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-block { width: 100%; }

/* setup page */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.setup-card {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--card);
}
.setup-card h2 { margin: 0 0 8px; font-size: 17px; }
.card-note {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.field-label {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input[type="password"],
.field select {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  color: var(--body-ink);
}
.field-hint {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
}
.row-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.setup-status {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.setup-status[data-state="bad"] { color: var(--bad); }
.profile-models {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-models li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.pm-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
}
.pm-default {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.pm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pm-list code,
.pm-label code {
  font-family: var(--sans);
  font-size: 11px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px 6px;
}
.pm-none {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .setup-grid { grid-template-columns: 1fr; }
}

.slashhelp {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
}

.slashhelp[hidden] { display: none; }

.slashhelp code {
  background: var(--paper-deep);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--body-ink);
}

.attach-btn { margin-top: 0; height: 30px; }

.entry-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.entry-images img {
  max-width: 160px;
  max-height: 160px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
}

.composer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.composer-row .btn { margin-top: 0; }
.composer-row .hint { margin: 0; }

.agent-side h2 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.runlist { list-style: none; margin: 0; padding: 0; }
.runlist li.empty { font-family: var(--sans); font-size: 12px; color: var(--faint); }

.runlist button {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: start;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  text-align: left;
  cursor: pointer;
}

.runlist button:hover .runtext { color: var(--accent); }
.runlist button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.runmark { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.runmark-done { background: var(--ok); }
.runmark-error { background: var(--bad); }
.runmark-stopped { background: var(--bad); }
.runmark-running { background: var(--accent); }

.runtext { font-size: 13px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }

.runwhen {
  grid-column: 2;
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--faint);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .split,
  .split.single { grid-template-columns: minmax(0, 1fr); }

  .identity {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    gap: 22px;
    padding: 28px 24px 26px;
  }

  .auth { padding: 34px 24px 44px; }
  .form, .form-wide { max-width: none; }
}

@media (max-width: 720px) {
  .prow { grid-template-columns: 10px minmax(0, 1fr); }
  .prow.plain { grid-template-columns: minmax(0, 1fr); }

  .pside {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    text-align: left;
  }

  .prow.plain .pside { grid-column: 1; }

  .log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .bar-inner {
    height: auto;
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .bar nav { gap: 10px; flex-wrap: wrap; row-gap: 2px; justify-content: flex-end; }

  /* Mobile: the profile link is reachable from the dashboard, so the nav keeps
     one row instead of wrapping into a stack. Type is a step smaller so the
     remaining five items fit 390px. */
  .bar nav .nav-profile { display: none; }
  .bar nav a,
  .bar .linklike { font-size: 10.5px; letter-spacing: 0.07em; }

  /* Vertical padding only: horizontal padding would push the four links past
     the row width and wrap the nav. Keeps each tap target above 24px. */
  .bar nav a,
  .bar .linklike { padding: 10px 0; display: inline-block; }

  .wrap { padding: 28px 18px 44px; }
}

@media (max-width: 620px) {
  .credentials div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .credentials dt { padding-top: 0; }
  .credentials dd { font-size: 15px; }
  .form-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 900px) {
  .agent { grid-template-columns: minmax(0, 1fr); }
  .agent-side { border-top: 1px solid var(--rule); padding-top: 18px; }
  .transcript { height: clamp(240px, calc(100vh - 540px), 480px); }
}

@media (max-width: 620px) {
  .agent-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; }
  .agent-field-model { grid-column: 1 / -1; grid-row: 1; }
  .agent-field-agent { grid-column: 1; grid-row: 2; }
  .agent-field-reasoning { grid-column: 2; grid-row: 2; }
  .agent-session { grid-column: 1 / -1; grid-row: 3; }
  .agent-state { grid-column: 1 / -1; grid-row: 4; justify-self: start; margin-left: 0; }
  .agent-session code { max-width: 13ch; }
  .transcript { height: clamp(220px, calc(100vh - 520px), 420px); padding: 16px 14px; }
  .agent-page .wrap { padding-top: 18px; }
  .agent-page .subline { font-size: 14px; }
  .composer { padding: 12px; }
  .composer-row { gap: 10px; }
  .composer-row .hint { order: 3; flex-basis: 100%; }
  .composer-row .btn { height: 44px; padding: 0 20px; }
}
