:root {
  --bg: #0b1420;
  --nav: #101d2b;
  --surface: #f5f8fb;
  --panel: #ffffff;
  --panel-soft: #edf3f7;
  --ink: #14253a;
  --muted: #6e8194;
  --line: #d7e2ea;
  --mint: #38bfa9;
  --mint-deep: #178d82;
  --coral: #df765e;
  --amber: #d39b4b;
  --shadow: 0 20px 54px rgba(11, 20, 32, .14);
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--surface); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; transform: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(23,141,130,.32); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) 420px; background: var(--bg); color: #e8f6f3; }
.login-visual { position: relative; overflow: hidden; padding: clamp(32px, 7vw, 96px); display: flex; align-items: flex-end; background: #122337; }
.login-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, rgba(56,191,169,.25), transparent 44%, rgba(223,118,94,.16)); opacity: .8; }
.login-grid { position: absolute; inset: 14% 9% 16% 13%; border: 1px solid rgba(216,238,240,.16); transform: skewY(-8deg); opacity: .55; }
.login-grid::before, .login-grid::after { content: ""; position: absolute; inset: 18% 10%; border: 1px solid rgba(216,238,240,.11); }
.login-grid::after { inset: 36% 20%; border-color: rgba(242,184,128,.18); }
.login-copy { position: relative; max-width: 620px; }
.login-copy h1 { margin: 0 0 16px; font-size: clamp(34px, 5vw, 70px); letter-spacing: 0; line-height: 1.06; }
.login-copy p { margin: 0; color: #a8c5c8; font-size: 18px; line-height: 1.8; }
.login-card { align-self: center; margin: 32px; padding: 34px; border-radius: 22px; background: #f7fafc; color: var(--ink); box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 8px; font-size: 26px; }
.login-card .hint { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.field { display: grid; gap: 8px; margin: 14px 0; }
.field label { font-size: 13px; font-weight: 700; color: #3a536a; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); padding: 12px 13px; outline: none; transition: border .18s, box-shadow .18s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(56,191,169,.15); }
.field textarea { min-height: 80px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 11px; line-height: 1.4; }
.backup-model-field { margin: 8px 0 0; padding: 14px 16px 4px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.backup-model-field legend { padding: 0 7px; color: #3a536a; font-size: 13px; font-weight: 800; }
.backup-model-toggle { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 12px; font-weight: 700; }
.backup-model-toggle input { width: 17px; height: 17px; accent-color: var(--mint-deep); }
.backup-model-grid { margin-top: 8px; }
.model-test-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.model-test-images figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8fafb; }
.model-test-images img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #16242b; }
.model-test-images figcaption { display: grid; gap: 4px; padding: 10px 12px; font-size: 12px; }
.model-test-images figcaption span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.primary-btn, .quiet-btn, .danger-btn { border: 0; border-radius: 8px; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-btn { color: #062921; background: var(--mint); box-shadow: 0 8px 20px rgba(56,191,169,.2); font-weight: 800; }
.primary-btn:hover { transform: translateY(-1px); background: #52d2bc; }
.quiet-btn { color: #3a536a; background: #eef3f7; }
.quiet-btn:hover { background: #e1ebf1; }
.danger-btn { color: #fff; background: var(--coral); }
.full { width: 100%; }
.error-text { min-height: 20px; margin: 8px 0 0; color: #b64b42; font-size: 13px; }

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); background: var(--surface); }
.sidebar { padding: 24px 16px; color: #dcece9; background: var(--nav); display: flex; flex-direction: column; gap: 20px; }
.brand { padding: 6px 12px 20px; border-bottom: 1px solid rgba(220,236,233,.1); }
.brand strong { display: block; font-size: 19px; letter-spacing: 0; }
.brand span { display: block; margin-top: 7px; color: #7f9aa7; font-size: 12px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { border: 0; border-radius: 9px; background: transparent; color: #9bb2bd; padding: 11px 12px; display: flex; align-items: center; gap: 10px; text-align: left; }
.nav-item:hover { color: #f1fffb; background: rgba(255,255,255,.06); }
.nav-item.active { color: #071f1b; background: var(--mint); font-weight: 800; }
.sidebar-foot { margin-top: auto; padding: 12px; color: #88a0aa; font-size: 12px; border-top: 1px solid rgba(220,236,233,.1); }
.content { min-width: 0; padding: 26px 30px 38px; overflow: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 5px; color: var(--mint-deep); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.page-title { margin: 0; font-size: 28px; line-height: 1.2; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { min-height: 44px; padding: 6px 12px; border: 1px solid #d6e1e8; border-radius: 8px; color: #314a5f; background: #eef3f6; display: grid; gap: 1px; text-align: left; }
.user-chip strong { font-size: 12px; }
.user-chip span { color: var(--muted); font-size: 10px; }
.workspace { display: grid; gap: 20px; }
.hero-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero-line p { max-width: 680px; margin: 8px 0 0; color: var(--muted); line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 8px; color: var(--ink); font-size: 25px; }
.dashboard-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dashboard-filters { padding-bottom: 8px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; }
.dashboard-list { display: grid; gap: 4px; }
.dashboard-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 0; border-top: 1px solid #edf1f4; }
.dashboard-row:first-child { border-top: 0; }
.dashboard-row small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.dashboard-table { display: grid; overflow-x: auto; }
.dashboard-table-head, .dashboard-table-row { min-width: 500px; display: grid; grid-template-columns: minmax(160px, 1fr) 80px 100px 120px; gap: 12px; padding: 11px 0; border-top: 1px solid #edf1f4; font-size: 12px; }
.dashboard-table-head { border-top: 0; color: var(--muted); font-weight: 800; }
.trend-chart { height: 250px; padding: 12px 0 0; }
.trend-chart svg { width: 100%; height: 210px; overflow: visible; background: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, #edf1f4 52px); }
.trend-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; }
.section { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 24px rgba(14,30,46,.04); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-head h3 { margin: 0; font-size: 17px; }
.muted { color: var(--muted); }
.project-list { display: grid; gap: 10px; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #edf1f4; }
.project-row:first-child { border-top: 0; }
.project-name { font-weight: 800; }
.project-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.status { padding: 6px 9px; border-radius: 99px; color: #3d5d70; background: #edf3f7; font-size: 12px; white-space: nowrap; }
.status.done { color: #147668; background: #dff6ef; }
.status.running { color: #92621c; background: #fff0d4; }
.status.fail { color: #a54f47; background: #fde5e0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.span-2 { grid-column: span 2; }
.wizard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.module-item { min-height: 130px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfe; }
.module-item .module-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.module-item strong { font-size: 15px; }
.module-item p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.module-item.signature-module { border-color: #8ad6c5; background: #eefaf7; box-shadow: 0 8px 22px rgba(21, 115, 98, .13); }
.module-tag { color: var(--mint-deep); font-size: 11px; }
.artifact-list { display: grid; gap: 8px; }
.artifact-option { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e2ebf0; border-radius: 11px; background: #fbfdfe; }
.artifact-option input { width: 17px; height: 17px; accent-color: var(--mint-deep); }
.artifact-option strong { display: block; font-size: 13px; }
.artifact-option span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.artifact-option.required { background: #eefaf7; border-color: #bfe8dd; }
.format-row { grid-column: 2 / 4; display: flex; gap: 12px; color: #6a7d8e; font-size: 11px; }
.format-row label { display: inline-flex; align-items: center; gap: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.selection-note { margin: 13px 0 0; padding: 10px 12px; border-left: 3px solid var(--amber); color: #7b5b28; background: #fff8e9; font-size: 12px; line-height: 1.6; }
.signature-summary { border-color: #8ad6c5; background: #f0fbf8; box-shadow: 0 10px 26px rgba(20, 104, 91, .10); }
.signature-summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px 120px; gap: 18px; align-items: center; }
.signature-summary-grid strong { display: block; margin-top: 4px; font-size: 17px; }
.signature-summary-grid p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.signature-summary-grid span { color: var(--muted); font-size: 11px; }

.progress-shell { display: grid; gap: 18px; }
.progress-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-bar { height: 10px; overflow: hidden; border-radius: 99px; background: #e8eef2; }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--mint); transition: width .25s ease; }
.artifact-status { display: grid; gap: 9px; }
.artifact-line { display: grid; grid-template-columns: 165px 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #edf1f4; }
.artifact-line:first-child { border-top: 0; }
.artifact-line strong { font-size: 13px; }
.artifact-line small { color: var(--muted); }
.repair-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 14px; padding: 13px 15px; border: 1px solid #d6e2e8; border-radius: 8px; background: #f5f8fa; box-shadow: 0 5px 14px rgba(28, 45, 58, .12); }
.repair-line div { display: grid; gap: 4px; }
.repair-line small { color: var(--muted); }
.event-log { max-height: 250px; overflow: auto; display: grid; gap: 8px; }
.event-log div { padding: 9px 11px; border-radius: 9px; background: #f4f7f9; color: #53697c; font-size: 12px; }
.event-log time { margin-right: 8px; color: #93a3b0; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.download-list { display: flex; flex-wrap: wrap; gap: 8px; }
.download-link { padding: 8px 10px; border-radius: 8px; color: var(--mint-deep); background: #e8f8f4; font-size: 12px; text-decoration: none; }
.download-link:hover { background: #d5f1e9; }
.is-preparing { pointer-events: none; opacity: .72; }
.is-preparing .icon { animation: download-spin .8s linear infinite; }
@keyframes download-spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 10; max-width: 360px; padding: 13px 15px; border-radius: 11px; color: #eaf7f3; background: #162b3a; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #713c39; }
.status.partial { color: #805819; background: #fff0cf; }

.task-toolbar, .detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.task-toolbar h2, .detail-heading h2 { margin: 0; font-size: 23px; }
.task-toolbar p, .detail-heading span { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.task-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.task-tab { min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; color: #496174; background: #e8eef2; display: flex; align-items: center; justify-content: space-between; }
.task-tab strong { min-width: 30px; padding: 4px 7px; border-radius: 5px; background: rgba(255,255,255,.7); color: var(--ink); }
.task-tab.active { border-color: #1c786f; color: #fff; background: #236e68; box-shadow: 0 8px 20px rgba(23, 84, 78, .22); }
.task-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 12px 30px rgba(21, 39, 55, .10); overflow: hidden; }
.task-panel-head { min-height: 64px; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-panel-head h3 { display: inline; margin: 0 9px 0 0; font-size: 16px; }
.task-panel-head span { color: var(--muted); font-size: 12px; }
.task-panel-actions, .completed-bulk-tools { display: flex; align-items: center; gap: 9px; }
.completed-bulk-tools { min-height: 40px; padding: 4px 5px 4px 11px; border: 1px solid #d7e2e7; border-radius: 7px; background: #f5f8fa; }
.completed-bulk-tools > span { min-width: 76px; color: #34596a; font-weight: 700; }
.bulk-check-all { display: inline-flex; align-items: center; gap: 7px; color: #365365; font-size: 12px; white-space: nowrap; }
.bulk-check-all input, .task-select input { width: 17px; height: 17px; accent-color: var(--mint-deep); }
.inline-filter { display: flex; align-items: center; gap: 8px; }
.inline-filter input, .inline-filter select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.task-table { min-height: 220px; }
.task-row { min-height: 72px; padding: 12px 16px; border-bottom: 1px solid #e6edf2; display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(170px, .7fr) auto 42px; align-items: center; gap: 16px; }
.task-row.with-selection { grid-template-columns: 24px minmax(260px, 1.4fr) minmax(170px, .7fr) auto 42px; }
.task-row.selectable { cursor: default; }
.task-row.selectable:has(.task-select input:checked) { background: #eef8f5; }
.task-select { width: 24px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.task-select-placeholder { width: 24px; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #f7fafb; }
.task-main, .task-stage { min-width: 0; display: grid; gap: 5px; }
.task-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.task-main span, .task-stage small { color: var(--muted); font-size: 11px; }
.task-stage span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3c566b; font-size: 12px; }
.icon-btn { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: #3c566b; background: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.icon-btn:hover { border-color: #80b8ae; color: #116b61; background: #eef8f5; }
.pagination { min-height: 58px; padding: 10px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pagination span { color: var(--muted); font-size: 12px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.batch-source-tabs { width: min(360px, 100%); margin-bottom: 14px; padding: 4px; border: 1px solid #cfdae1; border-radius: 8px; background: #eaf0f4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.batch-source-tab { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 6px; color: #506778; background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.batch-source-tab:hover { color: #174f49; background: rgba(255, 255, 255, .58); }
.batch-source-tab.active { color: #0b413a; background: #fff; box-shadow: 0 4px 12px rgba(17, 43, 57, .12); }
.batch-source-panel[hidden] { display: none; }
.batch-names-input { min-height: 168px !important; line-height: 1.65; }
.batch-names-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }
.batch-names-meta strong { flex: 0 0 auto; color: #2a625c; font-size: 11px; }
.upload-zone { min-height: 118px; padding: 18px; border: 1px dashed #75aa9f; border-radius: 8px; color: #265f59; background: #f3faf8; cursor: pointer; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-content: center; gap: 5px 12px; }
.upload-zone:hover { border-color: #1c786f; background: #eaf7f3; box-shadow: 0 8px 20px rgba(24, 93, 83, .10); }
.upload-zone .icon { width: 28px; height: 28px; grid-row: 1 / 3; align-self: center; }
.upload-zone strong { font-size: 14px; }
.upload-zone span { color: var(--muted); font-size: 11px; }
.batch-preview { min-height: 92px; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.batch-preview-head { min-height: 54px; padding: 10px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.batch-preview-head span { color: var(--muted); font-size: 11px; }
.batch-preview-list { max-height: 260px; overflow: auto; border-top: 1px solid var(--line); }
.batch-preview-row { min-height: 54px; padding: 8px 4px; border-bottom: 1px solid #e7edf1; display: grid; grid-template-columns: 34px minmax(160px, 1fr) 64px minmax(180px, .8fr); align-items: center; gap: 10px; }
.batch-preview-row > span, .batch-preview-row small { color: var(--muted); font-size: 10px; }
.batch-preview-row strong { font-size: 12px; }
.batch-table { min-height: 220px; }
.batch-row { min-height: 82px; padding: 12px 16px; border-bottom: 1px solid #e6edf2; display: grid; grid-template-columns: minmax(250px, 1.2fr) minmax(260px, .9fr) minmax(150px, .6fr) auto 42px; align-items: center; gap: 16px; }
.batch-row:hover { background: #f7fafb; }
.batch-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.batch-main > .icon { flex: 0 0 auto; color: #23796f; }
.batch-main span { min-width: 0; display: grid; gap: 5px; }
.batch-main strong, .batch-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-main small { color: var(--muted); font-size: 10px; }
.batch-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.batch-counts span { color: var(--muted); font-size: 9px; display: grid; gap: 3px; }
.batch-counts b { color: var(--ink); font-size: 13px; }
.batch-summary { display: grid; gap: 16px; }
.batch-progress { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.batch-progress div { display: grid; gap: 5px; }
.batch-progress span { color: var(--muted); font-size: 11px; }
.batch-stat-grid { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.batch-stat-grid div { min-height: 72px; padding: 14px 18px; border-right: 1px solid var(--line); display: grid; align-content: center; gap: 5px; }
.batch-stat-grid div:last-child { border-right: 0; }
.batch-stat-grid span { color: var(--muted); font-size: 10px; }
.batch-stat-grid strong { font-size: 20px; }
.artifact-heading { margin-top: 26px; }
.rule-panel h3 { margin: 0 0 16px; font-size: 17px; }
.rule-panel dl { margin: 0; }
.rule-panel dl div { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.rule-panel dt { color: var(--muted); font-size: 12px; }
.rule-panel dd { margin: 0; font-size: 12px; font-weight: 800; }
.detail-heading { align-items: flex-start; padding-bottom: 4px; }
.detail-title { min-width: 0; flex: 1; }
.detail-title h2 { overflow-wrap: anywhere; }
.detail-actions { display: flex; align-items: center; gap: 10px; }
.section-caption { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.delivery-zone { min-height: 104px; }
.recovery-zone { min-height: 132px; }
.recovery-panel { min-height: 132px; padding: 18px 20px; border: 1px solid #e2a092; border-left: 5px solid #b84f42; border-radius: 8px; background: #fff3f0; box-shadow: 0 12px 28px rgba(113, 48, 42, .14); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; }
.recovery-copy { min-width: 0; }
.recovery-title { display: flex; align-items: center; gap: 10px; }
.recovery-title strong { font-size: 16px; }
.recovery-copy p { max-width: 820px; margin: 10px 0; color: #6e443f; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.recovery-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #76544f; font-size: 11px; }
.recovery-facts b { color: #352421; font-weight: 700; }
.recovery-btn { min-width: 158px; }
.delivery-panel { min-height: 104px; padding: 18px 20px; border: 1px solid #77b9ab; border-left: 5px solid #1d8175; border-radius: 8px; background: #eaf7f4; box-shadow: 0 12px 28px rgba(18, 89, 78, .16); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.delivery-panel > .icon { width: 32px; height: 32px; color: #126a60; }
.delivery-panel p { margin: 0 0 4px; color: #17685f; font-size: 11px; font-weight: 800; }
.delivery-panel strong { display: block; overflow-wrap: anywhere; font-size: 16px; }
.delivery-panel span { display: block; margin-top: 6px; color: #57756f; font-size: 11px; }
.delivery-panel.pending { border-color: var(--line); border-left-color: #8ca0af; background: #f2f5f7; box-shadow: none; }
.material-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.material-action { min-height: 132px; padding: 14px; border: 1px solid #cbd9e2; border-radius: 8px; background: #f8fafb; box-shadow: 0 7px 18px rgba(27, 48, 65, .08); display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 14px; }
.material-action > div { display: flex; align-items: flex-start; gap: 10px; }
.material-action > div > .icon { margin-top: 2px; color: #23796f; }
.material-action span { display: grid; gap: 5px; }
.material-action small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.artifact-drawers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.drawer-trigger { min-height: 70px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #f7fafb; display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; align-items: center; gap: 11px; text-align: left; }
.drawer-trigger:hover { border-color: #80b8ae; background: #eef8f5; box-shadow: 0 6px 16px rgba(20, 70, 64, .09); }
.drawer-trigger span { display: grid; gap: 4px; }
.drawer-trigger small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.artifact-dialog { width: min(620px, calc(100vw - 28px)); height: min(740px, calc(100vh - 40px)); max-height: none; margin: 20px 0 20px auto; padding: 0; border: 0; border-radius: 8px 0 0 8px; color: var(--ink); background: #fff; box-shadow: -22px 0 60px rgba(8, 19, 30, .28); }
.artifact-dialog::backdrop { background: rgba(8, 19, 30, .46); }
.drawer-head { height: 82px; padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.drawer-head h3 { margin: 0; font-size: 19px; }
.drawer-body { padding: 10px 20px 24px; overflow: auto; height: calc(100% - 82px); }
.file-row { min-height: 66px; border-bottom: 1px solid #e4ebef; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-row > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.file-row span { min-width: 0; display: grid; gap: 4px; }
.file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-row small { color: var(--muted); font-size: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.settings-grid div { min-height: 92px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafb; display: grid; align-content: center; gap: 8px; }
.settings-grid div:nth-child(3n) { border-right: 0; }
.settings-grid span { color: var(--muted); font-size: 11px; }
.settings-grid strong { font-size: 13px; }
.settings-workspace { display: grid; gap: 16px; }
.runtime-settings-form { display: grid; gap: 18px; }
.concurrency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.concurrency-field { min-height: 82px; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafb; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.concurrency-field:nth-child(2n) { border-right: 0; }
.concurrency-field > span { display: grid; gap: 5px; }
.concurrency-field small, .fixed-limits small, .resource-row small, .worker-state small { color: var(--muted); font-size: 11px; }
.concurrency-field input { width: 82px; min-height: 44px; padding: 7px 9px; border: 1px solid #b9cbd5; border-radius: 6px; color: var(--ink); background: #fff; font: inherit; font-weight: 800; text-align: center; }
.concurrency-field input:focus { outline: 2px solid rgba(36, 127, 116, .2); border-color: #247f74; }
.fixed-limits { display: flex; flex-wrap: wrap; gap: 10px; }
.fixed-limits > span { min-width: 160px; padding: 10px 13px; border: 1px solid #d7e2e8; border-radius: 6px; background: #fff; display: grid; gap: 4px; }
.resource-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.resource-row { min-height: 58px; padding: 10px 14px; border-bottom: 1px solid #e2eaee; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.resource-row:last-child { border-bottom: 0; }
.resource-row > span:first-child { display: grid; gap: 4px; }
.resource-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.resource-counts b { min-width: 68px; padding: 6px 8px; border-radius: 5px; color: #315466; background: #eef4f7; font-size: 10px; text-align: center; }
.resource-counts .warn { color: #8a5c19; background: #fff0d4; }
.worker-list { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.worker-state { min-height: 64px; padding: 10px 12px; border: 1px solid #dce6eb; border-radius: 6px; background: #f8fafb; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 9px; }
.worker-state small { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty.compact { min-height: 64px; padding: 18px; }

.admin-table { min-height: 220px; }
.admin-row { min-height: 66px; padding: 10px 16px; border-bottom: 1px solid #e6edf2; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) 90px minmax(150px, .9fr) 110px; align-items: center; gap: 14px; font-size: 12px; }
.admin-row > span { min-width: 0; }
.admin-row > span:first-child { display: grid; gap: 3px; }
.admin-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.admin-head { min-height: 46px; color: #526a7b; background: #f2f6f8; font-weight: 800; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.role-list { display: grid; gap: 10px; }
.role-item { min-height: 122px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid #277f75; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(20,43,58,.07); display: grid; grid-template-columns: minmax(260px, 1fr) minmax(260px, .7fr) auto; align-items: center; gap: 20px; }
.role-item h3 { margin: 8px 0 4px; font-size: 16px; }
.role-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.role-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-facts span { padding: 10px 12px; border: 1px solid #dfe8ed; border-radius: 6px; color: var(--muted); background: #f7fafb; display: grid; gap: 5px; font-size: 10px; }
.role-facts strong { color: var(--ink); font-size: 12px; }
.model-type-tabs { margin-bottom: 14px; }
.model-profile-list { display: grid; gap: 10px; }
.model-profile-item { min-height: 116px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid #8ca0af; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(20, 43, 58, .06); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.model-profile-item.active { border-left-color: #277f75; background: #f3fbf9; }
.model-profile-main { min-width: 0; display: grid; gap: 9px; }
.model-profile-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.model-profile-title h4 { margin: 0; font-size: 16px; }
.model-profile-main p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.model-profile-facts { display: flex; flex-wrap: wrap; gap: 7px 10px; color: #547083; font-size: 10px; }
.model-profile-facts span { max-width: 340px; padding: 4px 7px; border-radius: 5px; background: #eef3f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.audit-table { min-height: 260px; overflow-x: auto; }
.audit-row { min-width: 900px; min-height: 58px; padding: 9px 16px; border-bottom: 1px solid #e6edf2; display: grid; grid-template-columns: 180px 120px 150px minmax(150px, 1fr) 90px 140px; align-items: center; gap: 12px; font-size: 11px; }
.audit-head { min-height: 46px; color: #526a7b; background: #f2f6f8; font-weight: 800; }
.form-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(8,19,30,.32); }
.form-dialog.wide { width: min(880px, calc(100vw - 24px)); }
.form-dialog::backdrop { background: rgba(8,19,30,.5); }
.dialog-head { min-height: 66px; padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h3 { margin: 0; font-size: 17px; }
.dialog-body { max-height: calc(100vh - 100px); padding: 18px; overflow: auto; }
.choice-field, .permission-matrix fieldset { margin: 16px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.choice-field legend, .permission-matrix legend { padding: 0 6px; color: #3a536a; font-size: 12px; font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid label, .permission-matrix label { min-height: 52px; padding: 8px 10px; border: 1px solid #e1e9ee; border-radius: 6px; background: #f8fafb; display: flex; align-items: flex-start; gap: 9px; }
.choice-grid.compact label { min-height: 42px; align-items: center; }
.choice-grid input, .permission-matrix input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--mint-deep); }
.choice-grid span, .permission-matrix span { min-width: 0; display: grid; gap: 3px; font-size: 12px; }
.choice-grid small, .permission-matrix small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.permission-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.permission-matrix fieldset { margin-top: 14px; display: grid; gap: 7px; }
.account-summary { padding: 13px 14px; border-left: 4px solid var(--mint-deep); background: #eef7f5; display: grid; gap: 5px; }
.account-summary span { color: var(--muted); font-size: 11px; }
.session-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.session-row { min-height: 62px; padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session-row:last-child { border-bottom: 0; }
.session-row div { min-width: 0; display: grid; gap: 4px; }
.session-row span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.session-row time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.secret-box { display: grid; gap: 14px; }
.secret-box p { margin: 0; color: var(--muted); font-size: 12px; }
.secret-box code { padding: 14px; border: 1px solid #b9d8d2; border-radius: 6px; color: #123f39; background: #edf8f5; overflow-wrap: anywhere; font-size: 16px; }

@media (max-width: 1040px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 260px; }
  .login-card { margin: 24px auto; width: min(420px, calc(100% - 48px)); }
  .app-frame { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; }
  .brand { padding: 6px 5px 18px; text-align: center; }
  .brand strong { font-size: 15px; }
  .brand span, .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 12px 8px; }
  .sidebar-foot { display: none; }
  .wizard-layout { grid-template-columns: 1fr; }
  .signature-summary-grid { grid-template-columns: 1fr 1fr; }
  .material-actions { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: minmax(0, 1fr) auto 42px; }
  .task-row.with-selection { grid-template-columns: 24px minmax(0, 1fr) auto 42px; }
  .task-panel-actions { align-items: flex-end; flex-direction: column-reverse; }
  .completed-bulk-tools { flex-wrap: wrap; justify-content: flex-end; }
  .batch-row { grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr) auto 42px; }
  .batch-row > .task-stage { display: none; }
  .task-stage { display: none; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid div:nth-child(3n) { border-right: 1px solid var(--line); }
  .settings-grid div:nth-child(2n) { border-right: 0; }
  .admin-row { grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr) 90px 110px; }
  .admin-row > span:nth-child(4) { display: none; }
  .role-item { grid-template-columns: 1fr auto; }
  .role-facts { display: none; }
  .worker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .content { padding: 18px 14px 28px; }
  .topbar, .hero-line { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: space-between; }
  .metric-grid, .form-grid, .module-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .artifact-line { grid-template-columns: 1fr auto; }
  .artifact-line small { grid-column: 1 / 3; }
  .task-tabs { grid-template-columns: 1fr; }
  .task-toolbar, .detail-heading { align-items: stretch; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > button { flex: 1; }
  #batch-form .section-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .detail-actions { justify-content: space-between; }
  .task-row { grid-template-columns: minmax(0, 1fr) auto; }
  .task-row.with-selection { grid-template-columns: 24px minmax(0, 1fr) 42px; }
  .batch-row { grid-template-columns: minmax(0, 1fr) auto; }
  .batch-row > .batch-counts, .batch-row > .status { display: none; }
  .batch-preview-row { grid-template-columns: 28px minmax(0, 1fr) 60px; }
  .batch-preview-row small { grid-column: 2 / 4; }
  .batch-source-tabs { width: 100%; }
  .batch-names-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .batch-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-stat-grid div:nth-child(2) { border-right: 0; }
  .batch-stat-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .task-row > .status { display: none; }
  .delivery-panel { grid-template-columns: 34px minmax(0, 1fr); }
  .delivery-panel .primary-btn { grid-column: 1 / 3; }
  .recovery-panel { grid-template-columns: 1fr; }
  .recovery-btn { width: 100%; }
  .artifact-drawers, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid div { border-right: 0 !important; }
  .artifact-dialog { width: calc(100vw - 12px); }
  .choice-grid, .permission-matrix { grid-template-columns: 1fr; }
  .task-panel-head { align-items: stretch; flex-direction: column; }
  .task-panel-actions { align-items: stretch; }
  .completed-bulk-tools { justify-content: flex-start; }
  .inline-filter { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
  .inline-filter input { min-width: 0; grid-column: 1 / -1; }
  .inline-filter select { min-width: 0; }
  .admin-row { min-height: 62px; padding: 9px 10px; grid-template-columns: minmax(0, 1fr) 70px 84px; gap: 6px; }
  .admin-row > span:nth-child(2) { display: none; }
  .admin-row .row-actions { gap: 6px; }
  .role-item { grid-template-columns: 1fr; }
  .concurrency-grid, .worker-list { grid-template-columns: 1fr; }
  .concurrency-field { border-right: 0; }
  .resource-row { align-items: flex-start; flex-direction: column; }
  .resource-counts { width: 100%; justify-content: flex-start; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-columns { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
