:root {
  --page: #f4f4f7;
  --page-strong: #ececf2;
  --surface: #ffffff;
  --surface-soft: #fafafe;
  --text: #111827;
  --muted: #697386;
  --soft: #98a1b3;
  --line: #e5e7ef;
  --line-strong: #d5d9e6;
  --primary: #6564f4;
  --primary-2: #7767f2;
  --primary-3: #8d7bff;
  --primary-soft: #f0efff;
  --success: #12b76a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-soft: #fff1f1;
  --shadow-sm: 0 8px 22px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 16px 40px rgba(17, 24, 39, 0.1);
  --shadow-lg: 0 26px 70px rgba(17, 24, 39, 0.14);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --font: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 16% -8%, rgba(101, 100, 244, 0.14), transparent 34rem),
    linear-gradient(180deg, #f8f8fb 0%, var(--page) 48%, #efeff5 100%);
  font-family: var(--font);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.hint,
.status-text,
.error-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.error-text {
  color: var(--danger);
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 20px rgba(17, 24, 39, 0.05);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.09);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.button.primary {
  min-height: 52px;
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 56%, var(--primary-3) 100%);
  box-shadow: 0 16px 34px rgba(101, 100, 244, 0.28);
}

.button.primary:hover {
  box-shadow: 0 20px 42px rgba(101, 100, 244, 0.34);
}

.button.ghost {
  border-color: transparent;
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}

.button.danger {
  border-color: #ffd8d8;
  color: #d92d20;
  background: var(--danger-soft);
  box-shadow: none;
}

.button.danger:hover {
  border-color: #ffbaba;
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.12);
}

.button-small {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input,
select {
  min-height: 44px;
  padding: 0 14px;
}

textarea {
  min-height: 126px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(101, 100, 244, 0.64);
  box-shadow: 0 0 0 4px rgba(101, 100, 244, 0.12);
}

input[type="file"] {
  padding: 10px 12px;
}

/* Front page */
.demo-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 58px;
}

.demo-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(229, 231, 239, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  box-shadow: 0 12px 24px rgba(101, 100, 244, 0.24);
  font-size: 14px;
  font-weight: 900;
}

.demo-topbar strong,
.sidebar-brand h1 {
  display: block;
  margin: 0;
  font-size: 15px;
}

.demo-topbar span,
.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.demo-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.demo-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 0.86fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 116px);
  padding: 56px 0 34px;
}

.hero-copy h1 {
  max-width: 680px;
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy h1 span {
  display: block;
}

.lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.actions .button {
  min-width: 176px;
}

.hero-studio,
.embed-panel,
.feature-grid article {
  border: 1px solid rgba(229, 231, 239, 0.92);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.hero-studio {
  overflow: hidden;
  border-radius: 28px;
}

.studio-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.studio-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #d9dce8;
}

.studio-toolbar span:first-child {
  background: #ff6b6b;
}

.studio-toolbar span:nth-child(2) {
  background: #ffc857;
}

.studio-toolbar span:nth-child(3) {
  background: var(--success);
}

.studio-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 160px;
  min-height: 438px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f6ff 100%);
}

.studio-chat {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 34px 26px;
}

.chat-line {
  max-width: 86%;
  margin: 0;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
}

.chat-line.visitor {
  justify-self: end;
  border-bottom-right-radius: 6px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.chat-line.assistant {
  justify-self: start;
  border-bottom-left-radius: 6px;
  color: var(--text);
  background: #f1f2f6;
}

.answer-card {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 18px;
  border: 1px solid rgba(101, 100, 244, 0.18);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.answer-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.studio-metrics {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 18px;
  border-left: 1px solid var(--line);
}

.studio-metrics article {
  display: grid;
  gap: 5px;
  padding: 16px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.studio-metrics strong {
  color: var(--primary);
  font-size: 24px;
}

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

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

.feature-grid article {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 22px;
  border-radius: 22px;
}

.feature-grid strong {
  font-size: 18px;
}

.feature-grid span {
  color: var(--muted);
  line-height: 1.75;
}

.embed-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
  padding: 24px;
  border-radius: 24px;
}

.embed-panel h2 {
  margin: 0;
}

.embed-panel pre,
.tutorial-card pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid #e6e8f2;
  border-radius: 16px;
  color: #273043;
  background: #f8f8fb;
  line-height: 1.65;
}

/* Tutorial */
.tutorial-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.tutorial-hero,
.tutorial-card,
.tutorial-nav {
  border: 1px solid rgba(229, 231, 239, 0.94);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.tutorial-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 30px;
  border-radius: 28px;
}

.tutorial-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

.tutorial-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.tutorial-actions {
  display: grid;
  gap: 10px;
  min-width: 170px;
}

.tutorial-nav {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 18px;
}

.tutorial-nav a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 800;
}

.tutorial-card {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: 24px;
  border-radius: 24px;
}

.tutorial-card h2 {
  margin: 0;
  font-size: 26px;
}

.tutorial-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.8;
}

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

.tutorial-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbff;
}

.tutorial-grid span {
  color: var(--muted);
  line-height: 1.7;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-list label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbff;
  color: var(--text);
  font-weight: 700;
}

.check-list input {
  width: 18px;
  min-height: 18px;
}

/* Admin */
.admin-body {
  background:
    radial-gradient(circle at 94% 2%, rgba(101, 100, 244, 0.16), transparent 34rem),
    linear-gradient(180deg, #f7f7fa 0%, #f1f1f6 100%);
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-box {
  display: grid;
  width: min(430px, 100%);
  gap: 16px;
  padding: 34px;
  border: 1px solid rgba(229, 231, 239, 0.95);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-box label,
.maintenance-actions label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px;
  border-right: 1px solid rgba(229, 231, 239, 0.92);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 12px 0 40px rgba(17, 24, 39, 0.04);
  backdrop-filter: blur(20px);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 9px;
}

.nav {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nav:hover,
.nav.active {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav.active {
  color: var(--primary);
}

.nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
}

.sidebar-foot {
  display: grid;
  gap: 12px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(18, 183, 106, 0.12);
}

.logout-button {
  display: inline-flex;
  min-height: 40px;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #d92d20;
  background: #fff5f5;
  border-color: #ffd8d8;
  text-align: center;
}

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

.admin-topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1480px);
  margin: 0 auto 18px;
  padding: 16px 18px;
  border: 1px solid rgba(229, 231, 239, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.admin-topbar h2 {
  margin: 0;
  font-size: 24px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.system-chip,
.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.admin-workspace {
  display: grid;
  width: min(100%, 1480px);
  margin: 0 auto;
  gap: 18px;
}

.security-banner,
.overview-panel,
.section-head,
.editor-form,
.import-panel,
.data-panel,
.settings-form {
  border: 1px solid rgba(229, 231, 239, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.security-banner,
.overview-panel {
  padding: 18px;
}

.overview-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fafafe);
}

.stat-card strong {
  font-size: 26px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.tab-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  align-items: start;
}

.section-head,
.data-panel,
.wide {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.section-head .search {
  max-width: 420px;
  background: #f9f9fc;
}

.editor-form,
.import-panel,
.data-panel {
  padding: 18px;
}

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

.editor-form textarea,
.editor-form .button,
.editor-form .status-text,
.settings-group,
.settings-actions,
#settings-status {
  grid-column: 1 / -1;
}

.import-panel {
  display: grid;
  gap: 16px;
}

.import-panel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.import-actions,
.maintenance-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#lead-maintenance-form,
#conversation-maintenance-form {
  grid-template-columns: 1fr;
  padding: 16px 18px;
}

#lead-maintenance-form > div:first-child,
#conversation-maintenance-form > div:first-child {
  align-self: center;
}

#lead-maintenance-form .maintenance-actions,
#conversation-maintenance-form .maintenance-actions {
  display: grid;
  grid-template-columns: minmax(104px, auto) repeat(2, minmax(130px, 150px)) minmax(104px, auto) minmax(120px, 140px) minmax(118px, auto) minmax(106px, auto);
  gap: 10px;
  align-items: end;
  justify-content: start;
}

.side-panel .import-actions {
  display: grid;
  align-items: stretch;
}

.maintenance-actions label {
  min-width: 150px;
}

#lead-maintenance-form .maintenance-actions label,
#conversation-maintenance-form .maintenance-actions label {
  min-width: 0;
  gap: 6px;
  color: #737b8e;
  font-size: 12px;
}

#lead-maintenance-form .maintenance-actions input,
#conversation-maintenance-form .maintenance-actions input {
  min-height: 42px;
  background: #fbfbfd;
}

#lead-maintenance-form .button,
#conversation-maintenance-form .button {
  min-height: 42px;
  padding: 0 15px;
}

#lead-maintenance-form .button.primary,
#conversation-maintenance-form .button.primary {
  min-height: 46px;
}

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

.settings-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.settings-group-head {
  grid-column: 1 / -1;
}

.settings-group h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.settings-group textarea,
.form-hint {
  grid-column: 1 / -1;
}

.color-field {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.color-field input {
  padding: 4px;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.item:hover {
  transform: translateY(-1px);
  border-color: rgba(101, 100, 244, 0.26);
  box-shadow: var(--shadow-md);
}

.record-main {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.record-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  box-shadow: 0 12px 22px rgba(101, 100, 244, 0.2);
  font-size: 13px;
  font-weight: 900;
}

.knowledge-record .record-icon {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.lead-record .record-icon {
  background: linear-gradient(135deg, #0ea5e9, #67e8f9);
}

.conversation-record .record-icon {
  background: linear-gradient(135deg, #14b8a6, #5eead4);
}

.record-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.item-title {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.item-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.record-desc,
.conversation-lines {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.conversation-lines {
  display: grid;
  gap: 5px;
}

.conversation-lines span {
  color: var(--soft);
  font-weight: 800;
}

.record-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.record-time {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.lead-record .item-actions {
  min-width: 168px;
}

.lead-record select {
  min-width: 150px;
}

.status-new {
  color: #2563eb;
  background: #eff6ff;
}

.status-contacted {
  color: #b45309;
  background: #fff7ed;
}

.status-won {
  color: #047857;
  background: #ecfdf3;
}

.status-invalid {
  color: #667085;
  background: #f2f4f7;
}

.source-ai {
  color: var(--primary);
  background: var(--primary-soft);
}

.source-local_rule {
  color: #047857;
  background: #ecfdf3;
}

.source-fallback {
  color: #b45309;
  background: #fff7ed;
}

.empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  background: #fbfbfd;
  text-align: center;
}

@media (max-width: 1100px) {
  .demo-hero,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .demo-hero {
    min-height: auto;
  }

  .admin-layout {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px;
  }

  .sidebar-brand {
    justify-items: center;
  }

  .sidebar-brand div:not(.brand-mark),
  .nav span:not(.nav-icon),
  .sidebar-foot .status-dot {
    display: none;
  }

  .nav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #lead-maintenance-form .maintenance-actions,
  #conversation-maintenance-form .maintenance-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .demo-shell {
    width: min(100% - 22px, 720px);
    padding-top: 12px;
  }

  .demo-topbar {
    grid-template-columns: auto 1fr;
  }

  .demo-topbar-actions,
  .demo-topbar .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .demo-topbar-actions {
    display: grid;
  }

  .demo-hero {
    padding-top: 36px;
  }

  .actions,
  .actions .button {
    width: 100%;
  }

  .studio-panel,
  .embed-panel,
  .tutorial-hero,
  .tutorial-grid,
  .check-list,
  .tab-panel,
  .editor-form,
  .settings-group,
  .overview-panel {
    grid-template-columns: 1fr;
  }

  .studio-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .admin-layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand div:not(.brand-mark),
  .nav span:not(.nav-icon),
  .sidebar-foot .status-dot {
    display: block;
  }

  .sidebar-nav {
    grid-template-columns: repeat(5, minmax(70px, 1fr));
    overflow-x: auto;
  }

  .nav {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .admin-main {
    padding: 14px;
  }

  .admin-topbar,
  .section-head {
    display: grid;
  }

  .section-head .search {
    max-width: none;
  }

  .secret-field,
  .color-field {
    grid-template-columns: 1fr;
  }

  .item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .item-actions {
    justify-content: flex-start;
  }

  .item-actions .button,
  .lead-record select {
    flex: 1 1 140px;
  }

  #lead-maintenance-form .maintenance-actions,
  #conversation-maintenance-form .maintenance-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero-copy h1 {
    font-size: 38px;
  }

  .studio-metrics {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    gap: 12px;
  }

  .record-main {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .record-icon {
    width: 40px;
    height: 40px;
  }

  .button,
  .button.primary {
    width: 100%;
  }
}
