.intents-page {
  min-width: 1040px;
}

.module-tabs {
  padding: 12px 18px 0;
  display: flex;
  gap: 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.module-tabs button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.module-tabs button.selected {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--accent);
  border-bottom-color: #ffffff;
}

.intent-toolbar {
  min-height: 64px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.intent-toolbar strong {
  display: block;
  font-size: 14px;
}

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

.intent-toolbar-actions {
  display: flex;
  gap: 8px;
}

.intent-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 18px 18px;
}

.intent-sidebar {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: start;
  gap: 8px;
}

.intent-group {
  min-height: 74px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.intent-group.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.intent-group span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.intent-group strong {
  font-size: 14px;
}

.intent-group small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.intent-group em {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  background: #f8fafc;
}

.intent-panel {
  min-height: calc(100vh - 170px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: auto;
}

.intent-panel-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.intent-panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.intent-panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.intent-card-list {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.intent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.intent-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.intent-card h3 {
  margin: 0;
  font-size: 15px;
}

.intent-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.phrase-list {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.phrase-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #c7d7ee;
  border-radius: 999px;
  padding: 0 7px 0 10px;
  background: #f2f7ff;
  color: #243b61;
  font-size: 12px;
}

.phrase-chip button {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: #53657f;
  line-height: 1;
}

.phrase-chip button:hover {
  border-color: #a5b8d3;
  color: var(--danger);
}

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

.bot-phrase-list {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bot-phrase-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.bot-phrase-field.wide {
  grid-column: 1 / -1;
}

.bot-phrase-field span {
  display: grid;
  gap: 3px;
  font-weight: 800;
  color: var(--ink);
}

.bot-phrase-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
}

.bot-phrase-field textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}

.bot-phrase-field select,
.bot-phrase-field input[type="number"],
.bot-phrase-field input[type="text"] {
  width: 100%;
  min-height: 38px;
}

.compact-setting {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-setting input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.variable-catalog {
  margin: 14px 14px 0;
  padding: 12px;
  border: 1px solid #c6dfd8;
  border-radius: 8px;
  background: #f4fbf8;
  display: grid;
  gap: 8px;
}

.variable-catalog strong {
  color: var(--ink);
}

.variable-catalog div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variable-catalog span {
  padding: 5px 8px;
  border-radius: 999px;
  background: white;
  border: 1px solid #c6dfd8;
  color: #156a5b;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .intents-page {
    min-width: 0;
  }

  .intent-toolbar,
  .intent-workspace,
  .intent-card-list,
  .bot-phrase-list {
    grid-template-columns: 1fr;
  }

  .intent-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
