.agents-trigger { font-size: .76rem; padding: .5rem .7rem; white-space: nowrap; }
.agents-dialog { width: min(830px, calc(100vw - 32px)); max-width: 830px; max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); color: var(--body); box-shadow: 0 20px 100px #15251a33; overscroll-behavior: contain; }
.agents-dialog::backdrop { background: #0d1d15a6; backdrop-filter: blur(3px); }
.agents-dialog button { font: inherit; }
.agents-dialog button:disabled { cursor: default; opacity: .48; }
.agents-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 28px 18px; position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line); }
.agents-eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1.8px; }
.agents-head h2 { margin: 0; color: var(--ink); font-size: 26px; font-weight: 500; letter-spacing: -.6px; line-height: 1.25; }
.agents-close { min-height: 42px; font-size: 12px !important; padding: 9px 13px; }
.agents-body { padding: 22px 28px 28px; }
.agents-intro { margin: 0 0 18px; font-size: 13px; max-width: 650px; }
.agents-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 17px 0; }
.agents-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.agents-status.is-error { color: #8b5c1c; }
.agents-text-button { border: 0; background: none; padding: 7px 0; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; font-size: 11px !important; line-height: 1.5; min-height: 36px; }
.agents-toolbar > button { white-space: nowrap; flex: 0 0 auto; }
.agents-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agent-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.agent-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agent-name { min-width: 0; }
.agent-name h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 500; line-height: 1.25; }
.agent-name p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agent-state { flex: 0 0 auto; max-width: 104px; text-align: center; font-size: 9px; line-height: 1.5; border: 1px solid #c6d3ba; border-radius: 6px; padding: 4px 7px; color: #41603c; background: #edf3e6; }
.agent-state.is-pending { color: #836123; border-color: #d9c9a6; background: #f8f1e0; }
.agent-current { display: grid; gap: 4px; margin: 19px 0 0; }
.agent-current span, .agent-desired > span { color: var(--muted); font-size: 10px; }
.agent-current strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.agent-desired { display: grid; gap: 3px; color: #836123; font-size: 12px; margin: 9px 0 0; }
.agent-control-group { border: 0; margin: 18px 0 0; border-top: 1px solid var(--line); padding: 14px 0 0; min-width: 0; }
.agent-control-group legend { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; }
.agent-toggle { display: flex; align-items: center; gap: 9px; color: var(--body); font-size: 12px; min-height: 44px; cursor: pointer; width: fit-content; }
.agent-toggle input { appearance: none; width: 36px; height: 22px; border: 1px solid #a9b59b; border-radius: 20px; background: var(--green-wash); position: relative; margin: 0; cursor: pointer; flex: 0 0 auto; transition: background .15s; }
.agent-toggle input::before { content: ''; display: block; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8b9c7c; transition: transform .15s; }
.agent-toggle input:checked { background: #426748; border-color: #426748; }
.agent-toggle input:checked::before { transform: translateX(14px); background: #fbfff5; }
.agent-interval-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 12px; }
.agent-interval-heading label { color: var(--muted); font-size: 11px; }
.agent-interval-value { color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.agent-slider-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.agent-step { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--green-wash); color: var(--ink); font-size: 20px !important; line-height: 1; }
.agent-slider-row input[type='range'] { width: 100%; min-width: 0; height: 44px; padding: 0; margin: 0; accent-color: #587d4e; background: transparent; cursor: pointer; }
.agent-slider-limits { display: flex; justify-content: space-between; margin: 0 45px; color: var(--muted); font-size: 9px; }
.agent-control-hint { min-height: 3.3em; margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.agent-actions { display: grid; gap: 5px; margin-top: 13px; justify-items: start; }
.agent-actions .primary-button { font-size: 11px; padding: 10px 14px; min-height: 42px; }
.agent-checked { margin: 11px 0 0; color: var(--muted); font-size: 10px; }
.agent-gap { margin: 11px 0 0; padding: 9px 11px; border: 1px solid #d9c9a6; border-radius: 8px; background: #f8f1e0; color: #836123; font-size: 10px; overflow-wrap: anywhere; }
.agents-workers { display: grid; gap: 14px; margin-top: 20px; }
.agents-workers:empty { display: none; }
.agents-footnote { margin: 21px 0 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
@media (max-width: 620px) {
  .agents-dialog { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); border-radius: 17px; }
  .agents-head { padding: 18px 18px 15px; gap: 12px; }
  .agents-head h2 { font-size: 23px; }
  .agents-body { padding: 18px; }
  .agents-list { grid-template-columns: 1fr; gap: 12px; }
  .agent-card { padding: 18px; }
  .agents-toolbar { gap: 13px; align-items: flex-start; }
  .agents-status { font-size: 11px; }
  .agent-control-hint { min-height: 0; font-size: 11px; }
  .agent-actions { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
  .agent-actions .agents-text-button { font-size: 10px !important; text-align: left; }
  .agent-step { width: 42px; height: 42px; flex-basis: 42px; }
  .agent-slider-limits { margin-inline: 51px; }
  .agents-intro { font-size: 12px; }
}
@media (prefers-color-scheme: dark) {
  .agents-dialog::backdrop { background: #060b08b8; }
  .agent-state { color: #cde4c5; border-color: #657d59; background: #304332; }
  .agent-state.is-pending, .agent-gap { color: #e0c18d; border-color: #786342; background: #3a3021; }
  .agent-desired, .agents-status.is-error { color: #e0c18d; }
  .agent-toggle input { border-color: #657d59; }
  .agent-toggle input:checked { background: #507b50; border-color: #8ba87c; }
  .agent-slider-row input[type='range'] { accent-color: #a4bf8d; }
}
@media (prefers-reduced-motion: reduce) { .agents-dialog *, .agents-dialog *::before { transition: none !important; } }
