/* Additions for the live app on top of the design system (foreman.css) and page styles. */
.small { font-size: var(--t-meta); }
.note { font-size: 11.5px; margin-top: var(--s-2); }
.fw4 { font-weight: 400; }
.lbl { font-weight: 600; font-size: var(--t-meta); }
.t .l0 { padding-left: 0; }
.t .r0 { padding-right: 0; }
.kv-top { margin-top: var(--s-3); }
.who-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.tier-pick { gap: 3px; }
.tier-pick .select { height: 30px; font-size: var(--t-meta); width: auto; }
.tier-pick .st { font-size: 10px; }
.strip.wide { --cols: 150px minmax(0, 1fr); }
.err { white-space: pre-wrap; }
[hidden] { display: none !important; }

/* chips can be links */
a.chip { text-decoration: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--fg); font-size: var(--t-meta); font-weight: 600;
}
.toast[data-bad="1"] { border-color: var(--error); color: var(--error); }
@media (max-width: 760px) { .toast { bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* agent text keeps its line breaks */
.tx .body.md { white-space: pre-wrap; overflow-wrap: anywhere; }
.tx .body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.tx details.tool > summary { cursor: pointer; list-style: none; }
.tx details.tool > summary::-webkit-details-marker { display: none; }
.tx details.tool > summary code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* map controls on the policy page */
.ctl.map { display: grid; grid-template-columns: auto; gap: 6px; justify-items: end; }
.maprow { display: inline-flex; gap: 10px; align-items: center; font-size: var(--t-meta); }
.maprow .select { height: 30px; width: 130px; font-size: var(--t-meta); }
.num-in { width: 72px; height: 30px; font-size: var(--t-meta); text-align: right; }
.ack.bad { color: var(--error); }
.set-flat { border-bottom: 0; padding-bottom: 0; }
.tier-row .input { height: 34px; font-size: var(--t-meta); }
@media (max-width: 760px) { .ctl.map { justify-items: start; } }

/* diff */
.diff-panel { margin-top: var(--s-6); }
.diff-files details.dfile { border-bottom: 1px solid var(--border); }
.diff-files details.dfile:last-child { border-bottom: 0; }
.diff-files summary { display: flex; gap: var(--s-3); align-items: center; padding: 8px var(--s-4); cursor: pointer; font-size: var(--t-meta); }
.diff-files summary .end { margin-left: auto; }
.diff-files .ok { color: var(--done); } .diff-files .bad { color: var(--error); }
.dbody { max-height: 70vh; overflow: auto; border-top: 1px solid var(--border); background: var(--bg); }
.dl { font-family: var(--font-mono); font-stretch: var(--mono-stretch); font-size: 11.5px; line-height: 1.55; white-space: pre; padding: 0 var(--s-3); }
.dl.add { background: var(--done-wash); color: var(--fg); }
.dl.del { background: var(--error-wash); color: var(--fg); }
.dl.hunk { color: var(--working); background: var(--surface); }

/* history snippet marks come from FTS */
.snip mark { background: var(--accent-wash); }
.audit td { font-size: var(--t-meta); }

/* agent page: keep long briefs and commands inside their columns */
.agent-grid > * { min-width: 0; }
.brief-body { overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
.kv dd.mono { overflow-wrap: anywhere; }
.tx .tool-h { min-width: 0; overflow: hidden; }
.tx .tool-h code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* rows: branch names and long marker lists stay on one line */
.markers .st { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.strip .f.side .agent-none.mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--m-micro); }
.strip .meta .branch { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: var(--m-micro); }
.compact .f.act { gap: 4px; }
@media (max-width: 760px) {
  .head-strip .f.act { flex-wrap: wrap; justify-content: flex-start; }
}
