/* The two account-scoped dialogs that render into the shared modal shell, the detail view and the connection-test view, plus the message banner both rely on. */

/* Detail modal */
.detail-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.detail-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.detail-item {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
}
.detail-label {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.detail-value {
  font-size: 0.8125rem;
  color: var(--foreground);
  font-weight: 500;
  word-break: break-all;
}
.machine-id-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.machine-id-row input {
  flex: 1;
  min-width: 12rem;
}
.model-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.model-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
}
.model-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
}
.model-credit {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.credit-ratio {
  background: var(--background);
  border: 1px solid var(--border);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}
.model-info {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

/* Message banner */
.message {
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
}
.message-error {
  background: color-mix(in oklab, var(--destructive) 12%, var(--background));
  color: var(--destructive);
  border-color: color-mix(in oklab, var(--destructive) 35%, transparent);
}
.message-info {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--border);
  text-align: center;
}
.message-center {
  text-align: center;
}
.builder-code {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Test modal */
.test-modal-content {
  width: min(44rem, 92vw);
}
.test-modal-account {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.test-modal-account-main {
  min-width: 0;
}
.test-modal-email {
  color: var(--foreground);
  font-size: 0.9375rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.test-modal-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.375rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.test-modal-status {
  flex: none;
  max-width: 14rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
}
.test-modal-grid {
  display: grid;
  gap: 1rem;
}
.test-model-field {
  margin-bottom: 0;
}
.test-model-loading {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.test-log-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  overflow: hidden;
}
.test-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}
.test-log-title {
  font-weight: 600;
  font-size: 0.8125rem;
}
.test-log-clear {
  height: 1.875rem;
  padding: 0 0.75rem;
  border-color: color-mix(in oklab, var(--border) 84%, var(--muted-foreground));
  background: var(--background);
  color: var(--foreground);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--border) 72%, transparent);
}
.test-log-clear:hover {
  background: var(--accent);
  border-color: color-mix(in oklab, var(--border) 64%, var(--foreground));
  color: var(--accent-foreground);
}
.test-log-content {
  overflow-y: auto;
  min-height: 10rem;
  max-height: 18rem;
  padding: 0.625rem 0.75rem;
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.test-log-line {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 0.625rem;
  margin-bottom: 0.375rem;
  word-break: break-all;
  line-height: 1.5;
}
.test-log-time {
  color: var(--muted-foreground);
}
.test-log-message {
  min-width: 0;
}
.test-log-line.ok {
  color: var(--success);
}
.test-log-line.err {
  color: var(--destructive);
}
.test-log-line.info {
  color: var(--info);
}
.test-log-empty {
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .test-modal-account {
    flex-direction: column;
  }
  .test-modal-status {
    max-width: none;
    text-align: left;
  }
  .test-log-line {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }
}

