* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, "Segoe UI", sans-serif; background: #f4f5f7; color: #1d2330; }
a { color: #1f5fbf; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1.5rem; background: #1d2330; }
/* Links to a message (#m12) land below the floating agent switcher. */
html { scroll-padding-top: 7.5rem; }
.top a, .top .who { color: #fff; text-decoration: none; margin-left: 1.2rem; }
.top .brand { margin-left: 0; font-weight: 600; }
.top .who { opacity: 0.7; }
nav { display: flex; align-items: center; }
main { max-width: 1000px; margin: 1.5rem auto; padding: 0 1rem; }
.card { background: #fff; border-radius: 8px; padding: 1.2rem 1.5rem; margin-bottom: 1.2rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.login-links { text-align: center; font-size: 0.85rem; color: #6b7280; }
h1 { font-size: 1.4rem; margin-top: 0; }
h2 { font-size: 1.1rem; }
label { display: block; margin-bottom: 0.9rem; font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 0.3rem; padding: 0.5rem; font: inherit; border: 1px solid #c8ccd4; border-radius: 5px; }
button { padding: 0.55rem 1.1rem; font: inherit; background: #1f5fbf; color: #fff; border: 0; border-radius: 5px; cursor: pointer; }
button.small { padding: 0.25rem 0.6rem; font-size: 0.85rem; background: #6b7280; }
button.link { background: none; padding: 0; color: #fff; margin-left: 1.2rem; }
form.inline { display: inline; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #eceef2; vertical-align: top; }
pre { white-space: pre-wrap; word-wrap: break-word; background: #f7f8fa; padding: 0.8rem; border-radius: 5px; font-family: Consolas, monospace; font-size: 0.9rem; }
.error { color: #a61b1b; background: #fdecec; padding: 0.6rem; border-radius: 5px; }
.notice { background: #fff6dd; border: 1px solid #f0d78c; padding: 0.6rem 0.9rem; border-radius: 5px; }
.meta { color: #6b7280; font-size: 0.9rem; }
.status { font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 10px; background: #e5e7eb; }
.status.done { background: #dcf5e3; color: #166534; }
.status.failed { background: #fdecec; color: #a61b1b; }
.status.running, .status.queued { background: #e0ecff; color: #1f5fbf; }
.badge { background: #d97706; color: #fff; border-radius: 9px; padding: 0 0.45rem; font-size: 0.8rem; }
.tabs a { margin-right: 1rem; text-decoration: none; padding-bottom: 0.2rem; }
.tabs a.active { font-weight: 600; border-bottom: 2px solid #1f5fbf; }
.approval { border: 1px solid #eceef2; border-left: 4px solid #d97706; border-radius: 6px; padding: 0.7rem 1rem; margin-bottom: 0.8rem; }
.approval.approved { border-left-color: #16a34a; }
.approval.rejected { border-left-color: #a61b1b; }
.approval-text { margin: 0 0 0.3rem; font-weight: 500; white-space: pre-wrap; }
form.decide { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
form.decide input { margin-top: 0; }
button.approve { background: #16a34a; }
button.reject { background: #a61b1b; }
.status.approved { background: #dcf5e3; color: #166534; }
.status.rejected { background: #fdecec; color: #a61b1b; }
.status.pending { background: #fef3c7; color: #92400e; }

/* The task request: the user's words, shown as written. */
.request { white-space: pre-wrap; word-wrap: break-word; background: #f4f7fb; border-left: 4px solid #1f5fbf; padding: 0.7rem 1rem; border-radius: 0 6px 6px 0; line-height: 1.5; }

/* Worker reports, rendered from Markdown by web/markdown.py. */
.report { line-height: 1.6; font-size: 0.97rem; overflow-wrap: anywhere; }
.report > :first-child { margin-top: 0; }
.report p { margin: 0.4rem 0 0.7rem; }
.report ul, .report ol { margin: 0.3rem 0 0.8rem; padding-left: 1.4rem; }
.report li { margin: 0.2rem 0; }
.report li > p { margin: 0.2rem 0; }
.report strong { font-weight: 600; color: #111827; }
.report a { word-break: break-all; }
.report h1, .report h2, .report h3, .report h4 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }
.report code { font-family: Consolas, monospace; font-size: 0.85em; background: #eef1f5; padding: 0.1rem 0.35rem; border-radius: 4px; }
.report pre { background: #f7f8fa; border: 1px solid #eceef2; }
.report pre code { background: none; padding: 0; }
.report blockquote { margin: 0.6rem 0; padding: 0.3rem 1rem; border-left: 3px solid #c8ccd4; color: #4b5563; }
.report table { margin: 0.6rem 0 1rem; font-size: 0.92rem; border: 1px solid #eceef2; }
.report th { background: #f4f5f7; font-weight: 600; }
.report hr { border: 0; border-top: 1px solid #eceef2; margin: 1rem 0; }

/* The six report sections. */
.report h3.section { display: flex; align-items: center; gap: 0.5rem; margin: 1.4rem 0 0.5rem; padding-bottom: 0.35rem; border-bottom: 1px solid #eceef2; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #4b5563; }
.report h3.section:first-child { margin-top: 0.2rem; }
.report h3.section::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #9ca3af; flex: none; }
.report h3.section-task::before { background: #1f5fbf; }
.report h3.section-actions::before { background: #6366f1; }
.report h3.section-results { color: #166534; }
.report h3.section-results::before { background: #16a34a; }
.report h3.section-issues { color: #a61b1b; }
.report h3.section-issues::before { background: #dc2626; }
.report h3.section-approval { color: #92400e; }
.report h3.section-approval::before { background: #d97706; }
.report h3.section-memory::before { background: #0891b2; }
.report h3.section-results + p, .report h3.section-results + ul, .report h3.section-results + ol { font-size: 1.02rem; }
.approval-text code { font-family: Consolas, monospace; font-size: 0.85em; background: #eef1f5; padding: 0.1rem 0.3rem; border-radius: 4px; }

/* Task conversations. */
.thread { margin-top: 1rem; }
.msg { margin-bottom: 1.1rem; }
.msg-head { font-size: 0.85rem; color: #6b7280; margin-bottom: 0.35rem; }
.msg-head strong { color: #1d2330; }
.msg-user { max-width: 85%; margin-left: auto; }
.msg-user .request { background: #e8f0fc; border-left: 0; border-radius: 12px 12px 2px 12px; padding: 0.65rem 0.95rem; }
.msg-user .msg-head { text-align: right; }
.msg-worker { border: 1px solid #eceef2; border-radius: 2px 12px 12px 12px; padding: 0.9rem 1.1rem; background: #fff; }
.msg-worker .report { margin-bottom: 0.4rem; }
h2.needs { font-size: 0.95rem; color: #92400e; margin: 0 0 0.6rem; }
.replies { font-size: 0.78rem; color: #1f5fbf; background: #e8f0fc; border-radius: 9px; padding: 0.05rem 0.45rem; margin-left: 0.3rem; white-space: nowrap; }
form.reply { border-top: 1px solid #eceef2; padding-top: 1rem; margin-top: 0.5rem; }
form.reply textarea { resize: vertical; }
button:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }

/* While the worker is busy. */
.working { padding: 0.2rem 0; }
.working-head { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; color: #1f5fbf; }
.elapsed { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; color: #6b7280; }
.spinner { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 3px solid #d6e3f8; border-top-color: #1f5fbf; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; padding: 0; margin: 0.8rem 0 0.4rem; }
.steps li { position: relative; padding: 0.2rem 0 0.2rem 1.6rem; color: #4b5563; font-size: 0.93rem; }
.steps li::before { content: "✓"; position: absolute; left: 0.2rem; color: #16a34a; font-weight: 700; }
.steps li.current { color: #1d2330; font-weight: 500; }
.steps li.current::before { content: ""; left: 0.3rem; top: 0.55rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #1f5fbf; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.25; } to { opacity: 1; } }
/* Floating button that jumps to the reply box (chat.js shows it). */
.to-prompt { position: fixed; right: 1.5rem; bottom: 1.5rem; width: 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #1f5fbf; color: #fff; font-size: 1.3rem; text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
.to-prompt.show { opacity: 1; pointer-events: auto; transform: none; }
.to-prompt:hover { background: #174a96; }
.to-prompt:focus-visible { opacity: 1; pointer-events: auto; outline: 3px solid #9cc0f5; }

/* Page content loads in; a task's answer fades in when it arrives. */
main { animation: load-in 0.12s ease-out both; }
.msg.arrived { animation: load-in 0.45s ease-out both; }
@keyframes load-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .spinner, .steps li.current::before, main, .msg.arrived { animation: none; } }

/* Sidebar (base.html, sidebar.js): conversations, like a chat app. */
body.has-sidebar { display: flex; min-height: 100vh; }
.page { flex: 1; min-width: 0; }
.sidebar { width: 260px; flex: none; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; background: #f9f9f9; border-right: 1px solid #e5e7eb; overflow: hidden; transition: margin-left 0.2s ease; }
html.side-closed .sidebar { margin-left: -261px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0.75rem 0.5rem 1rem; }
.side-brand { font-weight: 700; font-size: 1.15rem; color: #1d2330; text-decoration: none; }
.side-icons { display: flex; gap: 0.15rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.4rem; background: none; color: #5d6470; border-radius: 8px; }
.icon-btn:hover { background: #ececec; color: #1d2330; }
.side-new { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0.5rem; padding: 0.55rem 0.6rem; border-radius: 8px; color: #1d2330; text-decoration: none; }
.side-new:hover { background: #ececec; }
.side-search[hidden] { display: none; }
.side-search { margin: 0.4rem 0.75rem 0; width: auto; padding: 0.4rem 0.6rem; font-size: 0.9rem; }
.side-label { padding: 1rem 1rem 0.35rem; margin-top: 0.4rem; border-top: 1px solid #e5e7eb; font-size: 0.85rem; font-weight: 600; color: #8e8e8e; }
.side-list { display: block; flex: 1; overflow-y: auto; padding: 0 0.5rem 1rem; margin-top: 0.4rem; border-top: 1px solid #e5e7eb; }
.side-item { position: relative; display: flex; align-items: center; border-radius: 8px; }
.side-item[hidden] { display: none; }
.side-item:hover, .side-item:focus-within { background: #ececec; }
.side-item.active { background: #e3e4e8; font-weight: 500; }
.side-item a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.6rem; color: #1d2330; text-decoration: none; white-space: nowrap; }
.side-item a[hidden] { display: none; }
.side-more { display: inline-flex; align-items: center; padding: 0.3rem; margin-right: 0.25rem; background: none; color: #5d6470; border-radius: 6px; opacity: 0; }
.side-item:hover .side-more, .side-item.active .side-more, .side-more:focus-visible, .side-more.open { opacity: 1; }
.side-more:hover, .side-more.open { background: #dcdde2; color: #1d2330; }
@media (hover: none) { .side-more { opacity: 1; } }
.side-rename { flex: 1; margin: 0.2rem; padding: 0.3rem 0.5rem; font-size: 0.95rem; }
.side-list .side-label { border-top: 0; margin-top: 0; padding: 0.9rem 0.6rem 0.35rem; }
.side-menu { position: fixed; z-index: 30; min-width: 200px; padding: 0.4rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.side-menu[hidden] { display: none; }
.side-menu form { margin: 0; }
.side-menu button { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.55rem 0.7rem; background: none; color: #1d2330; border-radius: 8px; text-align: left; font-size: 0.95rem; }
.side-menu button:hover, .side-menu button:focus-visible { background: #f2f3f5; outline: none; }
.side-menu .danger button { color: #d93025; }
.side-menu .danger button:hover { background: #fdecea; }
.side-menu hr { border: 0; border-top: 1px solid #eceef2; margin: 0.35rem 0.2rem; }
.archived-note { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.side-title { overflow: hidden; text-overflow: ellipsis; }
.side-title strong { font-weight: 700; color: #111827; }
.side-list .dot { width: 0.5rem; height: 0.5rem; flex: none; border-radius: 50%; background: #1f5fbf; animation: pulse 0.9s ease-in-out infinite alternate; }
.side-empty { padding: 0 0.6rem; color: #8e8e8e; font-size: 0.9rem; }
.side-backdrop { display: none; }
/* Header: the open button shows only while the sidebar is closed, and the
   header's brand only then (the sidebar shows it otherwise). */
.top nav { margin-left: auto; }
.top .icon-btn { color: #fff; margin-right: 0.6rem; }
.top .icon-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.has-sidebar .top .side-open { display: none; }
html.side-closed .has-sidebar .top .side-open { display: inline-flex; }
html:not(.side-closed) .has-sidebar .top .brand { display: none; }
@media (max-width: 800px) {
  .sidebar { position: fixed; left: 0; z-index: 20; box-shadow: 2px 0 12px rgba(0, 0, 0, 0.18); }
  html:not(.side-closed) .side-backdrop { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.3); }
  html:not(.side-closed) .has-sidebar .top .brand { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } .side-list .dot { animation: none; } }

/* Agent picker (home.html), like a console's account picker. */
.stage { margin: 0 auto; padding: 3.2rem 1.5rem 3.6rem; border-radius: 22px; text-align: center; color: #fff;
  background: radial-gradient(ellipse at 50% 0%, #2b3f6b 0%, #16213a 55%, #0c1222 100%); box-shadow: 0 10px 30px rgba(12, 18, 34, 0.25); }
.stage h1 { font-size: 1.7rem; font-weight: 600; margin: 0 0 2.4rem; letter-spacing: 0.01em; }
.agents { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.2rem 2.6rem; }
.agent { display: flex; flex-direction: column; align-items: center; width: 190px; color: #fff; text-decoration: none; border-radius: 16px; outline: none; }
.avatar { display: block; width: 170px; height: 170px; border-radius: 50%; overflow: hidden; flex: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, box-shadow 0.22s ease; }
.avatar img { display: block; width: 100%; height: 100%; }
.avatar-standard-worker { background: radial-gradient(circle at 50% 30%, #fff27a, #ffc400 55%, #f09a00); }
.avatar-research-worker { background: radial-gradient(circle at 50% 30%, #7cc4ff, #1f7bf2 55%, #0a4fc2); }
.avatar-trainer-worker { background: radial-gradient(circle at 50% 30%, #ff8a80, #f2323f 55%, #c4101f); }
.avatar-business-analyst { background: radial-gradient(circle at 50% 30%, #86efac, #16a34a 55%, #0f7a35); }
.avatar-virtual-action-executor { background: radial-gradient(circle at 50% 30%, #fdba74, #f97316 55%, #c2510a); }
.avatar-website-orchestrator { background: radial-gradient(circle at 50% 30%, #c9a6ff, #8a4dff 55%, #5b22c9); }
.agent-name { margin-top: 1.1rem; font-size: 1.12rem; font-weight: 600; }
.agent-tag { margin-top: 0.25rem; font-size: 0.9rem; color: #aab6cf; }
/* The orchestrator sits on its own row below the workers. */
.agents-lead { margin-top: 2.4rem; padding-top: 2.2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.agents-lead .agent { width: 260px; }
.agent:hover .avatar, .agent:focus-visible .avatar { transform: scale(1.09);
  box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgba(120, 170, 255, 0.45), 0 16px 34px rgba(0, 0, 0, 0.45); }
.agent:hover .agent-name, .agent:focus-visible .agent-name { color: #fff; text-shadow: 0 0 12px rgba(150, 190, 255, 0.6); }
/* The new-task page for one agent. */
.composer-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.1rem; }
.composer-head h1 { margin: 0 0 0.2rem; }
.composer-head .meta { margin: 0; }
.avatar-small { width: 84px; height: 84px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
@media (prefers-reduced-motion: reduce) { .avatar { transition: none; } }

/* Confirmation dialog (base.html #confirm-delete). */
.modal { width: min(420px, calc(100vw - 2rem)); padding: 1.5rem 1.6rem 1.3rem; border: 0; border-radius: 16px; background: #fff; color: #1d2330;
  box-shadow: 0 24px 60px rgba(12, 18, 34, 0.35); }
.modal::backdrop { background: rgba(12, 18, 34, 0.45); backdrop-filter: blur(2px); }
.modal[open] { animation: load-in 0.18s ease-out both; }
.modal h2 { margin: 0 0 0.6rem; font-size: 1.2rem; }
.modal p { margin: 0 0 0.6rem; line-height: 1.45; }
.modal strong { word-break: break-word; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
.btn-secondary { background: #fff; color: #1d2330; border: 1px solid #c8ccd4; border-radius: 999px; padding: 0.5rem 1.2rem; }
.btn-secondary:hover { background: #f2f3f5; }
.btn-danger { background: #d93025; color: #fff; border-radius: 999px; padding: 0.5rem 1.2rem; font-weight: 600; }
.btn-danger:hover { background: #b3261e; }
.notice-page { margin-top: 3rem; }
.notice-page h1 { margin-bottom: 0.6rem; }
.notice-page p { line-height: 1.5; }
.button-link { display: inline-block; margin-top: 0.4rem; padding: 0.55rem 1.2rem; background: #1f5fbf; color: #fff; border-radius: 999px; text-decoration: none; }
.button-link:hover { background: #174a96; }
.modal-warning { padding: 0.6rem 0.8rem; border-radius: 10px; background: #fff4e5; border: 1px solid #f5c98b; color: #7a4a00; }
.modal-warning[hidden], .modal-actions button[hidden] { display: none; }

/* Tips page (tips.html). */
.tips-hero { padding: 2.4rem 2rem; margin-bottom: 1.6rem; border-radius: 22px; color: #fff;
  background: radial-gradient(ellipse at 20% 0%, #3b5aa6 0%, #1c2a4f 50%, #0f1730 100%); box-shadow: 0 10px 30px rgba(12, 18, 34, 0.2); }
.tips-hero h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
.tips-hero p { margin: 0; max-width: 640px; color: #c9d4ee; line-height: 1.5; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.tip-card { background: #fff; border-radius: 18px; padding: 1.3rem 1.4rem 1.4rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease; }
.tip-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(12, 18, 34, 0.12); }
.tip-card-lead { grid-column: 1 / -1; }
.tip-head { display: flex; align-items: center; gap: 1rem; }
.tip-head h2 { margin: 0 0 0.2rem; font-size: 1.2rem; }
.tip-head .meta { margin: 0; line-height: 1.4; }
.avatar-tip { width: 72px; height: 72px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.tip-skills { margin: 1rem 0 0; padding: 0; list-style: none; }
.tip-skills li { position: relative; padding: 0.3rem 0 0.3rem 1.5rem; line-height: 1.4; }
.tip-skills li::before { content: ""; position: absolute; left: 0.2rem; top: 0.72rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #1f5fbf; opacity: 0.75; }
.tip-label { margin: 1rem 0 0.5rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8e8e8e; }
.tip-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tip-chip { display: inline-block; padding: 0.45rem 0.85rem; border-radius: 999px; background: #eef3fc; color: #1d3f7a; text-decoration: none;
  font-size: 0.92rem; line-height: 1.3; border: 1px solid #d8e3f6; transition: background 0.15s, border-color 0.15s; }
.tip-chip:hover, .tip-chip:focus-visible { background: #dfe9fb; border-color: #a9c1ec; }
.tips-section { margin: 2.2rem 0 0.9rem; font-size: 1.3rem; }
.tips-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tip-feature { background: #fff; border-radius: 14px; padding: 1rem 1.1rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.tip-feature h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.tip-feature p { margin: 0; color: #4a5160; line-height: 1.45; font-size: 0.93rem; }
.tip-only { margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #eceef2; color: #6b7280; font-size: 0.72rem; font-weight: 600; vertical-align: middle; }
.tips-limits { margin: 0 0 2rem; padding: 1.1rem 1.4rem 1.1rem 2.6rem; background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.tips-limits li { margin: 0.45rem 0; line-height: 1.5; color: #3a4150; }
@media (prefers-reduced-motion: reduce) { .tip-card { transition: none; } }
.side-new + .side-new { margin-top: 0; }
.side-new.active { background: #e3e4e8; font-weight: 500; }

/* Tasks page (todo.html), like a personal to-do app. */
.todo-lists { display: block; }
.todo-app { display: grid; grid-template-columns: 220px 1fr; gap: 1.4rem; align-items: start; }
.todo-lists h1 { font-size: 1.4rem; margin: 0.3rem 0 0.9rem 0.6rem; }
.todo-list-link { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.8rem; border-radius: 999px; color: #1d2330; text-decoration: none; }
.todo-list-link:hover { background: #e9ebef; }
.todo-list-link.active { background: #dbe6fa; color: #174a96; font-weight: 600; }
.todo-count { font-size: 0.8rem; color: #6b7280; }
.todo-new-list { margin-top: 0.6rem; }
.todo-new-list summary, .todo-add summary, .todo-menu summary, .todo-done summary { cursor: pointer; list-style: none; }
.todo-new-list summary::-webkit-details-marker, .todo-add summary::-webkit-details-marker,
.todo-menu summary::-webkit-details-marker, .todo-done summary::-webkit-details-marker,
.todo-body summary::-webkit-details-marker { display: none; }
.todo-new-list summary { padding: 0.55rem 0.8rem; color: #1f5fbf; border-radius: 999px; }
.todo-new-list summary:hover { background: #e9ebef; }
.todo-new-list form { padding: 0.5rem 0.4rem; }
.small-blue { padding: 0.4rem 0.95rem; border-radius: 999px; font-size: 0.92rem; }
.link-danger { background: none; color: #d93025; padding: 0.3rem 0; font-size: 0.92rem; }
.link-danger:hover { text-decoration: underline; }
.todo-main { padding: 1.3rem 1.5rem 1.2rem; }
.todo-head { display: flex; justify-content: space-between; align-items: center; }
.todo-head h2 { margin: 0; font-size: 1.35rem; }
.todo-menu { position: relative; }
.todo-menu summary { padding: 0.15rem 0.6rem; border-radius: 8px; font-size: 1.3rem; color: #5d6470; }
.todo-menu summary:hover { background: #f0f1f4; }
.todo-menu-body { position: absolute; right: 0; z-index: 5; width: 260px; padding: 0.9rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.todo-add { margin: 1rem 0 0.4rem; }
.todo-add summary { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.9rem 0.45rem 0.5rem; border-radius: 999px; color: #1f5fbf; font-weight: 500; }
.todo-add summary:hover { background: #eef3fc; }
.todo-plus { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #1f5fbf; color: #fff; font-size: 1.15rem; line-height: 1; }
.todo-add form { margin-top: 0.7rem; padding: 0.9rem 1rem 0.6rem; border: 1px solid #e3e6ec; border-radius: 12px; }
.todo-add-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.todo-items { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.todo-item { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.55rem 0.2rem; border-bottom: 1px solid #f0f1f4; }
.todo-item:last-child { border-bottom: 0; }
.todo-item form { margin: 0; }
.todo-check { width: 1.35rem; height: 1.35rem; margin-top: 0.12rem; padding: 0; border-radius: 50%; border: 2px solid #8a93a3; background: #fff; color: #fff; font-size: 0.8rem; line-height: 1; flex: none; }
.todo-check:hover { border-color: #1f5fbf; background: #eef3fc; }
.todo-check.checked { background: #1f5fbf; border-color: #1f5fbf; }
.todo-body, .todo-body-static { flex: 1; min-width: 0; }
.todo-body summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.todo-title { line-height: 1.4; word-break: break-word; }
.todo-details { font-size: 0.88rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.todo-due { display: inline-block; margin-top: 0.15rem; padding: 0.1rem 0.6rem; border: 1px solid #c8ccd4; border-radius: 999px; font-size: 0.8rem; color: #3a4150; }
.todo-due.overdue { border-color: #f1b5b0; color: #c5221f; background: #fdecea; }
.todo-edit { margin: 0.7rem 0 0.3rem; padding: 0.8rem 0.9rem 0.5rem; border: 1px solid #e3e6ec; border-radius: 12px; }
.todo-star { background: none; padding: 0 0.25rem; font-size: 1.2rem; line-height: 1.3; color: #9aa1ad; }
.todo-star:hover { color: #5d6470; }
.todo-star.on { color: #1f5fbf; }
.todo-x { background: none; padding: 0 0.3rem; font-size: 1.3rem; line-height: 1; color: #9aa1ad; }
.todo-x:hover { color: #d93025; }
.is-done .todo-title { text-decoration: line-through; color: #8a93a3; }
.todo-empty { margin: 1.2rem 0.3rem; color: #6b7280; }
.todo-done { margin-top: 1rem; border-top: 1px solid #eceef2; padding-top: 0.8rem; }
.todo-done summary { font-weight: 600; color: #3a4150; padding: 0.2rem 0; }
.todo-done summary::before { content: "\25B8"; display: inline-block; margin-right: 0.45rem; transition: transform 0.15s; }
.todo-done[open] summary::before { transform: rotate(90deg); }
@media (max-width: 800px) { .todo-app { grid-template-columns: 1fr; } }

/* Stop button in the "Working on it" box, and a stopped message. */
.working-head .elapsed { margin-left: auto; }
.stop-form { margin: 0; }
.btn-stop { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.85rem; border-radius: 999px; background: #fff; color: #1d2330; border: 1px solid #c8ccd4; font-size: 0.88rem; font-weight: 500; }
.btn-stop:hover { background: #f2f3f5; border-color: #9aa1ad; }
.stop-square { width: 0.6rem; height: 0.6rem; border-radius: 2px; background: currentColor; }
.stopped-note { margin: 0.2rem 0; color: #6b7280; font-style: italic; }
.success { color: #14532d; background: #e6f6ec; padding: 0.6rem; border-radius: 5px; }
.top a.who:hover { opacity: 1; text-decoration: underline; }
.answer-tools { display: flex; gap: 0.3rem; margin-top: 0.5rem; }
.tool-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem; border-radius: 8px; background: none; color: #6b7280; font-size: 0.85rem; }
.tool-btn:hover { background: #f0f1f4; color: #1d2330; }

/* Tasks page: one box for the task; its first line is the task's name. */
.todo-text { margin: 0 0 0.7rem; padding: 0.45rem 0.1rem; font-size: 1.02rem; line-height: 1.45; border: 0; border-bottom: 1px solid #d5d9e0; border-radius: 0; resize: vertical; }
.todo-text:focus { outline: none; border-bottom: 2px solid #1f5fbf; padding-bottom: calc(0.45rem - 1px); }
.todo-text::placeholder { color: #9aa1ad; }

/* Due date chips (todo.html when_picker): Today, Tomorrow, clock. */
.todo-add-row { align-items: center; }
.todo-when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.3rem 0.85rem; background: #fff; color: #3a4150; border: 1px solid #c8ccd4; border-radius: 999px; font-size: 0.88rem; font-weight: 500; line-height: 1.2; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip:hover { background: #f2f4f7; }
.chip.on { background: #dbe6fa; border-color: #a9c2ee; color: #174a96; }
.chip-clock { padding: 0.3rem 0.55rem; }
.chip-clock span:empty { display: none; }
.when-input { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.chip-clear { margin: 0; padding: 0 0.3rem; background: none; color: #8a93a3; font-size: 1.15rem; line-height: 1; }
.chip-clear:hover { color: #d93025; }
.chip-clear[hidden] { display: none; }

/* Tasks page animations (todo.js adds the classes). */
.todo-item { transition: background 0.15s; border-radius: 8px; }
.todo-item:hover { background: #fafbfc; }
.todo-check { transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.todo-check:active { transform: scale(0.88); }
.todo-check.ticking { background: #1f5fbf; border-color: #1f5fbf; animation: todo-tick 0.3s ease-out both; }
.todo-item.todo-leaving { animation: todo-leave 0.42s ease-in 0.12s both; pointer-events: none; }
.todo-item.todo-removing { animation: todo-remove 0.26s ease-in both; }
.todo-item.is-done.todo-leaving .todo-check { background: #fff; color: transparent; border-color: #8a93a3; }
.todo-item.todo-leaving:not(.is-done):not(.todo-removing) .todo-title { text-decoration: line-through; color: #8a93a3; transition: color 0.2s; }
.todo-item.todo-enter { animation: todo-enter 0.38s ease-out both; }
.todo-star { transition: color 0.15s, transform 0.15s; }
.todo-star:hover { transform: scale(1.15); }
.todo-star.pop { animation: todo-pop 0.35s ease-out; }
.todo-add[open] form, .todo-body[open] .todo-edit, .todo-done[open] > ul,
.todo-menu[open] .todo-menu-body, .todo-new-list[open] form { animation: todo-open 0.2s ease-out both; }
.todo-plus { transition: transform 0.2s ease; }
.todo-add[open] .todo-plus { transform: rotate(45deg); }
.todo-list-link { transition: background 0.15s, color 0.15s; }
@keyframes todo-tick { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes todo-leave { to { opacity: 0; transform: translateX(28px); } }
@keyframes todo-remove { to { opacity: 0; transform: scale(0.96); } }
@keyframes todo-enter { from { opacity: 0; transform: translateY(-6px); background: #e8f0fd; } 60% { opacity: 1; transform: none; background: #e8f0fd; } to { background: transparent; } }
@keyframes todo-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes todo-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .todo-item, .todo-check, .todo-star, .todo-plus, .todo-list-link, .chip { transition: none; }
  .todo-check.ticking, .todo-item.todo-leaving, .todo-item.todo-removing, .todo-item.todo-enter, .todo-star.pop,
  .todo-add[open] form, .todo-body[open] .todo-edit, .todo-done[open] > ul,
  .todo-menu[open] .todo-menu-body, .todo-new-list[open] form { animation: none; }
  .todo-star:hover { transform: none; }
}

/* Voice (voice.js): Speak into message boxes; Listen / Play voice memo. */
.send-row { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; }
.mic-btn, [data-speak] { display: none; }
html.can-speak .mic-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.9rem; background: #fff; color: #1d2330; border: 1px solid #c8ccd4; border-radius: 999px; }
html.can-speak .mic-btn:hover { background: #f2f4f7; }
.mic-btn.on { background: #fdecea; border-color: #f1b5b0; color: #c5221f; }
.mic-btn.on svg { animation: pulse 0.8s ease-in-out infinite alternate; }
html.can-listen .tool-btn[data-speak] { display: inline-flex; }
html.can-listen .play-memo { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0.2rem 0 0.8rem; padding: 0.6rem 1.2rem 0.6rem 0.8rem; border-radius: 999px; font-weight: 600; }
.play-icon { width: 0; height: 0; border-left: 0.75rem solid currentColor; border-top: 0.45rem solid transparent; border-bottom: 0.45rem solid transparent; }
.play-memo.on .play-icon { width: 0.7rem; height: 0.7rem; border: 0; background: currentColor; border-radius: 2px; }
.tool-btn[data-speak].on { color: #1f5fbf; background: #eef3fc; }
.memo-request { display: flex; align-items: center; gap: 0.45rem; font-style: italic; }
.voice-memo .report { font-size: 1.02rem; }
@media (prefers-reduced-motion: reduce) { .mic-btn.on svg { animation: none; } }

/* Live browser (browser.js): the card in the conversation and the side panel. */
.browser-card { max-width: 380px; margin: 0.4rem 0 1rem; padding: 0.9rem; border: 1px solid #e3e6ec; border-radius: 16px; background: #fafbfc; }
.browser-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; color: #1f5fbf; }
.browser-card-head strong { display: block; color: #1d2330; }
.browser-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid #e3e6ec; border-radius: 10px; background: #fff; margin-bottom: 0.7rem; }
.browser-card [data-browser-open] { width: 100%; }
.browser-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(760px, 58vw); display: flex; flex-direction: column; background: #fff; border-left: 1px solid #e3e6ec; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08); animation: bp-in 0.2s ease-out both; }
.browser-panel[hidden] { display: none; }
body.browser-open .page { margin-right: min(760px, 58vw); }
@keyframes bp-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.bp-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid #eceef2; }
.bp-title { flex: 1; min-width: 0; }
.bp-title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-stop { display: inline-flex; align-items: center; gap: 0.4rem; background: none; color: #d93025; font-weight: 600; padding: 0.4rem 0.6rem; }
.bp-stop:hover { background: #fdecea; }
.bp-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid currentColor; box-shadow: inset 0 0 0 2px #fff; background: currentColor; }
.bp-control { border-radius: 999px; padding: 0.5rem 1rem; white-space: nowrap; }
.bp-control.on { background: #16a34a; }
.bp-close { font-size: 1.5rem; line-height: 1; }
.bp-tabs { display: flex; gap: 0.4rem; padding: 0.5rem 1rem; border-bottom: 1px solid #eceef2; min-height: 2.6rem; flex-wrap: wrap; }
.bp-tab { padding: 0.25rem 0.8rem; border: 1px solid #e3e6ec; border-radius: 8px; font-size: 0.88rem; color: #5d6470; }
.bp-tab.current { color: #1d2330; border-color: #c8ccd4; background: #f6f7f9; }
.bp-view { position: relative; flex: 1; overflow: auto; background: #f3f4f6; }
.bp-view img { display: block; width: 100%; height: auto; user-select: none; }
.in-control .bp-view img { cursor: pointer; outline: 3px solid #16a34a; outline-offset: -3px; }
.bp-approval { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 1rem; background: rgba(17, 24, 39, 0.35); }
.bp-approval[hidden] { display: none; }
.bp-approval-box { width: 100%; max-width: 620px; padding: 1.1rem 1.2rem; background: #1f2430; color: #f3f4f6; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); animation: load-in 0.18s ease-out both; }
.bp-approval-box .meta { color: #b6bcc8; margin: 0.4rem 0 0.8rem; }
.bp-approval-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; }
.bp-warning { margin: 0 0 0.8rem; padding: 0.5rem 0.7rem; border-radius: 8px; background: #5c1d1a; color: #ffd9d6; font-weight: 600; }
.bp-approval-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bp-approval-actions button { border-radius: 999px; }
.bp-approval-actions .btn-secondary { background: #2d3341; color: #f3f4f6; border-color: #3b4252; }
.bp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.7rem 1rem; border-top: 1px solid #eceef2; }
.bp-controls[hidden] { display: none; }
.bp-controls input { flex: 1 1 220px; width: auto; margin: 0; }
.bp-controls button { padding: 0.4rem 0.8rem; }
@media (max-width: 900px) { .browser-panel { width: 100vw; } body.browser-open .page { margin-right: 0; } }
@media (prefers-reduced-motion: reduce) { .browser-panel, .bp-approval-box { animation: none; } }

/* Floating agent switcher (base.html, agentbar.js): a bubble over the top
   of the page that stays while scrolling. One agent in the centre with its
   status; the neighbours faded at the sides. */
.agent-float { position: sticky; top: 0.6rem; z-index: 25; height: 0; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.agent-float ~ main { padding-top: 4.6rem; }
.af-bubble { pointer-events: auto; display: flex; align-items: center; gap: 0.1rem; margin-top: 0.6rem; padding: 0.35rem 0.5rem; border-radius: 26px; background: rgba(29, 35, 48, 0.9); backdrop-filter: blur(8px); box-shadow: 0 8px 26px rgba(15, 23, 42, 0.28); color: #fff; animation: af-in 0.3s ease-out both; }
@keyframes af-in { from { opacity: 0; transform: translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }
.af-bubble { position: relative; overflow: hidden; }
/* The countdown before switching to the agent in the centre (agentbar.js). */
.af-bubble::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #6ea8ff; transform: scaleX(0); transform-origin: left; opacity: 0; }
.af-bubble.going::after { opacity: 1; animation: af-go var(--go-delay, 2000ms) linear forwards; }
@keyframes af-go { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.af-arrow { width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50%; background: none; color: #cfd5e1; font-size: 1.5rem; line-height: 1; }
.af-arrow:hover, .af-arrow:focus-visible { background: rgba(255, 255, 255, 0.14); color: #fff; outline: none; }
.af-track { position: relative; width: 190px; height: 76px; transition: width 0.28s ease, height 0.28s ease; }
.af-agent { position: absolute; top: 50%; left: 50%; width: 110px; display: flex; flex-direction: column; align-items: center; color: #fff; text-decoration: none; opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5); transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), opacity 0.3s ease; }
.af-agent.pos-center { opacity: 1; pointer-events: auto; z-index: 2; transform: translate(-50%, -50%) scale(1); }
.af-agent.pos-left, .af-agent.pos-right { opacity: 0.4; pointer-events: auto; z-index: 1; }
.af-agent.pos-left { transform: translate(calc(-50% - 60px), -62%) scale(0.66); }
.af-agent.pos-right { transform: translate(calc(-50% + 60px), -62%) scale(0.66); }
.af-agent.pos-left:hover, .af-agent.pos-right:hover { opacity: 0.75; }
.af-face { position: relative; width: 42px; height: 42px; overflow: visible; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); }
.af-face img { border-radius: 50%; }
.af-agent.pos-center:hover .af-face { transform: scale(1.08); }
.af-name { margin-top: 0.25rem; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.af-label { font-size: 0.7rem; color: #b6bcc8; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.25rem; }
.af-name, .af-label { max-height: 1.4em; overflow: hidden; transition: opacity 0.2s ease, max-height 0.28s ease, margin 0.28s ease; }
.af-agent:not(.pos-center) .af-name, .af-agent:not(.pos-center) .af-label { visibility: hidden; }
.af-dot { position: absolute; right: -1px; top: -1px; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid #1d2330; display: none; }
.af-agent[data-status="working"] .af-dot { display: block; background: #4f9bff; animation: pulse 0.9s ease-in-out infinite alternate; }
.af-agent[data-status="approval"] .af-dot { display: block; background: #ffb020; }
.af-agent[data-status="stopped"] .af-dot { display: block; background: #9aa1ad; }
.af-agent[data-status="approval"] .af-label { color: #ffcf70; }
.af-agent[data-status="working"] .af-label { color: #9cc6ff; }
.af-agent.changed .af-face { animation: af-bump 0.5s ease-out; }
@keyframes af-bump { 40% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .af-bubble, .af-agent { animation: none; transition: none; } .af-agent[data-status="working"] .af-dot, .af-agent.changed .af-face { animation: none; } }

/* Browser recording replay (replay.js): reuses the browser panel's look. */
.replay-icon { font-size: 1.25rem; line-height: 1; }
.replay-panel .bp-tabs button.bp-tab { background: none; color: #5d6470; cursor: pointer; }
.replay-panel .bp-tabs button.bp-tab.current { color: #1d2330; background: #f6f7f9; }
.replay-panel .bp-view { flex: 1 1 auto; min-height: 0; }
.rp-controls { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-top: 1px solid #eceef2; }
.rp-controls button { padding: 0.35rem 0.75rem; border-radius: 999px; }
.rp-controls input[type=range] { flex: 1; margin: 0; padding: 0; border: 0; }
.rp-time { white-space: nowrap; }
.rp-log { flex: 0 0 auto; max-height: 26vh; overflow-y: auto; margin: 0; padding: 0.4rem 1rem 0.8rem 2.2rem; border-top: 1px solid #eceef2; font-size: 0.88rem; color: #3a4150; }
.rp-log li { margin: 0.15rem 0; }
.rp-when { color: #8a93a3; font-variant-numeric: tabular-nums; }
.rp-log li.rp-decision { font-weight: 600; color: #174a96; }

/* Voice typing status (voice.js): what the microphone is doing, or why not. */
.mic-status { flex: 1; min-width: 0; font-size: 0.85rem; color: #1f5fbf; text-align: right; }
.mic-status.problem { color: #c5221f; }

/* Smooth page changes (Chrome / Edge): pages cross-fade instead of blanking,
   while the sidebar, top bar and agent bubble stay still. Other browsers
   simply change pages as before. */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
header.top { view-transition-name: top-bar; }
.af-bubble { view-transition-name: agent-bubble; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.16s; animation-timing-function: ease-out; }
::view-transition-group(sidebar), ::view-transition-group(top-bar), ::view-transition-group(agent-bubble) { animation-duration: 0.16s; }
/* With the cross-fade, the page needn't also slide in on its own. */
@supports (view-transition-name: none) { main { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* A button whose form is being sent (ui.js): a small spinner, no double sends. */
button.is-busy { position: relative; cursor: progress; opacity: 0.85; }
button.is-busy::after { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-left: 0.45em; vertical-align: -0.1em;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
button:disabled.is-busy { opacity: 0.85; cursor: progress; }
/* Pressing a button gives a little feedback. */
button:not(:disabled):active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { button.is-busy::after { animation: none; } button:not(:disabled):active { transform: none; } }

/* Small until hovered (agentbar.js): only the current agent and its name.
   The arrows, side agents and status appear on hover, keyboard focus and
   during the switch countdown; always open on touch screens. Shrinks after
   a short pause, not instantly. */
.af-arrow { transition: width 0.28s ease, opacity 0.2s ease; overflow: hidden; flex: none; }
@media (hover: hover) {
  .af-bubble:not(:hover):not(:focus-within):not(.going) .af-track { width: 130px; height: 66px; transition-delay: 0.25s; }
  .af-bubble:not(:hover):not(:focus-within):not(.going) .af-arrow {
    width: 0; opacity: 0; pointer-events: none; transition-delay: 0.25s; }
  .af-bubble:not(:hover):not(:focus-within):not(.going) .af-agent.pos-left,
  .af-bubble:not(:hover):not(:focus-within):not(.going) .af-agent.pos-right {
    opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.5); transition-delay: 0.25s; }
  .af-bubble:not(:hover):not(:focus-within):not(.going) .af-label {
    max-height: 0; opacity: 0; margin: 0; transition-delay: 0.25s; }
  /* An agent out of sight needs approval: a small orange dot on the bubble. */
  .af-bubble.needs-you:not(:hover):not(:focus-within):not(.going)::before {
    content: ""; position: absolute; top: 0.45rem; right: 0.6rem; width: 0.55rem; height: 0.55rem;
    border-radius: 50%; background: #ffb020; box-shadow: 0 0 0 2px #1d2330; z-index: 3; }
}
@media (prefers-reduced-motion: reduce) { .af-track, .af-name, .af-label { transition: none; } }

/* The exit button at the top of the new-task and conversation pages. */
.exit-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; margin: 0 0 0.6rem; border-radius: 50%; color: #5d6470; background: #fff; border: 1px solid #e3e6ec; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s; }
.exit-btn:hover, .exit-btn:focus-visible { background: #eef0f4; color: #1d2330; }
.exit-btn:active { transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) { .exit-btn, .af-arrow { transition: none; } }

/* The Orchestrator's "+" (mention.js): call a worker into the task. */
.mention-picker { position: relative; margin-right: auto; }
.mention-btn { width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; background: #f2eaff; color: #5b22c9; border: 1px solid #d9c6ff; font-size: 1.5rem; line-height: 1; font-weight: 500; transition: background 0.15s, transform 0.15s; }
.mention-btn:hover, .mention-btn[aria-expanded="true"] { background: #e6d6ff; }
.mention-btn[aria-expanded="true"] { transform: rotate(45deg); }
.mention-menu { position: absolute; bottom: calc(100% + 0.5rem); left: 0; z-index: 30; width: 270px; padding: 0.4rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); animation: load-in 0.16s ease-out both; }
.mention-menu[hidden] { display: none; }
.mention-head { margin: 0.25rem 0.5rem 0.35rem; font-size: 0.8rem; font-weight: 600; color: #8a93a3; }
.mention-menu button { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.45rem 0.5rem; background: none; color: #1d2330; border-radius: 10px; text-align: left; }
.mention-menu button:hover, .mention-menu button:focus-visible { background: #f4f1fb; outline: none; }
.mention-menu button strong { display: block; font-size: 0.92rem; }
.mention-menu button .meta { display: block; font-size: 0.78rem; }
.mention-face { width: 34px; height: 34px; box-shadow: none; }
/* @-mentions in the conversation (web/mentions.py). */
.mention { display: inline-block; padding: 0 0.45rem; border-radius: 999px; font-weight: 600; font-size: 0.92em; }
.mention-standard-worker { background: #fff3c4; color: #8a5a00; }
.mention-research-worker { background: #dceaff; color: #174a96; }
.mention-trainer-worker { background: #ffe0e2; color: #a3121f; }
@media (prefers-reduced-motion: reduce) { .mention-btn, .mention-menu { transition: none; animation: none; } }

/* Choosing a microphone after a silent recording (voice.js). */
.mic-choice { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin: 0.5rem 0 0; font-size: 0.88rem; font-weight: 500; color: #3a4150; }
.mic-choice select { width: auto; max-width: 340px; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.88rem; }

/* ===== Rhodium Robots look (rhodiumrobots.com) =====
   Cream page, near-black ink with heavy rules, gold buttons, orange accents,
   square corners, Jost headings and bold uppercase Inter buttons. Fonts are
   served from /static/fonts (the CSP allows only this site). This block only
   overrides the rules above; delete it to go back to the old look. */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/static/fonts/jost.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/fonts/inter.woff2") format("woff2"); }
:root { --rr-ink: #0a0a0a; --rr-cream: #f6f3ef; --rr-cream-2: #ece6dd; --rr-gold: #ffd700; --rr-orange: #ff5500; --rr-link: #b83c00; --rr-muted: #5f5a52; }
body { font-family: "Inter", system-ui, "Segoe UI", sans-serif; background: var(--rr-cream); color: var(--rr-ink); }
a { color: var(--rr-link); }
h1, h2, h3, .side-brand, .top .brand, .stage h1, .tips-hero h1, .agent-name, .modal h2 { font-family: "Jost", "Inter", sans-serif; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
.meta { color: var(--rr-muted); }

/* Top bar: black with gold, like their header strip. */
.top { background: var(--rr-ink); border-bottom: 4px solid var(--rr-gold); }
.top a:hover, .top a.who:hover { color: var(--rr-gold); }
.top .brand { text-transform: uppercase; letter-spacing: 0.12em; }

/* Boxes: square, outlined, flat. */
.card, .tip-card, .tip-feature, .tips-limits, .msg-worker, .todo-main, .browser-card { border-radius: 0; border: 2px solid var(--rr-ink); box-shadow: none; }
.tip-card:hover { box-shadow: 6px 6px 0 var(--rr-orange); }
.modal, .side-menu, .todo-menu-body, .mention-menu { border-radius: 0; border: 2px solid var(--rr-ink); }
input, select, textarea { border: 2px solid var(--rr-ink); border-radius: 0; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--rr-gold); outline-offset: 0; }
.todo-text { border: 0; border-bottom: 2px solid var(--rr-ink); }
.todo-text:focus { outline: none; border-bottom: 3px solid var(--rr-orange); }
pre, .report pre, .report code, .approval-text code { border-radius: 0; background: var(--rr-cream-2); }
th, td { border-bottom-color: var(--rr-cream-2); }
.report th { background: var(--rr-cream-2); }

/* Buttons: gold, black text, bold uppercase, square. */
button, .button-link { background: var(--rr-gold); color: var(--rr-ink); border-radius: 0; font-family: "Inter", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; }
button:hover, .button-link:hover { background: var(--rr-ink); color: var(--rr-gold); }
button.small { background: var(--rr-ink); color: #fff; }
button.link { background: none; color: #fff; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 1rem; }
button.link:hover { background: none; color: var(--rr-gold); }
.btn-secondary, .btn-stop, html.can-speak .mic-btn { background: #fff; color: var(--rr-ink); border: 2px solid var(--rr-ink); border-radius: 0; }
.btn-secondary:hover, .btn-stop:hover, html.can-speak .mic-btn:hover { background: var(--rr-cream-2); color: var(--rr-ink); }
.btn-danger, button.reject { background: #c5221f; color: #fff; border-radius: 0; }
button.approve { background: #16a34a; color: #fff; }
/* Small icon and text-only buttons keep their quiet look. button:where()
   ties with the plain "button" rule above (and comes later), while each
   class's own earlier rules still win, so their sizes and colours stay. */
button:where(.icon-btn, .side-more, .side-menu button, .mention-menu button, .tool-btn, .todo-star, .todo-x,
  .chip-clear, .link-danger, .af-arrow, .bp-stop, .bp-tab, .todo-check, .chip) {
  background: none; color: inherit; text-transform: none; letter-spacing: normal; font-weight: inherit; font-size: inherit; }
button:where(.icon-btn, .side-more, .side-menu button, .mention-menu button, .tool-btn, .todo-star, .todo-x,
  .chip-clear, .link-danger, .af-arrow, .bp-stop, .bp-tab, .todo-check, .chip):hover { background: none; color: inherit; }
.icon-btn:hover, .side-menu button:hover, .mention-menu button:hover, .tool-btn:hover { background: var(--rr-cream-2); color: var(--rr-ink); }
.top .icon-btn:hover, .af-arrow:hover { background: rgba(255, 255, 255, 0.14); color: var(--rr-gold); }
.side-menu .danger button, .link-danger, .bp-stop { color: #c5221f; }
.todo-x:hover, .chip-clear:hover { background: none; color: #c5221f; }
.todo-star:hover { background: none; }
.chip { border-radius: 0; border: 2px solid var(--rr-ink); text-transform: none; letter-spacing: 0; font-weight: 500; background: #fff; color: var(--rr-ink); }
.chip:hover { background: var(--rr-cream-2); color: var(--rr-ink); }
.chip.on { background: var(--rr-gold); border-color: var(--rr-ink); color: var(--rr-ink); }
.todo-check { border: 2px solid var(--rr-ink); border-radius: 0; background: #fff; }
.todo-check:hover { background: var(--rr-cream-2); border-color: var(--rr-orange); }
.todo-check.checked, .todo-check.ticking { background: var(--rr-orange); border-color: var(--rr-orange); color: #fff; }
.mention-btn { background: var(--rr-gold); color: var(--rr-ink); border: 2px solid var(--rr-ink); border-radius: 0; font-size: 1.5rem; }
.mention-btn:hover, .mention-btn[aria-expanded="true"] { background: var(--rr-ink); color: var(--rr-gold); }
.exit-btn { border-radius: 0; border: 2px solid var(--rr-ink); color: var(--rr-ink); }
.exit-btn:hover, .exit-btn:focus-visible { background: var(--rr-gold); color: var(--rr-ink); }
.to-prompt { border-radius: 0; background: var(--rr-orange); }
.to-prompt:hover { background: var(--rr-ink); }

/* Orange replaces the old blue accent. */
.tabs a.active { border-bottom: 4px solid var(--rr-orange); }
.request { background: #fff; border-left: 4px solid var(--rr-orange); border-radius: 0; }
.msg-user .request { background: var(--rr-ink); color: #fff; border-radius: 0; }
.msg-user .request a { color: var(--rr-gold); }
.working-head, .mic-status { color: var(--rr-link); }
.spinner { border-color: #ffd9c4; border-top-color: var(--rr-orange); }
.steps li.current::before, .side-list .dot, .tip-skills li::before { background: var(--rr-orange); }
.replies { background: var(--rr-gold); color: var(--rr-ink); border-radius: 0; }
.status, .badge { border-radius: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
.status.running, .status.queued { background: #ffe6d6; color: #8a2d00; }
.badge { background: var(--rr-orange); }
.notice { background: #fff8cc; border: 2px solid var(--rr-gold); border-radius: 0; }
.error, .success { border-radius: 0; }
.approval { border: 2px solid var(--rr-ink); border-left-width: 8px; border-left-color: var(--rr-orange); border-radius: 0; }
.todo-list-link, .todo-new-list summary, .todo-add summary { border-radius: 0; }
.todo-list-link:hover, .todo-new-list summary:hover, .todo-add summary:hover { background: var(--rr-cream-2); }
.todo-list-link.active { background: var(--rr-ink); color: var(--rr-gold); }
.todo-new-list summary, .todo-add summary, .todo-star.on, .tool-btn[data-speak].on { color: var(--rr-link); }
.todo-plus { background: var(--rr-orange); border-radius: 0; }
.todo-due { border-radius: 0; }
.report h3.section { font-family: "Inter", sans-serif; border-bottom: 2px solid var(--rr-ink); color: var(--rr-ink); }
.report h3.section::before { border-radius: 0; }
.report h3.section-task::before { background: var(--rr-orange); }

/* Sidebar: a slightly darker cream with a heavy rule. */
.sidebar { background: var(--rr-cream-2); border-right: 4px solid var(--rr-ink); }
html.side-closed .sidebar { margin-left: -264px; }
.side-brand { text-transform: uppercase; letter-spacing: 0.05em; font-size: 1.05rem; white-space: nowrap; color: var(--rr-ink); }
.side-new, .side-item { border-radius: 0; }
.side-new:hover, .side-item:hover, .side-item:focus-within { background: #e0d8cc; }
.side-item.active, .side-new.active { background: var(--rr-ink); }
.side-item.active a, .side-item.active .side-more, .side-new.active { color: var(--rr-gold); }
.side-item.active .side-title strong { color: var(--rr-gold); }
.side-label, .side-list { border-top: 2px solid var(--rr-ink); color: var(--rr-muted); }
.side-list .side-label { border-top: 0; }

/* Agent picker and tips banner: black stage, orange rule. */
.stage, .tips-hero { background: var(--rr-ink); border-radius: 0; border-bottom: 8px solid var(--rr-orange); box-shadow: none; }
.stage h1 { font-size: 2.4rem; font-weight: 900; text-transform: uppercase; color: #fff; }
.tips-hero h1 { font-size: 2.2rem; font-weight: 900; color: #fff; }
.tips-hero p { color: #d8d2c8; }
.agent-tag { color: #bdb6aa; }
.agents-lead { border-top: 2px solid rgba(255, 255, 255, 0.15); }
.agent:hover .avatar, .agent:focus-visible .avatar { box-shadow: 0 0 0 4px var(--rr-ink), 0 0 0 8px var(--rr-gold), 0 16px 34px rgba(0, 0, 0, 0.45); }
.agent:hover .agent-name, .agent:focus-visible .agent-name { color: var(--rr-gold); text-shadow: none; }
.tip-chip { border-radius: 0; background: #fff; color: var(--rr-ink); border: 2px solid var(--rr-ink); }
.tip-chip:hover, .tip-chip:focus-visible { background: var(--rr-gold); border-color: var(--rr-ink); }
.tip-only { border-radius: 0; }

/* Floating agent switcher: black with a gold edge. */
.af-bubble { background: rgba(10, 10, 10, 0.94); border: 2px solid var(--rr-gold); border-radius: 0; }
.af-bubble::after { background: var(--rr-orange); }
.af-dot { border-color: var(--rr-ink); }
.af-agent[data-status="working"] .af-dot { background: var(--rr-orange); }
.af-agent[data-status="working"] .af-label { color: #ffb38a; }
.af-agent[data-status="approval"] .af-dot, .af-bubble.needs-you:not(:hover):not(:focus-within):not(.going)::before { background: var(--rr-gold); }
.af-agent[data-status="approval"] .af-label { color: var(--rr-gold); }

/* Live browser panel. */
.browser-panel { border-left: 4px solid var(--rr-ink); }
.browser-card-head { color: var(--rr-link); }
.bp-tab, .browser-thumb, .bp-approval-box, .bp-approval-actions button, .bp-control, .rp-controls button { border-radius: 0; }
.rp-log li.rp-decision { color: var(--rr-link); }

/* Rhodium Robots logo (static/brand): on black, so the sidebar's head and
   the top bar are black strips of the same height with a gold edge. */
.top { min-height: 4.25rem; padding-top: 0; padding-bottom: 0; }
.top .brand img, .side-brand img { display: block; width: auto; height: 58px; }
.side-head { height: 4.25rem; padding: 0 0.6rem 0 0.9rem; background: var(--rr-ink); border-bottom: 4px solid var(--rr-gold); }
.side-head .icon-btn { color: #fff; }
.side-head .icon-btn:hover { background: rgba(255, 255, 255, 0.14); color: var(--rr-gold); }
.login-logo { margin-top: 1.5rem; margin-bottom: 0; padding: 1.4rem 1rem 1.2rem; text-align: center; background: var(--rr-ink); border-bottom: 8px solid var(--rr-orange); }
.login-logo img { display: inline-block; width: 100%; max-width: 320px; height: auto; }
.login-logo + .card { margin-top: 0; border-top: 0; }
body:has(.login-logo) .top .brand { visibility: hidden; }

/* Proof screenshots under an answer (task.html, web/permissions.py). */
.proofs { margin: 0.6rem 0 0.4rem; }
.proofs-head { margin: 0 0 0.4rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.proof { display: inline-block; width: 240px; margin: 0 0.6rem 0.6rem 0; vertical-align: top; }
.proof img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 2px solid var(--rr-ink); background: #fff; }
.proof figcaption { margin-top: 0.3rem; font-size: 0.85rem; color: #166534; overflow-wrap: anywhere; }
/* Permissions page. */
.permissions select { width: auto; min-width: 210px; }
.permissions td { vertical-align: middle; }
.permissions h2 { margin-top: 1.6rem; }

/* A worker's question while a task runs (task.html, web/questions.py). */
.question { margin: 0.8rem 0 0.4rem; padding: 0.9rem 1rem; background: #fff8cc; border: 2px solid var(--rr-ink); border-left: 8px solid var(--rr-gold); }
.question-head { margin: 0 0 0.3rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.question-text { margin: 0 0 0.7rem; font-size: 1.05rem; font-weight: 600; white-space: pre-wrap; }
.question-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; }
.question-choice { background: #fff; border: 2px solid var(--rr-ink); text-transform: none; letter-spacing: 0; font-size: 0.95rem; }
.question-choice:hover { background: var(--rr-gold); color: var(--rr-ink); }
.question-form label { margin-bottom: 0.5rem; }
.question-remember { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0 auto 0 0; font-weight: 500; }
.question-remember input { width: auto; margin: 0; }
.private-choice { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.25rem 0 0.5rem; font-weight: 500; }
.private-choice input { width: auto; margin: 0; }
.private-mark { font-size: 0.85em; color: var(--rr-muted, #666); white-space: nowrap; }

/* Memory page (memory.html). */
.memory-search { display: flex; gap: 0.5rem; align-items: center; margin: 0.8rem 0 0.4rem; }
.memory-search input { margin: 0; }
.memory-clear { white-space: nowrap; }
.memory-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.memory { padding: 0.8rem 0; border-top: 2px solid var(--rr-cream-2); }
.memory-text { margin: 0 0 0.3rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.memory .meta { margin: 0 0 0.3rem; font-size: 0.82rem; }
.memory-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.memory-actions summary { cursor: pointer; color: var(--rr-link); font-size: 0.9rem; font-weight: 600; }
.memory-edit[open], .memory-delete[open] { flex-basis: 100%; }
.memory-edit form, .memory-delete form { margin-top: 0.5rem; }
.memory-delete form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.memory-delete summary { color: #c5221f; }
.memory-pages { display: flex; justify-content: space-between; margin-top: 1rem; }
/* Learn by watching (memory.html). */
.watch-now { display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0; }
.watch-now button { margin-left: auto; }
.watch-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: #c5221f; animation: pulse 0.9s ease-in-out infinite alternate; }
.watch-head { margin: 1.2rem 0 0.4rem; font-size: 1rem; }
.watch-list { list-style: none; margin: 0; padding: 0; }
.watch-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding: 0.6rem 0; border-top: 2px solid var(--rr-cream-2); }
.watch-list li > div { flex: 1; min-width: 220px; }
.watch-list .meta { display: block; font-size: 0.82rem; }
@media (prefers-reduced-motion: reduce) { .watch-dot { animation: none; } }
/* Record / Stop & teach in the message box (_record_controls.html). */
.rec-btn { display: inline-flex; align-items: center; gap: 0.45rem; background: #fff; color: var(--rr-ink); border: 2px solid var(--rr-ink); }
.rec-btn:hover { background: var(--rr-cream-2); color: var(--rr-ink); }
.rec-icon { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #c5221f; }
.rec-stop { background: #c5221f; color: #fff; border-color: #c5221f; }
.rec-stop:hover { background: var(--rr-ink); color: #fff; border-color: var(--rr-ink); }
.rec-live { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.85rem; color: #c5221f; text-transform: uppercase; letter-spacing: 0.05em; }

/* Chat-style message box bar (_composer_bar.html): "+" tools on the left,
   microphone and a round send arrow on the right. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.composer-bar { gap: 0.5rem; }
.composer-bar .tools-btn { width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; background: #fff; color: var(--rr-ink); border: 2px solid var(--rr-ink); font-size: 1.6rem; font-weight: 400; line-height: 1; transform: none; }
.composer-bar .tools-btn:hover, .composer-bar .tools-btn[aria-expanded="true"] { background: var(--rr-gold); color: var(--rr-ink); }
.composer-bar .tools-btn[aria-expanded="true"] { transform: rotate(45deg); }
.send-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; background: var(--rr-gold); color: var(--rr-ink); flex: none; }
.send-btn:hover { background: var(--rr-ink); color: var(--rr-gold); }
.send-btn:disabled { background: var(--rr-cream-2); color: #9a948a; }
.send-btn.is-busy svg { display: none; }
.send-btn.is-busy::after { margin: 0; }
html.can-speak .composer-bar .mic-btn { justify-content: center; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; }
html.can-speak .composer-bar .mic-btn.on { background: #fdecea; border-color: #c5221f; color: #c5221f; }
.tool-item { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.45rem 0.5rem; background: none; color: var(--rr-ink); text-align: left; text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 0.95rem; }
.tool-item:hover, .tool-item:focus-visible { background: var(--rr-cream-2); color: var(--rr-ink); outline: none; }
.tool-item strong { display: block; font-size: 0.92rem; }
.tool-item .meta { display: block; font-size: 0.78rem; }
.tool-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border: 2px solid var(--rr-ink); border-radius: 50%; background: #fff; }

/* Two-step login (account.html, two_step_setup.html, two_step_codes.html). */
.two-step-steps { padding-left: 1.3rem; margin: 0.4rem 0; }
.two-step-steps li { margin: 0.3rem 0; }
.two-step-qr { display: flex; justify-content: center; margin: 0.6rem 0 0.8rem; }
.two-step-qr svg { border: 2px solid var(--rr-ink); }
.two-step-secret { display: inline-block; margin-top: 0.3rem; padding: 0.3rem 0.5rem; font-size: 1rem; letter-spacing: 0.08em; background: var(--rr-cream-2); }
.recovery-codes { columns: 2; padding: 0; margin: 0.8rem 0 1.2rem; list-style: none; }
.recovery-codes li { margin: 0.25rem 0; }
.recovery-codes code { font-size: 1.05rem; letter-spacing: 0.05em; }
.two-step-more { margin-top: 0.8rem; }
.two-step-more summary { cursor: pointer; color: var(--rr-link); font-weight: 600; }
.two-step-more form { margin-top: 0.6rem; }

/* Activity page (activity.html). */
.activity-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem; margin: 0.6rem 0 1rem; }
.activity-filter label { margin: 0; }
.activity-filter select { width: auto; min-width: 180px; }
table.activity { font-size: 0.9rem; }
.activity-when { white-space: nowrap; color: var(--rr-muted); }
.activity-kind { display: inline-block; margin-right: 0.3rem; padding: 0 0.35rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--rr-cream-2); }
.activity-security .activity-kind { background: #ffe6d6; }
.activity-tool .activity-kind { background: #e6eef8; }
.activity-detail { overflow-wrap: anywhere; color: #3a3530; }
.bridge-code { display: inline-block; padding: 0.4rem 0.6rem; font-size: 1rem; background: var(--rr-cream-2); user-select: all; overflow-wrap: anywhere; }

/* Download, 👍/👎, Try again (task.html; web/feedback.py) */
.export-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; margin: 0 0 0.6rem 0.4rem; border-radius: 50%; color: #5d6470; background: #fff; border: 1px solid #e3e6ec; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s; }
.export-btn:hover, .export-btn:focus-visible { background: #eef0f4; color: #1d2330; }
.export-btn:active { transform: scale(0.94); }
.rate-form { display: inline-flex; gap: 0.1rem; }
.tool-btn.rate { padding: 0.25rem 0.45rem; }
.tool-btn.rate.on { color: #1f5fbf; background: #eef3fc; }
.rate-why { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin: 0.4rem 0 0.6rem; }
.rate-why label { flex: 1 1 18rem; font-size: 0.9rem; }
.rate-why input[type=text] { width: 100%; margin-top: 0.25rem; }
/* Copy button on code blocks in answers (chat.js) */
.report pre { position: relative; }
.code-copy { position: absolute; top: 0.35rem; right: 0.35rem; padding: 0.15rem 0.5rem; font-size: 0.75rem; border-radius: 6px; background: #fff; color: #5d6470; border: 1px solid #e3e6ec; opacity: 0.85; }
.code-copy:hover, .code-copy:focus-visible { opacity: 1; color: #1d2330; }
.thumb-down { transform: rotate(180deg); }

/* Attach files (paperclip in the message box; web/attachments.py) */
.composer-bar .attach-btn { position: relative; margin: 0; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #fff; color: var(--rr-ink, #1d2330); border: 2px solid var(--rr-ink, #1d2330); cursor: pointer; flex: none; }
.composer-bar .attach-btn:hover { background: #f2f4f7; }
.composer-bar .attach-btn:focus-within { outline: 3px solid var(--rr-gold, #ffd400); outline-offset: 2px; }
.attach-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.attach-names { margin-left: auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.attached { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.attached li { font-size: 0.85rem; padding: 0.2rem 0.55rem; border: 1px solid #d8dbe2; background: #fff; }

/* The answer as it's written (agent_runner.Draft; task.html) */
.report.draft { margin: 0.4rem 0 0.6rem; }
/* the blinking cursor at the end of the last line written */
.report.draft > :last-child:not(ul):not(ol):not(table)::after,
.report.draft > ul:last-child > li:last-child::after,
.report.draft > ol:last-child > li:last-child::after { content: ""; display: inline-block; width: 0.55em; height: 1.05em; margin-left: 0.15em; vertical-align: text-bottom; background: currentColor; animation: draft-blink 1s steps(2, start) infinite; }
@keyframes draft-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .report.draft *::after { animation: none; } }
.steps.steps-quiet { opacity: 0.7; font-size: 0.85rem; }

/* Notifications card (account.html, web/static/app/push.js): its On/Off forms start hidden. */
#notifications [hidden] { display: none; }

/* The top bar: Approvals and the gear (base.html); everything else is on
   the Settings page (settings.html). */
.top nav { display: flex; align-items: center; }
.top nav a[aria-current="page"] { color: var(--rr-gold); }
.top .gear { display: inline-flex; padding: 0.35rem; border-radius: 999px; }
.top .gear svg { display: block; transition: transform 0.3s ease; }
.top .gear:hover svg { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .top .gear:hover svg { transform: none; } }

/* Settings: a clean list of rows, like an app's settings screen. */
.settings h1 { margin-bottom: 0.5rem; }
.settings-group { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--rr-muted); margin: 1.6rem 0 0.5rem; }
.settings-list { border: 2px solid var(--rr-ink); background: #fff; }
.settings-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; color: var(--rr-ink); text-decoration: none; border-left: 4px solid transparent; }
.settings-row + .settings-row { border-top: 1px solid var(--rr-cream-2); }
.settings-row:hover, .settings-row:focus-visible { background: var(--rr-cream); border-left-color: var(--rr-gold); color: var(--rr-ink); }
.settings-icon { flex: none; display: inline-flex; color: var(--rr-ink); }
.settings-icon svg { display: block; }
.settings-text { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.settings-text strong { font-weight: 600; }
.settings-text span { color: var(--rr-muted); font-size: 0.9rem; }
.settings-chevron { flex: none; color: var(--rr-muted); }
.settings-row:hover .settings-chevron { color: var(--rr-ink); }
.status-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 1rem; }
.status-row + .status-row { border-top: 1px solid var(--rr-cream-2); }
.status-dot { flex: none; width: 0.85rem; height: 0.85rem; border-radius: 50%; background: #9a9a9a; }
.status-ok { background: #2e9d4f; }
.status-down { background: #d12d2d; }
.status-check { margin-top: 0.8rem; display: flex; align-items: center; gap: 0.8rem; }
.settings-logout { margin-top: 1.8rem; }
.settings-who { margin-top: 0.6rem; }
[data-desktop-only][hidden], [data-browser-only][hidden] { display: none; }

/* Goals (web/goals.py): urgent and deadlines. */
.goal-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.4rem; margin: 0.4rem 0; }
.goal-deadline { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.goal-deadline input { width: auto; }
.goal-line { margin: 0 0 0.8rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.goal-urgent, .goal-due, .goal-mark { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.5rem; border: 2px solid var(--rr-ink); }
.goal-urgent { background: var(--rr-gold); }
.goal-due.goal-later { background: #fff; }
.goal-today { background: var(--rr-cream-2); }
.goal-overdue { background: #c5221f; color: #fff; border-color: #c5221f; }
.goal-mark { font-size: 0.7rem; padding: 0 0.3rem; margin-right: 0.25rem; border-width: 1px; }

/* Activity page: the audit check (web/activity.py verify). */
.seal-check { margin: 0.8rem 0 1.2rem; padding: 0.8rem 1rem; border: 2px solid var(--rr-ink); background: #fff; }
.seal-check .seal-button { display: inline-block; text-decoration: none; margin: 0.2rem 0 0.4rem; }


/* The skill registry (skills.html, skill.html). */
.skill-new { display: inline-block; text-decoration: none; }
.skill-state { font-size: 0.85rem; color: var(--rr-muted); }
.skill-form label { display: block; margin-bottom: 0.8rem; }
.skill-version { border-top: 1px solid var(--rr-cream-2); padding: 0.8rem 0; }
.skill-version.approved { border-left: 4px solid var(--rr-gold); padding-left: 0.8rem; }
.skill-steps { white-space: pre-wrap; padding: 0.6rem 0.8rem; }
.skill-retire { margin-top: 1rem; }
.skill-save { margin-right: 0.6rem; }


/* Company policies (policies.html). */
.policy-form label { display: block; margin-bottom: 1rem; }
.policy-form label .meta { display: block; margin: 0.2rem 0 0.4rem; font-size: 0.88rem; }


/* Safe interruption: Pause / Resume (task.html). */
.pause-bars { display: inline-block; width: 0.55rem; height: 0.65rem; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.paused-note { white-space: pre-wrap; }
.resume-btn { font-weight: 600; }


/* Triggers (triggers.html). */
.trigger-form label { display: block; margin-bottom: 0.8rem; }
.trigger-secret { word-break: break-all; padding: 0.6rem 0.8rem; background: var(--rr-cream-2); }
.trigger-item { border-top: 1px solid var(--rr-cream-2); padding: 0.7rem 0; }
.trigger-item form { display: inline; }
.trigger-off { opacity: 0.6; }
