/* Galax Gen AI: task cards, task workspace, studies, specialists admin. */
.page-pad { padding: var(--s6) var(--s6) var(--s8); max-width: 1180px; width: 100%; margin: 0 auto; box-sizing: border-box; }
@media (max-width: 640px) { .page-pad { padding: var(--s4) var(--s4) var(--s8); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s4); min-width: 0; }
.card h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: var(--fs-md); font-family: var(--font-head); }
.card + .card, .grid2 + .card, .card + .grid2, .grid2 + .grid2, .grid3 + .card, .card + .grid3 { margin-top: var(--s3); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; }
.chip.sm { padding: 0 6px; font-size: 11px; margin-left: 6px; }

/* severity */
.sev { display: inline-block; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; margin-right: 4px; background: var(--surface-2); color: var(--text-2); }
.sev.error { background: var(--danger-weak); color: var(--danger-text); }
.sev.warning { background: var(--warn-bg); color: var(--warn-text); }
.sev.notice { background: var(--primary-weak); color: var(--primary-text); }
.sev.info { background: var(--signal-weak); color: var(--signal-text); }

/* step icons */
.step-ico { width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--border-strong); color: var(--text-3); background: var(--surface); }
.step-ico svg { width: 12px; height: 12px; }
.step-ico.ok { background: var(--signal); border-color: var(--signal); color: #fff; }
.step-ico.bad { background: var(--danger); border-color: var(--danger); color: #fff; }
.step-ico.run { border-color: var(--primary); border-top-color: transparent; animation: spin .9s linear infinite; }
.step-ico.wait { border-style: dashed; }
.step-ico.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .step-ico.run { animation: none; } }

/* task card in chat */
.task-slot:empty { display: none; }
.task-card { margin: var(--s3) 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); }
.task-loading { color: var(--text-2); font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
.task-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.task-title { display: flex; align-items: center; gap: 6px; font-weight: 600; flex: 1 1 220px; min-width: 0; }
.task-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-spec { display: flex; gap: 4px; flex-wrap: wrap; }
.task-progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.task-progress.lg { height: 6px; margin: var(--s3) 0 var(--s4); }
.task-progress > span { display: block; height: 100%; background: var(--primary); transition: width .4s var(--ease); }
.task-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task-step { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--fs-sm); }
.task-step .grow { min-width: 0; }
.task-step.pending, .task-step.skipped { color: var(--text-3); }
.st-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-weight: 500; }
.st-title .mono { margin-left: 6px; }
.st-sum { color: var(--text-2); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.st-q { margin: 4px 0 0; padding-left: 18px; font-size: var(--fs-xs); color: var(--warn-text); }
.task-steps.full { gap: 10px; }
.task-steps.full .task-step { padding-bottom: 8px; border-bottom: 1px solid var(--surface-3); }
.task-steps.full .task-step:last-child { border-bottom: 0; padding-bottom: 0; }
.task-issues { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: var(--fs-sm); }
.task-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* task workspace */
.task-page { padding: var(--s5) var(--s6) var(--s8); max-width: 1280px; width: 100%; margin: 0 auto; box-sizing: border-box; overflow-y: auto; flex: 1; }
@media (max-width: 640px) { .task-page { padding: var(--s4); } }
.task-page-head { display: flex; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.task-h1 { font-size: var(--fs-xl); margin: 0 0 4px; font-family: var(--font-head); overflow-wrap: anywhere; }
.task-overview { display: grid; gap: var(--s3); }
.task-overview .grid2 + .card, .task-overview .card + .grid2, .task-overview .grid2 + .grid2 { margin-top: 0; }

.outputs { display: grid; gap: var(--s3); }
.outputs-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s4); align-items: start; }
@media (max-width: 1000px) { .outputs-grid { grid-template-columns: minmax(0, 1fr); } }
.art-groups { display: grid; gap: var(--s3); }
.art-group h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 0 0 6px; }
.art-row { display: flex; align-items: center; gap: var(--s2); padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); margin-bottom: 4px; flex-wrap: wrap; }
.art-row .fn { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); font-family: var(--font-mono); }
.art-row .kind { font-size: var(--fs-xs); color: var(--text-3); }
.preview-pane { position: sticky; top: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: var(--s3); min-height: 240px; max-height: calc(100vh - 160px); overflow: auto; }
.preview-frame { width: 100%; height: 70vh; border: 0; background: #fff; border-radius: var(--r-sm); }
.preview-img { max-width: 100%; height: auto; display: block; margin: 0 auto; background: #fff; }
.preview-table { overflow: auto; max-height: 64vh; }
.preview-table table { font-size: var(--fs-xs); }
.code-view { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s3); overflow: auto; max-height: 64vh; white-space: pre; margin: 0; }
.code-view.sm { max-height: 240px; font-size: 11px; }

.issues-panel .filter-bar { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); align-items: center; }
.issues-panel table td { vertical-align: top; }
.issues-panel .records { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); overflow-wrap: anywhere; }

.log-view .events { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.log-view .ev { display: flex; gap: var(--s2); align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--surface-3); flex-wrap: wrap; }
.log-view .ev > span:last-child { flex: 1 1 300px; min-width: 0; overflow-wrap: anywhere; }
.log-view .ev.status { font-weight: 600; }

/* studies */
.mem-val { font-family: var(--font-mono); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 520px; max-height: 160px; overflow: auto; margin: 0; }

/* admin: specialists */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
@media (max-width: 640px) { .spec-grid { grid-template-columns: minmax(0, 1fr); } }
.spec-card { display: grid; gap: var(--s2); align-content: start; }
.spec-card h3 { margin: 0; }
table.limits th { text-align: left; font-weight: 500; }
table.limits td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* topbar study selector */
.study-btn .lbl { font-family: var(--font-mono); font-size: var(--fs-sm); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .study-btn .lbl { max-width: 80px; } }
.art-row .sub { font-size: 11px; color: var(--text-3); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.art-row > .kind { font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 2px 5px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--text-2); min-width: 38px; text-align: center; }
.issues tr.suggested td { background: var(--surface-2); }
.badge.xs { font-size: 10px; padding: 0 6px; }
.task-card { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); box-sizing: border-box; }
.side-item.active > .link { color: #fff; }
.side-item.active > .link .t { font-weight: 600; }
.side-item.active > .link .meta { color: rgba(255,255,255,.75); }
.spec-grid > .card, .stats + .grid2 { margin-top: 0; }
.spec-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
table.limits { font-size: var(--fs-xs); }
table.limits th, table.limits td { padding: 6px 8px; }
.grid2 > .card, .grid3 > .card { margin-top: 0; }
@media (max-width: 640px) { .title-zone .mode-btn .lbl { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .study-btn .lbl { max-width: 72px; } }
