@font-face { font-family: "Moai Sans"; src: url(/fonts/MoaiSansVariable-subset.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
:root {
  --bg: #F7F8FA; --panel: #fff; --panel-2: #F2F4F7; --border: #E3E6EB; --text: #1B1F24; --text-dim: #6B7280; --accent: #2563EB;
  --danger: #DC2626; --ok: #15803D; --warn: #B45309;
  --grad-primary: linear-gradient(135deg, #2563EB, #4F46E5);
  --mono: "IBM Plex Mono", ui-monospace, "Moai Sans", monospace; --sans: "Moai Sans", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] { --bg: #14161B; --panel: #1C1F26; --panel-2: #22262E; --border: #2C3038; --text: #E7E9ED; --text-dim: #97A0AC; --accent: #6D9BFF; color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #14161B; --panel: #1C1F26; --panel-2: #22262E; --border: #2C3038; --text: #E7E9ED; --text-dim: #97A0AC; --accent: #6D9BFF; color-scheme: dark; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.6 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--accent); }
.subtabs a { font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); text-decoration: none; padding: 8px 12px; border-radius: 6px; transition: color .12s, background .12s; }
.tab-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.tab-btn { min-height: 40px; min-width: 40px; justify-content: center; }
.tab-bar-inner { max-width: 1180px; }
header.top { padding-inline: max(28px, calc((100% - 1180px) / 2 + 28px)); }
.top .user-menu { right: max(28px, calc((100% - 1180px) / 2 + 28px)); }
.tab-bar-inner .tab-btn:first-child { padding-left: 0; justify-content: flex-start; }
.subtabs a:hover { background: var(--panel-2); }
.subtabs a[aria-current] { color: var(--accent); background: var(--panel-2); }
.top button { min-height: 0; }
.brand .brand-icon { fill: none; stroke: currentColor; stroke-width: 26; stroke-linecap: round; stroke-linejoin: round; }
.top .user-chip, .top .theme-toggle-btn { min-width: 40px; min-height: 40px; border-radius: 999px; font-size: 12px; }
.top .theme-toggle-btn { justify-content: center; padding: 4px 16px; }
.theme-toggle-btn .ico { width: 14px; height: 14px; }
.top .user-menu button { min-height: 36px; }
main { max-width: 1180px; margin: 0 auto; padding: 28px; }
h1 { font: 650 20px/1.4 var(--sans); margin: 0 0 16px; }
.board-heading { padding-bottom: var(--sp-4); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.board-heading h1 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.board-modes { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: fit-content; max-width: 100%; min-width: 0; padding: var(--sp-1); border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); }
.board-modes::before { content: ""; position: absolute; top: var(--sp-1); bottom: var(--sp-1); left: var(--sp-1); width: calc((100% - var(--sp-2)) / 3); border-radius: 999px; background: rgba(var(--accent-rgb), 0.12); box-shadow: var(--shadow); transition: transform .16s ease; pointer-events: none; }
.board-modes[data-mode="grid"]::before { transform: translateX(100%); }
.board-modes[data-mode="feed"]::before { transform: translateX(200%); }
.board-mode { position: relative; display: grid; place-items: center; min-width: 64px; min-height: 32px; margin: 0; padding: 0 var(--sp-2); cursor: pointer; font: 600 13px/1.4 var(--sans); }
.board-mode input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.board-mode > span { display: block; margin: 0; color: var(--text-dim); font: inherit; letter-spacing: normal; text-transform: none; pointer-events: none; }
.board-mode input:checked + span { color: var(--accent); }
.board-mode:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .board-modes::before { transition: none; } }
.board-actions { display: flex; align-self: stretch; }
.board-delete { min-width: 40px; min-height: 40px; padding: 8px; justify-content: center; }
.board-delete .ico { width: 16px; height: 16px; }
.skeleton { height: 96px; background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: skeleton-pulse 1.2s ease infinite; }
@keyframes skeleton-pulse { to { background-position: -200% 0; } }
.board-posts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.board-posts-grid .board-post { margin: 0; min-width: 0; }
.board-table { padding: 0; max-width: 100%; overflow-x: auto; }
.board-table table { min-width: 820px; table-layout: fixed; }
.board-table th:first-child, .board-table td:first-child { width: 7%; }
.board-table th:nth-child(2), .board-table td:nth-child(2) { width: 32%; }
.board-table th:nth-child(3), .board-table td:nth-child(3) { width: 16%; }
.board-table th:nth-child(4), .board-table td:nth-child(4) { width: 16%; }
.board-table th:nth-child(5), .board-table td:nth-child(5) { width: 13%; }
.board-table th:nth-child(6), .board-table td:nth-child(6) { width: 16%; }
.board-table td { overflow-wrap: anywhere; }
.board-table-empty { text-align: left; color: var(--text-dim); padding: var(--sp-5); }
.board-table-select { text-align: center; }
.board-select-target { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: 0; cursor: pointer; }
.board-select-target input { width: 20px; height: 20px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.board-table tbody tr { cursor: pointer; }
.board-table tbody tr:hover, .board-table tbody tr:focus-visible { background: var(--panel-2); }
.board-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.board-table-title { color: var(--text); font-weight: 600; }
.public-ref { display: inline-block; margin-right: var(--sp-2); color: var(--text-dim); font: 600 11px var(--mono); letter-spacing: .04em; user-select: text; }
.board-post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.board-author { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--text); letter-spacing: normal; text-transform: none; }
.board-author .agent-icon { width: 18px; height: 18px; flex: none; }
.board-field-chip { cursor: default; text-transform: none; letter-spacing: normal; overflow-wrap: anywhere; }
.board-back { display: inline-flex; align-items: center; min-height: 40px; margin-bottom: 16px; }
.board-detail .post-title { margin: var(--sp-4) 0 var(--sp-5); font-size: 24px; line-height: 1.35; }
.board-detail .post-body { margin-bottom: 24px; }
.article { margin-bottom: var(--sp-5); overflow-wrap: anywhere; font: 400 18px/1.8 Georgia, serif; counter-reset: article-section; }
.article > :not(.article-media-full) { max-width: 72ch; margin-left: auto; margin-right: auto; }
.article-heading { counter-increment: article-section; font: 650 24px/1.35 var(--sans); margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.article-heading::before { content: counter(article-section, decimal-leading-zero) " / "; display: block; margin-bottom: var(--sp-2); color: var(--text-dim); font: 600 12px/1.4 var(--mono); }
.article-lede { margin-top: var(--sp-5); margin-bottom: var(--sp-5); font-size: 24px; line-height: 1.6; }
.article-p { margin-top: var(--sp-3); margin-bottom: var(--sp-3); }
.article-fn { color: var(--text-dim); font: 400 12px var(--mono); }
.article-quote { padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--border); background: var(--panel-2); border-radius: var(--r-md); }
.article-quote p { margin: 0; }
.article-quote footer { margin-top: 8px; color: var(--text-dim); font-size: 12px; }
.article-pullquote { padding: var(--sp-5) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text); font: 500 32px/1.35 Georgia, serif; }
.article-pullquote p { margin: 0; }
.article-media { margin-top: var(--sp-5); margin-bottom: var(--sp-5); }
.article-media img, .article-media iframe, .article-media video { display: block; width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-md); }
.article-media iframe, .article-media video { aspect-ratio: 16 / 9; height: auto; }
.article-media figcaption { margin-top: 8px; color: var(--text-dim); font-size: 12px; }
.article-sources { border-top: 1px solid var(--border); padding-top: var(--sp-3); color: var(--text-dim); font: 400 12px/1.6 var(--sans); }
.article-sources h2 { font: 600 12px/1.4 var(--sans); margin: 0 0 var(--sp-2); }
.article-sources ul { margin: 0; padding-left: 20px; }
.issue-form h2,.issue-detail h2 { font: 600 16px/1.4 var(--sans); margin: 0 0 16px; }
.issue-detail h2 { margin: 0 0 var(--sp-3); }
.issue-detail .post-body { margin: 0; }
.issue-field-help { margin: 0 0 var(--sp-3); letter-spacing: normal; text-transform: none; }
.issue-kind-fields[hidden] { display: none; }
.issue-kind-fields textarea { width: 100%; }
.issue-uri-error { margin: 0 0 var(--sp-3); }
.issue-uri-error[hidden] { display: none; }
.issue-options { margin: 0 0 var(--sp-3); }
.issue-options summary { color: var(--accent); cursor: pointer; min-height: 40px; padding: 8px 0; }
.issue-options summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.issue-options[open] { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.issue-estimate { margin: 0 0 var(--sp-3); }
.issue-usage-scroll { max-width: 100%; overflow-x: auto; }
.issue-usage table { width: 100%; min-width: 320px; border-collapse: collapse; }
.issue-usage th, .issue-usage td { padding: var(--sp-2); border-bottom: 1px solid var(--border); text-align: left; }
.issue-usage th { white-space: nowrap; }
.topic-kind { margin-left: var(--sp-2); white-space: nowrap; }
.issue-request-fields { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); overflow-wrap: anywhere; }
.issue-request-fields span { background: var(--panel-2); border-radius: var(--r-md); padding: var(--sp-2); }
.issue-detail a { overflow-wrap: anywhere; }
.issue-item a { font: 600 16px/1.4 var(--sans); overflow-wrap: anywhere; }
.issue-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0; overflow-wrap: anywhere; }
.issue-files { overflow-wrap: anywhere; }
.issue-files p { margin: 8px 0; }
.issue-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.issue-heading h1, .issue-heading .meta { margin: 0; }
.issue-tools { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; margin-bottom: 16px; }
.issue-tools input { flex: 0 1 280px; min-width: 0; margin-bottom: 0; }
.issue-filters { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.issue-filters::-webkit-scrollbar { display: none; }
.issue-filters .chip { flex: none; }
.issue-list { padding-bottom: calc(56px + var(--sp-4)); }
.issue-filters .chip { min-height: 32px; padding: 4px 10px; font-family: var(--sans); }
.issue-selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.issue-selection-bar[hidden], .issue-selection-error[hidden] { display: none; }
.issue-selection-count { font-weight: 600; margin-right: auto; }
.issue-table tbody tr.issue-selected { background: var(--panel-2); }
.issue-table tbody tr.issue-pressing, .issue-table tbody tr[role="checkbox"] { user-select: none; touch-action: manipulation; }
.issue-select-mark { display: inline-block; color: var(--accent); margin-right: var(--sp-2); }
.issue-table { padding: 0; overflow: hidden; }
.issue-table th:first-child, .issue-table td:first-child { width: 17%; }
.issue-table th:nth-child(2), .issue-table td:nth-child(2) { width: 49%; }
.issue-table th:nth-child(3), .issue-table td:nth-child(3) { width: 19%; }
.issue-table th:last-child, .issue-table td:last-child { width: 15%; }
.issue-table td { overflow-wrap: anywhere; }
.issue-title-cell { min-width: 0; }
.issue-title-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.issue-title-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.issue-title-meta .agent-chip { max-width: 100%; }
.issue-created-short { display: none; }
.issue-quick-actions { white-space: nowrap; }
.issue-quick-button { min-width: 40px; min-height: 40px; justify-content: center; padding: var(--sp-2); }
.issue-quick-button:disabled { opacity: .45; cursor: not-allowed; }
.issue-table tbody tr:hover, .issue-table tbody tr:focus-visible { background: var(--panel-2); }
.issue-table tbody tr { cursor: pointer; }
.issue-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.issue-row-link { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; text-decoration: none; }
.issue-row-link .public-ref { flex: none; }
.issue-state { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.issue-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.issue-state-completed { color: var(--ok); }
.issue-state-target_needed, .issue-state-budget_held { color: var(--warn); }
.issue-state-failed, .issue-state-partial { color: var(--danger); }
.issue-state-assigned, .issue-state-researching { color: var(--accent); }
.issue-detail-head { grid-area: header; }
.issue-detail-head h1 { margin: var(--sp-2) 0 var(--sp-4); }
.issue-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); color: var(--text-dim); }
.issue-header-meta .chip { color: var(--text); }
.issue-detail-main { grid-area: main; display: grid; align-content: start; gap: var(--sp-4); min-width: 0; }
.issue-section { min-width: 0; overflow-wrap: anywhere; }
.issue-detail-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: var(--sp-5); }
.issue-detail-foot .issue-delete-error { margin: 0; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.issue-detail-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.issue-delete { min-width: 40px; min-height: 40px; padding: 8px; justify-content: center; }
.issue-delete .ico { width: 16px; height: 16px; }
.issue-delete-error:empty { display: none; }
.issue-detail-head h1 { overflow-wrap: anywhere; }
.issue-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); grid-template-areas: "header status" "main status"; gap: var(--sp-4) var(--sp-5); align-items: start; }
.issue-detail-grid > * { min-width: 0; overflow-wrap: anywhere; }
.issue-detail h3 { font: 600 12px/1.4 var(--mono); margin: 16px 0 4px; color: var(--text-dim); }
.issue-status { grid-area: status; position: sticky; top: var(--sp-4); }
.agent-chip { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; font-weight: 600; }
.agent-chip .agent-icon { flex: none; }
.issue-plan ol { margin: 0; padding-left: var(--sp-5); }
.issue-plan li { padding: var(--sp-1) 0; overflow-wrap: anywhere; }
.issue-progress-card { border-top: 1px solid var(--border); margin-top: var(--sp-5); padding-top: var(--sp-3); }
.issue-activity { border: 0; margin: 0; padding: 0; }
.issue-steps, .issue-activity ol { margin: 0; padding-left: var(--sp-5); }
.issue-steps li, .issue-activity li { padding: var(--sp-1) 0; overflow-wrap: anywhere; }
.issue-steps li { color: var(--dim); }
.issue-steps li.done { color: var(--text); }
.issue-steps li.current { color: var(--accent); font-weight: 650; }
.issue-steps li.stopped { color: var(--danger); }
.issue-guidance { background: var(--panel-2); border-radius: var(--r-md); padding: var(--sp-3); }
.issue-activity li span { display: block; }
.issue-image-status { color: var(--text-dim); margin: 0 0 var(--sp-3); }
.issue-target-form { margin-top: 16px; }
.issue-assign-form { margin-top: 12px; display: grid; gap: 8px; }
.issue-assign-form select { width: 100%; }
.issue-assign-form .meta:empty, .issue-assign-form .err:empty { display: none; }
.issue-retry { margin-top: 12px; }
.issue-attempts { border-top: 1px solid var(--border); margin-top: var(--sp-5); padding-top: var(--sp-3); }
.issue-attempt { border: 1px solid var(--border); border-radius: var(--r-md); margin: var(--sp-3) 0; min-width: 0; }
.issue-attempt summary { cursor: pointer; padding: var(--sp-3); overflow-wrap: anywhere; }
.issue-attempt summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.issue-attempt-body { border-top: 1px solid var(--border); padding: var(--sp-3); }
.issue-attempt-body p { margin: var(--sp-2) 0; }
.issue-attempt-activity { margin: 0; padding-left: var(--sp-5); }
.issue-attempt-activity li { padding: var(--sp-1) 0; overflow-wrap: anywhere; }
.issue-attempt-activity li span { display: block; }
.issue-detail a { overflow-wrap: anywhere; }
.board-post { min-width: 0; overflow-wrap: anywhere; }
.board-posts-feed .board-post { padding: var(--sp-5); border-radius: 0; border-width: 0 0 1px; box-shadow: none; }
.board-posts-grid .board-post { padding: var(--sp-5); }
.board-posts .post-title { font-size: 20px; font-weight: 650; line-height: 1.35; margin: var(--sp-4) 0; }
.board-posts .board-post > .row { margin-top: var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.post-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.post-details { margin-top: 8px; }
.post-details summary { color: var(--accent); cursor: pointer; min-height: 40px; padding: 8px 0; }
.post-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.subtabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 8px; max-width: 100%; overflow-x: auto; }
.subtabs a { flex: none; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.meta { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.post-title { font: 500 16px/1.4 var(--sans); margin: 4px 0; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; color: var(--text); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: block; margin-bottom: 12px; }
label > span { display: block; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=url], input[type=file], textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: 500 14px var(--sans); border-radius: 6px; padding: 8px 16px; min-height: 40px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; transition: background .12s; }
button:hover { background: var(--panel-2); }
button.primary { background: var(--grad-primary); color: #fff; border-color: transparent; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.ghost { background: none; border-color: transparent; }
button.icon-btn, button.ghost.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; min-width: 40px; min-height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
button.icon-btn:hover { background: var(--panel-2); }
button.primary.icon-btn { background: var(--grad-primary); color: #fff; border-color: transparent; }
button.danger.icon-btn { border-color: var(--danger); }
button.danger.icon-btn.armed { background: var(--danger); color: #fff; }
button.icon-btn .ico { width: 16px; height: 16px; }
.err { color: var(--danger); margin: 8px 0; }
.key-box { display: flex; align-items: stretch; min-width: 0; background: var(--panel-2); border-radius: 6px; }
.key { flex: 1; min-width: 0; margin: 0; font: 13px var(--mono); padding: 12px; overflow-wrap: anywhere; user-select: all; }
.key-copy { flex: none; width: 40px; min-width: 40px; min-height: 40px; padding: 0; display: grid; place-items: center; }
.key-copy .ico { width: 16px; height: 16px; }
.key-status:not(:empty) { margin-top: 8px; color: var(--text-dim); }
.agent-view .subtabs { margin-bottom: 16px; }
.agent-fab { position: fixed; z-index: 20; right: max(calc(max(0px, (100% - 1180px) / 2) + 28px), env(safe-area-inset-right)); bottom: max(var(--sp-4), env(safe-area-inset-bottom)); box-shadow: var(--shadow-pop); }
button.icon-btn.agent-fab { width: 48px; height: 48px; border-radius: 50%; }
button.icon-btn.agent-fab .ico { width: 22px; height: 22px; }
button.icon-btn.agent-fab:hover { filter: brightness(1.08); }
button.icon-btn.agent-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.agent-dialog { width: min(560px, calc(100% - 2 * var(--sp-4))); max-height: calc(100dvh - 2 * var(--sp-4)); overflow-y: auto; padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.agent-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.agent-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.agent-dialog-heading h2 { margin: 0; font-size: 20px; }
.agent-dialog-close { width: 40px; padding: 0; font-size: 24px; }
.agent-dialog .agent-note { margin-bottom: var(--sp-4); }
.agent-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; margin: 0; padding: 0; border: 0; box-shadow: none; }
.agent-form > button { grid-column: 1 / -1; }
.agent-loading, .view-loading { min-height: 96px; display: grid; place-items: center; }
.agent-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 999px; animation: agent-spin .8s linear infinite; }
@keyframes agent-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .agent-spinner { animation: none; } }
.agent-form label { min-width: 0; margin: 0; }
.agent-form input, .agent-form select, .agent-form button { height: 40px; }
.agent-form .err { grid-column: 1 / -1; }
.agent-form .err:empty { display: none; }
.agent-icon-field, .agent-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.agent-icon-field { display: flex; }
.agent-icon-field select { min-width: 0; flex: 1; }
.agent-icon-preview { display: inline-flex; flex: none; }
.agent-icon { width: 20px; height: 20px; flex: none; fill: currentColor; stroke: none; }
.agent-icon.line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agent-icon-field .agent-icon, .agent-name .agent-icon { color: var(--accent); }
.agent-form select.chosen, .agent-table select.chosen { border-color: var(--accent); }
.agent-table select { max-width: 190px; }
.agent-table .agent-icon { width: 18px; height: 18px; }
.agent-note { color: var(--text-dim); background: var(--panel-2); border-radius: 6px; padding: 12px 16px; margin: 0 0 16px; }
.agent-status { white-space: nowrap; }
.agent-table table { min-width: 960px; }
.agent-table td:nth-child(2) { white-space: nowrap; }
.agent-table th:nth-child(4), .agent-table th:nth-child(5), .agent-table th:nth-child(6),
.agent-table td:nth-child(4), .agent-table td:nth-child(5), .agent-table td:nth-child(6) { white-space: nowrap; }
.agent-table td:nth-child(4) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.agent-table td:last-child { white-space: nowrap; }
.agent-table td:first-child { min-width: 96px; }
.agent-table td .row { flex-wrap: nowrap; gap: 0; }
.agent-table td .row button { padding-left: 10px; padding-right: 10px; }
.settings-skeleton { height: 48px; margin-bottom: 8px; }
.settings-card h2, .settings-form h2 { font: 600 16px/1.4 var(--sans); margin: 0 0 16px; }
.settings-status { font-weight: 600; margin: 0 0 8px; }
.settings-reason, .settings-help { color: var(--text-dim); overflow-wrap: anywhere; }
.settings-help { margin-bottom: 0; }
.settings-panel { margin-top: 16px; }
.catalog-targets { margin-top: var(--sp-4); }
.catalog-target-list { list-style: none; padding: 0; margin: var(--sp-4) 0 0; }
.catalog-target-list li { border-top: 1px solid var(--border); padding: var(--sp-3) 0; overflow-wrap: anywhere; }
.catalog-target-list li p { margin: var(--sp-1) 0; color: var(--text-dim); }
.catalog-target-name { font-weight: 600; }
.catalog-target-list .row { flex-wrap: wrap; }
.settings-form h3 { font: 600 14px/1.4 var(--sans); margin: 16px 0 8px; }
.settings-switches, .settings-users { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.settings-user { display: flex; align-items: center; gap: 8px; margin: 0; }
.settings-user span { display: inline; font: inherit; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; }
.settings-secret { margin-bottom: 16px; }
.notification-form .switch { margin-bottom: var(--sp-2); }
.notification-modes { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.notification-mode { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; margin: 0; cursor: pointer; }
.notification-mode span { display: inline; font: inherit; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; }
.settings-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.settings-checks li { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.auto-assignment .switch { margin-bottom: 8px; }
.auto-agent-list { margin: 0 0 16px; padding: 0; list-style: none; }
.auto-agent-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.auto-agent-list li span { min-width: 0; }
.auto-agent-list .row { flex: none; flex-wrap: nowrap; }
.issue-assignment-source { overflow-wrap: anywhere; text-transform: none; }
@media (max-width: 640px) { .auto-agent-list li { align-items: flex-start; flex-direction: column; } }
.switch { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--text); cursor: pointer; }
.switch-knob { width: 36px; height: 20px; border-radius: 10px; background: var(--border); position: relative; flex: none; transition: background .12s; }
.switch-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transition: transform .12s; }
.switch[aria-checked=true] .switch-knob { background: var(--accent); }
.switch[aria-checked=true] .switch-knob::after { transform: translateX(16px); }
input[type=number] { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); background: var(--panel-2); height: 38px; padding: 0 12px; }
td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--text-dim); margin-right: 8px; }
.dot.on { background: var(--ok); }
body.logged-out header.top, body.logged-out .tab-bar { display: none; }
body.logged-out main { max-width: none; padding: 0; }
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: var(--sp-5); background-color: var(--bg);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text-dim) 16%, transparent) 1px, transparent 1px),
    radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 6%, transparent), transparent 65%);
  background-size: 28px 28px, 100% 100%; }
.login-content { width: min(100%, 320px); text-align: center; animation: login-rise .45s ease both; }
.login-mark { display: block; width: 18px; height: 29px; margin: 0 auto 12px; fill: none; stroke: currentColor; stroke-width: 26; stroke-linecap: round; stroke-linejoin: round; }
.login-wordmark { margin: 0; font: 600 12px/1.4 var(--mono); letter-spacing: .24em; text-transform: uppercase; }
.login-tagline { margin: 20px 0 32px; color: var(--text-dim); font-size: 13px; }
.login-tabs { display: flex; justify-content: center; min-height: 36px; margin-bottom: 16px; }
.login-tab { display: inline-flex; align-items: center; border-bottom: 2px solid var(--accent); padding: 0 2px; font: 600 12px var(--mono); letter-spacing: .14em; }
.login-form { display: grid; gap: 10px; }
.login-field-shell { width: 100%; }
.login-form .login-input { width: 100%; height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); text-align: center; font: 400 14px var(--sans); outline: none; }
.login-input::placeholder { color: var(--text-dim); opacity: .7; }
.login-input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.login-submit-btn { display: flex; justify-content: center; width: 100%; height: 40px; margin-top: 2px; border: 0; border-radius: 999px; background: var(--grad-primary); color: #fff; font: 600 14px var(--sans); }
.login-submit-btn:hover { border: 0; background: var(--grad-primary); filter: brightness(1.08); }
.login-error { min-height: 1.6em; margin-top: 4px; color: var(--danger); font-size: 12px; }
.login-watermark { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: var(--text-dim); opacity: .6; font: 600 10px var(--mono); letter-spacing: .24em; }
@keyframes login-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .login-content { animation: none; } }
@media (max-width: 640px) { header.top { padding: 12px 14px; } .top .user-menu { right: 14px; } .tab-bar-inner { padding: 0 14px; } main { padding: 14px; } .board-posts-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .issue-tools input { flex: 0 0 140px; }
  .agent-form { grid-template-columns: minmax(0, 1fr); }
  .agent-form button { width: 100%; }
  .issue-heading { align-items: flex-start; }
  .issue-table { overflow-x: auto; }
  .issue-table table { min-width: 0; table-layout: fixed; }
  .issue-table th, .issue-table td { padding: var(--sp-2); }
  .issue-table th:first-child, .issue-table td:first-child { width: 20%; }
  .issue-table th:nth-child(2), .issue-table td:nth-child(2) { width: 31%; }
  .issue-table th:nth-child(3), .issue-table td:nth-child(3) { width: 23%; }
  .issue-table th:last-child, .issue-table td:last-child { width: 26%; }
  .issue-created-full { display: none; }
  .issue-created-short { display: inline; }
  .issue-quick-button { padding: 0; }
  .issue-detail-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "status" "main"; gap: var(--sp-4); }
  .issue-status { position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Research 탭(조사자료)과 검토·리비전 보기 */
.dossier-list { display: grid; gap: var(--sp-3); }
.dossier-card { display: grid; gap: var(--sp-2); color: var(--text); overflow-wrap: anywhere; }
.dossier-card .topic-kind { justify-self: start; }
.dossier-card:hover { text-decoration: none; }
.dossier-issue { color: var(--accent); cursor: pointer; }
.dossier-detail { overflow-wrap: anywhere; }
.dossier-detail h2 { margin: var(--sp-5) 0 var(--sp-2); font-size: 16px; }
.dossier-claims li { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-3); }
.dossier-links, .revision-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0; }
.revision-btn { min-width: 40px; min-height: 40px; }
.issue-review textarea { width: 100%; box-sizing: border-box; }
.write-rounds li { display: grid; gap: var(--sp-1); }

/* 빠른 조사 요청 입력창(MO-89) */
.composer { position: fixed; z-index: 25; left: 50%; bottom: max(var(--sp-4), env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: var(--sp-2); box-sizing: border-box; width: min(720px, calc(100% - 2 * var(--sp-4) - 72px)); padding: var(--sp-3) var(--sp-3) var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.composer[hidden], .cmp-chips[hidden], .cmp-error[hidden] { display: none; }
.composer:focus-within { border-color: var(--border-strong); }
.cmp-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.cmp-chip { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); font-size: 12px; overflow-wrap: anywhere; }
.cmp-chip.failed { border-color: var(--danger); }
.cmp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-state { color: var(--text-dim); }
.cmp-thumb { display: block; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; background: none; cursor: zoom-in; }
.cmp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cmp-retry { min-height: 32px; padding: var(--sp-1) var(--sp-2); }
.cmp-chip button.cmp-remove { width: 32px; min-width: 32px; min-height: 32px; border: 0; background: none; }
.cmp-text { display: block; width: 100%; box-sizing: border-box; min-height: 24px; max-height: 40vh; padding: var(--sp-1); border: none; background: transparent; box-shadow: none; resize: none; overflow-y: auto; font-size: 14px; line-height: 1.6; font-family: inherit; }
.cmp-text:focus, .cmp-text:focus-visible { outline: none; border: none; box-shadow: none; }
.cmp-error { margin: 0; font-size: 13px; }
.cmp-bar { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.cmp-select { width: auto; flex: 0 1 auto; min-width: 0; max-width: 180px; min-height: 0; padding: 6px 8px; border-radius: 999px; background: var(--panel-2); font-size: 13px; }
button.icon-btn.cmp-icon { flex-shrink: 0; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; justify-content: center; border-radius: 999px; }
#cmp-run { margin-left: auto; }
.cmp-icon.on { color: var(--accent); border-color: var(--accent); }
button.primary.cmp-icon.cmp-send:disabled { opacity: .4; cursor: default; box-shadow: none; }
.cmp-lightbox { max-width: 92vw; max-height: 92dvh; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.cmp-lightbox img { display: block; max-width: 100%; max-height: calc(92dvh - 2 * var(--sp-2)); }
.issue-toast { bottom: calc(28px + var(--composer-height, 0px)); }
a.issue-toast { color: #fff; text-decoration: none; cursor: pointer; }
body.composer-open .agent-fab { display: none; }
@media (max-width: 800px) { .cmp-select { max-width: 120px; } button.icon-btn.cmp-icon { width: 40px; height: 40px; min-width: 40px; min-height: 40px; } }
@media (max-width: 600px) { .composer { width: calc(100% - 2 * var(--sp-4)); bottom: max(var(--sp-3), env(safe-area-inset-bottom)); } }
@media (max-width: 640px) { .agent-fab { right: max(14px, env(safe-area-inset-right)); } }
