:root {
  --bg: #eef2f6;
  --panel: #fff;
  --soft: #f6f8fb;
  --line: #d9e1ec;
  --text: #152033;
  --muted: #607089;
  --primary: #2f6dff;
  --primary-2: #1f53d4;
  --success: #1f9d63;
  --warn: #c27a00;
  --danger: #d33d4a;
  --info: #3274f4;
  --shadow: 0 14px 36px rgba(21, 34, 60, 0.08);
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f7f9fc 0%, var(--bg) 100%);
  color: var(--text);
}
body.is-blocking {
  overflow: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  padding: 18px;
}
.login-banner {
  position: relative;
  display: flex;
  align-items: center;
  padding: 64px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(7, 12, 24, .86), rgba(7, 12, 24, .42)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800'%3E%3Crect width='1200' height='800' fill='%23121b2a'/%3E%3Cpath d='M200 500h760c80 0 124 44 142 96H80c20-54 62-96 120-96z' fill='%232f6dff'/%3E%3Cpath d='M300 480c60-118 156-174 292-174h190c112 0 194 62 242 174' fill='none' stroke='%23f6a623' stroke-width='76' stroke-linecap='round'/%3E%3Ccircle cx='310' cy='615' r='70' fill='%230d121c'/%3E%3Ccircle cx='890' cy='615' r='70' fill='%230d121c'/%3E%3C/svg%3E") center/cover;
  border-radius: 18px 0 0 18px;
  overflow: hidden;
}
.login-banner h1 { margin: 0 0 14px; font-size: 2rem; letter-spacing: 0; }
.login-banner p { width: min(620px, 100%); margin: 0; color: rgba(255,255,255,.78); line-height: 1.7; }
.login-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 48px;
  background: var(--panel);
  border-radius: 0 18px 18px 0;
  box-shadow: var(--shadow);
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.segmented button {
  border: 0;
  border-radius: 8px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
}
.segmented button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.app-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 14px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #17243a;
  color: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.topbar h1 { margin: 0; font-size: 1.2rem; }
.topbar .muted { color: rgba(255, 255, 255, .72); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav button, .btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
}
.topbar .nav button { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.18); }
.topbar .nav button.active { background: #fff; color: #17243a; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: var(--soft); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric h3 { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.metric strong { font-size: 1.8rem; }
.metric p { margin: 8px 0 0; color: var(--muted); }

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #17243a 0%, #264b8f 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.dashboard-hero h2 {
  margin: 0 0 6px;
  font-size: 1.36rem;
  line-height: 1.25;
  letter-spacing: 0;
}
.dashboard-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: .92rem;
  line-height: 1.55;
}
.hero-tags {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  white-space: nowrap;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, .95fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.filter-field {
  display: grid;
  gap: 7px;
}
.filter-field label {
  color: var(--muted);
  font-size: .84rem;
}
.periods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  min-height: 42px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.periods button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.periods button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(22, 34, 58, .08);
}
.filter-apply {
  min-height: 42px;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.metric-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -38px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(47, 109, 255, .08);
}
.metric-title {
  color: var(--muted);
  font-size: .9rem;
}
.metric-card strong {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}
.metric-detail {
  width: max-content;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: .82rem;
}
.metric-detail.success { color: var(--success); background: rgba(31,157,99,.1); }
.metric-detail.danger { color: var(--danger); background: rgba(211,61,74,.1); }
.metric-detail.info { color: var(--info); background: rgba(50,116,244,.1); }

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
}
.trend-panel,
.side-panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin: 0 0 5px;
  font-size: 1.02rem;
}
.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.panel-head.compact strong {
  font-size: 1.6rem;
  color: var(--primary);
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: .84rem;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.trend-svg {
  display: block;
  width: 100%;
  min-height: 310px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%);
}
.side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}
.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf5;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #16a3a3);
}
.status-list {
  display: grid;
  gap: 10px;
}
.status-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.status-list span {
  color: var(--muted);
}
.overview-table {
  display: grid;
  gap: 8px;
}
.overview-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 120px 120px auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fbfcfe;
  border: 1px solid var(--line);
}
.overview-row div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.overview-row span {
  color: var(--muted);
  font-size: .86rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.field { display: grid; gap: 6px; }
.field label { color: var(--muted); font-size: .86rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wide { grid-column: 1 / -1; }

.merchant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.merchant { display: flex; gap: 12px; min-width: 0; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #16a3a3);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}
.merchant-name { font-weight: 760; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: .78rem;
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.badge.success { background: rgba(31,157,99,.1); color: var(--success); }
.badge.warn { background: rgba(194,122,0,.12); color: var(--warn); }
.badge.info { background: rgba(50,116,244,.1); color: var(--info); }
.badge.danger { background: rgba(211,61,74,.1); color: var(--danger); }

.split { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
.list { display: grid; gap: 8px; }
.list button {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}
.list button.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47,109,255,.12); }
.task-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.chat {
  display: grid;
  gap: 10px;
}
.bubble {
  max-width: 780px;
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
  line-height: 1.65;
}
.bubble.user { margin-left: auto; background: #eaf1ff; }
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(9, 15, 28, .42);
  z-index: 10;
}
.modal.show { display: grid; }
.modal-card {
  width: min(680px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 14px;
}
.modal-card.small { width: min(460px, 100%); }
.modal-card.video-modal {
  width: min(920px, 100%);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 1.08rem; }
.position-modal-card {
  width: min(1000px, calc(100vw - 64px));
  height: min(92vh, 660px);
  max-height: none;
  padding: 0;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  grid-template-rows: 58px minmax(0, 1fr) 72px;
}
.position-modal-head {
  flex: 0 0 auto;
  height: 58px;
  padding: 0 16px;
  border-bottom: 0;
}
.position-modal-head h2 {
  font-size: 1rem;
  font-weight: 500;
}
.modal-close-x {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #8a94a6;
  font-size: 22px;
  line-height: 1;
}
.position-form-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 52px 24px;
  display: grid;
  gap: 22px;
}
.position-field {
  display: grid;
  gap: 9px;
}
.position-field.required > label::before {
  content: "*";
  color: #ef4444;
  margin-right: 4px;
}
.position-field label,
.position-form-section > h3 {
  color: #182333;
  font-weight: 760;
}
.position-field input,
.position-field textarea {
  width: 100%;
  border: 1px solid #d7dde8;
  border-radius: 4px;
  background: #fff;
  color: #1f2937;
  padding: 8px 10px;
}
.position-field input { height: 32px; }
.position-field textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.55;
}
.position-field input::placeholder,
.position-field textarea::placeholder {
  color: #a4acb9;
}
.avatar-upload-box {
  width: 80px;
  height: 80px;
  border: 1px dashed #ccd4df;
  border-radius: 6px;
  background: #fff;
  color: #8c8c8c;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 300;
  overflow: hidden;
}
.avatar-upload-box.has-image {
  border-style: solid;
  padding: 0;
}
.avatar-upload-box img,
.position-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-file-input { display: none; }
.position-modal-card .avatar-file-input,
.position-avatar-file {
  display: block;
  width: 100%;
  height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
}
.position-form-section {
  display: grid;
  gap: 18px;
}
.position-form-section h3 {
  margin: 0;
  font-size: 1.22rem;
}
.position-form-section h3 span {
  margin-left: 10px;
  color: #a4acb9;
  font-size: .88rem;
  font-weight: 500;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.check-row.wrap {
  flex-wrap: wrap;
  gap: 14px 18px;
}
.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4b5565;
  font-weight: 500;
}
.check-row input,
.position-form-section .checkline input {
  width: 14px;
  height: 14px;
  accent-color: #4288f7;
}
.position-modal-foot {
  position: relative;
  height: 72px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #fff;
  box-shadow: none;
  border-top: 1px solid #f0f2f6;
}
.position-modal-foot .btn {
  min-width: 68px;
  height: 40px;
  padding: 0 20px;
  border-radius: 6px;
  font-weight: 500;
}
.position-modal-foot .btn.primary {
  background: #4288f7;
  border-color: #4288f7;
}
.position-form-section .checkline {
  border: 0;
  background: transparent;
  padding: 0;
  color: #4b5565;
  font-size: .9rem;
}
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}
.toast-item {
  min-width: 110px;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid #d9f2d2;
  border-radius: 4px;
  background: #f0ffe9;
  color: #37a52d;
  box-shadow: 0 8px 18px rgba(34, 94, 28, .08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}
.toast-item::before {
  content: "✓";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #5dc34a;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
}
.blocking-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(13, 22, 38, .42);
  backdrop-filter: blur(2px);
  z-index: 60;
  pointer-events: all;
}
.blocking-overlay.show {
  display: grid;
}
.blocking-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(21, 34, 60, .18);
  text-align: center;
}
.blocking-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}
.blocking-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.blocking-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid rgba(47,109,255,.18);
  border-top-color: var(--primary);
  animation: blocking-spin .9s linear infinite;
}
@keyframes blocking-spin {
  to { transform: rotate(360deg); }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .9rem;
  padding: 2px 2px 0;
}
.breadcrumb strong { color: var(--text); font-weight: 750; }
.sep { color: #a2adbf; }
.mini-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
  font-size: .82rem;
}
.mini-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.mini-btn.danger { color: var(--danger); border-color: rgba(211,61,74,.24); }

.merchant-workspace {
  min-height: calc(100vh - 144px);
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(217,225,236,.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.mg-sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-head h2 { margin: 0; font-size: .98rem; white-space: nowrap; }
.group-list { display: grid; gap: 8px; }
.group-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 11px 10px;
  text-align: left;
  display: grid;
  gap: 5px;
}
.group-btn:hover { background: #f1f5fb; }
.group-btn.active { background: #eef4ff; border-color: rgba(47,109,255,.18); color: var(--primary-2); }
.group-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 750;
}
.group-meta { color: var(--muted); font-size: .8rem; }
.mg-content { padding: 16px; overflow: auto; }
.mg-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 160px auto;
  gap: 10px;
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.add-merchant-btn { min-height: 42px; }
.result-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}
.checkline,
.card-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .86rem;
}
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.check-grid label,
.check-grid span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: .84rem;
}
.batch-bar button:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.merchant-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.merchant-card.selected {
  border-color: rgba(47, 109, 255, .45);
  box-shadow: 0 0 0 3px rgba(47, 109, 255, .08);
}
.card-check {
  justify-self: end;
}
.merchant-meta { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.merchant-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.merchant-stats span {
  padding: 8px;
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
  color: #41506b;
  font-size: .82rem;
}
.card-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.card-actions.operator-actions { grid-template-columns: 1fr; }
.role-note {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: .84rem;
}
.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--muted);
}

.backend-merchant-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 16px;
}
.merchant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.merchant-main {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}
.logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.28rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #16a3a3);
  flex: 0 0 auto;
}
.merchant-head h2 { margin: 0 0 6px; font-size: 1.35rem; }
.merchant-sub { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.status-row select { width: auto; min-width: 180px; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.section-head h2 { margin: 0 0 5px; font-size: 1.05rem; }
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.entry-grid.ai-operation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.entry-card {
  position: relative;
  min-height: 158px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 16px;
  transition: .18s ease;
}
.entry-card:hover { border-color: rgba(47,109,255,.32); box-shadow: 0 16px 34px rgba(21,34,60,.1); transform: translateY(-2px); }
.entry-card.active {
  border-color: rgba(47,109,255,.46);
  background: #f7faff;
  box-shadow: 0 0 0 3px rgba(47,109,255,.08);
}
.entry-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.entry-top h3 { margin: 0 0 7px; font-size: 1.05rem; }
.entry-top p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.entry-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #16a3a3);
}
.entry-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .84rem; }

.account-positioning-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  min-height: 900px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: #f5f7fb;
  box-shadow: none;
  overflow: hidden;
}
.position-list-panel,
.benchmark-filter,
.benchmark-list,
.benchmark-analysis,
.benchmark-videos,
.full-plan-doc,
.full-plan-tasks {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.position-list-panel {
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  background: #fff;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 16px;
  padding: 16px;
}
.position-create-btn {
  height: 40px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  background: #3f8cff;
}
.position-list-title {
  font-weight: 700;
  color: #1f2329;
}
.position-list {
  display: grid;
  gap: 10px;
  align-content: start;
}
.position-card {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: #364152;
  min-height: 40px;
}
.position-card.active { background: #efefff; }
.position-pick {
  min-width: 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  color: #111827;
}
.position-pick strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
}
.analysis-status {
  justify-self: end;
  border: 1px solid #c6edb8;
  border-radius: 4px;
  background: #eaffdf;
  color: #43b73a;
  padding: 2px 7px;
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}
.analysis-status.queued,
.benchmark-done.queued {
  border-color: #ffe2a9;
  background: #fff7e7;
  color: #b7791f;
}
.analysis-status.running,
.analysis-status.retrying,
.benchmark-done.running,
.benchmark-done.retrying {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}
.analysis-status.failed,
.benchmark-done.failed {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}
.position-avatar {
  width: 30px;
  height: 30px;
  border: 2px solid #1f70ff;
  border-radius: 999px;
  color: #1f70ff;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: #f4f7ff;
  overflow: hidden;
}
.position-avatar.image { border-width: 1px; background: #fff; }
.position-card-actions {
  display: flex;
  gap: 4px;
  padding-right: 8px;
}
.icon-mini {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b5565;
  display: grid;
  place-items: center;
}
.icon-mini:hover { background: rgba(47,109,255,.08); color: #2f6dff; }
.position-canvas-panel {
  position: relative;
  min-width: 0;
  min-height: 900px;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
}
.position-toolbar {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 16px;
  left: 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.position-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}
.tool-pill {
  height: 32px;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  background: #fff;
  color: #374151;
  padding: 0 15px;
  box-shadow: none;
  white-space: nowrap;
}
.tool-pill.save { color: #16a085; }
.mind-stage {
  position: absolute;
  inset: 48px 0 0;
  overflow: auto;
  background: #fff;
}
.mind-map {
  position: relative;
  width: 1880px;
  min-height: 1660px;
  background: #fff;
  transform-origin: 0 0;
}
.mind-lines {
  position: absolute;
  inset: 0;
  width: 1880px;
  height: 1660px;
  overflow: visible;
  pointer-events: none;
}
.mind-lines path {
  fill: none;
  stroke: #086fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mind-lines path.mind-child-line {
  stroke-linecap: round;
  stroke-width: 3.5;
  stroke-linejoin: round;
}
.mind-center {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  min-width: 88px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b62ff, #2878ff);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 1rem;
  box-shadow: 0 8px 24px rgba(47,109,255,.18);
}
.mind-trunk {
  display: none;
}
.mind-center-line {
  display: none;
}
.abs-branch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.abs-branch > * {
  pointer-events: auto;
}
.abs-branch-line {
  position: absolute;
  height: 4px;
  background: #086fff;
}
.trunk-to-title {
  left: 330px;
  top: calc(var(--branch-y) - 2px);
  width: 120px;
}
.abs-branch-title {
  position: absolute;
  z-index: 2;
  width: 136px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(90deg, #37d083, #3f8cff);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.title-to-spine {
  left: 584px;
  top: calc(var(--branch-y) - 2px);
  width: 82px;
}
.abs-group-spine {
  position: absolute;
  left: 666px;
  top: var(--spine-top);
  width: 4px;
  height: var(--spine-height);
  background: #086fff;
  border-radius: 999px;
}
.abs-group {
  position: absolute;
  inset: 0;
}
.spine-to-group {
  left: 666px;
  top: calc(var(--group-y) - 2px);
  width: 76px;
}
.abs-group-title {
  position: absolute;
  z-index: 2;
  min-height: 40px;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  padding-left: 18px;
  padding-right: 18px;
}
.group-to-leaves {
  left: 876px;
  top: calc(var(--group-y) - 2px);
  width: 86px;
}
.abs-leaf-node {
  position: absolute;
}
.mind-branches {
  position: absolute;
  left: 330px;
  top: 80px;
  width: 1160px;
  display: grid;
  gap: 92px;
}
.mind-branch {
  position: relative;
  min-height: 250px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  column-gap: 34px;
}
.branch-line {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 50%;
  width: 190px;
  height: 4px;
  background: #086fff;
  transform: translateY(-50%);
}
.branch-line::before {
  content: "";
  position: absolute;
  left: -106px;
  top: 0;
  width: 106px;
  height: 4px;
  background: #086fff;
}
.branch-title {
  position: relative;
  z-index: 2;
  justify-self: end;
  border-radius: 999px;
  padding: 11px 18px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(90deg, #37d083, #3f8cff);
  white-space: nowrap;
}
.branch-groups {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
}
.branch-group {
  position: relative;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}
.branch-group::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -34px;
  width: 184px;
  top: 50%;
  height: 4px;
  background: #086fff;
  transform: translateY(-50%);
}
.branch-group-title,
.leaf-node {
  min-height: 38px;
  border-radius: 999px;
  color: #293142;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  line-height: 1.35;
  font-weight: 650;
  box-sizing: border-box;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.branch-group-title {
  position: relative;
  z-index: 2;
  justify-content: center;
  background: #f2f3f5;
  border: 0;
  color: #273142;
  overflow: visible;
  text-align: center;
}
.node-control {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 0;
  border-radius: 999px;
  display: block;
  color: #fff;
  font-weight: 800;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity .12s ease, transform .12s ease;
  padding: 0;
  text-align: center;
}
.node-control::before,
.node-control::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.node-control.add::before,
.node-control.minus::before {
  width: 8px;
  height: 2px;
}
.node-control.add::after {
  width: 2px;
  height: 8px;
}
.node-control.minus::after {
  content: none;
}
.node-control.count::before {
  content: attr(data-label);
  inset: 0;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  transform: none;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}
.node-control.count::after { content: none; }
.node-control.count {
  width: 24px;
  height: 24px;
  min-width: 24px;
}
.node-control.count::before {
  font-size: 13px;
}
.branch-group-title.is-editing .node-control.collapse,
.abs-branch-title.is-editing .node-control.collapse,
.leaf-node.is-editing .node-control.add,
.leaf-node.is-editing .node-control.collapse,
.leaf-node.pending .node-control.add {
  opacity: 1;
  pointer-events: auto;
}
.branch-group-title .node-control.collapse,
.abs-branch-title .node-control.collapse,
.leaf-node .node-control.collapse {
  right: -26px;
  background: #94a3b8;
}
.branch-group-title .node-control.collapse[data-collapsed],
.abs-branch-title .node-control.collapse[data-collapsed],
.leaf-node .node-control.collapse[data-collapsed] {
  opacity: 1;
  pointer-events: auto;
  background: #fff;
  color: #5b6676;
  border: 1px solid #cfd8e6;
  font-weight: 700;
}
.leaf-list {
  display: grid;
  gap: 10px;
  align-content: center;
}
.leaf-node {
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: 470px;
  font-size: .9rem;
  background: #f2f3f5;
  overflow: visible;
}
.leaf-node:not(.abs-leaf-node)::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -38px;
  top: 50%;
  width: 38px;
  height: 4px;
  background: #086fff;
  transform: translateY(-50%);
}
.leaf-child-node::before {
  display: none;
  content: none;
}
.abs-leaf-node::before {
  display: none;
}
.leaf-node.abs-leaf-node {
  position: absolute;
  min-height: 40px;
  white-space: nowrap;
}
.leaf-child-node {
  position: absolute;
  z-index: 2;
  height: 38px;
  min-height: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #f2f3f5;
  color: #293142;
  box-shadow: none;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.leaf-node > span {
  min-width: 0;
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: anywhere;
}
.leaf-node .node-control.add {
  right: -26px;
  background: #94a3b8;
}
.leaf-child-node .node-control.add { right: -26px; background: #94a3b8; }
.leaf-child-node.is-editing .node-control.add,
.leaf-child-node.pending-child .node-control.add {
  opacity: 1;
  pointer-events: auto;
}
.branch-group-title.is-editing,
.leaf-node.is-editing {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(8,111,255,.28);
}
.leaf-child-node.is-editing {
  background: #f2f3f5;
  box-shadow: none;
}
.abs-branch-title.is-editing {
  box-shadow: 0 0 0 2px rgba(8,111,255,.28), 0 8px 24px rgba(47,109,255,.18);
}
.leaf-node.pending {
  background: #fff7ed;
  border: 1px solid #fb923c;
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
.leaf-child-node.pending-child {
  background: #f8fbff;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(56,189,248,.14);
}
.leaf-node.pending input {
  width: 210px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #c2410c;
  font-weight: 760;
}
.leaf-child-node.pending-child input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #334155;
  font-weight: 760;
  line-height: 36px;
  text-align: center;
  min-width: 0;
}
.position-side-zoom { display: none; }
.position-zoom-bar {
  position: absolute;
  left: 28px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d9e4f3;
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 32px rgba(15,23,42,.08);
}
.position-zoom-bar button {
  height: 40px;
  min-width: 42px;
  border: 1px solid #d9e4f3;
  border-radius: 12px;
  background: #fff;
  color: #2f3b52;
  padding: 0 14px;
}
.position-zoom-bar .zoom-icon-btn {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}
.position-zoom-bar .zoom-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.position-zoom-bar .zoom-reset-btn {
  min-width: 76px;
}
.position-zoom-bar span {
  color: #2f6dff;
  font-weight: 800;
}
.position-zoom-bar input { width: 104px; }
.position-empty-canvas {
  margin: 88px 16px 0;
  padding: 18px;
  border: 1px dashed #d7e0ee;
  border-radius: 12px;
  color: #64748b;
  background: #fbfdff;
}

.account-positioning-page {
  min-height: calc(100vh - 110px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
}
.account-positioning-strip {
  min-height: 54px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(217,225,236,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 28px rgba(21,34,60,.06);
}
.account-positioning-tabs {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.account-positioning-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-positioning-empty {
  color: var(--muted);
  font-size: .9rem;
}
.account-switch-chip {
  min-height: 38px;
  max-width: 240px;
  padding: 4px 11px 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  white-space: nowrap;
}
.account-switch-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-switch-chip.active {
  color: #fff;
  border-color: #147d64;
  background: #147d64;
}
.account-switch-chip.active .position-avatar {
  border-color: rgba(255,255,255,.78);
  color: #147d64;
  background: #fff;
}
.positioning-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, .92fr) minmax(460px, 1.08fr);
  gap: 16px;
  align-items: stretch;
}
.form-panel,
.report-panel,
.feedback-panel {
  border: 1px solid rgba(217,225,236,.9);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 36px rgba(21,34,60,.08);
}
.account-positioning-form,
.report-panel {
  min-height: 0;
  max-height: calc(100vh - 228px);
  overflow: auto;
}
.account-positioning-form {
  padding: 16px;
}
.report-panel {
  padding: 18px;
}
.panel-top {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-actions,
.md-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-top h2,
.feedback-panel h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}
.panel-top p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.account-positioning-page .primary-btn {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #147d64;
  font-weight: 900;
  white-space: nowrap;
}
.account-positioning-page .primary-btn:disabled,
.account-positioning-page .mini-btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.account-positioning-page .primary-btn:hover,
.account-positioning-page .mini-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(24,32,42,.12);
}
.mini-score {
  min-width: 118px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
}
.mini-score span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 900;
}
.mini-score strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}
.mini-score .progress-track {
  height: 6px;
  margin-top: 7px;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #147d64, #245bdb, #d8991c);
  transition: width .25s ease;
}
details.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
details.form-section + details.form-section {
  margin-top: 10px;
}
details.form-section summary {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
details.form-section summary::-webkit-details-marker {
  display: none;
}
details.form-section summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #147d64;
  background: rgba(20,125,100,.1);
  flex: 0 0 auto;
}
details.form-section[open] summary::after {
  content: "-";
}
.section-body {
  padding: 0 12px 12px;
  display: grid;
  gap: 12px;
}
.field,
.field-row {
  min-width: 0;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field label,
.check-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
}
.field textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.5;
}
.field input[readonly],
.field textarea[readonly],
.field select:disabled {
  color: #253247;
  background: #fff;
  opacity: 1;
}
.avatar-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.avatar-preview {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #147d64, #245bdb);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.6);
}
.account-positioning-page .check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.account-positioning-page .check-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.account-positioning-page .check-pill {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.account-positioning-page .check-pill input {
  width: 14px;
  height: 14px;
  accent-color: #147d64;
}
.missing-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #6f4b08;
  background: rgba(216,153,28,.14);
  font-size: 13px;
  line-height: 1.5;
}
.md-window {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #101820;
}
.md-titlebar {
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #cdd7e4;
  background: #151d28;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 900;
}
.md-titlebar span:last-child {
  color: rgba(205,215,228,.62);
  font-weight: 700;
}
.markdown-document {
  min-height: calc(100vh - 304px);
  margin: 0;
  padding: 20px;
  overflow: auto;
  color: #edf3fb;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    #101820;
  background-size: 100% 30px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}
.feedback-panel {
  min-height: 70px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-note {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
  outline: 0;
  line-height: 1.45;
}
.feedback-chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}
.feedback-chip.active {
  color: #fff;
  border-color: #245bdb;
  background: #245bdb;
}
.benchmark-page,
.planning-page {
  min-height: calc(100vh - 110px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
}
.benchmark-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(360px, 1fr) minmax(380px, 1.08fr);
  gap: 16px;
  align-items: stretch;
}
.planning-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1.22fr) minmax(340px, .78fr);
  gap: 16px;
  align-items: stretch;
}
.video-panel,
.task-panel {
  min-height: 0;
  max-height: calc(100vh - 228px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(217,225,236,.9);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 36px rgba(21,34,60,.08);
}
.planning-page .report-panel,
.benchmark-page .report-panel {
  max-height: calc(100vh - 228px);
}
.md-actions select {
  width: auto;
  min-width: 170px;
  min-height: 36px;
  padding: 7px 10px;
}
.platform-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.platform-option {
  min-height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
.platform-option input {
  width: 14px;
  height: 14px;
  accent-color: #147d64;
}
.video-list {
  display: grid;
  gap: 8px;
}
.training-benchmark-page .video-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.benchmark-blue-list {
  min-height: 0;
  height: 100%;
  overflow: auto;
  background: #fff;
}
.benchmark-green-report {
  border: 0;
  box-shadow: none;
}
.benchmark-green-report .markdown-document {
  min-height: calc(100vh - 360px);
}
.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.5;
}
.video-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.video-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.video-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.compact-video-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
}
.compact-video-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.compact-video-line b {
  color: var(--text);
}
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.metric-tag {
  min-height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.phase-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.phase-tab {
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  text-align: left;
}
.phase-tab strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.phase-tab span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.phase-tab.active {
  color: #fff;
  border-color: #147d64;
  background: #147d64;
}
.phase-tab.active span {
  color: rgba(255,255,255,.78);
}
.task-board {
  display: grid;
  gap: 10px;
}
.task-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.task-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
}
.task-day {
  min-width: 50px;
  min-height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #245bdb;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.task-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
}
.task-item p,
.task-item small {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.task-status {
  min-height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.task-status input {
  width: 14px;
  height: 14px;
  accent-color: #147d64;
}
.training-planning-page .full-plan-editor {
  min-height: calc(100vh - 350px);
}

.benchmark-workspace {
  min-height: calc(100vh - 146px);
  display: grid;
  gap: 14px;
  background: #f5f7fb;
}
.benchmark-filter { display: none; }
.benchmark-content {
  display: grid;
  grid-template-columns: 238px minmax(460px, .98fr) minmax(420px, .95fr);
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 170px);
}
.benchmark-list,
.benchmark-analysis,
.benchmark-videos {
  min-height: 0;
  background: #fff;
  border-radius: 0;
  display: grid;
  align-content: start;
  overflow: hidden;
}
.benchmark-list {
  padding: 18px 16px;
  gap: 14px;
}
.benchmark-create {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: #4b8df8;
  color: #fff;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
}
.benchmark-list-title {
  color: #1f2937;
  font-size: .95rem;
  font-weight: 800;
}
.benchmark-list-items {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}
.benchmark-card {
  position: relative;
  border: 0;
  border-radius: 8px;
  padding: 8px 30px 8px 8px;
  background: #fff;
  min-height: 50px;
}
.benchmark-card.active { background: #ece8fb; }
.benchmark-select {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.benchmark-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9e5f8, #7788a8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 850;
  overflow: hidden;
  flex: 0 0 auto;
}
.benchmark-avatar.image {
  background: #eef2f7;
}
.benchmark-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.benchmark-card-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.benchmark-card-copy strong {
  color: #222;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.benchmark-card-copy > span {
  color: #6b7280;
  font-size: .78rem;
}
.benchmark-meta-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}
.benchmark-meta-line em {
  color: #6b7280;
  font-size: .78rem;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
}
.benchmark-done {
  border: 1px solid #c6edb8;
  border-radius: 4px;
  background: #eaffdf;
  color: #43b73a;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.benchmark-card-copy .benchmark-done {
  color: #43b73a;
  font-size: .72rem;
  line-height: 1.1;
}
.benchmark-card-copy .benchmark-done.queued { color: #b7791f; }
.benchmark-card-copy .benchmark-done.running,
.benchmark-card-copy .benchmark-done.retrying { color: #2563eb; }
.benchmark-card-copy .benchmark-done.failed { color: #dc2626; }
.benchmark-delete {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #8d95a5;
  cursor: pointer;
}
.benchmark-analysis {
  overflow: auto;
}
.benchmark-report-toolbar {
  height: 64px;
  border-bottom: 1px solid #edf0f5;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.benchmark-report-toolbar h2,
.benchmark-video-head h2 {
  margin: 0;
  font-size: 1rem;
  color: #1f2937;
}
.benchmark-report-actions {
  display: flex;
  gap: 12px;
}
.benchmark-tool {
  height: 34px;
  border: 1px solid #d7dfeb;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  padding: 0 16px;
  cursor: pointer;
}
.analysis-sections {
  min-height: 0;
  display: block;
}
.benchmark-report-doc {
  padding: 32px 42px 56px;
  color: #2b3445;
  line-height: 1.72;
}
.benchmark-report-doc h1 {
  margin: 0 0 24px;
  color: #1f2937;
  font-size: 1.28rem;
  font-weight: 900;
}
.benchmark-report-doc h2 {
  margin: 24px 0 12px;
  border-top: 1px solid #d7dee8;
  padding-top: 16px;
  color: #1f2937;
  font-size: 1.05rem;
}
.benchmark-report-doc h3,
.benchmark-script-content h3 {
  margin: 20px 0 10px;
  color: #1f2937;
  font-size: .98rem;
  font-weight: 850;
}
.benchmark-report-doc h4,
.benchmark-script-content h4 {
  margin: 16px 0 8px;
  color: #334155;
  font-size: .92rem;
  font-weight: 820;
}
.benchmark-report-doc p,
.benchmark-script-content p {
  margin: 8px 0;
}
.benchmark-report-doc ul,
.benchmark-script-content ul {
  margin: 8px 0 12px;
  padding-left: 18px;
}
.benchmark-report-doc li,
.benchmark-script-content li {
  margin: 5px 0;
}
.benchmark-report-doc hr {
  border: 0;
  border-top: 1px solid #d7dee8;
  margin: 20px 0;
}
.benchmark-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: .9rem;
}
.benchmark-report-table th,
.benchmark-report-table td {
  border: 1px solid #d8dee8;
  padding: 10px 12px;
  text-align: left;
}
.benchmark-report-table th {
  background: #f4f6f9;
  font-weight: 850;
}
.benchmark-videos {
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}
.benchmark-video-head {
  min-height: 64px;
  border-bottom: 1px solid #edf0f5;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.benchmark-video-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.benchmark-video-tools input {
  height: 34px;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  padding: 0 12px;
}
.benchmark-video-tools button {
  height: 34px;
  border: 1px solid #d8e0ec;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  padding: 0 16px;
}
.benchmark-video-list {
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 10px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.benchmark-video-card {
  position: relative;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  border-radius: 0;
  padding: 0 34px 14px 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.video-cover {
  width: 86px;
  height: 112px;
  border-radius: 8px;
  background: linear-gradient(135deg, #17243a, #2f6dff 58%, #f0a21f);
  color: #fff;
  display: block;
  font-weight: 750;
  font-size: .82rem;
  text-align: center;
  overflow: hidden;
}
.video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-cover span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px;
}
.benchmark-video-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
}
.benchmark-video-copy strong {
  color: #1f2937;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.benchmark-video-copy p {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-metrics {
  display: flex;
  gap: 6px 12px;
  color: #303846;
  font-size: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  align-items: center;
  line-height: 18px;
}
.video-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.video-metrics i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  font-style: normal;
  color: #6b7280;
}
.benchmark-video-delete {
  position: absolute;
  right: 0;
  top: 2px;
  border: 0;
  background: transparent;
  color: #f35d5d;
  cursor: pointer;
}
.benchmark-same {
  position: absolute;
  right: 0;
  bottom: 14px;
  border: 0;
  background: transparent;
  color: #2f6dff;
  font-weight: 750;
  cursor: pointer;
}
.benchmark-pager {
  min-height: 48px;
  border-top: 1px solid #edf0f5;
  padding: 0 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  overflow: visible;
}
.benchmark-pager-summary,
.benchmark-pager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.benchmark-pager-controls {
  justify-content: flex-end;
}
.benchmark-pager button {
  width: 28px;
  height: 28px;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  padding: 0;
}
.benchmark-pager select,
.benchmark-pager input {
  height: 30px;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  flex: 0 0 auto;
}
.benchmark-pager strong {
  min-width: 28px;
  height: 28px;
  border: 1px solid #4d8cff;
  border-radius: 4px;
  color: #4d8cff;
  display: inline-grid;
  place-items: center;
  font-weight: 500;
  flex: 0 0 auto;
}
.benchmark-pager input { width: 42px; text-align: center; }
.benchmark-script-modal {
  z-index: 20;
}
.benchmark-script-card {
  width: min(1180px, calc(100vw - 48px));
  max-height: min(92vh, 820px);
  padding: 0;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
}
.benchmark-script-head {
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid #eef1f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.benchmark-script-head h2 {
  margin: 0;
  color: #1f2937;
  font-size: 17px;
  font-weight: 800;
}
.benchmark-script-body {
  max-height: calc(92vh - 132px);
  overflow: auto;
  padding: 28px 36px 22px;
  background: #fff;
}
.benchmark-script-content {
  border-left: 4px solid #2f6dff;
  padding: 2px 0 2px 18px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.82;
  white-space: normal;
}
.benchmark-script-content h1,
.benchmark-script-content h2 {
  margin: 18px 0 10px;
  color: #1f2937;
  font-size: 17px;
  font-weight: 880;
}
.benchmark-script-foot {
  min-height: 74px;
  padding: 0 22px;
  border-top: 1px solid #eef1f5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.benchmark-script-foot .btn {
  min-width: 82px;
  height: 36px;
}
.benchmark-modal-card {
  width: 666px;
  max-width: calc(100vw - 32px);
  min-height: 650px;
  max-height: 92vh;
  overflow: auto;
  border-radius: 10px;
  padding: 0;
}
.benchmark-modal-card .modal-head {
  height: 52px;
  border-bottom: 0;
  padding: 0 20px;
}
.benchmark-modal-card .modal-head h2 {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
}
.benchmark-add-body {
  padding: 18px 36px 24px 70px;
  display: grid;
  gap: 22px;
}
.benchmark-add-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #374151;
  font-size: 14px;
}
.benchmark-add-row > label:first-child,
.benchmark-link-row > label {
  width: 96px;
  text-align: right;
  color: #4b5563;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}
.benchmark-add-row.required > label:first-child::before,
.benchmark-link-row.required > label::before {
  content: "*";
  color: #f04438;
  margin-right: 4px;
}
.radio-inline,
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b5563;
  white-space: nowrap;
  font-size: 14px;
}
.radio-inline input,
.radio-group input {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
}
.radio-inline input,
.radio-group input,
.platform-card input {
  accent-color: #4d8cff;
}
.benchmark-platform-cards {
  margin-left: 108px;
  display: flex;
  gap: 12px;
}
.platform-card {
  width: 108px;
  height: 50px;
  border: 1px solid #d8e0ec;
  border-radius: 7px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: #4b5563;
  font-weight: 700;
}
.platform-card input { display: none; }
.platform-card.active {
  border-color: #4d8cff;
  background: #f4f8ff;
  color: #2f6dff;
}
.platform-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.platform-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.radio-group {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: nowrap;
}
.benchmark-link-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.benchmark-link-row textarea {
  width: 100%;
  min-width: 0;
  height: 74px;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  padding: 12px;
  resize: vertical;
}
.benchmark-help {
  margin-left: 108px;
  color: #5f6673;
  font-size: 13px;
  display: grid;
  gap: 12px;
}
.benchmark-help h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .86rem;
  color: #4b5563;
}
.benchmark-help h3 span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #666;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
}
.benchmark-help ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 18px;
}
.benchmark-help a { color: #2f6dff; text-decoration: none; }
.benchmark-add-foot {
  position: sticky;
  bottom: 0;
  min-height: 72px;
  background: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 0;
}
.benchmark-add-foot .btn {
  min-width: 58px;
  height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
}
.benchmark-add-foot .btn.primary {
  background: #4d8cff;
  border-color: #4d8cff;
}

.full-plan-layout {
  height: calc(100vh - 146px);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(420px, .98fr);
  gap: 16px;
}
.full-plan-panel,
.full-plan-task-panel {
  min-width: 0;
  min-height: 0;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
}
.full-plan-panel { grid-template-rows: max-content minmax(0, 1fr); }
.full-plan-panel.has-pending { grid-template-rows: max-content max-content minmax(0, 1fr); }
.full-plan-task-panel { grid-template-rows: max-content max-content minmax(0, 1fr); }
.full-plan-task-panel.has-pending { grid-template-rows: max-content max-content max-content minmax(0, 1fr); }
.full-plan-panel:has(> .full-plan-pending-note) { grid-template-rows: max-content max-content minmax(0, 1fr); }
.full-plan-task-panel:has(> .full-plan-pending-note) { grid-template-rows: max-content max-content max-content minmax(0, 1fr); }
.full-plan-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255,255,255,.92);
}
.full-plan-toolbar-left,
.full-plan-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.full-plan-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}
.full-plan-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}
.full-plan-select {
  position: relative;
}
.full-plan-select select {
  height: 34px;
  min-width: 142px;
  border: 1px solid #d8e2f1;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  padding: 0 34px;
  outline: none;
  appearance: none;
  font-size: .86rem;
}
.full-plan-select::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(47,109,255,.12);
  pointer-events: none;
}
.full-plan-select::after {
  content: "⌄";
  position: absolute;
  right: 14px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-55%);
  pointer-events: none;
  font-size: .86rem;
}
.full-plan-btn {
  height: 34px;
  border: 1px solid #d8e2f1;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
}
.full-plan-btn:hover {
  border-color: rgba(47,109,255,.48);
  color: var(--primary);
}
.full-plan-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.full-plan-document {
  min-height: 0;
  overflow: auto;
  padding: 34px 14px 40px;
}
.full-plan-doc-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}
.full-plan-doc-title {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.4;
  font-weight: 850;
  letter-spacing: 0;
}
.full-plan-summary {
  margin: 0;
  color: #1f2937;
  font-size: .95rem;
  line-height: 1.9;
  padding-bottom: 22px;
  border-bottom: 4px solid #cdd5df;
}
.full-plan-system-note {
  margin: -8px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d9e4f5;
  background: #f7faff;
  color: #54637f;
  font-size: .82rem;
  line-height: 1.6;
}
.full-plan-pending-note {
  margin: 10px 14px 0;
  padding: 9px 12px;
  min-height: 0;
  border-color: #b8cdfa;
  background: #eef5ff;
  color: #244a8f;
}
.full-plan-doc-section {
  display: grid;
  gap: 14px;
}
.full-plan-doc-section h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
  font-weight: 850;
}
.full-plan-doc-section h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 820;
}
.full-plan-doc-section p,
.full-plan-doc-section li {
  color: #1f2937;
  font-size: .94rem;
  line-height: 1.85;
}
.full-plan-doc-section p { margin: 0; }
.full-plan-doc-section ul,
.full-plan-doc-section ol {
  margin: 0;
  padding-left: 24px;
}
.full-plan-editor {
  width: 100%;
  min-height: 560px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .86rem;
  line-height: 1.6;
  resize: vertical;
}
.full-plan-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0 4px;
}
.full-plan-task-tabs {
  padding: 14px 16px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  align-content: start;
  align-items: start;
  min-height: 0;
  overflow: visible;
  border-bottom: 1px solid var(--line);
}
.full-plan-tab {
  height: 34px;
  min-width: 0;
  width: 100%;
  border: 1px solid #d8e2f1;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}
.full-plan-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(47,109,255,.22);
}
.full-plan-task-list {
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-content: start;
}
.full-plan-task-item {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  overflow: visible;
}
.full-plan-task-day {
  height: 30px;
  min-width: 48px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: .82rem;
  font-weight: 800;
}
.full-plan-task-copy {
  height: auto !important;
  max-height: none !important;
  min-width: 0;
  color: #111827;
  font-size: .88rem;
  line-height: 1.55;
  display: grid;
  gap: 4px;
  overflow: visible;
}
.full-plan-task-copy strong {
  font-size: .9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.full-plan-task-copy small,
.full-plan-task-copy em {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
  font-style: normal;
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}
.full-plan-task-status {
  height: 26px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: .8rem;
  white-space: nowrap;
  align-self: start;
}

@media (max-width: 1280px) {
  .full-plan-task-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .full-plan-task-status {
    grid-column: 2;
    justify-self: start;
  }
}

.library-workspace {
  min-height: 520px;
  display: grid;
  grid-template-columns: 260px 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.date-panel {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 16px 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}
.date-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.date-head h2 { margin: 0; font-size: 1rem; }
.date-list { display: grid; gap: 8px; align-content: start; }
.date-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 5px;
}
.date-btn.active { border-color: rgba(47,109,255,.3); background: #eef4ff; }
.date-main { display: flex; justify-content: space-between; font-weight: 750; }
.date-sub { color: var(--muted); font-size: .82rem; }
.material-area { padding: 16px; overflow: auto; }
.material-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.material-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  display: grid;
  cursor: pointer;
  transition: .18s ease;
}
.material-card.selectable {
  position: relative;
}
.material-card.selected,
.script-row.selected,
.highlight-clip-card.selected {
  border-color: rgba(47,109,255,.42);
  box-shadow: 0 0 0 3px rgba(47,109,255,.08);
}
.material-select,
.clip-select {
  position: absolute;
  z-index: 2;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(217,225,236,.86);
  color: var(--muted);
  font-size: .76rem;
}
.material-select input,
.clip-select input {
  width: auto;
}
.material-actions,
.library-actions,
.highlight-batch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.material-actions {
  padding: 0 12px 12px;
}
.material-card:hover {
  border-color: rgba(47,109,255,.34);
  box-shadow: 0 14px 28px rgba(21,34,60,.09);
  transform: translateY(-2px);
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #17243a, #2f6dff 58%, #f0a21f);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb span {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.92);
  color: var(--primary-2);
  font-size: .78rem;
  font-weight: 800;
}
.thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0f172a;
}
.thumb-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: auto;
  height: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #17305a;
  font-size: .74rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .16);
}
.card-body { padding: 12px; display: grid; gap: 9px; }
.card-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 750; }
.meta-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; }

.ai-workspace {
  height: calc(100vh - 150px);
  min-height: 560px;
  max-height: 820px;
  display: grid;
  grid-template-columns: 260px 320px 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ai-workspace.ai-director-clean {
  height: calc(100vh - 110px);
  min-height: 680px;
  max-height: none;
  grid-template-columns: minmax(0, 1fr);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 44px rgba(24, 32, 42, .10);
}
.operation-task-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.operation-task-board.single {
  grid-template-columns: minmax(0, 760px);
}
.module-toolbar {
  display: flex;
  justify-content: flex-start;
}
.op-task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.task-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.task-head h3 {
  margin: 0;
  font-size: 1rem;
}
.op-task-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.inline-task-form {
  display: grid;
  gap: 10px;
}
.inline-task-form textarea {
  min-height: 86px;
}

.highlight-workspace {
  min-height: 640px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 400px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.empty-highlight {
  display: block;
  padding: 16px;
}
.highlight-feed-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  display: grid;
  grid-template-rows: auto 1fr;
}
.highlight-feed-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.highlight-feed-head h2,
.highlight-chat-head h2,
.highlight-clip-head h2 {
  margin: 0;
  font-size: 1.04rem;
}
.highlight-feed-head p,
.highlight-chat-head p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}
.highlight-scope-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.highlight-scope-tabs button {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 7px 6px;
  font-size: .8rem;
  white-space: nowrap;
}
.highlight-scope-tabs button.active {
  background: #fff;
  color: var(--primary-2);
  box-shadow: 0 8px 18px rgba(22,34,58,.08);
}
.highlight-feed-list {
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.highlight-day-group {
  display: grid;
  gap: 10px;
}
.highlight-day-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}
.highlight-day-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(47,109,255,.08);
}
.highlight-source-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 11px;
  text-align: left;
  transition: .18s ease;
}
.highlight-source-card:hover {
  border-color: rgba(47,109,255,.32);
  box-shadow: 0 14px 28px rgba(21,34,60,.08);
  transform: translateY(-1px);
}
.highlight-source-card.active {
  border-color: rgba(47,109,255,.38);
  background: #eef4ff;
}
.highlight-cover,
.highlight-clip-cover {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, #17243a, #2f6dff 58%, #f0a21f);
  display: grid;
  place-items: center;
  color: var(--primary-2);
}
.highlight-cover {
  min-height: 92px;
}
.highlight-cover span,
.highlight-clip-cover span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.92);
  font-size: .76rem;
  font-weight: 800;
}
.highlight-source-body {
  min-width: 0;
  display: grid;
  gap: 7px;
}
.highlight-source-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.highlight-source-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.highlight-source-meta,
.highlight-clip-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}
.source-preview,
.preview-link {
  width: fit-content;
  border: 1px solid rgba(47,109,255,.28);
  border-radius: 999px;
  background: rgba(47,109,255,.08);
  color: var(--primary-2);
  padding: 4px 9px;
  font-size: .76rem;
  font-weight: 750;
}
.preview-link.danger {
  border-color: rgba(211,61,74,.28);
  background: rgba(211,61,74,.08);
  color: var(--danger);
}
.highlight-chat-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #f7f9fc;
}
.highlight-chat-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.highlight-chat-body {
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.highlight-clip-panel {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.highlight-clip-head {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.highlight-clip-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}
.highlight-clip-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 7px;
  align-content: start;
}
.highlight-clip-card strong {
  line-height: 1.35;
}
.highlight-clip-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.highlight-clip-cover {
  min-height: 58px;
}
.highlight-compile-bar {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.highlight-compile-bar .btn {
  width: 100%;
  min-height: 42px;
}
.highlight-compile-bar .btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.extractor-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}
.extractor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.extractor-head strong {
  font-size: .92rem;
}
.extractor-head span {
  color: var(--muted);
  font-size: .8rem;
}
.extractor-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.extractor-modes label {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #41506b;
  font-size: .84rem;
}
.extractor-modes input {
  width: auto;
}
.extractor-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.extractor-fields input {
  min-width: 0;
  font-size: .84rem;
}
.ai-merchant-panel {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 18px 16px;
  display: grid;
  align-content: start;
  gap: 14px;
}
.ai-merchant-panel h2 { margin: 0; font-size: 1.05rem; }
.ai-merchant-panel p { margin: 0; color: var(--muted); line-height: 1.6; }
.director-context {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: .86rem;
}
.director-context span { color: var(--muted); line-height: 1.5; }
.ai-task-panel {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}
.ai-task-panel .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding-bottom: 4px;
}
.task-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 6px;
}
.task-card.active { border-color: rgba(47,109,255,.32); background: #eef4ff; }
.task-card.pending { border-color: rgba(47,109,255,.26); }
.task-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.task-card small {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  background: #e9f1ff;
  color: #2456c6;
  font-size: .7rem;
  font-weight: 700;
}
.task-card span { color: var(--muted); font-size: .82rem; }
.task-card em {
  color: var(--muted);
  font-size: .78rem;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-panel {
  min-width: 0;
  min-height: 0;
  background: #f7f9fc;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.ai-director-clean .chat-panel {
  height: 100%;
  min-height: 0;
  background: transparent;
  grid-template-rows: auto minmax(260px, 1fr) auto;
}
.chat-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.ai-director-clean .chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 16px 18px;
  background: rgba(246, 248, 251, .92);
}
.chat-head h2 { margin: 0 0 5px; font-size: 1.08rem; }
.chat-head p { margin: 0; color: var(--muted); font-size: .84rem; }
.ai-director-clean .chat-head h2 {
  font-size: 1.16rem;
  letter-spacing: 0;
}
.chat-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-body {
  overflow: auto;
  min-height: 0;
  padding: 14px 18px 24px;
  display: grid;
  align-content: start;
  gap: 12px;
  scroll-behavior: auto;
  overscroll-behavior: contain;
}
.ai-director-clean .chat-body {
  min-height: 0;
  overflow: auto;
  margin: 18px;
  padding: 18px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background:
    linear-gradient(rgba(24, 32, 42, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 42, .028) 1px, transparent 1px),
    #fbfcfe;
  background-size: 28px 28px;
  overscroll-behavior: contain;
}
.ai-director-clean .chat-body > * {
  width: min(100%, 1080px);
  justify-self: center;
}

body {
  background:
    linear-gradient(rgba(24, 32, 42, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 42, .045) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}

.knowledge-train-shell {
  width: min(1680px, calc(100% - 24px));
  max-width: none;
  min-height: 100vh;
  padding: 14px 0 24px;
  gap: 14px;
}

.knowledge-train-prototype-nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  min-height: 72px;
  padding: 12px 14px;
  background: #18201d;
  color: #f8faf5;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 18px 44px rgba(24, 32, 42, .10);
}

.kt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  flex: 0 0 auto;
}

.kt-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #10231b;
  font-weight: 900;
  background: linear-gradient(135deg, #d8ef56, #48c790 54%, #36a4ed);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.kt-brand strong {
  display: block;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
}

.kt-brand span {
  display: block;
  margin-top: 4px;
  color: rgba(248, 250, 245, .62);
  font-size: 12px;
}

.kt-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(108px, 1fr));
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.kt-nav button {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(248, 250, 245, .72);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  font-weight: 700;
}

.kt-nav button:hover,
.kt-nav button.active {
  color: #ffffff;
  background: rgba(255, 255, 255, .09);
}

.kt-nav i {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  color: #17201c;
  background: #b8e46f;
  flex: 0 0 auto;
}

.kt-side-status {
  margin-left: auto;
  padding-left: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid rgba(255, 255, 255, .12);
  flex: 0 0 auto;
}

.kt-status-pill {
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(99, 184, 143, .16);
  color: #b9f0d0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.kt-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #76de9d;
  box-shadow: 0 0 0 5px rgba(118, 222, 157, .14);
}

.kt-capacity {
  color: rgba(248, 250, 245, .66);
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
}

.knowledge-train-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.knowledge-train-page-head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.knowledge-train-page-head p {
  margin: 0;
  color: var(--muted);
}

.knowledge-train-page-head select {
  min-width: 180px;
}

.knowledge-train-shell .breadcrumb,
.knowledge-train-shell .module-toolbar.ai-operation-back {
  display: none;
}
.history-loader {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 12px;
  font-size: .82rem;
}
.history-loader:hover {
  border-color: rgba(47,109,255,.28);
  color: var(--primary);
  background: #f7faff;
}
.context-banner {
  padding: 9px 12px;
  border: 1px solid rgba(239, 151, 58, .32);
  border-radius: 8px;
  background: #fff8ed;
  color: #8a530b;
  font-size: .84rem;
}
.director-trace-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.director-trace-head,
.director-trace-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.director-trace-head {
  justify-content: space-between;
  color: var(--muted);
  font-size: .82rem;
}
.director-trace-head strong {
  color: var(--text);
  font-size: .95rem;
}
.director-trace-steps span {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
}
.director-trace-steps span.active {
  color: var(--info);
  background: rgba(50,116,244,.1);
  border-color: rgba(50,116,244,.2);
}
.director-trace-steps span.done {
  color: var(--success);
  background: rgba(31,157,99,.1);
  border-color: rgba(31,157,99,.2);
}
.director-trace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.director-trace-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.director-trace-grid span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}
.director-trace-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.director-trace-result summary {
  cursor: pointer;
  color: var(--primary);
  font-size: .84rem;
}
.director-trace-result pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: pre-wrap;
  font: inherit;
}
.director-trace-warning {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(194,122,0,.08);
  color: var(--warn);
  overflow-wrap: anywhere;
  font-size: .82rem;
}
.director-pending {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid rgba(47,109,255,.18);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: .84rem;
}
.director-pending span {
  line-height: 1.5;
}
.director-job-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 78%;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2456c6;
  font-size: .78rem;
}
.inline-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(47,109,255,.18);
  border-top-color: var(--primary);
  animation: blocking-spin .9s linear infinite;
}
.director-empty-chat {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 240px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
}
.ai-director-clean .director-empty-chat {
  min-height: 220px;
  border-radius: 8px;
  border-color: #d8dee8;
  background: rgba(255, 255, 255, .88);
}
.director-empty-chat strong { color: var(--text); font-size: 1rem; }
.director-empty-chat span { max-width: 420px; line-height: 1.6; }
.message { display: grid; gap: 5px; max-width: 78%; }
.message.user { justify-self: end; }
.message span { color: var(--muted); font-size: .78rem; }
.message.streaming { max-width: 82%; }
.ai-director-clean .message {
  width: min(78%, 880px);
  justify-self: center;
}
.ai-director-clean .message.user {
  justify-self: center;
}
.ai-director-clean .message.user .bubble {
  margin-left: auto;
}
.ai-director-clean .message.streaming {
  width: min(82%, 920px);
}
.bubble.streaming {
  border-color: rgba(47,109,255,.2);
  background: #fff;
  box-shadow: 0 8px 24px rgba(47,109,255,.08);
}
.bubble.streaming i {
  display: inline-block;
  width: 7px;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--primary);
  animation: caretBlink 1s steps(2, start) infinite;
}
@keyframes caretBlink {
  50% { opacity: 0; }
}
.bubble pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}
.director-feedback {
  margin-top: 3px;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: rgba(255,255,255,.9);
}
.director-feedback.learned {
  border-color: rgba(20,125,100,.34);
  background: rgba(240,250,246,.94);
}
.director-feedback-top,
.director-feedback-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.director-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.director-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.director-feedback-chip,
.director-feedback-copy,
.director-feedback-submit {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  color: #253247;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}
.director-feedback-copy {
  color: #253247;
  background: #f8fafc;
}
.director-feedback-chip.active {
  color: #fff;
  border-color: #147d64;
  background: #147d64;
}
.director-feedback-submit {
  flex: 0 0 auto;
  color: #10231b;
  border-color: rgba(20,125,100,.28);
  background: #d8ef56;
}
.director-feedback-submit:disabled {
  opacity: .62;
  cursor: wait;
}
.director-feedback-copy:disabled {
  opacity: .62;
  cursor: wait;
}
.director-feedback-state,
.director-feedback-foot span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.director-feedback-note {
  width: 100%;
  min-height: 42px;
  padding: 8px 9px;
  color: var(--text);
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #fff;
  resize: vertical;
  outline: 0;
  line-height: 1.45;
}
.message-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
}
.message-actions label { display: inline-flex; align-items: center; gap: 6px; }
.message-actions input { padding: 6px 8px; min-height: 34px; }
.composer {
  z-index: 3;
  min-height: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 10px;
  box-shadow: 0 -6px 16px rgba(15, 23, 42, .04);
}
.ai-director-clean .composer {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px 18px 18px;
  background: #fff;
}
.ai-director-clean .composer > * {
  width: 100%;
  justify-self: center;
}
.ai-director-clean .quick-prompts {
  grid-column: 1 / -1;
}
.ai-director-clean .composer textarea {
  grid-column: 1;
  min-height: 78px;
  border-radius: 8px;
}
.ai-director-clean .composer-foot {
  grid-column: 2;
  display: grid;
  grid-template-columns: auto;
  align-content: end;
  justify-items: end;
  gap: 8px;
}
.ai-director-clean .composer-foot span {
  display: none;
}
.ai-director-clean .composer-foot .btn.primary {
  min-width: 86px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #10231b;
  background: linear-gradient(135deg, #d8ef56, #48c790);
  font-weight: 900;
}
.ai-director-clean .composer-foot .mini-btn {
  min-width: 58px;
  border-radius: 8px;
}
.composer.disabled {
  background: #fbfcfe;
}
.composer.disabled textarea {
  background: #f3f6fb;
  color: var(--muted);
}
.quick-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-height: 74px;
  overflow: auto;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  font-size: .82rem;
}
.chip:hover { border-color: rgba(47,109,255,.35); background: #f4f8ff; color: var(--primary); }
.chip.subtle {
  border-style: dashed;
  color: #53627d;
  background: #fbfcfe;
}
.composer-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: .84rem;
}
.composer textarea {
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
}

.client-workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
}
.client-profile,
.client-main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.client-profile { display: grid; align-content: start; gap: 14px; }
.client-profile h2 { margin: 0; }
.client-profile p { margin: 0; color: var(--muted); }
.upload-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}
.upload-picker {
  min-height: 86px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px dashed rgba(47,109,255,.34);
  border-radius: 12px;
  background: #fff;
}
.upload-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-picker span {
  min-width: 0;
  color: var(--muted);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.upload-actions .muted {
  font-size: .84rem;
}
.client-library {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.knowledge-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.knowledge-hero h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.knowledge-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.knowledge-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.knowledge-filter {
  display: grid;
  grid-template-columns: minmax(140px, .72fr) minmax(180px, 1fr) minmax(150px, .72fr) minmax(220px, 1.2fr) minmax(180px, .85fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.knowledge-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.knowledge-side {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
}
.knowledge-hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.knowledge-hot-tags button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
}
.knowledge-hot-tags button.active {
  border-color: rgba(47, 109, 255, .4);
  background: rgba(47, 109, 255, .08);
  color: var(--primary-2);
}
.knowledge-hot-tags button span {
  color: var(--muted);
  font-size: .78rem;
}
.knowledge-status-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
}
.knowledge-status-box strong {
  color: var(--text);
}
.knowledge-warning {
  padding: 12px 14px;
  border: 1px solid rgba(211, 61, 74, .22);
  border-radius: 12px;
  background: rgba(211, 61, 74, .08);
  color: var(--danger);
}
.knowledge-list {
  display: grid;
  gap: 12px;
}
.knowledge-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}
.knowledge-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.knowledge-card h3 {
  margin: 0 0 5px;
  font-size: 1.05rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.knowledge-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}
.knowledge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
  font-size: .82rem;
}
.knowledge-status.success { color: var(--success); background: rgba(31,157,99,.1); border-color: rgba(31,157,99,.2); }
.knowledge-status.info { color: var(--info); background: rgba(50,116,244,.1); border-color: rgba(50,116,244,.2); }
.knowledge-status.warn { color: var(--warn); background: rgba(194,122,0,.1); border-color: rgba(194,122,0,.2); }
.knowledge-status.danger { color: var(--danger); background: rgba(211,61,74,.1); border-color: rgba(211,61,74,.2); }
.knowledge-score-row,
.knowledge-tags,
.knowledge-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.knowledge-score-row span,
.knowledge-tag,
.knowledge-reasons span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: .8rem;
}
.knowledge-score-row .knowledge-score {
  color: var(--primary-2);
  background: rgba(47, 109, 255, .09);
}
.knowledge-tag {
  color: #2b4c7e;
  background: #eef5ff;
}
.knowledge-prompt {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: #f7faff;
}
.knowledge-prompt strong {
  font-size: .86rem;
}
.knowledge-prompt p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.knowledge-content {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: normal;
}
.knowledge-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(211, 61, 74, .08);
  color: var(--danger);
  overflow-wrap: anywhere;
}
.knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-workspace {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
  align-items: start;
}
.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-form .wide { grid-column: 1 / -1; }
.setting-image-field,
.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.secret-field {
  position: relative;
}
.secret-field .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.banner-preview {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f6f8fc;
  aspect-ratio: 16 / 7;
}
.banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.audit-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}
.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.audit-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.audit-row span {
  color: var(--muted);
  font-size: .84rem;
}

.asset-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.asset-summary span {
  padding: 10px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: #41506b;
  text-align: center;
  font-size: .84rem;
}
.plan-script-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.plan-script-board.ai-operator-board {
  grid-template-columns: 380px minmax(0, 1fr);
  align-items: start;
}
.plan-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.plan-output {
  min-width: 0;
}
.operation-plan-form {
  display: grid;
  gap: 12px;
}
.operation-plan-form textarea {
  min-height: 88px;
}
.plan-summary {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(47,109,255,.18);
  background: #f3f7ff;
  color: #263756;
  line-height: 1.6;
}
.operation-plan-result {
  display: grid;
  gap: 12px;
}
.plan-block {
  display: grid;
  gap: 8px;
}
.plan-block h3 {
  margin: 0;
  font-size: .95rem;
  color: #25324b;
}
.plan-block ul {
  margin: 0;
  padding-left: 18px;
  color: #46546f;
  line-height: 1.65;
}
.plan-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.plan-calendar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.day {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.plan-day {
  min-height: 168px;
}
.plan-day strong {
  font-size: .9rem;
  color: #24324d;
}
.plan-day span,
.plan-day small,
.plan-day em {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
  font-style: normal;
}
.plan-day em {
  color: #2858c8;
}
.pill {
  display: inline-flex;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(47,109,255,.1);
  color: var(--primary-2);
  font-size: .78rem;
  line-height: 1.35;
}
.script-list,
.delivered-library {
  display: grid;
  gap: 8px;
}
.delivered-library {
  margin-top: 16px;
}
.delivered-library h3 {
  margin: 0;
  font-size: 1rem;
}
.script-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.script-row[role="button"] {
  cursor: pointer;
}
.script-row[role="button"]:hover {
  border-color: rgba(47,109,255,.32);
  background: #f4f8ff;
}
.script-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.script-row span {
  color: var(--muted);
  font-size: .82rem;
}
.feedback-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.feedback-form textarea {
  min-height: 86px;
}
.video-stage {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #101827;
}
.video-stage video {
  width: 100%;
  height: min(62vh, 620px);
  max-height: 62vh;
  display: block;
  background: #101827;
}
.video-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.video-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  display: grid;
  gap: 5px;
}
.video-meta span {
  color: var(--muted);
  font-size: .78rem;
}
.video-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .88rem;
}
.video-meta p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-banner, .login-panel { border-radius: 16px; }
  .knowledge-train-shell {
    width: min(100%, calc(100% - 16px));
    padding-top: 8px;
  }
  .knowledge-train-prototype-nav {
    position: static;
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
  }
  .kt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kt-side-status {
    margin-left: 0;
    padding-left: 0;
    padding-top: 10px;
    justify-content: space-between;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .kt-capacity {
    white-space: normal;
    text-align: right;
  }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .split, .form-grid,
  .dashboard-hero, .filter-panel, .metric-grid, .dashboard-main, .overview-row,
  .merchant-workspace, .mg-toolbar, .cards, .entry-grid, .library-workspace,
  .material-grid, .ai-workspace, .highlight-workspace, .client-workspace, .settings-workspace,
  .knowledge-hero, .knowledge-metrics, .knowledge-filter, .knowledge-layout,
  .settings-form, .operation-task-board, .plan-script-board, .calendar,
  .plan-script-board.ai-operator-board, .plan-two-col,
  .asset-summary, .account-positioning-workspace, .positioning-grid, .benchmark-grid, .planning-grid, .feedback-panel, .mind-map, .benchmark-filter,
  .benchmark-content, .full-plan-layout {
    grid-template-columns: 1fr;
  }
  .account-positioning-page {
    min-height: 0;
  }
  .account-positioning-strip {
    align-items: stretch;
    flex-direction: column;
  }
  .account-positioning-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .account-positioning-form,
  .report-panel {
    max-height: none;
  }
  .field-row,
  .account-positioning-page .check-grid,
  .account-positioning-page .check-grid.three,
  .platform-switch,
  .metric-row,
  .phase-tabs {
    grid-template-columns: 1fr;
  }
  .benchmark-page,
  .planning-page {
    min-height: 0;
  }
  .video-panel,
  .task-panel,
  .benchmark-page .report-panel,
  .planning-page .report-panel {
    max-height: none;
  }
  .task-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .task-status {
    grid-column: 2;
    justify-self: start;
  }
  .feedback-panel {
    align-items: stretch;
  }
  .full-plan-layout { height: auto; }
  .knowledge-side { position: static; }
  .knowledge-card-head { grid-template-columns: 1fr; }
  .knowledge-status { justify-self: start; }
  .full-plan-panel,
  .full-plan-task-panel { min-height: 680px; }
  .full-plan-toolbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
  }
  .full-plan-actions {
    width: 100%;
    overflow-x: auto;
  }
  .ai-workspace {
    height: auto;
    min-height: 0;
  }
  .ai-workspace.ai-director-clean,
  .chat-panel {
    min-height: 680px;
  }
  .ai-director-clean .chat-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .ai-director-clean .chat-body {
    margin: 12px;
    padding: 12px;
  }
  .ai-director-clean .message,
  .ai-director-clean .message.streaming {
    width: min(100%, 920px);
  }
  .director-feedback-top,
  .director-feedback-foot {
    align-items: flex-start;
    flex-direction: column;
  }
  .director-feedback-actions {
    justify-content: flex-start;
  }
  .ai-director-clean .composer {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }
  .ai-director-clean .composer textarea,
  .ai-director-clean .composer-foot {
    grid-column: 1;
  }
  .ai-director-clean .composer-foot {
    display: flex;
    justify-content: flex-end;
  }
  .director-trace-grid {
    grid-template-columns: 1fr;
  }
  .full-plan-task-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .full-plan-task-status {
    grid-column: 2;
    justify-self: start;
  }
  .mg-sidebar, .date-panel, .ai-merchant-panel, .ai-task-panel, .highlight-feed-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .highlight-clip-panel { border-left: 0; border-top: 1px solid var(--line); }
  .highlight-clip-list { grid-template-columns: 1fr; }
  .extractor-modes, .extractor-fields { grid-template-columns: 1fr; }
  .hero-tags, .legend { justify-content: flex-start; }
}

.full-plan-task-panel .full-plan-task-list {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
.full-plan-task-panel .full-plan-task-item {
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
  overflow: visible !important;
}
.full-plan-task-panel .full-plan-task-copy,
.full-plan-task-panel .full-plan-task-copy strong,
.full-plan-task-panel .full-plan-task-copy small,
.full-plan-task-panel .full-plan-task-copy em {
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
}
