:root {
  color-scheme: light;
  --bg: #eef5fb;
  --panel: #ffffff;
  --text: #102033;
  --muted: #64748b;
  --line: #d5e2ee;
  --soft: #eef6ff;
  --brand: #003f9e;
  --brand-2: #0b63ce;
  --brand-3: #d9ebff;
  --accent: #00a3d7;
  --ok: #15803d;
  --warn: #b45309;
  --error: #b91c1c;
  --shadow: 0 14px 34px rgba(11, 50, 106, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 0;
  background:
    linear-gradient(180deg, #eaf6ff 0, #f7fbff 280px, var(--bg) 100%),
    var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "PingFang SC",
    Arial,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(248px, 292px) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  overflow-x: clip;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  border-right: 1px solid #c7dcf0;
  background:
    linear-gradient(180deg, #f7fbff 0, #ffffff 45%, #f3f8fd 100%);
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 9px;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid #b9d6f4;
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.46) 0, rgba(255, 255, 255, 0) 34%),
    linear-gradient(120deg, #123f9b 0, #1a5eb8 52%, #d9ecff 100%);
  padding: 14px;
  color: #fff;
}

.brand::before {
  content: "NEW";
  position: absolute;
  right: 8px;
  top: 8px;
  color: rgba(255, 255, 255, 0.14);
  font-size: 56px;
  font-weight: 900;
  line-height: 0.9;
}

.brand > div:last-child {
  position: relative;
  z-index: 1;
  align-self: end;
  min-width: 0;
}

.brand-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 48px;
  place-items: center;
  border-radius: 8px 8px 8px 0;
  background: #fff;
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.brand-title {
  position: relative;
  z-index: 1;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}

.brand-subtitle {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: #eaf3ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.nav-item.active {
  border-color: #b4d6ff;
  background: #e8f3ff;
  color: var(--brand);
  font-weight: 700;
}

.nav-item.disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #e5f0ff;
  color: #315c98;
  font-size: 11px;
  font-weight: 800;
}

.nav-item.active .nav-icon {
  background: var(--brand);
  color: #fff;
}

.side-tools {
  border: 1px solid #d5e5f4;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.side-tools summary {
  cursor: pointer;
  color: #23405f;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.side-tools summary::-webkit-details-marker {
  display: none;
}

.side-tools summary::after {
  content: "∨";
  float: right;
  color: var(--brand-2);
}

.side-tools[open] summary::after {
  content: "∧";
}

.side-tools a {
  display: block;
  margin-top: 8px;
  border-radius: 7px;
  color: #31506f;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.side-tools a:hover {
  background: #eef6ff;
  color: var(--brand);
}

.side-note {
  margin-top: auto;
  border: 1px solid #c7dcf0;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.side-note-title {
  font-weight: 800;
}

.side-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.main {
  padding: 24px 28px 34px;
  scroll-behavior: smooth;
  min-width: 0;
  overflow-x: clip;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 108px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #b7d6f4;
  border-radius: 8px;
  background:
    linear-gradient(100deg, #003f9e 0, #004eb8 42%, #a9c9ec 73%, #f8fcff 100%);
  box-shadow: var(--shadow);
  color: #fff;
  padding: 16px 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 0 auto;
  max-width: 520px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

.topbar p,
.panel-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.topbar p {
  max-width: 760px;
  font-size: 15px;
  color: #e6f3ff;
}

.hero-eyebrow {
  margin-bottom: 6px;
  color: #bfdbff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.handoff-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
  border: 1px solid #c8dbe0;
  border-radius: 8px;
  background: #fbfefe;
  box-shadow: var(--shadow);
  padding: 14px;
}

.handoff-title {
  display: grid;
  align-content: center;
  gap: 5px;
}

.handoff-title strong {
  font-size: 17px;
}

.handoff-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.handoff-runtime {
  display: grid;
  gap: 8px;
}

.runtime-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.handoff-runtime span,
.handoff-runtime strong {
  min-width: 0;
}

.handoff-runtime span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.handoff-runtime strong {
  color: #1f2937;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.handoff-runtime a {
  color: var(--brand);
  text-decoration: none;
}

.copy-button {
  height: 28px;
  border: 1px solid #b8d6f0;
  border-radius: 7px;
  background: #eef7ff;
  color: var(--brand);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.self-check-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

.self-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.self-check-head h2 {
  margin: 0;
  font-size: 17px;
}

.self-check-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.self-check-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.self-check-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.self-check-summary strong {
  font-size: 14px;
}

.self-check-summary.ok {
  border-color: #acd8ba;
  background: #eff9f2;
}

.self-check-summary.warn {
  border-color: #f0d49d;
  background: #fff8ed;
}

.self-check-summary.error {
  border-color: #f0b8b8;
  background: #fff1f1;
}

.self-check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.self-check-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  overflow: hidden;
}

.self-check-item.ok {
  border-color: #c5e3cf;
}

.self-check-item.warn {
  border-color: #edd2a0;
}

.self-check-item.error {
  border-color: #efb9b9;
}

.self-check-item span,
.self-check-item strong,
.self-check-item small {
  display: block;
}

.self-check-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.self-check-item strong {
  margin-top: 3px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.self-check-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.self-check-item p {
  color: #344054;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.status-pill {
  min-width: 132px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 7px 11px;
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.status-pill.ready {
  border-color: #a7d7b8;
  background: #edf8f0;
  color: var(--ok);
}

.status-pill.warn {
  border-color: #efd0a2;
  background: #fff7ed;
  color: var(--warn);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 84px;
  border: 1px solid #cfe0f1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0, #f7fbff 100%);
  box-shadow: var(--shadow);
  padding: 13px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  color: var(--brand);
  font-size: 24px;
  line-height: 1.1;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.4;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
}

.primary-workflow {
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr) minmax(240px, 0.72fr);
  align-items: stretch;
  margin-bottom: 16px;
}

.executive-panel {
  margin-top: 16px;
  margin-bottom: 16px;
}

.executive-dashboard {
  display: grid;
  gap: 12px;
}

.executive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.exec-card {
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.exec-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.mini-table {
  display: grid;
  gap: 6px;
}

.mini-head,
.mini-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.85fr 0.65fr;
  gap: 6px;
  align-items: center;
}

.mini-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mini-row {
  min-height: 32px;
  border-top: 1px solid #eef2f6;
  color: #344054;
  font-size: 12px;
}

.drill-row {
  cursor: pointer;
  border-radius: 6px;
  padding: 0 4px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.drill-row:hover,
.drill-row:focus-visible,
.drill-row.active {
  background: #eef7f8;
  color: #0f5964;
  box-shadow: inset 3px 0 0 #2f8b96;
  outline: none;
}

.mini-row span {
  overflow-wrap: anywhere;
}

.asset-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #b7d8df;
  border-radius: 8px;
  background: #e7f3f5;
  padding: 11px 12px;
}

.asset-summary span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.drilldown-panel {
  border: 1px solid #d7e5e8;
  border-radius: 8px;
  background: #fbfefe;
  padding: 14px;
}

.drilldown-panel.empty {
  background: #f7fafb;
}

.drilldown-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.drilldown-head h3 {
  margin: 0;
  font-size: 16px;
}

.drilldown-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.drilldown-head > span {
  flex: 0 0 auto;
  border: 1px solid #c6dee3;
  border-radius: 999px;
  background: #eaf6f8;
  color: #266c76;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.drilldown-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.drilldown-filters,
.drilldown-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-chip {
  border: 1px solid #d5e1e6;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: #2f8b96;
  background: #e8f6f8;
  color: #155e75;
}

.drilldown-search {
  width: min(220px, 100%);
  height: 34px;
  border: 1px solid #d5e1e6;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.drilldown-search:focus {
  border-color: #2f8b96;
  box-shadow: 0 0 0 3px rgba(47, 139, 150, 0.12);
}

.drilldown-count {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drilldown-run-status {
  min-height: 0;
  margin: 0 0 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drilldown-run-status.running,
.drilldown-run-status.ok,
.drilldown-run-status.warn,
.drilldown-run-status.error {
  border: 1px solid #d5e1e6;
  padding: 9px 10px;
}

.drilldown-run-status.running {
  border-color: #c6dee3;
  background: #edf8f9;
  color: #155e75;
}

.drilldown-run-status.ok {
  border-color: #a7d7b8;
  background: #edf8f0;
  color: var(--ok);
}

.drilldown-run-status.warn {
  border-color: #efd0a2;
  background: #fff7ed;
  color: var(--warn);
}

.drilldown-run-status.error {
  border-color: #f0b8b8;
  background: #fff1f1;
  color: var(--error);
}

.drilldown-table {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  background: #fff;
}

.drilldown-row {
  display: grid;
  grid-template-columns: 1fr 1.05fr 2fr 0.68fr 0.68fr 0.55fr 0.95fr 1.2fr;
  gap: 10px;
  align-items: center;
  min-width: 980px;
  padding: 10px 12px;
  border-top: 1px solid #eef2f6;
  color: #344054;
  font-size: 12px;
}

.drilldown-row:first-child {
  border-top: 0;
}

.drilldown-title {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7f8;
  color: var(--muted);
  font-weight: 800;
}

.drilldown-row span {
  overflow-wrap: anywhere;
}

.drilldown-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.row-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.row-tools a,
.mini-action-button {
  border: 1px solid #c8d7dc;
  border-radius: 6px;
  background: #fff;
  color: #245d66;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.mini-action-button {
  cursor: pointer;
}

.row-tools a:hover,
.mini-action-button:hover {
  border-color: #2f8b96;
  background: #edf8f9;
}

.row-tools em {
  color: var(--muted);
  font-style: normal;
}

.table-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.utility-grid .handoff-panel,
.utility-grid .self-check-panel {
  margin-bottom: 0;
}

.utility-grid .handoff-panel {
  grid-template-columns: 1fr;
  align-items: start;
  min-height: 0;
}

.utility-grid .handoff-title {
  align-content: start;
}

.utility-grid .handoff-title strong {
  font-size: 18px;
}

.utility-grid .handoff-runtime {
  grid-template-columns: 1fr;
}

.utility-grid .status-panel,
.utility-grid .model-panel {
  min-height: 0;
}

.utility-grid .self-check-list {
  grid-template-columns: 1fr;
}

.utility-grid .self-check-item {
  grid-template-columns: minmax(120px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
}

.utility-grid .self-check-item p {
  margin-top: 0;
}

.teammate-guide {
  margin-top: 16px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #d5e5f4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0, #f8fbff 100%);
  padding: 12px;
}

.guide-card.owner {
  border-color: #b9d7f7;
}

.guide-card.teammate {
  border-color: #bfe0cb;
}

.guide-card.ip-rule {
  grid-column: 1 / -1;
  border-color: #efd4a0;
  background: #fffaf0;
}

.guide-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.guide-card strong {
  color: #073f91;
  font-size: 15px;
}

.guide-card ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
}

.guide-card p {
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.guide-handoff {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1.58fr);
  gap: 12px;
  margin-top: 12px;
  border: 1px solid #c8dbe0;
  border-radius: 8px;
  background: #fbfefe;
  padding: 12px;
}

.guide-handoff .handoff-title {
  align-content: center;
}

.guide-handoff .handoff-runtime {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-handoff .runtime-row {
  grid-template-columns: 1fr auto;
}

.guide-handoff .runtime-row span {
  grid-column: 1 / -1;
}

.panel {
  border: 1px solid #cfe0f1;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.upload-panel {
  border-color: #9cc7f4;
}

.upload-panel .panel-head h2,
.result-panel .panel-head h2,
.batches-panel .panel-head h2 {
  color: #073f91;
}

.status-list,
.task-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e6f2;
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
}

.status-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-row strong {
  color: var(--text);
  font-size: 14px;
}

.status-row.ok {
  border-color: #bcdcc7;
  background: #f1fbf4;
}

.status-row.warn {
  border-color: #efd0a2;
  background: #fff8ef;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.flow-strip div {
  min-height: 34px;
  border: 1px solid #b8d6f0;
  border-radius: 8px;
  background: #eef7ff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 18px;
}

.step-badge {
  display: grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #e7f1ff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.upload-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.check-row,
.sync-note {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

select,
input[type="text"],
input[name="batch"],
input[type="password"],
input[type="search"],
input[type="url"],
input:not([type]) {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.dropzone {
  display: grid;
  min-height: 168px;
  place-items: center;
  gap: 6px;
  border: 1px dashed #7fb2e8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 18px;
  text-align: center;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--brand);
  background: #eef7ff;
}

.dropzone input {
  display: none;
}

.drop-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #d9ebff;
  color: var(--brand);
  font-size: 22px;
  font-weight: 800;
}

.dropzone small {
  color: var(--muted);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.sync-note {
  border: 1px solid #b9d8d4;
  border-radius: 8px;
  background: #effaf8;
  color: #0f5f59;
  padding: 10px 12px;
  font-weight: 700;
  line-height: 1.5;
}

.handoff-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.handoff-guide div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid #e2e8ef;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.handoff-guide b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: #e7f3f5;
  color: var(--brand);
  font-size: 12px;
}

.handoff-guide span {
  color: #344054;
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-button,
.ghost-button {
  height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
}

.primary-button:disabled {
  background: #98a2b3;
  cursor: wait;
}

.ghost-button {
  border-color: #bdd4ea;
  background: #fff;
  color: var(--text);
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 74px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.9));
  box-shadow:
    0 10px 22px rgba(0, 63, 158, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--brand);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.refresh-button:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow:
    0 14px 28px rgba(0, 63, 158, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.refresh-button:active {
  transform: translateY(0);
}

.refresh-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.refresh-symbol {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #e4f1ff;
  color: var(--brand-2);
  font-size: 17px;
  line-height: 1;
}

.refresh-button:hover .refresh-symbol {
  transform: rotate(18deg);
}

.mj-logo-card {
  display: grid;
  width: clamp(128px, 12vw, 196px);
  height: 86px;
  place-items: center;
  overflow: hidden;
  padding: 0;
}

.mj-logo-card img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78px;
  object-fit: contain;
}

.mini-button {
  height: 30px;
  border: 1px solid #b7d8df;
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mini-button:disabled {
  color: #98a2b3;
  cursor: wait;
}

.tutorial-list {
  display: grid;
  gap: 12px;
}

.tutorial-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  padding: 12px;
  background: #fcfdff;
}

.tutorial-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #e7f3f5;
  color: var(--brand);
  font-weight: 800;
}

.tutorial-item strong {
  display: block;
  margin-bottom: 4px;
}

.tutorial-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.result-panel {
  min-height: 300px;
}

.result-box {
  min-height: 210px;
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  overflow: auto;
  line-height: 1.65;
}

.run-lines {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-head span {
  font-weight: 800;
}

.progress-head strong {
  color: var(--brand);
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf0;
}

.progress-bar div {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-2);
  transition: width 0.25s ease;
}

.progress-wrap p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.step-log {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.step-log li {
  display: grid;
  gap: 2px;
  border-left: 3px solid #c6d7dc;
  padding-left: 9px;
}

.step-log span {
  font-weight: 800;
}

.step-log small {
  color: var(--muted);
}

.result-box.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.link-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  color: var(--brand);
  text-decoration: none;
}

.file-link.primary-file {
  border-color: #9ccfd7;
  background: #eaf7f8;
  color: #104f5c;
  font-weight: 800;
}

.reports-list {
  display: grid;
  max-height: 420px;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.script-asset-box {
  margin-bottom: 10px;
}

.script-asset-card,
.script-asset-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #b7d8df;
  border-radius: 8px;
  background: #e7f3f5;
  padding: 12px;
}

.script-asset-card strong,
.script-asset-card span,
.script-asset-empty strong,
.script-asset-empty span {
  display: block;
}

.script-asset-card span,
.script-asset-empty span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.script-asset-card a {
  flex: 0 0 auto;
  border: 1px solid var(--brand);
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
  text-decoration: none;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.report-filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
  font-size: 13px;
}

.batch-table,
.batch-card-list {
  display: grid;
  gap: 10px;
}

.batch-card {
  display: grid;
  gap: 12px;
  border: 1px solid #e1e8ee;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.batch-card.ready {
  border-color: #bddfe5;
  background: linear-gradient(180deg, #fbffff, #ffffff);
}

.batch-card.pending {
  border-color: #ecd4a8;
  background: #fffdf8;
}

.batch-main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
}

.batch-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.batch-main h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.batch-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.batch-score {
  min-width: 74px;
  border: 1px solid #d5e4e8;
  border-radius: 8px;
  background: #f4fafb;
  padding: 8px 10px;
  text-align: right;
}

.batch-score span,
.batch-score strong {
  display: block;
}

.batch-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.batch-score strong {
  margin-top: 2px;
  color: #0f4f5c;
  font-size: 19px;
}

.batch-status-line,
.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-status-line span {
  border: 1px solid #d7e0e7;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.batch-status-line span.ok {
  border-color: #acd8ba;
  background: #eff9f2;
  color: var(--ok);
}

.batch-status-line span.warn {
  border-color: #f0d49d;
  background: #fff8ed;
  color: var(--warn);
}

.row-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-links a,
.row-links span,
.batch-actions a,
.batch-actions span,
.batch-actions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 5px 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.row-links span,
.batch-actions span {
  color: #98a2b3;
  cursor: default;
}

.batch-actions .primary-link {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.batch-actions a:hover,
.batch-actions button:hover {
  border-color: #9ccfd7;
  background: #eaf7f8;
  color: #104f5c;
}

.batch-actions .primary-link:hover {
  border-color: #0f4f5c;
  background: #0f4f5c;
  color: #fff;
}

.task-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.task-item b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: #e7f3f5;
  color: var(--brand);
}

.task-item strong,
.task-item span {
  display: block;
}

.task-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.report-item {
  display: grid;
  gap: 4px;
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
}

.report-item.primary-report {
  border-color: #bddfe5;
  background: #f5fbfc;
}

.report-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-title-line em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e7f3f5;
  color: var(--brand);
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.report-item .report-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.report-item .report-actions a {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  text-decoration: none;
}

.report-item .report-actions a:hover {
  border-color: #b7d8df;
  background: #e7f3f5;
}

.report-item span {
  color: var(--muted);
  font-size: 12px;
}

.error {
  color: var(--error);
  font-weight: 700;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.model-panel {
  min-height: 0;
}

.model-form {
  display: grid;
  gap: 10px;
}

.model-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary-button.compact {
  width: auto;
  min-height: 40px;
  padding-inline: 18px;
}

.model-status {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.model-status.ok {
  border-color: #bbdfc6;
  background: #f0f9f3;
  color: var(--ok);
}

.model-status.warn {
  border-color: #f2d6a2;
  background: #fff8eb;
  color: var(--warn);
}

.model-status.error {
  border-color: #f0b8b8;
  background: #fff1f1;
  color: var(--error);
}

@media (max-width: 1120px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .work-grid,
  .table-grid,
  .executive-grid,
  .guide-grid,
  .handoff-panel,
  .handoff-runtime,
  .self-check-list,
  .utility-grid {
    grid-template-columns: 1fr;
  }

  .self-check-head,
  .self-check-summary {
    display: grid;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
    max-width: 100%;
  }

  .mj-logo-card {
    width: 150px;
    height: 72px;
  }

  .runtime-row {
    grid-template-columns: 1fr auto;
  }

  .runtime-row span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 12px;
  }

  .topbar {
    padding: 18px;
  }

  h1 {
    font-size: 24px;
  }

  .metric-grid,
  .report-filters,
  .flow-strip,
  .handoff-guide {
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .mj-logo-card {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (min-width: 1121px) and (max-width: 1680px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    min-height: 132px;
    padding: 12px;
  }

  .brand::before {
    right: 7px;
    font-size: 49px;
  }

  .nav-item {
    min-height: 38px;
    font-size: 13px;
  }

  .main {
    padding: 18px;
  }
}

@media (min-width: 1121px) and (max-width: 1520px) {
  .topbar {
    min-height: 104px;
  }

  .top-actions {
    justify-content: flex-start;
    max-width: 100%;
  }

  .primary-workflow {
    grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.05fr);
  }

  .primary-workflow .next-panel {
    grid-column: 1 / -1;
  }

  .table-grid,
  .utility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .executive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .self-check-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1121px) and (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .brand-title {
    font-size: 19px;
  }

  .brand-subtitle {
    font-size: 10px;
  }

  .nav-icon {
    width: 24px;
  }

  .nav-item {
    gap: 8px;
    padding-inline: 8px;
  }

  .side-note {
    display: none;
  }

  .self-check-list,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .guide-handoff {
    grid-template-columns: 1fr;
  }

  .guide-handoff .handoff-runtime {
    grid-template-columns: 1fr;
  }

  .table-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1121px) and (max-width: 1480px) {
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1121px) and (max-width: 1240px) {
  .self-check-list {
    grid-template-columns: 1fr;
  }
}
