.search-toolbar {
  justify-content: flex-start;
}

.search-field {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.search-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: bold;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.sms-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 15px;
  max-width: 900px;
}

.bot-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 15px;
  align-items: start;
}

.settings-group {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.settings-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.settings-group h4 {
  margin: 0 0 12px;
  font-size: 13px;
}

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide-field {
  grid-column: 1 / -1;
}

.field-state {
  float: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: normal;
}

.compact-form {
  margin-top: 0;
}

.compact-form .primary {
  justify-self: start;
}

.sms-summary {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background: #173d35;
}

.sms-summary .mini-label,
.sms-summary p,
.summary-meta span {
  color: #a6c8bc;
}

.sms-summary strong {
  margin: 10px 0;
  font-size: 40px;
}

.sms-summary p {
  margin: 0;
  font-size: 12px;
}

.api-version {
  padding: 6px 10px;
  border: 1px solid #b8d3ca;
  color: #173d35;
  background: #eaf4f0;
  font-size: 12px;
  font-weight: 700;
}

.api-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.api-info-item {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.api-info-item:last-child { border-right: 0; }
.api-info-item > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.api-info-item > div { display: flex; min-width: 0; align-items: center; gap: 8px; }
.api-info-item code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.copy-icon, .copy-code { border: 0; color: #245d50; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.api-status { color: var(--muted); font-size: 12px; }
.api-status.configured { color: #18734f; }
.api-status.missing { color: #b14c3e; }

.api-doc-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  margin-top: 18px;
  align-items: start;
}

.api-toc {
  position: sticky;
  top: 18px;
  display: grid;
  border-left: 2px solid var(--line);
}

.api-toc a { padding: 8px 14px; color: var(--muted); font-size: 12px; text-decoration: none; }
.api-toc a:hover { color: #173d35; background: #eef4f1; }
.api-doc-content { min-width: 0; border: 1px solid var(--line); background: #fff; }
.api-doc-section { padding: 24px; scroll-margin-top: 20px; border-bottom: 1px solid var(--line); }
.api-doc-section:last-child { border-bottom: 0; }
.api-doc-section h4 { margin: 0 0 8px; font-size: 18px; }
.api-doc-section h5 { margin: 24px 0 10px; font-size: 13px; }
.api-doc-section p { max-width: 760px; margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.api-doc-section code { font-family: Consolas, "Courier New", monospace; }
.api-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.endpoint-line { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); background: #f7f9f8; }
.method { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 48px; height: 24px; padding: 0 7px; color: #fff; font-size: 10px; font-weight: 800; }
.method.post { background: #18734f; }
.notice { display: flex; gap: 12px; padding: 13px 14px; border-left: 3px solid #d29b2f; color: #665122; background: #fff8e8; font-size: 12px; line-height: 1.6; }
.notice b { flex: 0 0 auto; }
.api-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.api-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.api-table th, .api-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.api-table tr:last-child td { border-bottom: 0; }
.api-table th { color: var(--muted); background: #f7f9f8; font-size: 10px; }
.code-tabs { display: flex; margin-top: 22px; border-bottom: 1px solid #32433e; background: #192521; }
.code-tab { padding: 10px 14px; border: 0; color: #91a29c; background: transparent; font-size: 11px; cursor: pointer; }
.code-tab.active { color: #fff; box-shadow: inset 0 -2px #55b695; }
.code-sample { position: relative; display: none; overflow: auto; color: #d9e6e1; background: #192521; }
.code-sample.active { display: block; }
.code-sample pre { margin: 0; padding: 18px; min-width: max-content; }
.code-sample pre code { font-size: 12px; line-height: 1.7; white-space: pre; }
.copy-code { position: absolute; top: 9px; right: 9px; z-index: 1; padding: 5px 8px; color: #b9cbc5; background: #2b3a35; }
.response-code { display: inline-flex; margin-left: 5px; padding: 2px 6px; font-size: 10px; }
.response-code.success { color: #18734f; background: #e8f5ef; }
.response-code.warning { margin-left: 0; color: #9c542d; background: #fff0e6; }
.api-rules { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: #45524e; font-size: 13px; line-height: 1.6; }

.summary-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-meta b {
  font-size: 18px;
}

@media (max-width: 850px) {
  .sms-grid,
  .bot-settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-fields {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .api-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-info-item:nth-child(2) { border-right: 0; }
  .api-info-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .api-doc-layout { grid-template-columns: 1fr; }
  .api-toc { position: static; grid-template-columns: repeat(5, max-content); overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .api-info-grid { grid-template-columns: 1fr; }
  .api-info-item, .api-info-item:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .api-info-item:last-child { border-bottom: 0; }
  .api-doc-section { padding: 18px 14px; }
  .api-heading { align-items: center; }
}