.ai-command-card {
  width: min(560px, calc(100vw - 390px));
  max-height: 62vh;
  overflow: hidden;
}

.ai-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #245ea8;
  font-size: 9.5px;
  font-weight: 760;
  letter-spacing: .02em;
}

.ai-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ai-sign-out {
  border: 0;
  background: transparent;
  color: #566473;
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-user-line {
  margin: -2px 0 8px;
  color: #687583;
  font-size: 10px;
}

.ai-access-copy {
  margin: 0 0 12px;
  color: #566473;
  font-size: 11px;
  line-height: 1.45;
}

.ai-access-form {
  display: grid;
  gap: 7px;
}

.ai-access-form > label:not(.ai-consent-row) {
  color: #3f4d5b;
  font-size: 10px;
  font-weight: 700;
}

.ai-access-form input[type="text"],
.ai-access-form input[type="email"] {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--text);
  font-size: 12px;
}

.ai-access-form input:focus,
#ai-input:focus {
  border-color: rgba(36,94,168,.68);
  box-shadow: 0 0 0 3px rgba(36,94,168,.12);
}

.ai-consent-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  margin: 4px 0 2px;
  color: #62707e;
  font-size: 9.5px;
  line-height: 1.35;
}

.ai-consent-row input {
  margin-top: 1px;
}

#ai-access-submit,
#ai-submit {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #1f5f9f;
  color: white;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

#ai-access-submit:disabled,
#ai-submit:disabled {
  opacity: .55;
  cursor: wait;
}

.ai-access-response {
  min-height: 18px;
  color: #9c3434;
  font-size: 10px;
  line-height: 1.35;
}

#ai-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: white;
  color: var(--text);
  font-size: 12.5px;
}

.ai-response {
  min-height: 38px;
}

.ai-results {
  margin-top: 9px;
}

.ai-table-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.ai-table th,
.ai-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf0f2;
  text-align: left;
  white-space: nowrap;
}

.ai-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fb;
  color: #344250;
  font-weight: 760;
}

.ai-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .ai-command-card {
    width: auto;
    max-height: 48vh;
  }
  .ai-table-wrap {
    max-height: 160px;
  }
}
