* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1d1d1b; background: #f6f4ef; }
header { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid #e2ded5; }
#account { margin-left: auto; position: relative; }
#who { padding: 4px 10px; }
#menu { position: absolute; right: 0; top: 34px; background: #fff; border: 1px solid #e2ded5; border-radius: 8px; padding: 6px; min-width: 140px; z-index: 2; }
#menu:not([hidden]) { display: flex; flex-direction: column; gap: 4px; }
#menu button { text-align: left; background: transparent; color: #1d1d1b; }
#menu button:hover { background: #f6f4ef; }
#menu [data-item=balance] { font-variant-numeric: tabular-nums; border-bottom: 1px solid #f0ece4; border-radius: 6px 6px 0 0; }
#menu [data-item=balance].low, #who.low { color: #dc2626; }
#who.low { border-color: #fca5a5; background: #fef2f2; }
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(360px, calc(100vw - 32px)); box-shadow: 0 16px 40px rgba(0,0,0,.16); }
dialog::backdrop { background: rgba(29,29,27,.28); }
.login-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; place-items: center; }
.login-page > header { justify-self: stretch; }
.login-card { width: min(380px, calc(100vw - 32px)); background: #fff; border: 1px solid #e2ded5; border-radius: 14px; padding: 28px 24px 22px; }
.login-card h2 { font-size: 22px; margin: 0 0 6px; }
.login-card input { width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; }
.login-card button { width: 100%; margin-top: 8px; }
h1 { font-size: 18px; margin: 0; white-space: nowrap; }
h2 { font-size: 15px; margin: 20px 0 8px; }
h3 { font-size: 13px; margin: 18px 0 6px; color: #666; }
.dim { color: #8a857b; }
main { display: grid; grid-template-columns: 380px 1fr; min-height: calc(100vh - 52px); }
aside { padding: 16px 20px; border-right: 1px solid #e2ded5; overflow-y: auto; }
section { padding: 16px 24px; min-width: 0; }
label { display: block; margin-bottom: 10px; font-size: 12px; color: #555; }
textarea, input[type=number], select { width: 100%; margin-top: 4px; padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
input[type=file] { margin-top: 4px; width: 100%; }
.files-field { display: block; margin-bottom: 10px; font-size: 12px; color: #555; }
.files-field .dim { font-weight: 400; }
.drop-zone { position: relative; margin-top: 4px; padding: 14px 10px; border: 1px dashed #d5d0c5; border-radius: 8px; background: #fff; text-align: center; }
input.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.drop-hint { font-size: 12px; color: #8a857b; pointer-events: none; }
.drop-zone.dragover { background: #f6f4ef; border-color: #c2410c; }
.drop-zone.full { opacity: .55; }
.drop-zone.full .drop-input { pointer-events: none; }
.file-list { list-style: none; margin: 6px 0 0; padding: 0; }
.file-list[hidden], .file-count[hidden] { display: none; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 3px 2px; font-size: 13px; color: #1d1d1b; }
.file-list .fname { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-list button.link { flex: none; font-size: 12px; color: #c2410c; }
.upstream { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 10px; padding: 8px 10px; border: 1px solid #fed7aa; border-radius: 8px; background: #fff7ed; font-size: 13px; }
.upstream[hidden] { display: none; }
.submit-row { display: flex; gap: 8px; }
.submit-row #submitBtn { flex: 1; }
.chain-draft { margin: 10px 0; padding: 8px 10px; border: 1px solid #e2ded5; border-radius: 8px; font-size: 13px; }
.chain-draft[hidden], #chainsBox[hidden] { display: none; }
.chain-draft .chain-head { margin: 0 0 4px; font-weight: 600; }
.chain-draft ol, #chains ol { margin: 0 0 8px; padding-left: 20px; }
.chain-draft li, #chains ol li { padding: 2px 0; }
.chain-draft li button.link { font-size: 12px; color: #c2410c; margin-left: 6px; }
#chains { list-style: none; padding: 0; margin: 0 0 12px; }
#chains > li { border-radius: 6px; }
#chains > li.open { background: #f3f0ea; }
#chains .chain-row { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
#chains .chain-row b { flex: 1; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#chains .chain-row:hover { background: #ebe7de; }
#chains .chain-body { display: none; padding: 0 10px 8px; font-size: 13px; }
#chains > li.open .chain-body { display: block; }
#chains .chain-body > p { margin: 0 0 4px; }
#chains ol li.now { font-weight: 600; }
#chains .chain-note { margin: 4px 0; color: #92400e; }
#chains .btns button { padding: 3px 10px; font-size: 12px; }
#chains .chain-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
#chains .chain-share input { flex: 1; min-width: 160px; padding: 3px 6px; font: 12px ui-monospace, Consolas, monospace; border: 1px solid #d5d0c5; border-radius: 6px; background: #f6f4ef; }
#chains .chain-share button { padding: 3px 10px; font-size: 12px; }
#chains .chain-share a { color: #c2410c; font-size: 12px; }
.badge.c-running, .badge.c-planning { background: #e0e7ff; color: #3730a3; }
.badge.c-done { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.chain { background: #e0e7ff; color: #3730a3; }
.rerun-steps label, .rerun-steps .step { display: block; margin: 8px 0; }
.rerun-steps .step textarea { display: block; width: 100%; }
.rerun-steps textarea:disabled { opacity: .55; }
.rerun-mode { margin: 0 0 12px; padding: 8px 12px; border: 1px solid #d5d0c5; border-radius: 6px; }
.rerun-mode legend { padding: 0 4px; font-size: 12px; color: #555; }
.rerun-mode label { margin: 6px 0; font-size: 13px; color: #222; align-items: flex-start; }
.rerun-mode input { margin-top: 3px; flex: none; }
.rerun-steps .step-ops { float: right; }
.rerun-steps .step-ops button { padding: 1px 8px; font-size: 12px; }
.upstream .up-text { flex: 1; min-width: 0; }
.up-list { list-style: none; margin: 4px 0 6px; padding: 0; }
.up-list li { padding: 2px 0; }
.up-list button.link { font-size: 12px; color: #c2410c; margin-left: 4px; }
.up-add { margin: 0 0 10px; font-size: 13px; }
.up-light { display: block; margin-bottom: 4px; color: #92400e; }
.up-light[hidden] { display: none; }
.up-add button.link { color: #c2410c; }
.up-add button.link:disabled { color: #a8a29e; cursor: default; }
#upQ { width: 100%; margin-top: 8px; }
.up-pick { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 520px); overflow-y: auto; }
.up-pick li { border-top: 1px solid #f0eee9; padding: 8px 2px; font-size: 13px; }
.up-pick .check { align-items: flex-start; }
.up-pick .check input { margin-top: 3px; }
.up-pick .why { color: #92400e; }
.file-count { margin: 2px 0 8px; font-size: 12px; }
.prompt-wrap { position: relative; display: block; }
.prompt-wrap.dragover textarea { border-color: #c2410c; background: #f6f4ef; }
button.ref-tag { flex: none; margin: 0; padding: 0 7px; border: 0; border-radius: 999px; background: #f3efe7; color: #c2410c; font-size: 12px; font-weight: 600; line-height: 20px; cursor: grab; user-select: none; white-space: nowrap; }
button.ref-tag:hover { background: #ebe7de; }
button.ref-tag:active { cursor: grabbing; }
.ref-thumb { flex: none; width: 22px; height: 22px; object-fit: cover; border-radius: 4px; background: #ebe7de; }
#refMenu { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #e2ded5; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.16); max-height: 220px; overflow-y: auto; }
#refMenu[hidden] { display: none; }
#refMenu li { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: #1d1d1b; cursor: pointer; }
#refMenu li:hover { background: #f6f4ef; }
#refMenu li[aria-selected="true"] { background: #ebe7de; }
#refMenu .ref-name { color: #c2410c; font-weight: 600; white-space: nowrap; }
#refMenu .dim { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 6px; align-items: center; }
button { padding: 8px 16px; font: inherit; border: 0; border-radius: 6px; background: #c2410c; color: #fff; cursor: pointer; }
button:disabled { opacity: .5; }
button.ghost { background: transparent; color: #c2410c; border: 1px solid #c2410c; }
#jobs { list-style: none; padding: 0; margin: 0; }
#jobs li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
#jobs .job-icon { flex: none; width: 18px; height: 18px; }
#jobs li b { flex: 1; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#jobs li:hover, #jobs li.on { background: #ebe7de; }
#jobs .rename, #chains .rename, #plans .rename { flex: none; padding: 0 2px; margin-left: -6px; font-size: 12px; line-height: 1; background: none; color: #8a857b; opacity: 0; }
#jobs li:hover .rename, #jobs li.on .rename, #jobs .rename:focus-visible,
#plans li:hover .rename, #plans li.on .rename, #plans .rename:focus-visible,
#chains .chain-row:hover .rename, #chains > li.open .rename, #chains .rename:focus-visible { opacity: 1; }
#jobs .rename:hover, #chains .rename:hover, #plans .rename:hover { color: #c2410c; }
@media (hover: none) { #jobs .rename, #chains .rename, #plans .rename { opacity: .6; } }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #e2ded5; white-space: nowrap; }
.s-planning, .s-rendering, .s-queued { background: #fde68a; }
.s-awaiting_approval { background: #fdba74; }
.s-done { background: #bbf7d0; }
.s-failed { background: #fecaca; }
.head { display: flex; gap: 12px; align-items: center; }
.head h2 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { display: flex; align-items: center; gap: 8px; flex: none; }
.meter .track { position: relative; width: 160px; height: 6px; border-radius: 3px; background: #e2ded5; }
.meter .fill { height: 100%; width: 0; border-radius: 3px; background: #c2410c; transition: width .4s ease; }
.meter.over .fill { background: #d97706; }
.meter.full .fill { background: #dc2626; }
.meter .mark { position: absolute; top: -3px; bottom: -3px; left: calc(100% / 1.2); width: 1px; background: #1d1d1b; }
.meter .nums { font: 12px/1 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; color: #8a857b; white-space: nowrap; }
#preview { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
#preview video { max-width: 100%; max-height: 60vh; background: #000; border-radius: 6px; }
#preview figure { margin: 0; }
#preview img { max-width: 100%; max-height: 60vh; border-radius: 6px; display: block; }
figcaption { font-size: 12px; color: #8a857b; margin-top: 4px; }
#actions textarea { margin-bottom: 8px; }
.fb-attach { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: -4px 0 4px; font-size: 12px; }
.fb-pick { flex: none; color: #c2410c; font-size: 13px; cursor: pointer; }
.fb-pick:hover { text-decoration: underline; }
.fb-wrap.dragover textarea { border-color: #c2410c; background: #f6f4ef; }
#fbLinks { width: 100%; margin: 6px 0 8px; padding: 7px 9px; font: inherit; font-size: 13px; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
#fbMsg { margin: 0 0 6px; font-size: 12px; }
#fbMsg:empty { display: none; }
#actions .btns { align-items: center; flex-wrap: wrap; }
#actions .budget-adj { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; color: #555; white-space: nowrap; }
#actions .budget-adj input[type=number] { width: 5em; margin: 0; padding: 8px; }
#contHint { flex: 1 1 100%; font-size: 12px; }
#contHint.err { color: #dc2626; }
.btns { display: flex; gap: 8px; }
#outputs { margin: 12px 0; font-size: 12px; }
#outputs a { color: #c2410c; }
#transcripts { font-weight: 400; margin-left: 8px; }
#transcripts a { color: #c2410c; font-size: 12px; }
#log { font: 12px/1.6 ui-monospace, Consolas, monospace; background: #fff; border: 1px solid #e2ded5; border-radius: 6px; padding: 10px; max-height: 50vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.ev i { color: #aaa; font-style: normal; margin-right: 8px; }
.ev-tool b { color: #2563eb; margin-right: 6px; }
.ev-assistant { color: #1d1d1b; }
.ev-assistant.dim { color: #8a857b; }
.ev-user { color: #7c3aed; }
.ev-user summary { cursor: pointer; }
.ev-user .body { display: block; color: #57534e; }
.log-more { text-align: center; margin-bottom: 6px; }
#asks ol { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
#asks li { background: #f7f4ee; border-left: 3px solid #7c3aed; border-radius: 4px; padding: 6px 10px; }
#asks .ask-head { font-size: 12px; color: #8a857b; }
#asks .ask-text { white-space: pre-wrap; word-break: break-word; max-height: 12em; overflow-y: auto; }
#asks .up { margin: 8px 0; }
#asks .up-title { font-weight: 600; font-size: 13px; }
#asks .up-title .dim { font-weight: normal; font-size: 12px; }
#asks .up-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
#asks .up-list li { background: #eef4ff; border-left: 3px solid #2563eb; border-radius: 4px; padding: 6px 10px; }
#asks .up-list .up-list li { background: #f5f8ff; }
#asks .up-list li.gone { background: #f3f3f3; border-left-color: #aaa; }
#asks .up-list .ask-head a { font-weight: 600; }
#asks .ask-later { font-size: 12px; margin-top: 2px; }
#asks details summary { cursor: pointer; font-size: 12px; color: #2563eb; margin-top: 4px; }
.ev-error, .ev-tool_error { color: #dc2626; }
.ev-result { color: #15803d; border-top: 1px dashed #ddd; padding-top: 4px; margin-top: 4px; }
.ev-status { color: #8a857b; }
.ev-report { color: #1d1d1b; background: #f7f4ee; border-left: 3px solid #c2410c; padding: 4px 8px; margin: 4px 0; }
#timing { margin-top: 10px; font-size: 12px; color: #555; font-variant-numeric: tabular-nums; }
#timing b { color: #c2410c; font-weight: 600; }
#timing .runs { color: #8a857b; margin-top: 2px; }
#libraryBtn { margin-left: 8px; }
#libraryBtn[hidden] { display: none; }
#libraryBtn + #account { margin-left: 8px; }
.low-note { margin: 8px 0 0; padding: 8px 10px; font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; }
.low-note[hidden] { display: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog .head { display: flex; justify-content: space-between; align-items: center; }
dialog .head h2 { margin: 0; }
#ledgerList { max-height: 60vh; overflow-y: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 12px; }
table.ledger th, table.ledger td { padding: 6px 8px; border-bottom: 1px solid #f0ece4; text-align: left; vertical-align: top; }
table.ledger th { color: #8a857b; font-weight: 500; position: sticky; top: 0; background: #fff; }
table.ledger .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.ledger .pos { color: #15803d; }
table.ledger .neg { color: #1d1d1b; }
table.ledger a { color: #c2410c; }
.plan-box { border: 1px solid #f0ece4; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.plan-box p { margin: 4px 0; }
.plan-box .plan-note { color: #15803d; }
.plan-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.plan-offers button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
#shareBox {display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; font-size: 12px; color: #555; background: #fff; border: 1px solid #e2ded5; border-radius: 8px; }
#shareBox[hidden] { display: none; }
#shareBox input { flex: 1; min-width: 220px; padding: 5px 8px; font: 12px ui-monospace, Consolas, monospace; border: 1px solid #d5d0c5; border-radius: 6px; background: #f6f4ef; }
#shareBox button { padding: 4px 10px; font-size: 12px; }
#shareBox a { color: #c2410c; }
.ev.sub { padding-left: 18px; opacity: .75; }

/* ---------- files ---------- */
dialog.files { width: min(1400px, calc(100vw - 32px)); height: calc(100vh - 48px); max-height: none; padding: 14px 16px; display: none; flex-direction: column; }
dialog.files[open] { display: flex; }
dialog.files .head { gap: 12px; margin-bottom: 10px; }
dialog.files .grow { flex: 1; }
.btn-link { color: #c2410c; font-size: 13px; }
.files-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; gap: 12px; }
.tree { overflow: auto; border: 1px solid #e2ded5; border-radius: 8px; padding: 6px; font-size: 13px; background: #fbfaf7; }
.tree details > summary { cursor: pointer; padding: 3px 4px; border-radius: 4px; white-space: nowrap; }
.tree details > summary:hover { background: #ebe7de; }
.tree details.here > summary { background: #fde6d8; }
.tree .kids { padding-left: 14px; }
.tree .zip { margin-left: 8px; font-size: 11px; color: #c2410c; }
.tree button.file { display: flex; width: 100%; gap: 8px; justify-content: space-between; padding: 3px 6px; border: 0; border-radius: 4px; background: transparent; color: #1d1d1b; font: inherit; text-align: left; cursor: pointer; }
.tree button.file:hover { background: #ebe7de; }
.tree button.file.on { background: #fde6d8; }
.tree .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .size { flex: none; color: #8a857b; font-size: 11px; font-variant-numeric: tabular-nums; }
.tree .lib-file { display: flex; align-items: center; gap: 4px; }
.tree .lib-file button.file { width: auto; flex: 1; min-width: 0; }
.tree .ops { display: inline-flex; gap: 2px; flex: none; opacity: 0; }
.tree summary:hover .ops, .tree .lib-file:hover .ops, .tree summary:focus-within .ops, .tree .lib-file:focus-within .ops { opacity: 1; }
.tree .ops button, .tree .ops a { font-size: 11px; color: #c2410c; background: transparent; border: 0; padding: 0 4px; cursor: pointer; text-decoration: none; }
.tree .ops button:disabled { color: #b5b0a5; cursor: not-allowed; }
.viewer { min-width: 0; overflow: auto; border: 1px solid #e2ded5; border-radius: 8px; padding: 10px 12px; background: #fff; }
.lib-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; font-size: 13px; }
.lib-crumb button { border: 0; background: transparent; color: #c2410c; font: inherit; cursor: pointer; padding: 2px 4px; }
.lib-crumb button:hover { text-decoration: underline; }
.lib-replace { margin: 0; font-size: 12px; font-weight: 400; white-space: nowrap; }
.lib-progress { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; font-size: 12px; }
.lib-progress[hidden] { display: none; }
.lib-progress .bar { height: 4px; background: #f0ece4; border-radius: 2px; overflow: hidden; }
.lib-progress .bar > span { display: block; height: 100%; width: 0; background: #c2410c; }
dialog.files.over { outline: 2px dashed #c2410c; outline-offset: -8px; }
.vhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #f0ece4; font-size: 13px; }
.vhead b { word-break: break-all; }
.vhead a { color: #c2410c; margin-left: auto; }
.vhead .tabs { display: flex; gap: 4px; }
.vhead .tab { padding: 2px 10px; font-size: 12px; background: #fff; color: #555; border: 1px solid #d5d0c5; }
.vhead .tab.on { background: #1d1d1b; color: #fff; border-color: #1d1d1b; }
.vbody img, .vbody video { max-width: 100%; max-height: 70vh; display: block; background: #f3f1ec; }
.vbody audio { width: 100%; }
.vbody .note { margin: 0 0 6px; font-size: 12px; }
.vbody .err { color: #dc2626; }
.code { display: flex; font: 12px/1.55 ui-monospace, Consolas, monospace; border: 1px solid #f0ece4; border-radius: 6px; overflow: auto; }
.code pre { margin: 0; padding: 8px 10px; }
.code .gutter { color: #b5b0a5; text-align: right; user-select: none; background: #faf9f6; border-right: 1px solid #f0ece4; }
.code .src { white-space: pre; tab-size: 2; }
.code .c { color: #8a857b; font-style: italic; }
.code .s { color: #15803d; }
.code .n { color: #b45309; }
.code .k { color: #7c3aed; }
.vbody .md { font-size: 14px; line-height: 1.65; max-width: 860px; }
.vbody .md pre { background: #f3f1ec; padding: 8px; border-radius: 6px; overflow-x: auto; }
.vbody .table { overflow: auto; }
.vbody table { border-collapse: collapse; font-size: 12px; }
.vbody th, .vbody td { border: 1px solid #e2ded5; padding: 4px 8px; text-align: left; vertical-align: top; }
.vbody th { background: #f6f4ef; }
.stage { position: relative; overflow: hidden; background: #111; border-radius: 6px; }
.stage iframe { border: 0; transform-origin: 0 0; background: #fff; display: block; }
.player { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }
.player input[type=range] { flex: 1; }
.player .clock { font-variant-numeric: tabular-nums; color: #555; white-space: nowrap; }
.player button { min-width: 40px; }

/* ---------- admin supervision ---------- */
.jobs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.jobs-head .check { margin: 0; font-weight: 400; }
.job-tabs { display: flex; gap: 3px; margin-left: auto; }
.job-tabs button { --fg: #555; --bg: #eee; padding: 2px 5px; border-radius: 10px; font-size: 11px; font-weight: 500; line-height: 18px; white-space: nowrap; color: var(--fg); background: var(--bg); }
.job-tabs button i { font-style: normal; font-variant-numeric: tabular-nums; opacity: .75; }
.job-tabs button:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.job-tabs button[aria-pressed="true"] { color: #fff; background: var(--fg); }
.job-tabs button[aria-pressed="true"] i { opacity: 1; }
.job-tabs .t-active { --fg: #92400e; --bg: #fef3c7; }
.job-tabs .t-approve { --fg: #c2410c; --bg: #ffedd5; }
.job-tabs .t-done { --fg: #166534; --bg: #dcfce7; }
.job-tabs .t-stopped { --fg: #b91c1c; --bg: #fee2e2; }
.job-tabs .t-paused { --fg: #57534e; --bg: #e7e5e4; }
#jobsEmpty { margin: 8px 10px; font-size: 13px; }
.jobs-filter { display: flex; gap: 6px; margin: 0 0 6px; }
/* One row as wide as the heading: the box fills it, the type picker ends under the 已停止 tab. */
.jobs-filter input, .jobs-filter select { box-sizing: border-box; height: 30px; min-width: 0; margin: 0; padding: 0 8px; font: inherit; font-size: 13px; line-height: 28px; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
#jobsQ { flex: 1 1 0; }
#jobsKind { flex: none; width: auto; max-width: 45%; }
.check[hidden] { display: none; }
.badge.owner { background: #dbeafe; color: #1e40af; }
.supervise { margin: 10px 0 0; padding: 8px 10px; font-size: 12px; color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; }
.supervise[hidden] { display: none; }

/* ---------- API keys ---------- */
.badge.api { background: #ede9fe; color: #5b21b6; }
.badge.recur { background: #dcfce7; color: #166534; }
.badge.recur.paused { background: #fef3c7; color: #92400e; }
#plans { list-style: none; padding: 0; margin: 0 0 12px; }
#plans li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
#plans li:hover, #plans li.on { background: #ebe7de; }
#plans .p-row { display: flex; gap: 8px; align-items: center; }
#plans .p-row b { flex: 1; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#plans .p-when { font-size: 12px; color: #6b665d; margin-top: 2px; }
#plans .p-when.why { color: #92400e; }
.sched-box { margin: 4px 0 8px; }
.sched-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.sched-fields select { width: auto; }
.sched-fields label { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.sched-fields input[type=number] { width: 4.5em; }
#chains .chain-sched { margin: 0 0 4px; color: #166534; }
#chains .chain-sched.why { color: #92400e; }
.badge.wait { background: #f1f5f9; color: #475569; }
/* 子任务: nested under the task that made them, folded like folders */
#jobs li.sub { padding-left: calc(10px + var(--depth) * 16px); }
#jobs .twisty { flex: none; width: 16px; padding: 0; background: none; color: #8a857b; font-size: 12px; line-height: 1; text-align: center; }
#jobs button.twisty:hover { color: #c2410c; }
.badge.tree { background: #dcfce7; color: #166534; }
.badge.sub { background: #fef3c7; color: #92400e; }
.tree-box details { margin-top: 6px; }
#recurBar .btns { display: flex; gap: 8px; margin-top: 8px; }
#recurBar .why { color: #92400e; }
.key-form { display: flex; gap: 8px; margin: 12px 0 4px; }
.key-form input, .copy-row input { flex: 1; min-width: 0; padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font: 12px ui-monospace, Consolas, monospace; background: #f6f4ef; }
.new-key { margin: 8px 0 14px; padding: 10px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; }
.new-key p { margin: 8px 0 4px; }
.new-key pre { margin: 0; padding: 8px 10px; font: 12px/1.5 ui-monospace, Consolas, monospace; background: #fff; border: 1px solid #f0ece4; border-radius: 6px; overflow-x: auto; }
#keyList { overflow-x: auto; }
.hook { margin: 10px 0 0; padding: 6px 10px; font-size: 12px; color: #5b21b6; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 6px; overflow-wrap: anywhere; }
.hook[hidden] { display: none; }
.client-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; }
.client-tabs .tab { padding: 4px 10px; font-size: 12px; background: #fff; color: #555; border: 1px solid #d5d0c5; }
.client-tabs .tab.on { background: #1d1d1b; color: #fff; border-color: #1d1d1b; }
.client-guide { padding: 10px 12px; background: #fbfaf7; border: 1px solid #e2ded5; border-radius: 8px; }
.client-guide p { margin: 0 0 8px; }
.snippet { position: relative; }
.snippet pre { margin: 0; padding: 10px 70px 10px 10px; font: 12px/1.5 ui-monospace, Consolas, monospace; background: #fff; border: 1px solid #f0ece4; border-radius: 6px; overflow-x: auto; white-space: pre; }
.snippet button { position: absolute; top: 6px; right: 6px; padding: 4px 10px; font-size: 12px; }
.connect-page .prof-card h2 .dim { margin-left: 6px; font-weight: 400; font-size: 12px; }
#appList { overflow-x: auto; }
.agent-link { margin: 14px 0 0; font-size: 12px; text-align: center; }
.agent-link a { color: #8a857b; }
.consent h1 { font-size: 19px; }
.consent code { font: 12px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.consent .btns button { flex: 1; }
.mcp-addr code, #keyList code { font: 12px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }

/* ---------- small screens ---------- */
html { -webkit-text-size-adjust: 100%; }
.back { display: none; }
dialog.files { height: calc(100dvh - 48px); }
#ledgerList, .img-body { overflow-x: auto; }
.head > button, #who { white-space: nowrap; }
#newUser input:not([type=checkbox]) { width: 100%; margin-top: 4px; padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }

/* Tablets: a narrower form column. */
@media (max-width: 1100px) {
  main { grid-template-columns: 320px 1fr; }
  aside { padding: 14px 16px; }
  section { padding: 14px 18px; }
  .files-body { grid-template-columns: 240px 1fr; }
  #cfg { min-width: 0; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #detail .head { flex-wrap: wrap; gap: 8px 10px; }
  #detail .head h2 { flex: 1 1 calc(100% - 160px); }
  #detail .head .meter { order: 1; flex: 1 1 200px; }
  #detail .head .meter .track { flex: 1; width: auto; }
  #detail .head > button:not(.back) { order: 2; }
}

/* Phones: one column, and the list and the open job take turns. */
@media (max-width: 760px) {
  header { flex-wrap: wrap; gap: 8px 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  h1 { font-size: 16px; }
  #cfg { order: 9; flex: 1 1 100%; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { display: block; min-height: 0; }
  aside { border-right: 0; padding: 12px 14px 24px; overflow: visible; }
  section { padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); }
  body.has-job main > aside, #empty { display: none; }

  /* iOS zooms into any field under 16px. */
  textarea, input, select, .login-card input, #creditForm input, .jobs-filter input, .jobs-filter select { font-size: 16px; }
  .jobs-filter input, .jobs-filter select { height: 36px; line-height: 34px; }
  .row { gap: 8px; }
  .seg label { font-size: 11px; white-space: nowrap; }

  .back { display: inline-block; padding: 6px 10px; }
  #detail .head h2 { flex: 1 1 0; font-size: 16px; }
  #detail .head .meter { flex: 1 1 100%; }
  #detail .head > button:not(.back) { order: 2; flex: 1 1 0; padding: 8px 6px; }
  #shareBox input { min-width: 0; flex: 1 1 100%; }
  #preview { gap: 12px; margin: 12px 0; }
  #preview figure, #preview video { width: 100%; }
  #preview video, #preview img { max-height: 70vh; margin: 0 auto; }
  #actions .btns { flex-wrap: wrap; }
  #actions .btns button { flex: 1 1 auto; }
  #outputs, #transcripts { overflow-wrap: anywhere; }
  #transcripts { display: block; margin: 4px 0 0; }
  #log { max-height: 60vh; font-size: 11px; padding: 8px; }

  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 16px; }
  dialog.wide { width: calc(100vw - 20px); }
  dialog.files { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); padding-top: max(10px, env(safe-area-inset-top)); }
  dialog.files .head { flex-wrap: wrap; gap: 6px 10px; }
  dialog.files .head h2 { font-size: 15px; }
  #filesNote { order: 9; flex: 1 1 100%; font-size: 12px; }
  .files-body { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 32%) 1fr; gap: 8px; }
  .viewer { padding: 8px; }
  .vhead a { margin-left: 0; }
  .vbody img, .vbody video { max-height: 60dvh; }
  #ledgerList { max-height: calc(100dvh - 140px); }
  table.ledger th, table.ledger td { padding: 6px 4px; }

  #account { margin-left: auto !important; }
  #menu { top: 40px; }
}

/* Fingers, not cursors: bigger targets. */
@media (pointer: coarse) {
  button { min-height: 40px; }
  #actions .budget-adj input[type=number] { min-height: 40px; }
  .btn-link { display: inline-flex; align-items: center; min-height: 40px; }
  #menu button { min-height: 44px; }
  #jobs li { padding: 12px 10px; }
  .job-tabs button { min-height: 32px; }
  .tree button.file, .tree details > summary { padding: 8px 6px; }
  .tree .zip { display: inline-block; padding: 4px 8px; }
  .tree .ops { opacity: 1; }
  .tree .ops button, .tree .ops a { min-height: 32px; padding: 4px 8px; }
  .check input { width: 20px; height: 20px; }
}

/* ---------- docs ---------- */
#docsLink { color: #c2410c; font-size: 13px; text-decoration: none; white-space: nowrap; }
#docsLink:hover { text-decoration: underline; }
#cfg.warn { color: #b45309; }
#cfg[hidden] { display: none; }
header h1 a { color: inherit; text-decoration: none; }
.docs-page main.docs { display: block; max-width: 900px; margin: 0 auto; padding: 16px 20px 48px; min-height: 0; }
.docs-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0 14px; border-bottom: 1px solid #e2ded5; font-size: 13px; }
.docs-nav a { color: #c2410c; }
.docs .md { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
/* md.js shifts headings down two levels: # is h3, ## h4, ### h5. */
.docs .md h3 { font-size: 24px; margin: 20px 0 10px; color: #1d1d1b; }
.docs .md h4 { font-size: 19px; margin: 30px 0 10px; padding-bottom: 4px; border-bottom: 1px solid #e2ded5; }
.docs .md h5 { font-size: 16px; margin: 20px 0 8px; }
.docs .md code { font: 13px ui-monospace, Consolas, monospace; background: #efece5; padding: 1px 4px; border-radius: 3px; }
.docs .md pre { background: #fff; border: 1px solid #e2ded5; padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
.docs .md pre code { background: none; padding: 0; }
.docs .md .table { overflow-x: auto; }
.docs .md table { border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.docs .md th, .docs .md td { border: 1px solid #e2ded5; padding: 5px 8px; text-align: left; vertical-align: top; }
.docs .md th { background: #efece5; }
@media (max-width: 760px) {
  header { gap: 8px 10px; }
  #who { padding: 4px 8px; font-size: 13px; }
}

/* 发布任务和浏览器扩展 */
.seg { display: flex; gap: 2px; padding: 3px; background: #ece8df; border-radius: 10px; }
.seg label { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; margin: 0; padding: 6px 2px 5px; border-radius: 8px; font-size: 11px; line-height: 1.2; color: #6b665c; white-space: nowrap; cursor: pointer; }
.seg label svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.seg label:has(input:checked) { background: #fff; color: #1d1d1b; box-shadow: 0 1px 2px rgba(29,29,27,.12), 0 0 0 .5px rgba(29,29,27,.06); }
.seg label:has(:focus-visible) { outline: 2px solid #c2410c; outline-offset: 1px; }
.seg input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.kind-note { margin: 6px 2px 8px; font-size: 12px; }
/* Specialist tasks live in a list under the down arrow; the one picked takes a slot in the row. */
#kindPick .seg { position: relative; }
.seg-more { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 6px; border: 0; border-radius: 8px; background: none; box-shadow: none; color: #6b665c; cursor: pointer; }
.seg-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.seg-more[aria-expanded=true] svg { transform: rotate(180deg); }
.seg-more:hover, .seg-more[aria-expanded=true] { color: #1d1d1b; background: rgba(255,255,255,.6); }
.seg label.pro:not(.pro-shown) { display: none; }
.pro-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 60vh; overflow-y: auto; padding: 4px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(29,29,27,.16), 0 0 0 .5px rgba(29,29,27,.08); }
.pro-menu button { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 7px; background: none; box-shadow: none; color: #1d1d1b; text-align: left; cursor: pointer; }
.pro-menu button:hover, .pro-menu button:focus-visible { background: #f3f0ea; outline: none; }
.pro-menu button[aria-checked=true] { background: #ece8df; }
.pro-menu svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pro-menu b { display: block; font-size: 13px; font-weight: 600; }
.pro-menu small { display: block; font-size: 12px; color: #6b665c; line-height: 1.35; }
/* 执行设备: icons only. Colour is usable, grey is offline, a no-entry mark is denied. */
.devices { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; min-height: 28px; }
.devices-label { font-size: 12px; flex: none; }
#devices { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dev { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 7px; background: none; box-shadow: none; transition: background-color .15s; }
.dev svg { width: 20px; height: 20px; transition: filter .15s, opacity .15s; }
button.dev { cursor: pointer; }
button.dev:hover { background: #ece8df; }
button.dev:focus-visible { outline: 2px solid #c2410c; outline-offset: 1px; }
.dev.is-off svg { filter: grayscale(1); opacity: .4; }
.dev.is-denied svg { filter: grayscale(1); opacity: .5; }
/* A browser carries its system as a small badge, bottom right; the denied mark sits top right. */
.dev .dev-os { position: absolute; right: 1px; bottom: 1px; display: flex; align-items: center; justify-content: center; width: 12px; height: 12px;
  border-radius: 3.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .12); }
.dev .dev-os svg { width: 9px; height: 9px; }
.dev.is-denied::after { content: ''; position: absolute; right: 1px; top: 1px; width: 11px; height: 11px; border-radius: 50%; box-sizing: border-box;
  background: linear-gradient(45deg, transparent 42%, #d93025 42%, #d93025 58%, transparent 58%) #fff; border: 1.5px solid #d93025; }
span.dev.is-denied { cursor: not-allowed; }
/* A browser that can generate images and clips (the flow capability pack) wears a spark, top left. */
.dev .dev-cap { position: absolute; left: 0; top: 0; display: flex; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px rgba(147, 51, 234, .25); align-items: center; justify-content: center; }
.dev .dev-cap svg { width: 9px; height: 9px; }
.dev.is-off .dev-cap, .dev.is-denied .dev-cap { opacity: .5; filter: grayscale(1); }
span.dev[data-tip] { cursor: default; }
/* Organization-shared Flows come after a thin divider: a Flow star with the sharer's initial,
   bottom right, and an amber dot, top right, when its known credits cannot pay for a clip. */
.dev-sep { width: 1px; height: 18px; margin: 0 4px; background: #d5d0c5; }
.dev .dev-who { position: absolute; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; width: 12px; height: 12px;
  border-radius: 50%; background: #1f1d1a; color: #fff; font-size: 8px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 1.5px #fff; }
.dev .dev-low { position: absolute; right: 1px; top: 1px; width: 7px; height: 7px; border-radius: 50%; background: #d97706; box-shadow: 0 0 0 1.5px #fff; }
.dev.is-off .dev-who, .dev.is-denied .dev-who { background: #8a857b; }
.dev.is-denied .dev-low { display: none; }
span.dev[data-tip]:focus-visible { outline: 2px solid #c2410c; outline-offset: 1px; }
/* What a device can do: shown while the pointer rests on its icon, or it has focus. */
.dev-tip { position: fixed; z-index: 1000; max-width: 320px; padding: 9px 12px 10px; border-radius: 9px; background: #1f1d1a; color: #f5f2ec;
  font-size: 12px; line-height: 1.5; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); pointer-events: none; }
.dev-tip[hidden] { display: none; }
.dev-tip-head { font-weight: 600; font-size: 13px; }
.dev-tip-state { color: #b8b2a7; }
.dev-tip ul { margin: 6px 0 0; padding-left: 16px; }
.dev-tip li { margin: 1px 0; }
.dev-tip-hint { margin-top: 6px; color: #b8b2a7; font-size: 11px; }
.dev-add { font-size: 12px; margin-left: 2px; }
.deny-note { margin: -6px 2px 12px; font-size: 12px; color: #b45309; }
.platform-pick { border: 1px solid #e2ded5; border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
.platform-pick legend { font-size: 13px; padding: 0 4px; }
form.browse .video-only { display: none; }
form.browse .design-only { display: none; }
form:not(.browse) .browse-only { display: none; }
form.landing .video-only { display: none; }
form:not(.landing) .landing-only { display: none; }
.slug-field { font-weight: 600; color: #1d1d1b; }
.slug-row { display: flex; align-items: stretch; margin-top: 4px; border: 1px solid #d5d0c5; border-radius: 8px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.slug-row:focus-within { border-color: #c2410c; box-shadow: 0 0 0 3px rgba(194,65,12,.14); }
.slug-row.ok { border-color: #2f7d4f; }
.slug-row.bad { border-color: #b3261e; }
.slug-row.bad:focus-within { box-shadow: 0 0 0 3px rgba(179,38,30,.14); }
.slug-row input { flex: 1; min-width: 0; padding: 9px 10px; border: 0; outline: 0; background: transparent; font: 600 15px/1.3 ui-monospace, Consolas, monospace; color: #1d1d1b; }
.slug-row input::placeholder { font-weight: 400; color: #b8b2a6; }
#slugHost { display: flex; align-items: center; padding: 0 10px; background: #f6f4ef; border-left: 1px solid #e2ded5; font: 14px/1 ui-monospace, Consolas, monospace; color: #6b665d; white-space: nowrap; }
#slugHost:empty { display: none; }
.slug-hint { display: block; margin-top: 5px; font-weight: 400; font-size: 12px; color: #8a857b; overflow-wrap: anywhere; }
.slug-hint.ok { color: #2f7d4f; }
.slug-hint.ok b { color: #1d1d1b; font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.slug-hint.bad { color: #b3261e; }
.site-box { border: 1px solid #e2ded5; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.site-box .err { color: #b3261e; white-space: pre-wrap; }
.site-box table { border-collapse: collapse; width: 100%; font-size: 13px; }
.site-box td, .site-box th { text-align: left; padding: 3px 6px; border-top: 1px solid #eee; }
button.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.social-row { display: grid; grid-template-columns: 6em 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee9de; }
.pin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 8px; }
.pin-row select { width: auto; min-width: 12em; margin: 0; }
.pin-row .dim { flex-basis: 100%; font-size: 13px; }
.acc-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.acc-bar input { flex: 1 1 10em; min-width: 8em; width: auto; margin: 0; }
.acc-bar select { width: auto; margin: 0; }
.devices-page .acc-bar input { padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
.acc-group { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.acc-group select { width: auto; margin: 0; }
.acc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.acc-table th, .acc-table td { padding: 5px 8px 5px 0; border-bottom: 1px solid #eee9de; text-align: left; overflow-wrap: anywhere; }
.acc-table th[scope="rowgroup"] { padding-top: 10px; }
.acc-table .acc-del { padding: 1px 8px; }
.social-row .dev-note { width: 100%; margin-top: 4px; padding: 5px 8px; font: inherit; font-size: 13px; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; box-sizing: border-box; }
.social-row .dev-start { display: flex; align-items: center; gap: 6px; margin-top: 6px; cursor: pointer; }
.social-row .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.s-valid { background: #bbf7d0; }
.s-invalid { background: #fecaca; }
.s-missing { background: #e2ded5; }
.s-unknown { background: #fde68a; }
.login-panel { margin: 12px 0; padding: 12px; border: 1px solid #e2ded5; border-radius: 10px; }
.login-panel h3 { margin-top: 0; }
.previews { display: flex; flex-wrap: wrap; gap: 10px; }
.previews figure { margin: 0; width: 200px; }
.previews img { width: 100%; border-radius: 6px; }
.md-doc { border: 1px solid #e2ded5; border-radius: 8px; padding: 4px 14px; margin: 10px 0; }
.login-panel[hidden], #mpClear[hidden] { display: none; }

/* hidden always wins over a display rule such as .seg { display: flex } */
[hidden] { display: none !important; }

.pair-code { font: 600 28px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 4px; margin: 4px 0 8px; }
a.store-btn { display: inline-flex; align-items: center; margin: 2px 0 6px; padding: 8px 16px; border-radius: 6px; background: #c2410c; color: #fff; font-weight: 600; text-decoration: none; }
a.store-btn:hover { background: #9a3412; }
#extPop a.store-btn { width: 100%; justify-content: center; margin: 6px 0; box-sizing: border-box; }

.sub-check { margin-left: 22px; }
.login-tag { font-size: 11px; margin-left: 4px; }
.login-tag.ok { color: #16a34a; } .login-tag.bad { color: #dc2626; } .login-tag.wait { color: #a1a1aa; }
#autoPublishPick textarea { margin-top: 6px; width: 100%; }
.images-page header a { color: #c2410c; }
.images-page #refresh { margin-left: auto; }
.images-page #refresh + #account { margin-left: 8px; }
.img-main { grid-template-columns: 300px 1fr; }
.img-list { list-style: none; padding: 0; margin: 0; }
.img-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.img-list li:hover, .img-list li.on { background: #ebe7de; }
.img-list li .dim { font-size: 12px; }
#imgWarn { white-space: pre-wrap; font-size: 12px; color: #dc2626; }
.img-head { display: flex; align-items: center; gap: 10px; }
.img-head h2 { margin: 4px 0; font-size: 18px; }
.img-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2ded5; margin: 10px 0 4px; }
.img-tabs button { background: transparent; color: #555; border-radius: 6px 6px 0 0; padding: 6px 14px; }
.img-tabs button.on { color: #c2410c; box-shadow: inset 0 -2px #c2410c; }
.img-body { max-width: 1100px; }
.img-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
.img-facts dt { color: #8a857b; }
.img-facts dd { margin: 0; }
.img-body tr.drift td { background: #fff7ed; }
.img-body code { font: 12px ui-monospace, Consolas, monospace; background: #f3f1ec; padding: 1px 5px; border-radius: 4px; }
.img-body .snippet { margin: 4px 0 10px; }
.img-body .snippet pre { white-space: pre-wrap; word-break: break-all; }
.img-files { flex-wrap: wrap; margin-bottom: 10px; }
.img-files button.on { background: #c2410c; color: #fff; }
.img-setting { display: flex; gap: 8px; flex-wrap: wrap; }
.img-setting input { flex: 1 1 220px; padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
@media (max-width: 760px) {
  .img-main { grid-template-columns: 1fr; }
  .img-main aside { border-right: 0; border-bottom: 1px solid #e2ded5; }
  .img-tabs { overflow-x: auto; }
}
.img-compare td:first-child, .img-compare td:last-child { white-space: nowrap; }
.users-page #search { width: 100%; padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; margin-bottom: 8px; }
.users-page .img-list li span .badge { margin-right: 4px; }
.users-page .new-user { margin-top: 12px; }
.users-page .new-user summary { cursor: pointer; color: #c2410c; }
.users-page .new-user form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.users-page .img-head .dim { margin-left: auto; font-variant-numeric: tabular-nums; }
.copy-val { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.copy-val code { font: 12px ui-monospace, Consolas, monospace; background: #f3f1ec; padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.copy-val button { padding: 2px 8px; font-size: 12px; }
.img-body button.ghost, .img-body .btns button { padding: 4px 10px; }
#userMsg:empty { display: none; }

/* ---------- vcorp-chrome connection ---------- */
#extWrap { position: relative; }
#extWrap:not([hidden]) { margin-left: auto; }
#extWrap:not([hidden]) ~ #libraryBtn, #extWrap:not([hidden]) ~ #account { margin-left: 8px; }
.ext-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ext-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #a8a29e; flex: none; }
.ext-pill.on { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.ext-pill.on .dot { background: #16a34a; }
.ext-pill.off, .ext-pill.bad { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.ext-pill.off .dot, .ext-pill.bad .dot { background: #dc2626; }
.ext-pill.busy { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.ext-pill.busy .dot { background: #d97706; animation: ext-pulse 1.2s ease-in-out infinite; }
.ext-pill.flash { animation: ext-flash .7s ease; }
@keyframes ext-pulse { 50% { opacity: .35; } }
@keyframes ext-flash { 40% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .28); } }
#extPop { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 24px)); background: #fff; border: 1px solid #e2ded5; border-radius: 12px; padding: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.16); z-index: 5; }
#extPop[hidden] { display: none; }
.ext-pop-title { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: #8a857b; }
#extPopList { max-height: 240px; overflow-y: auto; }
#extPopList .dim { margin: 4px 0 8px; font-size: 12px; }
.ext-dev { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f0ece4; }
.ext-dev b { font-weight: 600; }
.ext-dev .ext-check { flex: 1 1 100%; font-size: 12px; }
#extPop .btns { margin-top: 10px; }
#extPop .btns button { flex: 1; padding: 6px 10px; font-size: 13px; }
@media (max-width: 760px) {
  .ext-pill { padding: 6px 8px; }
  .ext-pill .label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  #extPop { position: fixed; top: 52px; right: 12px; left: 12px; width: auto; }
}
#updateBar { padding: 8px 24px; background: #fff6d9; border-bottom: 1px solid #e2ded5; font-size: 13px; }

/* 3D model viewer (viewer3d.js): CAD results on the job page and model files in the file viewer. */
.model3d { width: 100%; }
#preview .model3d { flex: 1 1 100%; }
.v3d { position: relative; width: 100%; height: min(62vh, 560px); min-height: 320px; border-radius: 6px; overflow: hidden; background: #f3f1ec; user-select: none; }
.vbody .v3d { height: min(66vh, 620px); }
.v3d:fullscreen { height: 100%; border-radius: 0; }
.v3d canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.v3d canvas:active { cursor: grabbing; }
.v3d-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: #666; font-size: 14px; }
.v3d-status.err { color: #dc2626; }
.v3d-info { position: absolute; top: 10px; left: 12px; font-size: 12px; color: #444; background: rgba(255, 255, 255, .8); padding: 3px 8px; border-radius: 4px; }
.v3d-info:empty { display: none; }
.v3d-hint { position: absolute; bottom: 52px; left: 0; right: 0; text-align: center; font-size: 11px; color: #8a8478; pointer-events: none; }
.v3d-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; padding: 4px; background: rgba(255, 255, 255, .9); border: 1px solid #e2ded5; border-radius: 8px; max-width: calc(100% - 16px); }
.v3d-bar:empty { display: none; }
.v3d-btn { padding: 4px 10px; font-size: 12px; background: transparent; color: #333; border: 1px solid transparent; border-radius: 5px; cursor: pointer; }
.v3d-btn:hover { background: #f0ece4; }
.v3d-btn.on { background: #1d1d1b; color: #fff; }
.v3d-explode { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #333; padding: 0 6px; }
.v3d-explode input { width: 90px; }
.v3d-parts { position: absolute; top: 10px; right: 10px; max-height: calc(100% - 80px); overflow: auto; display: flex; flex-direction: column; gap: 2px; font-size: 12px; background: rgba(255, 255, 255, .9); border: 1px solid #e2ded5; border-radius: 6px; padding: 6px 8px; min-width: 120px; }
.v3d-parts[hidden] { display: none; }
.v3d-part { display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.v3d-swatch { width: 10px; height: 10px; border-radius: 2px; background: #8fa3b8; flex: none; }
@media (max-width: 640px) {
  .v3d { height: 58dvh; }
  .v3d-hint { display: none; }
  .v3d-parts { max-width: 45%; }
}

/* 任务设置 */
.edit-form { display: flex; flex-direction: column; gap: 10px; }
.edit-form .head { margin-bottom: 4px; }
.edit-form textarea { width: 100%; resize: vertical; }
.edit-form input[name=title] { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; font: inherit; border: 1px solid #d5d0c5; border-radius: 6px; background: #fff; }
.edit-form fieldset { margin: 0; }
.edit-form .err { color: #dc2626; }
.edit-form .err { color: #dc2626; }
.edit-form .err:empty { display: none; }
