:root {
  color-scheme: light;
  --canvas: #f3f5ef;
  --surface: #ffffff;
  --surface-soft: #f8faf6;
  --ink: #132019;
  --ink-2: #33433a;
  --muted: #6f7c74;
  --line: #dbe2da;
  --line-strong: #cbd6cb;
  --green: #16764c;
  --green-dark: #105c3b;
  --green-soft: #e8f5ed;
  --lime: #dff36b;
  --blue: #2968c8;
  --blue-soft: #eaf2ff;
  --orange: #a75a08;
  --orange-soft: #fff3dc;
  --red: #b6312c;
  --red-soft: #fff0ee;
  --shadow: 0 18px 55px rgba(24, 45, 31, .08);
  --radius-lg: 22px;
  --radius-md: 15px;
  --sidebar-width: 270px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 1%, rgba(223, 243, 107, .26), transparent 23rem),
    var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .15em; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}
.login-screen::before,
.login-screen::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
}
.login-screen::before { width: 430px; height: 430px; left: -180px; bottom: -180px; background: rgba(65, 168, 113, .15); }
.login-screen::after { width: 360px; height: 360px; right: -130px; top: -140px; background: rgba(223, 243, 107, .35); }
.login-card {
  width: min(520px, 100%);
  padding: 44px;
  border: 1px solid rgba(203, 214, 203, .9);
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 80px rgba(27, 55, 37, .13);
  backdrop-filter: blur(12px);
}
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 17px;
  color: #fff;
  background: var(--green);
  box-shadow: inset 0 -8px 20px rgba(0, 0, 0, .12);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.brand-mark.small { width: 40px; height: 40px; margin: 0; border-radius: 12px; font-size: 13px; flex: 0 0 auto; }
.login-card h1 { margin: 0; font-size: clamp(30px, 7vw, 43px); letter-spacing: -.04em; }
.login-copy { margin: 16px 0 28px; color: var(--muted); line-height: 1.75; }
.login-footnote { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.owner-login-help {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.owner-login-help a { color: var(--green); font-weight: 800; }
.remember-device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.remember-device-row input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.stack-form, .settings-form, .production-form, #publishTaskForm { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--ink-2); font-size: 13px; font-weight: 750; }
label span b { color: var(--red); }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
textarea { resize: vertical; min-height: 118px; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #a1aca5; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 118, 76, .11); }
input:disabled, select:disabled, textarea:disabled { color: #89958d; background: #f1f3f0; cursor: not-allowed; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, opacity .14s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(41, 104, 200, .25); outline-offset: 2px; }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 9px 22px rgba(22, 118, 76, .16); }
.button.primary:hover:not(:disabled) { background: var(--green-dark); box-shadow: 0 12px 28px rgba(22, 118, 76, .22); }
.button.secondary { color: #294437; border-color: var(--line); background: #f3f6f2; }
.button.danger { color: var(--red); border-color: #f1c7c3; background: var(--red-soft); }
.button.compact { min-height: 38px; padding: 8px 13px; font-size: 13px; }
.button.wide { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(250, 252, 248, .92);
  backdrop-filter: blur(14px);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.tenant-panel { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.tenant-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--green-dark); background: var(--green-soft); font-weight: 900; }
.tenant-panel strong, .tenant-panel small { display: block; max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-panel strong { font-size: 13px; }
.tenant-panel small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.workspace-nav { display: grid; gap: 4px; margin: 22px 0 auto; }
.nav-item {
  position: relative;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: #4d5c53;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 750;
}
.nav-item:hover { color: var(--ink); background: #eef2ec; }
.nav-item.active { color: #fff; background: var(--green); box-shadow: 0 10px 24px rgba(22, 118, 76, .15); }
.nav-index { font-size: 10px; letter-spacing: .08em; opacity: .68; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9c3bc; }
.nav-dot.online { background: #4fd58f; box-shadow: 0 0 0 4px rgba(79, 213, 143, .16); }
.nav-dot.offline { background: #e09b3c; }
.count-badge { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; color: var(--green-dark); background: var(--lime); font-size: 11px; font-style: normal; font-weight: 900; }
.settings-link { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.runtime-card { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; margin: 18px 0 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.runtime-card strong, .runtime-card small { display: block; }
.runtime-card strong { font-size: 12px; }
.runtime-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.signal { width: 9px; height: 9px; display: inline-block; margin-top: 4px; border-radius: 999px; background: #b2bcb5; box-shadow: 0 0 0 4px rgba(178, 188, 181, .15); }
.signal.online { background: #27a96b; box-shadow: 0 0 0 4px rgba(39, 169, 107, .14); }
.signal.waiting { background: #e09b3c; box-shadow: 0 0 0 4px rgba(224, 155, 60, .14); }
.signal.error { background: #d54c45; box-shadow: 0 0 0 4px rgba(213, 76, 69, .14); }

.workspace-main { min-width: 0; width: min(1440px, 100%); margin: 0 auto; padding: 34px clamp(22px, 4vw, 58px) 80px; }
.workspace-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 22px; }
.workspace-header h1 { margin: 0; font-size: clamp(30px, 4vw, 45px); letter-spacing: -.045em; }
.workspace-header p:not(.eyebrow) { max-width: 720px; margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.sync-text { color: var(--muted); font-size: 12px; white-space: nowrap; }
.connection-strip { display: grid; grid-template-columns: 12px 1fr; gap: 11px; align-items: start; margin-bottom: 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .76); }
.connection-strip strong, .connection-strip small { display: block; }
.connection-strip strong { font-size: 13px; }
.connection-strip small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.workspace-view { display: none; }
.workspace-view.active { display: block; animation: view-in .2s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 9px 30px rgba(24, 45, 31, .045);
}
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.panel-head h2, .split-heading h2, .guide-panel h2, .security-panel h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.panel-head p:not(.eyebrow), .split-heading p:not(.eyebrow) { max-width: 700px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.panel-actions, .button-row, .filter-group { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }

.metric-grid { display: grid; gap: 12px; margin-bottom: 18px; }
.metric-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.metric-card.accent { border-color: rgba(22, 118, 76, .28); background: linear-gradient(145deg, #fff 30%, #edf8f1); }
.metric-card span, .metric-card small, .metric-card strong { display: block; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { margin: 7px 0 4px; font-size: clamp(24px, 3vw, 31px); letter-spacing: -.04em; }
.metric-card small { color: #8b968f; font-size: 10px; line-height: 1.45; }

.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.asset-card { position: relative; min-width: 0; display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease; }
.asset-card:has(input:checked) { border-color: rgba(22, 118, 76, .55); background: #f1f9f4; box-shadow: 0 0 0 3px rgba(22, 118, 76, .07); }
.asset-check { width: 19px; height: 19px; min-height: 0; margin: 2px 0 0; accent-color: var(--green); }
.asset-card h3 { margin: 0; font-size: 14px; line-height: 1.55; }
.asset-card p { margin: 7px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.asset-card a { display: block; color: var(--blue); font-size: 11px; overflow-wrap: anywhere; text-decoration: none; }
.asset-card a:hover { text-decoration: underline; }
.asset-to-image { width: fit-content; margin-top: 10px; }

.source-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px;
  border: 1px solid #bde4ce;
  border-radius: 13px;
  background: var(--green-soft);
}
.source-selection > div { min-width: 0; }
.source-selection span, .source-selection strong, .source-selection small { display: block; }
.source-selection span { color: var(--green-dark); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.source-selection strong { margin-top: 4px; font-size: 13px; line-height: 1.45; }
.source-selection small { margin-top: 4px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }

.content-results-panel { margin-top: 18px; }
.content-job-list { display: grid; gap: 14px; }
.content-job { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfa; }
.content-job.status-review { border-color: #f0d6a9; background: #fffdf8; }
.content-job.status-approved { border-color: #bde4ce; background: #f8fcf9; }
.content-job.status-failed { border-color: #efcbc7; background: #fff9f8; }
.content-job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.content-job-head strong, .content-job-head small { display: block; }
.content-job-head strong { font-size: 15px; }
.content-job-head small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.content-preview { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.content-preview summary { padding: 12px 14px; cursor: pointer; color: var(--ink-2); font-size: 12px; font-weight: 850; }
.content-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; padding: 0 14px 14px; }
.content-sheet { position: relative; min-height: 230px; padding: 18px 15px 15px; border-radius: 13px; color: #173126; background: linear-gradient(160deg, #f5f9ec 0%, #e8f1dd 58%, #d8e6d0 100%); overflow: hidden; }
.content-sheet::after { content: ""; position: absolute; right: -28px; bottom: -34px; width: 112px; height: 112px; border-radius: 999px; background: rgba(255,255,255,.48); }
.content-sheet-index { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #fff; background: var(--green); font-size: 9px; font-weight: 850; }
.content-sheet h4 { position: relative; z-index: 1; margin: 15px 0 10px; font-size: 18px; line-height: 1.28; letter-spacing: -.03em; }
.content-sheet ul { position: relative; z-index: 1; margin: 0; padding-left: 18px; font-size: 11px; line-height: 1.65; }
.content-sheet small { position: absolute; left: 15px; right: 15px; bottom: 13px; z-index: 1; color: #617468; font-size: 8px; }
.content-risk { padding: 11px 13px; border: 1px solid #f0d6a9; border-radius: 10px; color: #815019; background: var(--orange-soft); font-size: 10px; line-height: 1.55; }
.content-review-actions { justify-content: flex-start; }
.load-more-row { display: flex; justify-content: center; margin-top: 18px; }

.soft-badge, .status-badge, .executor-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.soft-badge.good, .status-badge.completed, .status-badge.review { color: var(--green-dark); background: var(--green-soft); }
.soft-badge.warning, .status-badge.queued, .status-badge.claimed, .executor-pill.waiting { color: var(--orange); background: var(--orange-soft); }
.soft-badge.error, .status-badge.failed, .status-badge.cancelled { color: var(--red); background: var(--red-soft); }
.status-badge.running, .executor-pill.online { color: #1e5da9; background: var(--blue-soft); }

.production-layout, .settings-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
.production-form { gap: 18px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.executor-state { padding: 13px 15px; border-radius: 12px; font-size: 12px; font-weight: 750; line-height: 1.55; }
.executor-state.online { color: var(--green-dark); border: 1px solid #bde4ce; background: var(--green-soft); }
.executor-state.waiting { color: #815019; border: 1px solid #f0d6a9; background: var(--orange-soft); }
.executor-state.error { color: var(--red); border: 1px solid #efcbc7; background: var(--red-soft); }
.form-footnote { margin: -5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.guide-panel { position: sticky; top: 24px; }
.guide-panel > .eyebrow, .security-panel > .eyebrow { margin-top: 2px; }
.step-list, .check-list { margin: 22px 0 0; padding: 0; list-style: none; }
.step-list { display: grid; gap: 18px; }
.step-list li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.step-list li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 900; }
.step-list strong, .step-list small { display: block; }
.step-list strong { font-size: 13px; }
.step-list small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.check-list { display: grid; gap: 13px; }
.check-list li { position: relative; padding-left: 25px; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 900; }

.split-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 6px 0 18px; }
.task-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.task-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.task-card h3 { margin: 0; font-size: 15px; line-height: 1.45; }
.task-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.task-card-message { min-height: 40px; padding: 10px 11px; border-radius: 10px; color: var(--ink-2); background: var(--surface-soft); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.result-link { width: fit-content; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.result-link:hover { text-decoration: underline; }
.task-action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.task-action-row .button { min-height: 34px; padding: 6px 11px; font-size: 11px; }
.publish-panel { margin-bottom: 18px; }
.compact-task-list { display: grid; }
.compact-task { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid #edf0ec; }
.compact-task:first-child { border-top: 0; }
.compact-task strong, .compact-task small { display: block; }
.compact-task strong { font-size: 13px; }
.compact-task small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.worker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.worker-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.worker-head { display: flex; align-items: center; gap: 9px; }
.worker-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.worker-card p { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.worker-card .capability-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.capability-tag { padding: 3px 6px; border-radius: 6px; color: #4d6156; background: #e9eeea; font-size: 9px; font-weight: 800; }

.task-table-wrap { width: 100%; overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.task-table th, .task-table td { padding: 13px 10px; border-top: 1px solid #edf0ec; text-align: left; vertical-align: top; }
.task-table th { padding-top: 0; color: var(--muted); border-top: 0; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.task-table td { font-size: 11px; }
.task-table td strong, .task-table td small { display: block; }
.task-table td strong { max-width: 290px; font-size: 12px; line-height: 1.45; }
.task-table td small { margin-top: 4px; color: var(--muted); }
.task-error { max-width: 270px; color: var(--red); line-height: 1.45; overflow-wrap: anywhere; }

.setup-steps { padding: 14px 16px; border: 1px solid #d9e6da; border-radius: 13px; background: #f5faf6; }
.setup-steps strong { font-size: 12px; }
.setup-steps ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 1.75; }
code { padding: 2px 5px; border-radius: 5px; color: #294437; background: #e9efea; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mapping-details { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.mapping-details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 850; }
.mapping-details > p { margin: 9px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.input-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.5; }
.input-hint.good { color: var(--green-dark); }
.input-hint.warning { color: #815019; }
.input-hint.error { color: var(--red); }

.target-inline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -5px 0 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcf9;
}
.target-inline-card.ready { border-color: #bde4ce; background: var(--green-soft); }
.target-inline-card.error { border-color: #efcbc7; background: var(--red-soft); }
.target-inline-card > div { min-width: 0; }
.target-inline-card span, .target-inline-card strong, .target-inline-card small { display: block; }
.target-inline-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.target-inline-card strong { margin-top: 4px; font-size: 13px; line-height: 1.45; }
.target-inline-card small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }

.feishu-target-card {
  display: grid;
  gap: 16px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, #fff 20%, #f7faf7);
}
.feishu-target-card.ready { border-color: #b6ddc8; background: linear-gradient(145deg, #fff 20%, #eef8f2); }
.feishu-target-card.error { border-color: #efcbc7; background: linear-gradient(145deg, #fff 20%, #fff4f2); }
.target-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.target-card-head h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.target-card-head p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.target-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0; }
.target-meta-grid > div { min-width: 0; padding: 11px 12px; border: 1px solid rgba(207, 216, 208, .8); border-radius: 10px; background: rgba(255, 255, 255, .72); }
.target-meta-grid dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.target-meta-grid dd { margin: 5px 0 0; color: var(--ink-2); font-size: 11px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.field-status-title { display: block; margin-bottom: 9px; font-size: 11px; }
.field-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field-status-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.field-status-item > div { min-width: 0; }
.field-status-item strong, .field-status-item small { display: block; }
.field-status-item strong { font-size: 10px; }
.field-status-item small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.field-status-item > span { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.field-status-item.matched { border-color: #c9e5d4; background: #f7fcf8; }
.field-status-item.matched > span { color: var(--green-dark); background: var(--green-soft); }
.field-status-item.missing_optional > span { color: #815019; background: var(--orange-soft); }
.field-status-item.missing_required, .field-status-item.incompatible { border-color: #efcbc7; background: #fff9f8; }
.field-status-item.missing_required > span, .field-status-item.incompatible > span { color: var(--red); background: var(--red-soft); }
.field-status-empty { grid-column: 1 / -1; padding: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 10px; line-height: 1.55; text-align: center; }
.feishu-target-card > .button { width: fit-content; }
.security-panel { position: sticky; top: 24px; }
.security-panel dl { display: grid; margin: 20px 0 0; }
.security-panel dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid #edf0ec; }
.security-panel dt { color: var(--muted); font-size: 11px; }
.security-panel dd { margin: 0; font-size: 12px; font-weight: 750; text-align: right; overflow-wrap: anywhere; }

.notice { padding: 12px 14px; border: 1px solid #cce0fb; border-radius: 11px; color: #24568e; background: #f1f7ff; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.notice.good { color: var(--green-dark); border-color: #bde4ce; background: var(--green-soft); }
.notice.warning { color: #815019; border-color: #f0d6a9; background: var(--orange-soft); }
.notice.error { color: var(--red); border-color: #efcbc7; background: var(--red-soft); }
#globalNotice { margin-bottom: 16px; }
.empty-state { padding: 28px 18px; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--muted); background: #fafcf9; text-align: center; font-size: 12px; line-height: 1.6; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; width: min(380px, calc(100vw - 32px)); display: grid; gap: 9px; pointer-events: none; }
.toast { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; animation: toast-in .2s ease both; }
.toast.good { border-color: #bde4ce; }
.toast.error { color: var(--red); border-color: #efcbc7; background: #fff8f7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  :root { --sidebar-width: 236px; }
  .metric-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .worker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; height: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand, .runtime-card, .sidebar > #logoutButton { display: none; }
  .tenant-panel { position: absolute; top: 11px; left: 14px; width: 178px; padding: 8px; z-index: 2; }
  .tenant-avatar { width: 30px; height: 30px; }
  .tenant-panel strong, .tenant-panel small { max-width: 116px; }
  .workspace-nav { display: flex; gap: 6px; margin: 0; padding-left: 190px; overflow-x: auto; scrollbar-width: none; }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .nav-item { min-width: max-content; min-height: 44px; grid-template-columns: auto auto auto; padding: 8px 12px; }
  .nav-index { display: none; }
  .settings-link { margin: 0; border: 0; border-radius: 12px; }
  .workspace-main { padding: 26px 18px 70px; }
  .production-layout, .settings-layout { grid-template-columns: 1fr; }
  .target-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-panel, .security-panel { position: static; }
  .task-card-list { grid-template-columns: 1fr; }
  .content-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .login-card { padding: 30px 24px; border-radius: 22px; }
  .workspace-header, .panel-head, .split-heading { align-items: stretch; flex-direction: column; }
  .header-actions, .panel-actions, .button-row { justify-content: flex-start; }
  .metric-grid.five, .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-grid, .form-grid.two, .form-grid.three, .worker-grid { grid-template-columns: 1fr; }
  .target-inline-card, .target-card-head { align-items: stretch; flex-direction: column; }
  .source-selection, .content-job-head { align-items: stretch; flex-direction: column; }
  .content-card-grid { grid-template-columns: 1fr; }
  .target-meta-grid, .field-status-grid { grid-template-columns: 1fr; }
  .target-inline-card .button, .feishu-target-card > .button { width: 100%; }
  .panel { padding: 18px; border-radius: 17px; }
  .compact-task { grid-template-columns: 1fr auto; }
  .compact-task time { grid-column: 1 / -1; }
}

@media (max-width: 470px) {
  .tenant-panel { width: 148px; }
  .tenant-panel strong, .tenant-panel small { max-width: 88px; }
  .workspace-nav { padding-left: 160px; }
  .metric-grid.five, .metric-grid.four { grid-template-columns: 1fr; }
  .workspace-header h1 { font-size: 31px; }
  .panel-actions .button, .button-row .button { width: 100%; }
}

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