:root {
  --bg: #edf4fb;
  --surface: #ffffff;
  --surface-soft: #f7fafd;
  --line: #d9e3ef;
  --line-strong: #c6d4e3;
  --text: #111827;
  --muted: #667085;
  --blue: #1769e8;
  --blue-soft: #eaf3ff;
  --green: #0f9f6e;
  --amber: #b56a00;
  --red: #d2415d;
  --rail: #101827;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.5 Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(rgba(34, 93, 164, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 93, 164, .05) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, rgba(23, 105, 232, .14), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(15, 159, 110, .12), transparent 28%),
    var(--bg);
  background-size: 18px 18px, 18px 18px, auto, auto, auto;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 60px clamp(330px, 18vw, 390px) minmax(780px, 1fr) clamp(400px, 22vw, 500px);
  grid-template-rows: 68px minmax(0, 1fr) 76px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand, .top-actions, .preview-head, .preview-footer, .panel-head, .launchbar, .segmented, .checks {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; min-width: 0; }
.mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-weight: 900;
}
.brand-title { font-size: 17px; font-weight: 900; letter-spacing: 0; }
.brand-sub { color: var(--muted); font-size: 12px; }
.top-actions { gap: 10px; }
.chip, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.status-pill { color: var(--blue); background: var(--blue-soft); border-color: #b8d7ff; }
.status-pill.danger-status { color: var(--red); background: #fff3f5; border-color: #ffc2cc; }

.btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-weight: 850;
}
.btn:hover { background: var(--surface-soft); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: white; }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.lang-toggle { min-width: 58px; }

.rail {
  grid-row: 2 / 4;
  padding: 10px 0;
  background: var(--rail);
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
}
.rail-item {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe4f0;
  font-weight: 900;
}
.rail-item.active { background: rgba(255,255,255,.15); }
.rail-item.danger-rail { color: #ffc9d2; }
.rail-item.danger-rail.active { background: rgba(210,65,93,.28); color: #fff; }

.tree-pane {
  grid-row: 2 / 4;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: auto;
}
.pane-head { padding: 16px; border-bottom: 1px solid var(--line); }
.pane-head h1 { margin: 0; font-size: 18px; }
.pane-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.asset-strip { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.mini-stats div {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.mini-stats span { font-size: 20px; font-weight: 900; }
.mini-stats small { color: var(--muted); font-size: 11px; font-weight: 800; }
label { display: grid; gap: 7px; font-weight: 800; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,232,.12); }

.tree-list { padding: 10px; display: grid; gap: 8px; }
.tree-node {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  padding: 10px;
  text-align: left;
}
.tree-node:hover { background: var(--surface-soft); }
.tree-node.active { background: var(--blue-soft); border-color: #9ec8ff; }
.tree-node.child { margin-left: 18px; width: calc(100% - 18px); }
.tree-node.danger-node { margin-top: 8px; border-top: 1px solid var(--line); }
.tree-node.danger-node .type { color: var(--red); background: #fff3f5; }
.tree-node.danger-node.active { background: #fff3f5; border-color: #ffc2cc; }
.tree-node strong, .tree-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-node small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.type {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--blue);
  font-weight: 900;
}
.tree-node em {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--red);
  font-size: 11px;
  font-style: normal;
}
.tree-node em:empty { display: none; }

.editor-pane { grid-row: 2 / 3; min-width: 0; overflow: auto; padding: 28px 30px; }
.tabs { display: flex; gap: 12px; margin-bottom: 18px; }
.tab {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 900;
}
.tab.active { background: var(--blue); border-color: var(--blue); color: white; }
.tab.danger-tab { color: var(--red); }
.tab.danger-tab.active { background: var(--red); border-color: var(--red); color: white; }
.panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(16, 24, 40, .08);
}
.level-panel { padding: 30px; }
.hidden { display: none !important; }
.panel-head { justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-head.compact { margin: 0; padding: 18px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 0; font-size: 24px; }
.panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide { grid-column: span 2; }
.quick-create-panel {
  margin-bottom: 22px;
  padding: 24px;
  border-color: #a8c9f7;
  box-shadow: 0 20px 48px rgba(23, 105, 232, .10);
}
.quick-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.quick-create-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.quick-targeting-settings {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  background: #f7fbff;
}
.quick-setting-block,
.quick-gender-field {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.quick-setting-block > strong,
.quick-gender-field legend,
.quick-fixed-grid strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}
.quick-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.quick-platform-grid label,
.quick-gender-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d8e5f5;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.quick-platform-grid input,
.quick-gender-field input {
  width: 17px;
  height: 17px;
  margin: 0;
}
.quick-platform-grid .muted-option {
  color: var(--muted);
  background: #f2f5f8;
}
.quick-fixed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-fixed-grid > div {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #d8e5f5;
  border-radius: 9px;
  background: #fff;
}
.quick-fixed-grid span {
  color: #294767;
  font-size: 13px;
  font-weight: 800;
}
.quick-gender-field {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.quick-gender-field legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}
.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.quick-copy-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px dashed #9fc5f8;
  border-radius: 10px;
  background: #f5f9ff;
}
.quick-copy-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.copy-candidates {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #a8c9f7;
  border-radius: 14px;
  background: #f8fbff;
}
.copy-candidate-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.copy-candidate-summary strong { font-size: 14px; }
.copy-candidate-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }
.copy-video-analysis {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid #bcd6f8;
  border-radius: 12px;
  background: #eef6ff;
}
.copy-video-analysis-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.copy-video-analysis-head strong { color: #124b96; font-size: 13px; }
.copy-video-analysis-head span { color: var(--muted); font-size: 10px; font-weight: 700; }
.copy-video-analysis p { margin: 0; color: #294767; font-size: 11px; line-height: 1.55; }
.copy-video-analysis .copy-video-limit { color: #8a5a00; }
.copy-candidate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.copy-candidate-card {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 14px;
  border: 1px solid #d5e4f8;
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 24px rgba(23, 105, 232, .06);
}
.copy-candidate-angle {
  color: #1769e8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}
.copy-candidate-card h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.copy-candidate-card pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
  font: 12px/1.55 inherit;
}
.copy-candidate-translation {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid #c9dcf6;
  border-radius: 10px;
  background: #f5f9ff;
}
.copy-candidate-translation strong {
  color: #16345f;
  font-size: 14px;
  line-height: 1.45;
}
.copy-candidate-translation pre {
  max-height: 180px;
  color: #294767;
  font-size: 12px;
  line-height: 1.6;
}
.copy-translation-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #1769e8;
  font-size: 11px;
  font-weight: 900;
}
.copy-translation-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.copy-candidate-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.copy-candidate-card .copy-video-alignment {
  padding: 8px 10px;
  border-left: 3px solid #1769e8;
  border-radius: 6px;
  background: #f4f8ff;
  color: #294767;
}
.copy-candidate-card .btn { justify-self: start; }
.quick-auto-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #c7daf5;
  border-radius: 10px;
  background: #f7faff;
}
.quick-auto-note strong {
  color: var(--text);
  font-size: 12px;
}
.quick-auto-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.quick-wide { grid-column: span 2; }
.quick-full { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .copy-candidate-grid { grid-template-columns: 1fr; }
  .copy-candidate-summary { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 700px) {
  .quick-platform-grid,
  .quick-fixed-grid,
  .quick-gender-field { grid-template-columns: 1fr; }
}
.quick-issues {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.quick-issues:empty { display: none; }
.quick-issue {
  padding: 10px 12px;
  border: 1px solid #ffc2cc;
  border-radius: 9px;
  background: #fff3f5;
  color: #9f1d38;
  font-size: 12px;
  font-weight: 800;
}
.quick-output {
  min-height: 118px;
  margin: 16px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.quick-actions .quick-status {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.subpanel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 14px;
}
.subpanel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.subpanel-head strong {
  display: block;
  font-size: 14px;
}
.subpanel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.spend-limit-box .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.segmented, .checks { gap: 10px; flex-wrap: wrap; }
.segmented label, .checks label, .switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--text);
  font-size: 14px;
}
.schedule-box p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.ad-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
  margin-bottom: 12px;
}
.ad-card.active { border-color: #91c2ff; background: #f3f8ff; }
.ad-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.ad-card h3 { margin: 0; font-size: 14px; }
.partnership-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 14px;
  margin-bottom: 14px;
}
.partnership-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.partnership-head h3 { margin: 0; font-size: 16px; }
.partnership-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.partnership-fields { margin-top: 14px; display: grid; gap: 12px; }
.partnership-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.partnership-switch { flex: 0 0 auto; }
.check-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.check-status.succeeded { color: #08724f; }
.check-status.failed { color: var(--red); }
.check-status.checking { color: var(--blue); }
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn.danger { color: var(--red); border-color: #ffc2cc; background: #fff5f7; }
.btn.solid-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.solid-danger:hover { background: #bd2f4a; }
.btn.flat { width: 100%; margin-top: 8px; background: white; }

.delete-panel textarea {
  resize: vertical;
  min-height: 150px;
}

.delete-warning {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #ffc2cc;
  border-radius: 10px;
  background: #fff3f5;
  color: #9f1d38;
  font-weight: 800;
}

.delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.preview-pane {
  grid-row: 2 / 3;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 18px;
}
.preview-head small:not([data-i18n]) { display: none; }
.secondary-panel { display: none !important; }
.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 28px rgba(16,24,40,.08);
}
.preview-head { gap: 10px; padding: 12px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dff3ea;
  color: var(--green);
  font-weight: 900;
}
.preview-head small { display: block; color: var(--muted); font-size: 11px; }
.preview-card p { margin: 0; padding: 0 12px 12px; }
.preview-media {
  min-height: 245px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf4ff, #eef8f4);
  color: var(--muted);
  font-weight: 900;
}
.preview-footer { justify-content: space-between; gap: 12px; padding: 12px; background: var(--surface-soft); }
.preview-footer button { border: 0; border-radius: 6px; background: #e7edf5; padding: 8px 12px; font-weight: 900; }
.side-panel { overflow: hidden; }
.preview-pane .panel-head.compact {
  align-items: flex-start;
  flex-wrap: wrap;
}
.preview-pane .panel-head.compact h2 {
  white-space: nowrap;
}
.issues, .tasks { padding: 14px; display: grid; gap: 12px; }
.issues {
  max-height: 240px;
  overflow: auto;
}
.task-monitor-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.tasks {
  flex: 1;
  min-height: 280px;
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable;
}
.issue, .task {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-soft);
}
.task {
  min-height: 236px;
  overflow: hidden;
}
.issue.error { border-color: #ffc2cc; background: #fff3f5; color: #9f1d38; }
.issue.ok { border-color: #bfe8d8; background: #effbf6; color: #08724f; }
.issue { width: 100%; text-align: left; }
.issue span { display: block; margin-top: 4px; color: inherit; }
.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 0;
}
.stat-grid div {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.stat-grid strong { display: block; font-size: 26px; }
.stat-grid span { color: var(--muted); font-size: 11px; font-weight: 800; }
.task-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.task-head > div {
  min-width: 0;
}
.task-head strong,
.task-head small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-head span {
  align-self: start;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.task.failed .task-head span,
.task.warning .task-head span { color: var(--red); background: #fff3f5; }
.task.succeeded .task-head span { color: var(--green); background: #effbf6; }
.task-line { margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.task-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.task-progress div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5ef;
}
.task-progress span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--bar);
}
.task-progress small {
  min-width: 96px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}
.task-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.task-counts div {
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.task-counts strong {
  display: block;
  margin: 0 0 2px;
  font-size: 22px;
  line-height: 1.1;
}
.task-counts span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.task-reason {
  min-height: 58px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #ffc2cc;
  border-radius: 9px;
  background: #fff3f5;
  color: #9f1d38;
  overflow: hidden;
}
.task-reason.is-empty {
  border-color: var(--line);
  background: white;
  color: var(--muted);
}
.task-reason strong {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
}
.task-reason span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.task-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.task-metrics span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.task strong { display: block; margin-bottom: 4px; }
.task small { color: var(--muted); }
.task pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  background: #eef2f6;
  border-radius: 8px;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
}
.task-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.task-details summary {
  padding: 9px 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}
.task-details pre {
  margin: 0;
  border-radius: 0 0 8px 8px;
}
.task-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.task-actions .btn.flat { margin-top: 0; }
.payload-preview {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #0f172a;
  color: #dbeafe;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.launchbar {
  grid-column: 3 / -1;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  position: sticky;
  bottom: 0;
  z-index: 4;
}
#launchSummary { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-weight: 800; }
#launchSummary strong { color: var(--text); }

@media (max-width: 1200px) {
  .shell { grid-template-columns: 58px 320px minmax(620px, 1fr); }
  .preview-pane { display: none; }
  .launchbar { grid-column: 3 / -1; }
  .quick-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-wide { grid-column: span 1; }
}

@media (min-width: 1201px) and (max-width: 1500px) {
  .shell {
    grid-template-columns: 58px minmax(300px, 330px) minmax(680px, 1fr) minmax(360px, 390px);
  }
  .editor-pane { padding: 22px; }
}

@media (max-width: 860px) {
  .shell { display: block; padding-bottom: 72px; }
  .rail { display: none; }
  .tree-pane, .editor-pane { overflow: visible; }
  .grid { grid-template-columns: 1fr; }
  .quick-create-grid { grid-template-columns: 1fr; }
  .quick-wide, .quick-full { grid-column: 1; }
  .quick-actions { align-items: stretch; flex-direction: column; }
  .launchbar { position: fixed; left: 0; right: 0; bottom: 0; }
  .top-actions .chip { display: none; }
}

body.standard-mode .shell {
  grid-template-columns: clamp(330px, 24vw, 420px) minmax(620px, 1fr) clamp(360px, 25vw, 480px);
  grid-template-rows: 68px minmax(0, 1fr);
}

body.standard-mode .rail,
body.standard-mode .tree-list,
body.standard-mode .tabs,
body.standard-mode #editorForm,
body.standard-mode .preview-pane > :not(.task-monitor-panel),
body.standard-mode .launchbar,
body.standard-mode #topLaunch {
  display: none !important;
}

body.standard-mode .tree-pane {
  grid-column: 1;
  grid-row: 2;
}

body.standard-mode .editor-pane {
  grid-column: 2;
  grid-row: 2;
}

body.standard-mode .preview-pane {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

body.standard-mode .quick-create-panel {
  margin-bottom: 0;
}

@media (min-width: 861px) and (max-width: 1200px) {
  body.standard-mode .shell {
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: 68px auto minmax(320px, 1fr);
  }

  body.standard-mode .tree-pane {
    grid-column: 1;
    grid-row: 2 / 4;
  }

  body.standard-mode .editor-pane {
    grid-column: 2;
    grid-row: 2;
  }

  body.standard-mode .preview-pane {
    grid-column: 2;
    grid-row: 3;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  body.standard-mode .shell {
    display: block;
    padding-bottom: 0;
  }

  body.standard-mode .tree-pane,
  body.standard-mode .editor-pane,
  body.standard-mode .preview-pane {
    display: block;
    overflow: visible;
  }
}
