:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #57606a;
  --line: #d8d4ca;
  --accent: #2f6f4e;
  --accent-dark: #245a3e;
  --danger: #b42318;
  --focus: #1a5fb4;
  --radius: 10px;
  --gap: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 18px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap.narrow { max-width: 480px; }
h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.lead { color: var(--muted); max-width: 70ch; margin: 0 0 20px; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: var(--gap); }
.card.highlight { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 111, 78, .15); }
.grid2, .layout { display: grid; gap: var(--gap); }
@media (min-width: 800px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 2fr 1fr; align-items: start; }
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea, .status-form select, .copy input {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: inherit;
  border: 1px solid #8c959f; border-radius: 8px; background: #fff;
}
.field textarea { min-height: 88px; }
.hint { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.error { margin: 0 0 6px; font-size: 14px; color: var(--danger); font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); border-width: 2px; }
.req { color: var(--danger); }
.alert { border: 2px solid var(--danger); background: #fff5f4; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.alert p { margin: 4px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 8px;
  border: 1px solid var(--accent); background: #fff; color: var(--accent-dark); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #eef5f1; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .7; cursor: progress; }
.link { background: none; border: 0; padding: 8px 4px; font: inherit; color: var(--accent-dark); text-decoration: underline; cursor: pointer; min-height: 36px; }
.link.danger { color: var(--danger); }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.actions .primary { margin-left: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list p { margin: 4px 0 0; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #eef1ec; font-size: 13px; color: var(--text); }
.tag.agent { background: #e8eefb; }
.steps ol { display: flex; gap: 8px; list-style: none; padding: 0; margin: 4px 0 12px; flex-wrap: wrap; }
.steps li { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.steps li.current { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.tabs { display: flex; gap: 16px; margin: 18px 0 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 0; text-decoration: none; color: var(--muted); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom: 3px solid var(--accent); }
.status-form { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.status-form select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; }
@media (max-width: 560px) { .list.tasks li { flex-direction: column; } }
.copy { display: flex; gap: 8px; flex-wrap: wrap; }
.copy input { flex: 1 1 240px; }
details summary { cursor: pointer; min-height: 36px; padding: 6px 0; color: var(--accent-dark); font-weight: 600; }
.flash .msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #eef5f1; border: 1px solid #b7d3c3; }
.flash .msg-error { background: #fff5f4; border-color: #f0b8b2; }
.ok { color: var(--accent-dark); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.gnome { display: flex; gap: 10px; align-items: flex-start; }
.gnome-face { font-size: 26px; line-height: 1; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #eef1ec; border: 2px solid var(--line); flex-shrink: 0; }
.gnome-face.state-working, .gnome-face.state-queued { border-color: #c08a1e; background: #fdf4e3; }
.gnome-face.state-idle { border-color: var(--accent); }
.gnome-face.state-offline, .gnome-face.state-manual { opacity: .55; }
.state.state-working, .state.state-queued { color: #8a5a00; font-weight: 600; }
.state.state-idle { color: var(--accent-dark); }
.state.state-offline, .state.state-manual { color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.msg-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; max-width: 90%; background: #fff; }
.msg-row.mine { align-self: flex-end; background: #eef5f1; }
.msg-row.from-agent { background: #f3f6fd; }
.msg-row header { margin-bottom: 4px; }
.msg-text { overflow-wrap: anywhere; }
.delivery.d-failed { color: var(--danger); }
.delivery.d-queued, .delivery.d-running { color: #8a5a00; }
.send label { display: block; font-weight: 600; margin-bottom: 4px; }
.send textarea { width: 100%; min-height: 88px; padding: 10px 12px; font: inherit; border: 1px solid #8c959f; border-radius: 8px; margin-bottom: 8px; }
.howto { padding-left: 20px; }
.howto li { margin-bottom: 10px; }
.howto .copy { margin-top: 4px; }
code { background: #eef1ec; padding: 1px 5px; border-radius: 4px; font-size: 14px; overflow-wrap: anywhere; }
