:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f2f2f0;
  --ink: #121212;
  --muted: #5e625f;
  --line: #e4e4e1;
  --teal: #15836d;
  --teal-dark: #0f5f51;
  --amber: #d58a28;
  --blue: #2867c7;
  --green: #39845f;
  --danger: #c85242;
  --pink: #ffe8f1;
  --lemon: #fff2ba;
  --cta: #ffd91a;
  --mint: #e7f8ef;
  --sky: #eaf3ff;
  --shadow: 0 18px 48px rgba(20, 20, 20, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #f4f7f5;
  display: none;
  place-items: center;
  padding: 24px;
}

.login-gate.open {
  display: grid;
}

.login-panel {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 56px);
  display: grid;
  gap: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand small,
.login-panel > small,
.login-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.login-panel h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.login-form input,
.admin-filter-bar input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fbfdfb;
}

.demo-login-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.register-panel {
  border: 1px dashed #cbd4cf;
  border-radius: 8px;
  background: #f8fbf9;
  padding: 14px;
}

.register-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.register-panel .login-form {
  margin-top: 14px;
}

.register-panel textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: #ffffff;
}

.nav-item.admin-only {
  display: none;
}

.admin-mode .customer-only,
.admin-mode #topPrimaryAction,
.admin-mode #resetLocalState {
  display: none;
}

.admin-mode .nav-item.admin-only {
  display: flex;
}

.role-hidden {
  display: none !important;
}

.account-button {
  display: grid;
  gap: 1px;
  text-align: left;
  min-width: 126px;
}

.account-button span {
  color: var(--muted);
  font-size: 11px;
}

.account-button strong {
  font-size: 13px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.promo-strip {
  min-height: 50px;
  background: #1f1b14;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  text-align: center;
  font-size: 15px;
}

.promo-strip button {
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: transparent;
  color: #ffffff;
  padding: 0;
  font-weight: 800;
}

.sidebar {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  padding: 14px clamp(20px, 3vw, 42px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  position: sticky;
  top: 0;
  height: auto;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 4px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid #171717;
  border-radius: 8px;
  position: relative;
  display: grid;
  place-items: center;
}

.brand-mark span {
  position: absolute;
  border: 1px solid #171717;
  border-radius: 50%;
}

.brand-mark span:nth-child(1) {
  width: 10px;
  height: 10px;
  background: #171717;
}

.brand-mark span:nth-child(2) {
  width: 24px;
  height: 24px;
}

.brand-mark span:nth-child(3) {
  width: 36px;
  height: 36px;
  border-color: #171717;
}

.nav-list {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
}

.nav-item {
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  text-align: left;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  background: #f2f0eb;
  color: #171717;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.header-contact span {
  font-size: 14px;
  font-weight: 800;
}

.icon {
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  display: inline-block;
  position: relative;
}

.grid-icon {
  border-radius: 4px;
}

.grid-icon::before,
.grid-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.grid-icon::before {
  width: 1.5px;
  height: 100%;
  left: 7px;
}

.grid-icon::after {
  width: 100%;
  height: 1.5px;
  top: 7px;
}

.profile-icon {
  border-radius: 50%;
}

.profile-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-radius: 7px 7px 0 0;
  border-bottom: 0;
  left: 1px;
  bottom: -8px;
}

.search-icon {
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 1.5px;
  background: currentColor;
  right: -6px;
  bottom: -3px;
  transform: rotate(45deg);
}

.feedback-icon {
  border-radius: 4px;
}

.feedback-icon::after {
  content: "";
  width: 7px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  position: absolute;
  left: 5px;
  top: 1px;
}

.sidebar-note {
  display: none;
  margin-top: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  gap: 10px;
  line-height: 1.5;
}

.mobile-account-button {
  display: none;
}

.sidebar-note p {
  margin: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #171717;
  margin-top: 7px;
  flex: 0 0 auto;
}

.main {
  width: min(100%, 1780px);
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 56px) 64px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 56px;
}

.main:has(#search.active) .topbar {
  display: none;
}

.main:has(#overview.active) .topbar {
  display: none;
}

.main:has(#overview.active) {
  padding-top: 0;
}

.topbar h1,
.hero-copy h2,
.panel-heading h2,
.form-intro h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.18;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-search {
  min-height: 58px;
  width: min(44vw, 620px);
  border-radius: 999px;
  background: #e9e9e8;
  color: #9a9a96;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  font-size: 18px;
}

.topbar-search .search-icon {
  width: 20px;
  height: 20px;
  border: 2px solid #171717;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.topbar-search .search-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2px;
  background: #171717;
  right: -6px;
  bottom: -3px;
  transform: rotate(45deg);
}

.topbar-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  background: var(--cta);
  color: #171717;
  border-color: #171717;
}

.primary-button:hover {
  background: #ffe45a;
}

.primary-button.large-action {
  min-height: 52px;
  padding: 0 22px;
  font-size: 16px;
}

.ghost-button {
  background: var(--surface);
  color: var(--ink);
  border-color: #171717;
}

.ghost-button:hover {
  border-color: #171717;
}

.small {
  min-height: 34px;
  font-size: 14px;
}

.subtle-tool {
  color: var(--muted);
}

.disabled {
  background: #eef2f0;
  color: #8d9996;
  border-color: #dce4e1;
  cursor: not-allowed;
}

button:disabled:hover,
.disabled:hover {
  border-color: #dce4e1;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.admin-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-hero,
.admin-page-header,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-hero,
.admin-page-header {
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.admin-hero h2,
.admin-page-header h2 {
  margin: 4px 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
}

.admin-hero p,
.admin-page-header p {
  margin: 0;
  color: var(--muted);
}

.admin-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.admin-metrics article {
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  display: grid;
  gap: 6px;
}

.admin-metrics article:nth-child(2) {
  background: var(--lemon);
}

.admin-metrics article:nth-child(3) {
  background: var(--pink);
}

.admin-metrics article:nth-child(4) {
  background: var(--mint);
}

.admin-metrics span,
.admin-metrics small {
  color: var(--muted);
}

.admin-metrics strong {
  font-size: 30px;
}

.admin-grid,
.agent-debug-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.agent-flow-strip article {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.agent-flow-strip article:nth-child(2) {
  background: var(--sky);
}

.agent-flow-strip article:nth-child(3) {
  background: var(--mint);
}

.agent-flow-strip article:nth-child(4) {
  background: var(--lemon);
}

.agent-flow-strip span,
.agent-flow-strip small {
  color: var(--muted);
}

.agent-flow-strip strong {
  font-size: 18px;
}

.admin-panel {
  padding: 22px;
  min-width: 0;
}

.admin-priority-list,
.admin-feedback-stream,
.agent-context {
  display: grid;
  gap: 9px;
}

.admin-priority-item,
.admin-feedback-item {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-feedback-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-priority-item strong,
.admin-priority-item small,
.admin-feedback-item strong,
.admin-feedback-item small {
  display: block;
}

.admin-priority-item small,
.admin-feedback-item small,
.admin-feedback-item p {
  color: var(--muted);
}

.admin-feedback-item p {
  margin: 5px 0;
  line-height: 1.45;
}

.admin-filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-filter-bar input {
  width: min(100%, 520px);
}

.admin-filter-bar span {
  color: var(--muted);
  white-space: nowrap;
}

.agent-debug-form {
  display: grid;
  gap: 15px;
}

.agent-debug-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.debug-template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.agent-debug-form textarea,
.agent-debug-form select,
.agent-debug-form input,
.agent-test-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

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

.skill-editor,
.api-config-panel {
  border: 1px dashed #cbd4cf;
  border-radius: 8px;
  background: #f8fbf9;
  padding: 14px;
}

.skill-editor summary,
.api-config-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.skill-editor label,
.api-config-panel label {
  margin-top: 10px;
}

.skill-toggle-grid {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-toggle-grid .skill-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0 12px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  font-weight: 800;
  white-space: nowrap;
}

.skill-toggle-grid .skill-chip:has(input:checked) {
  border-color: #171717;
  background: #171717;
  color: #ffffff;
}

.skill-toggle-grid .skill-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #171717;
  flex: 0 0 auto;
}

.skill-toggle-grid .skill-chip span {
  display: inline;
  line-height: 1;
}

.agent-context div {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.agent-context span,
.agent-context p {
  color: var(--muted);
}

.debug-rules {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  display: grid;
  gap: 7px;
}

.debug-rules small {
  color: var(--muted);
  line-height: 1.45;
}

.api-endpoints {
  margin-top: 20px;
  display: grid;
  gap: 7px;
}

.agent-test-console {
  display: grid;
  gap: 12px;
}

.test-chat-window {
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.test-chat-window article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.test-chat-window article p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.test-chat-window article small {
  display: block;
  margin-top: 8px;
  color: var(--teal-dark);
  overflow-wrap: anywhere;
}

.test-message-admin {
  margin-left: 12%;
  background: #f4fbf9 !important;
}

.test-message-system {
  margin-right: 12%;
}

.agent-test-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.agent-run-history {
  display: grid;
  gap: 10px;
}

.agent-run-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.agent-run-item p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.45;
}

.agent-run-item small {
  color: var(--muted);
}

.api-endpoints code,
.account-code code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7f5;
  padding: 9px 10px;
  color: var(--teal-dark);
  overflow-wrap: anywhere;
}

.account-policy,
.credential-grid,
.test-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.credential-grid,
.account-policy {
  margin-bottom: 18px;
}

.account-policy div,
.credential-card,
.test-account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
}

.account-policy strong,
.account-policy small,
.credential-card strong,
.credential-card small,
.test-account-card strong,
.test-account-card small {
  display: block;
}

.account-policy small,
.credential-card small,
.test-account-card small,
.test-account-card p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.credential-card {
  display: grid;
  gap: 9px;
}

.credential-card > span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.credential-card code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px 10px;
  overflow-wrap: anywhere;
}

.test-account-card {
  display: grid;
  gap: 13px;
}

.account-code {
  display: grid;
  gap: 5px;
}

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

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.75fr);
  gap: clamp(28px, 6vw, 90px);
  min-height: 500px;
  margin-bottom: 26px;
  align-items: center;
}

.portal-copy,
.next-card,
.customer-metrics article,
.journey-step {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.portal-copy {
  padding: clamp(30px, 6vw, 76px) clamp(8px, 3vw, 40px);
  display: grid;
  align-content: center;
  gap: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.plan-pill {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  font-weight: 900;
  font-size: 14px;
  color: #2f2b23;
}

.portal-copy h2 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.portal-copy p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.45;
}

.portal-actions,
.next-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-actions {
  margin-top: 8px;
}

.next-card {
  padding: clamp(26px, 4vw, 42px);
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 330px;
  background: #f7f7f3;
  border-color: transparent;
  box-shadow: none;
}

.next-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.16;
}

.next-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.customer-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.customer-metrics article {
  padding: 16px;
  display: grid;
  gap: 6px;
  min-height: 112px;
}

.customer-metrics strong {
  font-size: 22px;
  line-height: 1.05;
}

.customer-metrics small {
  color: var(--muted);
  line-height: 1.45;
}

.customer-metrics article:nth-child(2) {
  background: var(--mint);
}

.customer-metrics article:nth-child(3) {
  background: var(--sky);
}

.customer-metrics article:nth-child(4) {
  background: var(--pink);
}

.customer-metrics article:nth-child(5) {
  background: var(--lemon);
}

.customer-journey {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.journey-step {
  min-height: 154px;
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.journey-step span {
  color: var(--muted);
  font-weight: 900;
}

.journey-step strong {
  font-size: 18px;
}

.journey-step small {
  min-height: 38px;
  color: var(--muted);
  line-height: 1.45;
}

.journey-step.active {
  border-color: #171717;
}

.service-promise {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 42px);
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
}

.service-promise h2 {
  margin: 8px 0 0;
  max-width: 560px;
  font-size: 32px;
  line-height: 1.12;
}

.service-promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-promise-grid div {
  border-left: 1px solid var(--line);
  padding: 12px 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.service-promise-grid strong {
  font-size: 17px;
}

.service-promise-grid small {
  color: var(--muted);
  line-height: 1.55;
}

.delivery-page {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.delivery-header,
.delivery-batch-panel,
.delivery-history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.delivery-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  padding: clamp(26px, 5vw, 58px);
}

.delivery-header h2 {
  margin: 8px 0 12px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.98;
}

.delivery-header p,
.delivery-next small {
  color: var(--muted);
  line-height: 1.6;
}

.delivery-next {
  border-left: 1px solid var(--line);
  padding-left: 26px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.delivery-next span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.delivery-next strong {
  font-size: 34px;
}

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

.delivery-metrics article {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.delivery-metrics article:nth-child(2) {
  background: var(--mint);
}

.delivery-metrics article:nth-child(3) {
  background: var(--pink);
}

.delivery-metrics article:nth-child(4) {
  background: var(--sky);
}

.delivery-metrics strong {
  font-size: 25px;
}

.delivery-metrics small {
  color: var(--muted);
  line-height: 1.45;
}

.delivery-batch-panel,
.delivery-history-panel {
  padding: clamp(18px, 3vw, 30px);
  min-width: 0;
  max-width: 100%;
}

#deliveryCurrentBatch {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.delivery-empty {
  min-height: 300px;
  border: 1px dashed #cbd4cf;
  border-radius: 8px;
  background: #f8fbf9;
  padding: clamp(24px, 5vw, 54px);
  display: grid;
  gap: 12px;
  place-content: center;
  justify-items: start;
}

.delivery-empty span {
  color: var(--teal);
  font-weight: 900;
}

.delivery-empty strong {
  font-size: 30px;
}

.delivery-empty p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.journey-step.completed {
  background: #f2fbf5;
}

.journey-step.completed span {
  color: #25834d;
}

.journey-step.completed strong::after {
  content: " 已完成";
  color: #25834d;
  font-size: 12px;
  margin-left: 6px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.status-strip > div {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.status-strip > div:last-child {
  border-right: 0;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.task-card strong {
  font-size: 28px;
  line-height: 1;
}

.task-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.hero-panel,
.entry-panel,
.table-panel,
.form-card,
.result-panel,
.form-intro {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 24px;
  padding: 28px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy h2 {
  font-size: 38px;
  line-height: 1.08;
}

.hero-copy p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 680px;
}

.flow-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.flow-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface-2);
  font-weight: 700;
  font-size: 14px;
}

.radar-visual {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 330px;
}

.radar-header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.radar-header strong {
  color: var(--ink);
}

.signal-map {
  position: relative;
  margin-top: 18px;
  min-height: 260px;
  border: 1px dashed #bac7c0;
  border-radius: 8px;
  background:
    linear-gradient(#e6ede8 1px, transparent 1px),
    linear-gradient(90deg, #e6ede8 1px, transparent 1px);
  background-size: 36px 36px;
}

.signal {
  position: absolute;
  border: 1px solid;
  border-radius: 8px;
  background: white;
  padding: 9px 11px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(28, 36, 32, 0.08);
}

.signal-a {
  left: 24px;
  top: 28px;
  color: var(--teal);
}

.signal-b {
  right: 26px;
  top: 58px;
  color: var(--blue);
}

.signal-c {
  left: 38%;
  top: 120px;
  color: var(--green);
}

.signal-d {
  left: 34px;
  bottom: 36px;
  color: var(--danger);
}

.signal-e {
  right: 20px;
  bottom: 28px;
  color: var(--amber);
}

.entry-panel {
  padding: 22px;
}

.panel-heading h2 {
  font-size: 22px;
}

.entry-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.entry-item {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 14px;
  text-align: left;
  align-items: flex-start;
}

.entry-item:hover {
  border-color: #9eb2a7;
  background: #fbfcfb;
}

.entry-item small,
.form-intro p {
  color: var(--muted);
  line-height: 1.6;
}

.entry-index {
  color: var(--teal);
  font-weight: 900;
  min-width: 30px;
}

.locked .entry-index {
  color: var(--amber);
}

.table-panel {
  padding: 22px;
}

.inline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.pipeline-table {
  display: grid;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr 110px;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  font-size: 13px;
}

.badge.warning {
  background: #fff3df;
  color: #865511;
}

.badge.success {
  background: #e8f3ee;
  color: var(--green);
}

.badge.danger {
  background: #fff0ee;
  color: var(--danger);
}

.badge.muted {
  background: #edf1ee;
  color: #60726a;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-layout {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 24px;
}

.profile-content {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.form-intro,
.form-card,
.result-panel {
  padding: 24px;
}

.form-intro {
  position: sticky;
  top: 26px;
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 8px;
}

.step-list li {
  border: 1px solid var(--line);
  border-left: 4px solid #cfd4d1;
  border-radius: 0 8px 8px 0;
  background: #ffffff;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.step-list .current {
  border-color: var(--teal);
  color: var(--ink);
  background: #eef8f5;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
}

legend {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.4;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd6cf;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfdfb;
  color: var(--ink);
  min-height: 42px;
  font-weight: 600;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #858a87;
  opacity: 1;
  font-weight: 500;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(22, 117, 111, 0.18);
  border-color: var(--teal);
}

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

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

.choice-grid label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  min-height: 48px;
  background: #ffffff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.choice-grid input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
}

.lock-notice,
.keyword-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.lock-notice strong {
  color: var(--amber);
}

.keyword-preview span {
  color: var(--muted);
  line-height: 1.5;
}

.locked-form {
  position: relative;
}

.locked-form.is-locked::before {
  content: "LOCKED";
  position: absolute;
  right: 22px;
  top: 20px;
  color: #8b6426;
  background: #fff3df;
  border: 1px solid #e2c797;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.result-panel {
  grid-column: 2;
}

.search-workspace {
  display: grid;
  gap: 16px;
}

.search-header {
  padding: 8px 2px 2px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.search-header h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.search-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.search-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  min-height: 310px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-task-copy {
  padding: 34px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.task-kicker {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.search-task-copy h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.06;
  letter-spacing: 0;
}

.search-task-copy p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.search-task-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.search-task-service {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.search-task-service small {
  color: var(--muted);
  line-height: 1.45;
}

.search-brief {
  padding: 22px;
  background: #f4f8f5;
  border-left: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 1px;
}

.search-brief > div {
  padding: 14px 8px;
  border-bottom: 1px solid #dce5df;
  display: grid;
  gap: 5px;
}

.search-brief > div:last-child {
  border-bottom: 0;
}

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

.search-brief strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.42;
  font-size: 15px;
}

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

.compact-status > div {
  min-height: 100px;
  box-shadow: none;
}

.compact-status strong {
  font-size: 16px;
}

.workflow-summary > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 15px;
  display: grid;
  gap: 5px;
}

.workflow-summary strong {
  font-size: 18px;
}

.workflow-summary small {
  color: var(--muted);
  line-height: 1.45;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mode-tabs label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfb;
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.mode-tabs input {
  width: 14px;
  min-height: 14px;
}

.priority-result {
  grid-column: auto;
  padding: 22px;
}

.search-form-card {
  border-left: 4px solid var(--teal);
}

.search-form-heading {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.search-form-heading h2 {
  margin: 0;
  font-size: 23px;
}

.search-form-heading p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.compact-options {
  margin-bottom: 14px;
}

.result-actions,
.debug-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-actions .primary-button,
.result-actions .ghost-button {
  white-space: nowrap;
}

.action-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-group-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 4px;
}

.bridge-status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 9px 10px;
  white-space: nowrap;
}

.bridge-status-badge.online {
  border-color: #9fc6aa;
  background: #eef8f1;
  color: var(--green);
}

.bridge-status-badge.offline {
  border-color: #d9aaa2;
  background: #fff7f5;
  color: var(--danger);
}

.bridge-status-badge.checking {
  border-color: #a9c9c4;
  background: #eef8f6;
  color: var(--teal);
}

.primary-actions {
  border-color: #a9c9c4;
  background: #f2faf8;
}

.delivery-actions {
  border-color: #d8c29a;
  background: #fffaf0;
}

.utility-actions {
  background: #f8faf8;
}

button:disabled,
.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.ghost-button.disabled,
.primary-button.disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.search-state-bar {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f8faf8;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  color: var(--muted);
}

.search-state-bar strong {
  color: var(--ink);
  white-space: nowrap;
}

.result-source-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin: -4px 0 14px;
  color: var(--muted);
}

.result-source-banner strong {
  color: var(--ink);
  white-space: nowrap;
}

.result-source-banner.local {
  border-color: #e2c797;
  background: #fff9ee;
}

.result-source-banner.real {
  border-color: #9fc6aa;
  background: #f2fbf4;
}

.result-source-banner.warning {
  border-color: #d9aaa2;
  background: #fff7f5;
}

.search-state-bar.running {
  border-left-color: var(--amber);
  background: #fff9ee;
}

.search-state-bar.completed {
  border-left-color: var(--green);
  background: #f2fbf4;
}

.search-state-bar.warning {
  border-left-color: var(--danger);
  background: #fff7f5;
}

.run-details {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 11px 13px;
}

.run-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.run-details[open] summary {
  margin-bottom: 13px;
  color: var(--ink);
}

.run-details .progress-panel,
.run-details .openclaw-monitor {
  margin: 0 0 10px;
}

.run-details .openclaw-monitor:last-child {
  margin-bottom: 0;
}

.progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  margin: -2px 0 14px;
  display: grid;
  gap: 10px;
}

.progress-panel.running {
  border-color: #7fb7af;
  background: #f4fbf9;
  box-shadow: 0 0 0 3px rgba(18, 120, 112, 0.08);
}

.progress-panel.warning {
  border-color: #d9aaa2;
  background: #fff7f5;
}

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

.progress-head strong {
  font-size: 14px;
}

.progress-head span {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  background: #edf1ee;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 220ms ease;
}

.progress-panel.running .progress-track span {
  background: linear-gradient(90deg, var(--teal), #59a88e, var(--teal));
}

.progress-panel.warning .progress-track span {
  background: var(--danger);
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.step-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  min-height: 34px;
  padding: 7px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.step-item.active {
  border-color: #9fc6aa;
  background: #f2fbf4;
  color: var(--green);
}

.step-item.current {
  border-color: #a9c9c4;
  background: #eef8f6;
  color: var(--teal);
}

.step-item.warning {
  border-color: #d9aaa2;
  background: #fff7f5;
  color: var(--danger);
}

.openclaw-monitor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  margin: -4px 0 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(360px, 2fr);
  gap: 14px;
  align-items: center;
}

.openclaw-monitor strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.openclaw-monitor div > span {
  color: var(--muted);
  line-height: 1.5;
}

.openclaw-monitor.running {
  border-color: #a9c9c4;
  background: #f4fbf9;
}

.openclaw-monitor.warning {
  border-color: #d9aaa2;
  background: #fff7f5;
}

.openclaw-monitor.completed {
  border-color: #9fc6aa;
  background: #f2fbf4;
}

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

.monitor-metrics span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  min-height: 54px;
  padding: 8px;
  display: grid;
  gap: 3px;
  align-content: center;
}

.monitor-metrics b {
  color: var(--ink);
  font-size: 14px;
}

.monitor-metrics em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.search-form-card.collapsed {
  display: none;
}

.form-hint {
  margin: -4px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

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

.output-plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  min-height: 104px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.output-plan-card:has(input:checked) {
  border-color: #7fb7af;
  background: #f2faf8;
  box-shadow: 0 0 0 3px rgba(22, 117, 111, 0.08);
}

.output-plan-card.locked-plan {
  opacity: 0.5;
  background: #f4f5f4;
}

.output-plan-card.locked-plan small::after {
  content: " 需先反馈试用样本";
  color: #865511;
  font-weight: 800;
}

.output-plan-card input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.output-plan-card strong,
.output-plan-card small {
  display: block;
}

.output-plan-card small {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.debug-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px 14px;
}

.debug-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
}

.debug-actions {
  margin: 12px 0;
  justify-content: flex-start;
}

.code-output {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17221d;
  color: #edf6f1;
  overflow: auto;
  padding: 16px;
  min-height: 160px;
  max-height: 420px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.code-output.compact {
  min-height: 88px;
  max-height: 260px;
  margin-top: 12px;
}

.lead-results {
  display: grid;
  gap: 12px;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdfb;
}

.lead-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfb;
  display: grid;
  gap: 10px;
}

.lead-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #ffffff;
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.lead-table th,
.lead-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.lead-table th {
  background: #f4f7f5;
  color: var(--muted);
  font-size: 13px;
}

.lead-table td strong,
.lead-table td small {
  display: block;
}

.lead-table td small {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 5px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions .feedback-selected {
  border-color: #171717;
  background: #171717;
  color: #ffffff;
}

.lead-card-list {
  display: grid;
  gap: 8px;
}

.customer-lead-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.customer-lead-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 0.9fr) auto;
  gap: 14px;
  align-items: start;
}

.customer-lead-company {
  display: grid;
  gap: 5px;
}

.customer-lead-company strong {
  font-size: 17px;
}

.customer-lead-company small,
.customer-lead-meta span {
  color: var(--muted);
  line-height: 1.45;
}

.customer-lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.customer-lead-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f7f3;
  padding: 5px 9px;
  font-size: 13px;
}

.lead-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px 14px;
}

.lead-detail summary {
  cursor: pointer;
  font-weight: 900;
}

.lead-detail p {
  color: var(--muted);
  line-height: 1.55;
}

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

.lead-detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.lead-detail-grid span,
.source-list small {
  color: var(--muted);
  font-size: 12px;
}

.lead-reference-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.lead-reference-block div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.lead-reference-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-reference-block p {
  margin: 5px 0 0;
}

.source-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.external-source-link {
  color: #075f4f;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.external-source-link:hover {
  color: #171717;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.history-item p {
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0;
}

.history-item small,
.history-actions span {
  color: var(--muted);
  font-size: 13px;
}

.history-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.history-entry {
  display: block;
}

.history-entry > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.history-entry > summary::-webkit-details-marker {
  display: none;
}

.history-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffffff;
}

.history-toggle::before {
  content: ">";
  font-weight: 900;
  transition: transform 160ms ease;
}

.history-entry[open] .history-toggle::before {
  transform: rotate(90deg);
}

.history-entry-main {
  display: grid;
  gap: 7px;
}

.history-entry-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
}

.history-entry-title span {
  color: var(--muted);
  font-size: 13px;
}

.history-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-entry-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 8px;
}

.history-entry-body {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.history-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.feedback-record-list {
  display: grid;
  gap: 10px;
}

.feedback-record {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}

.feedback-record p,
.feedback-record small {
  color: var(--muted);
  margin: 0;
}

.feedback-record p,
.feedback-record > small {
  grid-column: 1 / -1;
}

.profile-snapshot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.profile-snapshot-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.profile-snapshot-header strong,
.profile-snapshot-header small {
  display: block;
}

.profile-snapshot-header strong {
  font-size: 24px;
  margin: 4px 0;
}

.profile-snapshot-header small {
  color: var(--muted);
}

.profile-snapshot-grid,
.profile-rule-strip {
  display: grid;
  gap: 10px;
}

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

.profile-rule-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-snapshot-grid div,
.profile-rule-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.profile-snapshot-grid span,
.profile-rule-strip span,
.profile-rule-strip small {
  color: var(--muted);
  font-size: 12px;
}

.profile-snapshot-grid strong,
.profile-rule-strip strong {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.asset-summary {
  margin-bottom: 14px;
}

.compact-summary {
  box-shadow: none;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.asset-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.asset-card strong,
.asset-card small {
  display: block;
}

.asset-card small,
.asset-card span {
  color: var(--muted);
  line-height: 1.45;
}

.asset-card span {
  font-weight: 800;
}

.ledger-panel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.ledger-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #ffffff;
}

.ledger-table {
  min-width: 980px;
}

.feedback-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.feedback-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfb;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.billing-page {
  display: grid;
  gap: 18px;
}

.billing-header {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: center;
}

.billing-header h2 {
  margin: 0;
  font-size: 36px;
  letter-spacing: 0;
}

.billing-header p:last-child {
  color: var(--muted);
  line-height: 1.65;
  max-width: 680px;
}

.billing-current {
  border-left: 1px solid var(--line);
  padding: 20px 24px;
  display: grid;
  gap: 8px;
}

.billing-current span,
.billing-current small {
  color: var(--muted);
}

.billing-current strong {
  font-size: 28px;
}

.quota-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.quota-strip > div {
  min-height: 106px;
  padding: 18px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 7px;
  align-content: center;
}

.quota-strip > div:last-child {
  border-right: 0;
}

.quota-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quota-strip strong {
  font-size: 22px;
}

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

.pricing-card {
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.pricing-card.recommended {
  border-color: #171717;
  box-shadow: 0 16px 36px rgba(20, 20, 20, 0.1);
}

.pricing-card.current-plan {
  border-color: #65a579;
  background: #f4fbf6;
}

.pricing-card.pending-plan {
  border-color: #d7ac60;
  background: #fffaf0;
}

.pricing-tag {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.pricing-card h3 {
  margin: 9px 0 7px;
  font-size: 25px;
}

.pricing-card p,
.pricing-card li {
  color: var(--muted);
  line-height: 1.55;
}

.pricing-card ul {
  min-height: 154px;
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price strong {
  font-size: 42px;
  line-height: 1;
}

.price span {
  color: var(--muted);
  font-weight: 800;
}

.discount-line {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.discount-line del {
  color: #92928c;
  font-size: 14px;
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.discount-badge {
  border-radius: 999px;
  background: #171717;
  color: #ffffff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.discount-badge.free {
  background: #dff5e7;
  color: #24744a;
}

.pricing-card > button {
  align-self: end;
  width: 100%;
}

.delivery-schedule {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
}

.delivery-week-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.delivery-week-grid article {
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.delivery-week-grid article.active {
  border-color: #65a579;
  background: #f2fbf4;
}

.delivery-week-grid span,
.delivery-week-grid small {
  color: var(--muted);
}

.delivery-week-grid strong {
  font-size: 17px;
}

.admin-activation {
  border: 1px dashed #c8d1cb;
  border-radius: 8px;
  background: #f7f9f7;
  padding: 14px 16px;
}

.admin-activation summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.admin-activation p {
  color: var(--muted);
  line-height: 1.55;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lead-card h3 {
  margin: 0;
  font-size: 18px;
}

.lead-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
  background: white;
}

.grade {
  border-radius: 999px;
  padding: 6px 10px;
  background: #e8f3ee;
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.signal.has-data {
  background: #e8f3ee;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 260px;
  max-width: calc(100vw - 36px);
  background: #17221d;
  color: #eef6f1;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  transition: transform 160ms ease;
  z-index: 10;
}

.toast.show {
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .promo-strip {
    justify-content: flex-start;
    text-align: left;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .header-contact {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar {
    display: grid;
  }

  .topbar-search {
    width: 100%;
    order: 3;
  }

  .nav-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    justify-content: flex-start;
    width: 100%;
  }

  .sidebar-note {
    margin-top: 0;
  }

  .overview-grid,
  .portal-hero,
  .customer-metrics,
  .customer-journey,
  .task-grid,
  .asset-grid,
  .workflow-summary,
  .hero-panel,
  .form-layout,
  .search-task-card,
  .billing-header,
  .delivery-header,
  .delivery-metrics,
  .service-promise,
  .service-promise-grid,
  .admin-metrics,
  .admin-grid,
  .agent-flow-strip,
  .agent-debug-layout,
  .agent-mode-grid,
  .skill-toggle-grid,
  .agent-test-form,
  .account-policy,
  .credential-grid,
  .test-account-grid,
  .pricing-grid,
  .delivery-week-grid,
  .customer-lead-main,
  .lead-detail-grid,
  .lead-reference-block,
  .profile-snapshot-grid,
  .profile-rule-strip,
  .quota-strip,
  .search-header {
    grid-template-columns: 1fr;
  }

  .search-brief {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .billing-current {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }

  .delivery-next {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }

  .service-promise-grid div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0;
  }

  .quota-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quota-strip > div:last-child {
    border-bottom: 0;
  }

  .search-header {
    display: grid;
  }

  .mode-tabs {
    justify-content: flex-start;
  }

  .form-intro {
    position: static;
  }

  .result-panel {
    grid-column: 1;
  }

  .admin-hero,
  .admin-page-header {
    align-items: start;
    flex-direction: column;
  }
}

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

  .promo-strip {
    min-height: auto;
    padding: 9px 16px;
    align-items: flex-start;
    flex-direction: column;
    font-size: 13px;
    gap: 4px;
  }

  .login-gate {
    padding: 12px;
  }

  .login-panel {
    padding: 24px;
  }

  .login-panel h1 {
    font-size: 34px;
  }

  .sidebar {
    padding: 12px 16px;
    gap: 10px;
  }

  .header-contact {
    width: 100%;
    gap: 6px;
  }

  .header-contact span {
    width: 100%;
    font-size: 13px;
  }

  .header-contact .primary-button,
  .header-contact .ghost-button {
    min-height: 34px;
    padding: 0 13px;
  }

  .sidebar-note,
  .topbar {
    display: none;
  }

  .mobile-account-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
  }

  #search .search-header {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 11px;
  }

  .topbar-search {
    min-height: 48px;
    font-size: 15px;
  }

  .portal-copy {
    padding: 22px 0;
  }

  .portal-copy h2 {
    font-size: 36px;
  }

  .portal-hero,
  .next-card {
    min-height: auto;
  }

  .search-task-copy {
    padding: 22px;
  }

  .search-task-copy h2 {
    font-size: 30px;
  }

  .search-task-actions .primary-button,
  .search-task-actions .ghost-button {
    width: 100%;
  }

  .billing-header {
    padding: 22px;
  }

  .billing-header h2 {
    font-size: 30px;
  }

  .delivery-header {
    padding: 24px;
  }

  .delivery-header h2 {
    font-size: 42px;
  }

  .service-promise h2,
  .delivery-empty strong {
    font-size: 26px;
  }

  .pricing-card {
    min-height: auto;
  }

  .admin-panel {
    padding: 16px;
  }

  .admin-hero,
  .admin-page-header {
    padding: 22px;
  }

  .admin-priority-item,
  .admin-feedback-item,
  .feedback-record,
  .history-entry > summary,
  .profile-snapshot-header,
  .admin-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .history-entry-actions,
  .history-actions {
    justify-content: flex-start;
    justify-items: start;
  }

  .agent-run-item {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .search-brief {
    padding: 12px 18px;
  }

  .search-brief > div {
    padding: 11px 4px;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .status-strip,
  .nav-list,
  .portal-hero,
  .customer-metrics,
  .customer-journey,
  .two-col,
  .choice-grid,
  .output-plan-grid,
  .task-grid,
  .asset-grid,
  .workflow-summary,
  .history-item,
  .openclaw-monitor,
  .step-progress {
    grid-template-columns: 1fr;
  }

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

  .status-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-strip > div:last-child {
    border-bottom: 0;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .table-head {
    display: none;
  }

  .signal-map {
    min-height: 330px;
  }

  .signal {
    position: static;
    margin: 12px;
    display: inline-block;
  }
}
