:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-dark: #0b1618;
  --ink: #152125;
  --muted: #6f7c80;
  --line: #dfe5e5;
  --line-soft: #ebefef;
  --teal: #0b6b63;
  --teal-bright: #16a394;
  --teal-soft: #e0f3ef;
  --lime: #b6e35a;
  --amber: #d88a26;
  --amber-soft: #fff1d8;
  --red: #c85454;
  --red-soft: #fce8e8;
  --blue: #426b9d;
  --blue-soft: #e9f0f8;
  --shadow-sm: 0 1px 2px rgba(18, 35, 38, 0.04), 0 7px 24px rgba(18, 35, 38, 0.04);
  --shadow-lg: 0 30px 80px rgba(7, 34, 34, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(11, 107, 99, 0.32);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 236px;
  display: flex;
  flex-direction: column;
  background: var(--surface-dark);
  color: #e8f1ef;
  padding: 22px 14px 14px;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 23px; }
.brand strong { display: block; font-size: 17px; letter-spacing: 0.16em; line-height: 1; }
.brand span { display: block; margin-top: 5px; color: #829794; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; position: relative; display: grid; place-items: center; }
.brand-core { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(182, 227, 90, 0.7); }
.orbit { position: absolute; width: 31px; height: 14px; border: 1px solid rgba(115, 215, 199, 0.74); border-radius: 50%; transform: rotate(30deg); }
.orbit-b { transform: rotate(-30deg); }

.primary-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { margin: 18px 10px 6px; color: #627673; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-item {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 9px;
  display: grid;
  grid-template-columns: 21px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  color: #91a3a0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.7; }
.nav-item:hover { color: #e7f1ee; background: rgba(255,255,255,0.045); }
.nav-item.active { color: #ffffff; background: linear-gradient(90deg, rgba(22,163,148,0.24), rgba(22,163,148,0.08)); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 24px; background: var(--lime); border-radius: 0 4px 4px 0; }
.nav-beta { font-size: 8px; font-style: normal; font-weight: 800; color: var(--lime); background: rgba(182,227,90,0.09); padding: 3px 5px; border-radius: 4px; letter-spacing: 0.05em; }
.nav-count { min-width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center; color: #b8c7c4; background: rgba(255,255,255,0.07); font-size: 10px; font-style: normal; }
.nav-count.alert { color: #ffc779; background: rgba(216,138,38,0.15); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.online { background: #48c78e; box-shadow: 0 0 0 4px rgba(72,199,142,0.08); }

.sidebar-footer { margin-top: auto; padding-top: 24px; }
.compute-mini { border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.025); padding: 12px; border-radius: 10px; margin-bottom: 10px; }
.compute-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #9aaba8; }
.compute-head span { display: flex; align-items: center; gap: 6px; }
.compute-head b { color: #d4dfdd; font-weight: 600; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #48c78e; box-shadow: 0 0 0 3px rgba(72,199,142,0.12); }
.compute-meter { height: 4px; background: rgba(255,255,255,0.08); border-radius: 4px; margin: 10px 0 7px; overflow: hidden; }
.compute-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-bright), var(--lime)); border-radius: inherit; }
.compute-mini small { color: #657a76; font-size: 10px; }
.profile-card { width: 100%; border: 0; background: transparent; color: inherit; border-radius: 10px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 8px; text-align: left; cursor: pointer; }
.profile-card:hover { background: rgba(255,255,255,0.04); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #24433f; color: #c5f28b; font-size: 11px; font-weight: 800; }
.profile-card b { display: block; color: #edf4f3; font-size: 12px; }
.profile-card small { display: block; color: #70827f; margin-top: 2px; font-size: 9px; }
.profile-more { color: #6b7f7b; letter-spacing: 1px; }

.main-stage { grid-column: 2; min-width: 0; }
.topbar { height: 70px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(244,246,248,0.88); border-bottom: 1px solid rgba(214,222,222,0.8); backdrop-filter: blur(16px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 9px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #8a979a; font-size: 12px; }
.breadcrumb i { font-style: normal; color: #c3caca; }
.breadcrumb strong { color: #344044; font-weight: 650; }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.72); cursor: pointer; }
.icon-button:hover { background: #fff; border-color: #cbd5d4; }
.icon-button svg { width: 17px; height: 17px; }
.mobile-menu { display: none; }
.notification-button { position: relative; }
.notification-button > i { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #d77352; border: 2px solid white; }
.environment-pill { border: 1px solid #d7e3df; background: rgba(255,255,255,0.66); border-radius: 999px; padding: 8px 12px; color: #54635f; font-size: 11px; display: flex; align-items: center; gap: 8px; }
.primary-button { border: 1px solid #0a5f58; color: white; background: var(--teal); border-radius: 10px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; box-shadow: 0 5px 15px rgba(11,107,99,0.16); transition: 160ms ease; }
.primary-button:hover { background: #085d56; transform: translateY(-1px); }
.primary-button svg { width: 15px; height: 15px; }
.primary-button.compact { padding: 8px 12px; font-size: 12px; }
.primary-button.lime { background: var(--lime); border-color: #a5cf4f; color: #172012; box-shadow: none; }

.page-container { padding: 28px 30px 44px; max-width: 1680px; margin: 0 auto; }
.page { animation: page-in 280ms ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.eyebrow { color: var(--teal); font-size: 10px; letter-spacing: 0.14em; font-weight: 800; text-transform: uppercase; }
.page-heading h1 { margin: 6px 0 5px; font-size: clamp(25px, 2.2vw, 34px); line-height: 1.12; letter-spacing: -0.045em; font-weight: 690; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.ghost-button { border: 1px solid var(--line); background: rgba(255,255,255,0.82); border-radius: 9px; padding: 8px 11px; color: #4e5b5e; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.ghost-button:hover { background: #fff; border-color: #c9d2d2; }
.ghost-button svg { width: 15px; height: 15px; }
.ghost-button.danger { color: var(--red); border-color: #ead1d1; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.68fr); }
.grid-equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 19px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 14px; letter-spacing: -0.025em; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.card-link { border: 0; background: transparent; color: var(--teal); font-size: 11px; cursor: pointer; padding: 2px; }

.hero-card { position: relative; overflow: hidden; min-height: 178px; padding: 24px 25px; color: #e8f3f0; background: #102c2c; border: 0; }
.hero-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 76% 10%, rgba(77,188,169,0.24), transparent 38%), linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px); background-size: auto, 24px 24px, 24px 24px; }
.hero-card::after { content: ""; position: absolute; width: 230px; height: 230px; border: 1px solid rgba(182,227,90,0.12); border-radius: 50%; right: -42px; top: -78px; box-shadow: 0 0 0 38px rgba(182,227,90,0.035), 0 0 0 76px rgba(182,227,90,0.025); }
.hero-content { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; }
.hero-kicker { display: flex; align-items: center; gap: 7px; color: #9fb6b1; font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; }
.hero-kicker .live-dot { width: 6px; height: 6px; }
.hero-card h2 { font-size: 25px; line-height: 1.2; margin: 13px 0 8px; letter-spacing: -0.04em; font-weight: 610; }
.hero-card p { max-width: 680px; color: #9eb4af; line-height: 1.65; margin: 0; font-size: 12px; }
.hero-meta { display: flex; gap: 9px; margin-top: 18px; }
.meta-chip { border: 1px solid rgba(255,255,255,0.1); border-radius: 7px; color: #a9bbb7; padding: 6px 9px; font-size: 10px; }
.meta-chip b { color: #edf6f4; margin-left: 5px; }
.progress-orbit { width: 106px; height: 106px; position: relative; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--lime) 0 68%, rgba(255,255,255,0.08) 68%); }
.progress-orbit::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #153534; }
.progress-orbit div { position: relative; z-index: 1; text-align: center; }
.progress-orbit strong { display: block; font-size: 24px; color: #f4f8f4; letter-spacing: -0.04em; }
.progress-orbit span { display: block; margin-top: 2px; color: #78908b; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }

.metric-card { padding: 16px 17px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--teal); background: var(--teal-soft); }
.metric-icon.amber { color: #a46114; background: var(--amber-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon svg { width: 15px; height: 15px; }
.metric-trend { font-size: 10px; color: var(--teal); }
.metric-card strong { display: block; margin-top: 17px; font-size: 26px; letter-spacing: -0.045em; }
.metric-card > span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.metric-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); margin-top: 13px; padding-top: 10px; color: #8c9698; font-size: 9px; }

.pipeline { display: grid; grid-template-columns: repeat(6, minmax(92px, 1fr)); position: relative; gap: 8px; padding: 7px 0 3px; }
.pipeline::before { content: ""; position: absolute; top: 31px; left: 8%; right: 8%; height: 1px; background: #dce5e3; }
.pipeline-node { position: relative; z-index: 1; text-align: center; }
.pipeline-dot { margin: 0 auto 10px; width: 49px; height: 49px; border: 5px solid white; border-radius: 50%; display: grid; place-items: center; background: #eff3f3; color: #83918e; box-shadow: 0 0 0 1px #dfe6e5; }
.pipeline-dot svg { width: 16px; height: 16px; }
.pipeline-node.done .pipeline-dot { background: var(--teal); color: white; box-shadow: 0 0 0 1px var(--teal); }
.pipeline-node.active .pipeline-dot { background: var(--lime); color: #203022; box-shadow: 0 0 0 1px #9dca4c, 0 0 0 6px rgba(182,227,90,0.14); }
.pipeline-node strong { display: block; font-size: 10px; }
.pipeline-node small { display: block; margin-top: 4px; color: #98a3a5; font-size: 9px; }

.ai-list { display: flex; flex-direction: column; gap: 9px; }
.ai-action { border: 1px solid var(--line-soft); border-radius: 11px; padding: 12px; display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: start; cursor: pointer; transition: 150ms ease; background: #fff; text-align: left; }
.ai-action:hover { border-color: #c9ded9; transform: translateX(2px); }
.priority-mark { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--teal-bright); }
.priority-mark.amber { background: var(--amber); }
.priority-mark.red { background: var(--red); }
.ai-action strong { display: block; font-size: 11px; line-height: 1.4; }
.ai-action small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.4; font-size: 9px; }
.ai-action svg { width: 14px; height: 14px; color: #8c9999; }

.run-table { width: 100%; border-collapse: collapse; }
.run-table th { color: #8a9697; font-size: 9px; font-weight: 650; text-align: left; padding: 0 10px 9px; border-bottom: 1px solid var(--line-soft); letter-spacing: 0.04em; }
.run-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); font-size: 10px; vertical-align: middle; }
.run-table tr:last-child td { border-bottom: 0; }
.task-cell { display: flex; align-items: center; gap: 10px; }
.task-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #f0f5f4; color: var(--teal); }
.task-symbol svg { width: 14px; }
.task-cell strong { display: block; font-size: 10px; }
.task-cell small { display: block; color: #95a0a1; font-size: 8px; margin-top: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; font-size: 9px; color: #4d615d; background: #edf4f2; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--teal-bright); }
.status-pill.running { color: #416276; background: #eaf2f7; }
.status-pill.running::before { background: #4a87ae; animation: pulse 1.5s infinite; }
.status-pill.waiting { color: #8a641c; background: var(--amber-soft); }
.status-pill.waiting::before { background: var(--amber); }
.status-pill.blocked { color: #984949; background: var(--red-soft); }
.status-pill.blocked::before { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.35; } }
.progress-line { min-width: 85px; display: flex; align-items: center; gap: 7px; }
.progress-line > i { display: block; flex: 1; height: 4px; background: #ebefef; border-radius: 4px; overflow: hidden; }
.progress-line > i span { display: block; height: 100%; background: var(--teal-bright); border-radius: inherit; }
.progress-line b { font-size: 9px; font-weight: 600; color: #708082; }

.activity-list { display: flex; flex-direction: column; }
.activity { position: relative; display: grid; grid-template-columns: 27px 1fr; gap: 9px; padding-bottom: 16px; }
.activity:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 27px; bottom: 0; width: 1px; background: #e0e7e6; }
.activity-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #eef5f3; color: var(--teal); z-index: 1; }
.activity-icon svg { width: 12px; }
.activity strong { display: block; font-size: 10px; margin-top: 2px; }
.activity p { color: var(--muted); margin: 3px 0; font-size: 9px; line-height: 1.45; }
.activity time { color: #a3acad; font-size: 8px; }

.scientist-layout { min-height: calc(100vh - 145px); display: grid; grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.35fr); gap: 16px; }
.scientist-chat { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { padding: 17px 18px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.chat-head strong { font-size: 12px; }
.model-pill { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; color: #697779; }
.messages { flex: 1; min-height: 340px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 15px; }
.message { display: flex; gap: 9px; align-items: flex-start; }
.message.user { justify-content: flex-end; }
.message-avatar { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: #153a37; color: var(--lime); font-size: 9px; font-weight: 700; }
.message-bubble { max-width: 84%; border: 1px solid var(--line-soft); background: #f7f9f9; border-radius: 4px 12px 12px 12px; padding: 11px 13px; font-size: 11px; line-height: 1.65; }
.message.user .message-bubble { background: #0f6c64; color: white; border-color: #0f6c64; border-radius: 12px 4px 12px 12px; }
.message-bubble strong { display: block; margin-bottom: 5px; }
.typing { display: inline-flex; gap: 3px; padding: 5px 0; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: #7c918d; animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-3px); opacity: .5; } }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.suggestions button { border: 1px solid var(--line); background: #fff; color: #647174; border-radius: 999px; padding: 6px 9px; font-size: 9px; cursor: pointer; }
.chat-composer { margin: 0 14px 14px; border: 1px solid #d8e0df; border-radius: 12px; background: white; padding: 10px; }
.chat-composer textarea { width: 100%; min-height: 64px; resize: vertical; border: 0; outline: 0; padding: 2px; color: var(--ink); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.composer-tools { display: flex; gap: 4px; }
.composer-tools button { width: 29px; height: 29px; border: 0; display: grid; place-items: center; border-radius: 7px; background: transparent; color: #839091; cursor: pointer; }
.composer-tools button:hover { background: #f2f5f5; }
.composer-tools svg { width: 14px; }

.research-panel { overflow: hidden; }
.research-hero { padding: 21px; background: linear-gradient(145deg,#102e2c,#173b37); color: white; }
.research-hero-top { display: flex; justify-content: space-between; gap: 15px; }
.research-hero span { color: #93aaa5; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.research-hero h2 { margin: 8px 0 5px; font-size: 20px; font-weight: 620; letter-spacing: -.035em; }
.research-hero p { margin: 0; color: #9eb4af; font-size: 10px; }
.confidence { text-align: right; min-width: 65px; }
.confidence strong { display: block; color: var(--lime); font-size: 22px; }
.objective-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.objective-chips b { font-size: 9px; font-weight: 600; color: #d6e4e0; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); padding: 6px 8px; border-radius: 6px; }
.research-body { padding: 18px 20px; }
.evidence-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.evidence-card { border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px; background: #fbfcfc; }
.evidence-card strong { font-size: 18px; display: block; }
.evidence-card span { color: #899596; font-size: 9px; display: block; margin-top: 4px; }
.plan-steps { margin-top: 18px; }
.plan-step { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.plan-step:last-child { border-bottom: 0; }
.step-num { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); font-size: 9px; font-weight: 800; }
.plan-step strong { display: block; font-size: 10px; }
.plan-step small { display: block; color: #8b9698; font-size: 9px; margin-top: 3px; }
.step-tool { font-size: 8px; color: #627472; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; }
.research-footer { padding: 14px 20px; border-top: 1px solid var(--line-soft); background: #fafcfc; display: flex; justify-content: space-between; align-items: center; }
.research-footer small { color: #869294; font-size: 9px; }

.workflow-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 16px; }
.workflow-canvas { min-height: 610px; position: relative; overflow: hidden; background-color: #f8faf9; background-image: radial-gradient(#cfd9d7 0.8px, transparent 0.8px); background-size: 19px 19px; }
.workflow-toolbar { position: absolute; z-index: 4; left: 14px; top: 14px; display: flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm); }
.workflow-toolbar button { width: 29px; height: 29px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; cursor: pointer; }
.workflow-toolbar button:hover { background: #edf3f2; }
.workflow-toolbar svg { width: 13px; }
.workflow-viewport { width: 940px; height: 610px; position: relative; transform-origin: top left; transition: transform 180ms ease; }
.connector { position: absolute; height: 2px; background: #c5d2cf; transform-origin: left center; z-index: 0; }
.connector.active { background: var(--teal-bright); }
.connector::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; color: inherit; }
.workflow-node { position: absolute; width: 154px; padding: 11px 11px 10px; border: 1px solid #dbe3e2; border-radius: 11px; background: white; box-shadow: 0 7px 18px rgba(19,46,45,.06); cursor: pointer; transition: 150ms ease; }
.workflow-node:hover, .workflow-node.selected { border-color: var(--teal-bright); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(11,107,99,.1); }
.workflow-node.selected { box-shadow: 0 0 0 3px rgba(22,163,148,.1), 0 10px 25px rgba(11,107,99,.1); }
.node-head { display: flex; justify-content: space-between; align-items: center; }
.node-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.node-icon svg { width: 12px; }
.node-state { width: 6px; height: 6px; border-radius: 50%; background: #47bb86; }
.node-state.running { background: #4f8fbc; animation: pulse 1.3s infinite; }
.node-state.waiting { background: #c9a04a; }
.node-title { margin: 9px 0 4px; font-size: 10px; font-weight: 700; }
.node-sub { color: #899698; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-port { position: absolute; top: 50%; width: 7px; height: 7px; background: white; border: 2px solid #9fb1ae; border-radius: 50%; }
.node-port.in { left: -5px; }.node-port.out { right: -5px; }
.workflow-side { padding: 18px; align-self: start; }
.detail-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); margin-bottom: 14px; }
.detail-icon svg { width: 20px; }
.workflow-side h2 { margin: 0 0 4px; font-size: 16px; }
.workflow-side > p { margin: 0 0 17px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.detail-list { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 9px; }
.detail-row span { color: #899596; }.detail-row strong { text-align: right; font-weight: 600; }
.artifact-file { margin-top: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; display: flex; gap: 8px; align-items: center; font-size: 9px; }
.artifact-file svg { width: 15px; color: var(--teal); }

.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.search-field { flex: 1; max-width: 420px; position: relative; }
.search-field > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #859293; }
.search-field svg { width: 15px; }
.search-field input { width: 100%; border: 1px solid var(--line); background: white; border-radius: 9px; padding: 9px 11px 9px 34px; outline: 0; }
.segmented { display: flex; background: #e9eeee; border-radius: 9px; padding: 3px; }
.segmented button { border: 0; background: transparent; border-radius: 7px; padding: 7px 10px; color: #7a8789; font-size: 10px; cursor: pointer; }
.segmented button.active { background: white; color: #344142; box-shadow: 0 1px 4px rgba(27,48,48,.08); }

.agent-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.agent-card { padding: 16px; transition: 160ms ease; }
.agent-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20,54,52,.08); border-color: #d2dfdc; }
.agent-card-top { display: flex; align-items: center; justify-content: space-between; }
.agent-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--teal); background: var(--teal-soft); }
.agent-symbol.sim { color: #496e9a; background: var(--blue-soft); }
.agent-symbol.design { color: #8c671b; background: var(--amber-soft); }
.agent-symbol.lab { color: #945c74; background: #f6eaf0; }
.agent-symbol svg { width: 18px; }
.toggle { width: 30px; height: 17px; border-radius: 999px; border: 0; background: #ced6d5; padding: 2px; cursor: pointer; transition: 160ms ease; }
.toggle::after { content: ""; display: block; width: 13px; height: 13px; border-radius: 50%; background: white; transition: 160ms ease; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.toggle.on { background: var(--teal-bright); }.toggle.on::after { transform: translateX(13px); }
.agent-card h3 { font-size: 12px; margin: 13px 0 5px; }
.agent-card > p { height: 34px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.55; margin: 0; }
.agent-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 12px 0; }
.agent-tags span { color: #657372; font-size: 8px; padding: 4px 6px; background: #f1f4f4; border-radius: 5px; }
.agent-meta { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 10px; color: #8f9a9b; font-size: 8px; }
.health { display: flex; align-items: center; gap: 5px; color: #44876f; }.health i { width: 5px; height: 5px; background: #48b985; border-radius: 50%; }

.knowledge-layout { display: grid; grid-template-columns: 210px minmax(300px,.85fr) minmax(420px,1.3fr); min-height: 610px; overflow: hidden; }
.knowledge-nav { background: #f8faf9; border-right: 1px solid var(--line-soft); padding: 16px 12px; }
.knowledge-nav h3 { padding: 0 8px; margin: 0 0 12px; font-size: 10px; color: #798687; }
.collection { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #667476; padding: 8px; border-radius: 7px; cursor: pointer; text-align: left; font-size: 10px; }
.collection:hover, .collection.active { background: white; color: var(--teal); box-shadow: 0 1px 4px rgba(17,44,43,.05); }
.collection svg { width: 14px; }.collection em { margin-left: auto; font-style: normal; font-size: 8px; color: #a0aaab; }
.document-list { border-right: 1px solid var(--line-soft); }
.pane-head { padding: 14px; border-bottom: 1px solid var(--line-soft); }
.pane-head .search-field { max-width: none; }
.doc-items { max-height: 550px; overflow-y: auto; }
.doc-item { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: white; padding: 13px 14px; text-align: left; cursor: pointer; }
.doc-item:hover, .doc-item.active { background: #f4f9f7; }
.doc-type { font-size: 8px; font-weight: 750; color: var(--teal); text-transform: uppercase; }
.doc-item strong { display: block; margin: 6px 0 5px; font-size: 10px; line-height: 1.45; }
.doc-item small { color: #929d9e; font-size: 8px; }
.document-view { padding: 22px; overflow-y: auto; max-height: 610px; }
.document-view h2 { font-size: 18px; line-height: 1.35; margin: 8px 0; }
.source-meta { color: #8e999a; font-size: 9px; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; }
.extraction-title { margin: 18px 0 10px; color: #5e6b6d; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.fact-row { display: grid; grid-template-columns: 100px 1fr; gap: 13px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 10px; line-height: 1.55; }
.fact-row span { color: #8a9697; }.fact-row strong { font-weight: 540; }
.used-by { display: flex; gap: 7px; flex-wrap: wrap; }.used-by button { border: 1px solid #d8e4e1; background: var(--teal-soft); color: var(--teal); border-radius: 6px; padding: 5px 8px; font-size: 8px; cursor: pointer; }

.material-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(320px,.58fr); gap: 16px; }
.table-card { overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.material-table { width: 100%; border-collapse: collapse; }
.material-table th { padding: 10px 12px; background: #f7f9f9; color: #899596; font-size: 8px; text-align: left; font-weight: 700; }
.material-table td { padding: 12px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.material-table tbody tr { cursor: pointer; }.material-table tbody tr:hover, .material-table tbody tr.selected { background: #f1f8f6; }
.material-id { font-weight: 700; color: #36514c; }
.composition { display: flex; gap: 3px; flex-wrap: wrap; }
.element { display: inline-flex; min-width: 26px; justify-content: center; border-radius: 4px; padding: 3px 4px; background: #edf3f2; font-size: 8px; }
.sample-panel { padding: 20px; align-self: start; }
.sample-visual { position: relative; height: 150px; display: grid; place-items: center; border-radius: 12px; background-color: #102d2b; background-image: radial-gradient(circle at center,rgba(105,206,188,.16),transparent 48%),linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px); background-size: auto,16px 16px,16px 16px; overflow: hidden; }
.sample-disc { width: 86px; height: 34px; border-radius: 50%; background: linear-gradient(165deg,#78908b 0%,#273f3b 46%,#a1b2ac 49%,#425b57 65%,#1b302d 100%); box-shadow: 0 18px 22px rgba(0,0,0,.28), inset -12px -7px 14px rgba(0,0,0,.28), inset 10px 5px 11px rgba(255,255,255,.14); transform: rotate(-8deg); }
.sample-scan { position: absolute; width: 120%; height: 1px; background: linear-gradient(90deg,transparent,var(--lime),transparent); top: 30%; box-shadow: 0 0 11px var(--lime); animation: scan 3.4s ease-in-out infinite; }
@keyframes scan { 50% { top: 74%; } }
.sample-panel h2 { margin: 15px 0 4px; font-size: 16px; }.sample-panel > p { margin: 0 0 14px; color: var(--muted); font-size: 9px; }
.property-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 14px; }
.property { border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px; }
.property span { display: block; color: #8b9697; font-size: 8px; }.property strong { display: block; margin-top: 4px; font-size: 12px; }
.prediction-bar { margin-top: 15px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.prediction-row { display: flex; justify-content: space-between; font-size: 9px; margin-bottom: 7px; }.prediction-row span { color: #7e898b; }
.bar { height: 6px; border-radius: 6px; background: #e8eeee; overflow: hidden; }.bar span { display: block; height: 100%; background: linear-gradient(90deg,var(--teal),var(--lime)); border-radius: inherit; }

.lab-layout { display: grid; grid-template-columns: minmax(0,1.5fr) 330px; gap: 16px; }
.lab-map { min-height: 590px; padding: 18px; background: #102b2a; color: white; position: relative; overflow: hidden; }
.lab-map::before { content: ""; position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px); background-size: 24px 24px; }
.lab-map-head { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.lab-map-head h2 { margin: 0; font-size: 13px; }.lab-map-head span { color: #8fa6a1; font-size: 9px; }
.lab-zones { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr; grid-template-rows: 1fr .72fr; gap: 10px; height: 510px; margin-top: 16px; }
.lab-zone { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.025); border-radius: 13px; padding: 13px; position: relative; }
.lab-zone.hot { border-color: rgba(216,138,38,.22); background: rgba(216,138,38,.035); }
.zone-label { color: #7f9691; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }.zone-label b { color: #bfd0cc; font-size: 10px; margin-right: 6px; }
.device-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 12px; }
.device { min-height: 91px; position: relative; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); color: #d8e6e3; border-radius: 9px; padding: 10px; text-align: left; cursor: pointer; }
.device:hover, .device.active { border-color: rgba(182,227,90,.55); background: rgba(182,227,90,.06); }
.device strong { display: block; font-size: 10px; }.device small { display: block; margin-top: 5px; color: #7d9590; font-size: 8px; }
.device i { position: absolute; top: 10px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: #49c38c; box-shadow: 0 0 0 4px rgba(73,195,140,.08); }
.device i.busy { background: #5e9cca; }.device i.idle { background: #c8a04b; }.device i.off { background: #6a7775; }
.device-glyph { height: 37px; display: flex; align-items: flex-end; gap: 3px; opacity: .65; }
.device-glyph span { display: block; width: 7px; background: #7da49d; border-radius: 2px 2px 0 0; }
.device-glyph span:nth-child(1) { height: 18px; }.device-glyph span:nth-child(2) { height: 29px; }.device-glyph span:nth-child(3) { height: 23px; }.device-glyph span:nth-child(4) { height: 34px; }
.lab-detail { padding: 20px; align-self: start; }
.device-live { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.device-live span { font-size: 9px; color: #8b9698; }.device-live strong { display: flex; align-items: center; gap: 7px; color: #3f8e72; font-size: 10px; }
.device-live strong i { width: 6px; height: 6px; border-radius: 50%; background: #48bc87; animation: pulse 1.4s infinite; }
.lab-detail h2 { margin: 0 0 4px; font-size: 18px; }.lab-detail > p { margin: 0 0 17px; color: var(--muted); font-size: 9px; }
.process-block { border: 1px solid var(--line-soft); border-radius: 10px; padding: 13px; background: #fafcfc; }
.process-block span { color: #8a9697; font-size: 8px; }.process-block strong { display: block; font-size: 11px; margin: 5px 0 9px; }
.process-progress { display: flex; align-items: center; gap: 8px; }.process-progress b { font-size: 9px; }.process-progress .bar { flex: 1; }
.telemetry { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 12px; }
.telemetry div { border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px; }.telemetry span { display: block; color: #8c9798; font-size: 8px; }.telemetry strong { display: block; margin-top: 5px; font-size: 13px; }
.event-log { margin-top: 16px; }.event-log h3 { font-size: 10px; margin: 0 0 9px; }.log-line { display: grid; grid-template-columns: 41px 1fr; gap: 8px; margin-bottom: 7px; font-size: 8px; }.log-line time { color: #9ca6a7; }.log-line span { color: #5d6b6d; }

.safety-summary { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(120px,.5fr)); gap: 12px; margin-bottom: 16px; }
.safety-posture { background: #152f2d; color: white; padding: 19px; position: relative; overflow: hidden; }
.safety-posture::after { content: ""; position: absolute; right: -30px; top: -50px; width: 150px; height: 150px; border: 1px solid rgba(182,227,90,.15); border-radius: 50%; box-shadow: 0 0 0 30px rgba(182,227,90,.03); }
.safety-posture span { color: #8ea5a0; font-size: 9px; }.safety-posture strong { display: block; font-size: 20px; margin: 7px 0; }.safety-posture p { color: #91a7a2; font-size: 9px; margin: 0; }
.safety-stat { padding: 16px; }.safety-stat strong { font-size: 23px; display: block; }.safety-stat span { display: block; margin-top: 5px; color: #899496; font-size: 9px; }
.approval-list { display: flex; flex-direction: column; gap: 11px; }
.approval-card { padding: 17px; display: grid; grid-template-columns: 7px minmax(0,1fr) auto; gap: 14px; align-items: start; }
.risk-stripe { align-self: stretch; border-radius: 6px; background: var(--amber); }.risk-stripe.high { background: var(--red); }.risk-stripe.low { background: var(--teal-bright); }
.approval-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }.approval-head h3 { font-size: 12px; margin: 0; }.risk-label { padding: 4px 6px; border-radius: 5px; font-size: 8px; color: #95661c; background: var(--amber-soft); }.risk-label.high { color: #984b4b; background: var(--red-soft); }
.approval-main p { margin: 7px 0 11px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }.check { display: inline-flex; align-items: center; gap: 5px; color: #5d716e; font-size: 8px; }.check::before { content: "✓"; width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 8px; }.check.warn::before { content: "!"; background: var(--amber-soft); color: #9c6e23; }
.approval-actions { display: flex; gap: 6px; }.approval-actions button { min-width: 66px; }

.command-palette, .modal-layer { position: fixed; inset: 0; z-index: 100; background: rgba(4,20,20,.48); display: flex; align-items: flex-start; justify-content: center; padding-top: 11vh; backdrop-filter: blur(4px); }
.command-palette.hidden, .modal-layer.hidden { display: none; }
.palette-card { width: min(620px,calc(100vw - 32px)); background: white; border-radius: 15px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input-wrap { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line-soft); }
.palette-input-wrap svg { width: 17px; color: #7b888a; }.palette-input-wrap input { border: 0; outline: 0; font-size: 13px; }.palette-input-wrap kbd { color: #899596; background: #f1f4f4; padding: 3px 6px; border-radius: 5px; font-size: 8px; }
.palette-results { padding: 8px; max-height: 360px; overflow-y: auto; }
.palette-result { width: 100%; border: 0; background: transparent; border-radius: 8px; padding: 10px; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.palette-result:hover { background: #f1f7f5; }.palette-result > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--teal-soft); color: var(--teal); }.palette-result svg { width: 13px; }.palette-result strong { display: block; font-size: 10px; }.palette-result small { display: block; color: #929d9e; font-size: 8px; margin-top: 2px; }
.modal-layer { align-items: center; padding-top: 0; }.modal-card { width: min(560px,calc(100vw - 30px)); background: white; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; }
.modal-card h2 { margin: 0 0 5px; font-size: 18px; }.modal-card > p { margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }.modal-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; }.field label { display: block; color: #697678; font-size: 9px; margin-bottom: 6px; }.field input,.field select,.field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; outline: 0; }.field.full { grid-column: 1 / -1; }.field textarea { min-height: 90px; resize: vertical; }.modal-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 18px; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; background: #122b29; color: white; box-shadow: var(--shadow-lg); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 19px 1fr; gap: 8px; animation: toast-in 240ms ease both; }.toast svg { width: 16px; color: var(--lime); }.toast strong { display: block; font-size: 10px; }.toast span { display: block; color: #90a5a1; font-size: 8px; margin-top: 3px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.empty-state { padding: 30px; text-align: center; color: #8b9798; font-size: 10px; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .agent-grid { grid-template-columns: repeat(3,1fr); }
  .knowledge-layout { grid-template-columns: 180px .85fr 1.1fr; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: 220ms ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .main-stage { grid-column: 1; }
  .mobile-menu { display: grid; }
  .environment-pill { display: none; }
  .topbar { padding: 0 18px; }
  .page-container { padding: 22px 18px 40px; }
  .grid-main, .scientist-layout, .workflow-layout, .material-layout, .lab-layout { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: repeat(2,1fr); }
  .knowledge-layout { grid-template-columns: 170px 1fr; }
  .document-view { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); }
  .workflow-side, .sample-panel, .lab-detail { align-self: auto; }
  .safety-summary { grid-template-columns: repeat(3,1fr); }.safety-posture { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .breadcrumb > span, .notification-button { display: none; }
  .topbar .primary-button { font-size: 0; width: 38px; height: 38px; padding: 0; }
  .topbar .primary-button svg { width: 17px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .grid-4, .grid-equal, .agent-grid { grid-template-columns: 1fr; }
  .hero-content { grid-template-columns: 1fr; }.progress-orbit { display: none; }
  .pipeline { overflow-x: auto; grid-template-columns: repeat(6,100px); padding-bottom: 10px; }
  .run-table { min-width: 680px; }.table-card { overflow-x: auto; }
  .evidence-grid { grid-template-columns: repeat(2,1fr); }
  .knowledge-layout { display: block; }.knowledge-nav { display: none; }.document-list { border-right: 0; }.document-view { max-height: none; }
  .lab-zones { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }.lab-map { min-height: auto; }.device-grid { grid-template-columns: 1fr 1fr; }
  .safety-summary { grid-template-columns: 1fr 1fr; }.safety-posture { grid-column: 1 / -1; }.approval-card { grid-template-columns: 6px 1fr; }.approval-actions { grid-column: 2; }
  .modal-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }
}
